You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
659 us->max_lun = 0;<br />
660 break;<br />
661<br />
662 case US_SC_QIC:<br />
663 us->protocol_name = "QIC-157";<br />
664 us->proto_handler = usb_stor_qic157_command;<br />
665 us->max_lun = 0;<br />
666 break;<br />
667<br />
668 case US_SC_8070:<br />
669 us->protocol_name = "8070i";<br />
670 us->proto_handler = usb_stor_ATAPI_command;<br />
671 us->max_lun = 0;<br />
672 break;<br />
673<br />
674 case US_SC_SCSI:<br />
675 us->protocol_name = "Transparent SCSI";<br />
53<br />
676 us->proto_handler = usb_stor_transparent_scsi_command;<br />
677 break;<br />
678<br />
679 case US_SC_UFI:<br />
680 us->protocol_name = "Uniform Floppy Interface (UFI)";<br />
681 us->proto_handler = usb_stor_ufi_command;<br />
682 break;<br />
683<br />
684 #ifdef CONFIG_USB_STORAGE_ISD200<br />
685 case US_SC_ISD200:<br />
686 us->protocol_name = "ISD200 ATA/ATAPI";<br />
687 us->proto_handler = isd200_ata_command;<br />
688 break;<br />
689 #endif<br />
690<br />
691 default:<br />
692 return -EIO;<br />
693 }<br />
694 US_DEBUGP("Protocol: %s\n", us->protocol_name);<br />
695 return 0;<br />
696 }<br />
这段代码非常的浅显易懂.我相信即使去问上海火车站附近那些卖黑车的哥们儿,他们也能告诉你这段代码<br />
做了什么.就一件事,根据us->subclass 来判断.对于U 盘来说,spec 里边规定了,它的subclass 是<br />
US_SC_SCSI,所以这里就是两句赋值语句.一个是令us 的protocol_name 为"Transparent SCSI",另<br />
一个是令us 的proto_handler 为usb_stor_transparent_scsi_command.后者又是一个函数指针,我<br />
们日后必将不可避免的遇到这个函数,暂且不表.