usb/storage: a couple defines from drivers/usb/storage/transport.h to include/linux...
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Sat, 25 Feb 2012 17:28:09 +0000 (18:28 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Feb 2012 19:05:18 +0000 (11:05 -0800)
This moves the BOT data structures for CBW and CSW from drivers internal
header file to global include able file in include/.
The storage gadget is using the same name for CSW but a different for
CBW so I fix it up properly. The same goes for the ub driver and keucr
driver in staging.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/ub.c
drivers/staging/keucr/transport.h
drivers/usb/gadget/f_mass_storage.c
drivers/usb/gadget/file_storage.c
drivers/usb/gadget/storage_common.c
drivers/usb/storage/transport.h
include/linux/usb/storage.h

index 7333b9e444113c9e2945cdcd99997c4fd3592275..298ac75ac8e51bc69c72809ae7c48f0c19c86dc0 100644 (file)
 
 #define UB_SENSE_SIZE  18
 
-/*
- */
-
-/* command block wrapper */
-struct bulk_cb_wrap {
-       __le32  Signature;              /* contains 'USBC' */
-       u32     Tag;                    /* unique per command id */
-       __le32  DataTransferLength;     /* size of data */
-       u8      Flags;                  /* direction in bit 0 */
-       u8      Lun;                    /* LUN */
-       u8      Length;                 /* of of the CDB */
-       u8      CDB[UB_MAX_CDB_SIZE];   /* max command */
-};
-
-#define US_BULK_CB_WRAP_LEN    31
-#define US_BULK_CB_SIGN                0x43425355      /*spells out USBC */
-#define US_BULK_FLAG_IN                1
-#define US_BULK_FLAG_OUT       0
-
-/* command status wrapper */
-struct bulk_cs_wrap {
-       __le32  Signature;              /* should = 'USBS' */
-       u32     Tag;                    /* same as original command */
-       __le32  Residue;                /* amount not transferred */
-       u8      Status;                 /* see below */
-};
-
-#define US_BULK_CS_WRAP_LEN    13
-#define US_BULK_CS_SIGN                0x53425355      /* spells out 'USBS' */
-#define US_BULK_STAT_OK                0
-#define US_BULK_STAT_FAIL      1
-#define US_BULK_STAT_PHASE     2
-
-/* bulk-only class specific requests */
-#define US_BULK_RESET_REQUEST  0xff
-#define US_BULK_GET_MAX_LUN    0xfe
-
 /*
  */
 struct ub_dev;
index 4ae57d0145b28d967db280a860730514ddbb30ac..2a11a98375d7ca879f6b0936eac3ddefee8f9483 100644 (file)
@@ -3,43 +3,6 @@
 
 #include <linux/blkdev.h>
 
-/* Bulk only data structures */
-
-/* command block wrapper */
-struct bulk_cb_wrap {
-       __le32  Signature;                      /* contains 'USBC' */
-       __u32   Tag;                            /* unique per command id */
-       __le32  DataTransferLength;     /* size of data */
-       __u8    Flags;                          /* direction in bit 0 */
-       __u8    Lun;                                    /* LUN normally 0 */
-       __u8    Length;                         /* of of the CDB */
-       __u8    CDB[16];                                /* max command */
-};
-
-#define US_BULK_CB_WRAP_LEN    31
-#define US_BULK_CB_SIGN                0x43425355      /*spells out USBC */
-#define US_BULK_FLAG_IN                1
-#define US_BULK_FLAG_OUT       0
-
-/* command status wrapper */
-struct bulk_cs_wrap {
-       __le32  Signature;              /* should = 'USBS' */
-       __u32           Tag;                    /* same as original command */
-       __le32  Residue;                /* amount not transferred */
-       __u8            Status;         /* see below */
-       __u8            Filler[18];
-};
-
-#define US_BULK_CS_WRAP_LEN    13
-#define US_BULK_CS_SIGN                0x53425355      /* spells out 'USBS' */
-#define US_BULK_STAT_OK                0
-#define US_BULK_STAT_FAIL      1
-#define US_BULK_STAT_PHASE     2
-
-/* bulk-only class specific requests */
-#define US_BULK_RESET_REQUEST  0xff
-#define US_BULK_GET_MAX_LUN    0xfe
-
 /* usb_stor_bulk_transfer_xxx() return codes, in order of severity */
 #define USB_STOR_XFER_GOOD     0       /* good transfer                 */
 #define USB_STOR_XFER_SHORT    1       /* transferred less than expected */
index ee8ceec01560e5391a4f115c130002bd98917e41..9e71fe7fc5029105a13a724f4000f5b62a2b22fb 100644 (file)
@@ -2221,7 +2221,7 @@ unknown_cmnd:
 static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh)
 {
        struct usb_request      *req = bh->outreq;
-       struct fsg_bulk_cb_wrap *cbw = req->buf;
+       struct bulk_cb_wrap     *cbw = req->buf;
        struct fsg_common       *common = fsg->common;
 
        /* Was this a real packet?  Should it be ignored? */
index 47766f0e7caa320796f7894d8144a3933ff1393f..15e6e8e55ef61f4cc4fa019b404e7afa6c9ca742 100644 (file)
@@ -2609,7 +2609,7 @@ static int do_scsi_command(struct fsg_dev *fsg)
 static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh)
 {
        struct usb_request              *req = bh->outreq;
-       struct fsg_bulk_cb_wrap *cbw = req->buf;
+       struct bulk_cb_wrap     *cbw = req->buf;
 
        /* Was this a real packet?  Should it be ignored? */
        if (req->status || test_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags))
