scsiglue.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. /* Driver for USB Mass Storage compliant devices
  2. * SCSI layer glue code
  3. *
  4. * Current development and maintenance by:
  5. * (c) 1999-2002 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
  6. *
  7. * Developed with the assistance of:
  8. * (c) 2000 David L. Brown, Jr. (usb-storage@davidb.org)
  9. * (c) 2000 Stephen J. Gowdy (SGowdy@lbl.gov)
  10. *
  11. * Initial work by:
  12. * (c) 1999 Michael Gee (michael@linuxspecific.com)
  13. *
  14. * This driver is based on the 'USB Mass Storage Class' document. This
  15. * describes in detail the protocol used to communicate with such
  16. * devices. Clearly, the designers had SCSI and ATAPI commands in
  17. * mind when they created this document. The commands are all very
  18. * similar to commands in the SCSI-II and ATAPI specifications.
  19. *
  20. * It is important to note that in a number of cases this class
  21. * exhibits class-specific exemptions from the USB specification.
  22. * Notably the usage of NAK, STALL and ACK differs from the norm, in
  23. * that they are used to communicate wait, failed and OK on commands.
  24. *
  25. * Also, for certain devices, the interrupt endpoint is used to convey
  26. * status of a command.
  27. *
  28. * Please see http://www.one-eyed-alien.net/~mdharm/linux-usb for more
  29. * information about this driver.
  30. *
  31. * This program is free software; you can redistribute it and/or modify it
  32. * under the terms of the GNU General Public License as published by the
  33. * Free Software Foundation; either version 2, or (at your option) any
  34. * later version.
  35. *
  36. * This program is distributed in the hope that it will be useful, but
  37. * WITHOUT ANY WARRANTY; without even the implied warranty of
  38. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  39. * General Public License for more details.
  40. *
  41. * You should have received a copy of the GNU General Public License along
  42. * with this program; if not, write to the Free Software Foundation, Inc.,
  43. * 675 Mass Ave, Cambridge, MA 02139, USA.
  44. */
  45. #include <linux/module.h>
  46. #include <linux/mutex.h>
  47. #include <scsi/scsi.h>
  48. #include <scsi/scsi_cmnd.h>
  49. #include <scsi/scsi_devinfo.h>
  50. #include <scsi/scsi_device.h>
  51. #include <scsi/scsi_eh.h>
  52. #include "usb.h"
  53. #include "scsiglue.h"
  54. #include "debug.h"
  55. #include "transport.h"
  56. #include "protocol.h"
  57. /* Vendor IDs for companies that seem to include the READ CAPACITY bug
  58. * in all their devices
  59. */
  60. #define VENDOR_ID_NOKIA 0x0421
  61. #define VENDOR_ID_NIKON 0x04b0
  62. #define VENDOR_ID_PENTAX 0x0a17
  63. #define VENDOR_ID_MOTOROLA 0x22b8
  64. /***********************************************************************
  65. * Host functions
  66. ***********************************************************************/
  67. static const char* host_info(struct Scsi_Host *host)
  68. {
  69. struct us_data *us = host_to_us(host);
  70. return us->scsi_name;
  71. }
  72. static int slave_alloc (struct scsi_device *sdev)
  73. {
  74. /*
  75. * Set the INQUIRY transfer length to 36. We don't use any of
  76. * the extra data and many devices choke if asked for more or
  77. * less than 36 bytes.
  78. */
  79. sdev->inquiry_len = 36;
  80. /* USB has unusual DMA-alignment requirements: Although the
  81. * starting address of each scatter-gather element doesn't matter,
  82. * the length of each element except the last must be divisible
  83. * by the Bulk maxpacket value. There's currently no way to
  84. * express this by block-layer constraints, so we'll cop out
  85. * and simply require addresses to be aligned at 512-byte
  86. * boundaries. This is okay since most block I/O involves
  87. * hardware sectors that are multiples of 512 bytes in length,
  88. * and since host controllers up through USB 2.0 have maxpacket
  89. * values no larger than 512.
  90. *
  91. * But it doesn't suffice for Wireless USB, where Bulk maxpacket
  92. * values can be as large as 2048. To make that work properly
  93. * will require changes to the block layer.
  94. */
  95. blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1));
  96. return 0;
  97. }
  98. static int slave_configure(struct scsi_device *sdev)
  99. {
  100. struct us_data *us = host_to_us(sdev->host);
  101. /* Many devices have trouble transferring more than 32KB at a time,
  102. * while others have trouble with more than 64K. At this time we
  103. * are limiting both to 32K (64 sectores).
  104. */
  105. if (us->fflags & (US_FL_MAX_SECTORS_64 | US_FL_MAX_SECTORS_MIN)) {
  106. unsigned int max_sectors = 64;
  107. if (us->fflags & US_FL_MAX_SECTORS_MIN)
  108. max_sectors = PAGE_CACHE_SIZE >> 9;
  109. if (queue_max_hw_sectors(sdev->request_queue) > max_sectors)
  110. blk_queue_max_hw_sectors(sdev->request_queue,
  111. max_sectors);
  112. } else if (sdev->type == TYPE_TAPE) {
  113. /* Tapes need much higher max_sector limits, so just
  114. * raise it to the maximum possible (4 GB / 512) and
  115. * let the queue segment size sort out the real limit.
  116. */
  117. blk_queue_max_hw_sectors(sdev->request_queue, 0x7FFFFF);
  118. }
  119. /* Some USB host controllers can't do DMA; they have to use PIO.
  120. * They indicate this by setting their dma_mask to NULL. For
  121. * such controllers we need to make sure the block layer sets
  122. * up bounce buffers in addressable memory.
  123. */
  124. if (!us->pusb_dev->bus->controller->dma_mask)
  125. blk_queue_bounce_limit(sdev->request_queue, BLK_BOUNCE_HIGH);
  126. /* We can't put these settings in slave_alloc() because that gets
  127. * called before the device type is known. Consequently these
  128. * settings can't be overridden via the scsi devinfo mechanism. */
  129. if (sdev->type == TYPE_DISK) {
  130. /* Some vendors seem to put the READ CAPACITY bug into
  131. * all their devices -- primarily makers of cell phones
  132. * and digital cameras. Since these devices always use
  133. * flash media and can be expected to have an even number
  134. * of sectors, we will always enable the CAPACITY_HEURISTICS
  135. * flag unless told otherwise. */
  136. switch (le16_to_cpu(us->pusb_dev->descriptor.idVendor)) {
  137. case VENDOR_ID_NOKIA:
  138. case VENDOR_ID_NIKON:
  139. case VENDOR_ID_PENTAX:
  140. case VENDOR_ID_MOTOROLA:
  141. if (!(us->fflags & (US_FL_FIX_CAPACITY |
  142. US_FL_CAPACITY_OK)))
  143. us->fflags |= US_FL_CAPACITY_HEURISTICS;
  144. break;
  145. }
  146. /* Disk-type devices use MODE SENSE(6) if the protocol
  147. * (SubClass) is Transparent SCSI, otherwise they use
  148. * MODE SENSE(10). */
  149. if (us->subclass != USB_SC_SCSI && us->subclass != USB_SC_CYP_ATACB)
  150. sdev->use_10_for_ms = 1;
  151. /* Many disks only accept MODE SENSE transfer lengths of
  152. * 192 bytes (that's what Windows uses). */
  153. sdev->use_192_bytes_for_3f = 1;
  154. /* Some devices don't like MODE SENSE with page=0x3f,
  155. * which is the command used for checking if a device
  156. * is write-protected. Now that we tell the sd driver
  157. * to do a 192-byte transfer with this command the
  158. * majority of devices work fine, but a few still can't
  159. * handle it. The sd driver will simply assume those
  160. * devices are write-enabled. */
  161. if (us->fflags & US_FL_NO_WP_DETECT)
  162. sdev->skip_ms_page_3f = 1;
  163. /* A number of devices have problems with MODE SENSE for
  164. * page x08, so we will skip it. */
  165. sdev->skip_ms_page_8 = 1;
  166. /* Some devices don't handle VPD pages correctly */
  167. sdev->skip_vpd_pages = 1;
  168. /* Do not attempt to use REPORT SUPPORTED OPERATION CODES */
  169. sdev->no_report_opcodes = 1;
  170. /* Do not attempt to use WRITE SAME */
  171. sdev->no_write_same = 1;
  172. /* Some disks return the total number of blocks in response
  173. * to READ CAPACITY rather than the highest block number.
  174. * If this device makes that mistake, tell the sd driver. */
  175. if (us->fflags & US_FL_FIX_CAPACITY)
  176. sdev->fix_capacity = 1;
  177. /* A few disks have two indistinguishable version, one of
  178. * which reports the correct capacity and the other does not.
  179. * The sd driver has to guess which is the case. */
  180. if (us->fflags & US_FL_CAPACITY_HEURISTICS)
  181. sdev->guess_capacity = 1;
  182. /* Some devices cannot handle READ_CAPACITY_16 */
  183. if (us->fflags & US_FL_NO_READ_CAPACITY_16)
  184. sdev->no_read_capacity_16 = 1;
  185. /*
  186. * Many devices do not respond properly to READ_CAPACITY_16.
  187. * Tell the SCSI layer to try READ_CAPACITY_10 first.
  188. */
  189. sdev->try_rc_10_first = 1;
  190. /* assume SPC3 or latter devices support sense size > 18 */
  191. if (sdev->scsi_level > SCSI_SPC_2)
  192. us->fflags |= US_FL_SANE_SENSE;
  193. /* USB-IDE bridges tend to report SK = 0x04 (Non-recoverable
  194. * Hardware Error) when any low-level error occurs,
  195. * recoverable or not. Setting this flag tells the SCSI
  196. * midlayer to retry such commands, which frequently will
  197. * succeed and fix the error. The worst this can lead to
  198. * is an occasional series of retries that will all fail. */
  199. sdev->retry_hwerror = 1;
  200. /* USB disks should allow restart. Some drives spin down
  201. * automatically, requiring a START-STOP UNIT command. */
  202. sdev->allow_restart = 1;
  203. /* Some USB cardreaders have trouble reading an sdcard's last
  204. * sector in a larger then 1 sector read, since the performance
  205. * impact is negible we set this flag for all USB disks */
  206. sdev->last_sector_bug = 1;
  207. /* Enable last-sector hacks for single-target devices using
  208. * the Bulk-only transport, unless we already know the
  209. * capacity will be decremented or is correct. */
  210. if (!(us->fflags & (US_FL_FIX_CAPACITY | US_FL_CAPACITY_OK |
  211. US_FL_SCM_MULT_TARG)) &&
  212. us->protocol == USB_PR_BULK)
  213. us->use_last_sector_hacks = 1;
  214. /* Check if write cache default on flag is set or not */
  215. if (us->fflags & US_FL_WRITE_CACHE)
  216. sdev->wce_default_on = 1;
  217. } else {
  218. /* Non-disk-type devices don't need to blacklist any pages
  219. * or to force 192-byte transfer lengths for MODE SENSE.
  220. * But they do need to use MODE SENSE(10). */
  221. sdev->use_10_for_ms = 1;
  222. /* Some (fake) usb cdrom devices don't like READ_DISC_INFO */
  223. if (us->fflags & US_FL_NO_READ_DISC_INFO)
  224. sdev->no_read_disc_info = 1;
  225. }
  226. /* The CB and CBI transports have no way to pass LUN values
  227. * other than the bits in the second byte of a CDB. But those
  228. * bits don't get set to the LUN value if the device reports
  229. * scsi_level == 0 (UNKNOWN). Hence such devices must necessarily
  230. * be single-LUN.
  231. */
  232. if ((us->protocol == USB_PR_CB || us->protocol == USB_PR_CBI) &&
  233. sdev->scsi_level == SCSI_UNKNOWN)
  234. us->max_lun = 0;
  235. /* Some devices choke when they receive a PREVENT-ALLOW MEDIUM
  236. * REMOVAL command, so suppress those commands. */
  237. if (us->fflags & US_FL_NOT_LOCKABLE)
  238. sdev->lockable = 0;
  239. /* this is to satisfy the compiler, tho I don't think the
  240. * return code is ever checked anywhere. */
  241. return 0;
  242. }
  243. static int target_alloc(struct scsi_target *starget)
  244. {
  245. struct us_data *us = host_to_us(dev_to_shost(starget->dev.parent));
  246. /*
  247. * Some USB drives don't support REPORT LUNS, even though they
  248. * report a SCSI revision level above 2. Tell the SCSI layer
  249. * not to issue that command; it will perform a normal sequential
  250. * scan instead.
  251. */
  252. starget->no_report_luns = 1;
  253. /*
  254. * The UFI spec treats the Peripheral Qualifier bits in an
  255. * INQUIRY result as reserved and requires devices to set them
  256. * to 0. However the SCSI spec requires these bits to be set
  257. * to 3 to indicate when a LUN is not present.
  258. *
  259. * Let the scanning code know if this target merely sets
  260. * Peripheral Device Type to 0x1f to indicate no LUN.
  261. */
  262. if (us->subclass == USB_SC_UFI)
  263. starget->pdt_1f_for_no_lun = 1;
  264. return 0;
  265. }
  266. /* queue a command */
  267. /* This is always called with scsi_lock(host) held */
  268. static int queuecommand_lck(struct scsi_cmnd *srb,
  269. void (*done)(struct scsi_cmnd *))
  270. {
  271. struct us_data *us = host_to_us(srb->device->host);
  272. US_DEBUGP("%s called\n", __func__);
  273. /* check for state-transition errors */
  274. if (us->srb != NULL) {
  275. printk(KERN_ERR USB_STORAGE "Error in %s: us->srb = %p\n",
  276. __func__, us->srb);
  277. return SCSI_MLQUEUE_HOST_BUSY;
  278. }
  279. /* fail the command if we are disconnecting */
  280. if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags)) {
  281. US_DEBUGP("Fail command during disconnect\n");
  282. srb->result = DID_NO_CONNECT << 16;
  283. done(srb);
  284. return 0;
  285. }
  286. /* enqueue the command and wake up the control thread */
  287. srb->scsi_done = done;
  288. us->srb = srb;
  289. complete(&us->cmnd_ready);
  290. return 0;
  291. }
  292. static DEF_SCSI_QCMD(queuecommand)
  293. /***********************************************************************
  294. * Error handling functions
  295. ***********************************************************************/
  296. /* Command timeout and abort */
  297. static int command_abort(struct scsi_cmnd *srb)
  298. {
  299. struct us_data *us = host_to_us(srb->device->host);
  300. US_DEBUGP("%s called\n", __func__);
  301. /* us->srb together with the TIMED_OUT, RESETTING, and ABORTING
  302. * bits are protected by the host lock. */
  303. scsi_lock(us_to_host(us));
  304. /* Is this command still active? */
  305. if (us->srb != srb) {
  306. scsi_unlock(us_to_host(us));
  307. US_DEBUGP ("-- nothing to abort\n");
  308. return FAILED;
  309. }
  310. /* Set the TIMED_OUT bit. Also set the ABORTING bit, but only if
  311. * a device reset isn't already in progress (to avoid interfering
  312. * with the reset). Note that we must retain the host lock while
  313. * calling usb_stor_stop_transport(); otherwise it might interfere
  314. * with an auto-reset that begins as soon as we release the lock. */
  315. set_bit(US_FLIDX_TIMED_OUT, &us->dflags);
  316. if (!test_bit(US_FLIDX_RESETTING, &us->dflags)) {
  317. set_bit(US_FLIDX_ABORTING, &us->dflags);
  318. usb_stor_stop_transport(us);
  319. }
  320. scsi_unlock(us_to_host(us));
  321. /* Wait for the aborted command to finish */
  322. wait_for_completion(&us->notify);
  323. return SUCCESS;
  324. }
  325. /* This invokes the transport reset mechanism to reset the state of the
  326. * device */
  327. static int device_reset(struct scsi_cmnd *srb)
  328. {
  329. struct us_data *us = host_to_us(srb->device->host);
  330. int result;
  331. US_DEBUGP("%s called\n", __func__);
  332. /* lock the device pointers and do the reset */
  333. mutex_lock(&(us->dev_mutex));
  334. result = us->transport_reset(us);
  335. mutex_unlock(&us->dev_mutex);
  336. return result < 0 ? FAILED : SUCCESS;
  337. }
  338. /* Simulate a SCSI bus reset by resetting the device's USB port. */
  339. static int bus_reset(struct scsi_cmnd *srb)
  340. {
  341. struct us_data *us = host_to_us(srb->device->host);
  342. int result;
  343. US_DEBUGP("%s called\n", __func__);
  344. result = usb_stor_port_reset(us);
  345. return result < 0 ? FAILED : SUCCESS;
  346. }
  347. /* Report a driver-initiated device reset to the SCSI layer.
  348. * Calling this for a SCSI-initiated reset is unnecessary but harmless.
  349. * The caller must own the SCSI host lock. */
  350. void usb_stor_report_device_reset(struct us_data *us)
  351. {
  352. int i;
  353. struct Scsi_Host *host = us_to_host(us);
  354. scsi_report_device_reset(host, 0, 0);
  355. if (us->fflags & US_FL_SCM_MULT_TARG) {
  356. for (i = 1; i < host->max_id; ++i)
  357. scsi_report_device_reset(host, 0, i);
  358. }
  359. }
  360. /* Report a driver-initiated bus reset to the SCSI layer.
  361. * Calling this for a SCSI-initiated reset is unnecessary but harmless.
  362. * The caller must not own the SCSI host lock. */
  363. void usb_stor_report_bus_reset(struct us_data *us)
  364. {
  365. struct Scsi_Host *host = us_to_host(us);
  366. scsi_lock(host);
  367. scsi_report_bus_reset(host, 0);
  368. scsi_unlock(host);
  369. }
  370. /***********************************************************************
  371. * /proc/scsi/ functions
  372. ***********************************************************************/
  373. /* we use this macro to help us write into the buffer */
  374. #undef SPRINTF
  375. #define SPRINTF(args...) \
  376. do { if (pos < buffer+length) pos += sprintf(pos, ## args); } while (0)
  377. static int proc_info (struct Scsi_Host *host, char *buffer,
  378. char **start, off_t offset, int length, int inout)
  379. {
  380. struct us_data *us = host_to_us(host);
  381. char *pos = buffer;
  382. const char *string;
  383. /* if someone is sending us data, just throw it away */
  384. if (inout)
  385. return length;
  386. /* print the controller name */
  387. SPRINTF(" Host scsi%d: usb-storage\n", host->host_no);
  388. /* print product, vendor, and serial number strings */
  389. if (us->pusb_dev->manufacturer)
  390. string = us->pusb_dev->manufacturer;
  391. else if (us->unusual_dev->vendorName)
  392. string = us->unusual_dev->vendorName;
  393. else
  394. string = "Unknown";
  395. SPRINTF(" Vendor: %s\n", string);
  396. if (us->pusb_dev->product)
  397. string = us->pusb_dev->product;
  398. else if (us->unusual_dev->productName)
  399. string = us->unusual_dev->productName;
  400. else
  401. string = "Unknown";
  402. SPRINTF(" Product: %s\n", string);
  403. if (us->pusb_dev->serial)
  404. string = us->pusb_dev->serial;
  405. else
  406. string = "None";
  407. SPRINTF("Serial Number: %s\n", string);
  408. /* show the protocol and transport */
  409. SPRINTF(" Protocol: %s\n", us->protocol_name);
  410. SPRINTF(" Transport: %s\n", us->transport_name);
  411. /* show the device flags */
  412. if (pos < buffer + length) {
  413. pos += sprintf(pos, " Quirks:");
  414. #define US_FLAG(name, value) \
  415. if (us->fflags & value) pos += sprintf(pos, " " #name);
  416. US_DO_ALL_FLAGS
  417. #undef US_FLAG
  418. *(pos++) = '\n';
  419. }
  420. /*
  421. * Calculate start of next buffer, and return value.
  422. */
  423. *start = buffer + offset;
  424. if ((pos - buffer) < offset)
  425. return (0);
  426. else if ((pos - buffer - offset) < length)
  427. return (pos - buffer - offset);
  428. else
  429. return (length);
  430. }
  431. /***********************************************************************
  432. * Sysfs interface
  433. ***********************************************************************/
  434. /* Output routine for the sysfs max_sectors file */
  435. static ssize_t show_max_sectors(struct device *dev, struct device_attribute *attr, char *buf)
  436. {
  437. struct scsi_device *sdev = to_scsi_device(dev);
  438. return sprintf(buf, "%u\n", queue_max_hw_sectors(sdev->request_queue));
  439. }
  440. /* Input routine for the sysfs max_sectors file */
  441. static ssize_t store_max_sectors(struct device *dev, struct device_attribute *attr, const char *buf,
  442. size_t count)
  443. {
  444. struct scsi_device *sdev = to_scsi_device(dev);
  445. unsigned short ms;
  446. if (sscanf(buf, "%hu", &ms) > 0) {
  447. blk_queue_max_hw_sectors(sdev->request_queue, ms);
  448. return count;
  449. }
  450. return -EINVAL;
  451. }
  452. static DEVICE_ATTR(max_sectors, S_IRUGO | S_IWUSR, show_max_sectors,
  453. store_max_sectors);
  454. static struct device_attribute *sysfs_device_attr_list[] = {
  455. &dev_attr_max_sectors,
  456. NULL,
  457. };
  458. /*
  459. * this defines our host template, with which we'll allocate hosts
  460. */
  461. struct scsi_host_template usb_stor_host_template = {
  462. /* basic userland interface stuff */
  463. .name = "usb-storage",
  464. .proc_name = "usb-storage",
  465. .proc_info = proc_info,
  466. .info = host_info,
  467. /* command interface -- queued only */
  468. .queuecommand = queuecommand,
  469. /* error and abort handlers */
  470. .eh_abort_handler = command_abort,
  471. .eh_device_reset_handler = device_reset,
  472. .eh_bus_reset_handler = bus_reset,
  473. /* queue commands only, only one command per LUN */
  474. .can_queue = 1,
  475. .cmd_per_lun = 1,
  476. /* unknown initiator id */
  477. .this_id = -1,
  478. .slave_alloc = slave_alloc,
  479. .slave_configure = slave_configure,
  480. .target_alloc = target_alloc,
  481. /* lots of sg segments can be handled */
  482. .sg_tablesize = SCSI_MAX_SG_CHAIN_SEGMENTS,
  483. /* limit the total size of a transfer to 120 KB */
  484. .max_sectors = 240,
  485. /* merge commands... this seems to help performance, but
  486. * periodically someone should test to see which setting is more
  487. * optimal.
  488. */
  489. .use_clustering = 1,
  490. /* emulated HBA */
  491. .emulated = 1,
  492. /* we do our own delay after a device or bus reset */
  493. .skip_settle_delay = 1,
  494. /* sysfs device attributes */
  495. .sdev_attrs = sysfs_device_attr_list,
  496. /* module management */
  497. .module = THIS_MODULE
  498. };
  499. /* To Report "Illegal Request: Invalid Field in CDB */
  500. unsigned char usb_stor_sense_invalidCDB[18] = {
  501. [0] = 0x70, /* current error */
  502. [2] = ILLEGAL_REQUEST, /* Illegal Request = 0x05 */
  503. [7] = 0x0a, /* additional length */
  504. [12] = 0x24 /* Invalid Field in CDB */
  505. };
  506. EXPORT_SYMBOL_GPL(usb_stor_sense_invalidCDB);