blob: 6ef1ba50ecf992f600392712d78ad21beceb945e [file] [log] [blame]
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001/*
2 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
3 * All rights reserved
4 * www.brocade.com
5 *
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
7 *
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
11 *
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.
16 */
17
18#ifndef __BFI_H__
19#define __BFI_H__
20
21#include "bfa_defs.h"
22#include "bfa_defs_svc.h"
23
24#pragma pack(1)
25
Jing Huangacdc79a2010-10-18 17:15:55 -070026/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070027 * BFI FW image type
28 */
29#define BFI_FLASH_CHUNK_SZ 256 /* Flash chunk size */
30#define BFI_FLASH_CHUNK_SZ_WORDS (BFI_FLASH_CHUNK_SZ/sizeof(u32))
31enum {
32 BFI_IMAGE_CB_FC,
33 BFI_IMAGE_CT_FC,
34 BFI_IMAGE_CT_CNA,
35 BFI_IMAGE_MAX,
36};
37
Jing Huangacdc79a2010-10-18 17:15:55 -070038/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070039 * Msg header common to all msgs
40 */
41struct bfi_mhdr_s {
42 u8 msg_class; /* @ref bfi_mclass_t */
43 u8 msg_id; /* msg opcode with in the class */
44 union {
45 struct {
46 u8 rsvd;
47 u8 lpu_id; /* msg destination */
48 } h2i;
49 u16 i2htok; /* token in msgs to host */
50 } mtag;
51};
52
53#define bfi_h2i_set(_mh, _mc, _op, _lpuid) do { \
54 (_mh).msg_class = (_mc); \
55 (_mh).msg_id = (_op); \
56 (_mh).mtag.h2i.lpu_id = (_lpuid); \
57} while (0)
58
59#define bfi_i2h_set(_mh, _mc, _op, _i2htok) do { \
60 (_mh).msg_class = (_mc); \
61 (_mh).msg_id = (_op); \
62 (_mh).mtag.i2htok = (_i2htok); \
63} while (0)
64
65/*
66 * Message opcodes: 0-127 to firmware, 128-255 to host
67 */
68#define BFI_I2H_OPCODE_BASE 128
69#define BFA_I2HM(_x) ((_x) + BFI_I2H_OPCODE_BASE)
70
Jing Huangacdc79a2010-10-18 17:15:55 -070071/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070072 ****************************************************************************
73 *
74 * Scatter Gather Element and Page definition
75 *
76 ****************************************************************************
77 */
78
79#define BFI_SGE_INLINE 1
80#define BFI_SGE_INLINE_MAX (BFI_SGE_INLINE + 1)
81
Jing Huangacdc79a2010-10-18 17:15:55 -070082/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070083 * SG Flags
84 */
85enum {
86 BFI_SGE_DATA = 0, /* data address, not last */
87 BFI_SGE_DATA_CPL = 1, /* data addr, last in current page */
88 BFI_SGE_DATA_LAST = 3, /* data address, last */
89 BFI_SGE_LINK = 2, /* link address */
90 BFI_SGE_PGDLEN = 2, /* cumulative data length for page */
91};
92
Jing Huangacdc79a2010-10-18 17:15:55 -070093/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070094 * DMA addresses
95 */
96union bfi_addr_u {
97 struct {
Maggie50444a32010-11-29 18:26:32 -080098 __be32 addr_lo;
99 __be32 addr_hi;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700100 } a32;
101};
102
Jing Huangacdc79a2010-10-18 17:15:55 -0700103/*
Krishna Gudipati85ce9282011-06-13 15:39:36 -0700104 * Scatter Gather Element used for fast-path IO requests
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700105 */
106struct bfi_sge_s {
Maggie Zhangf16a1752010-12-09 19:12:32 -0800107#ifdef __BIG_ENDIAN
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700108 u32 flags:2,
109 rsvd:2,
110 sg_len:28;
111#else
112 u32 sg_len:28,
113 rsvd:2,
114 flags:2;
115#endif
116 union bfi_addr_u sga;
117};
118
Krishna Gudipati85ce9282011-06-13 15:39:36 -0700119/**
120 * Generic DMA addr-len pair.
121 */
122struct bfi_alen_s {
123 union bfi_addr_u al_addr; /* DMA addr of buffer */
124 u32 al_len; /* length of buffer */
125};
126
Jing Huangacdc79a2010-10-18 17:15:55 -0700127/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700128 * Scatter Gather Page
129 */
130#define BFI_SGPG_DATA_SGES 7
131#define BFI_SGPG_SGES_MAX (BFI_SGPG_DATA_SGES + 1)
132#define BFI_SGPG_RSVD_WD_LEN 8
133struct bfi_sgpg_s {
134 struct bfi_sge_s sges[BFI_SGPG_SGES_MAX];
135 u32 rsvd[BFI_SGPG_RSVD_WD_LEN];
136};
137
138/*
139 * Large Message structure - 128 Bytes size Msgs
140 */
141#define BFI_LMSG_SZ 128
142#define BFI_LMSG_PL_WSZ \
143 ((BFI_LMSG_SZ - sizeof(struct bfi_mhdr_s)) / 4)
144
145struct bfi_msg_s {
146 struct bfi_mhdr_s mhdr;
147 u32 pl[BFI_LMSG_PL_WSZ];
148};
149
Jing Huangacdc79a2010-10-18 17:15:55 -0700150/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700151 * Mailbox message structure
152 */
153#define BFI_MBMSG_SZ 7
154struct bfi_mbmsg_s {
155 struct bfi_mhdr_s mh;
156 u32 pl[BFI_MBMSG_SZ];
157};
158
Jing Huangacdc79a2010-10-18 17:15:55 -0700159/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700160 * Message Classes
161 */
162enum bfi_mclass {
163 BFI_MC_IOC = 1, /* IO Controller (IOC) */
164 BFI_MC_FCPORT = 5, /* FC port */
165 BFI_MC_IOCFC = 6, /* FC - IO Controller (IOC) */
166 BFI_MC_LL = 7, /* Link Layer */
167 BFI_MC_UF = 8, /* Unsolicited frame receive */
168 BFI_MC_FCXP = 9, /* FC Transport */
169 BFI_MC_LPS = 10, /* lport fc login services */
170 BFI_MC_RPORT = 11, /* Remote port */
171 BFI_MC_ITNIM = 12, /* I-T nexus (Initiator mode) */
172 BFI_MC_IOIM_READ = 13, /* read IO (Initiator mode) */
173 BFI_MC_IOIM_WRITE = 14, /* write IO (Initiator mode) */
174 BFI_MC_IOIM_IO = 15, /* IO (Initiator mode) */
175 BFI_MC_IOIM = 16, /* IO (Initiator mode) */
176 BFI_MC_IOIM_IOCOM = 17, /* good IO completion */
177 BFI_MC_TSKIM = 18, /* Initiator Task management */
178 BFI_MC_PORT = 21, /* Physical port */
179 BFI_MC_MAX = 32
180};
181
182#define BFI_IOC_MAX_CQS 4
183#define BFI_IOC_MAX_CQS_ASIC 8
184#define BFI_IOC_MSGLEN_MAX 32 /* 32 bytes */
185
186#define BFI_BOOT_TYPE_OFF 8
187#define BFI_BOOT_LOADER_OFF 12
188
189#define BFI_BOOT_TYPE_NORMAL 0
190#define BFI_BOOT_TYPE_FLASH 1
191#define BFI_BOOT_TYPE_MEMTEST 2
192
193#define BFI_BOOT_LOADER_OS 0
194#define BFI_BOOT_LOADER_BIOS 1
195#define BFI_BOOT_LOADER_UEFI 2
196
Jing Huangacdc79a2010-10-18 17:15:55 -0700197/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700198 *----------------------------------------------------------------------
199 * IOC
200 *----------------------------------------------------------------------
201 */
202
203enum bfi_ioc_h2i_msgs {
204 BFI_IOC_H2I_ENABLE_REQ = 1,
205 BFI_IOC_H2I_DISABLE_REQ = 2,
206 BFI_IOC_H2I_GETATTR_REQ = 3,
207 BFI_IOC_H2I_DBG_SYNC = 4,
208 BFI_IOC_H2I_DBG_DUMP = 5,
209};
210
211enum bfi_ioc_i2h_msgs {
212 BFI_IOC_I2H_ENABLE_REPLY = BFA_I2HM(1),
213 BFI_IOC_I2H_DISABLE_REPLY = BFA_I2HM(2),
214 BFI_IOC_I2H_GETATTR_REPLY = BFA_I2HM(3),
215 BFI_IOC_I2H_READY_EVENT = BFA_I2HM(4),
216 BFI_IOC_I2H_HBEAT = BFA_I2HM(5),
217};
218
Jing Huangacdc79a2010-10-18 17:15:55 -0700219/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700220 * BFI_IOC_H2I_GETATTR_REQ message
221 */
222struct bfi_ioc_getattr_req_s {
223 struct bfi_mhdr_s mh;
224 union bfi_addr_u attr_addr;
225};
226
227struct bfi_ioc_attr_s {
228 wwn_t mfg_pwwn; /* Mfg port wwn */
229 wwn_t mfg_nwwn; /* Mfg node wwn */
230 mac_t mfg_mac; /* Mfg mac */
231 u16 rsvd_a;
232 wwn_t pwwn;
233 wwn_t nwwn;
234 mac_t mac; /* PBC or Mfg mac */
235 u16 rsvd_b;
236 mac_t fcoe_mac;
237 u16 rsvd_c;
238 char brcd_serialnum[STRSZ(BFA_MFG_SERIALNUM_SIZE)];
239 u8 pcie_gen;
240 u8 pcie_lanes_orig;
241 u8 pcie_lanes;
242 u8 rx_bbcredit; /* receive buffer credits */
243 u32 adapter_prop; /* adapter properties */
244 u16 maxfrsize; /* max receive frame size */
245 char asic_rev;
246 u8 rsvd_d;
247 char fw_version[BFA_VERSION_LEN];
248 char optrom_version[BFA_VERSION_LEN];
249 struct bfa_mfg_vpd_s vpd;
250 u32 card_type; /* card type */
251};
252
Jing Huangacdc79a2010-10-18 17:15:55 -0700253/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700254 * BFI_IOC_I2H_GETATTR_REPLY message
255 */
256struct bfi_ioc_getattr_reply_s {
257 struct bfi_mhdr_s mh; /* Common msg header */
258 u8 status; /* cfg reply status */
259 u8 rsvd[3];
260};
261
Jing Huangacdc79a2010-10-18 17:15:55 -0700262/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700263 * Firmware memory page offsets
264 */
265#define BFI_IOC_SMEM_PG0_CB (0x40)
266#define BFI_IOC_SMEM_PG0_CT (0x180)
267
Jing Huangacdc79a2010-10-18 17:15:55 -0700268/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700269 * Firmware statistic offset
270 */
271#define BFI_IOC_FWSTATS_OFF (0x6B40)
272#define BFI_IOC_FWSTATS_SZ (4096)
273
Jing Huangacdc79a2010-10-18 17:15:55 -0700274/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700275 * Firmware trace offset
276 */
277#define BFI_IOC_TRC_OFF (0x4b00)
278#define BFI_IOC_TRC_ENTS 256
279
280#define BFI_IOC_FW_SIGNATURE (0xbfadbfad)
281#define BFI_IOC_MD5SUM_SZ 4
282struct bfi_ioc_image_hdr_s {
283 u32 signature; /* constant signature */
284 u32 rsvd_a;
285 u32 exec; /* exec vector */
286 u32 param; /* parameters */
287 u32 rsvd_b[4];
288 u32 md5sum[BFI_IOC_MD5SUM_SZ];
289};
290
Jing Huangacdc79a2010-10-18 17:15:55 -0700291/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700292 * BFI_IOC_I2H_READY_EVENT message
293 */
294struct bfi_ioc_rdy_event_s {
295 struct bfi_mhdr_s mh; /* common msg header */
296 u8 init_status; /* init event status */
297 u8 rsvd[3];
298};
299
300struct bfi_ioc_hbeat_s {
301 struct bfi_mhdr_s mh; /* common msg header */
302 u32 hb_count; /* current heart beat count */
303};
304
Jing Huangacdc79a2010-10-18 17:15:55 -0700305/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700306 * IOC hardware/firmware state
307 */
308enum bfi_ioc_state {
309 BFI_IOC_UNINIT = 0, /* not initialized */
310 BFI_IOC_INITING = 1, /* h/w is being initialized */
311 BFI_IOC_HWINIT = 2, /* h/w is initialized */
312 BFI_IOC_CFG = 3, /* IOC configuration in progress */
313 BFI_IOC_OP = 4, /* IOC is operational */
314 BFI_IOC_DISABLING = 5, /* IOC is being disabled */
315 BFI_IOC_DISABLED = 6, /* IOC is disabled */
316 BFI_IOC_CFG_DISABLED = 7, /* IOC is being disabled;transient */
317 BFI_IOC_FAIL = 8, /* IOC heart-beat failure */
318 BFI_IOC_MEMTEST = 9, /* IOC is doing memtest */
319};
320
321#define BFI_IOC_ENDIAN_SIG 0x12345678
322
323enum {
324 BFI_ADAPTER_TYPE_FC = 0x01, /* FC adapters */
325 BFI_ADAPTER_TYPE_MK = 0x0f0000, /* adapter type mask */
326 BFI_ADAPTER_TYPE_SH = 16, /* adapter type shift */
327 BFI_ADAPTER_NPORTS_MK = 0xff00, /* number of ports mask */
328 BFI_ADAPTER_NPORTS_SH = 8, /* number of ports shift */
329 BFI_ADAPTER_SPEED_MK = 0xff, /* adapter speed mask */
330 BFI_ADAPTER_SPEED_SH = 0, /* adapter speed shift */
331 BFI_ADAPTER_PROTO = 0x100000, /* prototype adapaters */
332 BFI_ADAPTER_TTV = 0x200000, /* TTV debug capable */
333 BFI_ADAPTER_UNSUPP = 0x400000, /* unknown adapter type */
334};
335
336#define BFI_ADAPTER_GETP(__prop, __adap_prop) \
337 (((__adap_prop) & BFI_ADAPTER_ ## __prop ## _MK) >> \
338 BFI_ADAPTER_ ## __prop ## _SH)
339#define BFI_ADAPTER_SETP(__prop, __val) \
340 ((__val) << BFI_ADAPTER_ ## __prop ## _SH)
341#define BFI_ADAPTER_IS_PROTO(__adap_type) \
342 ((__adap_type) & BFI_ADAPTER_PROTO)
343#define BFI_ADAPTER_IS_TTV(__adap_type) \
344 ((__adap_type) & BFI_ADAPTER_TTV)
345#define BFI_ADAPTER_IS_UNSUPP(__adap_type) \
346 ((__adap_type) & BFI_ADAPTER_UNSUPP)
347#define BFI_ADAPTER_IS_SPECIAL(__adap_type) \
348 ((__adap_type) & (BFI_ADAPTER_TTV | BFI_ADAPTER_PROTO | \
349 BFI_ADAPTER_UNSUPP))
350
Jing Huangacdc79a2010-10-18 17:15:55 -0700351/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700352 * BFI_IOC_H2I_ENABLE_REQ & BFI_IOC_H2I_DISABLE_REQ messages
353 */
354struct bfi_ioc_ctrl_req_s {
355 struct bfi_mhdr_s mh;
356 u8 ioc_class;
357 u8 rsvd[3];
358 u32 tv_sec;
359};
360#define bfi_ioc_enable_req_t struct bfi_ioc_ctrl_req_s;
361#define bfi_ioc_disable_req_t struct bfi_ioc_ctrl_req_s;
362
Jing Huangacdc79a2010-10-18 17:15:55 -0700363/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700364 * BFI_IOC_I2H_ENABLE_REPLY & BFI_IOC_I2H_DISABLE_REPLY messages
365 */
366struct bfi_ioc_ctrl_reply_s {
367 struct bfi_mhdr_s mh; /* Common msg header */
368 u8 status; /* enable/disable status */
369 u8 rsvd[3];
370};
371#define bfi_ioc_enable_reply_t struct bfi_ioc_ctrl_reply_s;
372#define bfi_ioc_disable_reply_t struct bfi_ioc_ctrl_reply_s;
373
374#define BFI_IOC_MSGSZ 8
Jing Huangacdc79a2010-10-18 17:15:55 -0700375/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700376 * H2I Messages
377 */
378union bfi_ioc_h2i_msg_u {
379 struct bfi_mhdr_s mh;
380 struct bfi_ioc_ctrl_req_s enable_req;
381 struct bfi_ioc_ctrl_req_s disable_req;
382 struct bfi_ioc_getattr_req_s getattr_req;
383 u32 mboxmsg[BFI_IOC_MSGSZ];
384};
385
Jing Huangacdc79a2010-10-18 17:15:55 -0700386/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700387 * I2H Messages
388 */
389union bfi_ioc_i2h_msg_u {
390 struct bfi_mhdr_s mh;
391 struct bfi_ioc_rdy_event_s rdy_event;
392 u32 mboxmsg[BFI_IOC_MSGSZ];
393};
394
395
Jing Huangacdc79a2010-10-18 17:15:55 -0700396/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700397 *----------------------------------------------------------------------
398 * PBC
399 *----------------------------------------------------------------------
400 */
401
402#define BFI_PBC_MAX_BLUNS 8
403#define BFI_PBC_MAX_VPORTS 16
404
Jing Huangacdc79a2010-10-18 17:15:55 -0700405/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700406 * PBC boot lun configuration
407 */
408struct bfi_pbc_blun_s {
409 wwn_t tgt_pwwn;
Maggie Zhangf3148782010-12-09 19:11:39 -0800410 struct scsi_lun tgt_lun;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700411};
412
Jing Huangacdc79a2010-10-18 17:15:55 -0700413/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700414 * PBC virtual port configuration
415 */
416struct bfi_pbc_vport_s {
417 wwn_t vp_pwwn;
418 wwn_t vp_nwwn;
419};
420
Jing Huangacdc79a2010-10-18 17:15:55 -0700421/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700422 * BFI pre-boot configuration information
423 */
424struct bfi_pbc_s {
425 u8 port_enabled;
426 u8 boot_enabled;
427 u8 nbluns;
428 u8 nvports;
429 u8 port_speed;
430 u8 rsvd_a;
431 u16 hss;
432 wwn_t pbc_pwwn;
433 wwn_t pbc_nwwn;
434 struct bfi_pbc_blun_s blun[BFI_PBC_MAX_BLUNS];
435 struct bfi_pbc_vport_s vport[BFI_PBC_MAX_VPORTS];
436};
437
Jing Huangacdc79a2010-10-18 17:15:55 -0700438/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700439 *----------------------------------------------------------------------
440 * MSGQ
441 *----------------------------------------------------------------------
442 */
443#define BFI_MSGQ_FULL(_q) (((_q->pi + 1) % _q->q_depth) == _q->ci)
444#define BFI_MSGQ_EMPTY(_q) (_q->pi == _q->ci)
445#define BFI_MSGQ_UPDATE_CI(_q) (_q->ci = (_q->ci + 1) % _q->q_depth)
446#define BFI_MSGQ_UPDATE_PI(_q) (_q->pi = (_q->pi + 1) % _q->q_depth)
447
448/* q_depth must be power of 2 */
449#define BFI_MSGQ_FREE_CNT(_q) ((_q->ci - _q->pi - 1) & (_q->q_depth - 1))
450
451enum bfi_msgq_h2i_msgs_e {
452 BFI_MSGQ_H2I_INIT_REQ = 1,
453 BFI_MSGQ_H2I_DOORBELL = 2,
454 BFI_MSGQ_H2I_SHUTDOWN = 3,
455};
456
457enum bfi_msgq_i2h_msgs_e {
458 BFI_MSGQ_I2H_INIT_RSP = 1,
459 BFI_MSGQ_I2H_DOORBELL = 2,
460};
461
462
463/* Messages(commands/responsed/AENS will have the following header */
464struct bfi_msgq_mhdr_s {
465 u8 msg_class;
466 u8 msg_id;
467 u16 msg_token;
468 u16 num_entries;
469 u8 enet_id;
470 u8 rsvd[1];
471};
472
473#define bfi_msgq_mhdr_set(_mh, _mc, _mid, _tok, _enet_id) do { \
474 (_mh).msg_class = (_mc); \
475 (_mh).msg_id = (_mid); \
476 (_mh).msg_token = (_tok); \
477 (_mh).enet_id = (_enet_id); \
478} while (0)
479
480/*
481 * Mailbox for messaging interface
482 *
483*/
484#define BFI_MSGQ_CMD_ENTRY_SIZE (64) /* TBD */
485#define BFI_MSGQ_RSP_ENTRY_SIZE (64) /* TBD */
486#define BFI_MSGQ_MSG_SIZE_MAX (2048) /* TBD */
487
488struct bfi_msgq_s {
489 union bfi_addr_u addr;
490 u16 q_depth; /* Total num of entries in the queue */
491 u8 rsvd[2];
492};
493
494/* BFI_ENET_MSGQ_CFG_REQ TBD init or cfg? */
495struct bfi_msgq_cfg_req_s {
496 struct bfi_mhdr_s mh;
497 struct bfi_msgq_s cmdq;
498 struct bfi_msgq_s rspq;
499};
500
501/* BFI_ENET_MSGQ_CFG_RSP */
502struct bfi_msgq_cfg_rsp_s {
503 struct bfi_mhdr_s mh;
504 u8 cmd_status;
505 u8 rsvd[3];
506};
507
508
509/* BFI_MSGQ_H2I_DOORBELL */
510struct bfi_msgq_h2i_db_s {
511 struct bfi_mhdr_s mh;
512 u16 cmdq_pi;
513 u16 rspq_ci;
514};
515
516/* BFI_MSGQ_I2H_DOORBELL */
517struct bfi_msgq_i2h_db_s {
518 struct bfi_mhdr_s mh;
519 u16 rspq_pi;
520 u16 cmdq_ci;
521};
522
523#pragma pack()
524
525/* BFI port specific */
526#pragma pack(1)
527
528enum bfi_port_h2i {
529 BFI_PORT_H2I_ENABLE_REQ = (1),
530 BFI_PORT_H2I_DISABLE_REQ = (2),
531 BFI_PORT_H2I_GET_STATS_REQ = (3),
532 BFI_PORT_H2I_CLEAR_STATS_REQ = (4),
533};
534
535enum bfi_port_i2h {
536 BFI_PORT_I2H_ENABLE_RSP = BFA_I2HM(1),
537 BFI_PORT_I2H_DISABLE_RSP = BFA_I2HM(2),
538 BFI_PORT_I2H_GET_STATS_RSP = BFA_I2HM(3),
539 BFI_PORT_I2H_CLEAR_STATS_RSP = BFA_I2HM(4),
540};
541
Jing Huangacdc79a2010-10-18 17:15:55 -0700542/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700543 * Generic REQ type
544 */
545struct bfi_port_generic_req_s {
546 struct bfi_mhdr_s mh; /* msg header */
547 u32 msgtag; /* msgtag for reply */
548 u32 rsvd;
549};
550
Jing Huangacdc79a2010-10-18 17:15:55 -0700551/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700552 * Generic RSP type
553 */
554struct bfi_port_generic_rsp_s {
555 struct bfi_mhdr_s mh; /* common msg header */
556 u8 status; /* port enable status */
557 u8 rsvd[3];
558 u32 msgtag; /* msgtag for reply */
559};
560
Jing Huangacdc79a2010-10-18 17:15:55 -0700561/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700562 * BFI_PORT_H2I_GET_STATS_REQ
563 */
564struct bfi_port_get_stats_req_s {
565 struct bfi_mhdr_s mh; /* common msg header */
566 union bfi_addr_u dma_addr;
567};
568
569union bfi_port_h2i_msg_u {
570 struct bfi_mhdr_s mh;
571 struct bfi_port_generic_req_s enable_req;
572 struct bfi_port_generic_req_s disable_req;
573 struct bfi_port_get_stats_req_s getstats_req;
574 struct bfi_port_generic_req_s clearstats_req;
575};
576
577union bfi_port_i2h_msg_u {
578 struct bfi_mhdr_s mh;
579 struct bfi_port_generic_rsp_s enable_rsp;
580 struct bfi_port_generic_rsp_s disable_rsp;
581 struct bfi_port_generic_rsp_s getstats_rsp;
582 struct bfi_port_generic_rsp_s clearstats_rsp;
583};
584
585#pragma pack()
586
587#endif /* __BFI_H__ */