07.06.2013 Views

Scsi - Index of

Scsi - Index of

Scsi - Index of

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

99 * one <strong>of</strong> the luns for the device at a<br />

100 * time. */<br />

101 unsigned was_reset:1; /* There was a bus reset on the bus for<br />

102 * this device */<br />

103 unsigned expecting_cc_ua:1; /* Expecting a<br />

CHECK_CONDITION/UNIT_ATTN<br />

104 * because we did a bus reset. */<br />

105 unsigned use_10_for_rw:1; /* first try 10-byte read / write */<br />

106 unsigned use_10_for_ms:1; /* first try 10-byte mode sense/select */<br />

107 unsigned skip_ms_page_8:1; /* do not use MODE SENSE page 0x08<br />

*/<br />

108 unsigned skip_ms_page_3f:1; /* do not use MODE SENSE page 0x3f */<br />

109 unsigned use_192_bytes_for_3f:1; /* ask for 192 bytes from page 0x3f */<br />

110 unsigned no_start_on_add:1; /* do not issue start on add */<br />

111 unsigned allow_restart:1; /* issue START_UNIT in error handler */<br />

112 unsigned no_uld_attach:1; /* disable connecting to upper level drivers */<br />

113 unsigned select_no_atn:1;<br />

114 unsigned fix_capacity:1; /* READ_CAPACITY is too high by 1 */<br />

115<br />

116 unsigned int device_blocked; /* Device returned QUEUE_FULL. */<br />

117<br />

118 unsigned int max_device_blocked; /* what device_blocked counts down<br />

from */<br />

119 #define SCSI_DEFAULT_DEVICE_BLOCKED 3<br />

120<br />

121 int timeout;<br />

122<br />

123 struct device sdev_gendev;<br />

124 struct class_device sdev_classdev;<br />

125<br />

126 struct class_device transport_classdev;<br />

127<br />

128 enum scsi_device_state sdev_state;<br />

129 unsigned long sdev_data[0];<br />

130 } __attribute__((aligned(size<strong>of</strong>(unsigned long))));<br />

这个结构体将在未来的日子里被我们多次提到.当然,此刻,我们只需要注意到unsigned int id, lun,<br />

channel 这三个成员,这正是定位一个scsi 设备必要的三个成员,一个scsi 卡所控制的设备被划分为几<br />

层,<br />

先是若干个channel,然后每个channel 上有若干个target,每个target 用一个target id 来表征,然后一<br />

个target 可以有若干个lun,而咱们这里判断的是target id.对于不支持多个target 的设备,她必须为0.<br />

对于绝大多数usb mass storage 设备来说,它们的target id 肯定为0,但是世界上总是有那么多怪事,有<br />

些设备厂家就是要标新立异,它就是要让你个设备支持多个target,于是它就可以设置<br />

127<br />

US_FL_SCM_MULT_TARG 这么一个flag,比如我们可以在drivers/usb/storage/unusual_devs.h

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!