Pass all ATAPI commands through. Fixes detecting capabilities of DVD
authorHasso Tepper <hasso@dragonflybsd.org>
Wed, 2 Jan 2008 10:31:53 +0000 (10:31 +0000)
committerHasso Tepper <hasso@dragonflybsd.org>
Wed, 2 Jan 2008 10:31:53 +0000 (10:31 +0000)
writers.

Obtained-from: FreeBSD with modifications.

sys/dev/usbmisc/umass/umass.c

index 3ca357b..7e2be47 100644 (file)
@@ -26,7 +26,7 @@
  *
  * $NetBSD: umass.c,v 1.28 2000/04/02 23:46:53 augustss Exp $
  * $FreeBSD: src/sys/dev/usb/umass.c,v 1.96 2003/12/19 12:19:11 sanpei Exp $
- * $DragonFly: src/sys/dev/usbmisc/umass/umass.c,v 1.31 2007/12/23 07:00:57 pavalos Exp $
+ * $DragonFly: src/sys/dev/usbmisc/umass/umass.c,v 1.32 2008/01/02 10:31:53 hasso Exp $
  */
 
 /*
@@ -2991,48 +2991,13 @@ umass_atapi_transform(struct umass_softc *sc, unsigned char *cmd, int cmdlen,
                        return 1;
                }
                /* fallthrough */
-       case REZERO_UNIT:
-       case REQUEST_SENSE:
-       case START_STOP_UNIT:
-       case SEND_DIAGNOSTIC:
-       case PREVENT_ALLOW:
-       case READ_CAPACITY:
-       case READ_10:
-       case WRITE_10:
-       case POSITION_TO_ELEMENT:       /* SEEK_10 */
-       case SYNCHRONIZE_CACHE:
-       case MODE_SELECT_10:
-       case MODE_SENSE_10:
-       case READ_BUFFER:
-       case READ_SUBCHANNEL:
-       case READ_TOC:
-       case READ_HEADER:
-       case PLAY_MSF:
-       case PLAY_TRACK:
-       case PLAY_TRACK_REL:
-       case PAUSE:
-       case ATAPI_READ_DISK_INFO:
-       case ATAPI_READ_TRACK_INFO:
-       case ATAPI_SEND_OPC_INFO:
-       case ATAPI_READ_MASTER_CUE:
-       case ATAPI_CLOSE_TRACK:
-       case ATAPI_READ_BUFFER_CAPACITY:
-       case ATAPI_SEND_CUE_SHEET:
-       case ATAPI_BLANK:
-       case PLAY_12:
-       case EXCHANGE_MEDIUM:
-       case READ_DVD_STRUCTURE:
-       case SET_CD_SPEED:
-       case 0xe5: /* READ_TRACK_INFO_PHILIPS */
+       default:
+               /*
+                * All commands are passed through, very likely it will just work
+                * regardless whether we know these commands or not.
+                */
                memcpy(*rcmd, cmd, cmdlen);
                return 1;
-
-       case READ_12:
-       case WRITE_12:
-       default:
-               kprintf("%s: Unsupported ATAPI command 0x%02x\n",
-                       device_get_nameunit(sc->sc_dev), cmd[0]);
-               return 0;       /* failure */
        }
 }