sr_ioctl.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. #include <linux/kernel.h>
  2. #include <linux/mm.h>
  3. #include <linux/fs.h>
  4. #include <linux/errno.h>
  5. #include <linux/string.h>
  6. #include <linux/blkdev.h>
  7. #include <linux/module.h>
  8. #include <linux/blkpg.h>
  9. #include <linux/cdrom.h>
  10. #include <linux/delay.h>
  11. #include <linux/slab.h>
  12. #include <asm/io.h>
  13. #include <asm/uaccess.h>
  14. #include <scsi/scsi.h>
  15. #include <scsi/scsi_dbg.h>
  16. #include <scsi/scsi_device.h>
  17. #include <scsi/scsi_eh.h>
  18. #include <scsi/scsi_host.h>
  19. #include <scsi/scsi_ioctl.h>
  20. #include <scsi/scsi_cmnd.h>
  21. #include "sr.h"
  22. #if 0
  23. #define DEBUG
  24. #endif
  25. /* The sr_is_xa() seems to trigger firmware bugs with some drives :-(
  26. * It is off by default and can be turned on with this module parameter */
  27. static int xa_test = 0;
  28. module_param(xa_test, int, S_IRUGO | S_IWUSR);
  29. /* primitive to determine whether we need to have GFP_DMA set based on
  30. * the status of the unchecked_isa_dma flag in the host structure */
  31. #define SR_GFP_DMA(cd) (((cd)->device->host->unchecked_isa_dma) ? GFP_DMA : 0)
  32. static int sr_read_tochdr(struct cdrom_device_info *cdi,
  33. struct cdrom_tochdr *tochdr)
  34. {
  35. struct scsi_cd *cd = cdi->handle;
  36. struct packet_command cgc;
  37. int result;
  38. unsigned char *buffer;
  39. buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd));
  40. if (!buffer)
  41. return -ENOMEM;
  42. memset(&cgc, 0, sizeof(struct packet_command));
  43. cgc.timeout = IOCTL_TIMEOUT;
  44. cgc.cmd[0] = GPCMD_READ_TOC_PMA_ATIP;
  45. cgc.cmd[8] = 12; /* LSB of length */
  46. cgc.buffer = buffer;
  47. cgc.buflen = 12;
  48. cgc.quiet = 1;
  49. cgc.data_direction = DMA_FROM_DEVICE;
  50. result = sr_do_ioctl(cd, &cgc);
  51. tochdr->cdth_trk0 = buffer[2];
  52. tochdr->cdth_trk1 = buffer[3];
  53. kfree(buffer);
  54. return result;
  55. }
  56. static int sr_read_tocentry(struct cdrom_device_info *cdi,
  57. struct cdrom_tocentry *tocentry)
  58. {
  59. struct scsi_cd *cd = cdi->handle;
  60. struct packet_command cgc;
  61. int result;
  62. unsigned char *buffer;
  63. buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd));
  64. if (!buffer)
  65. return -ENOMEM;
  66. memset(&cgc, 0, sizeof(struct packet_command));
  67. cgc.timeout = IOCTL_TIMEOUT;
  68. cgc.cmd[0] = GPCMD_READ_TOC_PMA_ATIP;
  69. cgc.cmd[1] |= (tocentry->cdte_format == CDROM_MSF) ? 0x02 : 0;
  70. cgc.cmd[6] = tocentry->cdte_track;
  71. cgc.cmd[8] = 12; /* LSB of length */
  72. cgc.buffer = buffer;
  73. cgc.buflen = 12;
  74. cgc.data_direction = DMA_FROM_DEVICE;
  75. result = sr_do_ioctl(cd, &cgc);
  76. tocentry->cdte_ctrl = buffer[5] & 0xf;
  77. tocentry->cdte_adr = buffer[5] >> 4;
  78. tocentry->cdte_datamode = (tocentry->cdte_ctrl & 0x04) ? 1 : 0;
  79. if (tocentry->cdte_format == CDROM_MSF) {
  80. tocentry->cdte_addr.msf.minute = buffer[9];
  81. tocentry->cdte_addr.msf.second = buffer[10];
  82. tocentry->cdte_addr.msf.frame = buffer[11];
  83. } else
  84. tocentry->cdte_addr.lba = (((((buffer[8] << 8) + buffer[9]) << 8)
  85. + buffer[10]) << 8) + buffer[11];
  86. kfree(buffer);
  87. return result;
  88. }
  89. #define IOCTL_RETRIES 3
  90. /* ATAPI drives don't have a SCMD_PLAYAUDIO_TI command. When these drives
  91. are emulating a SCSI device via the idescsi module, they need to have
  92. CDROMPLAYTRKIND commands translated into CDROMPLAYMSF commands for them */
  93. static int sr_fake_playtrkind(struct cdrom_device_info *cdi, struct cdrom_ti *ti)
  94. {
  95. struct cdrom_tocentry trk0_te, trk1_te;
  96. struct cdrom_tochdr tochdr;
  97. struct packet_command cgc;
  98. int ntracks, ret;
  99. ret = sr_read_tochdr(cdi, &tochdr);
  100. if (ret)
  101. return ret;
  102. ntracks = tochdr.cdth_trk1 - tochdr.cdth_trk0 + 1;
  103. if (ti->cdti_trk1 == ntracks)
  104. ti->cdti_trk1 = CDROM_LEADOUT;
  105. else if (ti->cdti_trk1 != CDROM_LEADOUT)
  106. ti->cdti_trk1 ++;
  107. trk0_te.cdte_track = ti->cdti_trk0;
  108. trk0_te.cdte_format = CDROM_MSF;
  109. trk1_te.cdte_track = ti->cdti_trk1;
  110. trk1_te.cdte_format = CDROM_MSF;
  111. ret = sr_read_tocentry(cdi, &trk0_te);
  112. if (ret)
  113. return ret;
  114. ret = sr_read_tocentry(cdi, &trk1_te);
  115. if (ret)
  116. return ret;
  117. memset(&cgc, 0, sizeof(struct packet_command));
  118. cgc.cmd[0] = GPCMD_PLAY_AUDIO_MSF;
  119. cgc.cmd[3] = trk0_te.cdte_addr.msf.minute;
  120. cgc.cmd[4] = trk0_te.cdte_addr.msf.second;
  121. cgc.cmd[5] = trk0_te.cdte_addr.msf.frame;
  122. cgc.cmd[6] = trk1_te.cdte_addr.msf.minute;
  123. cgc.cmd[7] = trk1_te.cdte_addr.msf.second;
  124. cgc.cmd[8] = trk1_te.cdte_addr.msf.frame;
  125. cgc.data_direction = DMA_NONE;
  126. cgc.timeout = IOCTL_TIMEOUT;
  127. return sr_do_ioctl(cdi->handle, &cgc);
  128. }
  129. static int sr_play_trkind(struct cdrom_device_info *cdi,
  130. struct cdrom_ti *ti)
  131. {
  132. struct scsi_cd *cd = cdi->handle;
  133. struct packet_command cgc;
  134. int result;
  135. memset(&cgc, 0, sizeof(struct packet_command));
  136. cgc.timeout = IOCTL_TIMEOUT;
  137. cgc.cmd[0] = GPCMD_PLAYAUDIO_TI;
  138. cgc.cmd[4] = ti->cdti_trk0;
  139. cgc.cmd[5] = ti->cdti_ind0;
  140. cgc.cmd[7] = ti->cdti_trk1;
  141. cgc.cmd[8] = ti->cdti_ind1;
  142. cgc.data_direction = DMA_NONE;
  143. result = sr_do_ioctl(cd, &cgc);
  144. if (result == -EDRIVE_CANT_DO_THIS)
  145. result = sr_fake_playtrkind(cdi, ti);
  146. return result;
  147. }
  148. /* We do our own retries because we want to know what the specific
  149. error code is. Normally the UNIT_ATTENTION code will automatically
  150. clear after one error */
  151. int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc)
  152. {
  153. struct scsi_device *SDev;
  154. struct scsi_sense_hdr sshdr;
  155. int result, err = 0, retries = 0;
  156. unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE];
  157. SDev = cd->device;
  158. retry:
  159. if (!scsi_block_when_processing_errors(SDev)) {
  160. err = -ENODEV;
  161. goto out;
  162. }
  163. memset(sense_buffer, 0, sizeof(sense_buffer));
  164. result = scsi_execute(SDev, cgc->cmd, cgc->data_direction,
  165. cgc->buffer, cgc->buflen, sense_buffer,
  166. cgc->timeout, IOCTL_RETRIES, 0, NULL);
  167. scsi_normalize_sense(sense_buffer, sizeof(sense_buffer), &sshdr);
  168. if (cgc->sense)
  169. memcpy(cgc->sense, sense_buffer, sizeof(*cgc->sense));
  170. /* Minimal error checking. Ignore cases we know about, and report the rest. */
  171. if (driver_byte(result) != 0) {
  172. switch (sshdr.sense_key) {
  173. case UNIT_ATTENTION:
  174. SDev->changed = 1;
  175. if (!cgc->quiet)
  176. sr_printk(KERN_INFO, cd,
  177. "disc change detected.\n");
  178. if (retries++ < 10)
  179. goto retry;
  180. err = -ENOMEDIUM;
  181. break;
  182. case NOT_READY: /* This happens if there is no disc in drive */
  183. if (sshdr.asc == 0x04 &&
  184. sshdr.ascq == 0x01) {
  185. /* sense: Logical unit is in process of becoming ready */
  186. if (!cgc->quiet)
  187. sr_printk(KERN_INFO, cd,
  188. "CDROM not ready yet.\n");
  189. if (retries++ < 10) {
  190. /* sleep 2 sec and try again */
  191. ssleep(2);
  192. goto retry;
  193. } else {
  194. /* 20 secs are enough? */
  195. err = -ENOMEDIUM;
  196. break;
  197. }
  198. }
  199. if (!cgc->quiet)
  200. sr_printk(KERN_INFO, cd,
  201. "CDROM not ready. Make sure there "
  202. "is a disc in the drive.\n");
  203. err = -ENOMEDIUM;
  204. break;
  205. case ILLEGAL_REQUEST:
  206. err = -EIO;
  207. if (sshdr.asc == 0x20 &&
  208. sshdr.ascq == 0x00)
  209. /* sense: Invalid command operation code */
  210. err = -EDRIVE_CANT_DO_THIS;
  211. break;
  212. default:
  213. err = -EIO;
  214. }
  215. }
  216. /* Wake up a process waiting for device */
  217. out:
  218. cgc->stat = err;
  219. return err;
  220. }
  221. /* ---------------------------------------------------------------------- */
  222. /* interface to cdrom.c */
  223. int sr_tray_move(struct cdrom_device_info *cdi, int pos)
  224. {
  225. Scsi_CD *cd = cdi->handle;
  226. struct packet_command cgc;
  227. memset(&cgc, 0, sizeof(struct packet_command));
  228. cgc.cmd[0] = GPCMD_START_STOP_UNIT;
  229. cgc.cmd[4] = (pos == 0) ? 0x03 /* close */ : 0x02 /* eject */ ;
  230. cgc.data_direction = DMA_NONE;
  231. cgc.timeout = IOCTL_TIMEOUT;
  232. return sr_do_ioctl(cd, &cgc);
  233. }
  234. int sr_lock_door(struct cdrom_device_info *cdi, int lock)
  235. {
  236. Scsi_CD *cd = cdi->handle;
  237. return scsi_set_medium_removal(cd->device, lock ?
  238. SCSI_REMOVAL_PREVENT : SCSI_REMOVAL_ALLOW);
  239. }
  240. int sr_drive_status(struct cdrom_device_info *cdi, int slot)
  241. {
  242. struct scsi_cd *cd = cdi->handle;
  243. struct scsi_sense_hdr sshdr;
  244. struct media_event_desc med;
  245. if (CDSL_CURRENT != slot) {
  246. /* we have no changer support */
  247. return -EINVAL;
  248. }
  249. if (!scsi_test_unit_ready(cd->device, SR_TIMEOUT, MAX_RETRIES, &sshdr))
  250. return CDS_DISC_OK;
  251. /* SK/ASC/ASCQ of 2/4/1 means "unit is becoming ready" */
  252. if (scsi_sense_valid(&sshdr) && sshdr.sense_key == NOT_READY
  253. && sshdr.asc == 0x04 && sshdr.ascq == 0x01)
  254. return CDS_DRIVE_NOT_READY;
  255. if (!cdrom_get_media_event(cdi, &med)) {
  256. if (med.media_present)
  257. return CDS_DISC_OK;
  258. else if (med.door_open)
  259. return CDS_TRAY_OPEN;
  260. else
  261. return CDS_NO_DISC;
  262. }
  263. /*
  264. * SK/ASC/ASCQ of 2/4/2 means "initialization required"
  265. * Using CD_TRAY_OPEN results in an START_STOP_UNIT to close
  266. * the tray, which resolves the initialization requirement.
  267. */
  268. if (scsi_sense_valid(&sshdr) && sshdr.sense_key == NOT_READY
  269. && sshdr.asc == 0x04 && sshdr.ascq == 0x02)
  270. return CDS_TRAY_OPEN;
  271. /*
  272. * 0x04 is format in progress .. but there must be a disc present!
  273. */
  274. if (sshdr.sense_key == NOT_READY && sshdr.asc == 0x04)
  275. return CDS_DISC_OK;
  276. /*
  277. * If not using Mt Fuji extended media tray reports,
  278. * just return TRAY_OPEN since ATAPI doesn't provide
  279. * any other way to detect this...
  280. */
  281. if (scsi_sense_valid(&sshdr) &&
  282. /* 0x3a is medium not present */
  283. sshdr.asc == 0x3a)
  284. return CDS_NO_DISC;
  285. else
  286. return CDS_TRAY_OPEN;
  287. return CDS_DRIVE_NOT_READY;
  288. }
  289. int sr_disk_status(struct cdrom_device_info *cdi)
  290. {
  291. Scsi_CD *cd = cdi->handle;
  292. struct cdrom_tochdr toc_h;
  293. struct cdrom_tocentry toc_e;
  294. int i, rc, have_datatracks = 0;
  295. /* look for data tracks */
  296. rc = sr_read_tochdr(cdi, &toc_h);
  297. if (rc)
  298. return (rc == -ENOMEDIUM) ? CDS_NO_DISC : CDS_NO_INFO;
  299. for (i = toc_h.cdth_trk0; i <= toc_h.cdth_trk1; i++) {
  300. toc_e.cdte_track = i;
  301. toc_e.cdte_format = CDROM_LBA;
  302. if (sr_read_tocentry(cdi, &toc_e))
  303. return CDS_NO_INFO;
  304. if (toc_e.cdte_ctrl & CDROM_DATA_TRACK) {
  305. have_datatracks = 1;
  306. break;
  307. }
  308. }
  309. if (!have_datatracks)
  310. return CDS_AUDIO;
  311. if (cd->xa_flag)
  312. return CDS_XA_2_1;
  313. else
  314. return CDS_DATA_1;
  315. }
  316. int sr_get_last_session(struct cdrom_device_info *cdi,
  317. struct cdrom_multisession *ms_info)
  318. {
  319. Scsi_CD *cd = cdi->handle;
  320. ms_info->addr.lba = cd->ms_offset;
  321. ms_info->xa_flag = cd->xa_flag || cd->ms_offset > 0;
  322. return 0;
  323. }
  324. int sr_get_mcn(struct cdrom_device_info *cdi, struct cdrom_mcn *mcn)
  325. {
  326. Scsi_CD *cd = cdi->handle;
  327. struct packet_command cgc;
  328. char *buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd));
  329. int result;
  330. if (!buffer)
  331. return -ENOMEM;
  332. memset(&cgc, 0, sizeof(struct packet_command));
  333. cgc.cmd[0] = GPCMD_READ_SUBCHANNEL;
  334. cgc.cmd[2] = 0x40; /* I do want the subchannel info */
  335. cgc.cmd[3] = 0x02; /* Give me medium catalog number info */
  336. cgc.cmd[8] = 24;
  337. cgc.buffer = buffer;
  338. cgc.buflen = 24;
  339. cgc.data_direction = DMA_FROM_DEVICE;
  340. cgc.timeout = IOCTL_TIMEOUT;
  341. result = sr_do_ioctl(cd, &cgc);
  342. memcpy(mcn->medium_catalog_number, buffer + 9, 13);
  343. mcn->medium_catalog_number[13] = 0;
  344. kfree(buffer);
  345. return result;
  346. }
  347. int sr_reset(struct cdrom_device_info *cdi)
  348. {
  349. return 0;
  350. }
  351. int sr_select_speed(struct cdrom_device_info *cdi, int speed)
  352. {
  353. Scsi_CD *cd = cdi->handle;
  354. struct packet_command cgc;
  355. if (speed == 0)
  356. speed = 0xffff; /* set to max */
  357. else
  358. speed *= 177; /* Nx to kbyte/s */
  359. memset(&cgc, 0, sizeof(struct packet_command));
  360. cgc.cmd[0] = GPCMD_SET_SPEED; /* SET CD SPEED */
  361. cgc.cmd[2] = (speed >> 8) & 0xff; /* MSB for speed (in kbytes/sec) */
  362. cgc.cmd[3] = speed & 0xff; /* LSB */
  363. cgc.data_direction = DMA_NONE;
  364. cgc.timeout = IOCTL_TIMEOUT;
  365. if (sr_do_ioctl(cd, &cgc))
  366. return -EIO;
  367. return 0;
  368. }
  369. /* ----------------------------------------------------------------------- */
  370. /* this is called by the generic cdrom driver. arg is a _kernel_ pointer, */
  371. /* because the generic cdrom driver does the user access stuff for us. */
  372. /* only cdromreadtochdr and cdromreadtocentry are left - for use with the */
  373. /* sr_disk_status interface for the generic cdrom driver. */
  374. int sr_audio_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, void *arg)
  375. {
  376. switch (cmd) {
  377. case CDROMREADTOCHDR:
  378. return sr_read_tochdr(cdi, arg);
  379. case CDROMREADTOCENTRY:
  380. return sr_read_tocentry(cdi, arg);
  381. case CDROMPLAYTRKIND:
  382. return sr_play_trkind(cdi, arg);
  383. default:
  384. return -EINVAL;
  385. }
  386. }
  387. /* -----------------------------------------------------------------------
  388. * a function to read all sorts of funny cdrom sectors using the READ_CD
  389. * scsi-3 mmc command
  390. *
  391. * lba: linear block address
  392. * format: 0 = data (anything)
  393. * 1 = audio
  394. * 2 = data (mode 1)
  395. * 3 = data (mode 2)
  396. * 4 = data (mode 2 form1)
  397. * 5 = data (mode 2 form2)
  398. * blksize: 2048 | 2336 | 2340 | 2352
  399. */
  400. static int sr_read_cd(Scsi_CD *cd, unsigned char *dest, int lba, int format, int blksize)
  401. {
  402. struct packet_command cgc;
  403. #ifdef DEBUG
  404. sr_printk(KERN_INFO, cd, "sr_read_cd lba=%d format=%d blksize=%d\n",
  405. lba, format, blksize);
  406. #endif
  407. memset(&cgc, 0, sizeof(struct packet_command));
  408. cgc.cmd[0] = GPCMD_READ_CD; /* READ_CD */
  409. cgc.cmd[1] = ((format & 7) << 2);
  410. cgc.cmd[2] = (unsigned char) (lba >> 24) & 0xff;
  411. cgc.cmd[3] = (unsigned char) (lba >> 16) & 0xff;
  412. cgc.cmd[4] = (unsigned char) (lba >> 8) & 0xff;
  413. cgc.cmd[5] = (unsigned char) lba & 0xff;
  414. cgc.cmd[8] = 1;
  415. switch (blksize) {
  416. case 2336:
  417. cgc.cmd[9] = 0x58;
  418. break;
  419. case 2340:
  420. cgc.cmd[9] = 0x78;
  421. break;
  422. case 2352:
  423. cgc.cmd[9] = 0xf8;
  424. break;
  425. default:
  426. cgc.cmd[9] = 0x10;
  427. break;
  428. }
  429. cgc.buffer = dest;
  430. cgc.buflen = blksize;
  431. cgc.data_direction = DMA_FROM_DEVICE;
  432. cgc.timeout = IOCTL_TIMEOUT;
  433. return sr_do_ioctl(cd, &cgc);
  434. }
  435. /*
  436. * read sectors with blocksizes other than 2048
  437. */
  438. static int sr_read_sector(Scsi_CD *cd, int lba, int blksize, unsigned char *dest)
  439. {
  440. struct packet_command cgc;
  441. int rc;
  442. /* we try the READ CD command first... */
  443. if (cd->readcd_known) {
  444. rc = sr_read_cd(cd, dest, lba, 0, blksize);
  445. if (-EDRIVE_CANT_DO_THIS != rc)
  446. return rc;
  447. cd->readcd_known = 0;
  448. sr_printk(KERN_INFO, cd,
  449. "CDROM does'nt support READ CD (0xbe) command\n");
  450. /* fall & retry the other way */
  451. }
  452. /* ... if this fails, we switch the blocksize using MODE SELECT */
  453. if (blksize != cd->device->sector_size) {
  454. if (0 != (rc = sr_set_blocklength(cd, blksize)))
  455. return rc;
  456. }
  457. #ifdef DEBUG
  458. sr_printk(KERN_INFO, cd, "sr_read_sector lba=%d blksize=%d\n",
  459. lba, blksize);
  460. #endif
  461. memset(&cgc, 0, sizeof(struct packet_command));
  462. cgc.cmd[0] = GPCMD_READ_10;
  463. cgc.cmd[2] = (unsigned char) (lba >> 24) & 0xff;
  464. cgc.cmd[3] = (unsigned char) (lba >> 16) & 0xff;
  465. cgc.cmd[4] = (unsigned char) (lba >> 8) & 0xff;
  466. cgc.cmd[5] = (unsigned char) lba & 0xff;
  467. cgc.cmd[8] = 1;
  468. cgc.buffer = dest;
  469. cgc.buflen = blksize;
  470. cgc.data_direction = DMA_FROM_DEVICE;
  471. cgc.timeout = IOCTL_TIMEOUT;
  472. rc = sr_do_ioctl(cd, &cgc);
  473. return rc;
  474. }
  475. /*
  476. * read a sector in raw mode to check the sector format
  477. * ret: 1 == mode2 (XA), 0 == mode1, <0 == error
  478. */
  479. int sr_is_xa(Scsi_CD *cd)
  480. {
  481. unsigned char *raw_sector;
  482. int is_xa;
  483. if (!xa_test)
  484. return 0;
  485. raw_sector = kmalloc(2048, GFP_KERNEL | SR_GFP_DMA(cd));
  486. if (!raw_sector)
  487. return -ENOMEM;
  488. if (0 == sr_read_sector(cd, cd->ms_offset + 16,
  489. CD_FRAMESIZE_RAW1, raw_sector)) {
  490. is_xa = (raw_sector[3] == 0x02) ? 1 : 0;
  491. } else {
  492. /* read a raw sector failed for some reason. */
  493. is_xa = -1;
  494. }
  495. kfree(raw_sector);
  496. #ifdef DEBUG
  497. sr_printk(KERN_INFO, cd, "sr_is_xa: %d\n", is_xa);
  498. #endif
  499. return is_xa;
  500. }