18 #include <linux/kernel.h>
22 #define SERVICE_ACTION16(cdb) (cdb[1] & 0x1f)
23 #define SERVICE_ACTION32(cdb) ((cdb[8] << 8) | cdb[9])
26 scsi_trace_misc(
struct trace_seq *,
unsigned char *,
int);
29 scsi_trace_rw6(
struct trace_seq *
p,
unsigned char *
cdb,
int len)
34 lba |= ((cdb[1] & 0x1F) << 16);
40 (
unsigned long long)lba, (
unsigned long long)
txlen);
47 scsi_trace_rw10(
struct trace_seq *p,
unsigned char *cdb,
int len)
52 lba |= (cdb[2] << 24);
53 lba |= (cdb[3] << 16);
56 txlen |= (cdb[7] << 8);
60 (
unsigned long long)lba, (
unsigned long long)
txlen,
72 scsi_trace_rw12(
struct trace_seq *p,
unsigned char *cdb,
int len)
77 lba |= (cdb[2] << 24);
78 lba |= (cdb[3] << 16);
81 txlen |= (cdb[6] << 24);
82 txlen |= (cdb[7] << 16);
83 txlen |= (cdb[8] << 8);
87 (
unsigned long long)lba, (
unsigned long long)
txlen,
95 scsi_trace_rw16(
struct trace_seq *p,
unsigned char *cdb,
int len)
100 lba |= ((
u64)cdb[2] << 56);
101 lba |= ((
u64)cdb[3] << 48);
102 lba |= ((
u64)cdb[4] << 40);
103 lba |= ((
u64)cdb[5] << 32);
104 lba |= (cdb[6] << 24);
105 lba |= (cdb[7] << 16);
106 lba |= (cdb[8] << 8);
108 txlen |= (cdb[10] << 24);
109 txlen |= (cdb[11] << 16);
110 txlen |= (cdb[12] << 8);
114 (
unsigned long long)lba, (
unsigned long long)
txlen,
126 scsi_trace_rw32(
struct trace_seq *p,
unsigned char *cdb,
int len)
150 lba |= ((
u64)cdb[12] << 56);
151 lba |= ((
u64)cdb[13] << 48);
152 lba |= ((
u64)cdb[14] << 40);
153 lba |= ((
u64)cdb[15] << 32);
154 lba |= (cdb[16] << 24);
155 lba |= (cdb[17] << 16);
156 lba |= (cdb[18] << 8);
158 ei_lbrt |= (cdb[20] << 24);
159 ei_lbrt |= (cdb[21] << 16);
160 ei_lbrt |= (cdb[22] << 8);
162 txlen |= (cdb[28] << 24);
163 txlen |= (cdb[29] << 16);
164 txlen |= (cdb[30] << 8);
168 cmd, (
unsigned long long)lba,
169 (
unsigned long long)
txlen, cdb[10] >> 5, ei_lbrt);
181 scsi_trace_unmap(
struct trace_seq *p,
unsigned char *cdb,
int len)
184 unsigned int regions = cdb[7] << 8 | cdb[8];
193 scsi_trace_service_action_in(
struct trace_seq *p,
unsigned char *cdb,
int len)
201 cmd =
"READ_CAPACITY_16";
204 cmd =
"GET_LBA_STATUS";
211 lba |= ((
u64)cdb[2] << 56);
212 lba |= ((
u64)cdb[3] << 48);
213 lba |= ((
u64)cdb[4] << 40);
214 lba |= ((
u64)cdb[5] << 32);
215 lba |= (cdb[6] << 24);
216 lba |= (cdb[7] << 16);
217 lba |= (cdb[8] << 8);
219 alloc_len |= (cdb[10] << 24);
220 alloc_len |= (cdb[11] << 16);
221 alloc_len |= (cdb[12] << 8);
222 alloc_len |= cdb[13];
225 (
unsigned long long)lba, alloc_len);
234 scsi_trace_varlen(
struct trace_seq *p,
unsigned char *cdb,
int len)
241 return scsi_trace_rw32(p, cdb, len);
243 return scsi_trace_misc(p, cdb, len);
248 scsi_trace_misc(
struct trace_seq *p,
unsigned char *cdb,
int len)
264 return scsi_trace_rw6(p, cdb, len);
269 return scsi_trace_rw10(p, cdb, len);
273 return scsi_trace_rw12(p, cdb, len);
278 return scsi_trace_rw16(p, cdb, len);
280 return scsi_trace_unmap(p, cdb, len);
282 return scsi_trace_service_action_in(p, cdb, len);
284 return scsi_trace_varlen(p, cdb, len);
286 return scsi_trace_misc(p, cdb, len);