Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
458 .emulated = 1,<br />
459<br />
460 /* we do our own delay after a device or bus reset */<br />
461 .skip_settle_delay = 1,<br />
462<br />
463 /* sysfs device attributes */<br />
464 .sdev_attrs = sysfs_device_attr_list,<br />
465<br />
466 /* module management */<br />
467 .module = THIS_MODULE<br />
468 };<br />
如果您觉得眼前这个结构体变量的定义或者说初始化很复杂,那么您错了.因为下面您将看到一个更变态<br />
的数据结构的定义,她就是传说中的struct scsi_host_template,她是scsi 子系统定义的结构体,来自<br />
include/scsi/scsi_host.h 文件:<br />
40 struct scsi_host_template {<br />
41 struct module *module;<br />
42 const char *name;<br />
43<br />
44 /*<br />
45 * Used to initialize old-style drivers. For new-style drivers<br />
46 * just perform all work in your module initialization function.<br />
47 *<br />
48 * Status: OBSOLETE<br />
49 */<br />
50 int (* detect)(struct scsi_host_template *);<br />
51<br />
52 /*<br />
53 * Used as unload callback for hosts with old-style drivers.<br />
54 *<br />
55 * Status: OBSOLETE<br />
56 */<br />
57 int (* release)(struct <strong>Scsi</strong>_Host *);<br />
58<br />
59 /*<br />
60 * The info function will return whatever useful information the<br />
61 * developer sees fit. If not provided, then the name field will<br />
62 * be used instead.<br />
63 *<br />
64 * Status: OPTIONAL<br />
95<br />
65 */<br />
66 const char *(* info)(struct <strong>Scsi</strong>_Host *);<br />
67<br />
68 /*