summaryrefslogtreecommitdiffstats
path: root/sys/cam
Commit message (Collapse)AuthorAgeFilesLines
* Style nit.pjd2005-12-191-2/+2
|
* Allow to use TransFlash drive, which can be found in Motorola E398 Mobile Phone.pjd2005-12-191-0/+9
| | | | | | PR: usb/89889 Submitted by: Wojciech A. Koszek <dunstan@freebsd.czest.pl> MFC after: 1 week
* Fix a bug that caused some /dev entries to continue to exist afterjdp2005-11-182-0/+2
| | | | | | | | | | | | | | | | | | | | | | | the underlying drive had been hot-unplugged from the system. Here is a specific example. Filesystem code had opened /dev/da1s1e. Subsequently, the drive was hot-unplugged. This (correctly) caused all of the associated /dev/da1* entries to be deleted. When the filesystem later realized that the drive was gone it closed the device, reducing the write-access counts to 0 on the geom providers for da1s1e, da1s1, and da1. This caused geom to re-taste the providers, resulting in the devices being created again. When the drive was hot-plugged back in, it resulted in duplicate /dev entries for da1s1e, da1s1, and da1. This fix adds a new disk_gone() function which is called by CAM when a drive goes away. It orphans all of the providers associated with the drive, setting an error condition of ENXIO in each one. In addition, we prevent a re-taste on last close for writing if an error condition has been set in the provider. Sponsored by: Isilon Systems Reviewed by: phk MFC after: 1 week
* Make the exploring of all luns supported by an HBA more of amjacob2005-09-161-5/+38
| | | | | | | | | | | | | | | tunable (until we get REPORT LUNS in place). If we're probing luns, and each probe succeeds, we keep going past lun 7 if we're a SCSI3 or better device (until we fail to probe). If we're probing luns, and a probe fails, we only keep going if we're quirked *for* it (CAM_QUIRK_HILUNS), and if we're not quirked *against* it (CAM_QUIRK_NOHILUNS), or we're a SCSI3 or better device and the tunable (kern.cam.cam_srch_hi) is set non-zero. Reviewed by: nate@rootlabs.org, gibbs@scsiguy.com, ken@kdm.com, scottl@samsco.org MFC after: 1 week
* Merge the dev_clone and dev_clone_cred event handlers into a singlerwatson2005-08-081-3/+4
| | | | | | | | | | | | | event handler, dev_clone, which accepts a credential argument. Implementors of the event can ignore it if they're not interested, and most do. This avoids having multiple event handler types and fall-back/precedence logic in devfs. This changes the kernel API for /dev cloning, and may affect third party packages containg cloning kernel modules. Requested by: phk MFC after: 3 days
* Fix the recent panics/LORs/hangs created by my kqueue commit by:ssouhlal2005-07-011-1/+1
| | | | | | | | | | | | | | | | | - Introducing the possibility of using locks different than mutexes for the knlist locking. In order to do this, we add three arguments to knlist_init() to specify the functions to use to lock, unlock and check if the lock is owned. If these arguments are NULL, we assume mtx_lock, mtx_unlock and mtx_owned, respectively. - Using the vnode lock for the knlist locking, when doing kqueue operations on a vnode. This way, we don't have to lock the vnode while holding a mutex, in filt_vfsread. Reviewed by: jmg Approved by: re (scottl), scottl (mentor override) Pointyhat to: ssouhlal Will be happy: everyone
* - Providing fine-grained malloc statistic by replacing M_DEVBUF withavatar2005-07-019-66/+98
| | | | | | | | | | | | | module-specific malloc types. These should help us to pinpoint the possible memory leakage in the future. - Implementing xpt_alloc_ccb_nowait() and replacing all malloc/free based CCB memory management with xpt_alloc_ccb[_nowait]/xpt_free_ccb. Hopefully this would be helpful if someday we move the CCB allocator to use UMA instead of malloc(). Encouraged by: jeffr, rwatson Reviewed by: gibbs, scottl Approved by: re (scottl)
* Fixing a memory leak in xpt_release_device(), which can be quicklyavatar2005-06-241-0/+2
| | | | | | | | | | | | | | | | (depends on how many memory you have) observed through "tar -tvf /dev/sa0." Without this patch, RELENG_5 and HEAD panics with something like: kmem_malloc(4096): kmem_map too small: 42258432 total allocated RELENG_4 doesn't panic but spews following errors: camq_init: - cannot malloc array! Reviewed by: gibbs, scottl Approved by: re (scottl) MFC after: 3 days
* Add a quirk for my pen-drive.pjd2005-06-091-0/+8
|
* Do not initialize path variable with useless value just beforekan2005-05-111-1/+0
| | | | | | xpt_create_path overwrites it anyway. Noticed by: Coverity Prevent analysis tool
* Add quirk for TEAC USB floppy drives.dwhite2005-05-051-0/+7
|
* Make sure we look at the correct sub op codes whenmjacob2005-04-141-3/+22
| | | | | | | | deciding whether it's an operation we can perform via the control device. PR: kern/72010 MFC after: 1 week
* Take constructive advice from njl && reformatmjacob2005-04-141-0/+6
| | | | previously added quirks slightly.
* Quirk for ZICPlay USB MP3 Player.njl2005-04-141-0/+8
| | | | | PR: kern/75057 Submitted by: Aurelien Nephtali <aurelien.nephtali wanadoo.fr>
* Apply quirk.mjacob2005-04-141-0/+4
| | | | | | PR: 57469 Submitted by: walter@pelissero.de MFC after: 1 week
* Applied conservative version of suggested quirk.mjacob2005-04-141-0/+7
| | | | | | PR: 57468 Submitted by: walter@pelissero.de MFC after: 1 week
* Apply quirk suggested by submitter.mjacob2005-04-141-1/+1
| | | | | | PR: 75486 Submitted by: no_bs@web.de MFC after: 1 week
* The divide by zero panic must have been due to a bogusmjacob2005-04-141-0/+9
| | | | | | | | | period value. I suppose the BT adapter driver should be fixed, but more importantly we should protect against dividing by zero. PR: kern/75603 MFC after: 1 week
* avoid use after freesam2005-03-311-8/+8
| | | | | | Submitted by: gibbs Reviewed by: mdodd Approved by: Coverity Prevent analysis tool
* avoid use after freesam2005-03-311-1/+1
| | | | | | Submitted by: gibbs Reviewed by: mdodd Noticed by: Coverity Prevent analysis tool
* Explicitly hold a reference to the cdev we have just cloned. Thisphk2005-03-311-0/+1
| | | | | closes the race where the cdev was reclaimed before it ever made it back to devfs lookup.
* Fix a problem with the cd(4) driver -- the CAMGETPASSTHRU ioctl wouldn'tken2005-03-261-1/+7
| | | | | | | | | | | | succeed if there was no media in the drive. This was broken in rev 1.72 when the media check was added to cdioctl(). For now, check the ioctl group to decide whether to check for media or not. (We only need to check for media on CD-specific ioctls.) Reported by: bland MFC after: 3 days
* Fix a place where we were referencing a pointer after it had been freed.ken2005-03-261-0/+2
| | | | | Submitted by: "Henry Miller" <hank@blackhole.com> MFC after: 3 days
* Restore queue depth settings across tag disable events. The system oftengibbs2005-03-231-2/+13
| | | | | | | | | | | | | | | | disables tag queuing temporarily in order to allow controllers a window to safely perform transfer negotiation with non-compliant devices. Before this change, CAM would restore the queue depth to the controller specified maximum or device quirk level rather than any depth determined by reactions to QUEUE FULL/BUSY events or an explicit user setting. During device probe, initialize the flags field for XPT_SCAN_BUS. The uninitialized value often confused CAM into not bothering to issue an AC_FOUND_DEVICE async event for new devices. The reason this bug wasn't reported earlier is that CAM manually announces devices after the initial system bus scans. MFC: 3 days
* Don't free the SIM object twice.scottl2005-03-191-1/+0
| | | | Submitted by: Coverity Prevent analysis tool
* Reference a pointer correctly when copying to it's location.scottl2005-02-211-1/+1
| | | | Submitted by: Coverity Prevent analysis tool
* Check the correct periph pointer after search for it.scottl2005-02-201-1/+1
| | | | Submitted by: Coverity Prevent analysis tool
* Protect against trying to free a non-existant peripheral.scottl2005-02-201-0/+4
| | | | | Submitted by: Coverity Prevent analysis tool MFC After: 3 days
* Remove a shadow declaration of 'error' that caused certain tests to bescottl2005-02-121-1/+0
| | | | | | pointless. Submitted by: Coverity Prevent analysis tool
* Provide locking for the ccb_bioq. This allows xpt_done() to be called withoutscottl2005-02-091-5/+22
| | | | | | | | | | | Giant held. In camisr(), move the ccb_bioq elements to a temporary local list and then process the elements off of that list. This enables the list to be processed by only taking the ccb_bioq_lock once and only for a very short time. ccb_bioq_lock is a leaf mutex, so it's fine to call xpt_done() with other locks held. This is just a very minor step in the work to lock CAM, but it allows us to avoid some messy locking/unlock dances in certain drivers.
* Boot away another stackgap (one of the lest ones in linuxlator/i386) bysobomax2005-01-301-3/+11
| | | | | | | | | | providing special version of CDIOCREADSUBCHANNEL ioctl(), which assumes that result has to be placed into kernel space not user space. In the long run more generic solution has to be designed WRT emulating various ioctl()s that operate on userspace buffers, but right now there is only one such ioctl() is emulated, so that it makes little sense. MFC after: 2 weeks
* Add quirk for easyRAID ER5 alias areca ARC-6010.mr2005-01-251-0/+5
| | | | | | | It reports itself as SCSI-3 but doesnt like getting probed on high luns because it hangs hard after finding itself again on lun 32... Suggested by: Kenneth Merry
* This is a somewhat imperfect means to try and bring FreeBSD forward inmjacob2005-01-221-3/+13
| | | | | | | | | | | | | | | | | | | | | | its ability to automatically scan and attach luns for modern storage which has luns in the 0..1000 range, not 0..7. The correct thing would be to do REPORT LUNS for devices whose LUN0 version shows a version >= SCSI3, but lacking that we should be able to search higher than LUN 7 if we're >= SCSI3 with no ill effects. This change keeps all of the QUIRK_HILUNS quirks, obeys the QUIRK_NOLUNS, and introduces a QUIRK_NOHILUNS which will keep searches above LUN 7 happening for devices that report >= SCSI3 compliance. I doubt the latter will be needed, but you never know. This allowed me to randomly scan and attach > 500 disks at a time in a situation where quirking for QUIRK_HILUNS wasn't practical (the vendor id and product id changes of the virtualization changes constantly). Reviewed by: ken@freebsd.org, scottl@freebsd.org, gibbs@freebsd.org MFC after: 2 weeks
* Don't pass unadulterated unit numbers to make_dev and its ilk- if youmjacob2005-01-222-5/+6
| | | | | | | have more than 256 units, you die. Horribly. Convert them using unit2minor. MFC after: 1 week
* Start each of the license/copyright comments with /*-imp2005-01-0539-43/+43
|
* Correct another location where inquiry length as calculated from thegibbs2004-11-181-3/+5
| | | | | | inquiry additional length field is off by one. MFC: 3 days
* Correct an off-by-one in the calculation of the inquiry buffer lengthgibbs2004-11-181-1/+11
| | | | | | | | | | | | | | | | | to request from devices during the "long inquiry" portion of our probe. This same bug was fixed in the 4.x stream a few years ago, but the fix was never propogated to -current. This fix is slightly different than in -stable: o Use offsetof() instead of a hard coded constant so as the make the code more self-explainatory. o Round odd long inquiry lengths up so as to avoid tickling ignore wide residue bugs in broken parallel SCSI devices running with a wide transfer negotiation. MFC: 3 days
* Remove references to the second byte of a CCB containing the LUN, as thisbms2004-10-131-4/+4
| | | | | | | | is valid only for SCSI-2 and older devices. Rename the second byte of the VERIFY CCB from 'lun' to 'byte2'. Submitted by: ken MFC after: 2 weeks
* Add necessary data structures and definitions for the 12-byte SCSIbms2004-10-121-0/+79
| | | | | | | | commands READ_FORMAT_CAPACITIES, WRITE_AND_VERIFY, and VERIFY. Reviewed by: ken, scottl Source: USB Mass Storage UFI Specification v1.0 MFC after: 2 weeks
* Remove the camnet swi and CAM_PERIPH_NET. It has never been used, and givenscottl2004-10-052-14/+4
| | | | | that netowrk-over-scsi never really took off, there is little chance that it will ever be needed.
* For removable devices without media we set a zero mediasize but a non-zerophk2004-09-051-1/+1
| | | | | | | | sectorsize in order to avoid a lot of checks around various divisions etc. Enforce the sectorsize being > 0 with a KASSERT on successful open. Fix scsi_cd.c to return 2k sectors when no media inserted.
* Correct a typo in a comment: alloation->allocationgibbs2004-08-301-1/+1
| | | | Reported by: Jens Schweikhardt <schweikh@schweikhardt.net>
* Remove the HW_WDOG option; it serves no purpose.des2004-08-291-4/+0
| | | | MFC after: 3 days
* Add locking to the kqueue subsystem. This also makes the kqueue subsystemjmg2004-08-151-21/+5
| | | | | | | | | | | | | a more complete subsystem, and removes the knowlege of how things are implemented from the drivers. Include locking around filter ops, so a module like aio will know when not to be unloaded if there are outstanding knotes using it's filter ops. Currently, it uses the MTX_DUPOK even though it is not always safe to aquire duplicate locks. Witness currently doesn't support the ability to discover if a dup lock is ok (in some cases). Reviewed by: green, rwatson (both earlier versions)
* When printing out an unknown sense code we should print it in hex, notmjacob2004-08-131-3/+1
| | | | | | decimal. Reviewed by: gibbs, nate, kdm
* add support Frontier Labs NEX IA+ Digital Audio Player with USB CF card ↵sanpei2004-08-121-1/+9
| | | | | | | | reader/writer PR: kern/70158 Submitted by: Bernd Strau. <no_bs@web.de> MFC after: 1 week
* Add support iRiver iFP MP3 playersanpei2004-08-081-0/+8
| | | | | | | | PR: kern/54881, i386/63941, kern/66124 Submitted by: Magnus <bsdhead.at.spray.dot.se@FreeBSD.org>, Dmitry Dyomin <old@old.com.ua>, Dmitry Sivachenko <mitya@demos.su> MFC after: 1 week
* Quirk for SEGRAND NP-900 USB MP3Playersanpei2004-07-181-0/+8
| | | | | | PR: kern/64563 Submitted by: Kunitada Kokubun <unix_grandy@yahoo.co.jp> MFC after: 1 week
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPphk2004-07-152-0/+4
| | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything".
* Update for the KDB framework:marcel2004-07-101-1/+2
| | | | o Call kdb_enter() instead of Debugger().
OpenPOWER on IntegriCloud