summaryrefslogtreecommitdiffstats
path: root/sys/cam
Commit message (Collapse)AuthorAgeFilesLines
* Fix copy/paste bug, that requests data read during ATA device probe sequencemav2009-08-181-4/+4
| | | | | | | | | for ATA_SETFEATURES/ATA_SF_SETXFER command which by definition transfers no data. Most of controllers are irrelevant to this bug, but some nVidia's doesn't. Tested on: current@ Approved by: re (kib)
* Fix iSCSI initiator and vpo driver operation, broken by CAM changes.mav2009-08-182-0/+3
| | | | | Reviewed by: scottl, Danny Braniss Approved by: re (rwatson)
* Add 8Gb support (isp_2500). Fix a fair number of configuration andmjacob2009-08-012-1/+105
| | | | | | | | | | | | | | | | | | | | | firmware loading bugs. Target mode support has received some serious attention to make it more usable and stable. Some backward compatible additions to CAM have been made that make target mode async events easier to deal with have also been put into place. Further refinement and better support for NP-IV (N-port Virtualization) is now in place. Code for release prior to RELENG_7 has been stripped away for code clarity. Sponsored by: Copan Systems Reviewed by: scottl, ken, jung-uk kim Approved by: re
* Fix copy-paste bug. Use regular non-polled mode for executing FLUSHCACHEmav2009-07-171-2/+3
| | | | | | command on disk close. Approved by: re (implicitly)
* Change xpt_scan_bus to scsi_scan_bus and xpt_scan_lun to scsi_scan_lunemaste2009-07-141-10/+10
| | | | | | in comments and printfs to match new function names after refacoring. Approved by: re
* Fix leaks in probestart, probedone, and scsi_scan_bus. Also freeemaste2009-07-141-3/+8
| | | | | | | | | | page_list using the matching malloc type for the allocation. Approved by: re Reviewed by: scottl [1] MFC after: 1 week [1] Original patch was against xpt_cam.c, prior to the cam refactoring.
* Fix copy-paste bug, enabling SIM PMP support, when it was not really found.mav2009-07-131-1/+1
| | | | Approved by: re (implicitly)
* Rename ATA probe driver to "aprobe" to resolve name conflict with SCSImav2009-07-131-4/+4
| | | | | | and fix loading cam as module. Approved by: re (implicitly)
* Separate the parallel scsi knowledge out of the core of the XPT, andscottl2009-07-1022-2478/+6357
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | modularize it so that new transports can be created. Add a transport for SATA Add a periph+protocol layer for ATA Add a driver for AHCI-compliant hardware. Add a maxio field to CAM so that drivers can advertise their max I/O capability. Modify various drivers so that they are insulated from the value of MAXPHYS. The new ATA/SATA code supports AHCI-compliant hardware, and will override the classic ATA driver if it is loaded as a module at boot time or compiled into the kernel. The stack now support NCQ (tagged queueing) for increased performance on modern SATA drives. It also supports port multipliers. ATA drives are accessed via 'ada' device nodes. ATAPI drives are accessed via 'cd' device nodes. They can all be enumerated and manipulated via camcontrol, just like SCSI drives. SCSI commands are not translated to their ATA equivalents; ATA native commands are used throughout the entire stack, including camcontrol. See the camcontrol manpage for further details. Testing this code may require that you update your fstab, and possibly modify your BIOS to enable AHCI functionality, if available. This code is very experimental at the moment. The userland ABI/API has changed, so applications will need to be recompiled. It may change further in the near future. The 'ada' device name may also change as more infrastructure is completed in this project. The goal is to eventually put all CAM busses and devices until newbus, allowing for interesting topology and management options. Few functional changes will be seen with existing SCSI/SAS/FC drivers, though the userland ABI has still changed. In the future, transports specific modules for SAS and FC may appear in order to better support the topologies and capabilities of these technologies. The modularization of CAM and the addition of the ATA/SATA modules is meant to break CAM out of the mold of being specific to SCSI, letting it grow to be a framework for arbitrary transports and protocols. It also allows drivers to be written to support discrete hardware without jeopardizing the stability of non-related hardware. While only an AHCI driver is provided now, a Silicon Image driver is also in the works. Drivers for ICH1-4, ICH5-6, PIIX, classic IDE, and any other hardware is possible and encouraged. Help with new transports is also encouraged. Submitted by: scottl, mav Approved by: re
* Change the type of uio_resid member of struct uio from int to ssize_t.kib2009-06-251-1/+1
| | | | | | | | Note that this does not actually enable full-range i/o requests for 64 architectures, and is done now to update KBI only. Tested by: pho Reviewed by: jhb, bde (as part of the review of the bigger patch)
* Change cam_periph_ioctl() to take 'cmd' and a u_long instead of anscottl2009-06-222-2/+2
| | | | | | | | | int. All of its callers pass in cmd as a u_long, so this has always been a dangerous type demotion. It was spooted by clang/llvm trying to do a type promotion and sign extension within cam_periph_ioctl. Submitted by: rdivacky
* Include <camlib.h> for cam_path_string().ed2009-06-141-0/+1
| | | | Submitted by: Pawel Worach
* Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. Usekib2009-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | vnode interlock to protect the knote fields [1]. The locking assumes that shared vnode lock is held, thus we get exclusive access to knote either by exclusive vnode lock protection, or by shared vnode lock + vnode interlock. Do not use kl_locked() method to assert either lock ownership or the fact that curthread does not own the lock. For shared locks, ownership is not recorded, e.g. VOP_ISLOCKED can return LK_SHARED for the shared lock not owned by curthread, causing false positives in kqueue subsystem assertions about knlist lock. Remove kl_locked method from knlist lock vector, and add two separate assertion methods kl_assert_locked and kl_assert_unlocked, that are supposed to use proper asserts. Change knlist_init accordingly. Add convenience function knlist_init_mtx to reduce number of arguments for typical knlist initialization. Submitted by: jhb [1] Noted by: jhb [2] Reviewed by: jhb Tested by: rnoland
* 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
OpenPOWER on IntegriCloud