RT-AC56 3.0.0.4.374.37 core
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / drivers / scsi / bfa / include / bfi / bfi_iocfc.h
blob04ae379a39cad1885b6ab930ad3fe95a879a5d0c
1 /*
2 * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
3 * All rights reserved
4 * www.brocade.com
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License (GPL) Version 2 as
10 * published by the Free Software Foundation
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
18 #ifndef __BFI_IOCFC_H__
19 #define __BFI_IOCFC_H__
21 #include "bfi.h"
22 #include <bfi/bfi_pbc.h>
23 #include <defs/bfa_defs_ioc.h>
24 #include <defs/bfa_defs_iocfc.h>
25 #include <defs/bfa_defs_boot.h>
27 #pragma pack(1)
29 enum bfi_iocfc_h2i_msgs {
30 BFI_IOCFC_H2I_CFG_REQ = 1,
31 BFI_IOCFC_H2I_GET_STATS_REQ = 2,
32 BFI_IOCFC_H2I_CLEAR_STATS_REQ = 3,
33 BFI_IOCFC_H2I_SET_INTR_REQ = 4,
34 BFI_IOCFC_H2I_UPDATEQ_REQ = 5,
37 enum bfi_iocfc_i2h_msgs {
38 BFI_IOCFC_I2H_CFG_REPLY = BFA_I2HM(1),
39 BFI_IOCFC_I2H_GET_STATS_RSP = BFA_I2HM(2),
40 BFI_IOCFC_I2H_CLEAR_STATS_RSP = BFA_I2HM(3),
41 BFI_IOCFC_I2H_UPDATEQ_RSP = BFA_I2HM(5),
44 struct bfi_iocfc_cfg_s {
45 u8 num_cqs; /* Number of CQs to be used */
46 u8 sense_buf_len; /* SCSI sense length */
47 u8 trunk_enabled; /* port trunking enabled */
48 u8 trunk_ports; /* trunk ports bit map */
49 u32 endian_sig; /* endian signature of host */
51 /**
52 * Request and response circular queue base addresses, size and
53 * shadow index pointers.
55 union bfi_addr_u req_cq_ba[BFI_IOC_MAX_CQS];
56 union bfi_addr_u req_shadow_ci[BFI_IOC_MAX_CQS];
57 u16 req_cq_elems[BFI_IOC_MAX_CQS];
58 union bfi_addr_u rsp_cq_ba[BFI_IOC_MAX_CQS];
59 union bfi_addr_u rsp_shadow_pi[BFI_IOC_MAX_CQS];
60 u16 rsp_cq_elems[BFI_IOC_MAX_CQS];
62 union bfi_addr_u stats_addr; /* DMA-able address for stats */
63 union bfi_addr_u cfgrsp_addr; /* config response dma address */
64 union bfi_addr_u ioim_snsbase; /* IO sense buffer base address */
65 struct bfa_iocfc_intr_attr_s intr_attr; /* IOC interrupt attributes */
68 /**
69 * Boot target wwn information for this port. This contains either the stored
70 * or discovered boot target port wwns for the port.
72 struct bfi_iocfc_bootwwns {
73 wwn_t wwn[BFA_BOOT_BOOTLUN_MAX];
74 u8 nwwns;
75 u8 rsvd[7];
78 struct bfi_iocfc_cfgrsp_s {
79 struct bfa_iocfc_fwcfg_s fwcfg;
80 struct bfa_iocfc_intr_attr_s intr_attr;
81 struct bfi_iocfc_bootwwns bootwwns;
82 struct bfi_pbc_s pbc_cfg;
85 /**
86 * BFI_IOCFC_H2I_CFG_REQ message
88 struct bfi_iocfc_cfg_req_s {
89 struct bfi_mhdr_s mh;
90 union bfi_addr_u ioc_cfg_dma_addr;
93 /**
94 * BFI_IOCFC_I2H_CFG_REPLY message
96 struct bfi_iocfc_cfg_reply_s {
97 struct bfi_mhdr_s mh; /* Common msg header */
98 u8 cfg_success; /* cfg reply status */
99 u8 lpu_bm; /* LPUs assigned for this IOC */
100 u8 rsvd[2];
104 * BFI_IOCFC_H2I_GET_STATS_REQ & BFI_IOCFC_H2I_CLEAR_STATS_REQ messages
106 struct bfi_iocfc_stats_req_s {
107 struct bfi_mhdr_s mh; /* msg header */
108 u32 msgtag; /* msgtag for reply */
112 * BFI_IOCFC_I2H_GET_STATS_RSP & BFI_IOCFC_I2H_CLEAR_STATS_RSP messages
114 struct bfi_iocfc_stats_rsp_s {
115 struct bfi_mhdr_s mh; /* common msg header */
116 u8 status; /* reply status */
117 u8 rsvd[3];
118 u32 msgtag; /* msgtag for reply */
122 * BFI_IOCFC_H2I_SET_INTR_REQ message
124 struct bfi_iocfc_set_intr_req_s {
125 struct bfi_mhdr_s mh; /* common msg header */
126 u8 coalesce; /* enable intr coalescing*/
127 u8 rsvd[3];
128 u16 delay; /* delay timer 0..1125us */
129 u16 latency; /* latency timer 0..225us */
133 * BFI_IOCFC_H2I_UPDATEQ_REQ message
135 struct bfi_iocfc_updateq_req_s {
136 struct bfi_mhdr_s mh; /* common msg header */
137 u32 reqq_ba; /* reqq base addr */
138 u32 rspq_ba; /* rspq base addr */
139 u32 reqq_sci; /* reqq shadow ci */
140 u32 rspq_spi; /* rspq shadow pi */
144 * BFI_IOCFC_I2H_UPDATEQ_RSP message
146 struct bfi_iocfc_updateq_rsp_s {
147 struct bfi_mhdr_s mh; /* common msg header */
148 u8 status; /* updateq status */
149 u8 rsvd[3];
153 * H2I Messages
155 union bfi_iocfc_h2i_msg_u {
156 struct bfi_mhdr_s mh;
157 struct bfi_iocfc_cfg_req_s cfg_req;
158 struct bfi_iocfc_stats_req_s stats_get;
159 struct bfi_iocfc_stats_req_s stats_clr;
160 struct bfi_iocfc_updateq_req_s updateq_req;
161 u32 mboxmsg[BFI_IOC_MSGSZ];
165 * I2H Messages
167 union bfi_iocfc_i2h_msg_u {
168 struct bfi_mhdr_s mh;
169 struct bfi_iocfc_cfg_reply_s cfg_reply;
170 struct bfi_iocfc_stats_rsp_s stats_get_rsp;
171 struct bfi_iocfc_stats_rsp_s stats_clr_rsp;
172 struct bfi_iocfc_updateq_rsp_s updateq_rsp;
173 u32 mboxmsg[BFI_IOC_MSGSZ];
176 #pragma pack()
178 #endif /* __BFI_IOCFC_H__ */