You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
547 }<br />
469 行,不多说,dev 还是那个dev.<br />
470 行,struct usb_interface_descriptor *idesc,这个也无须再说,之前那个associate_dev 函数里<br />
已经介绍过这个结构体,而且整个故事就是针对一个interface 的,一个interface 就对应一个interface<br />
描<br />
述符.所以不管在哪里看到,她总还是她.<br />
472 行, struct us_unusual_dev,这个结构体是第一次出现,她定义于drivers/usb/storage/usb.h 中,<br />
55 /*<br />
56 * Unusual device list definitions<br />
57 */<br />
58<br />
59 struct us_unusual_dev {<br />
60 const char* vendorName;<br />
61 const char* productName;<br />
62 __u8 useProtocol;<br />
63 __u8 useTransport;<br />
64 int (*initFunction)(struct us_data *);<br />
65 unsigned int flags;<br />
66 };<br />
而等号右边的us_unusal_dev_list 是一个数组,定义于drivers/usb/storage/usb.c:<br />
157 /* This is the list <strong>of</strong> devices we recognize, along with their flag data */<br />
158<br />
159 /* The vendor name should be kept at eight characters or less, and<br />
160 * the product name should be kept at 16 characters or less. If a device<br />
161 * has the US_FL_FIX_INQUIRY flag, then the vendor and product names<br />
162 * normally generated by a device thorugh the INQUIRY response will be<br />
163 * taken from this list, and this is the reason for the above size<br />
164 * restriction. However, if the flag is not present, then you<br />
165 * are free to use as many characters as you like.<br />
166 */<br />
167<br />
168 #undef UNUSUAL_DEV<br />
169 #define UNUSUAL_DEV(idVendor, idProduct, bcdDeviceMin, bcdDeviceMax, \<br />
40<br />
170 vendor_name, product_name, use_protocol, use_transport,<br />
\<br />
171 init_function, Flags) \<br />
172 { \<br />
173 .vendorName = vendor_name, \<br />
174 .productName = product_name, \<br />
175 .useProtocol = use_protocol, \<br />
176 .useTransport = use_transport, \<br />
177 .initFunction = init_function, \<br />
178 .flags = Flags, \