freebsd-nq/sys/dev/usb
Kenneth D. Merry 1cc052e80f Add descriptor sense support to CAM, and honor sense residuals properly in
CAM.

Desriptor sense is a new sense data format that originated in SPC-3.  Among
other things, it allows for an 8-byte info field, which is necessary to
pass back block numbers larger than 4 bytes.

This change adds a number of new functions to scsi_all.c (and therefore
libcam) that abstract out most access to sense data.

This includes a bump of CAM_VERSION, because the CCB ABI has changed.
Userland programs that use the CAM pass(4) driver will need to be
recompiled.

camcontrol.c:	Change uses of scsi_extract_sense() to use
		scsi_extract_sense_len().

		Use scsi_get_sks() instead of accessing sense key specific
		data directly.

scsi_modes:	Update the control mode page to the latest version (SPC-4).

scsi_cmds.c,
scsi_target.c:	Change references to struct scsi_sense_data to struct
		scsi_sense_data_fixed.  This should be changed to allow the
		user to specify fixed or descriptor sense, and then use
		scsi_set_sense_data() to build the sense data.

ps3cdrom.c:	Use scsi_set_sense_data() instead of setting sense data
		manually.

cam_periph.c:	Use scsi_extract_sense_len() instead of using
		scsi_extract_sense() or accessing sense data directly.

cam_ccb.h:	Bump the CAM_VERSION from 0x15 to 0x16.  The change of
		struct scsi_sense_data from 32 to 252 bytes changes the
		size of struct ccb_scsiio, but not the size of union ccb.
		So the version must be bumped to prevent structure
		mis-matches.

scsi_all.h:	Lots of updated SCSI sense data and other structures.

		Add function prototypes for the new sense data functions.

		Take out the inline implementation of scsi_extract_sense().
		It is now too large to put in a header file.

		Add macros to calculate whether fields are present and
		filled in fixed and descriptor sense data

scsi_all.c:	In scsi_op_desc(), allow the user to pass in NULL inquiry
		data, and we'll assume a direct access device in that case.

		Changed the SCSI RESERVED sense key name and description
		to COMPLETED, as it is now defined in the spec.

		Change the error recovery action for a number of read errors
		to prevent lots of retries when the drive has said that the
		block isn't accessible.  This speeds up reconstruction of
		the block by any RAID software running on top of the drive
		(e.g. ZFS).

		In scsi_sense_desc(), allow for invalid sense key numbers.
		This allows calling this routine without checking the input
		values first.

		Change scsi_error_action() to use scsi_extract_sense_len(),
		and handle things when invalid asc/ascq values are
		encountered.

		Add a new routine, scsi_desc_iterate(), that will call the
		supplied function for every descriptor in descriptor format
		sense data.

		Add scsi_set_sense_data(), and scsi_set_sense_data_va(),
		which build descriptor and fixed format sense data.  They
		currently default to fixed format sense data.

		Add a number of scsi_get_*() functions, which get different
		types of sense data fields from either fixed or descriptor
		format sense data, if the data is present.

		Add a number of scsi_*_sbuf() functions, which print
		formatted versions of various sense data fields.  These
		functions work for either fixed or descriptor sense.

		Add a number of scsi_sense_*_sbuf() functions, which have a
		standard calling interface and print the indicated field.
		These functions take descriptors only.

		Add scsi_sense_desc_sbuf(), which will print a formatted
		version of the given sense descriptor.

		Pull out a majority of the scsi_sense_sbuf() function and
		put it into scsi_sense_only_sbuf().  This allows callers
		that don't use struct ccb_scsiio to easily utilize the
		printing routines.  Revamp that function to handle
		descriptor sense and use the new sense fetching and
		printing routines.

		Move scsi_extract_sense() into scsi_all.c, and implement it
		in terms of the new function, scsi_extract_sense_len().
		The _len() version takes a length (which should be the
		sense length - residual) and can indicate which fields are
		present and valid in the sense data.

		Add a couple of new scsi_get_*() routines to get the sense
		key, asc, and ascq only.

mly.c:		Rename struct scsi_sense_data to struct
		scsi_sense_data_fixed.

sbp_targ.c:	Use the new sense fetching routines to get sense data
		instead of accessing it directly.

sbp.c:		Change the firewire/SCSI sense data transformation code to
		use struct scsi_sense_data_fixed instead of struct
		scsi_sense_data.  This should be changed later to use
		scsi_set_sense_data().

ciss.c:		Calculate the sense residual properly.  Use
		scsi_get_sense_key() to fetch the sense key.

mps_sas.c,
mpt_cam.c:	Set the sense residual properly.

iir.c:		Use scsi_set_sense_data() instead of building sense data by
		hand.

iscsi_subr.c:	Use scsi_extract_sense_len() instead of grabbing sense data
		directly.

umass.c:	Use scsi_set_sense_data() to build sense data.

		Grab the sense key using scsi_get_sense_key().

		Calculate the sense residual properly.

isp_freebsd.h:	Use scsi_get_*() routines to grab asc, ascq, and sense key
		values.

		Calculate and set the sense residual.

