1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41#ifndef _TRANSPORT_H_
42#define _TRANSPORT_H_
43
44#include <linux/config.h>
45#include <linux/blk.h>
46#include "usb.h"
47#include "scsi.h"
48
49
50
51#define US_PR_CBI 0x00
52#define US_PR_CB 0x01
53#define US_PR_BULK 0x50
54#ifdef CONFIG_USB_STORAGE_HP8200e
55#define US_PR_SCM_ATAPI 0x80
56#endif
57#ifdef CONFIG_USB_STORAGE_SDDR09
58#define US_PR_EUSB_SDDR09 0x81
59
60#endif
61#ifdef CONFIG_USB_STORAGE_SDDR55
62#define US_PR_SDDR55 0x82
63#endif
64#define US_PR_DPCM_USB 0xf0
65
66#ifdef CONFIG_USB_STORAGE_FREECOM
67#define US_PR_FREECOM 0xf1
68#endif
69
70#ifdef CONFIG_USB_STORAGE_DATAFAB
71#define US_PR_DATAFAB 0xf2
72#endif
73
74#ifdef CONFIG_USB_STORAGE_JUMPSHOT
75#define US_PR_JUMPSHOT 0xf3
76#endif
77
78#define US_PR_DEVICE 0xff
79
80
81
82
83
84
85struct bulk_cb_wrap {
86 __u32 Signature;
87 __u32 Tag;
88 __u32 DataTransferLength;
89 __u8 Flags;
90 __u8 Lun;
91 __u8 Length;
92 __u8 CDB[16];
93};
94
95#define US_BULK_CB_WRAP_LEN 31
96#define US_BULK_CB_SIGN 0x43425355
97#define US_BULK_FLAG_IN 1
98#define US_BULK_FLAG_OUT 0
99
100
101struct bulk_cs_wrap {
102 __u32 Signature;
103 __u32 Tag;
104 __u32 Residue;
105 __u8 Status;
106 __u8 Filler[18];
107};
108
109#define US_BULK_CS_WRAP_LEN 13
110#define US_BULK_CS_SIGN 0x53425355
111
112#define US_BULK_CS_OLYMPUS_SIGN 0x55425355
113#define US_BULK_STAT_OK 0
114#define US_BULK_STAT_FAIL 1
115#define US_BULK_STAT_PHASE 2
116
117
118#define US_BULK_RESET_REQUEST 0xff
119#define US_BULK_GET_MAX_LUN 0xfe
120
121
122
123
124#define US_BULK_TRANSFER_GOOD 0
125#define US_BULK_TRANSFER_SHORT 1
126#define US_BULK_TRANSFER_FAILED 2
127#define US_BULK_TRANSFER_ABORTED 3
128
129
130
131
132
133#define USB_STOR_TRANSPORT_GOOD 0
134#define USB_STOR_TRANSPORT_FAILED 1
135#define USB_STOR_TRANSPORT_ERROR 2
136#define USB_STOR_TRANSPORT_ABORTED 3
137
138
139
140
141
142#define US_CBI_ADSC 0
143
144extern void usb_stor_CBI_irq(struct urb*);
145extern int usb_stor_CBI_transport(Scsi_Cmnd*, struct us_data*);
146
147extern int usb_stor_CB_transport(Scsi_Cmnd*, struct us_data*);
148extern int usb_stor_CB_reset(struct us_data*);
149
150extern int usb_stor_Bulk_transport(Scsi_Cmnd*, struct us_data*);
151extern int usb_stor_Bulk_max_lun(struct us_data*);
152extern int usb_stor_Bulk_reset(struct us_data*);
153
154extern unsigned int usb_stor_transfer_length(Scsi_Cmnd*);
155extern void usb_stor_invoke_transport(Scsi_Cmnd*, struct us_data*);
156extern int usb_stor_transfer_partial(struct us_data*, char*, int);
157extern int usb_stor_bulk_msg(struct us_data*, void*, int, unsigned int,
158 unsigned int*);
159extern int usb_stor_control_msg(struct us_data*, unsigned int, u8, u8,
160 u16, u16, void*, u16);
161extern int usb_stor_clear_halt(struct us_data*, int );
162extern void usb_stor_transfer(Scsi_Cmnd*, struct us_data*);
163#endif
164