scsi_host.h 21 KB

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