blob: 49f558fc2375a8d63969c5eaefe7ee8d1a3633bf [file] [log] [blame]
Krishna Gudipatib85daaf2011-06-13 15:55:11 -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#ifndef BFAD_BSG_H
18#define BFAD_BSG_H
19
20#include "bfa_defs.h"
21#include "bfa_defs_fcs.h"
22
23/* Definitions of vendor unique structures and command codes passed in
24 * using FC_BSG_HST_VENDOR message code.
25 */
26enum {
27 IOCMD_IOC_GET_ATTR = 0x1,
28 IOCMD_IOC_GET_INFO,
29 IOCMD_PORT_GET_ATTR,
30 IOCMD_LPORT_GET_ATTR,
31 IOCMD_RPORT_GET_ADDR,
32 IOCMD_FABRIC_GET_LPORTS,
33 IOCMD_ITNIM_GET_ATTR,
Krishna Gudipati1a4d8e12011-06-24 20:22:28 -070034 IOCMD_IOC_PCIFN_CFG,
35 IOCMD_PCIFN_CREATE,
36 IOCMD_PCIFN_DELETE,
37 IOCMD_PCIFN_BW,
38 IOCMD_ADAPTER_CFG_MODE,
39 IOCMD_PORT_CFG_MODE,
40 IOCMD_FLASH_ENABLE_OPTROM,
41 IOCMD_FLASH_DISABLE_OPTROM,
Krishna Gudipatia7141342011-06-24 20:23:19 -070042 IOCMD_FAA_ENABLE,
43 IOCMD_FAA_DISABLE,
44 IOCMD_FAA_QUERY,
Krishna Gudipati1a4d8e12011-06-24 20:22:28 -070045};
46
47struct bfa_bsg_gen_s {
48 bfa_status_t status;
49 u16 bfad_num;
50 u16 rsvd;
Krishna Gudipatib85daaf2011-06-13 15:55:11 -070051};
52
53struct bfa_bsg_ioc_info_s {
54 bfa_status_t status;
55 u16 bfad_num;
56 u16 rsvd;
57 char serialnum[64];
58 char hwpath[BFA_STRING_32];
59 char adapter_hwpath[BFA_STRING_32];
60 char guid[BFA_ADAPTER_SYM_NAME_LEN*2];
61 char name[BFA_ADAPTER_SYM_NAME_LEN];
62 char port_name[BFA_ADAPTER_SYM_NAME_LEN];
63 char eth_name[BFA_ADAPTER_SYM_NAME_LEN];
64 wwn_t pwwn;
65 wwn_t nwwn;
66 wwn_t factorypwwn;
67 wwn_t factorynwwn;
68 mac_t mac;
69 mac_t factory_mac; /* Factory mac address */
70 mac_t current_mac; /* Currently assigned mac address */
71 enum bfa_ioc_type_e ioc_type;
72 u16 pvid; /* Port vlan id */
73 u16 rsvd1;
74 u32 host;
75 u32 bandwidth; /* For PF support */
76 u32 rsvd2;
77};
78
79struct bfa_bsg_ioc_attr_s {
80 bfa_status_t status;
81 u16 bfad_num;
82 u16 rsvd;
83 struct bfa_ioc_attr_s ioc_attr;
84};
85
86struct bfa_bsg_port_attr_s {
87 bfa_status_t status;
88 u16 bfad_num;
89 u16 rsvd;
90 struct bfa_port_attr_s attr;
91};
92
93struct bfa_bsg_lport_attr_s {
94 bfa_status_t status;
95 u16 bfad_num;
96 u16 vf_id;
97 wwn_t pwwn;
98 struct bfa_lport_attr_s port_attr;
99};
100
101struct bfa_bsg_rport_scsi_addr_s {
102 bfa_status_t status;
103 u16 bfad_num;
104 u16 vf_id;
105 wwn_t pwwn;
106 wwn_t rpwwn;
107 u32 host;
108 u32 bus;
109 u32 target;
110 u32 lun;
111};
112
113struct bfa_bsg_fabric_get_lports_s {
114 bfa_status_t status;
115 u16 bfad_num;
116 u16 vf_id;
117 u64 buf_ptr;
118 u32 nports;
119 u32 rsvd;
120};
121
122struct bfa_bsg_itnim_attr_s {
123 bfa_status_t status;
124 u16 bfad_num;
125 u16 vf_id;
126 wwn_t lpwwn;
127 wwn_t rpwwn;
128 struct bfa_itnim_attr_s attr;
129};
130
Krishna Gudipati1a4d8e12011-06-24 20:22:28 -0700131struct bfa_bsg_pcifn_cfg_s {
132 bfa_status_t status;
133 u16 bfad_num;
134 u16 rsvd;
135 struct bfa_ablk_cfg_s pcifn_cfg;
136};
137
138struct bfa_bsg_pcifn_s {
139 bfa_status_t status;
140 u16 bfad_num;
141 u16 pcifn_id;
142 u32 bandwidth;
143 u8 port;
144 enum bfi_pcifn_class pcifn_class;
145 u8 rsvd[1];
146};
147
148struct bfa_bsg_adapter_cfg_mode_s {
149 bfa_status_t status;
150 u16 bfad_num;
151 u16 rsvd;
152 struct bfa_adapter_cfg_mode_s cfg;
153};
154
155struct bfa_bsg_port_cfg_mode_s {
156 bfa_status_t status;
157 u16 bfad_num;
158 u16 instance;
159 struct bfa_port_cfg_mode_s cfg;
160};
161
Krishna Gudipatia7141342011-06-24 20:23:19 -0700162struct bfa_bsg_faa_attr_s {
163 bfa_status_t status;
164 u16 bfad_num;
165 u16 rsvd;
166 struct bfa_faa_attr_s faa_attr;
167};
168
Krishna Gudipatib85daaf2011-06-13 15:55:11 -0700169struct bfa_bsg_fcpt_s {
170 bfa_status_t status;
171 u16 vf_id;
172 wwn_t lpwwn;
173 wwn_t dpwwn;
174 u32 tsecs;
175 int cts;
176 enum fc_cos cos;
177 struct fchs_s fchs;
178};
179#define bfa_bsg_fcpt_t struct bfa_bsg_fcpt_s
180
181struct bfa_bsg_data {
182 int payload_len;
183 void *payload;
184};
185
186#define bfad_chk_iocmd_sz(__payload_len, __hdrsz, __bufsz) \
187 (((__payload_len) != ((__hdrsz) + (__bufsz))) ? \
188 BFA_STATUS_FAILED : BFA_STATUS_OK)
189
190#endif /* BFAD_BSG_H */