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 7333b9e..298ac75 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 4ae57d0..2a11a98 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 ee8ceec..9e71fe7 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 47766f0..15e6e8e 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 85ea14e..4095696 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 242ff5e..9369d75 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 d7fc910..87a94bf 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