summaryrefslogtreecommitdiffstats
path: root/sys/scsi/scsi_base.c
Commit message (Collapse)AuthorAgeFilesLines
* Ifdefed some conditionally used declarations.bde1997-12-201-1/+3
|
* Remove the call to scsi_start_unit() from sd_open(). It was causingjoerg1997-10-121-2/+2
| | | | | | | | | | | | | | much grieve to owners of IBM drives when used in conjunction with tagged command queuing, and didn't serve any purpose at all (since experiments have proven that it simply didn't work). Instead, call scsi_start_unit() once in sd_attach(), so in case the drive has been configured to `remote start', it will spin up there. (If it has spun down later, it must have been because of administrator action (scsi(8)) anyway.) While i was at it, bump the timeout for scsi_start_unit() to 30 seconds. 10 seconds were way too few for most drives.
* Convert to use the new bufq* functions for dealing with buffergibbs1997-09-211-1/+2
| | | | queues.
* Removed unused #includes.bde1997-09-021-7/+1
|
* In SCSI diagnostic messages, cause "0x" to be prepended to the numberjdp1997-07-251-3/+3
| | | | in the "info" field to make it clear that it is hexadecimal.
* Add a 1ms delay in the XS_BUSY case. This is the same error code returnedgibbs1997-04-041-1/+6
| | | | | for the QUEUE FULL condition. This may help avoid wedging a device by immediately requeeuing the transaction in this case.
* free_xs must be called at splbio(). This is usually the case since the maingibbs1997-03-241-1/+3
| | | | | | | | | | | | caller is scsi_done which the controller interrupt handlers call. In the case of a non-buffer based transaction, the xs structure is freed by the process that initiated the transfer in scsi_scsi_cmd. In this case, an explicit splbio/splx pair around the call to free_xs is required. Without the splbio protection, the xs free list could be corrupted, and the type driver's start routine might run without spl protection. Submitted by: Tor Egge <Tor.Egge@idt.ntnu.no> Obtained from: PR kern/2891
* Removed nested #includes of <scsi/scsi_debug.h> and <scsi/scsi_driver.h>bde1997-03-231-1/+2
| | | | from <scsi/scsiconf.h> and fixed everything that depended on them.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make some small tweaks to the messages to clean up some stuffwpaul1997-02-081-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | from last time. Some people have pointed out that there were some odd side-effects in the changes I made. Two things are different: - sc_print_addr() will print 'foodev0:' (i.e. sd0:, st0:, cd0:, etc...) if the device name is known. If it's not known, it'll use a longer notation. This shortens error messages back to a sane length. - Added a small function called sc_print_init() to set the sc_printing flag so that sc_print_addr() will know that we want it to print a linefeed. Used this in scsi_device_attach() to restore proper carriage return printing behavior which I broke. Remaining bogons: the NCR SCSI driver prints out information while the device-specific attach routine is running with its own linefeeds. This breaks up the individual messages emitted by the subdriver modules and causes at least one message to appear on a line by itself without a device spec prefix. I'm not sure of the correct way to fix this, and I don't have any NCR SCSI hardware to test with anyway. There's probably more, but I gather that a rewrite of the SCSI subsystem is pending anyway, so I'll leave the rest to Those Who Know More About This Than I (tm).
* Fix a benign type mismatch i've introduced in rev 1.40.joerg1997-01-301-14/+14
| | | | Pointed out by: bde
* Make the SCSI probe messages more BSDish. This may raise a few eyebrowswpaul1997-01-251-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ("Hey! Who made _you_ the keeper of all things BSDish?!") but this has bugged me for a long time, and now that I finally have the chance to hack on it (and test the results), I'll take my chances. I can also point to other BSD implementations for precedents if you put my back to the wall. The only thing that's changed is how the messages are formatted. Now, instead of having this: aha0 at 0x330-0x333 irq 11 drq 5 on isa (aha0:3:0): "HP C1553A 9503" type 1 removable SCSI 2 st0(aha0:3:0): Sequential-Access density code 0x24, variable blocks, write-enabled (aha0:3:1): "HP C1553A 9503" type 8 removable SCSI 2 ch0(aha0:3:1): Medium-Changer 6 slot(s) 1 drive(s) 0 arm(s) 0 i/e-slot(s) We have this: aha0 at 0x330-0x333 irq 11 drq 5 on isa scbus0 at aha0 bus 0 st0 at scbus0 target 3 lun 0 st0: <HP C1553A 9503> type 1 removable SCSI 2 st0: Sequential-Access density code 0x24, variable blocks, write-enabled ch0 at scbus0 target 3 lun 1 ch0: <HP C1553A 9503> type 8 removable SCSI 2 ch0: Medium-Changer 6 slot(s) 1 drive(s) 0 arm(s) 0 i/e-slot(s) Which is (to me anyway) is a lot more pleasant to look at. (Call me crazy -- g'head: you know you wanna -- but the previous messages remind me of Linux. Ever see the output from the linux device probes? It's a mess of copyright notices, version numbers/dates, author e-mail addresses and other crap. Let's not go there, okay? Bleh.) Notice that devices are now specified in terms of the scsi bus they live on rather than the adapter. This better reflects the contents of the kernel config file (if you use wired-down device specifications anyway) and removes some ambiguity that may arise if you have a multi- channel adapter with more than one bus. Also, sc_print_addr() now generates messages like this: st0 at scbus0 target 3 lun 0: NOT READY asc:3a,0 Medium not present instead of this: st0(aha0:3:0): NOT READY asc:3a,0 Medium not present I also added a quirk entry for the HP Superstore 12000e 6 tape DAT autoloader, which needs SC_MORE_LUS in order for the changer device to be properly probed and attached. (I'm working on a chcontrol utility to manipulate the changer on this drive which should hopefully be general enough to work with other changers too. If you want the prototype I have now, it's at ftp://skynet.ctr.columbia.edu/pub/freebsd/changer.c.) Remaining bugs: - The 'foodev0: yadda yadda yadda' bits should probably be printed entirely by the device-specific subdriver attach code instead of half by the scsi_device_attach() routine and half by the device specific attach routine like it is now. - The wired-down device specifications in the kernel config file should be used to control bus/device probing to some extent rather than just for choosing names for devices we find. If the config says there's a device at scbus0 target 0 lun 0 called sd0, we should look there and check for a device that can be managed by the sd driver. If we don't find one, we should probably complain that there's no device there or that there is a device but of the wrong type. Once all the devices from the wired down list have been probed, the code can then autodetect and autoattach any devices that remain unassigned. - Apparently some tape changers (hi Ulf!) return 'not ready/medium not present' when the magazine is loaded but a tape has not been put in the drive yet. This causes an open(/dev/ch0) to fail and prevents you from using the changer.c utility to load the first tape into the drive. My HP changer does not behave this way. The workaround is to manually load a tape into the drive before attempting to use the changer program, but you can get in trouble if you accidentally eject a tape without loading a new one and you're at a remote location: you won't be able to load any tapes anymore. I'm not sure what the correct software solution is for this but ideally there should be one. - I should not be doing this: I'm the NIS guru, not the SCSI guru. (This is not my beautiful code. How did I get here? My god: what have I done?)
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Do something Peter Dufault long since intended to do: make a currentjoerg1996-12-241-4/+18
| | | | | | | | | | | | error code with ASC/ASCQ 4/1 (``Logical unit is in the process of becoming ready'') non-fatal. Retry the operation until it will eventually either yield a real error condition, or finally succeed. Devices like CD changers or tape drives with a freshly inserted cartridge should benefit from this. Should go into 2.2 after some testing in -current. I'd like to see this in the release if possible.
* Turn SCSIDEBUG into a new-style option.joerg1996-07-141-1/+2
|
* Another sweep over the pmap/vm macros, this time with more focus onphk1996-05-031-3/+3
| | | | | the usage. I'm not satisfied with the naming, but now at least there is less bogus stuff around.
* Implement the XS_SELTIMEOUT error code. This causes the SCSI code togibbs1996-03-311-1/+2
| | | | | not retry again and should be used when a device times out during selection (ie is not on the bus). This should speed up the boot sequence.
* Cleanse the SCSI subsystem of its internally defined typesgibbs1996-03-101-45/+45
| | | | | u_int32, u_int16, u_int8, int32, int16, int8. Use the system defined *_t types instead.
* Convert BOUNCE_BUFFERS and BOUNCEPAGES to new option scheme.wollman1996-01-051-1/+3
|
* Staticize.phk1995-12-171-5/+4
| | | | | | | | | | | | Unstaticize a function in scsi/scsi_base that was used, with an undocumented option. My last count on the LINT kernel shows: Total symbols: 3647 unref symbols: 463 undef symbols: 4 1 ref symbols: 1751 2 ref symbols: 485 Approaching the pain threshold now.
* Another mega commit to staticize things.phk1995-12-141-8/+23
|
* Untangled the vm.h include file spaghetti.dg1995-12-071-1/+3
|
* Some bug fixes for the worm driver:joerg1995-10-091-3/+3
| | | | | | | | | | | | | | | o don't use polled mode after the device probe phase o don't biodone() a NULL buffer pointer o increase the timeout for scsi_read_capacity(); WORMs are slooow o make WORMMs known to scsiconf at all This brings the driver in a state where it at least doesn't immediately panic, nor hangs the controller any more. Unfortunately, at least the YAMAHA CDR100 i've been testing with answered my write attempts with an "Incorrect command sequence" response. Perhaps other CD burners might work however. Reviewed by: dufault
* Change memcmp() to bcmp(). memcmp() isn't declared or implementedbde1995-07-251-2/+2
| | | | | | | | | for the kernel, but gcc provides an inline version of it if the kernel is compiled with -O. The inline memcmp() is OK for small compares and is better than the dumb kernel bcmp() in all cases, but it has been hiding the library memcmp() which is 4 times faster for large compares.
* Remove trailing whitespace.rgrimes1995-05-301-25/+25
|
* Set SCSI_NOSLEEP only when we really need to. This requires an additionalgibbs1995-04-231-3/+2
| | | | | | | | flags parameter to all xxstart routines so that the correct information can be passed down into the device specific routines. This is needed to ensure that ccb/scb allocation routines don't hang. Submitted by: John Dyson
* Added "scsi target" device that can act as a target for scsi transfersdufault1995-04-141-107/+299
| | | | | | | | from an initiator Added Julian's support for residuals. Added Julian's fixes to the tape driver Made compile cleanly with -Wall Reduce boot up output
* Read of a record smaller then request size always failsache1995-04-111-3/+2
| | | | Submitted by: edward@edcom.com
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'bde1995-03-281-2/+3
| | | | | (except in netccitt, netiso and netns) that I didn't notice when I fixed "all" such warnings before.
* cd.c: Julian's CD audio cleanupdufault1995-03-211-5/+31
| | | | | | | | | | sd.c: Julian's removal of subdriver requests st.c, scsi_tape.h: Julian's suport of compressed tape drives Note: compressed tape drives are still not working fully. scsiconf.h, scsi_base.c, scsi_driver.c: address problems in probes and error console logs
* Change it so it doesn't say "probe0" for SCSI probe "device".dufault1995-03-151-4/+5
|
* 1. Add text for ASC/ASCQdufault1995-03-151-14/+13
| | | | | 2. Clean up probe messages. This is how I propose it looks for 2.1 so if you don't like it you have my e-mail address.
* 1. Change driver signatures to full signature for slice support.dufault1995-03-041-12/+51
| | | | | 2. Add "pt" (processor type) driver. 3. Add "worm" (Write Once) driver for Jordan.
* >From a week or two ago I got kernel panics as soon as I tried to access mydg1995-02-151-3/+3
| | | | | | | | | | | | tape drive. I traced it to sys/scsi/scsi_base.c where some code were added to print the return values of the sense command. My tape drive returned a extended flags value of 0x20, so the key that is the lower 4 bits, is 0. The code uses "key-1" to index into a table and then the kernel go to never- never land. Here is a fix for this. Will somebody please apply it? Submitted by: John Hay
* Split byte packing functions into signed and unsigned versions.dufault1995-01-311-7/+22
| | | | Left most current invocations as signed, though that could be wrong.
* 1. Reject obviously broken CDB command lengthsdufault1995-01-241-1/+16
| | | | 2. Use "uprintf" (instead of printf) to log the "tape not ready" message
* Remove dup biodone and no more SCSIUSER option.dufault1995-01-191-3/+1
|
* Reviewed by: gibbs@estienne.CS.Berkeley.EDUdufault1995-01-081-68/+196
| | | | | | | Reenabled "SCIOCOMAND" ioctl. Restructured so low level drivers can easily request retries. Added preliminary fixed SCSI devices (should be revisited before 2.1) Added "ssc" device that can have its' (HBA, ID, LUN) set via ioctl.
* Remove bogus and unused declaration and definition of Debugger().bde1994-11-151-7/+1
|
* Removed unused vars. Silenced gcc -Wall. Some of this stuff is virtuallyphk1994-10-081-4/+4
| | | | type-less. Everything is "u_int32" :-(
* GCC cleanup.phk1994-10-021-1/+2
| | | | | | Reviewed by: Submitted by: Obtained from:
* Rather than exclude bounce buffers support with NOBOUNCE, include itdg1994-08-311-7/+7
| | | | | | with BOUNCE_BUFFERS. This is more intuitive, and is better for future multiplatform support. Added BOUNCE_BUFFERS option to the GENERIC and LINT kernel config files.
* 1) Changed ddb into a option rather than a pseudo-device (use options DDBdg1994-08-271-9/+1
| | | | | | | | | | in your kernel config now). 2) Added ps ddb function from 1.1.5. Cleaned it up a bit and moved into its own file. 3) Added \r handing in db_printf. 4) Added missing memory usage stats to statclock(). 5) Added dummy function to pseudo_set so it will be emitted if there are no other pseudo declarations.
* 1) cleaned up after Garrett - fixed more redundant declarations, changeddg1994-08-201-3/+1
| | | | | | | | use of timeout_t -> timeout_func_t in aha1542 and aha1742 drivers. 2) fix a bug in the portalfs that was uncovered by better prototyping - specifically, the time must be converted from timeval to timespec before storing in va_atime. 3) fixed/added some miscellaneous prototypes
* The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.rgrimes1994-05-251-8/+3
| | | | | Reviewed by: Rodney W. Grimes Submitted by: John Dyson and David Greenman
* Wait a much longer time for slow devices like CD multichangers to timeoutjkh1994-05-191-3/+3
| | | | (by request of Horo Hideo).
* Bug fixes and performance improvements from John Dyson and myself:dg1994-04-201-2/+10
| | | | | | | | | | | | | | | 1) check va before clearing the page clean flag. Not doing so was causing the vnode pager error 5 messages when paging from NFS. (pmap.c) 2) put back interrupt protection in idle_loop. Bruce didn't think it was necessary, John insists that it is (and I agree). (swtch.s) 3) various improvements to the clustering code (vm_machdep.c). It's now enabled/used by default. 4) bad disk blocks are now handled properly when doing clustered IOs. (wd.c, vm_machdep.c) 5) bogus bad block handling fixed in wd.c. 6) algorithm improvements to the pageout/pagescan daemons. It's amazing how well 4MB machines work now.
* Gee, seems like I have commited this fix at least 3 times :-)rgrimes1994-02-071-2/+2
| | | | | | | | | | | | | | | >From: Adam David <adam@veda.is> Subject: SCSI timeout in sdopen() Date: Sun, 6 Feb 1994 21:40:48 GMT Index: sys FreeBSD-current Reference: FreeBSD-current/sys/9 Description: sdopen() times out on slow SCSI devices. This code was moved into a different file, which might explain why it got missed again. Repeat-By: using slow SCSI disks
* Patch from Julian. Commit message by me.rgrimes1994-01-291-1/+29
| | | | | | | | | | | | | | | | | | | | | | cd.c: Initialize channel info in CDIOCSETVOL ioctl. Correct CDIOCSTOP and CDIOCEJCET ioctls to use scsi_stop_unit instead of scsi_start_unit. Add CDIOCALLOW and CDIOCPREVENT ioctls. ch.h: Return EBUSY instead of ENXIO if the device is already in use. scsi_base.c: Add scsi_stop_unit routine. sd.c: Add mising indirection through sc_link to sd_get_parms routine when checking for media loaded. st.c: Return EBUSY instead of ENXIO if the device is already in use. Clear the SDEV_WAITING flag in ststart if we do the wakeup call.
* "New" VM system from John Dyson & myself. For a run-down of thedg1994-01-141-3/+10
| | | | | major changes, see the log of any effected file in the sys/vm directory (swap_pager.c for instance).
OpenPOWER on IntegriCloud