@@ -683,11 +683,7 @@ Details::
683
683
*
684
684
* Calling context: kernel thread
685
685
*
686
- * Notes: If 'no_async_abort' is defined this callback
687
- * will be invoked from scsi_eh thread. No other commands
688
- * will then be queued on current host during eh.
689
- * Otherwise it will be called whenever scsi_timeout()
690
- * is called due to a command timeout.
686
+ * Notes: This is called only for a command that has timed out.
691
687
*
692
688
* Optionally defined in: LLD
693
689
**/
@@ -990,7 +986,7 @@ struct scsi_host_template
990
986
There is one "struct scsi_host_template" instance per LLD [# ]_. It is
991
987
typically initialized as a file scope static in a driver's header file. That
992
988
way members that are not explicitly initialized will be set to 0 or NULL.
993
- Member of interest:
989
+ Members of interest:
994
990
995
991
name
996
992
- name of driver (may contain spaces, please limit to
@@ -1006,6 +1002,13 @@ Member of interest:
1006
1002
- primary callback that the mid level uses to inject
1007
1003
SCSI commands into an LLD.
1008
1004
1005
+ vendor_id
1006
+ - a unique value that identifies the vendor supplying
1007
+ the LLD for the Scsi_Host. Used most often in validating
1008
+ vendor-specific message requests. Value consists of an
1009
+ identifier type and a vendor-specific value.
1010
+ See scsi_netlink.h for a description of valid formats.
1011
+
1009
1012
The structure is defined and commented in include/scsi/scsi_host.h
1010
1013
1011
1014
.. [# ] In extreme situations a single driver may have several instances
@@ -1046,9 +1049,6 @@ of interest:
1046
1049
- maximum number of commands that can be queued on devices
1047
1050
controlled by the host. Overridden by LLD calls to
1048
1051
scsi_change_queue_depth().
1049
- no_async_abort
1050
- - 1=>Asynchronous aborts are not supported
1051
- - 0=>Timed-out commands will be aborted asynchronously
1052
1052
hostt
1053
1053
- pointer to driver's struct scsi_host_template from which
1054
1054
this struct Scsi_Host instance was spawned
@@ -1057,22 +1057,10 @@ of interest:
1057
1057
transportt
1058
1058
- pointer to driver's struct scsi_transport_template instance
1059
1059
(if any). FC and SPI transports currently supported.
1060
- sh_list
1061
- - a double linked list of pointers to all struct Scsi_Host
1062
- instances (currently ordered by ascending host_no)
1063
- my_devices
1064
- - a double linked list of pointers to struct scsi_device
1065
- instances that belong to this host.
1066
1060
hostdata[0]
1067
1061
- area reserved for LLD at end of struct Scsi_Host. Size
1068
- is set by the second argument (named 'xtr_bytes ') to
1062
+ is set by the second argument (named 'privsize ') to
1069
1063
scsi_host_alloc().
1070
- vendor_id
1071
- - a unique value that identifies the vendor supplying
1072
- the LLD for the Scsi_Host. Used most often in validating
1073
- vendor-specific message requests. Value consists of an
1074
- identifier type and a vendor-specific value.
1075
- See scsi_netlink.h for a description of valid formats.
1076
1064
1077
1065
The scsi_host structure is defined in include/scsi/scsi_host.h
1078
1066
@@ -1094,30 +1082,11 @@ Members of interest:
1094
1082
1095
1083
cmnd
1096
1084
- array containing SCSI command
1097
- cmnd_len
1085
+ cmd_len
1098
1086
- length (in bytes) of SCSI command
1099
1087
sc_data_direction
1100
1088
- direction of data transfer in data phase. See
1101
1089
"enum dma_data_direction" in include/linux/dma-mapping.h
1102
- request_bufflen
1103
- - number of data bytes to transfer (0 if no data phase)
1104
- use_sg
1105
- - ==0 -> no scatter gather list, hence transfer data
1106
- to/from request_buffer
1107
- - >0 -> scatter gather list (actually an array) in
1108
- request_buffer with use_sg elements
1109
- request_buffer
1110
- - either contains data buffer or scatter gather list
1111
- depending on the setting of use_sg. Scatter gather
1112
- elements are defined by 'struct scatterlist' found
1113
- in include/linux/scatterlist.h .
1114
- done
1115
- - function pointer that should be invoked by LLD when the
1116
- SCSI command is completed (successfully or otherwise).
1117
- Should only be called by an LLD if the LLD has accepted
1118
- the command (i.e. queuecommand() returned or will return
1119
- 0). The LLD may invoke 'done' prior to queuecommand()
1120
- finishing.
1121
1090
result
1122
1091
- should be set by LLD prior to calling 'done'. A value
1123
1092
of 0 implies a successfully completed command (and all
@@ -1140,13 +1109,13 @@ Members of interest:
1140
1109
device
1141
1110
- pointer to scsi_device object that this command is
1142
1111
associated with.
1143
- resid
1112
+ resid_len (access by calling scsi_set_resid() / scsi_get_resid())
1144
1113
- an LLD should set this unsigned integer to the requested
1145
1114
transfer length (i.e. 'request_bufflen') less the number
1146
- of bytes that are actually transferred. 'resid ' is
1115
+ of bytes that are actually transferred. 'resid_len ' is
1147
1116
preset to 0 so an LLD can ignore it if it cannot detect
1148
1117
underruns (overruns should not be reported). An LLD
1149
- should set 'resid ' prior to invoking 'done'. The most
1118
+ should set 'resid_len ' prior to invoking 'done'. The most
1150
1119
interesting case is data transfers from a SCSI target
1151
1120
device (e.g. READs) that underrun.
1152
1121
underflow
@@ -1155,10 +1124,10 @@ Members of interest:
1155
1124
figure. Not many LLDs implement this check and some that
1156
1125
do just output an error message to the log rather than
1157
1126
report a DID_ERROR. Better for an LLD to implement
1158
- 'resid '.
1127
+ 'resid_len '.
1159
1128
1160
- It is recommended that a LLD set 'resid ' on data transfers from a SCSI
1161
- target device (e.g. READs). It is especially important that 'resid ' is set
1129
+ It is recommended that a LLD set 'resid_len ' on data transfers from a SCSI
1130
+ target device (e.g. READs). It is especially important that 'resid_len ' is set
1162
1131
when such data transfers have sense keys of MEDIUM ERROR and HARDWARE ERROR
1163
1132
(and possibly RECOVERED ERROR). In these cases if a LLD is in doubt how much
1164
1133
data has been received then the safest approach is to indicate no bytes have
@@ -1168,7 +1137,7 @@ a LLD might use these helpers::
1168
1137
scsi_set_resid(SCpnt, scsi_bufflen(SCpnt));
1169
1138
1170
1139
where 'SCpnt' is a pointer to a scsi_cmnd object. To indicate only three 512
1171
- bytes blocks has been received 'resid ' could be set like this::
1140
+ bytes blocks have been received 'resid_len ' could be set like this::
1172
1141
1173
1142
scsi_set_resid(SCpnt, scsi_bufflen(SCpnt) - (3 * 512));
1174
1143
0 commit comments