summaryrefslogtreecommitdiff
path: root/sys/dev/ic/isp_netbsd.h
AgeCommit message (Collapse)Author
2003-12-04netbsd.org -> NetBSD.orgkeihan
This was the last commit of this kind to src/sys, which is now totally "NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
2002-10-18Slight cleanup to use ISP_MUSTPOLL macro in case we can ever fix themjacob
issue about knowing when we're on the interrupt stack or not.
2002-04-04Redo fabric evaluation to not use GET ALL NEXT (GA_NXT). Switches seemmjacob
to be trying to wriggle out of supporting this well. Instead, use GID_FT to get a list of Port IDs and then use GPN_ID/GNN_ID to find the port and node wwn. This should make working on fabrics a bit cleaner and more stable. This also caused some cleanup of SNS subcommand canonicalization so that we can actually check for FS_ACC and FS_RJT, and if we get an FS_RJT, print out the reason and explanation codes. We'll keep the old GA_NXT method around if people want to uncomment a controlling definition in ispvar.h. This also had us clean up ISPASYNC_FABRICDEV to use a local lportdb argument and to have the caller explicitly say that a device is at the end of the fabric list.
2002-03-31Thanks to Jason Wright of OpenBSD- spotted that the offsets were all wrongmjacob
for bus_dmamap_sync calls. They'd been blindly ported from Solaris which had *one* dma map for the entire control space, so offset was incremented for the Request, Response and FC Scratch spaces. Tsk. There are three maps in NetBSD. I should probably make them one anyway.
2002-02-21Implement F/W crashdumps for 2200 && 2300 cards (kernel compile option).mjacob
Distinguish between 2312 and 2300 cards (they *are* different). Enable RIO (Reduced Interrupt Operation) for the LVD cards (hey- I've seen batched completions of the 30 commands at a time with this,....)... If we get a Port Logout on local loop topologies, we have to force the f/w to log back in. The easiest way (for us) to do this is to force a LIP. This also will wake up the disk that probably just had a f/w crash. Implement mailbox 'continuations'- this allows interrupts to re-drive a mailbox command if it's one that just essentially repeats the previous mailbox command (e.g., f/w download). This saves a boatload of sleep/wakeup twitches. If we're not a 2300 and we're about to return with a 'bogus interrupt'- check the semaphore register to be non-zero at all and outgoing mailbox 0- this seems to be where some of the lost ISP1080 commands came from.
2001-12-14Major restructuring for swizzling to the request queue and unswizzling frommjacob
the response queue. Instead of the ad hoc ISP_SWIZZLE_REQUEST, we now have a complete set of inline functions in isp_inline.h. Each platform is responsible for providing just one of a set of ISP_IOX_{GET,PUT}{8,16,32} macros. The reason this needs to be done is that we need to have a single set of functions that will work correctly on multiple architectures for both little and big endian machines. It also needs to work correctly in the case that we have the request or response queues in memory that has to be treated specially (e.g., have ddi_dma_sync called on it for Solaris after we update it or before we read from it). One thing that falls out of this is that we no longer build requests in the request queue itself. Instead, we build the request locally (e.g., on the stack) and then as part of the swizzling operation, copy it to the request queue entry we've allocated. I thought long and hard about whether this was too expensive a change to make as it in a lot of cases requires an extra copy. On balance, the flexbility is worth it. With any luck, the entry that we build locally stays in a processor writeback cache (after all, it's only 64 bytes) so that the cost of actually flushing it to the memory area that is the shared queue with the PCI device is not all that expensive. We may examine this again and try to get clever in the future to try and avoid copies. Another change that falls out of this is that MEMORYBARRIER should be taken a lot more seriously. The macro ISP_ADD_REQUEST does a MEMORYBARRIER on the entry being added. But there had been many other places this had been missing. It's now very important that it be done. For NetBSD, it does a ddi_dmamap_sync as appropriate. This gets us out of the explicit ddi_dmamap_sync on the whole response queue that we did for SBus cards at each interrupt. Set things up so that platforms that cannot have an SBus don't get a lot of the SBus code checks (dead coded out). Additional changes: Fix a longstanding buglet of sorts. When we get an entry via isp_getrqentry, the iptr value that gets returned is the value we intend to eventually plug into the ISP registers as the entry *one past* the last one we've written- *not* the current entry we're updating. All along we've been calling sync functions on the wrong index value. Argh. The 'fix' here is to rename all 'iptr' variables as 'nxti' to remember that this is the 'next' pointer- not the current pointer. Devote a single bit to mboxbsy- and set aside bits for output mbox registers that we need to pick up- we can have at least one command which does not have any defined output registers (MBOX_EXECUTE_FIRMWARE). Explicitly decode GetAllNext SNS Response back *as* a GetAllNext response. Otherwise, we won't unswizzle it correctly. Nuke some additional __P macros.
2001-09-01Add support for 2 Gigabit cards (2300/2312). This necessitated a changemjacob
in how interrupts are down- the 23XX has not only a different place to check for an interrupt, but unlike all other QLogic cards, you have to read the status as a 32 bit word- not 16 bit words. Rather than have device specific functions as called from the core module (in isp_intr), it makes more sense to have the platform/bus modules do the gruntwork of splitting out the isr, semaphore register and the first outgoing mailbox register (if needed) *prior* to calling isp_intr (if calling isp_intr is necessary at all).
2001-07-07bzero -> memsetthorpej
2001-07-07bcopy -> memcpythorpej
2001-05-25Create a kernel thread for Fibre Channel cards. This is the newmjacob
way of doing business- modulo some startup spasms and peculiarities of the way kthreads are started (*after* configuration, weird) and some strangeness with the freeze/thaw code, what now happens is that any of Loop Down, LIP, Loop Reset or Port Datbase or Name Server Database Changed ASYNC events cause the queues to freeze for this channel. The arrival of a Loop UP is not relevant. What *is* relevant is that the Port Datbase or Name Server Changed async event indicate that it's okay to go and (re)evaluate the state of the FC link and (re)probe local loop and fabric membership. We have a kthread do this because it's *sooooo* much nicer to be able to sleep while doing the 130-250 mailbox commands it'll take to re-evaluate things. When the state is well known again, we can unfreeze the channel queues. Then, as commands start arriving, we simply can start them or bounce them with XS_SELTIMEOUT (if the device in question has gone away). Previously, we did lazy evaluation, which meant that if a change occurred, we would wait until the very *next* command to go rebuild stuff. The reason this is not sensible is: a) Even with sleeping, you can hang up your system because you might be making some poor stat(2) call pay the price of re-evaluating the whole fabric. b) If we ever really want to get to dynamic attachment/detachment, we should find out sooner, rather than later, where things get to. Split off ispminphys_1020 from ispminphys- a 1020 has a 24 bit limit- not anything newer. Re-enable LIPs and Loop Resets as async events- this allows the outer layer to set policy about them. Roll platform major && minor. Remove bogus waitq (no longer used). Remove callout entry in softc (no longer used). Define some shorthands for channels. Clean up a variety of cruft left over from the thorpej_scsipi changeover.
2001-05-16Per helpful suggestion from LukeM- make INLINE usage consistent (andmjacob
use correct __inline format).
2001-05-16Long overdue- put locks on the usage of the mailbox command stuff. Thismjacob
keeps us from stomping on ourselves. Say we're in the middle of re-evaluating a loop (and sleeping) when a command completes, or a timer refires, and this *other* thread decides *it* wants to start re-evaluating the loop. Bad news. We have to be a bit careful- if we can't acquire the MBOX semaphore at interrupt level, we will simulate a host interface error. This is a bit of a temp workaround. There's some work underway driven by a NetBSD commercial user that will try and force most mailbox stuff into a part A/part B interrupt driven model.
2001-04-25Pull up the thorpej_scsipi branch to main branch.bouyer
This is a completely rewritten scsipi_xfer execution engine, and the associated changes to HBA drivers. Overview of changes & features: - All xfers are queued in the mid-layer, rather than doing so in an ad-hoc fashion in individual adapter drivers. - Adapter/channel resource management in the mid-layer, avoids even trying to start running an xfer if the adapter/channel doesn't have the resources. - Better communication between the mid-layer and the adapters. - Asynchronous event notification mechanism from adapter to mid-layer and peripherals. - Better peripheral queue management: freeze/thaw, sorted requeueing during recovery, etc. - Clean separation of peripherals, adapters, and adapter channels (no more scsipi_link). - Kernel thread for each scsipi_channel makes error recovery much easier (no more dealing with interrupt context when recovering from an error). - Mid-layer support for tagged queueing: commands can have the tag type set explicitly, tag IDs are allocated in the mid-layer (thus eliminating the need to use buggy tag ID allocation schemes in many adapter drivers). - support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command will be requeued, or a REQUEST SENSE will be sent as appropriate. Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
2001-04-10Include isp_ioctl.h.mjacob
2001-03-14ANSIfy source.mjacob
2001-02-28roll platform minormjacob
2001-02-12Remove ISP2100_FABRIC (we're always fabric now). Fix usage of isp_lastmbxcmdmjacob
to report the mailbox command that times out. Fix isp_unswizzle_sns_rsp which for reasons *I* find obscurer just doesn't work correctly on sparc64 with words past 128. I have no idea why this *does* work on SparcLinux.
2001-01-05(some of these changes were made in the previous revision- oops)mjacob
Say which mailbox command times out (polled or interrupting). Also, give them a bit more time to timeout (5 seconds instead of 2).
2001-01-05Ian McDonnell <apriori@world.std.com> made me see the error of my ways.mjacob
*Cough*. Ahem. I hadn't been setting error to XS_SENSE when there was a check condition. Major blunder.
2000-12-23Fix pathnames in comment.wiz
2000-12-09Finally fix this driver to be sensible about the ENDIAN dance. It's notmjacob
quite simply a question of the Qlogic being little endian and having to have stuff swapped on big endian machines- it also has to do with the fact that the SBus and PCI DMA layouts are wierd with respect to this. At any rate, now finally fixed- works on Mac G4, tested it on a SS10 for sparc, checked on alpha to see if I've broken anything, and as soon as I get another spare afternoon I'll finally install a sparc64 version which should just work (as it'll be like the Mac).
2000-11-14Pull in <uvm/uvm_extern.h>thorpej
2000-10-16Make changes relevant to changes in WWN defaults.mjacob
Also fix egregious bug where we would never decrement the islocked recursion counter. I guess this means that we don't recurse on this platform! All of this should go away when we have real lock primitives to use in drivers.
2000-08-14Add a maintenance note. Move the single bit tags of islocked andmjacob
onintstack to be real integers. Add ISP_ILOCK/ISP_IUNLOCK macros. Fix the isp_lock/isp_unlock inlines to stop being so embarrassingly in error. Why, or why, can't I have mutex_enter/mutex_exit, pretty please?
2000-08-11Make our policy WRT tagged queueing consistent and sane: ordered tags for ↵tls
sync writes, simple tags for all else. Should make ahc and adv a bit more reliable (metadata writes won't get reordered incorrectly...) and isp a bit more performant (it was using ordered tags all the time).
2000-08-01Core version 2.0 (platform version 1.0) rewrite of ISP driver. Somemjacob
interace cleanups, some new common functions. The major impact that will be noticeable right away is that if you boot with not Fibre connected to the FC cards, you no longer hang indefinitely.
2000-07-05Roll platform minor. We are now always supporting ISP2100_FABRIC. Addmjacob
in new MBOX_WAIT_COMPLETE/MBOX_NOTIFY_COMPLETE macros (ready for SMPizing). Define STRNCAT inline for our usage. Stealing a bit of the xs_status flags to maintain command state that is pertinent for the hBA- should really reserve them for private usage in scsipiconf.h.
2000-06-28remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>mrg
2000-06-26remove redundant vm includes.mrg
2000-03-23New callout mechanism with two major improvements over the oldthorpej
timeout()/untimeout() API: - Clients supply callout handle storage, thus eliminating problems of resource allocation. - Insertion and removal of callouts is constant time, important as this facility is used quite a lot in the kernel. The old timeout()/untimeout() API has been removed from the kernel.
2000-02-19Add in ISP_SWIZZLE_CONTINUATION macro.mjacob
1999-12-20restore (by request) CFGPRINTF to DIAGNOSTIC level kernelsmjacob
1999-12-16Dual LVD (1280) support.mjacob
1999-12-04Rearrange defines to make the file diff cleaner with OpenBSD. Change CFGPRINTFmjacob
and default verbose levels. Add in a forced compile in f/w define unless either IS_DISABLE_FW or ISP_COMPILE_FW defined.
1999-10-14Roll platform version. Keep a bitmap of 'discovered' devices for SCSI adaptersmjacob
so we'll know when it's time to switch from 'slow' command mode to normal. Change some settings for configuration printfs and debug levels. Redo the internal ispscsicmd return definitions and let isp_cmd translate them as approrpriate to NetBSD values. Remove the inline functions from here- they're now in isp_inline.h. Put in the start of the correct SWIZZLE/UNSWIZZLE functions.
1999-09-30Update for SCSIPI changes. Note that capabilities update is disabledthorpej
until Matt Jacob has a change to update the driver for the latest firmware, etc. since update device parameters seems to fail once the system is really up and running, and eventually causes the controller to wedge. This may be due to a firmware bug. Per discussion with Matt.
1999-09-07A useful discussion with Jason convinced me that I had selected themjacob
wrong tag as the default tag to use- we should use ORDERED, no SIMPLE.
1999-07-05Change to approved NASA/Ames copyright. Add Fabric support. Fix SCCLUN support.mjacob
Add code that tries to track LoopID shifting.
1999-05-12Do a fairly large internal restructuring to accomodate dual-bus host adaptersmjacob
(e.g., the 1240). Include the new 1080/1240 NVRAM layout reading code. Some moderately significant mailbox changes were necessary also to accomodate a second channel.
1999-04-04roll internal revsmjacob
1999-03-26add isp1080 support and some basic PDB change stuffmjacob
1999-03-17Update the driver with some infrastructure for the 1080. Fix an embarrassingmjacob
clock botch bug. Additional infrastructure for PDB change stuff.
1999-02-09Roll platform revision level. Add blocked flag and waitq to osinfo structure.mjacob
1999-01-30Implement and use Fast Posting for both parallel && fibre. Redo a bit ofmjacob
the startup code. Implement a call to outer framework function so that asynchronous events can be handled (e.g., speed negotiation, target mode). Roll internal release tags.
1999-01-10cross platform define MEMZERO addedmjacob
1998-12-28clean up headers; move uninit/watch to outer layersmjacob
1998-12-05Update BA for new max_lun parameter for SCSIbusses. Clearify maximum lunsmjacob
for FC HB based upon a SCCLUN define (15 for normal- 255 out of a possible 65535 for SCCLUN). Propagate loopid as adapter_target. Roll minor platform version. Roll core version number. Update mailbox definitions with cleaner target mode structure definitions. Clean up some ENDIAN stuff. Correct botched ISP2100_NVRAM_HARDLOOPID offset.
1998-11-19Adapt to the new scsipi_adapter interface.thorpej
1998-09-17cleanup header to be just NetBSDmjacob
1998-09-08roll revision, change default tagging to simple tagsmjacob