summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/atapi-cam.c
Commit message (Collapse)AuthorAgeFilesLines
* Make the ATAPI sense data accessible when using the ioctl interfacesos2006-03-311-2/+2
| | | | MFC candidate.
* Normalize a significant number of kernel malloc type names:rwatson2005-10-311-1/+1
| | | | | | | | | | | | | | | | | | | - Prefer '_' to ' ', as it results in more easily parsed results in memory monitoring tools such as vmstat. - Remove punctuation that is incompatible with using memory type names as file names, such as '/' characters. - Disambiguate some collisions by adding subsystem prefixes to some memory types. - Generally prefer lower case to upper case. - If the same type is defined in multiple architecture directories, attempt to use the same name in additional cases. Not all instances were caught in this change, so more work is required to finish this conversion. Similar changes are required for UMA zone names.
* Change the way ioctls are issue to ATA.sos2005-05-161-1/+1
| | | | | | The most prominent part is that its now possible to issue ata_requests directly to say acd0, instead of going through the cumbersome /dev/ata device.
* Take newbusification one step further, ie use the device_t more consequentlysos2005-04-301-28/+28
| | | | | | | all way through the code down the layers, instead of the mix'n'match that resulted from the conversion done earlier. Sponsored by: pair.com
* Move the creation of ata_channel child devices to the channel code.sos2005-04-151-14/+67
| | | | | | | | | This allows to attach to the children (ATA devices) even without a driver being attached. This allows atapi-cam to do its work both with and without the pure ATAPI driver being present. ATA patches by /me ATAPI-cam pathes by Thomas
* Explicity make atapi-cam depend on CAM.scottl2005-04-081-0/+1
| | | | Submitted by: Michal Mertl
* Fix a use-after-free problem in atapi_cb(). Add some necessary synchronizationscottl2005-04-051-4/+13
| | | | | to the XPT_PATH_INQ op. Don't leak locks on failure in XPT_SCSIIO. Correctly fix the CAMDEBUG message.
* Push some faulty debugging aside so LINT compiles.phk2005-04-051-1/+1
|
* Commit ATAPI-CAM for ATAmkIII. Improvements and changes:scottl2005-04-051-151/+186
| | | | | | | | | | | | | | | | | | - newbus plumbing. Each atapicam bus is a child off of a parent ata channel bus. This is somewhat of a hack, but allows the ata core to be completely free of atapicam knowledge. - No more global lists of softc's and no more groping around in internal ata structures on each command. - Giant-free operation of the completion handler. - Per-bus mutex for protecting the busy list and synchronizing detach. - Lots of streamlining and dead code elimination, better adherence to the CAM locking protocol. This feature still requires that the appropriate atapi-* driver be present for each atapi device that you want to talk to (i.e. atapi-cd for cdroms). It does work both compiled into the kernel and as a loadable module. Reviewed by: thomas, sos
* atapicam(4) is currently off by three orders of magnitude regarding thegreen2004-06-171-2/+2
| | | | | | | | | timeout values in the CAM CCBs. Divide by 1000 to get values in seconds which are what ata(4) timeouts internally use. This does lose granularity, though, and small values can now round down to zero. It's probably worth making all ata(4) timeouts in terms of hz/ticks/milliseconds/something.
* Use auto-sense data provided by the lowlevel ATA code.thomas2004-03-041-1/+10
|
* (atapi_cb): Reenable automatic retrieve of sense data on error, makingthomas2004-02-111-14/+21
| | | | | | | it asynchronous to avoid incorrect use of ata_atapicmd within an ATAPI callback. Tested by: harti
* Fixed a memory leak.ru2004-01-181-1/+3
|
* Use UMA instead of plain malloc for getting ATA request storage.sos2004-01-141-0/+1
| | | | | | | This gives +10% performance on simple tests, so definitly worth it. A few percent more could be had by not using M_ZERO'd alloc's, but we then need to clear fields all over the place to be safe, and that was deemed not worth the trouble (and it makes life dangerous).
* #include sema.h is now required.sos2004-01-121-0/+1
|
* Fix a potential problem with atapi-cam where an incorrect flag is passedscottl2003-12-051-1/+1
| | | | | | into the ata queueing layer. Approved by: re
* Centralise mode setting. Instead of doing it in all subdrivers, dosos2003-11-111-5/+0
| | | | | | it in ata-all.c where it belongs. Prime controller HW by always setting PIO mode first in attach.
* Free the ata_request struct after we are done using it. This should stopscottl2003-11-091-2/+9
| | | | the memory leak seen when using ATAPICAM.
* Enable DMA for ATAPI/CAM input/output operations.thomas2003-09-241-3/+10
| | | | Reviewed by: scottl
* (atapi_cb): Reorganize error handling circuitry.thomas2003-09-211-17/+19
| | | | | | Fix to the messages output under CAM_DEBUG_CCB: the summary sense information (error bits and sense key) is in the error field, not in the result field, of struct ata_request. No other functional change.
* (atapi_cb): Disable autosense for now as it causes a missed ATA interrupt.thomas2003-09-211-2/+8
| | | | Minor reformatting.
* (atapi_action): avoid memory leak in a marginal invalid ccb case.thomas2003-09-191-25/+30
| | | | | (free_hcb): defend against calling TAILQ_REMOVE on an hcb that was not inserted on pending_hcbs.
* (atapi_action, case XPT_PATH_INQ): Handle properly the case ofthomas2003-09-111-2/+5
| | | | | | | | | CAM_TARGET_WILDCARD (target_id_t is an unsigned integer type). Fixes boot-time crash on Alpha. Reviewed by: roberto Approved by: re (murray) MFC after: 1 week
* Add missing braces. Fixes boot-time kernel panic with ATAng and ATAPI/CAM.thomas2003-08-281-1/+2
| | | | Reviewed by: roberto
* Use __FBSDID().obrien2003-08-241-2/+3
| | | | Also some minor style cleanups.
* This is a major rework of the ATA driver (ATAng)sos2003-08-241-77/+151
| | | | | | | | | | | | | | | | | | | | | | Restructure the way ATA/ATAPI commands are processed, use a common ata_request structure for both. This centralises the way requests are handled so locking is much easier to handle. The driver is now layered much more cleanly to seperate the lowlevel HW access so it can be tailored to specific controllers without touching the upper layers. This is needed to support some of the newer semi-intelligent ATA controllers showing up. The top level drivers (disk, ATAPI devices) are more or less still the same with just corrections to use the new interface. Pull ATA out from under Gaint now that locking can be done in a sane way. Add support for a the National Geode SC1100. Thanks to Soekris engineering for sponsoring a Soekris 4801 to make this support. Fixed alot of small bugs in the chipset code for various chips now we are around in that corner anyways.
* Add a PATH_INQ flag, PIM_NO_6_BYTE, which indicates the SIM never wishes tonjl2003-07-281-1/+1
| | | | | | | | | | receive 6 byte commands. Add a check for this flag to da(4) and cd(4) so that they honor it. This is a quick workaround for many devices (especially USB) that require da(4) quirks to operate. The more complete approach is to finish the new transport code which will be aware of the SCSI version a transport implements. MFC after: 1 day
* Merge common XPT_CALC_GEOMETRY functions into a single convenience function.njl2003-06-141-19/+1
| | | | | | | | | | | | | Devices below may experience a change in geometry. * Due to a bug, aic(4) never used extended geometry. Changes all drives >1G to now use extended translation. * sbp(4) drives exactly 1 GB in size now no longer use extended geometry. * umass(4) drives exactly 1 GB in size now no longer use extended geometry. For all other controllers in this commit, this should be a no-op. Looked over by: scottl
* In atapi_cam_reinit_bus, only call reinit_bus if the ATAPI channelthomas2003-05-141-1/+8
| | | | | | | | | | | has already been registered with ATAPI/CAM (else there is nothing to do). atapi_cam_reinit_bus may be called before the bus is registered if an ATAPI command times out during the boot sequence. PR: i386/51421 Reviewed by: roberto Approved by: re (rwatson) MFC after: 1 week
* Centralize the devstat handling for all GEOM disk device driversphk2003-03-081-1/+0
| | | | | | | | in geom_disk.c. As a side effect this makes a lot of #include <sys/devicestat.h> lines not needed and some biofinish() calls can be reduced to biodone() again.
* Zero cpi->target_sprt since atapi-cam does not support target mode. Thisnjl2003-02-271-0/+1
| | | | | | | gets rid of annoying messages when targbh tries to attach to the ATA bus and gets rejected. MFC after: 1 day
* Fix ATAPI/USB/Firewire CDROM drive handling in cd(4) and hopefully fixken2003-02-211-30/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a number of related problems along the way. - Automatically detect CDROM drives that can't handle 6 byte mode sense and mode select, and adjust our command size accordingly. We have to handle this in the cd(4) driver (where the buffers are allocated), since the parameter list length is different for the 6 and 10 byte mode sense commands. - Remove MODE_SENSE and MODE_SELECT translation removed in ATAPICAM and in the umass(4) driver, since there's no way for that to work properly. - Add a quirk entry for CDROM drives that just hang when they get a 6 byte mode sense or mode select. The reason for the quirk must be documented in a PR, and all quirks must be approved by ken@FreeBSD.org. This is to make sure that we fully understand why each quirk is needed. Once the CAM_NEW_TRAN_CODE is finished, we should be able to remove any such quirks, since we'll know what protocol the drive speaks (SCSI, ATAPI, etc.) and therefore whether we should use 6 or 10 byte mode sense/select commands. - Change the way the da(4) handles the no_6_byte sysctl. There is now a per-drive sysctl to set the minimum command size for that particular disk. (Since you could have multiple disks with multiple requirements in one system.) - Loader tunable support for all the sysctls in the da(4) and cd(4) drivers. - Add a CDIOCCLOSE ioctl for cd(4) (bde pointed this out a long time ago). - Add a media validation routine (cdcheckmedia()) to the cd(4) driver, to fix some problems bde pointed out a long time ago. We now allow open() to succeed no matter what, but if we don't detect valid media, the user can only issue CDIOCCLOSE or CDIOCEJECT ioctls. - The media validation routine also reads the table of contents off the drive. We use the table of contents to implement the CDIOCPLAYTRACKS ioctl using the PLAY AUDIO MSF command. The PLAY AUDIO TRACK INDEX command that we previously used was deprecated after SCSI-2. It works in every SCSI CDROM I've tried, but doesn't seem to work on ATAPI CDROM drives. We still use the play audio track index command if we don't have a valid TOC, but I suppose it'll fail anyway in that case. - Add _len() versions of scsi_mode_sense() and scsi_mode_select() so that we can specify the minimum command length. - Fix a couple of formatting problems in the sense printing code. MFC after: 4 weeks
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Fill in missing parts of the ATAPI/CAM XPT: implement XPT_RESET_BUSthomas2002-10-221-14/+47
| | | | | | | | | | | | | | and XPT_RESET_DEV. In order to properly handle reset requests whether they originate in the ATA layer (atacontrol reinit) or from the CAM layer (camcontrol reset) ata_reinit does not cause the SIM to be deallocated anymore. The SIM is now unconditionnally created for each ATAPI bus. This change may cause existing bus ids to change on some setups. Reviewed by: roberto Approved by: sos
* Be consistent about "static" functions: if the function is markedphk2002-09-281-1/+1
| | | | | | static in its prototype, mark it static at the definition too. Inspired by: FlexeLint warning #512
* Change a couple of splcam() calls that do not make sense in atapi-camthomas2002-09-121-3/+5
| | | | | | | | | | (what we want to mask is the ATA interrupts, which run at level splbio), and add interrupt masking around the statement that modifies the request queue for a SIM. This resolves problems reported by users under heavy ATAPI load. Reviewed by: roberto
* printf -> CAM_DEBUG so debugging prints are tunable.njl2002-08-281-60/+47
| | | | MFC after: 1 week
* Use csio pointer instead of dereferencing hcb.njl2002-08-281-5/+5
| | | | MFC after: 1 week
* Fix typo.sos2002-08-191-1/+1
|
* Shut up warning in debug code.sos2002-08-121-5/+5
|
* Fix the GET_TRAN_SETTINGS and SET_TRAN_SETTINGS ops to be more correct.scottl2002-08-101-8/+7
|
* Minor corrections.sos2002-08-101-13/+3
| | | | Suggested by: scottl <Scott Long>
* Add the ability to use ATAPI devices via CAM.sos2002-08-091-0/+712
The CAM<>ATAPI layer was submitted by "Thomas Quinot <thomas@cuivre.fr.eu.org>" changes form the version on the net by me (formatting, ability to be used alone without the ATAPI native device driver, proper speed reporting...) See /sys/conf/NOTES for usage. Submitted by: Thomas Quinot <thomas@cuivre.fr.eu.org>
OpenPOWER on IntegriCloud