dasd_int.h 20 KB

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