MFC after:	3 days
Sponsored by:	Spectra Logic Corporation
2011-10-03 20:32:55 +00:00
..
controller Renamed PCI_INTERFACE_XHCI to PCIP_SERIALBUS_USB_XHCI and moved it 2011-05-17 11:23:43 +00:00
input MFprojects/hid: 2011-09-28 14:52:25 +00:00
misc - Export more USB device ID's. 2011-06-24 19:32:29 +00:00
net Add new USB ID. 2011-08-20 14:21:32 +00:00
quirk Add quirks for some USB mass storage devices which doesn't respond 2011-09-27 07:06:02 +00:00
serial Add new USB ID to u3g driver. 2011-08-20 16:21:40 +00:00
storage Add descriptor sense support to CAM, and honor sense residuals properly in 2011-10-03 20:32:55 +00:00
template - Add some comments about the origin of some USB descriptors. 2011-06-23 10:35:45 +00:00
wlan The SMCWUSBG is a zyd(4) device, not an uath(4) device. Remove from the 2011-06-26 11:37:24 +00:00
ufm_ioctl.h
usb_bus.h Removes all duplicated code with BPF that it's greatly simplified and 2010-11-24 19:11:32 +00:00
usb_busdma.c Remove unneeded includes of <sys/linker_set.h>. Other headers that use 2011-01-11 13:59:06 +00:00
usb_busdma.h
usb_cdc.h USB network (NCM driver): 2010-10-13 22:04:55 +00:00
usb_compat_linux.c Remove unneeded includes of <sys/linker_set.h>. Other headers that use 2011-01-11 13:59:06 +00:00
usb_compat_linux.h
usb_controller.h Removes a unused function `usb_bus_find'. 2010-11-25 22:56:26 +00:00
usb_core.c Remove unneeded includes of <sys/linker_set.h>. Other headers that use 2011-01-11 13:59:06 +00:00
usb_core.h
usb_debug.c Remove unneeded includes of <sys/linker_set.h>. Other headers that use 2011-01-11 13:59:06 +00:00
usb_debug.h Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this had 2010-04-22 21:31:34 +00:00
usb_dev.c In order to maximize the re-usability of kernel code in user space this 2011-09-16 13:58:51 +00:00
usb_dev.h
usb_device.c Refactor auto-quirk solution so that we break as few external 2011-09-10 15:55:36 +00:00
usb_device.h This patch adds automatic detection of USB mass storage devices 2011-09-02 18:50:44 +00:00
usb_dynamic.c Refactor auto-quirk solution so that we break as few external 2011-09-10 15:55:36 +00:00
usb_dynamic.h Refactor auto-quirk solution so that we break as few external 2011-09-10 15:55:36 +00:00
usb_endian.h
usb_error.c Remove unneeded includes of <sys/linker_set.h>. Other headers that use 2011-01-11 13:59:06 +00:00
usb_freebsd.h This patch adds automatic detection of USB mass storage devices 2011-09-02 18:50:44 +00:00
usb_generic.c Improve enumeration of Low- and Full-speed devices connected through a 2011-06-06 21:45:09 +00:00
usb_generic.h
usb_handle_request.c Remove unneeded includes of <sys/linker_set.h>. Other headers that use 2011-01-11 13:59:06 +00:00
usb_hid.c Make the USB keyboard driver more HID compliant. 2011-07-04 07:37:28 +00:00
usb_hub.c - Add additional information to the PnP info of USB HUBs children which 2011-06-24 04:16:06 +00:00
usb_hub.h This commit adds full support for USB 3.0 devices in host and device 2010-10-04 23:18:05 +00:00
usb_if.m
usb_ioctl.h - Add more USB templates for various USB device classes 2011-06-23 07:54:03 +00:00
usb_lookup.c - Export the USB device ID format to userspace tools. 2011-06-25 15:51:44 +00:00
usb_mbuf.c Remove unneeded includes of <sys/linker_set.h>. Other headers that use 2011-01-11 13:59:06 +00:00
usb_mbuf.h
usb_msctest.c Reduce USB memory usage during enumeration. 2011-09-14 15:16:53 +00:00
usb_msctest.h This patch adds automatic detection of USB mass storage devices 2011-09-02 18:50:44 +00:00
usb_parse.c Remove unneeded includes of <sys/linker_set.h>. Other headers that use 2011-01-11 13:59:06 +00:00
usb_pci.h
usb_pf.c - Improvements to USB PF solution 2011-04-03 20:03:45 +00:00
usb_pf.h - Improvements to USB PF solution 2011-04-03 20:03:45 +00:00
usb_process.c Add support for new USB serial driver. 2011-06-01 17:58:27 +00:00
usb_process.h Use software interrupt priorities for USB kthreads instead of hardware 2011-01-13 14:15:36 +00:00
usb_request.c Add sysctl to not reset the device on clear stall failures, to 2011-08-19 09:01:34 +00:00
usb_request.h Improve enumeration of Low- and Full-speed devices connected through a 2011-06-06 21:45:09 +00:00
usb_transfer.c Avoid starting the USB transfer if an error is already pending. 2011-09-20 14:17:58 +00:00
usb_transfer.h This commit adds full support for USB 3.0 devices in host and device 2010-10-04 23:18:05 +00:00
usb_util.c Remove unneeded includes of <sys/linker_set.h>. Other headers that use 2011-01-11 13:59:06 +00:00
usb_util.h
usb.h Add missing USB 3.0 definitions. Correct some wrong ones. 2010-10-04 21:38:10 +00:00
usbdevs Add quirks for some USB mass storage devices which doesn't respond 2011-09-27 07:06:02 +00:00
usbdi_util.h This commit adds full support for USB 3.0 devices in host and device 2010-10-04 23:18:05 +00:00
usbdi.h Refactor auto-quirk solution so that we break as few external 2011-09-10 15:55:36 +00:00
usbhid.h Make the USB keyboard driver more HID compliant. 2011-07-04 07:37:28 +00:00