dasd_fba.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. /*
  2. * File...........: linux/drivers/s390/block/dasd_fba.c
  3. * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com>
  4. * Bugreports.to..: <Linux390@de.ibm.com>
  5. * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
  6. *
  7. */
  8. #include <linux/config.h>
  9. #include <linux/stddef.h>
  10. #include <linux/kernel.h>
  11. #include <asm/debug.h>
  12. #include <linux/slab.h>
  13. #include <linux/hdreg.h> /* HDIO_GETGEO */
  14. #include <linux/bio.h>
  15. #include <linux/module.h>
  16. #include <linux/init.h>
  17. #include <asm/idals.h>
  18. #include <asm/ebcdic.h>
  19. #include <asm/io.h>
  20. #include <asm/todclk.h>
  21. #include <asm/ccwdev.h>
  22. #include "dasd_int.h"
  23. #include "dasd_fba.h"
  24. #ifdef PRINTK_HEADER
  25. #undef PRINTK_HEADER
  26. #endif /* PRINTK_HEADER */
  27. #define PRINTK_HEADER "dasd(fba):"
  28. #define DASD_FBA_CCW_WRITE 0x41
  29. #define DASD_FBA_CCW_READ 0x42
  30. #define DASD_FBA_CCW_LOCATE 0x43
  31. #define DASD_FBA_CCW_DEFINE_EXTENT 0x63
  32. MODULE_LICENSE("GPL");
  33. static struct dasd_discipline dasd_fba_discipline;
  34. struct dasd_fba_private {
  35. struct dasd_fba_characteristics rdc_data;
  36. };
  37. static struct ccw_device_id dasd_fba_ids[] = {
  38. { CCW_DEVICE_DEVTYPE (0x6310, 0, 0x9336, 0), driver_info: 0x1},
  39. { CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3370, 0), driver_info: 0x2},
  40. { /* end of list */ },
  41. };
  42. MODULE_DEVICE_TABLE(ccw, dasd_fba_ids);
  43. static struct ccw_driver dasd_fba_driver; /* see below */
  44. static int
  45. dasd_fba_probe(struct ccw_device *cdev)
  46. {
  47. int ret;
  48. ret = dasd_generic_probe (cdev, &dasd_fba_discipline);
  49. if (ret)
  50. return ret;
  51. ccw_device_set_options(cdev, CCWDEV_DO_PATHGROUP);
  52. return 0;
  53. }
  54. static int
  55. dasd_fba_set_online(struct ccw_device *cdev)
  56. {
  57. return dasd_generic_set_online (cdev, &dasd_fba_discipline);
  58. }
  59. static struct ccw_driver dasd_fba_driver = {
  60. .name = "dasd-fba",
  61. .owner = THIS_MODULE,
  62. .ids = dasd_fba_ids,
  63. .probe = dasd_fba_probe,
  64. .remove = dasd_generic_remove,
  65. .set_offline = dasd_generic_set_offline,
  66. .set_online = dasd_fba_set_online,
  67. .notify = dasd_generic_notify,
  68. };
  69. static inline void
  70. define_extent(struct ccw1 * ccw, struct DE_fba_data *data, int rw,
  71. int blksize, int beg, int nr)
  72. {
  73. ccw->cmd_code = DASD_FBA_CCW_DEFINE_EXTENT;
  74. ccw->flags = 0;
  75. ccw->count = 16;
  76. ccw->cda = (__u32) __pa(data);
  77. memset(data, 0, sizeof (struct DE_fba_data));
  78. if (rw == WRITE)
  79. (data->mask).perm = 0x0;
  80. else if (rw == READ)
  81. (data->mask).perm = 0x1;
  82. else
  83. data->mask.perm = 0x2;
  84. data->blk_size = blksize;
  85. data->ext_loc = beg;
  86. data->ext_end = nr - 1;
  87. }
  88. static inline void
  89. locate_record(struct ccw1 * ccw, struct LO_fba_data *data, int rw,
  90. int block_nr, int block_ct)
  91. {
  92. ccw->cmd_code = DASD_FBA_CCW_LOCATE;
  93. ccw->flags = 0;
  94. ccw->count = 8;
  95. ccw->cda = (__u32) __pa(data);
  96. memset(data, 0, sizeof (struct LO_fba_data));
  97. if (rw == WRITE)
  98. data->operation.cmd = 0x5;
  99. else if (rw == READ)
  100. data->operation.cmd = 0x6;
  101. else
  102. data->operation.cmd = 0x8;
  103. data->blk_nr = block_nr;
  104. data->blk_ct = block_ct;
  105. }
  106. static int
  107. dasd_fba_check_characteristics(struct dasd_device *device)
  108. {
  109. struct dasd_fba_private *private;
  110. struct ccw_device *cdev = device->cdev;
  111. void *rdc_data;
  112. int rc;
  113. private = (struct dasd_fba_private *) device->private;
  114. if (private == NULL) {
  115. private = kmalloc(sizeof(struct dasd_fba_private), GFP_KERNEL);
  116. if (private == NULL) {
  117. DEV_MESSAGE(KERN_WARNING, device, "%s",
  118. "memory allocation failed for private "
  119. "data");
  120. return -ENOMEM;
  121. }
  122. device->private = (void *) private;
  123. }
  124. /* Read Device Characteristics */
  125. rdc_data = (void *) &(private->rdc_data);
  126. rc = read_dev_chars(device->cdev, &rdc_data, 32);
  127. if (rc) {
  128. DEV_MESSAGE(KERN_WARNING, device,
  129. "Read device characteristics returned error %d",
  130. rc);
  131. return rc;
  132. }
  133. DEV_MESSAGE(KERN_INFO, device,
  134. "%04X/%02X(CU:%04X/%02X) %dMB at(%d B/blk)",
  135. cdev->id.dev_type,
  136. cdev->id.dev_model,
  137. cdev->id.cu_type,
  138. cdev->id.cu_model,
  139. ((private->rdc_data.blk_bdsa *
  140. (private->rdc_data.blk_size >> 9)) >> 11),
  141. private->rdc_data.blk_size);
  142. return 0;
  143. }
  144. static int
  145. dasd_fba_do_analysis(struct dasd_device *device)
  146. {
  147. struct dasd_fba_private *private;
  148. int sb, rc;
  149. private = (struct dasd_fba_private *) device->private;
  150. rc = dasd_check_blocksize(private->rdc_data.blk_size);
  151. if (rc) {
  152. DEV_MESSAGE(KERN_INFO, device, "unknown blocksize %d",
  153. private->rdc_data.blk_size);
  154. return rc;
  155. }
  156. device->blocks = private->rdc_data.blk_bdsa;
  157. device->bp_block = private->rdc_data.blk_size;
  158. device->s2b_shift = 0; /* bits to shift 512 to get a block */
  159. for (sb = 512; sb < private->rdc_data.blk_size; sb = sb << 1)
  160. device->s2b_shift++;
  161. return 0;
  162. }
  163. static int
  164. dasd_fba_fill_geometry(struct dasd_device *device, struct hd_geometry *geo)
  165. {
  166. if (dasd_check_blocksize(device->bp_block) != 0)
  167. return -EINVAL;
  168. geo->cylinders = (device->blocks << device->s2b_shift) >> 10;
  169. geo->heads = 16;
  170. geo->sectors = 128 >> device->s2b_shift;
  171. return 0;
  172. }
  173. static dasd_era_t
  174. dasd_fba_examine_error(struct dasd_ccw_req * cqr, struct irb * irb)
  175. {
  176. struct dasd_device *device;
  177. struct ccw_device *cdev;
  178. device = (struct dasd_device *) cqr->device;
  179. if (irb->scsw.cstat == 0x00 &&
  180. irb->scsw.dstat == (DEV_STAT_CHN_END | DEV_STAT_DEV_END))
  181. return dasd_era_none;
  182. cdev = device->cdev;
  183. switch (cdev->id.dev_type) {
  184. case 0x3370:
  185. return dasd_3370_erp_examine(cqr, irb);
  186. case 0x9336:
  187. return dasd_9336_erp_examine(cqr, irb);
  188. default:
  189. return dasd_era_recover;
  190. }
  191. }
  192. static dasd_erp_fn_t
  193. dasd_fba_erp_action(struct dasd_ccw_req * cqr)
  194. {
  195. return dasd_default_erp_action;
  196. }
  197. static dasd_erp_fn_t
  198. dasd_fba_erp_postaction(struct dasd_ccw_req * cqr)
  199. {
  200. if (cqr->function == dasd_default_erp_action)
  201. return dasd_default_erp_postaction;
  202. DEV_MESSAGE(KERN_WARNING, cqr->device, "unknown ERP action %p",
  203. cqr->function);
  204. return NULL;
  205. }
  206. static struct dasd_ccw_req *
  207. dasd_fba_build_cp(struct dasd_device * device, struct request *req)
  208. {
  209. struct dasd_fba_private *private;
  210. unsigned long *idaws;
  211. struct LO_fba_data *LO_data;
  212. struct dasd_ccw_req *cqr;
  213. struct ccw1 *ccw;
  214. struct bio *bio;
  215. struct bio_vec *bv;
  216. char *dst;
  217. int count, cidaw, cplength, datasize;
  218. sector_t recid, first_rec, last_rec;
  219. unsigned int blksize, off;
  220. unsigned char cmd;
  221. int i;
  222. private = (struct dasd_fba_private *) device->private;
  223. if (rq_data_dir(req) == READ) {
  224. cmd = DASD_FBA_CCW_READ;
  225. } else if (rq_data_dir(req) == WRITE) {
  226. cmd = DASD_FBA_CCW_WRITE;
  227. } else
  228. return ERR_PTR(-EINVAL);
  229. blksize = device->bp_block;
  230. /* Calculate record id of first and last block. */
  231. first_rec = req->sector >> device->s2b_shift;
  232. last_rec = (req->sector + req->nr_sectors - 1) >> device->s2b_shift;
  233. /* Check struct bio and count the number of blocks for the request. */
  234. count = 0;
  235. cidaw = 0;
  236. rq_for_each_bio(bio, req) {
  237. bio_for_each_segment(bv, bio, i) {
  238. if (bv->bv_len & (blksize - 1))
  239. /* Fba can only do full blocks. */
  240. return ERR_PTR(-EINVAL);
  241. count += bv->bv_len >> (device->s2b_shift + 9);
  242. #if defined(CONFIG_64BIT)
  243. if (idal_is_needed (page_address(bv->bv_page),
  244. bv->bv_len))
  245. cidaw += bv->bv_len / blksize;
  246. #endif
  247. }
  248. }
  249. /* Paranoia. */
  250. if (count != last_rec - first_rec + 1)
  251. return ERR_PTR(-EINVAL);
  252. /* 1x define extent + 1x locate record + number of blocks */
  253. cplength = 2 + count;
  254. /* 1x define extent + 1x locate record */
  255. datasize = sizeof(struct DE_fba_data) + sizeof(struct LO_fba_data) +
  256. cidaw * sizeof(unsigned long);
  257. /*
  258. * Find out number of additional locate record ccws if the device
  259. * can't do data chaining.
  260. */
  261. if (private->rdc_data.mode.bits.data_chain == 0) {
  262. cplength += count - 1;
  263. datasize += (count - 1)*sizeof(struct LO_fba_data);
  264. }
  265. /* Allocate the ccw request. */
  266. cqr = dasd_smalloc_request(dasd_fba_discipline.name,
  267. cplength, datasize, device);
  268. if (IS_ERR(cqr))
  269. return cqr;
  270. ccw = cqr->cpaddr;
  271. /* First ccw is define extent. */
  272. define_extent(ccw++, cqr->data, rq_data_dir(req),
  273. device->bp_block, req->sector, req->nr_sectors);
  274. /* Build locate_record + read/write ccws. */
  275. idaws = (unsigned long *) (cqr->data + sizeof(struct DE_fba_data));
  276. LO_data = (struct LO_fba_data *) (idaws + cidaw);
  277. /* Locate record for all blocks for smart devices. */
  278. if (private->rdc_data.mode.bits.data_chain != 0) {
  279. ccw[-1].flags |= CCW_FLAG_CC;
  280. locate_record(ccw++, LO_data++, rq_data_dir(req), 0, count);
  281. }
  282. recid = first_rec;
  283. rq_for_each_bio(bio, req) bio_for_each_segment(bv, bio, i) {
  284. dst = page_address(bv->bv_page) + bv->bv_offset;
  285. if (dasd_page_cache) {
  286. char *copy = kmem_cache_alloc(dasd_page_cache,
  287. SLAB_DMA | __GFP_NOWARN);
  288. if (copy && rq_data_dir(req) == WRITE)
  289. memcpy(copy + bv->bv_offset, dst, bv->bv_len);
  290. if (copy)
  291. dst = copy + bv->bv_offset;
  292. }
  293. for (off = 0; off < bv->bv_len; off += blksize) {
  294. /* Locate record for stupid devices. */
  295. if (private->rdc_data.mode.bits.data_chain == 0) {
  296. ccw[-1].flags |= CCW_FLAG_CC;
  297. locate_record(ccw, LO_data++,
  298. rq_data_dir(req),
  299. recid - first_rec, 1);
  300. ccw->flags = CCW_FLAG_CC;
  301. ccw++;
  302. } else {
  303. if (recid > first_rec)
  304. ccw[-1].flags |= CCW_FLAG_DC;
  305. else
  306. ccw[-1].flags |= CCW_FLAG_CC;
  307. }
  308. ccw->cmd_code = cmd;
  309. ccw->count = device->bp_block;
  310. if (idal_is_needed(dst, blksize)) {
  311. ccw->cda = (__u32)(addr_t) idaws;
  312. ccw->flags = CCW_FLAG_IDA;
  313. idaws = idal_create_words(idaws, dst, blksize);
  314. } else {
  315. ccw->cda = (__u32)(addr_t) dst;
  316. ccw->flags = 0;
  317. }
  318. ccw++;
  319. dst += blksize;
  320. recid++;
  321. }
  322. }
  323. if (req->flags & REQ_FAILFAST)
  324. set_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags);
  325. cqr->device = device;
  326. cqr->expires = 5 * 60 * HZ; /* 5 minutes */
  327. cqr->retries = 32;
  328. cqr->buildclk = get_clock();
  329. cqr->status = DASD_CQR_FILLED;
  330. return cqr;
  331. }
  332. static int
  333. dasd_fba_free_cp(struct dasd_ccw_req *cqr, struct request *req)
  334. {
  335. struct dasd_fba_private *private;
  336. struct ccw1 *ccw;
  337. struct bio *bio;
  338. struct bio_vec *bv;
  339. char *dst, *cda;
  340. unsigned int blksize, off;
  341. int i, status;
  342. if (!dasd_page_cache)
  343. goto out;
  344. private = (struct dasd_fba_private *) cqr->device->private;
  345. blksize = cqr->device->bp_block;
  346. ccw = cqr->cpaddr;
  347. /* Skip over define extent & locate record. */
  348. ccw++;
  349. if (private->rdc_data.mode.bits.data_chain != 0)
  350. ccw++;
  351. rq_for_each_bio(bio, req) bio_for_each_segment(bv, bio, i) {
  352. dst = page_address(bv->bv_page) + bv->bv_offset;
  353. for (off = 0; off < bv->bv_len; off += blksize) {
  354. /* Skip locate record. */
  355. if (private->rdc_data.mode.bits.data_chain == 0)
  356. ccw++;
  357. if (dst) {
  358. if (ccw->flags & CCW_FLAG_IDA)
  359. cda = *((char **)((addr_t) ccw->cda));
  360. else
  361. cda = (char *)((addr_t) ccw->cda);
  362. if (dst != cda) {
  363. if (rq_data_dir(req) == READ)
  364. memcpy(dst, cda, bv->bv_len);
  365. kmem_cache_free(dasd_page_cache,
  366. (void *)((addr_t)cda & PAGE_MASK));
  367. }
  368. dst = NULL;
  369. }
  370. ccw++;
  371. }
  372. }
  373. out:
  374. status = cqr->status == DASD_CQR_DONE;
  375. dasd_sfree_request(cqr, cqr->device);
  376. return status;
  377. }
  378. static int
  379. dasd_fba_fill_info(struct dasd_device * device,
  380. struct dasd_information2_t * info)
  381. {
  382. info->label_block = 1;
  383. info->FBA_layout = 1;
  384. info->format = DASD_FORMAT_LDL;
  385. info->characteristics_size = sizeof(struct dasd_fba_characteristics);
  386. memcpy(info->characteristics,
  387. &((struct dasd_fba_private *) device->private)->rdc_data,
  388. sizeof (struct dasd_fba_characteristics));
  389. info->confdata_size = 0;
  390. return 0;
  391. }
  392. static void
  393. dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
  394. struct irb *irb)
  395. {
  396. char *page;
  397. struct ccw1 *act, *end, *last;
  398. int len, sl, sct, count;
  399. page = (char *) get_zeroed_page(GFP_ATOMIC);
  400. if (page == NULL) {
  401. DEV_MESSAGE(KERN_ERR, device, " %s",
  402. "No memory to dump sense data");
  403. return;
  404. }
  405. len = sprintf(page, KERN_ERR PRINTK_HEADER
  406. " I/O status report for device %s:\n",
  407. device->cdev->dev.bus_id);
  408. len += sprintf(page + len, KERN_ERR PRINTK_HEADER
  409. " in req: %p CS: 0x%02X DS: 0x%02X\n", req,
  410. irb->scsw.cstat, irb->scsw.dstat);
  411. len += sprintf(page + len, KERN_ERR PRINTK_HEADER
  412. " device %s: Failing CCW: %p\n",
  413. device->cdev->dev.bus_id,
  414. (void *) (addr_t) irb->scsw.cpa);
  415. if (irb->esw.esw0.erw.cons) {
  416. for (sl = 0; sl < 4; sl++) {
  417. len += sprintf(page + len, KERN_ERR PRINTK_HEADER
  418. " Sense(hex) %2d-%2d:",
  419. (8 * sl), ((8 * sl) + 7));
  420. for (sct = 0; sct < 8; sct++) {
  421. len += sprintf(page + len, " %02x",
  422. irb->ecw[8 * sl + sct]);
  423. }
  424. len += sprintf(page + len, "\n");
  425. }
  426. } else {
  427. len += sprintf(page + len, KERN_ERR PRINTK_HEADER
  428. " SORRY - NO VALID SENSE AVAILABLE\n");
  429. }
  430. MESSAGE_LOG(KERN_ERR, "%s",
  431. page + sizeof(KERN_ERR PRINTK_HEADER));
  432. /* dump the Channel Program */
  433. /* print first CCWs (maximum 8) */
  434. act = req->cpaddr;
  435. for (last = act; last->flags & (CCW_FLAG_CC | CCW_FLAG_DC); last++);
  436. end = min(act + 8, last);
  437. len = sprintf(page, KERN_ERR PRINTK_HEADER
  438. " Related CP in req: %p\n", req);
  439. while (act <= end) {
  440. len += sprintf(page + len, KERN_ERR PRINTK_HEADER
  441. " CCW %p: %08X %08X DAT:",
  442. act, ((int *) act)[0], ((int *) act)[1]);
  443. for (count = 0; count < 32 && count < act->count;
  444. count += sizeof(int))
  445. len += sprintf(page + len, " %08X",
  446. ((int *) (addr_t) act->cda)
  447. [(count>>2)]);
  448. len += sprintf(page + len, "\n");
  449. act++;
  450. }
  451. MESSAGE_LOG(KERN_ERR, "%s",
  452. page + sizeof(KERN_ERR PRINTK_HEADER));
  453. /* print failing CCW area */
  454. len = 0;
  455. if (act < ((struct ccw1 *)(addr_t) irb->scsw.cpa) - 2) {
  456. act = ((struct ccw1 *)(addr_t) irb->scsw.cpa) - 2;
  457. len += sprintf(page + len, KERN_ERR PRINTK_HEADER "......\n");
  458. }
  459. end = min((struct ccw1 *)(addr_t) irb->scsw.cpa + 2, last);
  460. while (act <= end) {
  461. len += sprintf(page + len, KERN_ERR PRINTK_HEADER
  462. " CCW %p: %08X %08X DAT:",
  463. act, ((int *) act)[0], ((int *) act)[1]);
  464. for (count = 0; count < 32 && count < act->count;
  465. count += sizeof(int))
  466. len += sprintf(page + len, " %08X",
  467. ((int *) (addr_t) act->cda)
  468. [(count>>2)]);
  469. len += sprintf(page + len, "\n");
  470. act++;
  471. }
  472. /* print last CCWs */
  473. if (act < last - 2) {
  474. act = last - 2;
  475. len += sprintf(page + len, KERN_ERR PRINTK_HEADER "......\n");
  476. }
  477. while (act <= last) {
  478. len += sprintf(page + len, KERN_ERR PRINTK_HEADER
  479. " CCW %p: %08X %08X DAT:",
  480. act, ((int *) act)[0], ((int *) act)[1]);
  481. for (count = 0; count < 32 && count < act->count;
  482. count += sizeof(int))
  483. len += sprintf(page + len, " %08X",
  484. ((int *) (addr_t) act->cda)
  485. [(count>>2)]);
  486. len += sprintf(page + len, "\n");
  487. act++;
  488. }
  489. if (len > 0)
  490. MESSAGE_LOG(KERN_ERR, "%s",
  491. page + sizeof(KERN_ERR PRINTK_HEADER));
  492. free_page((unsigned long) page);
  493. }
  494. /*
  495. * max_blocks is dependent on the amount of storage that is available
  496. * in the static io buffer for each device. Currently each device has
  497. * 8192 bytes (=2 pages). For 64 bit one dasd_mchunkt_t structure has
  498. * 24 bytes, the struct dasd_ccw_req has 136 bytes and each block can use
  499. * up to 16 bytes (8 for the ccw and 8 for the idal pointer). In
  500. * addition we have one define extent ccw + 16 bytes of data and a
  501. * locate record ccw for each block (stupid devices!) + 16 bytes of data.
  502. * That makes:
  503. * (8192 - 24 - 136 - 8 - 16) / 40 = 200.2 blocks at maximum.
  504. * We want to fit two into the available memory so that we can immediately
  505. * start the next request if one finishes off. That makes 100.1 blocks
  506. * for one request. Give a little safety and the result is 96.
  507. */
  508. static struct dasd_discipline dasd_fba_discipline = {
  509. .owner = THIS_MODULE,
  510. .name = "FBA ",
  511. .ebcname = "FBA ",
  512. .max_blocks = 96,
  513. .check_device = dasd_fba_check_characteristics,
  514. .do_analysis = dasd_fba_do_analysis,
  515. .fill_geometry = dasd_fba_fill_geometry,
  516. .start_IO = dasd_start_IO,
  517. .term_IO = dasd_term_IO,
  518. .examine_error = dasd_fba_examine_error,
  519. .erp_action = dasd_fba_erp_action,
  520. .erp_postaction = dasd_fba_erp_postaction,
  521. .build_cp = dasd_fba_build_cp,
  522. .free_cp = dasd_fba_free_cp,
  523. .dump_sense = dasd_fba_dump_sense,
  524. .fill_info = dasd_fba_fill_info,
  525. };
  526. static int __init
  527. dasd_fba_init(void)
  528. {
  529. int ret;
  530. ASCEBC(dasd_fba_discipline.ebcname, 4);
  531. ret = ccw_driver_register(&dasd_fba_driver);
  532. if (ret)
  533. return ret;
  534. dasd_generic_auto_online(&dasd_fba_driver);
  535. return 0;
  536. }
  537. static void __exit
  538. dasd_fba_cleanup(void)
  539. {
  540. ccw_driver_unregister(&dasd_fba_driver);
  541. }
  542. module_init(dasd_fba_init);
  543. module_exit(dasd_fba_cleanup);
  544. /*
  545. * Overrides for Emacs so that we follow Linus's tabbing style.
  546. * Emacs will notice this stuff at the end of the file and automatically
  547. * adjust the settings for this buffer only. This must remain at the end
  548. * of the file.
  549. * ---------------------------------------------------------------------------
  550. * Local variables:
  551. * c-indent-level: 4
  552. * c-brace-imaginary-offset: 0
  553. * c-brace-offset: -4
  554. * c-argdecl-indent: 4
  555. * c-label-offset: -4
  556. * c-continued-statement-offset: 4
  557. * c-continued-brace-offset: 0
  558. * indent-tabs-mode: 1
  559. * tab-width: 8
  560. * End:
  561. */