summaryrefslogtreecommitdiff
path: root/sys/dev/ic/qla.c
AgeCommit message (Collapse)Author
2015-09-07sizes for free(); ok jmatthewTheo de Raadt
2015-08-28fairly simple sizes for free(); ok teduTheo de Raadt
2015-06-19remove isp(4) now that the ql* family have replaced itJonathan Matthew
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2015-02-09turn off QLA_DEBUG noise, requested by deraadt@Jonathan Matthew
2015-02-09we want to defer work traditionally (in openbsd) handled in anDavid Gwynne
interrupt context to a taskq running in a thread. however, there is a concern that if we do that then we allow accidental use of sleeping APIs in this work, which will make it harder to move the work back to interrupts in the future. guenther and kettenis came up with the idea of marking a proc with CANTSLEEP which the sleep paths can check and panic on. this builds on that so you create taskqs that run with CANTSLEEP set except when they need to sleep for more tasks to run. the taskq_create api is changed to take a flags argument so users can specify CANTSLEEP. MPSAFE is also passed via this flags field now. this means archs that defined IPL_MPSAFE to 0 can now create mpsafe taskqs too. lots of discussion at s2k15 ok guenther@ miod@ mpi@ tedu@ pelikan@
2015-01-27remove the second void * argument on tasks.David Gwynne
when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
2014-12-19another handful of bcopy -> memcpy because there is no overlapTheo de Raadt
2014-09-14remove uneeded proc.h includesJonathan Gray
ok mpi@ kspillner@
2014-09-13Replace all queue *_END macro calls except CIRCLEQ_END with NULL.Doug Hogan
CIRCLEQ_* is deprecated and not called in the tree. The other queue types have *_END macros which were added for symmetry with CIRCLEQ_END. They are defined as NULL. There's no reason to keep the other *_END macro calls. ok millert@
2014-07-13Some reallocarray() use; review Jean-Philippe Ouellet, patrick keshishianTheo de Raadt
ok tedu
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-05-21We only have one possible location to use for a logged in port, so only setJonathan Matthew
it in one place.
2014-05-17When the firmware tells us a loop id is already in use, add the deviceJonathan Matthew
there to our port lists, then find the next available loop id and carry on rather than restarting. This way, we're less likely to get stuck looping when the firmware behaves inconsistently. We also don't need to treat domain controller logins specially. additional complications discovered by deraadt@
2014-04-27transplant hotplug code over from qle(4)Jonathan Matthew
2014-04-21In qla_get_port_name_list, handle malloc failure, skip special fabric ports,Jonathan Matthew
and set location on ports as best we can. Take the port mutex too.
2014-04-14Always copy out all mailbox registers and use msleep in a loop to ensure thatJonathan Matthew
post-attach mailbox operations work reliably.
2014-04-13In debug output, print loop ids as decimals and port ids as 24bit hex.Jonathan Matthew
Fix some parameters and wording too.
2014-04-07When iterating through fabric ports, start at our own port ID. It doesn'tJonathan Matthew
matter if we don't see ourselves, and if we pick another starting point, the first port we see might disappear half way through (I have seen this happen), which makes it more complicated to identify when we're back at the start.
2014-04-07ISP2322 chips need a different firmware image to other 2300s, so until weJonathan Matthew
add that, don't try loading firmware for them.
2014-04-05set adapter buswidth according to the number of loop ids supported by theJonathan Matthew
firmware (2048 for 2k login firmware, 256 otherwise) pointed out by deraadt@, ok dlg@
2014-04-04Rework the command polling loop so it can handle multiple responses in a singleJonathan Matthew
interrupt. With this we can talk to Hitachi disk arrays, which sometimes return so much sense data that a status continuation response is generated in addition to the normal status response. tested by deraadt@
2014-03-31Rather than scanning local loop ids sequentially, just ask the chip whichJonathan Matthew
local devices it has logged in to. This will also be useful for hotplug later on.
2014-02-23when built without firmware, check that the chip already has firmwareJonathan Matthew
before trying to boot it, so we can explain why it's not working rather than printing cryptic errors.
2014-02-22refactor firmware loading with a function pointerTheo de Raadt
ok jmatthew
2014-02-20More turd shining; cleanup the message that prints the firmware revision andMark Kettenis
attributes. ok dlg@, jmatthew@
2014-02-20Avoid printing the "nvram corrupt" message for onboard 2200s found on SunMark Kettenis
hardware. ok dlg@, jmatthew@
2014-02-20jsg@ pointed out i am bad at loops.David Gwynne
2014-02-20knfDavid Gwynne
2014-02-20pull the isr reads out into per chip variants we get to via pointersDavid Gwynne
in a per generation structure. this avoids code on every isr to figure out what version of the chip we are, which is silly since we know that at attach time. ok jmatthew@
2014-02-19tweak the response queue handling so it looks like qle. the importantDavid Gwynne
bit is to post to the resp_out register once outside the loop rather than inside every loop. rework the code for finding the queue registers so its done once on attach by pointing the sc at a map, rather than running big conditionals in code on every register operation based on teh chip version. tested on 2200s by me and 2312s by jmatthew@ ok jmatthew@
2014-02-19remove some dead code - all the chips we handle can do type 4 commands,Jonathan Matthew
which means we don't need to use sgl continuation command buffers. this keeps things much simpler on the iopool side of things.
2014-02-18convert printfs into a few different debug categories, leaving portJonathan Matthew
discovery stuff enabled for now.
2014-02-11fix endianness of fc4 type registration (again), and don't bother printingJonathan Matthew
the fc4 types for fabric ports we find
2014-02-10Build isp2xxx firmware into separate object files so we only includeJonathan Matthew
one copy when both isp(4) and qla(4) are enabled. This is a temporary measure until qla(4) takes over completely. looked at by miod@ and kettenis@
2014-02-06Almost-working QLA2100 support. This appears to be the best I can do forJonathan Matthew
now. The one 2100 card I have doesn't work at all with isp(4). I can get it to see devices on the fabric, but it can't log in to them, and it can't see loop devices at all.
2014-02-05Avoid calling delay(9) between checking and clearing the interrupt status bits.Mark Kettenis
ok jmatthew@
2014-02-05Punt on handling responses if we haven't allocated the response queue yet.Mark Kettenis
Otherwise a spurious interrupt might make us dereference a null-pointer. This is especially important for ISP2200 cards with Open Firmware, where the card is running a full firmware and the response queue "in" pointer is non-zero when we take over. ok jmatthew@
2014-02-03use the same option as isp(4) to build without firmware.Jonathan Matthew
stub out the firmware loading code and don't include the firmware files when ISP_NOFIRMWARE is defined.
2014-02-02carve up qla_attach() into bits we can use to process loop and fabric changesJonathan Matthew
later on.
2014-02-02Rearrange interrupt register processing for 2200s. The mailbox semaphoreJonathan Matthew
seems to be disconnected from the interrupt status register, so we shouldn't wait until the interrupt status is nonzero to check it. This makes onboard FC controllers in Sun systems work better. tested on a blade1k (by kettenis@) and a v880.
2014-02-01On sparc64, use the WWNs from Open Firmware, as the onboard ISP2200 that canMark Kettenis
be found on some Sun hardware doesn't have an NVRAM. ok jmatthew@
2014-01-30the option bit for controlling fast posting is in icb_fw_options, notJonathan Matthew
icb_xfwoptions. one of my qla2200 cards seems to have this enabled in its nvram, so it wasn't getting io completions.
2014-01-30don't do a register test mailbox command before resetting the chip.Jonathan Matthew
kettenis@ found that this causes problems on sparc64 machines that boot off isp2200s.
2014-01-30Set port and node WWN in scsi_link structure when we successfully probe aMark Kettenis
target. ok jmatthew@, dlg@
2014-01-22fix endianness for FC4 type registrationJonathan Matthew
2014-01-21add a missing printf argumentJonathan Gray
ok jmatthew@
2014-01-21Add support for ISP2200 based adapters.Jonathan Matthew
This involves a bit of a hack in the interrupt processing path, where we ignore the interrupt status if we're expecting a mailbox command to complete, but we don't have the mailbox semaphore and the response ring hasn't moved. Typically next time through, the interrupt status is the same and we have the semaphore so we can read the results.
2014-01-21The semaphore register does need to be cleared when clearing interrupts,Jonathan Matthew
but only for interrupts that return information through mailbox registers.
2014-01-21Stop using 23xx-specific interrupt status codes everywhere. Instead, classifyJonathan Matthew
into one of 4 types in qla_read_isr.