summaryrefslogtreecommitdiffstats
path: root/sys/cam/scsi
Commit message (Collapse)AuthorAgeFilesLines
* Use bioq_flush() to drain a bio queue with a specific error code.phk2003-04-014-54/+12
| | | | | | | | Retain the mistake of not updating the devstat API for now. Spell bioq_disksort() consistently with the remaining bioq_*(). #include <geom/geom_disk.h> where this is more appropriate.
* Clean up dynamically allocated sysctl variables when we run dacleanup() andken2003-03-262-0/+14
| | | | | | | | | | | cdcleanup(). This fixes sysctl problems ("can't re-use a leaf") when someone adds another peripheral at the same unit number. (e.g. rescan da0, it goes away, then rescan again and da0 comes back, but since we haven't cleaned up the sysctl variables from the last da0 instance, we can't register the variables for the new instance under the same name.) Reported by: njl Tested by: njl
* Don't use the devstat->busy_count for state decisions in the devicephk2003-03-152-8/+13
| | | | | | | drivers. Doing so imposes atomicity and locking constraints on the devstat API. By: ken
* Call devstat_start_transaction_bio() instead of devstat_start_transaction()phk2003-03-153-3/+3
|
* Quirk for SanDisk ImageMate II compact flash readernjl2003-03-111-0/+8
| | | | | | PR: kern/47877 Submitted by: Mike Durian <durian@boogie.com> MFC after: 3 days
* Quirk for Pentax Optio 230 USB camera. Note that other products probablynjl2003-03-111-0/+9
| | | | | | | | | use the underlying AsahiOptical USB chip and thus this quirk may need to be generalized in the future. PR: kern/46369 Submitted by: Tim Vanderhoek <vanderh@ecf.utoronto.ca> MFC After: 3 days
* Allocate the devstat structure with devstat_new_entry().phk2003-03-085-64/+64
|
* Centralize the devstat handling for all GEOM disk device driversphk2003-03-083-37/+9
| | | | | | | | 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.
* Make nokqfilter() return the correct return value.phk2003-03-031-1/+0
| | | | Ditch the D_KQFILTER flag which was used to prevent calling NULL pointers.
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-037-92/+51
| | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl)
* msgphk2003-02-261-1/+0
|
* NO_GEOM cleanup:phk2003-02-251-46/+21
| | | | Move to "struct disk *" centric api.
* NO_GEOM cleanup:phk2003-02-211-3/+5
| | | | | | | | | | | | | Retire the "d_dump_t" and use the "dumper_t" type instead. Dumper_t takes a void * as first arg which is more general than the dev_t taken by d_dump_t. (Remember: we could have net-dumpers if somebody wrote us one!) Define the convention for GEOM controlled disk devices to be that the first argument to the dumper function is the struct disk pointer. Change device drivers accordingly.
* NO_GEOM cleanup:phk2003-02-211-1/+1
| | | | | | | | Change the argument to disk_destroy() to be the same struct disk * as disk_create() takes. This enables drivers to ignore the (now) bogus dev_t which disk_create() returns.
* Fix ATAPI/USB/Firewire CDROM drive handling in cd(4) and hopefully fixken2003-02-215-308/+1117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-196-34/+34
| | | | Approved by: trb
* Announce our ability to do DFLTPHYS sized transfers.phk2003-02-111-0/+1
|
* Quirk for Lexar Media Jumpdrivenjl2003-02-091-0/+8
| | | | | | PR: kern/47006 Tested by: George Hartzell <hartzell@kestrel.alerce.com> MFC after: 1 week
* Rename bio_linkage to the more obvious bio_parent.phk2003-02-071-0/+1
| | | | Add bio_t0 timestamp, and include <sys/time.h> where needed
* Consolidate MIN/MAX macros into one place (param.h).alfred2003-02-023-10/+0
| | | | Submitted by: Hiten Pandya <hiten@unixdaemons.com>
* NO_GEOM cleanup: retire disk_invalidate()phk2003-01-301-1/+0
|
* Remove redundant printf from targbhasync() since all places that return annjl2003-01-231-4/+0
| | | | error do their own, more useful printf.
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-216-34/+34
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Add definitions for the task management codes sent in SPI4gibbs2003-01-201-0/+8
| | | | command information units.
* kernel:njl2003-01-161-1/+1
| | | | | | | | | | | | * Fix a bug where devices weren't cleaned up on close(): CAM_REQ_CMP != 0 user: * Increase timeout in usermode to CAM_TIME_INFINITY. The initiator is in charge of timeouts and the value was in ms, not seconds. * Bring two debugging printfs under the debug flag * Clean up man page to show increased testing on isp(4) Submitted by: gibbs (bugfixes)
* Quirk for Sony USB disk-on-key device.njl2003-01-131-0/+8
| | | | | | PR: kern/46386 Submitted by: dillon MFC after: 3 days
* Back out last commit.peter2003-01-061-1/+1
|
* Move dashutdown from SHUTDOWN_PRI_DEFAULT to SHUTDOWN_PRI_FIRST.peter2003-01-061-1/+1
| | | | | | | | | | | Otherwise, the scsi devices that it is trying to issue commands to may have gone away. This is what caused shutdown to hang on ia64 systems with mpt scsi controllers. The bus system has torn down the device tree and reset the mpt controller etc, and suddenly along comes dashutdown and wants to issue a few more scsi commands.... <HANG!> This shouldn't work on i386 either, but it seems to work solely due to luck.
* Quirk for Memorybird pen drivenjl2002-12-181-0/+8
| | | | | | PR: kern/34712 Submitted by: Oliver Fromme <olli@lurza.secnetix.de> MFC after: 3 days
* The HP DAT 40 tape drive should be able to handle variable block sizes.trhodes2002-12-161-0/+4
| | | | | | | | | 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
* Clear the "device open" flag in daopen() before returning a error,yar2002-12-121-0/+1
| | | | | | | so the device won't stay marked as open whereas it isn't. Approved by: re, njl MFC after: 1 week
* Release the reference to the peripheral if returning a error.yar2002-11-291-0/+2
| | | | | | | | | That reference is to be held only if daopen() has been successful and until daclose() releases it. daclose() won't be called if daopen() has failed, though. Approved by: re, njl MFC after: 1 week
* Remove unnecessary includes and add sys/{lock,mutex}.hnjl2002-11-251-6/+2
| | | | | Submitted by: bde Approved by: re (previously)
* Whitespace cleanup that was missed by quirks commit 1.114njl2002-11-231-4/+4
|
* Allow acd(4) and cd(4) to support old behavior for CDRIOC*SPEED ioctls.njl2002-11-231-0/+6
| | | | | | | | | | If the value from the user is less than 177, assume it is a multiple of a single speed CDROM and convert to KB/sec. No complaints from: sos Reviewed by: ken Approved by: re MFC after: 1 day
* Update quirks, adding PR references and fixing a capitalization mismatch.njl2002-11-231-3/+5
| | | | | PR: kern/45494 Approved by: re
* New SCSI target emulator codenjl2002-11-222-2103/+922
| | | | | | | | | | | | | | | | | | | | | 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. Code has been tested on ahc(4) and should also work on isp(4) (and other SIMs that gain target mode support). It is a complete rewrite of /sys/cam/scsi_target* and /usr/share/examples/scsi_target. Design, comments from: gibbs Supported by: Cryptography Research Approved by: re
* Panic message should end with \n.imp2002-11-142-12/+12
| | | | Reviewed by: ken a while ago.
* Fix instances of macros with improperly parenthasized arguments.alfred2002-11-091-2/+2
| | | | Verified by: md5
* * Add CDRIOC{READ,WRITE}SPEED ioctls to cd(4). Units are in KB/sec.njl2002-10-182-0/+58
| | | | | | | | | | | | | | | * 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. This change does not break ABI but does change the units passed through the ioctl so 3rd party software that uses cdrio.h will have to convert (most likely by multiplying CDROM speed by 177 to get KB/s). PR: kern/36845 Submitted by: Philipp Mergenthaler <p@i609a.hadiko.de> (CAM ioctls) Reviewed by: sos, ken MFC after: 1 month
* Backout my previous "brain cramp" commit.pirzyk2002-10-181-11/+9
| | | | | | Requested by: Most developers Apologies to: Most developers, with special note to <ken@kdm.org> Collabroation in the future with: Kenneth D. Merry <ken@kdm.org>
* Changed the scsi mode command to use 10 bytes scsi commands insteadpirzyk2002-10-171-9/+11
| | | | | | | of the 6 byte ones. This helps with using a IDE cdrom behind a USB interface. PR: kern/43885
* Quirk for HP 315 USB Digital Cameranjl2002-10-171-0/+8
| | | | | | | Submitted by: Keith White <kwhite@uottawa.ca> PR: kern/41010 MFC after: 1 week
* Trapdoor access to cd%da and cd%c so they still work, but do not let themphk2002-10-111-0/+24
| | | | show up in /dev.
* Use malloc(9)'s M_ZERO rather than explicit bzero(9) call.phk2002-10-111-2/+2
|
* Fix the location of the length bytes in the 12-byte read/write CDBken2002-10-081-1/+1
| | | | | | | | | 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: "Moore, Eric Dean" <emoore@lsil.com> MFC after: 3 days
* Correctly convert to appropriate blocksize.phk2002-10-071-1/+2
| | | | | | | note to self: Never check block-size sensitive patches on Sun compatible CD drives. Sponsored by: DARPA & NAI Labs.
* Unhook the SCSI CD driver from the disk "mini-layer" and/or GEOM.phk2002-10-041-117/+23
| | | | | | | | | | | | | | | | | | SCSI disks are too square pegs for the round holes in both of these. And since atapi-cd has clearly shown that there are better acccess models for CD media than trying to pretend to be a classical disk, we stop the masquerade rather than patch up the costume. But do implement the DIOCGMEDIASIZE and DIOCGSECTORSIZE so it will be possible to manually attach to GEOM, should some the need arise. Ideally, this driver should do media-detection and call make_dev() when a CD is inserted and destroy_dev() when it is removed, this would allow our future devd(8) to automount etc etc but coding that takes SCSI-clue beyond anything I posses. Tested on: sparc64
* Fix style problems in the quirk entry section.ken2002-10-031-4/+6
| | | | MFC after: 2 weeks
* Add quirks for DaisyTechnology PhotoClip camera.sobomax2002-10-011-0/+7
| | | | | Submitted by: Olexander Kunitsa <kunia@istc.kiev.ua> MFC after: 3 days
OpenPOWER on IntegriCloud