Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
drivers
s390
scsi
zfcp_dbf.h
Go to the documentation of this file.
1
/*
2
* zfcp device driver
3
* debug feature declarations
4
*
5
* Copyright IBM Corp. 2008, 2010
6
*/
7
8
#ifndef ZFCP_DBF_H
9
#define ZFCP_DBF_H
10
11
#include <
scsi/fc/fc_fcp.h
>
12
#include "
zfcp_ext.h
"
13
#include "
zfcp_fsf.h
"
14
#include "
zfcp_def.h
"
15
16
#define ZFCP_DBF_TAG_LEN 7
17
18
#define ZFCP_DBF_INVALID_LUN 0xFFFFFFFFFFFFFFFFull
19
27
struct
zfcp_dbf_rec_trigger
{
28
u32
ready
;
29
u32
running
;
30
u8
want
;
31
u8
need
;
32
}
__packed
;
33
41
struct
zfcp_dbf_rec_running
{
42
u64
fsf_req_id
;
43
u32
rec_status
;
44
u16
rec_step
;
45
u8
rec_action
;
46
u8
rec_count
;
47
}
__packed
;
48
54
enum
zfcp_dbf_rec_id
{
55
ZFCP_DBF_REC_TRIG
= 1,
56
ZFCP_DBF_REC_RUN
= 2,
57
};
58
72
struct
zfcp_dbf_rec
{
73
u8
id
;
74
char
tag
[
ZFCP_DBF_TAG_LEN
];
75
u64
lun
;
76
u64
wwpn
;
77
u32
d_id
;
78
u32
adapter_status
;
79
u32
port_status
;
80
u32
lun_status
;
81
union
{
82
struct
zfcp_dbf_rec_trigger
trig
;
83
struct
zfcp_dbf_rec_running
run
;
84
}
u
;
85
}
__packed
;
86
93
enum
zfcp_dbf_san_id
{
94
ZFCP_DBF_SAN_REQ
= 1,
95
ZFCP_DBF_SAN_RES
= 2,
96
ZFCP_DBF_SAN_ELS
= 3,
97
};
98
106
struct
zfcp_dbf_san
{
107
u8
id
;
108
char
tag
[
ZFCP_DBF_TAG_LEN
];
109
u64
fsf_req_id
;
110
u32
d_id
;
111
#define ZFCP_DBF_SAN_MAX_PAYLOAD (FC_CT_HDR_LEN + 32)
112
char
payload
[
ZFCP_DBF_SAN_MAX_PAYLOAD
];
113
}
__packed
;
114
123
struct
zfcp_dbf_hba_res
{
124
u64
req_issued
;
125
u32
prot_status
;
126
u8
prot_status_qual
[
FSF_PROT_STATUS_QUAL_SIZE
];
127
u32
fsf_status
;
128
u8
fsf_status_qual
[
FSF_STATUS_QUALIFIER_SIZE
];
129
}
__packed
;
130
139
struct
zfcp_dbf_hba_uss
{
140
u32
status_type
;
141
u32
status_subtype
;
142
u32
d_id
;
143
u64
lun
;
144
u64
queue_designator
;
145
}
__packed
;
146
153
enum
zfcp_dbf_hba_id
{
154
ZFCP_DBF_HBA_RES
= 1,
155
ZFCP_DBF_HBA_USS
= 2,
156
ZFCP_DBF_HBA_BIT
= 3,
157
ZFCP_DBF_HBA_BASIC
= 4,
158
};
159
171
struct
zfcp_dbf_hba
{
172
u8
id
;
173
char
tag
[
ZFCP_DBF_TAG_LEN
];
174
u64
fsf_req_id
;
175
u32
fsf_req_status
;
176
u32
fsf_cmd
;
177
u32
fsf_seq_no
;
178
u16
pl_len
;
179
union
{
180
struct
zfcp_dbf_hba_res
res
;
181
struct
zfcp_dbf_hba_uss
uss
;
182
struct
fsf_bit_error_payload
be
;
183
}
u
;
184
}
__packed
;
185
190
enum
zfcp_dbf_scsi_id
{
191
ZFCP_DBF_SCSI_CMND
= 1,
192
};
193
210
struct
zfcp_dbf_scsi
{
211
u8
id
;
212
char
tag
[
ZFCP_DBF_TAG_LEN
];
213
u32
scsi_id
;
214
u32
scsi_lun
;
215
u32
scsi_result
;
216
u8
scsi_retries
;
217
u8
scsi_allowed
;
218
u8
fcp_rsp_info
;
219
#define ZFCP_DBF_SCSI_OPCODE 16
220
u8
scsi_opcode
[
ZFCP_DBF_SCSI_OPCODE
];
221
u64
fsf_req_id
;
222
u64
host_scribble
;
223
u16
pl_len
;
224
struct
fcp_resp_with_ext
fcp_rsp
;
225
}
__packed
;
226
234
struct
zfcp_dbf_pay
{
235
u8
counter
;
236
char
area
[
ZFCP_DBF_TAG_LEN
];
237
u64
fsf_req_id
;
238
#define ZFCP_DBF_PAY_MAX_REC 0x100
239
char
data
[
ZFCP_DBF_PAY_MAX_REC
];
240
}
__packed
;
241
260
struct
zfcp_dbf
{
261
debug_info_t
*
pay
;
262
debug_info_t
*
rec
;
263
debug_info_t
*
hba
;
264
debug_info_t
*
san
;
265
debug_info_t
*
scsi
;
266
spinlock_t
pay_lock
;
267
spinlock_t
rec_lock
;
268
spinlock_t
hba_lock
;
269
spinlock_t
san_lock
;
270
spinlock_t
scsi_lock
;
271
struct
zfcp_dbf_pay
pay_buf
;
272
struct
zfcp_dbf_rec
rec_buf
;
273
struct
zfcp_dbf_hba
hba_buf
;
274
struct
zfcp_dbf_san
san_buf
;
275
struct
zfcp_dbf_scsi
scsi_buf
;
276
};
277
278
static
inline
279
void
zfcp_dbf_hba_fsf_resp(
char
*
tag
,
int
level
,
struct
zfcp_fsf_req
*
req
)
280
{
281
if
(level <= req->
adapter
->dbf->hba->level)
282
zfcp_dbf_hba_fsf_res
(tag, req);
283
}
284
289
static
inline
290
void
zfcp_dbf_hba_fsf_response(
struct
zfcp_fsf_req
*req)
291
{
292
struct
fsf_qtcb
*qtcb = req->
qtcb
;
293
294
if
((qtcb->
prefix
.prot_status !=
FSF_PROT_GOOD
) &&
295
(qtcb->
prefix
.prot_status !=
FSF_PROT_FSF_STATUS_PRESENTED
)) {
296
zfcp_dbf_hba_fsf_resp(
"fs_perr"
, 1, req);
297
298
}
else
if
(qtcb->
header
.fsf_status !=
FSF_GOOD
) {
299
zfcp_dbf_hba_fsf_resp(
"fs_ferr"
, 1, req);
300
301
}
else
if
((req->
fsf_command
==
FSF_QTCB_OPEN_PORT_WITH_DID
) ||
302
(req->
fsf_command
==
FSF_QTCB_OPEN_LUN
)) {
303
zfcp_dbf_hba_fsf_resp(
"fs_open"
, 4, req);
304
305
}
else
if
(qtcb->
header
.log_length) {
306
zfcp_dbf_hba_fsf_resp(
"fs_qtcb"
, 5, req);
307
308
}
else
{
309
zfcp_dbf_hba_fsf_resp(
"fs_norm"
, 6, req);
310
}
311
}
312
313
static
inline
314
void
_zfcp_dbf_scsi(
char
*tag,
int
level,
struct
scsi_cmnd
*scmd,
315
struct
zfcp_fsf_req
*req)
316
{
317
struct
zfcp_adapter
*
adapter
= (
struct
zfcp_adapter
*)
318
scmd->
device
->host->hostdata[0];
319
320
if
(level <= adapter->
dbf
->scsi->level)
321
zfcp_dbf_scsi
(tag, scmd, req);
322
}
323
329
static
inline
330
void
zfcp_dbf_scsi_result(
struct
scsi_cmnd
*scmd,
struct
zfcp_fsf_req
*req)
331
{
332
if
(scmd->
result
!= 0)
333
_zfcp_dbf_scsi(
"rsl_err"
, 3, scmd, req);
334
else
if
(scmd->
retries
> 0)
335
_zfcp_dbf_scsi(
"rsl_ret"
, 4, scmd, req);
336
else
337
_zfcp_dbf_scsi(
"rsl_nor"
, 6, scmd, req);
338
}
339
344
static
inline
345
void
zfcp_dbf_scsi_fail_send(
struct
scsi_cmnd
*scmd)
346
{
347
_zfcp_dbf_scsi(
"rsl_fai"
, 4, scmd,
NULL
);
348
}
349
356
static
inline
357
void
zfcp_dbf_scsi_abort(
char
*tag,
struct
scsi_cmnd
*scmd,
358
struct
zfcp_fsf_req
*fsf_req)
359
{
360
_zfcp_dbf_scsi(tag, 1, scmd, fsf_req);
361
}
362
369
static
inline
370
void
zfcp_dbf_scsi_devreset(
char
*tag,
struct
scsi_cmnd
*scmnd,
u8
flag
)
371
{
372
char
tmp_tag[
ZFCP_DBF_TAG_LEN
];
373
374
if
(flag ==
FCP_TMF_TGT_RESET
)
375
memcpy
(tmp_tag,
"tr_"
, 3);
376
else
377
memcpy
(tmp_tag,
"lr_"
, 3);
378
379
memcpy
(&tmp_tag[3], tag, 4);
380
_zfcp_dbf_scsi(tmp_tag, 1, scmnd,
NULL
);
381
}
382
383
#endif
/* ZFCP_DBF_H */
Generated on Thu Jan 10 2013 14:18:23 for Linux Kernel by
1.8.2