summaryrefslogtreecommitdiffstats
path: root/sys/cam
Commit message (Collapse)AuthorAgeFilesLines
...
* Add /* FALLTHROUGH */phk2003-05-311-0/+3
| | | | Found by: FlexeLint
* Use symbolic constants instead of "4".phk2003-05-312-15/+9
| | | | | | Use arrays instead of relying on struct packing. Identical md5(scsi_ch.o).
* Don't use return(foo(...)); in a function returning void.phk2003-05-311-6/+8
| | | | Found by: FlexeLint
* Add a quirk for OTi USB flash key.njl2003-05-151-0/+8
| | | | | PR: kern/51825 Approved by: re (rwatson)
* Fix three problems in large (>2TB) device handling:ken2003-05-031-2/+2
| | | | | | | | | | | - Make sure we don't release the READ CAPACITY CCB twice - If we have a device that needs a 16 byte READ CAPACITY command, make sure we call xpt_schedule() so we can get a CCB. - Don't unlock the peripheral until we're fully probed. Many thanks to Julian Elischer for providing hardware and testing this. Tested by: julian
* Fix compile errors on ia64 in dagetcapacity. Set block_len and maxsectorken2003-05-011-0/+2
| | | | | | to 0 initially. It seems that the ia64 backend isn't as "smart" as the i386 backend, which realized that those variables were only set or used when error == 0, and thus were not used uninitialized.
* Use %j instead of %q in printf to unbreak sparc64.phk2003-04-301-3/+4
|
* Add support to CAM for devices with more than 2^32 blocks. (2TB if you'reken2003-04-304-88/+347
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | using 512 byte blocks). cam_ccb.h: Bump up volume_size and cylinders in ccb_calc_geometry to 64 bits and 32 bits respectively, so we can hold larger device sizes. cylinders would overflow at about 500GB. Bump CAM_VERSION for this change. Note that this will require a recompile of all applications that talk to the pass(4) driver. scsi_all.c: Add descriptions for READ/WRITE(16), update READ/WRITE(12) descriptions, add descriptions for SERVICE ACTION IN/OUT. Add a new function, scsi_read_capacity_16(), that issues the read capacity service action. (Necessary for arrays larger than 2^32 sectors.) Update scsi_read_write() to use a 64 bit LBA and issue READ(16) or WRITE(16) if necessary. NOTE the API change. This should be largely transparnet to most userland applications at compile time, but will break binary compatibility. The CAM_VERSION bump, above, also serves the purpose of forcing a recompile for any applications that talk to CAM. scsi_all.h: Add 16 byte READ/WRITE structures, structures for 16 byte READ CAPACITY/SERVICE ACTION IN. Add scsi_u64to8b() and scsi_8btou64. scsi_da.c: The da(4) driver probe now has two stages for devices larger than 2TB. If a standard READ CAPACITY(10) returns 0xffffffff, we issue the 16 byte version of read capacity to determine the true array capacity. We also do the same thing in daopen() -- use the 16 byte read capacity if the device is large enough. The sysctl/loader code has also been updated to accept 16 bytes as a minimum command size.
* Deprecate machine/limits.h in favor of new sys/limits.h.kan2003-04-292-2/+2
| | | | | | | Change all in-tree consumers to include <sys/limits.h> Discussed on: standards@ Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
* SCSI Quirks for:njl2003-04-271-1/+35
| | | | | | | | | Casio QV-R3 USB camera, which appears to use a Pentax chipset M-Systems DiskOnKey USB flash key Feiya "slider" dual-slot flash reader SmartDisk (Mitsumi) USB floppy drive PR: kern/46545, kern/47793, kern/50020, kern/50226
* Remove the unused ioctl routine.phk2003-04-121-32/+0
|
* Sufficient access checks are performed by vmapbuf() that calling useracc()alc2003-04-061-19/+0
| | | | is pointless. Remove the calls to useracc().
* 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
* Run a revision of the devstat interface:phk2003-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kernel: Change statistics to use the *uptime() timescale (ie: relative to boottime) rather than the UTC aligned timescale. This makes the device statistics code oblivious to clock steps. Change timestamps to bintime format, they are cheaper. Remove the "busy_count", and replace it with two counter fields: "start_count" and "end_count", which are updated in the down and up paths respectively. This removes the locking constraint on devstat. Add a timestamp argument to devstat_start_transaction(), this will normally be a timestamp set by the *_bio() function in bp->bio_t0. Use this field to calculate duration of I/O operations. Add two timestamp arguments to devstat_end_transaction(), one is the current time, a NULL pointer means "take timestamp yourself", the other is the timestamp of when this transaction started (see above). Change calculation of busy_time to operate on "the salami principle": Only when we are idle, which we can determine by the start+end counts being identical, do we update the "busy_from" field in the down path. In the up path we accumulate the timeslice in busy_time and update busy_from. Change the byte_* and num_* fields into two arrays: bytes[] and operations[]. Userland: Change the misleading "busy_time" name to be called "snap_time" and make the time long double since that is what most users need anyway, fill it using clock_gettime(CLOCK_MONOTONIC) to put it on the same timescale as the kernel fields. Change devstat_compute_etime() to operate on struct bintime. Remove the version 2 legacy interface: the change to bintime makes compatibility far too expensive. Fix a bug in systat's "vm" page where boot relative busy times would be bogus. Bump __FreeBSD_version to 500107 Review & Collaboration by: ken
* 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-085-38/+11
| | | | | | | | 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-038-105/+56
| | | | | | | | | | | | | 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-199-38/+38
| | | | 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-219-38/+38
| | | | 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.
* Close the remaining user address mapping races for physicaldillon2003-01-201-3/+23
| | | | | | | I/O, CAM, and AIO. Still TODO: streamline useracc() checks. Reviewed by: alc, tegge MFC after: 7 days
* 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.
* Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/schweikh2002-12-301-1/+1
| | | | Add FreeBSD Id tag where missing.
* 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
OpenPOWER on IntegriCloud