scsi_host.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. #ifndef _SCSI_SCSI_HOST_H
  2. #define _SCSI_SCSI_HOST_H
  3. #include <linux/device.h>
  4. #include <linux/list.h>
  5. #include <linux/types.h>
  6. #include <linux/workqueue.h>
  7. #include <linux/mutex.h>
  8. struct block_device;
  9. struct completion;
  10. struct module;
  11. struct scsi_cmnd;
  12. struct scsi_device;
  13. struct scsi_target;
  14. struct Scsi_Host;
  15. struct scsi_host_cmd_pool;
  16. struct scsi_transport_template;
  17. /*
  18. * The various choices mean:
  19. * NONE: Self evident. Host adapter is not capable of scatter-gather.
  20. * ALL: Means that the host adapter module can do scatter-gather,
  21. * and that there is no limit to the size of the table to which
  22. * we scatter/gather data.
  23. * Anything else: Indicates the maximum number of chains that can be
  24. * used in one scatter-gather request.
  25. */
  26. #define SG_NONE 0
  27. #define SG_ALL 0xff
  28. #define DISABLE_CLUSTERING 0
  29. #define ENABLE_CLUSTERING 1
  30. enum scsi_eh_timer_return {
  31. EH_NOT_HANDLED,
  32. EH_HANDLED,
  33. EH_RESET_TIMER,
  34. };
  35. struct scsi_host_template {
  36. struct module *module;
  37. const char *name;
  38. /*
  39. * Used to initialize old-style drivers. For new-style drivers
  40. * just perform all work in your module initialization function.
  41. *
  42. * Status: OBSOLETE
  43. */
  44. int (* detect)(struct scsi_host_template *);
  45. /*
  46. * Used as unload callback for hosts with old-style drivers.
  47. *
  48. * Status: OBSOLETE
  49. */
  50. int (* release)(struct Scsi_Host *);
  51. /*
  52. * The info function will return whatever useful information the
  53. * developer sees fit. If not provided, then the name field will
  54. * be used instead.
  55. *
  56. * Status: OPTIONAL
  57. */
  58. const char *(* info)(struct Scsi_Host *);
  59. /*
  60. * Ioctl interface
  61. *
  62. * Status: OPTIONAL
  63. */
  64. int (* ioctl)(struct scsi_device *dev, int cmd, void __user *arg);
  65. #ifdef CONFIG_COMPAT
  66. /*
  67. * Compat handler. Handle 32bit ABI.
  68. * When unknown ioctl is passed return -ENOIOCTLCMD.
  69. *
  70. * Status: OPTIONAL
  71. */
  72. int (* compat_ioctl)(struct scsi_device *dev, int cmd, void __user *arg);
  73. #endif
  74. /*
  75. * The queuecommand function is used to queue up a scsi
  76. * command block to the LLDD. When the driver finished
  77. * processing the command the done callback is invoked.
  78. *
  79. * If queuecommand returns 0, then the HBA has accepted the
  80. * command. The done() function must be called on the command
  81. * when the driver has finished with it. (you may call done on the
  82. * command before queuecommand returns, but in this case you
  83. * *must* return 0 from queuecommand).
  84. *
  85. * Queuecommand may also reject the command, in which case it may
  86. * not touch the command and must not call done() for it.
  87. *
  88. * There are two possible rejection returns:
  89. *
  90. * SCSI_MLQUEUE_DEVICE_BUSY: Block this device temporarily, but
  91. * allow commands to other devices serviced by this host.
  92. *
  93. * SCSI_MLQUEUE_HOST_BUSY: Block all devices served by this
  94. * host temporarily.
  95. *
  96. * For compatibility, any other non-zero return is treated the
  97. * same as SCSI_MLQUEUE_HOST_BUSY.
  98. *
  99. * NOTE: "temporarily" means either until the next command for#
  100. * this device/host completes, or a period of time determined by
  101. * I/O pressure in the system if there are no other outstanding
  102. * commands.
  103. *
  104. * STATUS: REQUIRED
  105. */
  106. int (* queuecommand)(struct scsi_cmnd *,
  107. void (*done)(struct scsi_cmnd *));
  108. /*
  109. * This is an error handling strategy routine. You don't need to
  110. * define one of these if you don't want to - there is a default
  111. * routine that is present that should work in most cases. For those
  112. * driver authors that have the inclination and ability to write their
  113. * own strategy routine, this is where it is specified. Note - the
  114. * strategy routine is *ALWAYS* run in the context of the kernel eh
  115. * thread. Thus you are guaranteed to *NOT* be in an interrupt
  116. * handler when you execute this, and you are also guaranteed to
  117. * *NOT* have any other commands being queued while you are in the
  118. * strategy routine. When you return from this function, operations
  119. * return to normal.
  120. *
  121. * See scsi_error.c scsi_unjam_host for additional comments about
  122. * what this function should and should not be attempting to do.
  123. *
  124. * Status: REQUIRED (at least one of them)
  125. */
  126. int (* eh_abort_handler)(struct scsi_cmnd *);
  127. int (* eh_device_reset_handler)(struct scsi_cmnd *);
  128. int (* eh_bus_reset_handler)(struct scsi_cmnd *);
  129. int (* eh_host_reset_handler)(struct scsi_cmnd *);
  130. /*
  131. * Before the mid layer attempts to scan for a new device where none
  132. * currently exists, it will call this entry in your driver. Should
  133. * your driver need to allocate any structs or perform any other init
  134. * items in order to send commands to a currently unused target/lun
  135. * combo, then this is where you can perform those allocations. This
  136. * is specifically so that drivers won't have to perform any kind of
  137. * "is this a new device" checks in their queuecommand routine,
  138. * thereby making the hot path a bit quicker.
  139. *
  140. * Return values: 0 on success, non-0 on failure
  141. *
  142. * Deallocation: If we didn't find any devices at this ID, you will
  143. * get an immediate call to slave_destroy(). If we find something
  144. * here then you will get a call to slave_configure(), then the
  145. * device will be used for however long it is kept around, then when
  146. * the device is removed from the system (or * possibly at reboot
  147. * time), you will then get a call to slave_destroy(). This is
  148. * assuming you implement slave_configure and slave_destroy.
  149. * However, if you allocate memory and hang it off the device struct,
  150. * then you must implement the slave_destroy() routine at a minimum
  151. * in order to avoid leaking memory
  152. * each time a device is tore down.
  153. *
  154. * Status: OPTIONAL
  155. */
  156. int (* slave_alloc)(struct scsi_device *);
  157. /*
  158. * Once the device has responded to an INQUIRY and we know the
  159. * device is online, we call into the low level driver with the
  160. * struct scsi_device *. If the low level device driver implements
  161. * this function, it *must* perform the task of setting the queue
  162. * depth on the device. All other tasks are optional and depend
  163. * on what the driver supports and various implementation details.
  164. *
  165. * Things currently recommended to be handled at this time include:
  166. *
  167. * 1. Setting the device queue depth. Proper setting of this is
  168. * described in the comments for scsi_adjust_queue_depth.
  169. * 2. Determining if the device supports the various synchronous
  170. * negotiation protocols. The device struct will already have
  171. * responded to INQUIRY and the results of the standard items
  172. * will have been shoved into the various device flag bits, eg.
  173. * device->sdtr will be true if the device supports SDTR messages.
  174. * 3. Allocating command structs that the device will need.
  175. * 4. Setting the default timeout on this device (if needed).
  176. * 5. Anything else the low level driver might want to do on a device
  177. * specific setup basis...
  178. * 6. Return 0 on success, non-0 on error. The device will be marked
  179. * as offline on error so that no access will occur. If you return
  180. * non-0, your slave_destroy routine will never get called for this
  181. * device, so don't leave any loose memory hanging around, clean
  182. * up after yourself before returning non-0
  183. *
  184. * Status: OPTIONAL
  185. */
  186. int (* slave_configure)(struct scsi_device *);
  187. /*
  188. * Immediately prior to deallocating the device and after all activity
  189. * has ceased the mid layer calls this point so that the low level
  190. * driver may completely detach itself from the scsi device and vice
  191. * versa. The low level driver is responsible for freeing any memory
  192. * it allocated in the slave_alloc or slave_configure calls.
  193. *
  194. * Status: OPTIONAL
  195. */
  196. void (* slave_destroy)(struct scsi_device *);
  197. /*
  198. * Before the mid layer attempts to scan for a new device attached
  199. * to a target where no target currently exists, it will call this
  200. * entry in your driver. Should your driver need to allocate any
  201. * structs or perform any other init items in order to send commands
  202. * to a currently unused target, then this is where you can perform
  203. * those allocations.
  204. *
  205. * Return values: 0 on success, non-0 on failure
  206. *
  207. * Status: OPTIONAL
  208. */
  209. int (* target_alloc)(struct scsi_target *);
  210. /*
  211. * Immediately prior to deallocating the target structure, and
  212. * after all activity to attached scsi devices has ceased, the
  213. * midlayer calls this point so that the driver may deallocate
  214. * and terminate any references to the target.
  215. *
  216. * Status: OPTIONAL
  217. */
  218. void (* target_destroy)(struct scsi_target *);
  219. /*
  220. * fill in this function to allow the queue depth of this host
  221. * to be changeable (on a per device basis). returns either
  222. * the current queue depth setting (may be different from what
  223. * was passed in) or an error. An error should only be
  224. * returned if the requested depth is legal but the driver was
  225. * unable to set it. If the requested depth is illegal, the
  226. * driver should set and return the closest legal queue depth.
  227. *
  228. */
  229. int (* change_queue_depth)(struct scsi_device *, int);
  230. /*
  231. * fill in this function to allow the changing of tag types
  232. * (this also allows the enabling/disabling of tag command
  233. * queueing). An error should only be returned if something
  234. * went wrong in the driver while trying to set the tag type.
  235. * If the driver doesn't support the requested tag type, then
  236. * it should set the closest type it does support without
  237. * returning an error. Returns the actual tag type set.
  238. */
  239. int (* change_queue_type)(struct scsi_device *, int);
  240. /*
  241. * This function determines the bios parameters for a given
  242. * harddisk. These tend to be numbers that are made up by
  243. * the host adapter. Parameters:
  244. * size, device, list (heads, sectors, cylinders)
  245. *
  246. * Status: OPTIONAL */
  247. int (* bios_param)(struct scsi_device *, struct block_device *,
  248. sector_t, int []);
  249. /*
  250. * Can be used to export driver statistics and other infos to the
  251. * world outside the kernel ie. userspace and it also provides an
  252. * interface to feed the driver with information.
  253. *
  254. * Status: OBSOLETE
  255. */
  256. int (*proc_info)(struct Scsi_Host *, char *, char **, off_t, int, int);
  257. /*
  258. * suspend support
  259. */
  260. int (*resume)(struct scsi_device *);
  261. int (*suspend)(struct scsi_device *, pm_message_t state);
  262. /*
  263. * Name of proc directory
  264. */
  265. char *proc_name;
  266. /*
  267. * Used to store the procfs directory if a driver implements the
  268. * proc_info method.
  269. */
  270. struct proc_dir_entry *proc_dir;
  271. /*
  272. * This determines if we will use a non-interrupt driven
  273. * or an interrupt driven scheme, It is set to the maximum number
  274. * of simultaneous commands a given host adapter will accept.
  275. */
  276. int can_queue;
  277. /*
  278. * In many instances, especially where disconnect / reconnect are
  279. * supported, our host also has an ID on the SCSI bus. If this is
  280. * the case, then it must be reserved. Please set this_id to -1 if
  281. * your setup is in single initiator mode, and the host lacks an
  282. * ID.
  283. */
  284. int this_id;
  285. /*
  286. * This determines the degree to which the host adapter is capable
  287. * of scatter-gather.
  288. */
  289. unsigned short sg_tablesize;
  290. /*
  291. * If the host adapter has limitations beside segment count
  292. */
  293. unsigned short max_sectors;
  294. /*
  295. * dma scatter gather segment boundary limit. a segment crossing this
  296. * boundary will be split in two.
  297. */
  298. unsigned long dma_boundary;
  299. /*
  300. * This specifies "machine infinity" for host templates which don't
  301. * limit the transfer size. Note this limit represents an absolute
  302. * maximum, and may be over the transfer limits allowed for
  303. * individual devices (e.g. 256 for SCSI-1)
  304. */
  305. #define SCSI_DEFAULT_MAX_SECTORS 1024
  306. /*
  307. * True if this host adapter can make good use of linked commands.
  308. * This will allow more than one command to be queued to a given
  309. * unit on a given host. Set this to the maximum number of command
  310. * blocks to be provided for each device. Set this to 1 for one
  311. * command block per lun, 2 for two, etc. Do not set this to 0.
  312. * You should make sure that the host adapter will do the right thing
  313. * before you try setting this above 1.
  314. */
  315. short cmd_per_lun;
  316. /*
  317. * present contains counter indicating how many boards of this
  318. * type were found when we did the scan.
  319. */
  320. unsigned char present;
  321. /*
  322. * true if this host adapter uses unchecked DMA onto an ISA bus.
  323. */
  324. unsigned unchecked_isa_dma:1;
  325. /*
  326. * true if this host adapter can make good use of clustering.
  327. * I originally thought that if the tablesize was large that it
  328. * was a waste of CPU cycles to prepare a cluster list, but
  329. * it works out that the Buslogic is faster if you use a smaller
  330. * number of segments (i.e. use clustering). I guess it is
  331. * inefficient.
  332. */
  333. unsigned use_clustering:1;
  334. /*
  335. * True for emulated SCSI host adapters (e.g. ATAPI)
  336. */
  337. unsigned emulated:1;
  338. /*
  339. * True if the low-level driver performs its own reset-settle delays.
  340. */
  341. unsigned skip_settle_delay:1;
  342. /*
  343. * ordered write support
  344. */
  345. unsigned ordered_tag:1;
  346. /*
  347. * Countdown for host blocking with no commands outstanding
  348. */
  349. unsigned int max_host_blocked;
  350. /*
  351. * Default value for the blocking. If the queue is empty,
  352. * host_blocked counts down in the request_fn until it restarts
  353. * host operations as zero is reached.
  354. *
  355. * FIXME: This should probably be a value in the template
  356. */
  357. #define SCSI_DEFAULT_HOST_BLOCKED 7
  358. /*
  359. * Pointer to the sysfs class properties for this host, NULL terminated.
  360. */
  361. struct class_device_attribute **shost_attrs;
  362. /*
  363. * Pointer to the SCSI device properties for this host, NULL terminated.
  364. */
  365. struct device_attribute **sdev_attrs;
  366. /*
  367. * List of hosts per template.
  368. *
  369. * This is only for use by scsi_module.c for legacy templates.
  370. * For these access to it is synchronized implicitly by
  371. * module_init/module_exit.
  372. */
  373. struct list_head legacy_hosts;
  374. };
  375. /*
  376. * shost state: If you alter this, you also need to alter scsi_sysfs.c
  377. * (for the ascii descriptions) and the state model enforcer:
  378. * scsi_host_set_state()
  379. */
  380. enum scsi_host_state {
  381. SHOST_CREATED = 1,
  382. SHOST_RUNNING,
  383. SHOST_CANCEL,
  384. SHOST_DEL,
  385. SHOST_RECOVERY,
  386. SHOST_CANCEL_RECOVERY,
  387. SHOST_DEL_RECOVERY,
  388. };
  389. struct Scsi_Host {
  390. /*
  391. * __devices is protected by the host_lock, but you should
  392. * usually use scsi_device_lookup / shost_for_each_device
  393. * to access it and don't care about locking yourself.
  394. * In the rare case of beeing in irq context you can use
  395. * their __ prefixed variants with the lock held. NEVER
  396. * access this list directly from a driver.
  397. */
  398. struct list_head __devices;
  399. struct list_head __targets;
  400. struct scsi_host_cmd_pool *cmd_pool;
  401. spinlock_t free_list_lock;
  402. struct list_head free_list; /* backup store of cmd structs */
  403. struct list_head starved_list;
  404. spinlock_t default_lock;
  405. spinlock_t *host_lock;
  406. struct mutex scan_mutex;/* serialize scanning activity */
  407. struct list_head eh_cmd_q;
  408. struct task_struct * ehandler; /* Error recovery thread. */
  409. struct completion * eh_action; /* Wait for specific actions on the
  410. host. */
  411. wait_queue_head_t host_wait;
  412. struct scsi_host_template *hostt;
  413. struct scsi_transport_template *transportt;
  414. /*
  415. * The following two fields are protected with host_lock;
  416. * however, eh routines can safely access during eh processing
  417. * without acquiring the lock.
  418. */
  419. unsigned int host_busy; /* commands actually active on low-level */
  420. unsigned int host_failed; /* commands that failed. */
  421. unsigned short host_no; /* Used for IOCTL_GET_IDLUN, /proc/scsi et al. */
  422. int resetting; /* if set, it means that last_reset is a valid value */
  423. unsigned long last_reset;
  424. /*
  425. * These three parameters can be used to allow for wide scsi,
  426. * and for host adapters that support multiple busses
  427. * The first two should be set to 1 more than the actual max id
  428. * or lun (i.e. 8 for normal systems).
  429. */
  430. unsigned int max_id;
  431. unsigned int max_lun;
  432. unsigned int max_channel;
  433. /*
  434. * This is a unique identifier that must be assigned so that we
  435. * have some way of identifying each detected host adapter properly
  436. * and uniquely. For hosts that do not support more than one card
  437. * in the system at one time, this does not need to be set. It is
  438. * initialized to 0 in scsi_register.
  439. */
  440. unsigned int unique_id;
  441. /*
  442. * The maximum length of SCSI commands that this host can accept.
  443. * Probably 12 for most host adapters, but could be 16 for others.
  444. * For drivers that don't set this field, a value of 12 is
  445. * assumed. I am leaving this as a number rather than a bit
  446. * because you never know what subsequent SCSI standards might do
  447. * (i.e. could there be a 20 byte or a 24-byte command a few years
  448. * down the road?).
  449. */
  450. unsigned char max_cmd_len;
  451. int this_id;
  452. int can_queue;
  453. short cmd_per_lun;
  454. short unsigned int sg_tablesize;
  455. short unsigned int max_sectors;
  456. unsigned long dma_boundary;
  457. /*
  458. * Used to assign serial numbers to the cmds.
  459. * Protected by the host lock.
  460. */
  461. unsigned long cmd_serial_number, cmd_pid;
  462. unsigned unchecked_isa_dma:1;
  463. unsigned use_clustering:1;
  464. unsigned use_blk_tcq:1;
  465. /*
  466. * Host has requested that no further requests come through for the
  467. * time being.
  468. */
  469. unsigned host_self_blocked:1;
  470. /*
  471. * Host uses correct SCSI ordering not PC ordering. The bit is
  472. * set for the minority of drivers whose authors actually read
  473. * the spec ;)
  474. */
  475. unsigned reverse_ordering:1;
  476. /*
  477. * ordered write support
  478. */
  479. unsigned ordered_tag:1;
  480. /*
  481. * Optional work queue to be utilized by the transport
  482. */
  483. char work_q_name[KOBJ_NAME_LEN];
  484. struct workqueue_struct *work_q;
  485. /*
  486. * Host has rejected a command because it was busy.
  487. */
  488. unsigned int host_blocked;
  489. /*
  490. * Value host_blocked counts down from
  491. */
  492. unsigned int max_host_blocked;
  493. /* legacy crap */
  494. unsigned long base;
  495. unsigned long io_port;
  496. unsigned char n_io_port;
  497. unsigned char dma_channel;
  498. unsigned int irq;
  499. enum scsi_host_state shost_state;
  500. /* ldm bits */
  501. struct device shost_gendev;
  502. struct class_device shost_classdev;
  503. /*
  504. * List of hosts per template.
  505. *
  506. * This is only for use by scsi_module.c for legacy templates.
  507. * For these access to it is synchronized implicitly by
  508. * module_init/module_exit.
  509. */
  510. struct list_head sht_legacy_list;
  511. /*
  512. * Points to the transport data (if any) which is allocated
  513. * separately
  514. */
  515. void *shost_data;
  516. /*
  517. * We should ensure that this is aligned, both for better performance
  518. * and also because some compilers (m68k) don't automatically force
  519. * alignment to a long boundary.
  520. */
  521. unsigned long hostdata[0] /* Used for storage of host specific stuff */
  522. __attribute__ ((aligned (sizeof(unsigned long))));
  523. };
  524. #define class_to_shost(d) \
  525. container_of(d, struct Scsi_Host, shost_classdev)
  526. #define shost_printk(prefix, shost, fmt, a...) \
  527. dev_printk(prefix, &(shost)->shost_gendev, fmt, ##a)
  528. int scsi_is_host_device(const struct device *);
  529. static inline struct Scsi_Host *dev_to_shost(struct device *dev)
  530. {
  531. while (!scsi_is_host_device(dev)) {
  532. if (!dev->parent)
  533. return NULL;
  534. dev = dev->parent;
  535. }
  536. return container_of(dev, struct Scsi_Host, shost_gendev);
  537. }
  538. static inline int scsi_host_in_recovery(struct Scsi_Host *shost)
  539. {
  540. return shost->shost_state == SHOST_RECOVERY ||
  541. shost->shost_state == SHOST_CANCEL_RECOVERY ||
  542. shost->shost_state == SHOST_DEL_RECOVERY;
  543. }
  544. extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *);
  545. extern void scsi_flush_work(struct Scsi_Host *);
  546. extern struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *, int);
  547. extern int __must_check scsi_add_host(struct Scsi_Host *, struct device *);
  548. extern void scsi_scan_host(struct Scsi_Host *);
  549. extern void scsi_rescan_device(struct device *);
  550. extern void scsi_remove_host(struct Scsi_Host *);
  551. extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *);
  552. extern void scsi_host_put(struct Scsi_Host *t);
  553. extern struct Scsi_Host *scsi_host_lookup(unsigned short);
  554. extern const char *scsi_host_state_name(enum scsi_host_state);
  555. extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *);
  556. static inline void scsi_assign_lock(struct Scsi_Host *shost, spinlock_t *lock)
  557. {
  558. shost->host_lock = lock;
  559. }
  560. static inline struct device *scsi_get_device(struct Scsi_Host *shost)
  561. {
  562. return shost->shost_gendev.parent;
  563. }
  564. /**
  565. * scsi_host_scan_allowed - Is scanning of this host allowed
  566. * @shost: Pointer to Scsi_Host.
  567. **/
  568. static inline int scsi_host_scan_allowed(struct Scsi_Host *shost)
  569. {
  570. return shost->shost_state == SHOST_RUNNING;
  571. }
  572. extern void scsi_unblock_requests(struct Scsi_Host *);
  573. extern void scsi_block_requests(struct Scsi_Host *);
  574. struct class_container;
  575. /*
  576. * These two functions are used to allocate and free a pseudo device
  577. * which will connect to the host adapter itself rather than any
  578. * physical device. You must deallocate when you are done with the
  579. * thing. This physical pseudo-device isn't real and won't be available
  580. * from any high-level drivers.
  581. */
  582. extern void scsi_free_host_dev(struct scsi_device *);
  583. extern struct scsi_device *scsi_get_host_dev(struct Scsi_Host *);
  584. /* legacy interfaces */
  585. extern struct Scsi_Host *scsi_register(struct scsi_host_template *, int);
  586. extern void scsi_unregister(struct Scsi_Host *);
  587. extern int scsi_host_set_state(struct Scsi_Host *, enum scsi_host_state);
  588. #endif /* _SCSI_SCSI_HOST_H */