scsi_host.h 21 KB

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