tape_34xx.c 34 KB

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