1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2014 QLogic Corporation
* The contents of this file are subject to the terms of the
* QLogic End User License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the License at
* http://www.qlogic.com/Resources/Documents/DriverDownloadHelp/
* QLogic_End_User_Software_License.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*/
#ifndef __BNXE_BINDING_H
#define __BNXE_BINDING_H
#include "bcmtype.h"
#include "mac_drv_info.h"
#define BNXE_BINDING_VERSION \
((MAJVERSION << 16) | (MINVERSION << 8) | (REVVERSION << 0))
/* cb_ioctl commands sent to bnxe */
#define BNXE_BIND_FCOE 0x0ead0001
#define BNXE_UNBIND_FCOE 0x0ead0002
/* default FCoE max exchanges is 4096 for SF and 2048 for MF */
#define FCOE_MAX_EXCHANGES_SF 4096
#define FCOE_MAX_EXCHANGES_MF 2048
#ifndef BNXE_FCOE_WWN_SIZE
#define BNXE_FCOE_WWN_SIZE 8
#endif
typedef struct bnxe_wwn_info
{
uint32_t fcp_pwwn_provided;
uint8_t fcp_pwwn[BNXE_FCOE_WWN_SIZE];
uint32_t fcp_nwwn_provided;
uint8_t fcp_nwwn[BNXE_FCOE_WWN_SIZE];
} BnxeWwnInfo;
#define FCOE_INFO_FLAG_FORCE_LOAD 0x1
#define FCOE_INFO_FLAG_MF_MODE_MASK 0x6 /* bits 2-3 */
#define FCOE_INFO_FLAG_MF_MODE_SF 0x0 /* single function */
#define FCOE_INFO_FLAG_MF_MODE_SD 0x2 /* switch dependent (vlan based) */
#define FCOE_INFO_FLAG_MF_MODE_SI 0x4 /* switch independent (mac based) */
#define FCOE_INFO_FLAG_MF_MODE_AFEX 0x6 /* switch dependent (afex based) */
#define FCOE_INFO_IS_MF_MODE_SF(flags) \
(((flags) & FCOE_INFO_FLAG_MF_MODE_MASK) == FCOE_INFO_FLAG_MF_MODE_SF)
#define FCOE_INFO_IS_MF_MODE_SD(flags) \
(((flags) & FCOE_INFO_FLAG_MF_MODE_MASK) == FCOE_INFO_FLAG_MF_MODE_SD)
#define FCOE_INFO_IS_MF_MODE_SI(flags) \
(((flags) & FCOE_INFO_FLAG_MF_MODE_MASK) == FCOE_INFO_FLAG_MF_MODE_SI)
#define FCOE_INFO_IS_MF_MODE_AFEX(flags) \
(((flags) & FCOE_INFO_FLAG_MF_MODE_MASK) == FCOE_INFO_FLAG_MF_MODE_AFEX)
typedef struct bnxe_fcoe_info
{
u32_t flags;
u32_t max_fcoe_conn;
u32_t max_fcoe_exchanges;
BnxeWwnInfo wwn;
} BnxeFcoeInfo;
typedef struct bnxe_fcoe_caps
{
struct fcoe_capabilities fcoe_caps;
} BnxeFcoeCaps;
/*
* cli_ctl - misc control interface up to the client
*
* cmd: CLI_CTL_LINK_UP - link up event, no data passed
* CLI_CTL_LINK_DOWN - link down event, no data passed
* CLI_CTL_UNLOAD - graceful unload event, no data passed
*
* pData: pointer to command data or NULL
*
* dataLen: length of command data or 0
*/
#define CLI_CTL_LINK_UP 1
#define CLI_CTL_LINK_DOWN 2
#define CLI_CTL_UNLOAD 3
typedef boolean_t (*cli_ctl)(dev_info_t * pDev,
int cmd,
void * pData,
int dataLen);
typedef boolean_t (*cli_indicate_tx)(dev_info_t * pDev,
mblk_t * pMblk);
typedef boolean_t (*cli_indicate_rx)(dev_info_t * pDev,
mblk_t * pMblk);
typedef boolean_t (*cli_indicate_cqes)(dev_info_t * pDev,
void * cqes[],
int cqeCnt);
/*
* prv_ctl - misc control interface down to the provider
*
* cmd: PRV_CTL_GET_MAC_ADDR - get MAC Address, pass data buffer to hold addr
* PRV_CTL_SET_MAC_ADDR - set MAC Address, pass data buffer contains addr
* PRV_CTL_QUERY_PARAMS - query related params, pass BnxeXXXInfo struct
* PRV_CTL_DISABLE_INTR - disable interrupts, no data passed
* PRV_CTL_ENABLE_INTR - enable interrupts, no data passed
* PRV_CTL_MBA_BOOT - check if MBA performed network boot
* PRV_CTL_LINK_STATE - query the link state, pass boolean buffer
* PRV_CTL_BOARD_TYPE - query the board type, pass string buffer
* PRV_CTL_BOARD_SERNUM - query the board's serial number, pass string buffer
* PRV_CTL_BOOTCODE_VERSION - query the MFW bootcode version, pass string buffer
* PRV_CTL_REPORT_FCOE_STATS - report FCoE stats, pass filled in fcoe_stats_info_t
* PRV_CTL_SET_CAPS - report FCoE capabilities, pass filled in BnxeFcoeCaps struct
*
* pData: pointer to command data or NULL
*
* dataLen: length of command data or 0
*
* returns: TRUE upon success, FALSE otherwise
*/
#define PRV_CTL_GET_MAC_ADDR 1
#define PRV_CTL_SET_MAC_ADDR 2
#define PRV_CTL_QUERY_PARAMS 3
#define PRV_CTL_DISABLE_INTR 4
#define PRV_CTL_ENABLE_INTR 5
#define PRV_CTL_MBA_BOOT 6
#define PRV_CTL_LINK_STATE 7
#define PRV_CTL_BOARD_TYPE 8
#define PRV_CTL_BOARD_SERNUM 9
#define PRV_CTL_BOOTCODE_VERSION 10
#define PRV_CTL_REPORT_FCOE_STATS 11
#define PRV_CTL_SET_CAPS 12
typedef boolean_t (*prv_ctl)(dev_info_t * pDev,
int cmd,
void * pData,
int dataLen);
#define PRV_TX_VLAN_TAG 1
typedef mblk_t * (*prv_tx)(dev_info_t * pDev,
mblk_t * pMblk,
u32_t flags,
u16_t vlan_tag);
typedef boolean_t (*prv_poll)(dev_info_t * pDev);
typedef boolean_t (*prv_send_wqes)(dev_info_t * pDev,
void * wqes[],
int wqeCnt);
typedef boolean_t (*prv_map_mailboxq)(dev_info_t * pDev,
u32_t cid,
void ** ppMap,
ddi_acc_handle_t * pAccHandle);
typedef boolean_t (*prv_unmap_mailboxq)(dev_info_t * pDev,
u32_t cid,
void * pMap,
ddi_acc_handle_t accHandle);
typedef struct bnxe_binding
{
u32_t version;
dev_info_t * pCliDev; /* bnxe client */
cli_ctl cliCtl;
cli_indicate_tx cliIndicateTx;
cli_indicate_rx cliIndicateRx;
cli_indicate_cqes cliIndicateCqes;
u32_t numRxDescs;
u32_t numTxDescs;
dev_info_t * pPrvDev; /* bnxe */
prv_ctl prvCtl;
prv_tx prvTx;
prv_poll prvPoll;
prv_send_wqes prvSendWqes;
prv_map_mailboxq prvMapMailboxq;
prv_unmap_mailboxq prvUnmapMailboxq;
} BnxeBinding;
#endif /* __BNXE_BINDING_H */
|