dasd_int.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. /*
  2. * File...........: linux/drivers/s390/block/dasd_int.h
  3. * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com>
  4. * Horst Hummel <Horst.Hummel@de.ibm.com>
  5. * Martin Schwidefsky <schwidefsky@de.ibm.com>
  6. * Bugreports.to..: <Linux390@de.ibm.com>
  7. * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
  8. *
  9. */
  10. #ifndef DASD_INT_H
  11. #define DASD_INT_H
  12. #ifdef __KERNEL__
  13. /* we keep old device allocation scheme; IOW, minors are still in 0..255 */
  14. #define DASD_PER_MAJOR (1U << (MINORBITS - DASD_PARTN_BITS))
  15. #define DASD_PARTN_MASK ((1 << DASD_PARTN_BITS) - 1)
  16. /*
  17. * States a dasd device can have:
  18. * new: the dasd_device structure is allocated.
  19. * known: the discipline for the device is identified.
  20. * basic: the device can do basic i/o.
  21. * unfmt: the device could not be analyzed (format is unknown).
  22. * ready: partition detection is done and the device is can do block io.
  23. * online: the device accepts requests from the block device queue.
  24. *
  25. * Things to do for startup state transitions:
  26. * new -> known: find discipline for the device and create devfs entries.
  27. * known -> basic: request irq line for the device.
  28. * basic -> ready: do the initial analysis, e.g. format detection,
  29. * do block device setup and detect partitions.
  30. * ready -> online: schedule the device tasklet.
  31. * Things to do for shutdown state transitions:
  32. * online -> ready: just set the new device state.
  33. * ready -> basic: flush requests from the block device layer, clear
  34. * partition information and reset format information.
  35. * basic -> known: terminate all requests and free irq.
  36. * known -> new: remove devfs entries and forget discipline.
  37. */
  38. #define DASD_STATE_NEW 0
  39. #define DASD_STATE_KNOWN 1
  40. #define DASD_STATE_BASIC 2
  41. #define DASD_STATE_UNFMT 3
  42. #define DASD_STATE_READY 4
  43. #define DASD_STATE_ONLINE 5
  44. #include <linux/module.h>
  45. #include <linux/wait.h>
  46. #include <linux/blkdev.h>
  47. #include <linux/genhd.h>
  48. #include <linux/hdreg.h>
  49. #include <linux/interrupt.h>
  50. #include <asm/ccwdev.h>
  51. #include <linux/workqueue.h>
  52. #include <asm/debug.h>
  53. #include <asm/dasd.h>
  54. #include <asm/idals.h>
  55. /*
  56. * SECTION: Type definitions
  57. */
  58. struct dasd_device;
  59. typedef enum {
  60. dasd_era_fatal = -1, /* no chance to recover */
  61. dasd_era_none = 0, /* don't recover, everything alright */
  62. dasd_era_msg = 1, /* don't recover, just report... */
  63. dasd_era_recover = 2 /* recovery action recommended */
  64. } dasd_era_t;
  65. /* BIT DEFINITIONS FOR SENSE DATA */
  66. #define DASD_SENSE_BIT_0 0x80
  67. #define DASD_SENSE_BIT_1 0x40
  68. #define DASD_SENSE_BIT_2 0x20
  69. #define DASD_SENSE_BIT_3 0x10
  70. /*
  71. * SECTION: MACROs for klogd and s390 debug feature (dbf)
  72. */
  73. #define DBF_DEV_EVENT(d_level, d_device, d_str, d_data...) \
  74. do { \
  75. debug_sprintf_event(d_device->debug_area, \
  76. d_level, \
  77. d_str "\n", \
  78. d_data); \
  79. } while(0)
  80. #define DBF_DEV_EXC(d_level, d_device, d_str, d_data...) \
  81. do { \
  82. debug_sprintf_exception(d_device->debug_area, \
  83. d_level, \
  84. d_str "\n", \
  85. d_data); \
  86. } while(0)
  87. #define DBF_EVENT(d_level, d_str, d_data...)\
  88. do { \
  89. debug_sprintf_event(dasd_debug_area, \
  90. d_level,\
  91. d_str "\n", \
  92. d_data); \
  93. } while(0)
  94. #define DBF_EXC(d_level, d_str, d_data...)\
  95. do { \
  96. debug_sprintf_exception(dasd_debug_area, \
  97. d_level,\
  98. d_str "\n", \
  99. d_data); \
  100. } while(0)
  101. /* definition of dbf debug levels */
  102. #define DBF_EMERG 0 /* system is unusable */
  103. #define DBF_ALERT 1 /* action must be taken immediately */
  104. #define DBF_CRIT 2 /* critical conditions */
  105. #define DBF_ERR 3 /* error conditions */
  106. #define DBF_WARNING 4 /* warning conditions */
  107. #define DBF_NOTICE 5 /* normal but significant condition */
  108. #define DBF_INFO 6 /* informational */
  109. #define DBF_DEBUG 6 /* debug-level messages */
  110. /* messages to be written via klogd and dbf */
  111. #define DEV_MESSAGE(d_loglevel,d_device,d_string,d_args...)\
  112. do { \
  113. printk(d_loglevel PRINTK_HEADER " %s: " d_string "\n", \
  114. d_device->cdev->dev.bus_id, d_args); \
  115. DBF_DEV_EVENT(DBF_ALERT, d_device, d_string, d_args); \
  116. } while(0)
  117. #define MESSAGE(d_loglevel,d_string,d_args...)\
  118. do { \
  119. printk(d_loglevel PRINTK_HEADER " " d_string "\n", d_args); \
  120. DBF_EVENT(DBF_ALERT, d_string, d_args); \
  121. } while(0)
  122. /* messages to be written via klogd only */
  123. #define DEV_MESSAGE_LOG(d_loglevel,d_device,d_string,d_args...)\
  124. do { \
  125. printk(d_loglevel PRINTK_HEADER " %s: " d_string "\n", \
  126. d_device->cdev->dev.bus_id, d_args); \
  127. } while(0)
  128. #define MESSAGE_LOG(d_loglevel,d_string,d_args...)\
  129. do { \
  130. printk(d_loglevel PRINTK_HEADER " " d_string "\n", d_args); \
  131. } while(0)
  132. struct dasd_ccw_req {
  133. unsigned int magic; /* Eye catcher */
  134. struct list_head list; /* list_head for request queueing. */
  135. /* Where to execute what... */
  136. struct dasd_device *device; /* device the request is for */
  137. struct ccw1 *cpaddr; /* address of channel program */
  138. char status; /* status of this request */
  139. short retries; /* A retry counter */
  140. unsigned long flags; /* flags of this request */
  141. /* ... and how */
  142. unsigned long starttime; /* jiffies time of request start */
  143. int expires; /* expiration period in jiffies */
  144. char lpm; /* logical path mask */
  145. void *data; /* pointer to data area */
  146. /* these are important for recovering erroneous requests */
  147. struct irb irb; /* device status in case of an error */
  148. struct dasd_ccw_req *refers; /* ERP-chain queueing. */
  149. void *function; /* originating ERP action */
  150. /* these are for statistics only */
  151. unsigned long long buildclk; /* TOD-clock of request generation */
  152. unsigned long long startclk; /* TOD-clock of request start */
  153. unsigned long long stopclk; /* TOD-clock of request interrupt */
  154. unsigned long long endclk; /* TOD-clock of request termination */
  155. /* Callback that is called after reaching final status. */
  156. void (*callback)(struct dasd_ccw_req *, void *data);
  157. void *callback_data;
  158. };
  159. /*
  160. * dasd_ccw_req -> status can be:
  161. */
  162. #define DASD_CQR_FILLED 0x00 /* request is ready to be processed */
  163. #define DASD_CQR_QUEUED 0x01 /* request is queued to be processed */
  164. #define DASD_CQR_IN_IO 0x02 /* request is currently in IO */
  165. #define DASD_CQR_DONE 0x03 /* request is completed successfully */
  166. #define DASD_CQR_ERROR 0x04 /* request is completed with error */
  167. #define DASD_CQR_FAILED 0x05 /* request is finally failed */
  168. #define DASD_CQR_CLEAR 0x06 /* request is clear pending */
  169. /* per dasd_ccw_req flags */
  170. #define DASD_CQR_FLAGS_USE_ERP 0 /* use ERP for this request */
  171. #define DASD_CQR_FLAGS_FAILFAST 1 /* FAILFAST */
  172. /* Signature for error recovery functions. */
  173. typedef struct dasd_ccw_req *(*dasd_erp_fn_t) (struct dasd_ccw_req *);
  174. /*
  175. * the struct dasd_discipline is
  176. * sth like a table of virtual functions, if you think of dasd_eckd
  177. * inheriting dasd...
  178. * no, currently we are not planning to reimplement the driver in C++
  179. */
  180. struct dasd_discipline {
  181. struct module *owner;
  182. char ebcname[8]; /* a name used for tagging and printks */
  183. char name[8]; /* a name used for tagging and printks */
  184. int max_blocks; /* maximum number of blocks to be chained */
  185. struct list_head list; /* used for list of disciplines */
  186. /*
  187. * Device recognition functions. check_device is used to verify
  188. * the sense data and the information returned by read device
  189. * characteristics. It returns 0 if the discipline can be used
  190. * for the device in question.
  191. * do_analysis is used in the step from device state "basic" to
  192. * state "accept". It returns 0 if the device can be made ready,
  193. * it returns -EMEDIUMTYPE if the device can't be made ready or
  194. * -EAGAIN if do_analysis started a ccw that needs to complete
  195. * before the analysis may be repeated.
  196. */
  197. int (*check_device)(struct dasd_device *);
  198. int (*do_analysis) (struct dasd_device *);
  199. /*
  200. * Device operation functions. build_cp creates a ccw chain for
  201. * a block device request, start_io starts the request and
  202. * term_IO cancels it (e.g. in case of a timeout). format_device
  203. * returns a ccw chain to be used to format the device.
  204. */
  205. struct dasd_ccw_req *(*build_cp) (struct dasd_device *,
  206. struct request *);
  207. int (*start_IO) (struct dasd_ccw_req *);
  208. int (*term_IO) (struct dasd_ccw_req *);
  209. struct dasd_ccw_req *(*format_device) (struct dasd_device *,
  210. struct format_data_t *);
  211. int (*free_cp) (struct dasd_ccw_req *, struct request *);
  212. /*
  213. * Error recovery functions. examine_error() returns a value that
  214. * indicates what to do for an error condition. If examine_error()
  215. * returns 'dasd_era_recover' erp_action() is called to create a
  216. * special error recovery ccw. erp_postaction() is called after
  217. * an error recovery ccw has finished its execution. dump_sense
  218. * is called for every error condition to print the sense data
  219. * to the console.
  220. */
  221. dasd_era_t(*examine_error) (struct dasd_ccw_req *, struct irb *);
  222. dasd_erp_fn_t(*erp_action) (struct dasd_ccw_req *);
  223. dasd_erp_fn_t(*erp_postaction) (struct dasd_ccw_req *);
  224. void (*dump_sense) (struct dasd_device *, struct dasd_ccw_req *,
  225. struct irb *);
  226. /* i/o control functions. */
  227. int (*fill_geometry) (struct dasd_device *, struct hd_geometry *);
  228. int (*fill_info) (struct dasd_device *, struct dasd_information2_t *);
  229. int (*ioctl) (struct dasd_device *, unsigned int, void __user *);
  230. };
  231. extern struct dasd_discipline *dasd_diag_discipline_pointer;
  232. /*
  233. * Unique identifier for dasd device.
  234. */
  235. struct dasd_uid {
  236. __u8 alias;
  237. char vendor[4];
  238. char serial[15];
  239. __u16 ssid;
  240. __u8 unit_addr;
  241. };
  242. /*
  243. * Notification numbers for extended error reporting notifications:
  244. * The DASD_EER_DISABLE notification is sent before a dasd_device (and it's
  245. * eer pointer) is freed. The error reporting module needs to do all necessary
  246. * cleanup steps.
  247. * The DASD_EER_TRIGGER notification sends the actual error reports (triggers).
  248. */
  249. #define DASD_EER_DISABLE 0
  250. #define DASD_EER_TRIGGER 1
  251. /* Trigger IDs for extended error reporting DASD_EER_TRIGGER notification */
  252. #define DASD_EER_FATALERROR 1
  253. #define DASD_EER_NOPATH 2
  254. #define DASD_EER_STATECHANGE 3
  255. #define DASD_EER_PPRCSUSPEND 4
  256. struct dasd_device {
  257. /* Block device stuff. */
  258. struct gendisk *gdp;
  259. request_queue_t *request_queue;
  260. spinlock_t request_queue_lock;
  261. struct block_device *bdev;
  262. unsigned int devindex;
  263. unsigned long blocks; /* size of volume in blocks */
  264. unsigned int bp_block; /* bytes per block */
  265. unsigned int s2b_shift; /* log2 (bp_block/512) */
  266. unsigned long flags; /* per device flags */
  267. unsigned short features; /* copy of devmap-features (read-only!) */
  268. /* extended error reporting stuff (eer) */
  269. struct dasd_ccw_req *eer_cqr;
  270. /* Device discipline stuff. */
  271. struct dasd_discipline *discipline;
  272. struct dasd_discipline *base_discipline;
  273. char *private;
  274. /* Device state and target state. */
  275. int state, target;
  276. int stopped; /* device (ccw_device_start) was stopped */
  277. /* Open and reference count. */
  278. atomic_t ref_count;
  279. atomic_t open_count;
  280. /* ccw queue and memory for static ccw/erp buffers. */
  281. struct list_head ccw_queue;
  282. spinlock_t mem_lock;
  283. void *ccw_mem;
  284. void *erp_mem;
  285. struct list_head ccw_chunks;
  286. struct list_head erp_chunks;
  287. atomic_t tasklet_scheduled;
  288. struct tasklet_struct tasklet;
  289. struct work_struct kick_work;
  290. struct timer_list timer;
  291. debug_info_t *debug_area;
  292. struct ccw_device *cdev;
  293. #ifdef CONFIG_DASD_PROFILE
  294. struct dasd_profile_info_t profile;
  295. #endif
  296. };
  297. /* reasons why device (ccw_device_start) was stopped */
  298. #define DASD_STOPPED_NOT_ACC 1 /* not accessible */
  299. #define DASD_STOPPED_QUIESCE 2 /* Quiesced */
  300. #define DASD_STOPPED_PENDING 4 /* long busy */
  301. #define DASD_STOPPED_DC_WAIT 8 /* disconnected, wait */
  302. #define DASD_STOPPED_DC_EIO 16 /* disconnected, return -EIO */
  303. /* per device flags */
  304. #define DASD_FLAG_DSC_ERROR 2 /* return -EIO when disconnected */
  305. #define DASD_FLAG_OFFLINE 3 /* device is in offline processing */
  306. #define DASD_FLAG_EER_SNSS 4 /* A SNSS is required */
  307. #define DASD_FLAG_EER_IN_USE 5 /* A SNSS request is running */
  308. void dasd_put_device_wake(struct dasd_device *);
  309. /*
  310. * Reference count inliners
  311. */
  312. static inline void
  313. dasd_get_device(struct dasd_device *device)
  314. {
  315. atomic_inc(&device->ref_count);
  316. }
  317. static inline void
  318. dasd_put_device(struct dasd_device *device)
  319. {
  320. if (atomic_dec_return(&device->ref_count) == 0)
  321. dasd_put_device_wake(device);
  322. }
  323. /*
  324. * The static memory in ccw_mem and erp_mem is managed by a sorted
  325. * list of free memory chunks.
  326. */
  327. struct dasd_mchunk
  328. {
  329. struct list_head list;
  330. unsigned long size;
  331. } __attribute__ ((aligned(8)));
  332. static inline void
  333. dasd_init_chunklist(struct list_head *chunk_list, void *mem,
  334. unsigned long size)
  335. {
  336. struct dasd_mchunk *chunk;
  337. INIT_LIST_HEAD(chunk_list);
  338. chunk = (struct dasd_mchunk *) mem;
  339. chunk->size = size - sizeof(struct dasd_mchunk);
  340. list_add(&chunk->list, chunk_list);
  341. }
  342. static inline void *
  343. dasd_alloc_chunk(struct list_head *chunk_list, unsigned long size)
  344. {
  345. struct dasd_mchunk *chunk, *tmp;
  346. size = (size + 7L) & -8L;
  347. list_for_each_entry(chunk, chunk_list, list) {
  348. if (chunk->size < size)
  349. continue;
  350. if (chunk->size > size + sizeof(struct dasd_mchunk)) {
  351. char *endaddr = (char *) (chunk + 1) + chunk->size;
  352. tmp = (struct dasd_mchunk *) (endaddr - size) - 1;
  353. tmp->size = size;
  354. chunk->size -= size + sizeof(struct dasd_mchunk);
  355. chunk = tmp;
  356. } else
  357. list_del(&chunk->list);
  358. return (void *) (chunk + 1);
  359. }
  360. return NULL;
  361. }
  362. static inline void
  363. dasd_free_chunk(struct list_head *chunk_list, void *mem)
  364. {
  365. struct dasd_mchunk *chunk, *tmp;
  366. struct list_head *p, *left;
  367. chunk = (struct dasd_mchunk *)
  368. ((char *) mem - sizeof(struct dasd_mchunk));
  369. /* Find out the left neighbour in chunk_list. */
  370. left = chunk_list;
  371. list_for_each(p, chunk_list) {
  372. if (list_entry(p, struct dasd_mchunk, list) > chunk)
  373. break;
  374. left = p;
  375. }
  376. /* Try to merge with right neighbour = next element from left. */
  377. if (left->next != chunk_list) {
  378. tmp = list_entry(left->next, struct dasd_mchunk, list);
  379. if ((char *) (chunk + 1) + chunk->size == (char *) tmp) {
  380. list_del(&tmp->list);
  381. chunk->size += tmp->size + sizeof(struct dasd_mchunk);
  382. }
  383. }
  384. /* Try to merge with left neighbour. */
  385. if (left != chunk_list) {
  386. tmp = list_entry(left, struct dasd_mchunk, list);
  387. if ((char *) (tmp + 1) + tmp->size == (char *) chunk) {
  388. tmp->size += chunk->size + sizeof(struct dasd_mchunk);
  389. return;
  390. }
  391. }
  392. __list_add(&chunk->list, left, left->next);
  393. }
  394. /*
  395. * Check if bsize is in { 512, 1024, 2048, 4096 }
  396. */
  397. static inline int
  398. dasd_check_blocksize(int bsize)
  399. {
  400. if (bsize < 512 || bsize > 4096 || (bsize & (bsize - 1)) != 0)
  401. return -EMEDIUMTYPE;
  402. return 0;
  403. }
  404. /* externals in dasd.c */
  405. #define DASD_PROFILE_ON 1
  406. #define DASD_PROFILE_OFF 0
  407. extern debug_info_t *dasd_debug_area;
  408. extern struct dasd_profile_info_t dasd_global_profile;
  409. extern unsigned int dasd_profile_level;
  410. extern struct block_device_operations dasd_device_operations;
  411. extern struct kmem_cache *dasd_page_cache;
  412. struct dasd_ccw_req *
  413. dasd_kmalloc_request(char *, int, int, struct dasd_device *);
  414. struct dasd_ccw_req *
  415. dasd_smalloc_request(char *, int, int, struct dasd_device *);
  416. void dasd_kfree_request(struct dasd_ccw_req *, struct dasd_device *);
  417. void dasd_sfree_request(struct dasd_ccw_req *, struct dasd_device *);
  418. static inline int
  419. dasd_kmalloc_set_cda(struct ccw1 *ccw, void *cda, struct dasd_device *device)
  420. {
  421. return set_normalized_cda(ccw, cda);
  422. }
  423. struct dasd_device *dasd_alloc_device(void);
  424. void dasd_free_device(struct dasd_device *);
  425. void dasd_enable_device(struct dasd_device *);
  426. void dasd_set_target_state(struct dasd_device *, int);
  427. void dasd_kick_device(struct dasd_device *);
  428. void dasd_add_request_head(struct dasd_ccw_req *);
  429. void dasd_add_request_tail(struct dasd_ccw_req *);
  430. int dasd_start_IO(struct dasd_ccw_req *);
  431. int dasd_term_IO(struct dasd_ccw_req *);
  432. void dasd_schedule_bh(struct dasd_device *);
  433. int dasd_sleep_on(struct dasd_ccw_req *);
  434. int dasd_sleep_on_immediatly(struct dasd_ccw_req *);
  435. int dasd_sleep_on_interruptible(struct dasd_ccw_req *);
  436. void dasd_set_timer(struct dasd_device *, int);
  437. void dasd_clear_timer(struct dasd_device *);
  438. int dasd_cancel_req(struct dasd_ccw_req *);
  439. int dasd_generic_probe (struct ccw_device *, struct dasd_discipline *);
  440. void dasd_generic_remove (struct ccw_device *cdev);
  441. int dasd_generic_set_online(struct ccw_device *, struct dasd_discipline *);
  442. int dasd_generic_set_offline (struct ccw_device *cdev);
  443. int dasd_generic_notify(struct ccw_device *, int);
  444. int dasd_generic_read_dev_chars(struct dasd_device *, char *, void **, int);
  445. /* externals in dasd_devmap.c */
  446. extern int dasd_max_devindex;
  447. extern int dasd_probeonly;
  448. extern int dasd_autodetect;
  449. extern int dasd_nopav;
  450. int dasd_devmap_init(void);
  451. void dasd_devmap_exit(void);
  452. struct dasd_device *dasd_create_device(struct ccw_device *);
  453. void dasd_delete_device(struct dasd_device *);
  454. int dasd_get_uid(struct ccw_device *, struct dasd_uid *);
  455. int dasd_set_uid(struct ccw_device *, struct dasd_uid *);
  456. int dasd_get_feature(struct ccw_device *, int);
  457. int dasd_set_feature(struct ccw_device *, int, int);
  458. int dasd_add_sysfs_files(struct ccw_device *);
  459. void dasd_remove_sysfs_files(struct ccw_device *);
  460. struct dasd_device *dasd_device_from_cdev(struct ccw_device *);
  461. struct dasd_device *dasd_device_from_cdev_locked(struct ccw_device *);
  462. struct dasd_device *dasd_device_from_devindex(int);
  463. int dasd_parse(void);
  464. int dasd_busid_known(char *);
  465. /* externals in dasd_gendisk.c */
  466. int dasd_gendisk_init(void);
  467. void dasd_gendisk_exit(void);
  468. int dasd_gendisk_alloc(struct dasd_device *);
  469. void dasd_gendisk_free(struct dasd_device *);
  470. int dasd_scan_partitions(struct dasd_device *);
  471. void dasd_destroy_partitions(struct dasd_device *);
  472. /* externals in dasd_ioctl.c */
  473. int dasd_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
  474. long dasd_compat_ioctl(struct file *, unsigned int, unsigned long);
  475. /* externals in dasd_proc.c */
  476. int dasd_proc_init(void);
  477. void dasd_proc_exit(void);
  478. /* externals in dasd_erp.c */
  479. struct dasd_ccw_req *dasd_default_erp_action(struct dasd_ccw_req *);
  480. struct dasd_ccw_req *dasd_default_erp_postaction(struct dasd_ccw_req *);
  481. struct dasd_ccw_req *dasd_alloc_erp_request(char *, int, int,
  482. struct dasd_device *);
  483. void dasd_free_erp_request(struct dasd_ccw_req *, struct dasd_device *);
  484. void dasd_log_sense(struct dasd_ccw_req *, struct irb *);
  485. /* externals in dasd_3370_erp.c */
  486. dasd_era_t dasd_3370_erp_examine(struct dasd_ccw_req *, struct irb *);
  487. /* externals in dasd_3990_erp.c */
  488. dasd_era_t dasd_3990_erp_examine(struct dasd_ccw_req *, struct irb *);
  489. struct dasd_ccw_req *dasd_3990_erp_action(struct dasd_ccw_req *);
  490. /* externals in dasd_9336_erp.c */
  491. dasd_era_t dasd_9336_erp_examine(struct dasd_ccw_req *, struct irb *);
  492. /* externals in dasd_9336_erp.c */
  493. dasd_era_t dasd_9343_erp_examine(struct dasd_ccw_req *, struct irb *);
  494. struct dasd_ccw_req *dasd_9343_erp_action(struct dasd_ccw_req *);
  495. /* externals in dasd_eer.c */
  496. #ifdef CONFIG_DASD_EER
  497. int dasd_eer_init(void);
  498. void dasd_eer_exit(void);
  499. int dasd_eer_enable(struct dasd_device *);
  500. void dasd_eer_disable(struct dasd_device *);
  501. void dasd_eer_write(struct dasd_device *, struct dasd_ccw_req *cqr,
  502. unsigned int id);
  503. void dasd_eer_snss(struct dasd_device *);
  504. static inline int dasd_eer_enabled(struct dasd_device *device)
  505. {
  506. return device->eer_cqr != NULL;
  507. }
  508. #else
  509. #define dasd_eer_init() (0)
  510. #define dasd_eer_exit() do { } while (0)
  511. #define dasd_eer_enable(d) (0)
  512. #define dasd_eer_disable(d) do { } while (0)
  513. #define dasd_eer_write(d,c,i) do { } while (0)
  514. #define dasd_eer_snss(d) do { } while (0)
  515. #define dasd_eer_enabled(d) (0)
  516. #endif /* CONFIG_DASD_ERR */
  517. #endif /* __KERNEL__ */
  518. #endif /* DASD_H */