diff options
author | Bhanu Gollapudi <bprakash@broadcom.com> | 2011-02-04 15:10:34 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2011-02-28 19:40:27 -0500 |
commit | 853e2bd2103aaa91d1ba1c0b57ba17628d836f03 (patch) | |
tree | a8e0cae98856eac066cb9e598a5b9693c27cb2da /drivers/scsi/bnx2fc/bnx2fc_debug.h | |
parent | d2f809528a3534ea295b6d855c33cbbb3369d8c9 (diff) |
[SCSI] bnx2fc: Broadcom FCoE offload driver
This driver is for Broadcom Netxtreme II 57712 chip. The following
patch contains the driver sources for bnx2fc driver. libfc/libfcoe
changes to enable bnx2fc have already gone through the fcoe
tree. bnx2fc is a SCSI low level driver that interfaces with SCSI
midlayer, libfc, libfcoe, cnic modules. bnx2fc driver uses services
of libfc for slow path operations such as FIP and fabric
discovery. The fast path IO perations are performed after offloading
the session information to the underlying FCoE firmware.
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bnx2fc/bnx2fc_debug.h')
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_debug.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_debug.h b/drivers/scsi/bnx2fc/bnx2fc_debug.h new file mode 100644 index 000000000000..7f6aff68cc53 --- /dev/null +++ b/drivers/scsi/bnx2fc/bnx2fc_debug.h | |||
@@ -0,0 +1,70 @@ | |||
1 | #ifndef __BNX2FC_DEBUG__ | ||
2 | #define __BNX2FC_DEBUG__ | ||
3 | |||
4 | /* Log level bit mask */ | ||
5 | #define LOG_IO 0x01 /* scsi cmd error, cleanup */ | ||
6 | #define LOG_TGT 0x02 /* Session setup, cleanup, etc' */ | ||
7 | #define LOG_HBA 0x04 /* lport events, link, mtu, etc' */ | ||
8 | #define LOG_ELS 0x08 /* ELS logs */ | ||
9 | #define LOG_MISC 0x10 /* fcoe L2 frame related logs*/ | ||
10 | #define LOG_ALL 0xff /* LOG all messages */ | ||
11 | |||
12 | extern unsigned int bnx2fc_debug_level; | ||
13 | |||
14 | #define BNX2FC_CHK_LOGGING(LEVEL, CMD) \ | ||
15 | do { \ | ||
16 | if (unlikely(bnx2fc_debug_level & LEVEL)) \ | ||
17 | do { \ | ||
18 | CMD; \ | ||
19 | } while (0); \ | ||
20 | } while (0) | ||
21 | |||
22 | #define BNX2FC_ELS_DBG(fmt, arg...) \ | ||
23 | BNX2FC_CHK_LOGGING(LOG_ELS, \ | ||
24 | printk(KERN_ALERT PFX fmt, ##arg)) | ||
25 | |||
26 | #define BNX2FC_MISC_DBG(fmt, arg...) \ | ||
27 | BNX2FC_CHK_LOGGING(LOG_MISC, \ | ||
28 | printk(KERN_ALERT PFX fmt, ##arg)) | ||
29 | |||
30 | #define BNX2FC_IO_DBG(io_req, fmt, arg...) \ | ||
31 | do { \ | ||
32 | if (!io_req || !io_req->port || !io_req->port->lport || \ | ||
33 | !io_req->port->lport->host) \ | ||
34 | BNX2FC_CHK_LOGGING(LOG_IO, \ | ||
35 | printk(KERN_ALERT PFX "NULL " fmt, ##arg)); \ | ||
36 | else \ | ||
37 | BNX2FC_CHK_LOGGING(LOG_IO, \ | ||
38 | shost_printk(KERN_ALERT, \ | ||
39 | (io_req)->port->lport->host, \ | ||
40 | PFX "xid:0x%x " fmt, \ | ||
41 | (io_req)->xid, ##arg)); \ | ||
42 | } while (0) | ||
43 | |||
44 | #define BNX2FC_TGT_DBG(tgt, fmt, arg...) \ | ||
45 | do { \ | ||
46 | if (!tgt || !tgt->port || !tgt->port->lport || \ | ||
47 | !tgt->port->lport->host || !tgt->rport) \ | ||
48 | BNX2FC_CHK_LOGGING(LOG_TGT, \ | ||
49 | printk(KERN_ALERT PFX "NULL " fmt, ##arg)); \ | ||
50 | else \ | ||
51 | BNX2FC_CHK_LOGGING(LOG_TGT, \ | ||
52 | shost_printk(KERN_ALERT, \ | ||
53 | (tgt)->port->lport->host, \ | ||
54 | PFX "port:%x " fmt, \ | ||
55 | (tgt)->rport->port_id, ##arg)); \ | ||
56 | } while (0) | ||
57 | |||
58 | |||
59 | #define BNX2FC_HBA_DBG(lport, fmt, arg...) \ | ||
60 | do { \ | ||
61 | if (!lport || !lport->host) \ | ||
62 | BNX2FC_CHK_LOGGING(LOG_HBA, \ | ||
63 | printk(KERN_ALERT PFX "NULL " fmt, ##arg)); \ | ||
64 | else \ | ||
65 | BNX2FC_CHK_LOGGING(LOG_HBA, \ | ||
66 | shost_printk(KERN_ALERT, lport->host, \ | ||
67 | PFX fmt, ##arg)); \ | ||
68 | } while (0) | ||
69 | |||
70 | #endif | ||