Lines Matching +full:host +full:- +full:command

1 .. SPDX-License-Identifier: GPL-2.0
4 SCSI mid_level - lower_level driver interface
11 host bus adapter (HBA) drivers and host drivers (HD). A "host" in this
14 (SCSI terminology, see SAM-3 at http://www.t10.org) sends SCSI commands
22 Examples are the usb-storage driver (found in the drivers/usb/storage
30 HBAs. These HBAs might be either on PCI daughter-boards or built into
32 and thus represent two hosts. Like most modern HBAs, each aic7xxx host
33 has its own PCI device address. [The one-to-one correspondence between
34 a SCSI host and a PCI device is common but not required (e.g. with
49 documented in Documentation/scsi (e.g. aic7xxx.rst). The SCSI mid-level is
53 scsi-generic.rst (for the sg driver).
68 and OS-specific code (e.g. FreeBSD and Linux). Such drivers tend to have
127 to control, the LLD will initialize the HBA and then register a new host
144 ===-------------------=========--------------------===------
145 scsi_host_alloc() -->
146 scsi_add_host() ---->
147 scsi_scan_host() -------+
150 sdev_configure() --> scsi_change_queue_depth()
167 command) or in response to a "hot unplug" indicated by sysfs()'s
173 ===----------------------=========-----------------===------
174 scsi_remove_host() ---------+
182 by the mid-level. struct Scsi_Host instances are freed from
199 ===-------------------=========--------------------===------
200 scsi_add_device() ------+
203 sdev_configure() [--> scsi_change_queue_depth()]
208 device has been removed until a subsequent SCSI command fails which will
215 ===----------------------=========-----------------===------
216 scsi_remove_device() -------+
222 sdev_configure() callbacks). Such instances are "owned" by the mid-level.
238 - scsi_host_alloc():
242 - scsi_host_get():
245 - scsi_host_put():
269 Documentation/process/coding-style.rst file.
277 Well written, tested and documented code, need not be re-formatted to
294 - scsi_add_device - creates new scsi device (lu) instance
295 - scsi_add_host - perform sysfs registration and set up transport class
296 - scsi_change_queue_depth - change the queue depth on a SCSI device
297 - scsi_bios_ptable - return copy of block device's partition table
298 - scsi_block_requests - prevent further commands being queued to given host
299 - scsi_host_alloc - return a new scsi_host instance whose refcount==1
300 - scsi_host_get - increments Scsi_Host instance's refcount
301 - scsi_host_put - decrements Scsi_Host instance's refcount (free if 0)
302 - scsi_remove_device - detach and remove a SCSI device
303 - scsi_remove_host - detach and remove all SCSI devices owned by host
304 - scsi_report_bus_reset - report scsi _bus_ reset observed
305 - scsi_scan_host - scan SCSI bus
306 - scsi_track_queue_full - track successive QUEUE_FULL events
307 - scsi_unblock_requests - allow further commands to be queued to given host
313 * scsi_add_device - creates new scsi device (lu) instance
314 * @shost: pointer to scsi host instance
320 * ERR_PTR(-ENODEV) (or some other bent pointer) if something is
340 * scsi_add_host - perform sysfs registration and set up transport class
341 * @shost: pointer to scsi host instance
344 * Returns 0 on success, negative errno of failure (e.g. -ENOMEM)
351 * in some other transport-specific way. The LLD must set up
361 * scsi_change_queue_depth - allow LLD to change queue depth on a SCSI device
365 * in non-tagged mode (as per cmd_per_lun).
382 * scsi_bios_ptable - return copy of block device's partition table
397 * scsi_block_requests - prevent further commands being queued to given host
399 * @shost: pointer to host to block commands on
414 * scsi_host_alloc - create a scsi host adapter instance and perform basic
416 * @sht: pointer to scsi host template
425 * this host has _not_ yet been done.
426 * The hostdata array (by default zero length) is a per host scratch
439 * scsi_host_get - increment Scsi_Host instance refcount
446 * Notes: Actually increments the counts in two sub-objects
454 * scsi_host_put - decrement Scsi_Host instance refcount, free if 0
461 * Notes: Actually decrements the counts in two sub-objects. If the
473 * scsi_remove_device - detach and remove a SCSI device
476 * Returns value: 0 on success, -EINVAL if device not attached
481 * been removed but its host is still present then it can request
492 * scsi_remove_host - detach and remove all SCSI devices owned by host
493 * @shost: a pointer to a scsi host instance
509 * scsi_report_bus_reset - report scsi _bus_ reset observed
510 * @shost: a pointer to a scsi host involved
511 * @channel: channel (within) host on which scsi bus reset occurred
529 * scsi_scan_host - scan SCSI bus
530 * @shost: a pointer to a scsi host instance
542 * scsi_track_queue_full - track successive QUEUE_FULL events on given
549 * Returns 0 - no change needed
550 * >0 - adjust queue depth to this new depth
551 * -1 - drop back to untagged operation using host->cmd_per_lun
552 * as the untagged command depth
565 * scsi_unblock_requests - allow further commands to be queued to given host
567 * @shost: pointer to host to unblock commands on
605 - bios_param - fetch head, sector, cylinder info for a disk
606 - eh_timed_out - notify the host that a command timer expired
607 - eh_abort_handler - abort given command
608 - eh_bus_reset_handler - issue SCSI bus reset
609 - eh_device_reset_handler - issue SCSI device reset
610 - eh_host_reset_handler - reset host (host bus adapter)
611 - info - supply information about given host
612 - ioctl - driver can respond to ioctls
613 - proc_info - supports /proc/scsi/{driver_name}/{host_no}
614 - queuecommand - queue scsi command, invoke 'done' on completion
615 - sdev_init - prior to any commands being sent to a new device
616 - sdev_configure - driver fine tuning for given device after attach
617 - sdev_destroy - given device is about to be shut down
623 * bios_param - fetch head, sector, cylinder info for a disk
641 * pre-initialized with made up values just in case this function
651 * eh_timed_out - The timer for the command has just fired
652 * @scp: identifies command timing out
656 * EH_HANDLED: I fixed the error, please complete the command
667 * This recovery is limited to determining if the outstanding command
668 * will ever complete. You may not abort and restart the command from
677 * eh_abort_handler - abort command associated with scp
678 * @scp: identifies command to be aborted
680 * Returns SUCCESS if command aborted else FAILED
686 * Notes: This is called only for a command that has timed out.
694 * eh_bus_reset_handler - issue SCSI bus reset
697 * Returns SUCCESS if command aborted else FAILED
704 * queued on current host during eh.
712 * eh_device_reset_handler - issue SCSI device reset
715 * Returns SUCCESS if command aborted else FAILED
722 * queued on current host during eh.
730 * eh_host_reset_handler - reset host (host bus adapter)
731 * @scp: SCSI host that contains this device should be reset
733 * Returns SUCCESS if command aborted else FAILED
740 * queued on current host during eh.
752 * info - supply information about given host: driver name plus data
753 * to distinguish given host
754 * @shp: host to supply information about
758 * lifetime of this host.]
778 * ioctl - driver can respond to ioctls
799 * unsupported ioctl() 'cmd' numbers should return -ENOTTY.
807 * proc_info - supports /proc/scsi/{driver_name}/{host_no}
815 * @host_no: host number of interest (struct Scsi_Host::host_no)
816 * @writeto1_read0: 1 -> data coming from user space towards driver
818 * 0 -> user what data from this driver
838 * queuecommand - queue scsi command, invoke scp->scsi_done on completion
839 * @shost: pointer to the scsi host object
840 * @scp: pointer to scsi command object
847 * SCSI_MLQUEUE_HOST_BUSY if the entire host queue is full
849 * On both of these returns, the mid-layer will requeue the I/O
851 * - if the return is SCSI_MLQUEUE_DEVICE_BUSY, only that particular
852 * device will be paused, and it will be unpaused when a command to
857 * - if the return is SCSI_MLQUEUE_HOST_BUSY, all I/O to the host
858 * is paused and will be unpaused when any command returns from
859 * the host (or after a brief delay if there are no outstanding
860 * commands to the host).
867 * flagged by setting scp->result to an appropriate value,
868 * invoking the scp->scsi_done callback, and then returning 0
869 * from this function. If the command is not performed
871 * command) then this function should place 0 in scp->result and
874 * Command ownership. If the driver returns zero, it owns the
875 * command and must take responsibility for ensuring the
876 * scp->scsi_done callback is executed. Note: the driver may
877 * call scp->scsi_done before returning zero, but after it has
878 * called scp->scsi_done, it may not return any value other than
879 * zero. If the driver makes a non-zero return, it must not
880 * execute the command's scsi_done callback at any time.
890 * will not wait for IO to complete. Hence the scp->scsi_done
894 * response to a SCSI INQUIRY) the scp->scsi_done callback may be
895 * invoked before this function returns. If the scp->scsi_done
898 * CONDITION is placed in "result" when the scp->scsi_done
902 * the mid level queuing a command to an LLD.
910 * sdev_init - prior to any commands being sent to a new device
924 * and INQUIRY command plus ...). If a device is found then
935 * sdev_configure - driver fine tuning for given device just after it
958 * sdev_destroy - given device is about to be shut down. All
972 * could be re-attached in the future in which case a new instance
985 -------------------------
992 - name of driver (may contain spaces, please limit to
996 - name used in "/proc/scsi/<proc_name>/<host_no>" and
1002 - primary callback that the mid level uses to inject
1006 - a unique value that identifies the vendor supplying
1008 vendor-specific message requests. Value consists of an
1009 identifier type and a vendor-specific value.
1020 ----------------
1021 There is one struct Scsi_Host instance per host (HBA) that an LLD
1029 - system wide unique number that is used for identifying
1030 this host. Issued in ascending order from 0.
1032 - must be greater than 0; do not send more than can_queue
1035 - scsi id of host (scsi initiator) or -1 if not known
1037 - maximum scatter gather elements allowed by host.
1041 - maximum number of sectors (usually 512 bytes) allowed
1042 in a single SCSI command. The default value of 0 leads
1049 - maximum number of commands that can be queued on devices
1050 controlled by the host. Overridden by LLD calls to
1053 - pointer to driver's struct scsi_host_template from which
1055 hostt->proc_name
1056 - name of LLD. This is the driver name that sysfs uses
1058 - pointer to driver's struct scsi_transport_template instance
1061 - area reserved for LLD at end of struct Scsi_Host. Size
1068 ------------------
1070 on a host. Scsi devices connected to a host are uniquely identified by a
1075 ----------------
1084 - array containing SCSI command
1086 - length (in bytes) of SCSI command
1088 - direction of data transfer in data phase. See
1089 "enum dma_data_direction" in include/linux/dma-mapping.h
1091 - should be set by LLD prior to calling 'done'. A value
1092 of 0 implies a successfully completed command (and all
1099 - an array (maximum size: SCSI_SENSE_BUFFERSIZE bytes) that
1105 level will issue a REQUEST_SENSE SCSI command to
1107 prone in the presence of command queuing so the LLD should
1108 always "auto-sense".
1110 - pointer to scsi_device object that this command is
1113 - an LLD should set this unsigned integer to the requested
1122 - LLD should place (DID_ERROR << 16) in 'result' if
1142 scsi_set_resid(SCpnt, scsi_bufflen(SCpnt) - (3 * 512));
1160 Autosense (or auto-sense) is defined in the SAM-2 document as "the
1162 with the completion of a SCSI command" when a status of CHECK CONDITION
1168 b) or, the LLD issuing a REQUEST SENSE command itself
1174 this byte is initialized to 0 before each command) then the mid level will
1175 issue a REQUEST SENSE command.
1178 buffer data from the command that failed until a following REQUEST SENSE
1187 one per SCSI host.
1209 - Mike Anderson <andmike at us dot ibm dot com>
1210 - James Bottomley <James dot Bottomley at hansenpartnership dot com>
1211 - Patrick Mansfield <patmans at us dot ibm dot com>
1212 - Christoph Hellwig <hch at infradead dot org>
1213 - Doug Ledford <dledford at redhat dot com>
1214 - Andries Brouwer <Andries dot Brouwer at cwi dot nl>
1215 - Randy Dunlap <rdunlap at xenotime dot net>
1216 - Alan Stern <stern at rowland dot harvard dot edu>