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.

240 * device */<br />

241 /* This is always called with scsi_lock(srb->host) held */<br />

242 static int device_reset(struct scsi_cmnd *srb)<br />

243 {<br />

244 struct us_data *us = (struct us_data *)srb->device->host->hostdata[0];<br />

245 int result;<br />

246<br />

247 US_DEBUGP("%s called\n", __FUNCTION__);<br />

248<br />

249 scsi_unlock(srb->device->host);<br />

250<br />

251 /* lock the device pointers and do the reset */<br />

252 down(&(us->dev_semaphore));<br />

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

254 result = FAILED;<br />

255 US_DEBUGP("No reset during disconnect\n");<br />

184<br />

256 } else<br />

257 result = us->transport_reset(us);<br />

258 up(&(us->dev_semaphore));<br />

259<br />

260 /* lock the host for the return */<br />

261 scsi_lock(srb->device->host);<br />

262 return result;<br />

263 }<br />

244 行,没啥好说的,星星还是那颗星星哟,月亮还是那个月亮,山也还是那座山哟,梁也还是那道梁,碾子<br />

是碾子,缸是缸哟,爹是爹来娘是娘,麻油灯啊,还吱吱地响,点的还那么丁点亮,喔哦...喔哦...只有那篱笆墙<br />

影子咋那么长,只有那篱笆墙影子咋那么长,还有那看家的狗叫的叫的叫的叫的咋就这么狂...80 后不可能<br />

没有听过毛阿敏的歌,不可能没有听过这首毛阿敏姐姐的成名作.20 多年过去,星星不再像那颗星星,月亮<br />

也<br />

不象那个月亮,河也不是那条河哟,房也不是那座房.然而,us 还是那个us.就像那篱笆墙,影子还那么长.<br />

253 行,首先看US_FLIDX_DISCONNECTING flag 设了没有.显然,disconnecting 了就没有必要再<br />

reset 了.关于disconnect,你别急,讲完reset 部分就该讲它了.<br />

否则,会调用us->transport_reset,我们前面已经说过了,很久很久以前,我们曾经为<br />

us->transport_reset 赋值为usb_stor_Bulk_reset,所以这里也就是函数usb_stor_Bulk_reset()会<br />

被调用,usb_stor_Bulk_reset 定义于drivers/usb/storage/transport.c 中,<br />

1184 /* This issues a Bulk-only Reset to the device in question, including<br />

1185 * clearing the subsequent endpoint halts that may occur.<br />

1186 */<br />

1187 int usb_stor_Bulk_reset(struct us_data *us)<br />

1188 {<br />

1189 US_DEBUGP("%s called\n", __FUNCTION__);<br />

1190<br />

1191 return usb_stor_reset_common(us, US_BULK_RESET_REQUEST,

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

Saved successfully!

Ooh no, something went wrong!