diff options
-rw-r--r-- | drivers/block/ub.c | 37 | ||||
-rw-r--r-- | drivers/staging/keucr/transport.h | 37 | ||||
-rw-r--r-- | drivers/usb/gadget/f_mass_storage.c | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/file_storage.c | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/storage_common.c | 19 | ||||
-rw-r--r-- | drivers/usb/storage/transport.h | 39 | ||||
-rw-r--r-- | include/linux/usb/storage.h | 39 |
7 files changed, 41 insertions, 134 deletions
diff --git a/drivers/block/ub.c b/drivers/block/ub.c index 7333b9e44411..298ac75ac8e5 100644 --- a/drivers/block/ub.c +++ b/drivers/block/ub.c | |||
@@ -119,43 +119,6 @@ | |||
119 | 119 | ||
120 | /* | 120 | /* |
121 | */ | 121 | */ |
122 | |||
123 | /* command block wrapper */ | ||
124 | struct bulk_cb_wrap { | ||
125 | __le32 Signature; /* contains 'USBC' */ | ||
126 | u32 Tag; /* unique per command id */ | ||
127 | __le32 DataTransferLength; /* size of data */ | ||
128 | u8 Flags; /* direction in bit 0 */ | ||
129 | u8 Lun; /* LUN */ | ||
130 | u8 Length; /* of of the CDB */ | ||
131 | u8 CDB[UB_MAX_CDB_SIZE]; /* max command */ | ||
132 | }; | ||
133 | |||
134 | #define US_BULK_CB_WRAP_LEN 31 | ||
135 | #define US_BULK_CB_SIGN 0x43425355 /*spells out USBC */ | ||
136 | #define US_BULK_FLAG_IN 1 | ||
137 | #define US_BULK_FLAG_OUT 0 | ||
138 | |||
139 | /* command status wrapper */ | ||
140 | struct bulk_cs_wrap { | ||
141 | __le32 Signature; /* should = 'USBS' */ | ||
142 | u32 Tag; /* same as original command */ | ||
143 | __le32 Residue; /* amount not transferred */ | ||
144 | u8 Status; /* see below */ | ||
145 | }; | ||
146 | |||
147 | #define US_BULK_CS_WRAP_LEN 13 | ||
148 | #define US_BULK_CS_SIGN 0x53425355 /* spells out 'USBS' */ | ||
149 | #define US_BULK_STAT_OK 0 | ||
150 | #define US_BULK_STAT_FAIL 1 | ||
151 | #define US_BULK_STAT_PHASE 2 | ||
152 | |||
153 | /* bulk-only class specific requests */ | ||
154 | #define US_BULK_RESET_REQUEST 0xff | ||
155 | #define US_BULK_GET_MAX_LUN 0xfe | ||
156 | |||
157 | /* | ||
158 | */ | ||
159 | struct ub_dev; | 122 | struct ub_dev; |
160 | 123 | ||
161 | #define UB_MAX_REQ_SG 9 /* cdrecord requires 32KB and maybe a header */ | 124 | #define UB_MAX_REQ_SG 9 /* cdrecord requires 32KB and maybe a header */ |
diff --git a/drivers/staging/keucr/transport.h b/drivers/staging/keucr/transport.h index 4ae57d0145b2..2a11a98375d7 100644 --- a/drivers/staging/keucr/transport.h +++ b/drivers/staging/keucr/transport.h | |||
@@ -3,43 +3,6 @@ | |||
3 | 3 | ||
4 | #include <linux/blkdev.h> | 4 | #include <linux/blkdev.h> |
5 | 5 | ||
6 | /* Bulk only data structures */ | ||
7 | |||
8 | /* command block wrapper */ | ||
9 | struct bulk_cb_wrap { | ||
10 | __le32 Signature; /* contains 'USBC' */ | ||
11 | __u32 Tag; /* unique per command id */ | ||
12 | __le32 DataTransferLength; /* size of data */ | ||
13 | __u8 Flags; /* direction in bit 0 */ | ||
14 | __u8 Lun; /* LUN normally 0 */ | ||
15 | __u8 Length; /* of of the CDB */ | ||
16 | __u8 CDB[16]; /* max command */ | ||
17 | }; | ||
18 | |||
19 | #define US_BULK_CB_WRAP_LEN 31 | ||
20 | #define US_BULK_CB_SIGN 0x43425355 /*spells out USBC */ | ||
21 | #define US_BULK_FLAG_IN 1 | ||
22 | #define US_BULK_FLAG_OUT 0 | ||
23 | |||
24 | /* command status wrapper */ | ||
25 | struct bulk_cs_wrap { | ||
26 | __le32 Signature; /* should = 'USBS' */ | ||
27 | __u32 Tag; /* same as original command */ | ||
28 | __le32 Residue; /* amount not transferred */ | ||
29 | __u8 Status; /* see below */ | ||
30 | __u8 Filler[18]; | ||
31 | }; | ||
32 | |||
33 | #define US_BULK_CS_WRAP_LEN 13 | ||
34 | #define US_BULK_CS_SIGN 0x53425355 /* spells out 'USBS' */ | ||
35 | #define US_BULK_STAT_OK 0 | ||
36 | #define US_BULK_STAT_FAIL 1 | ||
37 | #define US_BULK_STAT_PHASE 2 | ||
38 | |||
39 | /* bulk-only class specific requests */ | ||
40 | #define US_BULK_RESET_REQUEST 0xff | ||
41 | #define US_BULK_GET_MAX_LUN 0xfe | ||
42 | |||
43 | /* usb_stor_bulk_transfer_xxx() return codes, in order of severity */ | 6 | /* usb_stor_bulk_transfer_xxx() return codes, in order of severity */ |
44 | #define USB_STOR_XFER_GOOD 0 /* good transfer */ | 7 | #define USB_STOR_XFER_GOOD 0 /* good transfer */ |
45 | #define USB_STOR_XFER_SHORT 1 /* transferred less than expected */ | 8 | #define USB_STOR_XFER_SHORT 1 /* transferred less than expected */ |
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index ee8ceec01560..9e71fe7fc502 100644 --- a/drivers/usb/gadget/f_mass_storage.c +++ b/drivers/usb/gadget/f_mass_storage.c | |||
@@ -2221,7 +2221,7 @@ unknown_cmnd: | |||
2221 | static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh) | 2221 | static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh) |
2222 | { | 2222 | { |
2223 | struct usb_request *req = bh->outreq; | 2223 | struct usb_request *req = bh->outreq; |
2224 | struct fsg_bulk_cb_wrap *cbw = req->buf; | 2224 | struct bulk_cb_wrap *cbw = req->buf; |
2225 | struct fsg_common *common = fsg->common; | 2225 | struct fsg_common *common = fsg->common; |
2226 | 2226 | ||
2227 | /* Was this a real packet? Should it be ignored? */ | 2227 | /* Was this a real packet? Should it be ignored? */ |
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index 47766f0e7caa..15e6e8e55ef6 100644 --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c | |||
@@ -2609,7 +2609,7 @@ static int do_scsi_command(struct fsg_dev *fsg) | |||
2609 | static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh) | 2609 | static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh) |
2610 | { | 2610 | { |
2611 | struct usb_request *req = bh->outreq; | 2611 | struct usb_request *req = bh->outreq; |
2612 | struct fsg_bulk_cb_wrap *cbw = req->buf; | 2612 | struct bulk_cb_wrap *cbw = req->buf; |
2613 | 2613 | ||
2614 | /* Was this a real packet? Should it be ignored? */ | 2614 | /* Was this a real packet? Should it be ignored? */ |
2615 | if (req->status || test_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags)) | 2615 | if (req->status || test_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags)) |
diff --git a/drivers/usb/gadget/storage_common.c b/drivers/usb/gadget/storage_common.c index 85ea14e2545e..4095696b1582 100644 --- a/drivers/usb/gadget/storage_common.c +++ b/drivers/usb/gadget/storage_common.c | |||
@@ -153,29 +153,10 @@ | |||
153 | 153 | ||
154 | /* Bulk-only data structures */ | 154 | /* Bulk-only data structures */ |
155 | 155 | ||
156 | /* Command Block Wrapper */ | ||
157 | struct fsg_bulk_cb_wrap { | ||
158 | __le32 Signature; /* Contains 'USBC' */ | ||
159 | u32 Tag; /* Unique per command id */ | ||
160 | __le32 DataTransferLength; /* Size of the data */ | ||
161 | u8 Flags; /* Direction in bit 7 */ | ||
162 | u8 Lun; /* LUN (normally 0) */ | ||
163 | u8 Length; /* Of the CDB, <= MAX_COMMAND_SIZE */ | ||
164 | u8 CDB[16]; /* Command Data Block */ | ||
165 | }; | ||
166 | |||
167 | #define USB_BULK_CB_WRAP_LEN 31 | 156 | #define USB_BULK_CB_WRAP_LEN 31 |
168 | #define USB_BULK_CB_SIG 0x43425355 /* Spells out USBC */ | 157 | #define USB_BULK_CB_SIG 0x43425355 /* Spells out USBC */ |
169 | #define USB_BULK_IN_FLAG 0x80 | 158 | #define USB_BULK_IN_FLAG 0x80 |
170 | 159 | ||
171 | /* Command Status Wrapper */ | ||
172 | struct bulk_cs_wrap { | ||
173 | __le32 Signature; /* Should = 'USBS' */ | ||
174 | u32 Tag; /* Same as original command */ | ||
175 | __le32 Residue; /* Amount not transferred */ | ||
176 | u8 Status; /* See below */ | ||
177 | }; | ||
178 | |||
179 | #define USB_BULK_CS_WRAP_LEN 13 | 160 | #define USB_BULK_CS_WRAP_LEN 13 |
180 | #define USB_BULK_CS_SIG 0x53425355 /* Spells out 'USBS' */ | 161 | #define USB_BULK_CS_SIG 0x53425355 /* Spells out 'USBS' */ |
181 | #define USB_STATUS_PASS 0 | 162 | #define USB_STATUS_PASS 0 |
diff --git a/drivers/usb/storage/transport.h b/drivers/usb/storage/transport.h index 242ff5e791a5..9369d752d419 100644 --- a/drivers/usb/storage/transport.h +++ b/drivers/usb/storage/transport.h | |||
@@ -42,45 +42,6 @@ | |||
42 | #include <linux/blkdev.h> | 42 | #include <linux/blkdev.h> |
43 | 43 | ||
44 | /* | 44 | /* |
45 | * Bulk only data structures | ||
46 | */ | ||
47 | |||
48 | /* command block wrapper */ | ||
49 | struct bulk_cb_wrap { | ||
50 | __le32 Signature; /* contains 'USBC' */ | ||
51 | __u32 Tag; /* unique per command id */ | ||
52 | __le32 DataTransferLength; /* size of data */ | ||
53 | __u8 Flags; /* direction in bit 0 */ | ||
54 | __u8 Lun; /* LUN normally 0 */ | ||
55 | __u8 Length; /* of of the CDB */ | ||
56 | __u8 CDB[16]; /* max command */ | ||
57 | }; | ||
58 | |||
59 | #define US_BULK_CB_WRAP_LEN 31 | ||
60 | #define US_BULK_CB_SIGN 0x43425355 /*spells out USBC */ | ||
61 | #define US_BULK_FLAG_IN 1 | ||
62 | #define US_BULK_FLAG_OUT 0 | ||
63 | |||
64 | /* command status wrapper */ | ||
65 | struct bulk_cs_wrap { | ||
66 | __le32 Signature; /* should = 'USBS' */ | ||
67 | __u32 Tag; /* same as original command */ | ||
68 | __le32 Residue; /* amount not transferred */ | ||
69 | __u8 Status; /* see below */ | ||
70 | __u8 Filler[18]; | ||
71 | }; | ||
72 | |||
73 | #define US_BULK_CS_WRAP_LEN 13 | ||
74 | #define US_BULK_CS_SIGN 0x53425355 /* spells out 'USBS' */ | ||
75 | #define US_BULK_STAT_OK 0 | ||
76 | #define US_BULK_STAT_FAIL 1 | ||
77 | #define US_BULK_STAT_PHASE 2 | ||
78 | |||
79 | /* bulk-only class specific requests */ | ||
80 | #define US_BULK_RESET_REQUEST 0xff | ||
81 | #define US_BULK_GET_MAX_LUN 0xfe | ||
82 | |||
83 | /* | ||
84 | * usb_stor_bulk_transfer_xxx() return codes, in order of severity | 45 | * usb_stor_bulk_transfer_xxx() return codes, in order of severity |
85 | */ | 46 | */ |
86 | 47 | ||
diff --git a/include/linux/usb/storage.h b/include/linux/usb/storage.h index d7fc910f1dc4..87a94bf34d47 100644 --- a/include/linux/usb/storage.h +++ b/include/linux/usb/storage.h | |||
@@ -45,4 +45,43 @@ | |||
45 | 45 | ||
46 | #define USB_PR_DEVICE 0xff /* Use device's value */ | 46 | #define USB_PR_DEVICE 0xff /* Use device's value */ |
47 | 47 | ||
48 | /* | ||
49 | * Bulk only data structures | ||
50 | */ | ||
51 | |||
52 | /* command block wrapper */ | ||
53 | struct bulk_cb_wrap { | ||
54 | __le32 Signature; /* contains 'USBC' */ | ||
55 | __u32 Tag; /* unique per command id */ | ||
56 | __le32 DataTransferLength; /* size of data */ | ||
57 | __u8 Flags; /* direction in bit 0 */ | ||
58 | __u8 Lun; /* LUN normally 0 */ | ||
59 | __u8 Length; /* of of the CDB */ | ||
60 | __u8 CDB[16]; /* max command */ | ||
61 | }; | ||
62 | |||
63 | #define US_BULK_CB_WRAP_LEN 31 | ||
64 | #define US_BULK_CB_SIGN 0x43425355 /*spells out USBC */ | ||
65 | #define US_BULK_FLAG_IN 1 | ||
66 | #define US_BULK_FLAG_OUT 0 | ||
67 | |||
68 | /* command status wrapper */ | ||
69 | struct bulk_cs_wrap { | ||
70 | __le32 Signature; /* should = 'USBS' */ | ||
71 | __u32 Tag; /* same as original command */ | ||
72 | __le32 Residue; /* amount not transferred */ | ||
73 | __u8 Status; /* see below */ | ||
74 | __u8 Filler[18]; | ||
75 | }; | ||
76 | |||
77 | #define US_BULK_CS_WRAP_LEN 13 | ||
78 | #define US_BULK_CS_SIGN 0x53425355 /* spells out 'USBS' */ | ||
79 | #define US_BULK_STAT_OK 0 | ||
80 | #define US_BULK_STAT_FAIL 1 | ||
81 | #define US_BULK_STAT_PHASE 2 | ||
82 | |||
83 | /* bulk-only class specific requests */ | ||
84 | #define US_BULK_RESET_REQUEST 0xff | ||
85 | #define US_BULK_GET_MAX_LUN 0xfe | ||
86 | |||
48 | #endif | 87 | #endif |