aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/scsi
Commit message (Collapse)AuthorAgeFilesLines
* Implement the usage of Report Luns as part of SCSI probing for SCP3 orMatt Jacob2010-06-081-26/+351
| | | | | | | | | | | | | | better devices. This can be disabled on a per-device basis using quirks as well. This also handles the case where there is actually no connected LUN 0 (which can definitely be the case for storage arrays). Reviewed by: scsi@ MFC after: 1 month Notes: svn path=/head/; revision=208911
* Make additional definitions up to and including SPC-4. Add in definitionsMatt Jacob2010-06-083-131/+276
| | | | | | | | | | | | | for REPORT and SET TARGET PORT GROUP commands (foundations for future work). Regularize opcodes to be upper case hex. Pick *one* of tab or space after #define (tab) and stick with that. MFC after: 2 weeks Notes: svn path=/head/; revision=208905
* redfacedly noting a missing part of a patch.Matt Jacob2010-06-071-0/+1
| | | | | | | | | Pointy Hat To: Me MFC after: 2 Week X-MFC: 208896 Notes: svn path=/head/; revision=208900
* Do a minor amount of stylifying. Also, get a Fibre Channel WWPN if one existsMatt Jacob2010-06-071-2/+27
| | | | | | | for a da unit and create a sysctl OID for it. Notes: svn path=/head/; revision=208896
* scsi_cd: pass correct pointer to free()Andriy Gapon2010-06-041-1/+1
| | | | | | | | | Found with: Coverity Prevent(tm) CID: 2986 MFC after: 4 days Notes: svn path=/head/; revision=208800
* Add a new primitive, XPT_SCAN_TGT, to cover the range between scanning aMatt Jacob2010-05-261-4/+13
| | | | | | | | | | | | | | whole bus (XPT_SCAN_BUS) and a single lun on that bus (XPT_SCAN_LUN). It's less resource comsumptive than scanning a whole bus when the caller knows only one target has changes. Reviewed by: scsi@ Sponsored by: Panasas MFC after: 1 month Notes: svn path=/head/; revision=208582
* Remove unnecessary headers which were inherited from cam_xpt.c withoutMarius Strobl2010-05-201-4/+0
| | | | | | | | | | reason. Reviewed by: mav MFC after: 3 days Notes: svn path=/head/; revision=208348
* Pick up the right change, not it's close cousin. The oneMatt Jacob2010-05-111-2/+4
| | | | | | | | | | | previously submitted was wrong. Point hat: mjacob X-MFC: 207933 MFC after: 1 week Notes: svn path=/head/; revision=207938
* Deal sensibly with more than 26 sg devices. It isn't a completeMatt Jacob2010-05-111-1/+6
| | | | | | | | | | solution. Sponsored by: Panasas MFC after: 1 week Notes: svn path=/head/; revision=207933
* scsi_cd: CD_FLAG_VALID_MEDIA is sufficient to set d_sectorsize andAndriy Gapon2010-04-151-4/+5
| | | | | | | | | | | | | | | | | | d_mediasize CD_FLAG_VALID_TOC is not required for setting those media properties. PR: kern/145385 Submitted by: Juergen Lock <nox@jelal.kn-bremen.de> a slightly different version Tested by: Pavel Sukhoy <sukhoy@ripn.net>, Markus Wild <m.wild@cybernet.ch>, Juergen Lock <nox@jelal.kn-bremen.de>, uqs MFC after: 1 week Notes: svn path=/head/; revision=206648
* Nullify our periph pointer in dacleanup to try and catchMatt Jacob2010-04-021-0/+5
| | | | | | | race conditions in callbacks/downcalls. Notes: svn path=/head/; revision=206112
* Add a couple missing basic mode page codes.Matt Jacob2010-04-011-0/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=206029
* We actually can generate a host number.Matt Jacob2010-03-171-1/+1
| | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=205252
* Virtualize transport part of periph announcement.Alexander Motin2010-02-221-0/+99
| | | | Notes: svn path=/head/; revision=204220
* Make CD driver a bit more robust and predictable to unreported errors.Alexander Motin2010-02-151-17/+13
| | | | Notes: svn path=/head/; revision=203931
* MFp4: Large set of CAM inprovements.Alexander Motin2010-01-287-108/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Unify bus reset/probe sequence. Whenever bus attached at boot or later, CAM will automatically reset and scan it. It allows to remove duplicate code from many drivers. - Any bus, attached before CAM completed it's boot-time initialization, will equally join to the process, delaying boot if needed. - New kern.cam.boot_delay loader tunable should help controllers that are still unable to register their buses in time (such as slow USB/ PCCard/ CardBus devices), by adding one more event to wait on boot. - To allow synchronization between different CAM levels, concept of requests priorities was extended. Priorities now split between several "run levels". Device can be freezed at specified level, allowing higher priority requests to pass. For example, no payload requests allowed, until PMP driver enable port. ATA XPT negotiate transfer parameters, periph driver configure caching and so on. - Frozen requests are no more counted by request allocation scheduler. It fixes deadlocks, when frozen low priority payload requests occupying slots, required by higher levels to manage theit execution. - Two last changes were holding proper ATA reinitialization and error recovery implementation. Now it is done: SATA controllers and Port Multipliers now implement automatic hot-plug and should correctly recover from timeouts and bus resets. - Improve SCSI error recovery for devices on buses without automatic sense reporting, such as ATAPI or USB. For example, it allows CAM to wait, while CD drive loads disk, instead of immediately return error status. - Decapitalize diagnostic messages and make them more readable and sensible. - Teach PMP driver to limit maximum speed on fan-out ports. - Make boot wait for PMP scan completes, and make rescan more reliable. - Fix pass driver, to return CCB to user level in case of error. - Increase number of retries in cd driver, as device may return several UAs. Notes: svn path=/head/; revision=203108
* Remove extraneous semicolons, no functional changes.Martin Blapp2010-01-072-3/+3
| | | | | | | | Submitted by: Marc Balmer <marc@msys.ch> MFC after: 1 week Notes: svn path=/head/; revision=201758
* Remove duplicate devstat_start_transaction_bio() call. It is already calledAlexander Motin2009-12-181-2/+0
| | | | | | | from geom_disk. Dulicate call causes wrong queue depth and busy accounting. Notes: svn path=/head/; revision=200668
* Clear result before requesting XPT_PATH_INQ.Alexander Motin2009-12-091-0/+1
| | | | | | | Many SIMs doesn't fill maxio field yet. Notes: svn path=/head/; revision=200295
* MFp4:Alexander Motin2009-12-061-2/+6
| | | | | | | | | | | | | | | | | | | | | Introduce ATA_CAM kernel option, turning ata(4) controller drivers into cam(4) interface modules. When enabled, this options deprecates all ata(4) peripheral drivers (ad, acd, ...) and interfaces and allows cam(4) drivers (ada, cd, ...) and interfaces to be natively used instead. As side effect of this, ata(4) mode setting code was completely rewritten to make controller API more strict and permit above change. While doing this, SATA revision was separated from PATA mode. It allows DMA-incapable SATA devices to operate and makes hw.ata.atapi_dma tunable work again. Also allow ata(4) controller drivers (except some specific or broken ones) to handle larger data transfers. Previous constraint of 64K was artificial and is not really required by PCI ATA BM specification or hardware. Submitted by: nwitehorn (powerpc part) Notes: svn path=/head/; revision=200171
* Fix several cases where the periph lock was held over malloc.Scott Long2009-12-021-54/+24
| | | | | | | Submitted by: Jaakko Heinonen Notes: svn path=/head/; revision=200036
* MFp4:Alexander Motin2009-11-142-3/+6
| | | | | | | Fix several device freeze counting bugs. Notes: svn path=/head/; revision=199279
* MFp4:Alexander Motin2009-11-111-18/+1
| | | | | | | | | | | | | - Move tagged queueing control from ADA to ATA XPT. It allows to control device command queue length correctly. First step to support < 32 tags. - Limit queue for non-tagged devices by 2 slots for ahci(4) and siis(4). - Implement quirk matching for ATA devices. - Move xpt_schedule_dev_sendq() from header to source file. - Move delayed queue shrinking to the more expected place - element freeing. - Remove some SCSIsms in ATA. Notes: svn path=/head/; revision=199178
* MFp4:Alexander Motin2009-11-041-3/+0
| | | | | | | | | | | | - Remove CAM_PERIPH_POLLED flag. It is broken by design. Polling can't be periph flag. May be SIM, may be CCB, but now it works fine just without it. - Remove check unused for at least five years. If we will ever have non-BIO devices in CAM, this check is smallest of what we will need. - If several controllers complete requests same time, call swi_sched() only once. Notes: svn path=/head/; revision=198899
* Provide the same sanity check on the sector size in dagetcapacity as when theAndrew Thompson2009-11-021-2/+9
| | | | | | | | disk is first probed. dagetcapacity is called whenever the disk is opened from geom via d_open(), a zero sector size will cause geom to panic later on. Notes: svn path=/head/; revision=198832
* MFp4:Alexander Motin2009-11-011-5/+17
| | | | | | | | | | | | Fix reference counting bug, when device unreferenced before then invalidated. To do it, do not handle validity flag as another reference, but explicitly modify reference count each time flag is modified. Discovered by: thompsa Notes: svn path=/head/; revision=198748
* MFp4:Alexander Motin2009-10-313-4/+7
| | | | | | | | | | | | | | | - Reduce code duplication in ATA XPT and PMP driver. - Move PIO size setting from ada driver to ATA XPT. It is XPT business to negotiate transfer details. ada driver is now stateless. - Report PIO size to SIM. It is required for correct PATA SIM operation. - Tune PMP scan timings. It workarounds some problems with SiI. - If reset hapens during PMP initialization - restart it. - Introduce early-initialized periph drivers, which are used during initial scan process. Use it for xpt, probe, aprobe and pmp. It gives pmp chance to finish scan before mountroot and numerate devices in right order. Notes: svn path=/head/; revision=198708
* Replace most of priority numbers with defines. No logical changes.Alexander Motin2009-10-239-72/+72
| | | | Notes: svn path=/head/; revision=198382
* Remove some obsoleted comments.Alexander Motin2009-10-231-13/+0
| | | | Notes: svn path=/head/; revision=198381
* Fix a memory leak in an error case.Christian Brueffer2009-10-221-0/+3
| | | | | | | | | | PR: 138376 Submitted by: Patroklos Argyroudis <argp@census-labs.com> Reviewed by: scottl MFC after: 1 week Notes: svn path=/head/; revision=198356
* Remember to unlock the peripheral prior to notifying the user. Make someMatt Jacob2009-09-191-15/+70
| | | | | | | | | | | | | allocations M_NOWAIT so that we don't try and sleep with a nested non-sleepable lock. This makes the userland scsi_target begin to function again. Obtained from: Sean Bruno MFC after: 1 month Notes: svn path=/head/; revision=197332
* Use C99 initialization for struct filterops.Robert Watson2009-09-121-2/+5
| | | | | | | | | Obtained from: Mac OS X Sponsored by: Apple Inc. MFC after: 3 weeks Notes: svn path=/head/; revision=197134
* Free the correct buffer in an error case.Scott Long2009-09-081-1/+1
| | | | | | | Submitted by: phk Notes: svn path=/head/; revision=196983
* Revert previous commit and add myself to the list of people who shouldPoul-Henning Kamp2009-09-081-1/+1
| | | | | | | know better than to commit with a cat in the area. Notes: svn path=/head/; revision=196970
* Add necessary include.Poul-Henning Kamp2009-09-081-1/+1
| | | | Notes: svn path=/head/; revision=196969
* Make serial numbers of daX disks visible by GEOM.Pawel Jakub Dawidek2009-09-041-0/+2
| | | | | | | | No objections from: scottl Obtained from: Wheel Sp. z o.o. (http://www.wheel.pl) Notes: svn path=/head/; revision=196824
* - Add quirk for Sony DSC digital cameras. This umass devices failStanislav Sedov2009-08-261-0/+8
| | | | | | | | | | | | to attach without these quirks applied. PR: usb/137035 URL: http://lists.freebsd.org/pipermail/freebsd-current/2009-August/010852.html Reported by: Henri Hennebert <hlh@restart.be>, Andrey V. Elsukov <bu7cher@yandex.ru> MFC after: 1 week Notes: svn path=/head/; revision=196568
* Change xpt_scan_bus to scsi_scan_bus and xpt_scan_lun to scsi_scan_lunEd Maste2009-07-141-10/+10
| | | | | | | | | in comments and printfs to match new function names after refacoring. Approved by: re Notes: svn path=/head/; revision=195688
* Fix leaks in probestart, probedone, and scsi_scan_bus. Also freeEd Maste2009-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. Notes: svn path=/head/; revision=195685
* Separate the parallel scsi knowledge out of the core of the XPT, andScott Long2009-07-1010-2/+2413
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=195534
* Change the type of uio_resid member of struct uio from int to ssize_t.Konstantin Belousov2009-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) Notes: svn path=/head/; revision=194990
* Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. UseKonstantin Belousov2009-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 Notes: svn path=/head/; revision=193951
* Remove dead code.Edward Tomasz Napierala2009-05-121-2/+0
| | | | | | | | Found with: Coverity Prevent(tm) CID: 3667 Notes: svn path=/head/; revision=192019
* Add missing 'break' statements.Edward Tomasz Napierala2009-05-121-0/+2
| | | | | | | | | Found with: Coverity Prevent(tm) CID: 3936, 3937 Reviewed by: scottl@ Notes: svn path=/head/; revision=192015
* Get rid of the device index number stored in the sa(4) unit number.Ed Schouten2009-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. Notes: svn path=/head/; revision=191304
* Remove unused SESUNIT() macro from ses(4).Ed Schouten2009-04-181-2/+0
| | | | Notes: svn path=/head/; revision=191243
* Reorder dacleanup() and cdcleanup() slightly so that the sysctl context isJohn Baldwin2009-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 Notes: svn path=/head/; revision=188503
* Adding dynamic sysctls no longer requires Giant.John Baldwin2009-02-102-7/+0
| | | | | | | Submitted by: rdivacky Notes: svn path=/head/; revision=188458
* There is no need to initialize the variable here.Bjoern A. Zeeb2009-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 Notes: svn path=/head/; revision=187957
* Don't leak memory when alloc fails.Edward Tomasz Napierala2009-01-231-3/+3
| | | | | | | | | | | Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Found with: Coverity Prevent(tm) CID: 2908 Notes: svn path=/head/; revision=187651