07.06.2013 Views

Scsi - Index of

Scsi - Index of

Scsi - Index of

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1139 /* Give the device some time to recover from the reset,<br />

1140 * but don't delay disconnect processing. */<br />

1141 wait_event_interruptible_timeout(us->dev_reset_wait,<br />

1142 test_bit(US_FLIDX_DISCONNECTING, &us->flags),<br />

1143 HZ*6);<br />

1144 if (test_bit(US_FLIDX_DISCONNECTING, &us->flags)) {<br />

1145 US_DEBUGP("Reset interrupted by disconnect\n");<br />

1146 goto Done;<br />

1147 }<br />

1148<br />

1149 US_DEBUGP("S<strong>of</strong>t reset: clearing bulk-in endpoint halt\n");<br />

1150 result = usb_stor_clear_halt(us, us->recv_bulk_pipe);<br />

1151<br />

1152 US_DEBUGP("S<strong>of</strong>t reset: clearing bulk-out endpoint halt\n");<br />

186<br />

1153 result2 = usb_stor_clear_halt(us, us->send_bulk_pipe);<br />

1154<br />

1155 /* return a result code based on the result <strong>of</strong> the control message */<br />

1156 if (result < 0 || result2 < 0) {<br />

1157 US_DEBUGP("S<strong>of</strong>t reset failed\n");<br />

1158 goto Done;<br />

1159 }<br />

1160 US_DEBUGP("S<strong>of</strong>t reset done\n");<br />

1161 rc = SUCCESS;<br />

1162<br />

1163 Done:<br />

1164 clear_bit(US_FLIDX_RESETTING, &us->flags);<br />

1165 return rc;<br />

1166 }<br />

前面几行是赋值,然后usb_stor_report_device_reset()被调用. usb_stor_report_device_reset()<br />

定义于drivers/usb/storage/scsiglue.c 中,<br />

308 /* Report a driver-initiated device reset to the SCSI layer.<br />

309 * Calling this for a SCSI-initiated reset is unnecessary but harmless.<br />

310 * The caller must own the SCSI host lock. */<br />

311 void usb_stor_report_device_reset(struct us_data *us)<br />

312 {<br />

313 int i;<br />

314<br />

315 scsi_report_device_reset(us->host, 0, 0);<br />

316 if (us->flags & US_FL_SCM_MULT_TARG) {<br />

317 for (i = 1; i < us->host->max_id; ++i)<br />

318 scsi_report_device_reset(us->host, 0, i);<br />

319 }<br />

320 }

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

Saved successfully!

Ooh no, something went wrong!