dasd_int.h 20 KB

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