index 85ea14e2545e8fa29d777ddbd945ed8df8476807..4095696b15827af6f880462b488b36a18a575774 100644 (file)
 
 /* Bulk-only data structures */
 
-/* Command Block Wrapper */
-struct fsg_bulk_cb_wrap {
-       __le32  Signature;              /* Contains 'USBC' */
-       u32     Tag;                    /* Unique per command id */
-       __le32  DataTransferLength;     /* Size of the data */
-       u8      Flags;                  /* Direction in bit 7 */
-       u8      Lun;                    /* LUN (normally 0) */
-       u8      Length;                 /* Of the CDB, <= MAX_COMMAND_SIZE */
-       u8      CDB[16];                /* Command Data Block */
-};
-
 #define USB_BULK_CB_WRAP_LEN   31
 #define USB_BULK_CB_SIG                0x43425355      /* Spells out USBC */
 #define USB_BULK_IN_FLAG       0x80
 
-/* Command Status Wrapper */
-struct bulk_cs_wrap {
-       __le32  Signature;              /* Should = 'USBS' */
-       u32     Tag;                    /* Same as original command */
-       __le32  Residue;                /* Amount not transferred */
-       u8      Status;                 /* See below */
-};
-
 #define USB_BULK_CS_WRAP_LEN   13
 #define USB_BULK_CS_SIG                0x53425355      /* Spells out 'USBS' */
 #define USB_STATUS_PASS                0
index 242ff5e791a532ecc96d4ceaf180e3d60130f8c1..9369d752d4194682b1a52532f2107c84a5979bca 100644 (file)
 
 #include <linux/blkdev.h>
 
-/*
- * Bulk only data structures
- */
-
-/* command block wrapper */
-struct bulk_cb_wrap {
-       __le32  Signature;              /* contains 'USBC' */
-       __u32   Tag;                    /* unique per command id */
-       __le32  DataTransferLength;     /* size of data */
-       __u8    Flags;                  /* direction in bit 0 */
-       __u8    Lun;                    /* LUN normally 0 */
-       __u8    Length;                 /* of of the CDB */
-       __u8    CDB[16];                /* max command */
-};
-
-#define US_BULK_CB_WRAP_LEN    31
-#define US_BULK_CB_SIGN                0x43425355      /*spells out USBC */
-#define US_BULK_FLAG_IN                1
-#define US_BULK_FLAG_OUT       0
-
-/* command status wrapper */
-struct bulk_cs_wrap {
-       __le32  Signature;              /* should = 'USBS' */
-       __u32   Tag;                    /* same as original command */
-       __le32  Residue;                /* amount not transferred */
-       __u8    Status;                 /* see below */
-       __u8    Filler[18];
-};
-
-#define US_BULK_CS_WRAP_LEN    13
-#define US_BULK_CS_SIGN                0x53425355      /* spells out 'USBS' */
-#define US_BULK_STAT_OK                0
-#define US_BULK_STAT_FAIL      1
-#define US_BULK_STAT_PHASE     2
-
-/* bulk-only class specific requests */
-#define US_BULK_RESET_REQUEST  0xff
-#define US_BULK_GET_MAX_LUN    0xfe
-
 /*
  * usb_stor_bulk_transfer_xxx() return codes, in order of severity
  */
index d7fc910f1dc4317fe79fb1cd8c434b7e3d33b3ee..87a94bf34d4764913515a2db06f720c074197212 100644 (file)
 
 #define USB_PR_DEVICE  0xff            /* Use device's value */
 
+ /*
+  * Bulk only data structures
+  */
+
+/* command block wrapper */
+struct bulk_cb_wrap {
+       __le32  Signature;              /* contains 'USBC' */
+       __u32   Tag;                    /* unique per command id */
+       __le32  DataTransferLength;     /* size of data */
+       __u8    Flags;                  /* direction in bit 0 */
+       __u8    Lun;                    /* LUN normally 0 */
+       __u8    Length;                 /* of of the CDB */
+       __u8    CDB[16];                /* max command */
+};
+
+#define US_BULK_CB_WRAP_LEN    31
+#define US_BULK_CB_SIGN                0x43425355      /*spells out USBC */
+#define US_BULK_FLAG_IN                1
+#define US_BULK_FLAG_OUT       0
+
+/* command status wrapper */
+struct bulk_cs_wrap {
+       __le32  Signature;      /* should = 'USBS' */
+       __u32   Tag;            /* same as original command */
+       __le32  Residue;        /* amount not transferred */
+       __u8    Status;         /* see below */
+       __u8    Filler[18];
+};
+
+#define US_BULK_CS_WRAP_LEN    13
+#define US_BULK_CS_SIGN                0x53425355      /* spells out 'USBS' */
+#define US_BULK_STAT_OK                0
+#define US_BULK_STAT_FAIL      1
+#define US_BULK_STAT_PHASE     2
+
+/* bulk-only class specific requests */
+#define US_BULK_RESET_REQUEST   0xff
+#define US_BULK_GET_MAX_LUN     0xfe
+
 #endif