tape_34xx.c 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234
  1. /*
  2. * tape device discipline for 3480/3490 tapes.
  3. *
  4. * Copyright IBM Corp. 2001, 2009
  5. * Author(s): Carsten Otte <cotte@de.ibm.com>
  6. * Tuan Ngo-Anh <ngoanh@de.ibm.com>
  7. * Martin Schwidefsky <schwidefsky@de.ibm.com>
  8. */
  9. #define KMSG_COMPONENT "tape_34xx"
  10. #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
  11. #include <linux/module.h>
  12. #include <linux/init.h>
  13. #include <linux/bio.h>
  14. #include <linux/workqueue.h>
  15. #include <linux/slab.h>
  16. #define TAPE_DBF_AREA tape_34xx_dbf
  17. #include "tape.h"
  18. #include "tape_std.h"
  19. /*
  20. * Pointer to debug area.
  21. */
  22. debug_info_t *TAPE_DBF_AREA = NULL;
  23. EXPORT_SYMBOL(TAPE_DBF_AREA);
  24. #define TAPE34XX_FMT_3480 0
  25. #define TAPE34XX_FMT_3480_2_XF 1
  26. #define TAPE34XX_FMT_3480_XF 2
  27. struct tape_34xx_block_id {
  28. unsigned int wrap : 1;
  29. unsigned int segment : 7;
  30. unsigned int format : 2;
  31. unsigned int block : 22;
  32. };
  33. /*
  34. * A list of block ID's is used to faster seek blocks.
  35. */
  36. struct tape_34xx_sbid {
  37. struct list_head list;
  38. struct tape_34xx_block_id bid;
  39. };
  40. static void tape_34xx_delete_sbid_from(struct tape_device *, int);
  41. /*
  42. * Medium sense for 34xx tapes. There is no 'real' medium sense call.
  43. * So we just do a normal sense.
  44. */
  45. static void __tape_34xx_medium_sense(struct tape_request *request)
  46. {
  47. struct tape_device *device = request->device;
  48. unsigned char *sense;
  49. if (request->rc == 0) {
  50. sense = request->cpdata;
  51. /*
  52. * This isn't quite correct. But since INTERVENTION_REQUIRED
  53. * means that the drive is 'neither ready nor on-line' it is
  54. * only slightly inaccurate to say there is no tape loaded if
  55. * the drive isn't online...
  56. */
  57. if (sense[0] & SENSE_INTERVENTION_REQUIRED)
  58. tape_med_state_set(device, MS_UNLOADED);
  59. else
  60. tape_med_state_set(device, MS_LOADED);
  61. if (sense[1] & SENSE_WRITE_PROTECT)
  62. device->tape_generic_status |= GMT_WR_PROT(~0);
  63. else
  64. device->tape_generic_status &= ~GMT_WR_PROT(~0);
  65. } else
  66. DBF_EVENT(4, "tape_34xx: medium sense failed with rc=%d\n",
  67. request->rc);
  68. tape_free_request(request);
  69. }
  70. static int tape_34xx_medium_sense(struct tape_device *device)
  71. {
  72. struct tape_request *request;
  73. int rc;
  74. request = tape_alloc_request(1, 32);
  75. if (IS_ERR(request)) {
  76. DBF_EXCEPTION(6, "MSEN fail\n");
  77. return PTR_ERR(request);
  78. }
  79. request->op = TO_MSEN;
  80. tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata);
  81. rc = tape_do_io_interruptible(device, request);
  82. __tape_34xx_medium_sense(request);
  83. return rc;
  84. }
  85. static void tape_34xx_medium_sense_async(struct tape_device *device)
  86. {
  87. struct tape_request *request;
  88. request = tape_alloc_request(1, 32);
  89. if (IS_ERR(request)) {
  90. DBF_EXCEPTION(6, "MSEN fail\n");
  91. return;
  92. }
  93. request->op = TO_MSEN;
  94. tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata);
  95. request->callback = (void *) __tape_34xx_medium_sense;
  96. request->callback_data = NULL;
  97. tape_do_io_async(device, request);
  98. }
  99. struct tape_34xx_work {
  100. struct tape_device *device;
  101. enum tape_op op;
  102. struct work_struct work;
  103. };
  104. /*
  105. * These functions are currently used only to schedule a medium_sense for
  106. * later execution. This is because we get an interrupt whenever a medium
  107. * is inserted but cannot call tape_do_io* from an interrupt context.
  108. * Maybe that's useful for other actions we want to start from the
  109. * interrupt handler.
  110. * Note: the work handler is called by the system work queue. The tape
  111. * commands started by the handler need to be asynchrounous, otherwise
  112. * a deadlock can occur e.g. in case of a deferred cc=1 (see __tape_do_irq).
  113. */
  114. static void
  115. tape_34xx_work_handler(struct work_struct *work)
  116. {
  117. struct tape_34xx_work *p =
  118. container_of(work, struct tape_34xx_work, work);
  119. struct tape_device *device = p->device;
  120. switch(p->op) {
  121. case TO_MSEN:
  122. tape_34xx_medium_sense_async(device);
  123. break;
  124. default:
  125. DBF_EVENT(3, "T34XX: internal error: unknown work\n");
  126. }
  127. tape_put_device(device);
  128. kfree(p);
  129. }
  130. static int
  131. tape_34xx_schedule_work(struct tape_device *device, enum tape_op op)
  132. {
  133. struct tape_34xx_work *p;
  134. if ((p = kzalloc(sizeof(*p), GFP_ATOMIC)) == NULL)
  135. return -ENOMEM;
  136. INIT_WORK(&p->work, tape_34xx_work_handler);
  137. p->device = tape_get_device(device);
  138. p->op = op;
  139. schedule_work(&p->work);
  140. return 0;
  141. }
  142. /*
  143. * Done Handler is called when dev stat = DEVICE-END (successful operation)
  144. */
  145. static inline int
  146. tape_34xx_done(struct tape_request *request)
  147. {
  148. DBF_EVENT(6, "%s done\n", tape_op_verbose[request->op]);
  149. switch (request->op) {
  150. case TO_DSE:
  151. case TO_RUN:
  152. case TO_WRI:
  153. case TO_WTM:
  154. case TO_ASSIGN:
  155. case TO_UNASSIGN:
  156. tape_34xx_delete_sbid_from(request->device, 0);
  157. break;
  158. default:
  159. ;
  160. }
  161. return TAPE_IO_SUCCESS;
  162. }
  163. static inline int
  164. tape_34xx_erp_failed(struct tape_request *request, int rc)
  165. {
  166. DBF_EVENT(3, "Error recovery failed for %s (RC=%d)\n",
  167. tape_op_verbose[request->op], rc);
  168. return rc;
  169. }
  170. static inline int
  171. tape_34xx_erp_succeeded(struct tape_request *request)
  172. {
  173. DBF_EVENT(3, "Error Recovery successful for %s\n",
  174. tape_op_verbose[request->op]);
  175. return tape_34xx_done(request);
  176. }
  177. static inline int
  178. tape_34xx_erp_retry(struct tape_request *request)
  179. {
  180. DBF_EVENT(3, "xerp retr %s\n", tape_op_verbose[request->op]);
  181. return TAPE_IO_RETRY;
  182. }
  183. /*
  184. * This function is called, when no request is outstanding and we get an
  185. * interrupt
  186. */
  187. static int
  188. tape_34xx_unsolicited_irq(struct tape_device *device, struct irb *irb)
  189. {
  190. if (irb->scsw.cmd.dstat == 0x85) { /* READY */
  191. /* A medium was inserted in the drive. */
  192. DBF_EVENT(6, "xuud med\n");
  193. tape_34xx_delete_sbid_from(device, 0);
  194. tape_34xx_schedule_work(device, TO_MSEN);
  195. } else {
  196. DBF_EVENT(3, "unsol.irq! dev end: %08x\n", device->cdev_id);
  197. tape_dump_sense_dbf(device, NULL, irb);
  198. }
  199. return TAPE_IO_SUCCESS;
  200. }
  201. /*
  202. * Read Opposite Error Recovery Function:
  203. * Used, when Read Forward does not work
  204. */
  205. static int
  206. tape_34xx_erp_read_opposite(struct tape_device *device,
  207. struct tape_request *request)
  208. {
  209. if (request->op == TO_RFO) {
  210. /*
  211. * We did read forward, but the data could not be read
  212. * *correctly*. We transform the request to a read backward
  213. * and try again.
  214. */
  215. tape_std_read_backward(device, request);
  216. return tape_34xx_erp_retry(request);
  217. }
  218. /*
  219. * We tried to read forward and backward, but hat no
  220. * success -> failed.
  221. */
  222. return tape_34xx_erp_failed(request, -EIO);
  223. }
  224. static int
  225. tape_34xx_erp_bug(struct tape_device *device, struct tape_request *request,
  226. struct irb *irb, int no)
  227. {
  228. if (request->op != TO_ASSIGN) {
  229. dev_err(&device->cdev->dev, "An unexpected condition %d "
  230. "occurred in tape error recovery\n", no);
  231. tape_dump_sense_dbf(device, request, irb);
  232. }
  233. return tape_34xx_erp_failed(request, -EIO);
  234. }
  235. /*
  236. * Handle data overrun between cu and drive. The channel speed might
  237. * be too slow.
  238. */
  239. static int
  240. tape_34xx_erp_overrun(struct tape_device *device, struct tape_request *request,
  241. struct irb *irb)
  242. {
  243. if (irb->ecw[3] == 0x40) {
  244. dev_warn (&device->cdev->dev, "A data overrun occurred between"
  245. " the control unit and tape unit\n");
  246. return tape_34xx_erp_failed(request, -EIO);
  247. }
  248. return tape_34xx_erp_bug(device, request, irb, -1);
  249. }
  250. /*
  251. * Handle record sequence error.
  252. */
  253. static int
  254. tape_34xx_erp_sequence(struct tape_device *device,
  255. struct tape_request *request, struct irb *irb)
  256. {
  257. if (irb->ecw[3] == 0x41) {
  258. /*
  259. * cu detected incorrect block-id sequence on tape.
  260. */
  261. dev_warn (&device->cdev->dev, "The block ID sequence on the "
  262. "tape is incorrect\n");
  263. return tape_34xx_erp_failed(request, -EIO);
  264. }
  265. /*
  266. * Record sequence error bit is set, but erpa does not
  267. * show record sequence error.
  268. */
  269. return tape_34xx_erp_bug(device, request, irb, -2);
  270. }
  271. /*
  272. * This function analyses the tape's sense-data in case of a unit-check.
  273. * If possible, it tries to recover from the error. Else the user is
  274. * informed about the problem.
  275. */
  276. static int
  277. tape_34xx_unit_check(struct tape_device *device, struct tape_request *request,
  278. struct irb *irb)
  279. {
  280. int inhibit_cu_recovery;
  281. __u8* sense;
  282. inhibit_cu_recovery = (*device->modeset_byte & 0x80) ? 1 : 0;
  283. sense = irb->ecw;
  284. if (
  285. sense[0] & SENSE_COMMAND_REJECT &&
  286. sense[1] & SENSE_WRITE_PROTECT
  287. ) {
  288. if (
  289. request->op == TO_DSE ||
  290. request->op == TO_WRI ||
  291. request->op == TO_WTM
  292. ) {
  293. /* medium is write protected */
  294. return tape_34xx_erp_failed(request, -EACCES);
  295. } else {
  296. return tape_34xx_erp_bug(device, request, irb, -3);
  297. }
  298. }
  299. /*
  300. * Special cases for various tape-states when reaching
  301. * end of recorded area
  302. *
  303. * FIXME: Maybe a special case of the special case:
  304. * sense[0] == SENSE_EQUIPMENT_CHECK &&
  305. * sense[1] == SENSE_DRIVE_ONLINE &&
  306. * sense[3] == 0x47 (Volume Fenced)
  307. *
  308. * This was caused by continued FSF or FSR after an
  309. * 'End Of Data'.
  310. */
  311. if ((
  312. sense[0] == SENSE_DATA_CHECK ||
  313. sense[0] == SENSE_EQUIPMENT_CHECK ||
  314. sense[0] == SENSE_EQUIPMENT_CHECK + SENSE_DEFERRED_UNIT_CHECK
  315. ) && (
  316. sense[1] == SENSE_DRIVE_ONLINE ||
  317. sense[1] == SENSE_BEGINNING_OF_TAPE + SENSE_WRITE_MODE
  318. )) {
  319. switch (request->op) {
  320. /*
  321. * sense[0] == SENSE_DATA_CHECK &&
  322. * sense[1] == SENSE_DRIVE_ONLINE
  323. * sense[3] == 0x36 (End Of Data)
  324. *
  325. * Further seeks might return a 'Volume Fenced'.
  326. */
  327. case TO_FSF:
  328. case TO_FSB:
  329. /* Trying to seek beyond end of recorded area */
  330. return tape_34xx_erp_failed(request, -ENOSPC);
  331. case TO_BSB:
  332. return tape_34xx_erp_retry(request);
  333. /*
  334. * sense[0] == SENSE_DATA_CHECK &&
  335. * sense[1] == SENSE_DRIVE_ONLINE &&
  336. * sense[3] == 0x36 (End Of Data)
  337. */
  338. case TO_LBL:
  339. /* Block could not be located. */
  340. tape_34xx_delete_sbid_from(device, 0);
  341. return tape_34xx_erp_failed(request, -EIO);
  342. case TO_RFO:
  343. /* Read beyond end of recorded area -> 0 bytes read */
  344. return tape_34xx_erp_failed(request, 0);
  345. /*
  346. * sense[0] == SENSE_EQUIPMENT_CHECK &&
  347. * sense[1] == SENSE_DRIVE_ONLINE &&
  348. * sense[3] == 0x38 (Physical End Of Volume)
  349. */
  350. case TO_WRI:
  351. /* Writing at physical end of volume */
  352. return tape_34xx_erp_failed(request, -ENOSPC);
  353. default:
  354. return tape_34xx_erp_failed(request, 0);
  355. }
  356. }
  357. /* Sensing special bits */
  358. if (sense[0] & SENSE_BUS_OUT_CHECK)
  359. return tape_34xx_erp_retry(request);
  360. if (sense[0] & SENSE_DATA_CHECK) {
  361. /*
  362. * hardware failure, damaged tape or improper
  363. * operating conditions
  364. */
  365. switch (sense[3]) {
  366. case 0x23:
  367. /* a read data check occurred */
  368. if ((sense[2] & SENSE_TAPE_SYNC_MODE) ||
  369. inhibit_cu_recovery)
  370. // data check is not permanent, may be
  371. // recovered. We always use async-mode with
  372. // cu-recovery, so this should *never* happen.
  373. return tape_34xx_erp_bug(device, request,
  374. irb, -4);
  375. /* data check is permanent, CU recovery has failed */
  376. dev_warn (&device->cdev->dev, "A read error occurred "
  377. "that cannot be recovered\n");
  378. return tape_34xx_erp_failed(request, -EIO);
  379. case 0x25:
  380. // a write data check occurred
  381. if ((sense[2] & SENSE_TAPE_SYNC_MODE) ||
  382. inhibit_cu_recovery)
  383. // data check is not permanent, may be
  384. // recovered. We always use async-mode with
  385. // cu-recovery, so this should *never* happen.
  386. return tape_34xx_erp_bug(device, request,
  387. irb, -5);
  388. // data check is permanent, cu-recovery has failed
  389. dev_warn (&device->cdev->dev, "A write error on the "
  390. "tape cannot be recovered\n");
  391. return tape_34xx_erp_failed(request, -EIO);
  392. case 0x26:
  393. /* Data Check (read opposite) occurred. */
  394. return tape_34xx_erp_read_opposite(device, request);
  395. case 0x28:
  396. /* ID-Mark at tape start couldn't be written */
  397. dev_warn (&device->cdev->dev, "Writing the ID-mark "
  398. "failed\n");
  399. return tape_34xx_erp_failed(request, -EIO);
  400. case 0x31:
  401. /* Tape void. Tried to read beyond end of device. */
  402. dev_warn (&device->cdev->dev, "Reading the tape beyond"
  403. " the end of the recorded area failed\n");
  404. return tape_34xx_erp_failed(request, -ENOSPC);
  405. case 0x41:
  406. /* Record sequence error. */
  407. dev_warn (&device->cdev->dev, "The tape contains an "
  408. "incorrect block ID sequence\n");
  409. return tape_34xx_erp_failed(request, -EIO);
  410. default:
  411. /* all data checks for 3480 should result in one of
  412. * the above erpa-codes. For 3490, other data-check
  413. * conditions do exist. */
  414. if (device->cdev->id.driver_info == tape_3480)
  415. return tape_34xx_erp_bug(device, request,
  416. irb, -6);
  417. }
  418. }
  419. if (sense[0] & SENSE_OVERRUN)
  420. return tape_34xx_erp_overrun(device, request, irb);
  421. if (sense[1] & SENSE_RECORD_SEQUENCE_ERR)
  422. return tape_34xx_erp_sequence(device, request, irb);
  423. /* Sensing erpa codes */
  424. switch (sense[3]) {
  425. case 0x00:
  426. /* Unit check with erpa code 0. Report and ignore. */
  427. return TAPE_IO_SUCCESS;
  428. case 0x21:
  429. /*
  430. * Data streaming not operational. CU will switch to
  431. * interlock mode. Reissue the command.
  432. */
  433. return tape_34xx_erp_retry(request);
  434. case 0x22:
  435. /*
  436. * Path equipment check. Might be drive adapter error, buffer
  437. * error on the lower interface, internal path not usable,
  438. * or error during cartridge load.
  439. */
  440. dev_warn (&device->cdev->dev, "A path equipment check occurred"
  441. " for the tape device\n");
  442. return tape_34xx_erp_failed(request, -EIO);
  443. case 0x24:
  444. /*
  445. * Load display check. Load display was command was issued,
  446. * but the drive is displaying a drive check message. Can
  447. * be threated as "device end".
  448. */
  449. return tape_34xx_erp_succeeded(request);
  450. case 0x27:
  451. /*
  452. * Command reject. May indicate illegal channel program or
  453. * buffer over/underrun. Since all channel programs are
  454. * issued by this driver and ought be correct, we assume a
  455. * over/underrun situation and retry the channel program.
  456. */
  457. return tape_34xx_erp_retry(request);
  458. case 0x29:
  459. /*
  460. * Function incompatible. Either the tape is idrc compressed
  461. * but the hardware isn't capable to do idrc, or a perform
  462. * subsystem func is issued and the CU is not on-line.
  463. */
  464. return tape_34xx_erp_failed(request, -EIO);
  465. case 0x2a:
  466. /*
  467. * Unsolicited environmental data. An internal counter
  468. * overflows, we can ignore this and reissue the cmd.
  469. */
  470. return tape_34xx_erp_retry(request);
  471. case 0x2b:
  472. /*
  473. * Environmental data present. Indicates either unload
  474. * completed ok or read buffered log command completed ok.
  475. */
  476. if (request->op == TO_RUN) {
  477. /* Rewind unload completed ok. */
  478. tape_med_state_set(device, MS_UNLOADED);
  479. return tape_34xx_erp_succeeded(request);
  480. }
  481. /* tape_34xx doesn't use read buffered log commands. */
  482. return tape_34xx_erp_bug(device, request, irb, sense[3]);
  483. case 0x2c:
  484. /*
  485. * Permanent equipment check. CU has tried recovery, but
  486. * did not succeed.
  487. */
  488. return tape_34xx_erp_failed(request, -EIO);
  489. case 0x2d:
  490. /* Data security erase failure. */
  491. if (request->op == TO_DSE)
  492. return tape_34xx_erp_failed(request, -EIO);
  493. /* Data security erase failure, but no such command issued. */
  494. return tape_34xx_erp_bug(device, request, irb, sense[3]);
  495. case 0x2e:
  496. /*
  497. * Not capable. This indicates either that the drive fails
  498. * reading the format id mark or that that format specified
  499. * is not supported by the drive.
  500. */
  501. dev_warn (&device->cdev->dev, "The tape unit cannot process "
  502. "the tape format\n");
  503. return tape_34xx_erp_failed(request, -EMEDIUMTYPE);
  504. case 0x30:
  505. /* The medium is write protected. */
  506. dev_warn (&device->cdev->dev, "The tape medium is write-"
  507. "protected\n");
  508. return tape_34xx_erp_failed(request, -EACCES);
  509. case 0x32:
  510. // Tension loss. We cannot recover this, it's an I/O error.
  511. dev_warn (&device->cdev->dev, "The tape does not have the "
  512. "required tape tension\n");
  513. return tape_34xx_erp_failed(request, -EIO);
  514. case 0x33:
  515. /*
  516. * Load Failure. The cartridge was not inserted correctly or
  517. * the tape is not threaded correctly.
  518. */
  519. dev_warn (&device->cdev->dev, "The tape unit failed to load"
  520. " the cartridge\n");
  521. tape_34xx_delete_sbid_from(device, 0);
  522. return tape_34xx_erp_failed(request, -EIO);
  523. case 0x34:
  524. /*
  525. * Unload failure. The drive cannot maintain tape tension
  526. * and control tape movement during an unload operation.
  527. */
  528. dev_warn (&device->cdev->dev, "Automatic unloading of the tape"
  529. " cartridge failed\n");
  530. if (request->op == TO_RUN)
  531. return tape_34xx_erp_failed(request, -EIO);
  532. return tape_34xx_erp_bug(device, request, irb, sense[3]);
  533. case 0x35:
  534. /*
  535. * Drive equipment check. One of the following:
  536. * - cu cannot recover from a drive detected error
  537. * - a check code message is shown on drive display
  538. * - the cartridge loader does not respond correctly
  539. * - a failure occurs during an index, load, or unload cycle
  540. */
  541. dev_warn (&device->cdev->dev, "An equipment check has occurred"
  542. " on the tape unit\n");
  543. return tape_34xx_erp_failed(request, -EIO);
  544. case 0x36:
  545. if (device->cdev->id.driver_info == tape_3490)
  546. /* End of data. */
  547. return tape_34xx_erp_failed(request, -EIO);
  548. /* This erpa is reserved for 3480 */
  549. return tape_34xx_erp_bug(device, request, irb, sense[3]);
  550. case 0x37:
  551. /*
  552. * Tape length error. The tape is shorter than reported in
  553. * the beginning-of-tape data.
  554. */
  555. dev_warn (&device->cdev->dev, "The tape information states an"
  556. " incorrect length\n");
  557. return tape_34xx_erp_failed(request, -EIO);
  558. case 0x38:
  559. /*
  560. * Physical end of tape. A read/write operation reached
  561. * the physical end of tape.
  562. */
  563. if (request->op==TO_WRI ||
  564. request->op==TO_DSE ||
  565. request->op==TO_WTM)
  566. return tape_34xx_erp_failed(request, -ENOSPC);
  567. return tape_34xx_erp_failed(request, -EIO);
  568. case 0x39:
  569. /* Backward at Beginning of tape. */
  570. return tape_34xx_erp_failed(request, -EIO);
  571. case 0x3a:
  572. /* Drive switched to not ready. */
  573. dev_warn (&device->cdev->dev, "The tape unit is not ready\n");
  574. return tape_34xx_erp_failed(request, -EIO);
  575. case 0x3b:
  576. /* Manual rewind or unload. This causes an I/O error. */
  577. dev_warn (&device->cdev->dev, "The tape medium has been "
  578. "rewound or unloaded manually\n");
  579. tape_34xx_delete_sbid_from(device, 0);
  580. return tape_34xx_erp_failed(request, -EIO);
  581. case 0x42:
  582. /*
  583. * Degraded mode. A condition that can cause degraded
  584. * performance is detected.
  585. */
  586. dev_warn (&device->cdev->dev, "The tape subsystem is running "
  587. "in degraded mode\n");
  588. return tape_34xx_erp_retry(request);
  589. case 0x43:
  590. /* Drive not ready. */
  591. tape_34xx_delete_sbid_from(device, 0);
  592. tape_med_state_set(device, MS_UNLOADED);
  593. /* Some commands commands are successful even in this case */
  594. if (sense[1] & SENSE_DRIVE_ONLINE) {
  595. switch(request->op) {
  596. case TO_ASSIGN:
  597. case TO_UNASSIGN:
  598. case TO_DIS:
  599. case TO_NOP:
  600. return tape_34xx_done(request);
  601. break;
  602. default:
  603. break;
  604. }
  605. }
  606. return tape_34xx_erp_failed(request, -ENOMEDIUM);
  607. case 0x44:
  608. /* Locate Block unsuccessful. */
  609. if (request->op != TO_BLOCK && request->op != TO_LBL)
  610. /* No locate block was issued. */
  611. return tape_34xx_erp_bug(device, request,
  612. irb, sense[3]);
  613. return tape_34xx_erp_failed(request, -EIO);
  614. case 0x45:
  615. /* The drive is assigned to a different channel path. */
  616. dev_warn (&device->cdev->dev, "The tape unit is already "
  617. "assigned\n");
  618. return tape_34xx_erp_failed(request, -EIO);
  619. case 0x46:
  620. /*
  621. * Drive not on-line. Drive may be switched offline,
  622. * the power supply may be switched off or
  623. * the drive address may not be set correctly.
  624. */
  625. dev_warn (&device->cdev->dev, "The tape unit is not online\n");
  626. return tape_34xx_erp_failed(request, -EIO);
  627. case 0x47:
  628. /* Volume fenced. CU reports volume integrity is lost. */
  629. dev_warn (&device->cdev->dev, "The control unit has fenced "
  630. "access to the tape volume\n");
  631. tape_34xx_delete_sbid_from(device, 0);
  632. return tape_34xx_erp_failed(request, -EIO);
  633. case 0x48:
  634. /* Log sense data and retry request. */
  635. return tape_34xx_erp_retry(request);
  636. case 0x49:
  637. /* Bus out check. A parity check error on the bus was found. */
  638. dev_warn (&device->cdev->dev, "A parity error occurred on the "
  639. "tape bus\n");
  640. return tape_34xx_erp_failed(request, -EIO);
  641. case 0x4a:
  642. /* Control unit erp failed. */
  643. dev_warn (&device->cdev->dev, "I/O error recovery failed on "
  644. "the tape control unit\n");
  645. return tape_34xx_erp_failed(request, -EIO);
  646. case 0x4b:
  647. /*
  648. * CU and drive incompatible. The drive requests micro-program
  649. * patches, which are not available on the CU.
  650. */
  651. dev_warn (&device->cdev->dev, "The tape unit requires a "
  652. "firmware update\n");
  653. return tape_34xx_erp_failed(request, -EIO);
  654. case 0x4c:
  655. /*
  656. * Recovered Check-One failure. Cu develops a hardware error,
  657. * but is able to recover.
  658. */
  659. return tape_34xx_erp_retry(request);
  660. case 0x4d:
  661. if (device->cdev->id.driver_info == tape_3490)
  662. /*
  663. * Resetting event received. Since the driver does
  664. * not support resetting event recovery (which has to
  665. * be handled by the I/O Layer), retry our command.
  666. */
  667. return tape_34xx_erp_retry(request);
  668. /* This erpa is reserved for 3480. */
  669. return tape_34xx_erp_bug(device, request, irb, sense[3]);
  670. case 0x4e:
  671. if (device->cdev->id.driver_info == tape_3490) {
  672. /*
  673. * Maximum block size exceeded. This indicates, that
  674. * the block to be written is larger than allowed for
  675. * buffered mode.
  676. */
  677. dev_warn (&device->cdev->dev, "The maximum block size"
  678. " for buffered mode is exceeded\n");
  679. return tape_34xx_erp_failed(request, -ENOBUFS);
  680. }
  681. /* This erpa is reserved for 3480. */
  682. return tape_34xx_erp_bug(device, request, irb, sense[3]);
  683. case 0x50:
  684. /*
  685. * Read buffered log (Overflow). CU is running in extended
  686. * buffered log mode, and a counter overflows. This should
  687. * never happen, since we're never running in extended
  688. * buffered log mode.
  689. */
  690. return tape_34xx_erp_retry(request);
  691. case 0x51:
  692. /*
  693. * Read buffered log (EOV). EOF processing occurs while the
  694. * CU is in extended buffered log mode. This should never
  695. * happen, since we're never running in extended buffered
  696. * log mode.
  697. */
  698. return tape_34xx_erp_retry(request);
  699. case 0x52:
  700. /* End of Volume complete. Rewind unload completed ok. */
  701. if (request->op == TO_RUN) {
  702. tape_med_state_set(device, MS_UNLOADED);
  703. tape_34xx_delete_sbid_from(device, 0);
  704. return tape_34xx_erp_succeeded(request);
  705. }
  706. return tape_34xx_erp_bug(device, request, irb, sense[3]);
  707. case 0x53:
  708. /* Global command intercept. */
  709. return tape_34xx_erp_retry(request);
  710. case 0x54:
  711. /* Channel interface recovery (temporary). */
  712. return tape_34xx_erp_retry(request);
  713. case 0x55:
  714. /* Channel interface recovery (permanent). */
  715. dev_warn (&device->cdev->dev, "A channel interface error cannot be"
  716. " recovered\n");
  717. return tape_34xx_erp_failed(request, -EIO);
  718. case 0x56:
  719. /* Channel protocol error. */
  720. dev_warn (&device->cdev->dev, "A channel protocol error "
  721. "occurred\n");
  722. return tape_34xx_erp_failed(request, -EIO);
  723. case 0x57:
  724. if (device->cdev->id.driver_info == tape_3480) {
  725. /* Attention intercept. */
  726. return tape_34xx_erp_retry(request);
  727. } else {
  728. /* Global status intercept. */
  729. return tape_34xx_erp_retry(request);
  730. }
  731. case 0x5a:
  732. /*
  733. * Tape length incompatible. The tape inserted is too long,
  734. * which could cause damage to the tape or the drive.
  735. */
  736. dev_warn (&device->cdev->dev, "The tape unit does not support "
  737. "the tape length\n");
  738. return tape_34xx_erp_failed(request, -EIO);
  739. case 0x5b:
  740. /* Format 3480 XF incompatible */
  741. if (sense[1] & SENSE_BEGINNING_OF_TAPE)
  742. /* The tape will get overwritten. */
  743. return tape_34xx_erp_retry(request);
  744. dev_warn (&device->cdev->dev, "The tape unit does not support"
  745. " format 3480 XF\n");
  746. return tape_34xx_erp_failed(request, -EIO);
  747. case 0x5c:
  748. /* Format 3480-2 XF incompatible */
  749. dev_warn (&device->cdev->dev, "The tape unit does not support tape "
  750. "format 3480-2 XF\n");
  751. return tape_34xx_erp_failed(request, -EIO);
  752. case 0x5d:
  753. /* Tape length violation. */
  754. dev_warn (&device->cdev->dev, "The tape unit does not support"
  755. " the current tape length\n");
  756. return tape_34xx_erp_failed(request, -EMEDIUMTYPE);
  757. case 0x5e:
  758. /* Compaction algorithm incompatible. */
  759. dev_warn (&device->cdev->dev, "The tape unit does not support"
  760. " the compaction algorithm\n");
  761. return tape_34xx_erp_failed(request, -EMEDIUMTYPE);
  762. /* The following erpas should have been covered earlier. */
  763. case 0x23: /* Read data check. */
  764. case 0x25: /* Write data check. */
  765. case 0x26: /* Data check (read opposite). */
  766. case 0x28: /* Write id mark check. */
  767. case 0x31: /* Tape void. */
  768. case 0x40: /* Overrun error. */
  769. case 0x41: /* Record sequence error. */
  770. /* All other erpas are reserved for future use. */
  771. default:
  772. return tape_34xx_erp_bug(device, request, irb, sense[3]);
  773. }
  774. }
  775. /*
  776. * 3480/3490 interrupt handler
  777. */
  778. static int
  779. tape_34xx_irq(struct tape_device *device, struct tape_request *request,
  780. struct irb *irb)
  781. {
  782. if (request == NULL)
  783. return tape_34xx_unsolicited_irq(device, irb);
  784. if ((irb->scsw.cmd.dstat & DEV_STAT_UNIT_EXCEP) &&
  785. (irb->scsw.cmd.dstat & DEV_STAT_DEV_END) &&
  786. (request->op == TO_WRI)) {
  787. /* Write at end of volume */
  788. return tape_34xx_erp_failed(request, -ENOSPC);
  789. }
  790. if (irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK)
  791. return tape_34xx_unit_check(device, request, irb);
  792. if (irb->scsw.cmd.dstat & DEV_STAT_DEV_END) {
  793. /*
  794. * A unit exception occurs on skipping over a tapemark block.
  795. */
  796. if (irb->scsw.cmd.dstat & DEV_STAT_UNIT_EXCEP) {
  797. if (request->op == TO_BSB || request->op == TO_FSB)
  798. request->rescnt++;
  799. else
  800. DBF_EVENT(5, "Unit Exception!\n");
  801. }
  802. return tape_34xx_done(request);
  803. }
  804. DBF_EVENT(6, "xunknownirq\n");
  805. tape_dump_sense_dbf(device, request, irb);
  806. return TAPE_IO_STOP;
  807. }
  808. /*
  809. * ioctl_overload
  810. */
  811. static int
  812. tape_34xx_ioctl(struct tape_device *device, unsigned int cmd, unsigned long arg)
  813. {
  814. if (cmd == TAPE390_DISPLAY) {
  815. struct display_struct disp;
  816. if (copy_from_user(&disp, (char __user *) arg, sizeof(disp)) != 0)
  817. return -EFAULT;
  818. return tape_std_display(device, &disp);
  819. } else
  820. return -EINVAL;
  821. }
  822. static inline void
  823. tape_34xx_append_new_sbid(struct tape_34xx_block_id bid, struct list_head *l)
  824. {
  825. struct tape_34xx_sbid * new_sbid;
  826. new_sbid = kmalloc(sizeof(*new_sbid), GFP_ATOMIC);
  827. if (!new_sbid)
  828. return;
  829. new_sbid->bid = bid;
  830. list_add(&new_sbid->list, l);
  831. }
  832. /*
  833. * Build up the search block ID list. The block ID consists of a logical
  834. * block number and a hardware specific part. The hardware specific part
  835. * helps the tape drive to speed up searching for a specific block.
  836. */
  837. static void
  838. tape_34xx_add_sbid(struct tape_device *device, struct tape_34xx_block_id bid)
  839. {
  840. struct list_head * sbid_list;
  841. struct tape_34xx_sbid * sbid;
  842. struct list_head * l;
  843. /*
  844. * immediately return if there is no list at all or the block to add
  845. * is located in segment 1 of wrap 0 because this position is used
  846. * if no hardware position data is supplied.
  847. */
  848. sbid_list = (struct list_head *) device->discdata;
  849. if (!sbid_list || (bid.segment < 2 && bid.wrap == 0))
  850. return;
  851. /*
  852. * Search the position where to insert the new entry. Hardware
  853. * acceleration uses only the segment and wrap number. So we
  854. * need only one entry for a specific wrap/segment combination.
  855. * If there is a block with a lower number but the same hard-
  856. * ware position data we just update the block number in the
  857. * existing entry.
  858. */
  859. list_for_each(l, sbid_list) {
  860. sbid = list_entry(l, struct tape_34xx_sbid, list);
  861. if (
  862. (sbid->bid.segment == bid.segment) &&
  863. (sbid->bid.wrap == bid.wrap)
  864. ) {
  865. if (bid.block < sbid->bid.block)
  866. sbid->bid = bid;
  867. else return;
  868. break;
  869. }
  870. /* Sort in according to logical block number. */
  871. if (bid.block < sbid->bid.block) {
  872. tape_34xx_append_new_sbid(bid, l->prev);
  873. break;
  874. }
  875. }
  876. /* List empty or new block bigger than last entry. */
  877. if (l == sbid_list)
  878. tape_34xx_append_new_sbid(bid, l->prev);
  879. DBF_LH(4, "Current list is:\n");
  880. list_for_each(l, sbid_list) {
  881. sbid = list_entry(l, struct tape_34xx_sbid, list);
  882. DBF_LH(4, "%d:%03d@%05d\n",
  883. sbid->bid.wrap,
  884. sbid->bid.segment,
  885. sbid->bid.block
  886. );
  887. }
  888. }
  889. /*
  890. * Delete all entries from the search block ID list that belong to tape blocks
  891. * equal or higher than the given number.
  892. */
  893. static void
  894. tape_34xx_delete_sbid_from(struct tape_device *device, int from)
  895. {
  896. struct list_head * sbid_list;
  897. struct tape_34xx_sbid * sbid;
  898. struct list_head * l;
  899. struct list_head * n;
  900. sbid_list = (struct list_head *) device->discdata;
  901. if (!sbid_list)
  902. return;
  903. list_for_each_safe(l, n, sbid_list) {
  904. sbid = list_entry(l, struct tape_34xx_sbid, list);
  905. if (sbid->bid.block >= from) {
  906. DBF_LH(4, "Delete sbid %d:%03d@%05d\n",
  907. sbid->bid.wrap,
  908. sbid->bid.segment,
  909. sbid->bid.block
  910. );
  911. list_del(l);
  912. kfree(sbid);
  913. }
  914. }
  915. }
  916. /*
  917. * Merge hardware position data into a block id.
  918. */
  919. static void
  920. tape_34xx_merge_sbid(
  921. struct tape_device * device,
  922. struct tape_34xx_block_id * bid
  923. ) {
  924. struct tape_34xx_sbid * sbid;
  925. struct tape_34xx_sbid * sbid_to_use;
  926. struct list_head * sbid_list;
  927. struct list_head * l;
  928. sbid_list = (struct list_head *) device->discdata;
  929. bid->wrap = 0;
  930. bid->segment = 1;
  931. if (!sbid_list || list_empty(sbid_list))
  932. return;
  933. sbid_to_use = NULL;
  934. list_for_each(l, sbid_list) {
  935. sbid = list_entry(l, struct tape_34xx_sbid, list);
  936. if (sbid->bid.block >= bid->block)
  937. break;
  938. sbid_to_use = sbid;
  939. }
  940. if (sbid_to_use) {
  941. bid->wrap = sbid_to_use->bid.wrap;
  942. bid->segment = sbid_to_use->bid.segment;
  943. DBF_LH(4, "Use %d:%03d@%05d for %05d\n",
  944. sbid_to_use->bid.wrap,
  945. sbid_to_use->bid.segment,
  946. sbid_to_use->bid.block,
  947. bid->block
  948. );
  949. }
  950. }
  951. static int
  952. tape_34xx_setup_device(struct tape_device * device)
  953. {
  954. int rc;
  955. struct list_head * discdata;
  956. DBF_EVENT(6, "34xx device setup\n");
  957. if ((rc = tape_std_assign(device)) == 0) {
  958. if ((rc = tape_34xx_medium_sense(device)) != 0) {
  959. DBF_LH(3, "34xx medium sense returned %d\n", rc);
  960. }
  961. }
  962. discdata = kmalloc(sizeof(struct list_head), GFP_KERNEL);
  963. if (discdata) {
  964. INIT_LIST_HEAD(discdata);
  965. device->discdata = discdata;
  966. }
  967. return rc;
  968. }
  969. static void
  970. tape_34xx_cleanup_device(struct tape_device *device)
  971. {
  972. tape_std_unassign(device);
  973. if (device->discdata) {
  974. tape_34xx_delete_sbid_from(device, 0);
  975. kfree(device->discdata);
  976. device->discdata = NULL;
  977. }
  978. }
  979. /*
  980. * MTTELL: Tell block. Return the number of block relative to current file.
  981. */
  982. static int
  983. tape_34xx_mttell(struct tape_device *device, int mt_count)
  984. {
  985. struct {
  986. struct tape_34xx_block_id cbid;
  987. struct tape_34xx_block_id dbid;
  988. } __attribute__ ((packed)) block_id;
  989. int rc;
  990. rc = tape_std_read_block_id(device, (__u64 *) &block_id);
  991. if (rc)
  992. return rc;
  993. tape_34xx_add_sbid(device, block_id.cbid);
  994. return block_id.cbid.block;
  995. }
  996. /*
  997. * MTSEEK: seek to the specified block.
  998. */
  999. static int
  1000. tape_34xx_mtseek(struct tape_device *device, int mt_count)
  1001. {
  1002. struct tape_request *request;
  1003. struct tape_34xx_block_id * bid;
  1004. if (mt_count > 0x3fffff) {
  1005. DBF_EXCEPTION(6, "xsee parm\n");
  1006. return -EINVAL;
  1007. }
  1008. request = tape_alloc_request(3, 4);
  1009. if (IS_ERR(request))
  1010. return PTR_ERR(request);
  1011. /* setup ccws */
  1012. request->op = TO_LBL;
  1013. bid = (struct tape_34xx_block_id *) request->cpdata;
  1014. bid->format = (*device->modeset_byte & 0x08) ?
  1015. TAPE34XX_FMT_3480_XF : TAPE34XX_FMT_3480;
  1016. bid->block = mt_count;
  1017. tape_34xx_merge_sbid(device, bid);
  1018. tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte);
  1019. tape_ccw_cc(request->cpaddr + 1, LOCATE, 4, request->cpdata);
  1020. tape_ccw_end(request->cpaddr + 2, NOP, 0, NULL);
  1021. /* execute it */
  1022. return tape_do_io_free(device, request);
  1023. }
  1024. /*
  1025. * List of 3480/3490 magnetic tape commands.
  1026. */
  1027. static tape_mtop_fn tape_34xx_mtop[TAPE_NR_MTOPS] = {
  1028. [MTRESET] = tape_std_mtreset,
  1029. [MTFSF] = tape_std_mtfsf,
  1030. [MTBSF] = tape_std_mtbsf,
  1031. [MTFSR] = tape_std_mtfsr,
  1032. [MTBSR] = tape_std_mtbsr,
  1033. [MTWEOF] = tape_std_mtweof,
  1034. [MTREW] = tape_std_mtrew,
  1035. [MTOFFL] = tape_std_mtoffl,
  1036. [MTNOP] = tape_std_mtnop,
  1037. [MTRETEN] = tape_std_mtreten,
  1038. [MTBSFM] = tape_std_mtbsfm,
  1039. [MTFSFM] = tape_std_mtfsfm,
  1040. [MTEOM] = tape_std_mteom,
  1041. [MTERASE] = tape_std_mterase,
  1042. [MTRAS1] = NULL,
  1043. [MTRAS2] = NULL,
  1044. [MTRAS3] = NULL,
  1045. [MTSETBLK] = tape_std_mtsetblk,
  1046. [MTSETDENSITY] = NULL,
  1047. [MTSEEK] = tape_34xx_mtseek,
  1048. [MTTELL] = tape_34xx_mttell,
  1049. [MTSETDRVBUFFER] = NULL,
  1050. [MTFSS] = NULL,
  1051. [MTBSS] = NULL,
  1052. [MTWSM] = NULL,
  1053. [MTLOCK] = NULL,
  1054. [MTUNLOCK] = NULL,
  1055. [MTLOAD] = tape_std_mtload,
  1056. [MTUNLOAD] = tape_std_mtunload,
  1057. [MTCOMPRESSION] = tape_std_mtcompression,
  1058. [MTSETPART] = NULL,
  1059. [MTMKPART] = NULL
  1060. };
  1061. /*
  1062. * Tape discipline structure for 3480 and 3490.
  1063. */
  1064. static struct tape_discipline tape_discipline_34xx = {
  1065. .owner = THIS_MODULE,
  1066. .setup_device = tape_34xx_setup_device,
  1067. .cleanup_device = tape_34xx_cleanup_device,
  1068. .process_eov = tape_std_process_eov,
  1069. .irq = tape_34xx_irq,
  1070. .read_block = tape_std_read_block,
  1071. .write_block = tape_std_write_block,
  1072. .ioctl_fn = tape_34xx_ioctl,
  1073. .mtop_array = tape_34xx_mtop
  1074. };
  1075. static struct ccw_device_id tape_34xx_ids[] = {
  1076. { CCW_DEVICE_DEVTYPE(0x3480, 0, 0x3480, 0), .driver_info = tape_3480},
  1077. { CCW_DEVICE_DEVTYPE(0x3490, 0, 0x3490, 0), .driver_info = tape_3490},
  1078. { /* end of list */ },
  1079. };
  1080. static int
  1081. tape_34xx_online(struct ccw_device *cdev)
  1082. {
  1083. return tape_generic_online(
  1084. dev_get_drvdata(&cdev->dev),
  1085. &tape_discipline_34xx
  1086. );
  1087. }
  1088. static struct ccw_driver tape_34xx_driver = {
  1089. .driver = {
  1090. .name = "tape_34xx",
  1091. .owner = THIS_MODULE,
  1092. },
  1093. .ids = tape_34xx_ids,
  1094. .probe = tape_generic_probe,
  1095. .remove = tape_generic_remove,
  1096. .set_online = tape_34xx_online,
  1097. .set_offline = tape_generic_offline,
  1098. .freeze = tape_generic_pm_suspend,
  1099. .int_class = IRQIO_TAP,
  1100. };
  1101. static int
  1102. tape_34xx_init (void)
  1103. {
  1104. int rc;
  1105. TAPE_DBF_AREA = debug_register ( "tape_34xx", 2, 2, 4*sizeof(long));
  1106. debug_register_view(TAPE_DBF_AREA, &debug_sprintf_view);
  1107. #ifdef DBF_LIKE_HELL
  1108. debug_set_level(TAPE_DBF_AREA, 6);
  1109. #endif
  1110. DBF_EVENT(3, "34xx init\n");
  1111. /* Register driver for 3480/3490 tapes. */
  1112. rc = ccw_driver_register(&tape_34xx_driver);
  1113. if (rc)
  1114. DBF_EVENT(3, "34xx init failed\n");
  1115. else
  1116. DBF_EVENT(3, "34xx registered\n");
  1117. return rc;
  1118. }
  1119. static void
  1120. tape_34xx_exit(void)
  1121. {
  1122. ccw_driver_unregister(&tape_34xx_driver);
  1123. debug_unregister(TAPE_DBF_AREA);
  1124. }
  1125. MODULE_DEVICE_TABLE(ccw, tape_34xx_ids);
  1126. MODULE_AUTHOR("(C) 2001-2002 IBM Deutschland Entwicklung GmbH");
  1127. MODULE_DESCRIPTION("Linux on zSeries channel attached 3480 tape device driver");
  1128. MODULE_LICENSE("GPL");
  1129. module_init(tape_34xx_init);
  1130. module_exit(tape_34xx_exit);