summaryrefslogtreecommitdiffstats
path: root/sys/i386/scsi
Commit message (Collapse)AuthorAgeFilesLines
* Correct a typo in a comment.ats1995-07-081-2/+2
|
* Dan Eischen's serial eeprom code.gibbs1995-07-042-0/+227
|
* First pass cleanup of this driver. This pass does not include the sequencergibbs1995-07-042-61/+389
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | optimizations I have been working on yet, but does bring in some bug fixes and performance improvments that were easy to regression test: Setup the data fifo threshold and bus off timing correctly for 27/284x cards. Users of these adapters with fast periferals (greater than 5MB/s) will notice a big performance difference. (Sometimes as large as going from 3.7->8.3MB/s). Fix handling of the active target flags. Some of the outbs where missing the base offset in the abort code. The abort code still needs lots of work. Support 3940 controllers, but only with 16 SCBs for now. Eventually I'll add support for all 255, but I need to find a tester for the code first since we have to enable the cards external SRAM to do this. Add Dan Eischen's serial eeprom reading facilities. This allows the 2940 adapters to pull additional information left over from SCSI-Select right out out of the configuration seeprom. If the BIOS is disabled on 274x controllers, reset all target parameters to there defaults since you can't rely on what is stored in scratch ram. Report motherboard controllers as such. Stick the first SG address and count into the SCB data and count areas for all transfers in preparation of a later sequencer optimization. Keep track of which targets can are allowed to have the disconnection priveledge since this will be handled by the kernel driver in the future. If a target issues a message reject in response to a tagged message, disable tagged queuing for that target. Some seagates say they can do tagged queuing, but lie, and its a shame to have to disable tagged queuing on all devices just because you have one that can't cope.
* Merge RELENG_2_0_5 into HEADrgrimes1995-06-112-144/+147
|
* Remove trailing whitespace.rgrimes1995-05-302-235/+235
|
* Fixes to the aic7xxx sequencer code and device driver from Justin Gibbs:dg1995-05-172-49/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) If a target initiated a sync negotiation with us and happened to chose a value above 15, the old code inadvertantly truncated it with an "& 0x0f". If the periferal picked something really bad like 0x32, you'd end up with an offset of 2 which would hang the drive since it didn't expect to ever get something so low. We now do a MIN(maxoffset, given_offset). 2) In the case of Wide cards, we were turning on sync transfers after a sucessfull wide negotiation. Now we leave the offset alone in the per target scratch space (which implies asyncronous transfers since we initialize it that way) until a syncronous negotation occurs. 3) We were advertizing a max offset of 15 instead of 8 for wide devices. 4) If the upper level SCSI code sent down a "SCSI_RESET", it would hang the system because we would end up sending a null command to the sequencer. Now we handle SCSI_RESET correctly by having the sequencer interrupt us when it is about to fill the message buffer so that we can fill it in ourselves. The sequencer will also "simulate" a command complete for these "message only" SCBs so that the kernel driver can finish up properly. The cdplay utility will send a "SCSI_REST" to the cdplayer if you use the reset command. 5) The code that handles SCSIINTs was broken in that if more than one type of error was true at once, we'd do outbs without the card being paused. The else clause after the busfree case was also an accident waiting to happen. I've now turned this into an if, else if, else type of thing, since in most cases when we handle one type of error, it should be okay to ignore the rest (ie if we have a SELTO, who cares if there was a parity error on the transaction?), but the section should really be rewritten after 2.0.5. This fix was the least obtrusive way to patch the problem. 6) Only tag either SDTR or WDTR negotiation on an SCB. The real problem is that I don't account for the case when an SCB that is tagged to do a particular type of negotiation completes or SELTOs (selection timeout) without the negotiation taking place, so the accounting of sdtrpending and wdtrpending gets screwed up. In the wide case, if we tag it to do both wdtr and sdtr, it only performs wdtr (since wdtr must occur first and we spread out the negotiation over two commands) so we always have sdtrpending set for that target and we never do a real SDTR. I fill properly fix the accounting after 2.0.5 goes out the door, but this works (as confirmed by Dan) on wide targets. Other stuff that is also included: 1) Don't do a bzero when recycling SCBs. The only thing that must explicitly be set to zero is the scb control byte which is done in ahc_get_scb. We also need to set the SG_list_pointer and SG_list_count to 0 for commands that do not transfer data. 2) Mask the interrupt type printout for the aic7870 case. The bit we were using to determine interrupt type is only valid for the aic7770. Submitted by: Justin Gibbs
* Fix -Wformat warnings from LINT kernel.rgrimes1995-05-111-4/+5
|
* Aaron Daily of Adaptec has informed me that some form of paged SCBgibbs1995-05-011-6/+4
| | | | | | | | | | | | | | algorithm is used on aic7770 Rev E or higher chips to improve perfomance. This required a hardware change but we don't know exactly what (most likely some special register to do fast SCB indexing into host memory), and we are not at all sure that there are more than 4 SCBs on these chips. This probe will still classify the revision of the aic7xxx, but we now default to 4 SCBs (at least until we know more of what was done). This also fixes a bug in the timeout routine where we cleared a flag too soon making it imposible to enter one section of the routine. Submitted by: Timeout bug - Dan Eischen <deischen@iworks.InterWorks.org>
* Set the return value (outb'd to the sequencer) for non zero statusgibbs1995-05-011-10/+17
| | | | | | | | | | | | | | interrupts to zero to start with. This is the value we return in most cases. The sense code then outbs the apropriate value to cause sense retrieval. The return value was uninitialized before this change (something that was an okay thing with the old sequencer code, but not with the semantics of the new). This problem caused us to always retrieve sense upon recieving a non zero status byte. This is exactly what was happening for the "target busy" status returned by exabyte tape drives when they rewind or power on with a tape installed. The request sense proved fatal. This should fix the tape problems.
* Additions to support the WAITING_SCB list that the sequencer maintains.gibbs1995-04-272-35/+90
| | | | | | | | | | | | | It is the kernel driver's responsibility to do the list manipulation whenever a selection timeout or a request sense occurs. Print out the interrupt type that the device has been set to. It seems that one of the Asus motherboards botches this and David thought a diagnostic would be nice. Fix a bug in my diagnostic code that David found. Reviewed by: Wcarchive and David Greenman
* Don't arbitrarily set SCSI_NOSLEEP. It is now handled correctly by thegibbs1995-04-232-22/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | higher level scsi code. Spls should never be conditionalized, so don't do so here. Restructure the get_scb routine so that we can't get into an infinite loop if the ccbs are exhausted and we are are called with SCSI_NOSLEEP set. Other driver maintainer's that based their scb allocation routines on Julian's code should look at these changes and implement them for their driver. The aic7xxx driver inspired these changes because early revs of the aic7770 chips have so few SCBs that you can actually run out. If you have a rev C or aic7770 (as is reported by the driver probe) and had more than 2 drives, you could get into an infinite loop when using up all of the SCBs. Since the driver will only allow two SCBs per device and I only had two devices, I never saw this problem on my Rev C card. Bzero only 19 bytes of the scb instead of 2k (ack!). This was a hold over from when a struct SCB only contained the information downloaded to the board, but we now store kernel driver data in there as well. This greatly lowers the overhead for small transactions (I get ~1MB/sec for dds with a 512 byte block size). Submitted by: John Dyson with the aic7xxx specific optimization by me
* Be more careful with how we do a chip reset.gibbs1995-04-151-16/+33
| | | | Clean up some comments.
* Disable tagged queuing by default. option AHC_TAGENABLE will turn it on.gibbs1995-04-091-1/+3
| | | | This is temporary until I can get a device flags added.
* Log ABORT_TAG messages to the console.gibbs1995-04-011-3/+31
| | | | | | When attempting to abort a command, don't assume that just because the sequecer happens to have SCBPTR pointing at the scb we want that it is an active command.
* Major overhaul of the aic7xxx driver:gibbs1995-03-312-67/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - catch the interrupt type (EDGE/LEVEL) before chip reset instead of guessing the right type. - Add pause variable to the ahc struct to better handle the different interrupt types and pausing the sequencer. - CLRINTSTAT -> CLRSCSIINT: This is a documented bit in the CLRINT register in newer Adaptec documentation, so use their name for it. - Report valid residual byte counts. - Don't mess with the target scratch areas > id 8 on single, narrow, channel devices. The BIOS does a checksum of this area and can flip out if we zero it out. - Initialize the sequencer FLAGS scratch ram variable in the single channel devices to 0. This was the cause of the annoying warning where we would get a cmdcmplt the first time we did any type of transfer negotiation with no valid scb. It also fixes the problem that looked like the INTSTAT register wasn't clearing fast enough. This only showed up on 294x cards, not motherboard aic7870s. - Add the AHC_AIC7870 type and use it as the superset of aic7870 based controllers. - clear the sync offset section of the targ scratch area so that we default to asyncronous transfers. This was only a problem for wide controllers because there was a scenario where the offset wouldn't get updated before a data(out/in) phase would occur. This required some change in the sequencer code since we were depending on this field to hold the rate to negotiate. - allow sync and wide negotiated commands to be tagged (the sequencer now handles this properly).
* Increase the DELAY used in ahc_poll. This is only used during intialgibbs1995-03-171-47/+67
| | | | | | | | | | | | | | | probe of the device and shouldn't affect normal operation. It seems that some version of the aic7870 are extreamly slow in clearing their interrupt register so the added delay is required to ensure we don't poll a stale interrupt value. Clean up debugging printfs and stuff superflous output into #ifdef AHC_DEBUG. Ensure that sdtrpending and wdtrpending are cleared in all cases after we recieve an SDTR or WDTR message. With this commit, the 294x should work or at least be much closer to working properly.
* Compile cleanly -Wall. Remove some code that was an attempt to makegibbs1995-03-071-59/+46
| | | | | the 294x probe more stable, but since the guess was wrong, go back to the clearer aproach I used the first time around.
* Add tagged queueing support. Right now, we only allow two taggedgibbs1995-02-222-85/+169
| | | | | | | | commands per target. I could have followed the route of the ncr driver and gone to great lengths to get the SCSI subsystem to support more, but I think I'll use the time saved to help Julian and Peter make tagged queuing a better handled generic feature. This also includes some comment and enum clean up and a possible fix for the hanging PCI controllers.
* Keep track of when we actually are awaiting a reply to an SDTR or WDTRgibbs1995-02-032-10/+31
| | | | | | | | | | message instead of relying on the fact that we are scheduled to send them. The old method worked 99.9% of the time, but someone reported some periferals that did MSG_REJECT at odd times (sometimes before we could send an SDTR or WDTR) that we would construe as the response to an SDTR or WDTR message. This also removes a possible race condition where after a bus reset (the result of a command time out not during intial probe time), we might queue two commands both requesting SDTR, WDTR or both.
* Set the current transfer parameters directly after a mesg reject for eithergibbs1995-01-271-13/+16
| | | | Wide or Sync negotiation attempts as we do in all other phases of negotiation.
* Initialize SIMODE1, SCSIID, and SXFRCTL1 in ahc_init instead of at eachgibbs1995-01-221-7/+52
| | | | reconnection/selection with a target.
* Add $Ids. Use DMA for downloading SCBs to the sequencer. Implement SDTR,gibbs1995-01-162-86/+125
| | | | | | WDTR, and message reject handlers so they don't need to exist in the sequencer. All three of these cases are not on the critical path, so it makes little sense to use up precious sequencer ram for them.
* Point include to i386/scsigibbs1995-01-131-2/+2
|
* Generic support for the entire aic7x70 line of adaptors. No one elsegibbs1995-01-132-449/+619
| | | | came up with a directory place ment more me, so now we have i386/scsi.
* Handle both channels of Twin channeled devices. Respect the configurationgibbs1994-12-311-161/+284
| | | | | | | values for syncronous negotiation. The 284x series adaptors can now be supported without the Bios being enabled. If you disable the Bios on the 274x series adaptors, all configuration parameters revert to the default since there is no way to retrieve them.
* Put the sequencer into FASTMODE during initialization. I can nowgibbs1994-11-291-3/+6
| | | | get up to 8m/sec write performance out of a pd2100 with this driver.
* Changed the MAX_SLOTS constant from 8 to 16. The EISA bus can have upats1994-11-251-2/+2
| | | | to 16 slots.
* Register with devconfg so we show up in lsdev.gibbs1994-11-181-1/+25
|
* Change the include for the sequencer program to point back to thegibbs1994-11-181-2/+4
| | | | | | right place: include "../../sys/gnu/misc/aic7770/aic7770_seq.h"
* Whoops - this one's my fault. Put back my changes for seqprog[].jkh1994-11-181-4/+2
|
* My port of Julian's 1742 driver to work with the Linux aic7770 sequencergibbs1994-11-171-0/+1707
code.
OpenPOWER on IntegriCloud