summaryrefslogtreecommitdiffstats
path: root/sys/cam
Commit message (Collapse)AuthorAgeFilesLines
* Remove dead code.trasz2009-05-121-2/+0
| | | | | Found with: Coverity Prevent(tm) CID: 3667
* Add missing free(9) in error case.trasz2009-05-121-0/+1
| | | | | Found with: Coverity Prevent(tm) CID: 4224
* Add missing 'break' statements.trasz2009-05-121-0/+2
| | | | | | Found with: Coverity Prevent(tm) CID: 3936, 3937 Reviewed by: scottl@
* Get rid of the device index number stored in the sa(4) unit number.ed2009-04-201-21/+12
| | | | | | The device index number stored in the unit number of sa(4) devices is only used to print debug messages. Get rid of this index number and use devtoname() to just print the entire device name.
* Remove unused SESUNIT() macro from ses(4).ed2009-04-181-2/+0
|
* Revert r190676,190677thompsa2009-04-101-6/+0
| | | | | | | The geom and CAM changes for root_hold are the wrong solution for USB design quirks. Requested by: scottl
* Add interleaving root hold tokens from the CAM probe to disk_create and geomthompsa2009-04-031-0/+6
| | | | | | | provider tasting. This is needed for disk attachments that happen after threads are running in the boot process. Tested by: rnoland
* GCC attacks!scottl2009-02-161-1/+2
|
* Fix parallel SCSI negotiation in the CAM_NEW_TRAN_CODE world order.scottl2009-02-161-4/+3
| | | | | Overzealous sanity checks were locking the sync_rate and offset values to zero, thanks to a twisty maze of recursive code.
* Instrument the probe state machine so that things like DV can be tracked.scottl2009-02-161-18/+55
|
* In the case that the probe has determined that it can't query the device forscottl2009-02-131-4/+3
| | | | | | | | | | | a serial number, fall through to the next case so that initial negotiation still happens. Without this, devices were showing up with only 1 available tag opening, leading to observations of very poor I/O performance. This should fix problems reported with VMWare Fusion and ESX. Early generation MPT-SAS controllers with SATA disks might also be affected. HP CISS controllers are also likely affected, as are many other pseudo-scsi disk subsystems.
* Reorder dacleanup() and cdcleanup() slightly so that the sysctl context isjhb2009-02-112-8/+9
| | | | | | | freed while the periph lock is not held. While here, wait until after freeing the softc before reacquiring the periph lock. Tested by: sbruno
* Adding dynamic sysctls no longer requires Giant.jhb2009-02-102-7/+0
| | | | Submitted by: rdivacky
* cam_periph_alloc: fix "invalid periph name" error conditionfjoe2009-02-091-1/+1
| | | | | Found with: Coverity Prevent(tm) CID: 130
* Remove an overzealous check.trasz2009-02-081-1/+1
| | | | | | | Submitted by: das Reviewed by: scottl Approved by: rwatson (mentor, implicit) Sponsored by: FreeBSD Foundation
* There is no need to initialize the variable here.bz2009-01-311-2/+0
| | | | | | Submitted by: Christoph Mallon christoph.mallon@gmx.de Reviewed by: kib (as part of a larger patch) MFC after: 2 weeks
* Now that mtx_sleep/msleep can accept Giant as the interlock, simplify thejhb2009-01-261-19/+6
| | | | | | | CAM locking code slightly to no longer special case sleeping when a sim uses Giant for its lock. Tested by: trasz
* Protect against NULL pointer dereference.trasz2009-01-231-0/+5
| | | | | | Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation
* Don't leak memory when alloc fails.trasz2009-01-231-3/+3
| | | | | | | | Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Found with: Coverity Prevent(tm) CID: 2908
* Guard against NULL pointer dereference.trasz2009-01-231-1/+4
| | | | | | | | Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Found with: Coverity Prevent(tm) CID: 1847
* Guard against NULL pointer dereference.trasz2009-01-231-0/+4
| | | | | | | | Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Found with: Coverity Prevent(tm) CID: 130
* Add missing 'break' statement.trasz2009-01-141-0/+1
| | | | | | | | Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Found with: Coverity Prevent(tm) CID: 3667
* Fix use after free.trasz2009-01-141-1/+1
| | | | | | | | Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Found with: Coverity Prevent(tm) CID: 3712
* Remove unused variable.trasz2009-01-141-2/+0
| | | | | | | | Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Found with: Coverity Prevent(tm) CID: 3665
* Add missing 'break' statement.trasz2009-01-141-0/+1
| | | | | | | | Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Found with: Coverity Prevent(tm) CID: 3927
* Don't call destroy_dev(9) with a mutex held. While here, shuffletrasz2009-01-106-18/+20
| | | | | | | | | | things around so the periph destructors look alike. Based on a patch by Jaakko Heinonen. Submitted by: Jaakko Heinonen Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation
* Make "kldunload atapicam" return EBUSY instead of deadlocking when a devicetrasz2009-01-082-1/+35
| | | | | | | | | | created by atapicam is being kept opened or mounted. This is probably just a temporary solution until we invent something better. Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Reported by: Jaakko Heinonen
* cam: Retry TEST UNIT READY command if not successful.raj2009-01-081-1/+8
| | | | | | | | | | | | | | | | | | | | This fixes problems with discovering some USB devices that are very slow to respond during initialisation. When a USB device is inserted, CAM performs the sequence: 1) INQUIRY 2) INQUIRY (second time with other parameters) 3) TEST UNIT READY 4) READ CAPACITY Before this change CAM didn't check if TEST UNIT READY was successful and went on blindly to the next state and sent READ CAPACITY. If the device was still not ready by then, CAM ended with error message. This patch adds checking for the status of TEST UNIT READY command and retrying up to 10 times with 0.5 sec interval. Submitted by: Grzegorz Bernacki gjb ! semihalf dot com Reviewed by: scottl
* Make it possible to override the number of retries for the CD media.imp2009-01-081-1/+8
| | | | | | | | | | | | | | | When trying to read scratched or damaged CDs and DVDs, the default mechanism is sub-optimal. Programs like ddrescue do much better if you turn off retries entirely, since their algorithms are designed scan big areas fast, then winnow the areas down. Turning off retries speeds these programs up by as much as 20x, since the drive is able to 'stream past' many small errors... The sysctl/tunable kern.cam.cd.retry_count controls this. That defaults to '4' (for a total of 5 attempts). Setting to 0 turns off all retry attempts. Reviewed by: scottl@
* Add quirk for the Storcase InfoStation 12bayremko2008-12-231-0/+8
| | | | | | | | SATA to FC SAN. PR: 129858 Submitted by: Nick Triantos <nick-freebsd at triantos dot com> MFC after: 1 week
* Fix a comment to reflect what really happens.scottl2008-12-221-1/+1
|
* Fix refcount locking in cd, pass, and sg periphs.scottl2008-12-213-11/+13
|
* Fix cam_sim_free() wakeup condition and add mtx_asserts.trasz2008-12-191-1/+3
| | | | | | | Submitted by: Christoph Mallon Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation
* Periph driver fixes, second try.trasz2008-12-194-5/+20
| | | | | | Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation
* Move mtx_assert lower, when we can be sure that the pointertrasz2008-12-191-2/+1
| | | | | | | | to the mutex is valid. Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation
* Revert r186186 for now; it breaks stuff.trasz2008-12-173-5/+6
| | | | Approved by: rwatson (mentor)
* Fix locking in periph drivers - don't try to unlock periphtrasz2008-12-163-6/+5
| | | | | | | | that was already deallocated. Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation
* Add SIM refcounting. This is slightly different from what DragonFlytrasz2008-12-163-0/+34
| | | | | | | | | | | | | does - in DragonFly, it's cam_sim_release() what actually frees the SIM; cam_sim_free does nothing more than calling cam_sim_release(). Here, we drain in cam_sim_free, waiting for refcount to drop to zero. We cannot do the same think DragonFly does, because after cam_sim_free returns, client would destroy the sim->mtx, and CAM would trip over an initialized mutex. Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation
* Get rid of dead_sim. There is no way to make it work - any attempttrasz2008-12-161-100/+5
| | | | | | | | | | to actually use it would panic on mtx operation, as dead_sim doesn't have a proper mutex. Even if it had a properly initialized mutex, it wouldn't have properly locked and owned one. Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation
* Retire the MALLOC and FREE macros. They are an abomination unto style(9).des2008-10-231-9/+9
| | | | MFC after: 3 months
* Replace all calls to minor() with dev2unit().ed2008-09-273-6/+6
| | | | | | | | | | | | | | | After I removed all the unit2minor()/minor2unit() calls from the kernel yesterday, I realised calling minor() everywhere is quite confusing. Character devices now only have the ability to store a unit number, not a minor number. Remove the confusion by using dev2unit() everywhere. This commit could also be considered as a bug fix. A lot of drivers call minor(), while they should actually be calling dev2unit(). In -CURRENT this isn't a problem, but it turns out we never had any problem reports related to that issue in the past. I suspect not many people connect more than 256 pieces of the same hardware. Reviewed by: kib
* Remove unit2minor() use from kernel code.ed2008-09-264-6/+6
| | | | | | | | | | | | | | | When I changed kern_conf.c three months ago I made device unit numbers equal to (unneeded) device minor numbers. We used to require bitshifting, because there were eight bits in the middle that were reserved for a device major number. Not very long after I turned dev2unit(), minor(), unit2minor() and minor2unit() into macro's. The unit2minor() and minor2unit() macro's were no-ops. We'd better not remove these four macro's from the kernel, because there is a lot of (external) code that may still depend on them. For now it's harmless to remove all invocations of unit2minor() and minor2unit(). Reviewed by: kib
* Add a new cam_status CAM_SCSI_IT_NEXUS_LOST. This will be used by future ↵sbruno2008-09-181-0/+1
| | | | | | | | | patches for target mode that are forthcoming. Reviewed by: Scott Long MFC after: 2 days
* Fix a locking mistake in daopen(). If the open fails, which can happenscottl2008-08-291-6/+7
| | | | | | | | because the media was removed, the periph would get its refcount dropped and ultimately freed before getting unlocked. This created a dangling pointer that was easy to trip over. This fixes a common source of crashes with removaable media, but problems remain and will get tracked down.
* SCSI_DELAY is specified in milliseconds, not seconds.ken2008-08-161-1/+1
| | | | | Submitted by: Andre Albsmeier <Andre.Albsmeier@siemens.com> MFC after: 1 week
* Update SCSI opcodes and ASCs from t10.org.jkim2008-08-072-1227/+2398
| | | | | | | | | | | | http://www.t10.org/lists/1spc-lst.htm Note opcodes for scanner and communication devices are taken from the previous revision because they are not listed in the files any more. Also, note newly added ASCs are all marked with 'XXX TBD' and take SS_RDEF action for now. Some ASCs need SS_TUR for error recovery or SS_FATAL to prevent further retrials. We should deal with them later. Reviewed by: scottl, ken
* Fix whitespace.emaste2008-08-011-2/+2
|
* Add quirk for the Samsung YP-U3remko2008-07-091-0/+8
| | | | | | | PR: 125398 Submitted by: Tino Engel <goaengel at gmx dot net> Approved by: imp (mentor, implicit) MFC after: 1 week
* Locking in the ses_ioctl handler doesn't have to be so strict becausescottl2008-03-171-21/+25
| | | | | | | | the referenced data is only obtained/changed in the device open handler, and the ioctl handler can only run after the open handler. Also fix a few nearby style issues. Submitted by: Matt Jacob
* When probing a newly found device, don't automatically assume that thescottl2008-02-271-36/+95
| | | | | | | | device supports retrieving a serial number. Instead, first query the list of VPD pages it does support, and only query the serial number if it's supported, else silently move on. This eliminates a lot of noise during verbose booting, and will likely eliminate the need for most NOSERIAL quirks.
OpenPOWER on IntegriCloud