summaryrefslogtreecommitdiff
path: root/sys/cam
Commit message (Collapse)AuthorAgeFilesLines
* MFC rev. 1.86:Thomas Quinot2003-10-211-2/+6
| | | | | | | | | | (cdcleanup,cdsysctlinit): Defend against calling sysctl_ctx_free on an uninitialized sysctl_ctx. Approved by: re (murray) Notes: svn path=/stable/4/; revision=121319
* MFC rev. 1.160:Thomas Quinot2003-10-211-2/+5
| | | | | | | | | | (dacleanup, dasysctlinit): Defend against calling sysctl_ctx_free on an uninitialized sysctl_ctx. Approved by: re (murray) Notes: svn path=/stable/4/; revision=121318
* MFC: Move dynamic sysctl(8) variable creation for the cd(4) and da(4)Kenneth D. Merry2003-09-102-43/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers out of cdregister() and daregister(), which are run from interrupt context. Files/revisions merged: scsi_da.c: 1.157, 1.158 scsi_cd.c: 1.81 subr_taskqueue.c: 1.17 taskqueue.h: 1.8 cd.4: 1.33 da.4: 1.42 cd.9: 1.18 not merged: taskqueue.9 rev 1.7, 1.8 (not in RELENG_4) This code is necessarily a little bit different than the version committed to -current, mainly in the area of mutexes. (Which become splfoo() in -stable.) The sysctl code does blocking mallocs (M_WAITOK), which causes problems if malloc(9) actually needs to sleep. (And causes a panic for people running with INVARIANTS turned on.) The eventual fix for this issue will involve moving the CAM probe process inside a kernel thread. For now, though, I have fixed the issue by moving dynamic sysctl variable creation for these two drivers to a task queue running in a kernel thread. The existing task queue in -stable (taskqueue_swi) runs in software interrupt handlers, which wouldn't fix the problem at hand. So I have created a new task queue, taskqueue_thread, that runs inside a kernel thread. scsi_cd.c: Remove sysctl variable creation code from cdregister(), and move it to a new function, cdsysctlinit(). Queue cdsysctlinit() to the taskqueue_thread taskqueue once we have fully registered the cd(4) driver instance. scsi_da.c: Remove sysctl variable creation code from daregister(), and move it to move it to a new function, dasysctlinit(). Queue dasysctlinit() to the taskqueue_thread taskqueue once we have fully registered the da(4) instance. taskqueue.h: Declare the new taskqueue_thread taskqueue, update some comments. subr_taskqueue.c: Create the new kernel thread taskqueue. cd.4: Update the cd(4) man page to talk about the minimum command size sysctl/loader tunable. Also note that the changer variables are available as loader tunables as well. da.4: Update the da(4) man page to cover the retry_count, default_timeout and minimum_cmd_size sysctl variables/loader tunables. Remove references to /dev/r???, they aren't used any longer. cd.9: Update the cd(9) man page to describe the CD_Q_10_BYTE_ONLY quirk. Approved by: re (scottl, murray) Notes: svn path=/stable/4/; revision=119934
* More vm_offset_t -> vm_paddr_t conversions in kernel dump related code.Luoqi Chen2003-08-311-2/+2
| | | | | | | | | | | This is functionally a no-op. If you have 4G or more memory, most likely you will still have problem with dumping since PCI device windows are not currently excluded. Approved by: re Notes: svn path=/stable/4/; revision=119598
* Sort quirks. MFC IntelligentStick quirk. At this point, all da(4) quirksNate Lawson2003-08-251-19/+31
| | | | | | | | | | | | are the same for -current and -stable. Also, temporarily re-enable all USB floppy quirks for 4.9R. Although I received no input whether or not these devices work without the quirks, installs often depend on USB floppies and it is unacceptable for them to be broken for a release. They will be disabled again after the release. Notes: svn path=/stable/4/; revision=119463
* Remove all USB 6-byte quirks as the da(4) driver no longer generatesNate Lawson2003-08-251-159/+16
| | | | | | | 6-byte commands for umass(4) devices. Notes: svn path=/stable/4/; revision=119460
* MFC USB device quirks: rev 1.152, 1.153, 1.154Nate Lawson2003-08-251-9/+33
| | | | Notes: svn path=/stable/4/; revision=119457
* MFC: Fix ATAPI/USB/Firewire CDROM drive handling in cd(4) and hopefullyKenneth D. Merry2003-08-245-418/+1309
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix a number of related problems along the way. Files/revisions merged: scsi_cd.c: 1.72, 1.77, 1.80 scsi_all.c: 1.39 (partial) scsi_all.h: 1.22 scsi_cd.h: 1.7 scsi_da.c: 1.139 atapi-cam.c: 1.13 not merged: umass.c rev 1.76 (doesn't apply to -stable) Because of the differences between -current and -stable, some of these changes are not identical to the ones in -current. Most notably, cd(4) in -stable uses the slice code, whereas cd(4) in -current has no disklabel support at all. So there is extra code in the -stable version of these patches to handle that. - 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 in ATAPICAM, since there's no way for that to work properly. - Merge support for sending a path inquiry CCB to see if the SIM has set the PIM_NO_6_BYTE flag. (scsi_cd.c rev 1.80) - 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. In most cases, the PIM_NO_6_BYTE flag set by the SIM driver should eliminate the need for a quirk. - 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. For -stable, open() will still fail if there is no media in the drive. This is because of issues with the slice code handling media changing underneath it. If bde and I can get those issues worked out, there is basic code in this set of patches to handle allowing the CDIOCCLOSE and CDIOCEJECT ioctls without media in the drive. - 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. Approved by: re Notes: svn path=/stable/4/; revision=119386
* [MFC]Noriaki Mitsunaga2003-08-091-11/+11
| | | | | | | | | | We do not need `\n' for panic(). cam/scsi/scsi_low.c: 1.15 -> 1.16 dev/ct/ct.c: 1.5 -> 1.6 Notes: svn path=/stable/4/; revision=118690
* MFC 1.150: Remove unused cmd6workaround() calls.Nate Lawson2003-08-071-15/+2
| | | | Notes: svn path=/stable/4/; revision=118629
* Deprecate USB quirks. We should now never send 6 byte commandsNate Lawson2003-08-071-1/+3
| | | | | | | | | | to such devices. If a device fails due to this commit, add: options DA_OLD_QUIRKS to the kernel config and recompile. Then send the output of "camcontrol inquiry da0" to scsi@freebsd.org so the quirk can be re-enabled. Notes: svn path=/stable/4/; revision=118571
* MFC: Add PIM_NO_6_BYTE to hba_misc. USB, firewire, and ATAPI-CAM driversNate Lawson2003-07-292-1/+13
| | | | | | | | | | set this flag to indicate they do not wish to receive 6 byte commands. The da(4) driver now honors this flag. Note that the cd(4) portion of the commit is not MFCd now because it depends on other code which needs to be MFCd first. Notes: svn path=/stable/4/; revision=118139
* Quirk for OTi usb key. MFC of 1.143Nate Lawson2003-05-171-0/+8
| | | | Notes: svn path=/stable/4/; revision=115112
* MFC: 1.138 Various quirksNate Lawson2003-04-291-1/+35
| | | | Notes: svn path=/stable/4/; revision=114235
* Add a quirk for the Sony Memory Stick adapter for the CLIE series. ThisNate Lawson2003-04-271-0/+8
| | | | | | | has been in -current for a while but was never MFCd. Notes: svn path=/stable/4/; revision=114127
* MFC SanDisk ImageMate quirkNate Lawson2003-03-141-0/+8
| | | | | | | Approved by: re (jhb) Notes: svn path=/stable/4/; revision=112221
* MFC USB and SCSI quirks for Optio230 camera. The USB quirk is in a slightlyNate Lawson2003-03-141-0/+9
| | | | | | | | | different format than the one in -current but they have the same effect. Approved by: re (jhb) Notes: svn path=/stable/4/; revision=112220
* MFC: 1.118, 1.121, 1.124. Quirks for various USB devicesNate Lawson2003-03-091-0/+24
| | | | Notes: svn path=/stable/4/; revision=112023
* MFC: New SCSI target emulator codeNate Lawson2003-02-182-2062/+864
| | | | | | | | | | | | | | | | | | This code allows a user program to enable target mode on a SIM and then emulate any number of devices (disks, tape drives, etc.) All decisions about device behavior (UA, CA, inquiry response) are left to the usermode program and the kernel driver is merely a conduit for CCBs. This enables multiple concurrent target emulators, each using its own backing store and IO model. Also included is a user program that emulates a disk (RBC) using a file as a backing store. This provides functionality similar to md(4) at the CAM layer. Approved by: re (scottl) Notes: svn path=/stable/4/; revision=111098
* MFC vmapbuf()/userland race. vmapbuf() can block, allowing another userlandMatthew Dillon2003-01-251-2/+15
| | | | | | | | process or thread to change a mapping or resize a file. vmapbuf() Now returns an error which callers check. Notes: svn path=/stable/4/; revision=109824
* MFC: aic7xxx and aic79xx driversJustin T. Gibbs2003-01-201-0/+8
| | | | Notes: svn path=/stable/4/; revision=109604
* MFC rev. 1.116, 1.117:Yaroslav Tykhiy2002-12-201-0/+2
| | | | | | | | Clear the "device open" flag and release the peripheral if returning a error from daopen(). Notes: svn path=/stable/4/; revision=108130
* MFC: The HP DAT 40 tape drive should be able to handle variable blockTom Rhodes2002-12-171-0/+4
| | | | | | | | | | | | sizes. But for some reason the block size is different when a different type of tape is placed in the drive. This commit fixes that. PR: 46209 Submitted by: Alex Wang <alex@alexwang.com> Approved by: mjacob Notes: svn path=/stable/4/; revision=107973
* Correct an off by one in the calculation of the "full inquiry length".Justin T. Gibbs2002-12-091-10/+21
| | | | | | | | | | | | | | | Although the SCSI spec indicates that the "additional length field" of the inquiry data is "n - 4", n is an index to the last byte of inquiry data, not the length of data. For length calculations, use 5, not 4. In xpt_set_transfer_settings, never attempt U320 transfer speeds if the information transfer units capability is not supported by the device. The SPI4 spec precludes running any PACED transfer speed without IUTs. Reviewed by: scottl, ken Notes: svn path=/stable/4/; revision=107714
* MFC: support old behavior for CDRIOC*SPEED ioctlsNate Lawson2002-11-251-0/+6
| | | | Notes: svn path=/stable/4/; revision=107222
* MFC: 1.112-1.114 Quirk cleanups and two small whitespace changesNate Lawson2002-11-231-4/+4
| | | | Notes: svn path=/stable/4/; revision=107195
* Fix cdrunccb for -stable usage (SF_RETRY_SELTO instead of CAM_RETRY_SELTO)Nate Lawson2002-11-201-2/+2
| | | | | | | Pointed out by: bsd Notes: svn path=/stable/4/; revision=107097
* MFC:Nate Lawson2002-11-202-0/+58
| | | | | | | | | | * Add CDRIOC{READ,WRITE}SPEED ioctls to cd(4). Units are in KB/sec. * Change atapi-cd ioctls to use the same units. * Change burncd, cdcontrol to convert CDROM speed to KB/sec before calling the ioctl. Add a "max" speed option for their command lines. Notes: svn path=/stable/4/; revision=107093
* MFC 1.111 and 1.113 - whitespace cleanup and USB camera quirkNate Lawson2002-11-121-4/+14
| | | | | | | PR: kern/41010 Notes: svn path=/stable/4/; revision=106787
* MFC several quirks and add a PR reference to an earlier one.Nate Lawson2002-10-311-1/+17
| | | | | | | | | | | PR: kern/43627 Submitted-By: Guido van Rooij <guido@mouse.gvr.org> PR: kern/33638 PR: kern/43580 Submitted-By: Olexander Kunytsa <kunia@istc.kiev.ua> Notes: svn path=/stable/4/; revision=106239
* MFC, rev 1.45:Kenneth D. Merry2002-10-271-4/+3
| | | | | | | | | Fix region code reporting. Reported by: Andrew Gordon <arg@arg1.demon.co.uk> Notes: svn path=/stable/4/; revision=106021
* MFC: rev. 1.30Hidetoshi Shimokawa2002-10-211-0/+4
| | | | | | | Add support for Simplified Direct Access Device in scsi_op_desc(). Notes: svn path=/stable/4/; revision=105613
* MFC, rev 1.21Kenneth D. Merry2002-10-111-1/+1
| | | | | | | | | | | | Fix the location of the length bytes in the 12-byte read/write CDB structure. This has been broken since 1998, but probably hasn't been noticed because it takes a read/write of 64K blocks (32MB with 512 byte blocks) to trigger using the 12 byte read/write CDB in scsi_read_write(). Submitted by: emoore Notes: svn path=/stable/4/; revision=104935
* MFC: rev 1.40 (without cosmetic changes). Fix scsi device wiring.Peter Wemm2002-09-221-2/+1
| | | | | | | | Approved by: re Prompted by: scottl/ken Notes: svn path=/stable/4/; revision=103789
* MFC: Fix async notifications for listners registered to wildcard nodes. ForJustin T. Gibbs2002-08-301-55/+77
| | | | | | | | example, a client registered to receive specific events for bus 0, target *, lun *, was not receiving notifications. Notes: svn path=/stable/4/; revision=102636
* MFC: Update syncrate exception table to include U320 speeds.Justin T. Gibbs2002-08-301-8/+11
| | | | Notes: svn path=/stable/4/; revision=102629
* MFC: SPI4 PPR message definitions.Justin T. Gibbs2002-08-301-6/+11
| | | | Notes: svn path=/stable/4/; revision=102628
* MFC:Nate Lawson2002-08-291-3/+3
| | | | | | | Add \n to various printfs. grep shows these should be the last ones. Notes: svn path=/stable/4/; revision=102580
* MFC from -CURRENTNate Lawson2002-08-241-15/+18
| | | | | | | | | | | Updates to cmd6workaround: * Only update cdb in place if not CDB_POINTER * Correctly check for QFRZ before restarting CCB * More accurate printf message * style(9) changes at end Notes: svn path=/stable/4/; revision=102373
* MFC (1.78)- lots of fixes for EOT handling.Matt Jacob2002-08-021-72/+114
| | | | Notes: svn path=/stable/4/; revision=101203
* MFC: Correct spelling of the word 'supplied'.Robert Drehmel2002-06-201-1/+1
| | | | Notes: svn path=/stable/4/; revision=98489
* This commit was manufactured by cvs2svn to create branch 'RELENG_4'.cvs2svn2002-06-161-0/+32
| | | | Notes: svn path=/stable/4/; revision=98297
* MFC 1.104 - add quirk entry for Minolta Dimage E203 digital cameraMatthew Dillon2002-05-291-0/+7
| | | | | | | | PR: kern/38208 Approved by: re Notes: svn path=/stable/4/; revision=97514
* MFC 1.103. Add a Quirk entry for the USB SimpleTech UCF-100 compact flashMatthew Dillon2002-05-191-0/+7
| | | | | | | | | | reader. Note that even with the quirk entry the reader typically only works if the USB device is recognized by UHCI instead of the generic OHCI driver. Approved by: re Notes: svn path=/stable/4/; revision=96960
* MFC: remove hot spare 'r' in Arrray (rev 1.26)Bill Fumerola2002-05-151-1/+1
| | | | | | | | PR: kern/38104 Approved by: re (brian) Notes: svn path=/stable/4/; revision=96684
* MFC: Make Veritas Storage Appliance a HILUNS device.Matt Jacob2002-04-241-0/+5
| | | | Notes: svn path=/stable/4/; revision=95380
* MFC:Hidetoshi Shimokawa2002-04-082-2/+83
| | | | | | | | | | | - Add support for Simplified Direct Access Device. - Automatically detect devices that do not support READ(6)/WRITE(6). scsi_all.c: rev. 1.29 scsi_da.c: rev. 1.98, 1.101 Notes: svn path=/stable/4/; revision=94180
* MFC 1.97: Add NO_6_BYTE quirk entry for the LaCie Ltd. 105311 80 GigBrian S. Dean2002-02-231-1/+8
| | | | | | | | | USB2 drive. Submitted by: Brian Schellenberger <bts@babbleon.org> Notes: svn path=/stable/4/; revision=91106
* MFC: add support for PhotoClip USB Camera.Maxim Sobolev2002-02-041-0/+7
| | | | Notes: svn path=/stable/4/; revision=90173
* MFC: add quirk for DIVA USB Mp3 Player.Maxim Sobolev2002-01-141-0/+8
| | | | | | | Approved by: re Notes: svn path=/stable/4/; revision=89340