aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-01-11 06:45:56 -0500
committerLuis Henriques <luis.henriques@canonical.com>2012-05-01 06:00:13 -0400
commit586cb09205527924bccfb5ee411757a050f0bbe0 (patch)
tree6b2e9ac62e5d98b9e77cbb0fa861a8c8a83b0f6a /drivers/usb/storage
parent20841e613821aedbe4908120b3d68fa61b805751 (diff)
usb/uas: move UAS structs / defines into a header file
BugLink: http://bugs.launchpad.net/bugs/901215 The protocol specific structures and defines which are used by UAS are moved into a header files by this patch so it can be accessed by the UAS gadget as well. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> (cherry picked from commit 348748b0e8cccc675e2f3a1456460ffcd540e1a1) Signed-off-by: Tim Gardner <tim.gardner@canonical.com> Acked-by: Herton Krzesinski <herton.krzesinski@canonical.com>
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r--drivers/usb/storage/uas.c56
1 files changed, 1 insertions, 55 deletions
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index 012e61ad3db..28fa254ae8d 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -14,6 +14,7 @@
14#include <linux/usb.h> 14#include <linux/usb.h>
15#include <linux/usb/hcd.h> 15#include <linux/usb/hcd.h>
16#include <linux/usb/storage.h> 16#include <linux/usb/storage.h>
17#include <linux/usb/uas.h>
17 18
18#include <scsi/scsi.h> 19#include <scsi/scsi.h>
19#include <scsi/scsi_dbg.h> 20#include <scsi/scsi_dbg.h>
@@ -22,49 +23,6 @@
22#include <scsi/scsi_host.h> 23#include <scsi/scsi_host.h>
23#include <scsi/scsi_tcq.h> 24#include <scsi/scsi_tcq.h>
24 25
25/* Common header for all IUs */
26struct iu {
27 __u8 iu_id;
28 __u8 rsvd1;
29 __be16 tag;
30};
31
32enum {
33 IU_ID_COMMAND = 0x01,
34 IU_ID_STATUS = 0x03,
35 IU_ID_RESPONSE = 0x04,
36 IU_ID_TASK_MGMT = 0x05,
37 IU_ID_READ_READY = 0x06,
38 IU_ID_WRITE_READY = 0x07,
39};
40
41struct command_iu {
42 __u8 iu_id;
43 __u8 rsvd1;
44 __be16 tag;
45 __u8 prio_attr;
46 __u8 rsvd5;
47 __u8 len;
48 __u8 rsvd7;
49 struct scsi_lun lun;
50 __u8 cdb[16]; /* XXX: Overflow-checking tools may misunderstand */
51};
52
53/*
54 * Also used for the Read Ready and Write Ready IUs since they have the
55 * same first four bytes
56 */
57struct sense_iu {
58 __u8 iu_id;
59 __u8 rsvd1;
60 __be16 tag;
61 __be16 status_qual;
62 __u8 status;
63 __u8 rsvd7[7];
64 __be16 len;
65 __u8 sense[SCSI_SENSE_BUFFERSIZE];
66};
67
68/* 26/*
69 * The r00-r01c specs define this version of the SENSE IU data structure. 27 * The r00-r01c specs define this version of the SENSE IU data structure.
70 * It's still in use by several different firmware releases. 28 * It's still in use by several different firmware releases.
@@ -79,18 +37,6 @@ struct sense_iu_old {
79 __u8 sense[SCSI_SENSE_BUFFERSIZE]; 37 __u8 sense[SCSI_SENSE_BUFFERSIZE];
80}; 38};
81 39
82enum {
83 CMD_PIPE_ID = 1,
84 STATUS_PIPE_ID = 2,
85 DATA_IN_PIPE_ID = 3,
86 DATA_OUT_PIPE_ID = 4,
87
88 UAS_SIMPLE_TAG = 0,
89 UAS_HEAD_TAG = 1,
90 UAS_ORDERED_TAG = 2,
91 UAS_ACA = 4,
92};
93
94struct uas_dev_info { 40struct uas_dev_info {
95 struct usb_interface *intf; 41 struct usb_interface *intf;
96 struct usb_device *udev; 42 struct usb_device *udev;