blob: fda3e8851e1724d558ba6fca16ed28d9a2a6376b [file] [log] [blame]
Sathya Perla6b7c5b92009-03-11 23:32:03 -07001/*
Vasundhara Volam40263822014-02-12 16:09:07 +05302 * Copyright (C) 2005 - 2014 Emulex
Sathya Perla6b7c5b92009-03-11 23:32:03 -07003 * All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License version 2
7 * as published by the Free Software Foundation. The full GNU General
8 * Public License is included in this distribution in the file called COPYING.
9 *
10 * Contact Information:
Ajit Khaparded2145cd2011-03-16 08:20:46 +000011 * linux-drivers@emulex.com
Sathya Perla6b7c5b92009-03-11 23:32:03 -070012 *
Ajit Khaparded2145cd2011-03-16 08:20:46 +000013 * Emulex
14 * 3333 Susan Street
15 * Costa Mesa, CA 92626
Sathya Perla6b7c5b92009-03-11 23:32:03 -070016 */
17
18/*
19 * The driver sends configuration and managements command requests to the
20 * firmware in the BE. These requests are communicated to the processor
21 * using Work Request Blocks (WRBs) submitted to the MCC-WRB ring or via one
22 * WRB inside a MAILBOX.
23 * The commands are serviced by the ARM processor in the BladeEngine's MPU.
24 */
25
26struct be_sge {
27 u32 pa_lo;
28 u32 pa_hi;
29 u32 len;
30};
31
32#define MCC_WRB_EMBEDDED_MASK 1 /* bit 0 of dword 0*/
33#define MCC_WRB_SGE_CNT_SHIFT 3 /* bits 3 - 7 of dword 0 */
34#define MCC_WRB_SGE_CNT_MASK 0x1F /* bits 3 - 7 of dword 0 */
35struct be_mcc_wrb {
36 u32 embedded; /* dword 0 */
37 u32 payload_length; /* dword 1 */
38 u32 tag0; /* dword 2 */
39 u32 tag1; /* dword 3 */
40 u32 rsvd; /* dword 4 */
41 union {
42 u8 embedded_payload[236]; /* used by embedded cmds */
43 struct be_sge sgl[19]; /* used by non-embedded cmds */
44 } payload;
45};
46
47#define CQE_FLAGS_VALID_MASK (1 << 31)
48#define CQE_FLAGS_ASYNC_MASK (1 << 30)
49#define CQE_FLAGS_COMPLETED_MASK (1 << 28)
50#define CQE_FLAGS_CONSUMED_MASK (1 << 27)
51
52/* Completion Status */
53enum {
Sathya Perla2b3f2912011-06-29 23:32:56 +000054 MCC_STATUS_SUCCESS = 0,
55 MCC_STATUS_FAILED = 1,
56 MCC_STATUS_ILLEGAL_REQUEST = 2,
57 MCC_STATUS_ILLEGAL_FIELD = 3,
58 MCC_STATUS_INSUFFICIENT_BUFFER = 4,
59 MCC_STATUS_UNAUTHORIZED_REQUEST = 5,
Ajit Khaparde49643842009-10-05 02:22:05 +000060 MCC_STATUS_NOT_SUPPORTED = 66
Sathya Perla6b7c5b92009-03-11 23:32:03 -070061};
62
Ajit Khaparded9d604f2013-09-27 15:17:58 -050063#define MCC_ADDL_STS_INSUFFICIENT_RESOURCES 0x16
64
Sathya Perla6b7c5b92009-03-11 23:32:03 -070065#define CQE_STATUS_COMPL_MASK 0xFFFF
66#define CQE_STATUS_COMPL_SHIFT 0 /* bits 0 - 15 */
67#define CQE_STATUS_EXTD_MASK 0xFFFF
Sathya Perlaf5209b42009-11-06 00:31:01 -080068#define CQE_STATUS_EXTD_SHIFT 16 /* bits 16 - 31 */
Sathya Perla6b7c5b92009-03-11 23:32:03 -070069
Sathya Perlaefd2e402009-07-27 22:53:10 +000070struct be_mcc_compl {
Sathya Perla6b7c5b92009-03-11 23:32:03 -070071 u32 status; /* dword 0 */
72 u32 tag0; /* dword 1 */
73 u32 tag1; /* dword 2 */
74 u32 flags; /* dword 3 */
75};
76
Sathya Perlaa8f447bd2009-06-18 00:10:27 +000077/* When the async bit of mcc_compl is set, the last 4 bytes of
78 * mcc_compl is interpreted as follows:
79 */
80#define ASYNC_TRAILER_EVENT_CODE_SHIFT 8 /* bits 8 - 15 */
81#define ASYNC_TRAILER_EVENT_CODE_MASK 0xFF
Somnath Koturcc4ce022010-10-21 07:11:14 -070082#define ASYNC_TRAILER_EVENT_TYPE_SHIFT 16
83#define ASYNC_TRAILER_EVENT_TYPE_MASK 0xFF
Sathya Perlaa8f447bd2009-06-18 00:10:27 +000084#define ASYNC_EVENT_CODE_LINK_STATE 0x1
Somnath Koturcc4ce022010-10-21 07:11:14 -070085#define ASYNC_EVENT_CODE_GRP_5 0x5
86#define ASYNC_EVENT_QOS_SPEED 0x1
87#define ASYNC_EVENT_COS_PRIORITY 0x2
Ajit Khaparde3968fa12011-02-20 11:41:53 +000088#define ASYNC_EVENT_PVID_STATE 0x3
Ajit Khapardebc0c3402013-04-24 11:52:50 +000089#define ASYNC_EVENT_CODE_QNQ 0x6
90#define ASYNC_DEBUG_EVENT_TYPE_QNQ 1
91
Sathya Perlaa8f447bd2009-06-18 00:10:27 +000092struct be_async_event_trailer {
93 u32 code;
94};
95
96enum {
Sathya Perlaea172a02011-08-02 19:57:42 +000097 LINK_DOWN = 0x0,
98 LINK_UP = 0x1
Sathya Perlaa8f447bd2009-06-18 00:10:27 +000099};
Sathya Perlaea172a02011-08-02 19:57:42 +0000100#define LINK_STATUS_MASK 0x1
Padmanabh Ratnakar2e177a52012-07-18 02:52:15 +0000101#define LOGICAL_LINK_STATUS_MASK 0x2
Sathya Perlaa8f447bd2009-06-18 00:10:27 +0000102
103/* When the event code of an async trailer is link-state, the mcc_compl
104 * must be interpreted as follows
105 */
106struct be_async_event_link_state {
107 u8 physical_port;
108 u8 port_link_status;
109 u8 port_duplex;
110 u8 port_speed;
111 u8 port_fault;
112 u8 rsvd0[7];
113 struct be_async_event_trailer trailer;
114} __packed;
115
Somnath Koturcc4ce022010-10-21 07:11:14 -0700116/* When the event code of an async trailer is GRP-5 and event_type is QOS_SPEED
117 * the mcc_compl must be interpreted as follows
118 */
119struct be_async_event_grp5_qos_link_speed {
120 u8 physical_port;
121 u8 rsvd[5];
122 u16 qos_link_speed;
123 u32 event_tag;
124 struct be_async_event_trailer trailer;
125} __packed;
126
127/* When the event code of an async trailer is GRP5 and event type is
128 * CoS-Priority, the mcc_compl must be interpreted as follows
129 */
130struct be_async_event_grp5_cos_priority {
131 u8 physical_port;
132 u8 available_priority_bmap;
133 u8 reco_default_priority;
134 u8 valid;
135 u8 rsvd0;
136 u8 event_tag;
137 struct be_async_event_trailer trailer;
138} __packed;
139
Ajit Khaparde3968fa12011-02-20 11:41:53 +0000140/* When the event code of an async trailer is GRP5 and event type is
141 * PVID state, the mcc_compl must be interpreted as follows
142 */
143struct be_async_event_grp5_pvid_state {
144 u8 enabled;
145 u8 rsvd0;
146 u16 tag;
147 u32 event_tag;
148 u32 rsvd1;
149 struct be_async_event_trailer trailer;
150} __packed;
151
Ajit Khapardebc0c3402013-04-24 11:52:50 +0000152/* async event indicating outer VLAN tag in QnQ */
153struct be_async_event_qnq {
154 u8 valid; /* Indicates if outer VLAN is valid */
155 u8 rsvd0;
156 u16 vlan_tag;
157 u32 event_tag;
158 u8 rsvd1[4];
159 struct be_async_event_trailer trailer;
160} __packed;
161
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700162struct be_mcc_mailbox {
163 struct be_mcc_wrb wrb;
Sathya Perlaefd2e402009-07-27 22:53:10 +0000164 struct be_mcc_compl compl;
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700165};
166
167#define CMD_SUBSYSTEM_COMMON 0x1
168#define CMD_SUBSYSTEM_ETH 0x3
Suresh Rff33a6e2009-12-03 16:15:52 -0800169#define CMD_SUBSYSTEM_LOWLEVEL 0xb
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700170
171#define OPCODE_COMMON_NTWK_MAC_QUERY 1
172#define OPCODE_COMMON_NTWK_MAC_SET 2
173#define OPCODE_COMMON_NTWK_MULTICAST_SET 3
174#define OPCODE_COMMON_NTWK_VLAN_CONFIG 4
175#define OPCODE_COMMON_NTWK_LINK_STATUS_QUERY 5
Sarveshwar Bandifa9a6fe2009-11-20 14:23:47 -0800176#define OPCODE_COMMON_READ_FLASHROM 6
Ajit Khaparde84517482009-09-04 03:12:16 +0000177#define OPCODE_COMMON_WRITE_FLASHROM 7
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700178#define OPCODE_COMMON_CQ_CREATE 12
179#define OPCODE_COMMON_EQ_CREATE 13
Somnath Koturcc4ce022010-10-21 07:11:14 -0700180#define OPCODE_COMMON_MCC_CREATE 21
Ajit Khapardee1d18732010-07-23 01:52:13 +0000181#define OPCODE_COMMON_SET_QOS 28
Somnath Koturcc4ce022010-10-21 07:11:14 -0700182#define OPCODE_COMMON_MCC_CREATE_EXT 90
Sarveshwar Bandi368c0ca2010-01-08 00:07:27 -0800183#define OPCODE_COMMON_SEEPROM_READ 30
Ajit Khaparde9e1453c2011-02-20 11:42:22 +0000184#define OPCODE_COMMON_GET_CNTL_ATTRIBUTES 32
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700185#define OPCODE_COMMON_NTWK_RX_FILTER 34
186#define OPCODE_COMMON_GET_FW_VERSION 35
187#define OPCODE_COMMON_SET_FLOW_CONTROL 36
188#define OPCODE_COMMON_GET_FLOW_CONTROL 37
189#define OPCODE_COMMON_SET_FRAME_SIZE 39
190#define OPCODE_COMMON_MODIFY_EQ_DELAY 41
191#define OPCODE_COMMON_FIRMWARE_CONFIG 42
192#define OPCODE_COMMON_NTWK_INTERFACE_CREATE 50
193#define OPCODE_COMMON_NTWK_INTERFACE_DESTROY 51
Sathya Perla5fb379e2009-06-18 00:02:59 +0000194#define OPCODE_COMMON_MCC_DESTROY 53
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700195#define OPCODE_COMMON_CQ_DESTROY 54
196#define OPCODE_COMMON_EQ_DESTROY 55
197#define OPCODE_COMMON_QUERY_FIRMWARE_CONFIG 58
198#define OPCODE_COMMON_NTWK_PMAC_ADD 59
199#define OPCODE_COMMON_NTWK_PMAC_DEL 60
sarveshwarb14074ea2009-08-05 13:05:24 -0700200#define OPCODE_COMMON_FUNCTION_RESET 61
Somnath Kotur311fddc2011-03-16 21:22:43 +0000201#define OPCODE_COMMON_MANAGE_FAT 68
Sarveshwar Bandifad9ab22009-10-12 04:23:15 -0700202#define OPCODE_COMMON_ENABLE_DISABLE_BEACON 69
203#define OPCODE_COMMON_GET_BEACON_STATE 70
Sarveshwar Bandi0388f252009-10-28 04:15:20 -0700204#define OPCODE_COMMON_READ_TRANSRECV_DATA 73
Padmanabh Ratnakarb4e32a72012-07-12 03:57:35 +0000205#define OPCODE_COMMON_GET_PORT_NAME 77
Suresh Reddybdce2ad2014-03-11 18:53:04 +0530206#define OPCODE_COMMON_SET_LOGICAL_LINK_CONFIG 80
Somnath Kotur68c45a22013-03-14 02:42:07 +0000207#define OPCODE_COMMON_SET_INTERRUPT_ENABLE 89
Sathya Perla04a06022013-07-23 15:25:00 +0530208#define OPCODE_COMMON_SET_FN_PRIVILEGES 100
Ajit Khapardeee3cb622010-07-01 03:51:00 +0000209#define OPCODE_COMMON_GET_PHY_DETAILS 102
Sathya Perla2e588f82011-03-11 02:49:26 +0000210#define OPCODE_COMMON_SET_DRIVER_FUNCTION_CAP 103
Ajit Khaparde609ff3b2011-02-20 11:42:07 +0000211#define OPCODE_COMMON_GET_CNTL_ADDITIONAL_ATTRIBUTES 121
Somnath Kotur941a77d2012-05-17 22:59:03 +0000212#define OPCODE_COMMON_GET_EXT_FAT_CAPABILITES 125
213#define OPCODE_COMMON_SET_EXT_FAT_CAPABILITES 126
Padmanabh Ratnakar590c3912011-11-25 05:47:26 +0000214#define OPCODE_COMMON_GET_MAC_LIST 147
215#define OPCODE_COMMON_SET_MAC_LIST 148
Ajit Khapardef1f3ee12012-03-18 06:23:41 +0000216#define OPCODE_COMMON_GET_HSW_CONFIG 152
Padmanabh Ratnakarabb93952012-10-20 06:01:41 +0000217#define OPCODE_COMMON_GET_FUNC_CONFIG 160
218#define OPCODE_COMMON_GET_PROFILE_CONFIG 164
Padmanabh Ratnakard5c18472012-10-20 06:01:53 +0000219#define OPCODE_COMMON_SET_PROFILE_CONFIG 165
Vasundhara Volam542963b2014-01-15 13:23:33 +0530220#define OPCODE_COMMON_GET_ACTIVE_PROFILE 167
Ajit Khapardef1f3ee12012-03-18 06:23:41 +0000221#define OPCODE_COMMON_SET_HSW_CONFIG 153
Padmanabh Ratnakarf25b1192012-10-20 06:02:52 +0000222#define OPCODE_COMMON_GET_FN_PRIVILEGES 170
Padmanabh Ratnakarde49bd52011-11-16 02:02:43 +0000223#define OPCODE_COMMON_READ_OBJECT 171
Shripad Nunjundarao485bf562011-05-16 07:36:59 +0000224#define OPCODE_COMMON_WRITE_OBJECT 172
Sathya Perla4c876612013-02-03 20:30:11 +0000225#define OPCODE_COMMON_GET_IFACE_LIST 194
Padmanabh Ratnakardcf7ebb2012-10-20 06:03:49 +0000226#define OPCODE_COMMON_ENABLE_DISABLE_VF 196
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700227
Sathya Perla3abcded2010-10-03 22:12:27 -0700228#define OPCODE_ETH_RSS_CONFIG 1
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700229#define OPCODE_ETH_ACPI_CONFIG 2
230#define OPCODE_ETH_PROMISCUOUS 3
231#define OPCODE_ETH_GET_STATISTICS 4
232#define OPCODE_ETH_TX_CREATE 7
233#define OPCODE_ETH_RX_CREATE 8
234#define OPCODE_ETH_TX_DESTROY 9
235#define OPCODE_ETH_RX_DESTROY 10
Ajit Khaparde71d8d1b2009-12-03 06:16:59 +0000236#define OPCODE_ETH_ACPI_WOL_MAGIC_CONFIG 12
Selvin Xavier005d5692011-05-16 07:36:35 +0000237#define OPCODE_ETH_GET_PPORT_STATS 18
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700238
Suresh Rff33a6e2009-12-03 16:15:52 -0800239#define OPCODE_LOWLEVEL_HOST_DDR_DMA 17
240#define OPCODE_LOWLEVEL_LOOPBACK_TEST 18
Sarveshwar Bandifced9992009-12-23 04:41:44 +0000241#define OPCODE_LOWLEVEL_SET_LOOPBACK_MODE 19
Suresh Rff33a6e2009-12-03 16:15:52 -0800242
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700243struct be_cmd_req_hdr {
244 u8 opcode; /* dword 0 */
245 u8 subsystem; /* dword 0 */
246 u8 port_number; /* dword 0 */
247 u8 domain; /* dword 0 */
248 u32 timeout; /* dword 1 */
249 u32 request_length; /* dword 2 */
Ajit Khaparde7b139c82010-01-27 21:56:44 +0000250 u8 version; /* dword 3 */
251 u8 rsvd[3]; /* dword 3 */
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700252};
253
254#define RESP_HDR_INFO_OPCODE_SHIFT 0 /* bits 0 - 7 */
255#define RESP_HDR_INFO_SUBSYS_SHIFT 8 /* bits 8 - 15 */
256struct be_cmd_resp_hdr {
Padmanabh Ratnakar652bf642012-04-25 01:47:03 +0000257 u8 opcode; /* dword 0 */
258 u8 subsystem; /* dword 0 */
259 u8 rsvd[2]; /* dword 0 */
260 u8 status; /* dword 1 */
261 u8 add_status; /* dword 1 */
262 u8 rsvd1[2]; /* dword 1 */
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700263 u32 response_length; /* dword 2 */
264 u32 actual_resp_len; /* dword 3 */
265};
266
267struct phys_addr {
268 u32 lo;
269 u32 hi;
270};
271
272/**************************
273 * BE Command definitions *
274 **************************/
275
276/* Pseudo amap definition in which each bit of the actual structure is defined
277 * as a byte: used to calculate offset/shift/mask of each field */
278struct amap_eq_context {
279 u8 cidx[13]; /* dword 0*/
280 u8 rsvd0[3]; /* dword 0*/
281 u8 epidx[13]; /* dword 0*/
282 u8 valid; /* dword 0*/
283 u8 rsvd1; /* dword 0*/
284 u8 size; /* dword 0*/
285 u8 pidx[13]; /* dword 1*/
286 u8 rsvd2[3]; /* dword 1*/
287 u8 pd[10]; /* dword 1*/
288 u8 count[3]; /* dword 1*/
289 u8 solevent; /* dword 1*/
290 u8 stalled; /* dword 1*/
291 u8 armed; /* dword 1*/
292 u8 rsvd3[4]; /* dword 2*/
293 u8 func[8]; /* dword 2*/
294 u8 rsvd4; /* dword 2*/
295 u8 delaymult[10]; /* dword 2*/
296 u8 rsvd5[2]; /* dword 2*/
297 u8 phase[2]; /* dword 2*/
298 u8 nodelay; /* dword 2*/
299 u8 rsvd6[4]; /* dword 2*/
300 u8 rsvd7[32]; /* dword 3*/
301} __packed;
302
303struct be_cmd_req_eq_create {
304 struct be_cmd_req_hdr hdr;
305 u16 num_pages; /* sword */
306 u16 rsvd0; /* sword */
307 u8 context[sizeof(struct amap_eq_context) / 8];
308 struct phys_addr pages[8];
309} __packed;
310
311struct be_cmd_resp_eq_create {
312 struct be_cmd_resp_hdr resp_hdr;
313 u16 eq_id; /* sword */
Sathya Perlaf2f781a2013-08-27 16:57:30 +0530314 u16 msix_idx; /* available only in v2 */
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700315} __packed;
316
317/******************** Mac query ***************************/
318enum {
319 MAC_ADDRESS_TYPE_STORAGE = 0x0,
320 MAC_ADDRESS_TYPE_NETWORK = 0x1,
321 MAC_ADDRESS_TYPE_PD = 0x2,
322 MAC_ADDRESS_TYPE_MANAGEMENT = 0x3
323};
324
325struct mac_addr {
326 u16 size_of_struct;
327 u8 addr[ETH_ALEN];
328} __packed;
329
330struct be_cmd_req_mac_query {
331 struct be_cmd_req_hdr hdr;
332 u8 type;
333 u8 permanent;
334 u16 if_id;
Padmanabh Ratnakar590c3912011-11-25 05:47:26 +0000335 u32 pmac_id;
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700336} __packed;
337
338struct be_cmd_resp_mac_query {
339 struct be_cmd_resp_hdr hdr;
340 struct mac_addr mac;
341};
342
343/******************** PMac Add ***************************/
344struct be_cmd_req_pmac_add {
345 struct be_cmd_req_hdr hdr;
346 u32 if_id;
347 u8 mac_address[ETH_ALEN];
348 u8 rsvd0[2];
349} __packed;
350
351struct be_cmd_resp_pmac_add {
352 struct be_cmd_resp_hdr hdr;
353 u32 pmac_id;
354};
355
356/******************** PMac Del ***************************/
357struct be_cmd_req_pmac_del {
358 struct be_cmd_req_hdr hdr;
359 u32 if_id;
360 u32 pmac_id;
361};
362
363/******************** Create CQ ***************************/
364/* Pseudo amap definition in which each bit of the actual structure is defined
365 * as a byte: used to calculate offset/shift/mask of each field */
Sathya Perlafe6d2a32010-11-21 23:25:50 +0000366struct amap_cq_context_be {
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700367 u8 cidx[11]; /* dword 0*/
368 u8 rsvd0; /* dword 0*/
369 u8 coalescwm[2]; /* dword 0*/
370 u8 nodelay; /* dword 0*/
371 u8 epidx[11]; /* dword 0*/
372 u8 rsvd1; /* dword 0*/
373 u8 count[2]; /* dword 0*/
374 u8 valid; /* dword 0*/
375 u8 solevent; /* dword 0*/
376 u8 eventable; /* dword 0*/
377 u8 pidx[11]; /* dword 1*/
378 u8 rsvd2; /* dword 1*/
379 u8 pd[10]; /* dword 1*/
380 u8 eqid[8]; /* dword 1*/
381 u8 stalled; /* dword 1*/
382 u8 armed; /* dword 1*/
383 u8 rsvd3[4]; /* dword 2*/
384 u8 func[8]; /* dword 2*/
385 u8 rsvd4[20]; /* dword 2*/
386 u8 rsvd5[32]; /* dword 3*/
387} __packed;
388
Ajit Khapardebbdc42f2013-05-01 09:37:17 +0000389struct amap_cq_context_v2 {
Sathya Perlafe6d2a32010-11-21 23:25:50 +0000390 u8 rsvd0[12]; /* dword 0*/
391 u8 coalescwm[2]; /* dword 0*/
392 u8 nodelay; /* dword 0*/
393 u8 rsvd1[12]; /* dword 0*/
394 u8 count[2]; /* dword 0*/
395 u8 valid; /* dword 0*/
396 u8 rsvd2; /* dword 0*/
397 u8 eventable; /* dword 0*/
398 u8 eqid[16]; /* dword 1*/
399 u8 rsvd3[15]; /* dword 1*/
400 u8 armed; /* dword 1*/
401 u8 rsvd4[32]; /* dword 2*/
402 u8 rsvd5[32]; /* dword 3*/
403} __packed;
404
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700405struct be_cmd_req_cq_create {
406 struct be_cmd_req_hdr hdr;
407 u16 num_pages;
Sathya Perlafe6d2a32010-11-21 23:25:50 +0000408 u8 page_size;
409 u8 rsvd0;
410 u8 context[sizeof(struct amap_cq_context_be) / 8];
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700411 struct phys_addr pages[8];
412} __packed;
413
Sathya Perlafe6d2a32010-11-21 23:25:50 +0000414
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700415struct be_cmd_resp_cq_create {
416 struct be_cmd_resp_hdr hdr;
417 u16 cq_id;
418 u16 rsvd0;
419} __packed;
420
Somnath Kotur311fddc2011-03-16 21:22:43 +0000421struct be_cmd_req_get_fat {
422 struct be_cmd_req_hdr hdr;
423 u32 fat_operation;
424 u32 read_log_offset;
425 u32 read_log_length;
426 u32 data_buffer_size;
427 u32 data_buffer[1];
428} __packed;
429
430struct be_cmd_resp_get_fat {
431 struct be_cmd_resp_hdr hdr;
432 u32 log_size;
433 u32 read_log_length;
434 u32 rsvd[2];
435 u32 data_buffer[1];
436} __packed;
437
438
Sathya Perla5fb379e2009-06-18 00:02:59 +0000439/******************** Create MCCQ ***************************/
440/* Pseudo amap definition in which each bit of the actual structure is defined
441 * as a byte: used to calculate offset/shift/mask of each field */
Sathya Perlafe6d2a32010-11-21 23:25:50 +0000442struct amap_mcc_context_be {
Sathya Perla5fb379e2009-06-18 00:02:59 +0000443 u8 con_index[14];
444 u8 rsvd0[2];
445 u8 ring_size[4];
446 u8 fetch_wrb;
447 u8 fetch_r2t;
448 u8 cq_id[10];
449 u8 prod_index[14];
450 u8 fid[8];
451 u8 pdid[9];
452 u8 valid;
453 u8 rsvd1[32];
454 u8 rsvd2[32];
455} __packed;
456
Vasundhara Volam666d39c2014-01-15 13:23:31 +0530457struct amap_mcc_context_v1 {
Sathya Perlafe6d2a32010-11-21 23:25:50 +0000458 u8 async_cq_id[16];
459 u8 ring_size[4];
460 u8 rsvd0[12];
461 u8 rsvd1[31];
462 u8 valid;
463 u8 async_cq_valid[1];
464 u8 rsvd2[31];
465 u8 rsvd3[32];
466} __packed;
467
Sathya Perla5fb379e2009-06-18 00:02:59 +0000468struct be_cmd_req_mcc_create {
469 struct be_cmd_req_hdr hdr;
470 u16 num_pages;
Sathya Perlafe6d2a32010-11-21 23:25:50 +0000471 u16 cq_id;
Somnath Kotur34b1ef02011-06-01 00:33:22 +0000472 u8 context[sizeof(struct amap_mcc_context_be) / 8];
473 struct phys_addr pages[8];
474} __packed;
475
476struct be_cmd_req_mcc_ext_create {
477 struct be_cmd_req_hdr hdr;
478 u16 num_pages;
479 u16 cq_id;
Somnath Koturcc4ce022010-10-21 07:11:14 -0700480 u32 async_event_bitmap[1];
Vasundhara Volam666d39c2014-01-15 13:23:31 +0530481 u8 context[sizeof(struct amap_mcc_context_v1) / 8];
Sathya Perla5fb379e2009-06-18 00:02:59 +0000482 struct phys_addr pages[8];
483} __packed;
484
485struct be_cmd_resp_mcc_create {
486 struct be_cmd_resp_hdr hdr;
487 u16 id;
488 u16 rsvd0;
489} __packed;
490
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700491/******************** Create TxQ ***************************/
492#define BE_ETH_TX_RING_TYPE_STANDARD 2
493#define BE_ULP1_NUM 1
494
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700495struct be_cmd_req_eth_tx_create {
496 struct be_cmd_req_hdr hdr;
497 u8 num_pages;
498 u8 ulp_num;
Vasundhara Volam94d73aa2013-04-21 23:28:14 +0000499 u16 type;
500 u16 if_id;
501 u8 queue_size;
502 u8 rsvd0;
503 u32 rsvd1;
504 u16 cq_id;
505 u16 rsvd2;
506 u32 rsvd3[13];
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700507 struct phys_addr pages[8];
508} __packed;
509
510struct be_cmd_resp_eth_tx_create {
511 struct be_cmd_resp_hdr hdr;
512 u16 cid;
Vasundhara Volam94d73aa2013-04-21 23:28:14 +0000513 u16 rid;
514 u32 db_offset;
515 u32 rsvd0[4];
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700516} __packed;
517
518/******************** Create RxQ ***************************/
519struct be_cmd_req_eth_rx_create {
520 struct be_cmd_req_hdr hdr;
521 u16 cq_id;
522 u8 frag_size;
523 u8 num_pages;
524 struct phys_addr pages[2];
525 u32 interface_id;
526 u16 max_frame_size;
527 u16 rsvd0;
528 u32 rss_queue;
529} __packed;
530
531struct be_cmd_resp_eth_rx_create {
532 struct be_cmd_resp_hdr hdr;
533 u16 id;
Sathya Perla3abcded2010-10-03 22:12:27 -0700534 u8 rss_id;
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700535 u8 rsvd0;
536} __packed;
537
538/******************** Q Destroy ***************************/
539/* Type of Queue to be destroyed */
540enum {
541 QTYPE_EQ = 1,
542 QTYPE_CQ,
543 QTYPE_TXQ,
Sathya Perla5fb379e2009-06-18 00:02:59 +0000544 QTYPE_RXQ,
545 QTYPE_MCCQ
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700546};
547
548struct be_cmd_req_q_destroy {
549 struct be_cmd_req_hdr hdr;
550 u16 id;
551 u16 bypass_flush; /* valid only for rx q destroy */
552} __packed;
553
554/************ I/f Create (it's actually I/f Config Create)**********/
555
556/* Capability flags for the i/f */
557enum be_if_flags {
558 BE_IF_FLAGS_RSS = 0x4,
559 BE_IF_FLAGS_PROMISCUOUS = 0x8,
560 BE_IF_FLAGS_BROADCAST = 0x10,
561 BE_IF_FLAGS_UNTAGGED = 0x20,
562 BE_IF_FLAGS_ULP = 0x40,
563 BE_IF_FLAGS_VLAN_PROMISCUOUS = 0x80,
564 BE_IF_FLAGS_VLAN = 0x100,
565 BE_IF_FLAGS_MCAST_PROMISCUOUS = 0x200,
566 BE_IF_FLAGS_PASS_L2_ERRORS = 0x400,
Padmanabh Ratnakarf21b5382011-03-07 03:09:36 +0000567 BE_IF_FLAGS_PASS_L3L4_ERRORS = 0x800,
568 BE_IF_FLAGS_MULTICAST = 0x1000
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700569};
570
Sarveshwar Bandi3da988c2013-08-14 13:21:47 +0530571#define BE_IF_CAP_FLAGS_WANT (BE_IF_FLAGS_RSS | BE_IF_FLAGS_PROMISCUOUS |\
572 BE_IF_FLAGS_BROADCAST | BE_IF_FLAGS_VLAN_PROMISCUOUS |\
573 BE_IF_FLAGS_VLAN | BE_IF_FLAGS_MCAST_PROMISCUOUS |\
574 BE_IF_FLAGS_PASS_L3L4_ERRORS | BE_IF_FLAGS_MULTICAST |\
575 BE_IF_FLAGS_UNTAGGED)
576
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700577/* An RX interface is an object with one or more MAC addresses and
578 * filtering capabilities. */
579struct be_cmd_req_if_create {
580 struct be_cmd_req_hdr hdr;
André Goddard Rosaaf901ca2009-11-14 13:09:05 -0200581 u32 version; /* ignore currently */
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700582 u32 capability_flags;
583 u32 enable_flags;
584 u8 mac_addr[ETH_ALEN];
585 u8 rsvd0;
586 u8 pmac_invalid; /* if set, don't attach the mac addr to the i/f */
587 u32 vlan_tag; /* not used currently */
588} __packed;
589
590struct be_cmd_resp_if_create {
591 struct be_cmd_resp_hdr hdr;
592 u32 interface_id;
593 u32 pmac_id;
594};
595
596/****** I/f Destroy(it's actually I/f Config Destroy )**********/
597struct be_cmd_req_if_destroy {
598 struct be_cmd_req_hdr hdr;
599 u32 interface_id;
600};
601
602/*************** HW Stats Get **********************************/
Ajit Khaparde89a88ab2011-05-16 07:36:18 +0000603struct be_port_rxf_stats_v0 {
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700604 u32 rx_bytes_lsd; /* dword 0*/
605 u32 rx_bytes_msd; /* dword 1*/
606 u32 rx_total_frames; /* dword 2*/
607 u32 rx_unicast_frames; /* dword 3*/
608 u32 rx_multicast_frames; /* dword 4*/
609 u32 rx_broadcast_frames; /* dword 5*/
610 u32 rx_crc_errors; /* dword 6*/
611 u32 rx_alignment_symbol_errors; /* dword 7*/
612 u32 rx_pause_frames; /* dword 8*/
613 u32 rx_control_frames; /* dword 9*/
614 u32 rx_in_range_errors; /* dword 10*/
615 u32 rx_out_range_errors; /* dword 11*/
616 u32 rx_frame_too_long; /* dword 12*/
Suresh Reddy18fb06a2013-04-25 23:03:21 +0000617 u32 rx_address_filtered; /* dword 13*/
618 u32 rx_vlan_filtered; /* dword 14*/
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700619 u32 rx_dropped_too_small; /* dword 15*/
620 u32 rx_dropped_too_short; /* dword 16*/
621 u32 rx_dropped_header_too_small; /* dword 17*/
622 u32 rx_dropped_tcp_length; /* dword 18*/
623 u32 rx_dropped_runt; /* dword 19*/
624 u32 rx_64_byte_packets; /* dword 20*/
625 u32 rx_65_127_byte_packets; /* dword 21*/
626 u32 rx_128_256_byte_packets; /* dword 22*/
627 u32 rx_256_511_byte_packets; /* dword 23*/
628 u32 rx_512_1023_byte_packets; /* dword 24*/
629 u32 rx_1024_1518_byte_packets; /* dword 25*/
630 u32 rx_1519_2047_byte_packets; /* dword 26*/
631 u32 rx_2048_4095_byte_packets; /* dword 27*/
632 u32 rx_4096_8191_byte_packets; /* dword 28*/
633 u32 rx_8192_9216_byte_packets; /* dword 29*/
634 u32 rx_ip_checksum_errs; /* dword 30*/
635 u32 rx_tcp_checksum_errs; /* dword 31*/
636 u32 rx_udp_checksum_errs; /* dword 32*/
637 u32 rx_non_rss_packets; /* dword 33*/
638 u32 rx_ipv4_packets; /* dword 34*/
639 u32 rx_ipv6_packets; /* dword 35*/
640 u32 rx_ipv4_bytes_lsd; /* dword 36*/
641 u32 rx_ipv4_bytes_msd; /* dword 37*/
642 u32 rx_ipv6_bytes_lsd; /* dword 38*/
643 u32 rx_ipv6_bytes_msd; /* dword 39*/
644 u32 rx_chute1_packets; /* dword 40*/
645 u32 rx_chute2_packets; /* dword 41*/
646 u32 rx_chute3_packets; /* dword 42*/
647 u32 rx_management_packets; /* dword 43*/
648 u32 rx_switched_unicast_packets; /* dword 44*/
649 u32 rx_switched_multicast_packets; /* dword 45*/
650 u32 rx_switched_broadcast_packets; /* dword 46*/
651 u32 tx_bytes_lsd; /* dword 47*/
652 u32 tx_bytes_msd; /* dword 48*/
653 u32 tx_unicastframes; /* dword 49*/
654 u32 tx_multicastframes; /* dword 50*/
655 u32 tx_broadcastframes; /* dword 51*/
656 u32 tx_pauseframes; /* dword 52*/
657 u32 tx_controlframes; /* dword 53*/
658 u32 tx_64_byte_packets; /* dword 54*/
659 u32 tx_65_127_byte_packets; /* dword 55*/
660 u32 tx_128_256_byte_packets; /* dword 56*/
661 u32 tx_256_511_byte_packets; /* dword 57*/
662 u32 tx_512_1023_byte_packets; /* dword 58*/
663 u32 tx_1024_1518_byte_packets; /* dword 59*/
664 u32 tx_1519_2047_byte_packets; /* dword 60*/
665 u32 tx_2048_4095_byte_packets; /* dword 61*/
666 u32 tx_4096_8191_byte_packets; /* dword 62*/
667 u32 tx_8192_9216_byte_packets; /* dword 63*/
668 u32 rx_fifo_overflow; /* dword 64*/
669 u32 rx_input_fifo_overflow; /* dword 65*/
670};
671
Ajit Khaparde89a88ab2011-05-16 07:36:18 +0000672struct be_rxf_stats_v0 {
673 struct be_port_rxf_stats_v0 port[2];
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700674 u32 rx_drops_no_pbuf; /* dword 132*/
675 u32 rx_drops_no_txpb; /* dword 133*/
676 u32 rx_drops_no_erx_descr; /* dword 134*/
677 u32 rx_drops_no_tpre_descr; /* dword 135*/
678 u32 management_rx_port_packets; /* dword 136*/
679 u32 management_rx_port_bytes; /* dword 137*/
680 u32 management_rx_port_pause_frames; /* dword 138*/
681 u32 management_rx_port_errors; /* dword 139*/
682 u32 management_tx_port_packets; /* dword 140*/
683 u32 management_tx_port_bytes; /* dword 141*/
684 u32 management_tx_port_pause; /* dword 142*/
685 u32 management_rx_port_rxfifo_overflow; /* dword 143*/
686 u32 rx_drops_too_many_frags; /* dword 144*/
687 u32 rx_drops_invalid_ring; /* dword 145*/
688 u32 forwarded_packets; /* dword 146*/
689 u32 rx_drops_mtu; /* dword 147*/
Ajit Khapardef6c4bf32011-02-20 11:41:04 +0000690 u32 rsvd0[7];
691 u32 port0_jabber_events;
692 u32 port1_jabber_events;
693 u32 rsvd1[6];
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700694};
695
Ajit Khaparde89a88ab2011-05-16 07:36:18 +0000696struct be_erx_stats_v0 {
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700697 u32 rx_drops_no_fragments[44]; /* dwordS 0 to 43*/
Ajit Khaparde89a88ab2011-05-16 07:36:18 +0000698 u32 rsvd[4];
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700699};
700
Ajit Khapardef6c4bf32011-02-20 11:41:04 +0000701struct be_pmem_stats {
702 u32 eth_red_drops;
Ajit Khaparde89a88ab2011-05-16 07:36:18 +0000703 u32 rsvd[5];
Ajit Khapardef6c4bf32011-02-20 11:41:04 +0000704};
705
Ajit Khaparde89a88ab2011-05-16 07:36:18 +0000706struct be_hw_stats_v0 {
707 struct be_rxf_stats_v0 rxf;
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700708 u32 rsvd[48];
Ajit Khaparde89a88ab2011-05-16 07:36:18 +0000709 struct be_erx_stats_v0 erx;
Ajit Khapardef6c4bf32011-02-20 11:41:04 +0000710 struct be_pmem_stats pmem;
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700711};
712
Ajit Khaparde89a88ab2011-05-16 07:36:18 +0000713struct be_cmd_req_get_stats_v0 {
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700714 struct be_cmd_req_hdr hdr;
Ajit Khaparde89a88ab2011-05-16 07:36:18 +0000715 u8 rsvd[sizeof(struct be_hw_stats_v0)];
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700716};
717
Ajit Khaparde89a88ab2011-05-16 07:36:18 +0000718struct be_cmd_resp_get_stats_v0 {
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700719 struct be_cmd_resp_hdr hdr;
Ajit Khaparde89a88ab2011-05-16 07:36:18 +0000720 struct be_hw_stats_v0 hw_stats;
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700721};
722
Sathya Perlaac124ff2011-07-25 19:10:14 +0000723struct lancer_pport_stats {
Selvin Xavier005d5692011-05-16 07:36:35 +0000724 u32 tx_packets_lo;
725 u32 tx_packets_hi;
726 u32 tx_unicast_packets_lo;
727 u32 tx_unicast_packets_hi;
728 u32 tx_multicast_packets_lo;
729 u32 tx_multicast_packets_hi;
730 u32 tx_broadcast_packets_lo;
731 u32 tx_broadcast_packets_hi;
732 u32 tx_bytes_lo;
733 u32 tx_bytes_hi;
734 u32 tx_unicast_bytes_lo;
735 u32 tx_unicast_bytes_hi;
736 u32 tx_multicast_bytes_lo;
737 u32 tx_multicast_bytes_hi;
738 u32 tx_broadcast_bytes_lo;
739 u32 tx_broadcast_bytes_hi;
740 u32 tx_discards_lo;
741 u32 tx_discards_hi;
742 u32 tx_errors_lo;
743 u32 tx_errors_hi;
744 u32 tx_pause_frames_lo;
745 u32 tx_pause_frames_hi;
746 u32 tx_pause_on_frames_lo;
747 u32 tx_pause_on_frames_hi;
748 u32 tx_pause_off_frames_lo;
749 u32 tx_pause_off_frames_hi;
750 u32 tx_internal_mac_errors_lo;
751 u32 tx_internal_mac_errors_hi;
752 u32 tx_control_frames_lo;
753 u32 tx_control_frames_hi;
754 u32 tx_packets_64_bytes_lo;
755 u32 tx_packets_64_bytes_hi;
756 u32 tx_packets_65_to_127_bytes_lo;
757 u32 tx_packets_65_to_127_bytes_hi;
758 u32 tx_packets_128_to_255_bytes_lo;
759 u32 tx_packets_128_to_255_bytes_hi;
760 u32 tx_packets_256_to_511_bytes_lo;
761 u32 tx_packets_256_to_511_bytes_hi;
762 u32 tx_packets_512_to_1023_bytes_lo;
763 u32 tx_packets_512_to_1023_bytes_hi;
764 u32 tx_packets_1024_to_1518_bytes_lo;
765 u32 tx_packets_1024_to_1518_bytes_hi;
766 u32 tx_packets_1519_to_2047_bytes_lo;
767 u32 tx_packets_1519_to_2047_bytes_hi;
768 u32 tx_packets_2048_to_4095_bytes_lo;
769 u32 tx_packets_2048_to_4095_bytes_hi;
770 u32 tx_packets_4096_to_8191_bytes_lo;
771 u32 tx_packets_4096_to_8191_bytes_hi;
772 u32 tx_packets_8192_to_9216_bytes_lo;
773 u32 tx_packets_8192_to_9216_bytes_hi;
774 u32 tx_lso_packets_lo;
775 u32 tx_lso_packets_hi;
776 u32 rx_packets_lo;
777 u32 rx_packets_hi;
778 u32 rx_unicast_packets_lo;
779 u32 rx_unicast_packets_hi;
780 u32 rx_multicast_packets_lo;
781 u32 rx_multicast_packets_hi;
782 u32 rx_broadcast_packets_lo;
783 u32 rx_broadcast_packets_hi;
784 u32 rx_bytes_lo;
785 u32 rx_bytes_hi;
786 u32 rx_unicast_bytes_lo;
787 u32 rx_unicast_bytes_hi;
788 u32 rx_multicast_bytes_lo;
789 u32 rx_multicast_bytes_hi;
790 u32 rx_broadcast_bytes_lo;
791 u32 rx_broadcast_bytes_hi;
792 u32 rx_unknown_protos;
793 u32 rsvd_69; /* Word 69 is reserved */
794 u32 rx_discards_lo;
795 u32 rx_discards_hi;
796 u32 rx_errors_lo;
797 u32 rx_errors_hi;
798 u32 rx_crc_errors_lo;
799 u32 rx_crc_errors_hi;
800 u32 rx_alignment_errors_lo;
801 u32 rx_alignment_errors_hi;
802 u32 rx_symbol_errors_lo;
803 u32 rx_symbol_errors_hi;
804 u32 rx_pause_frames_lo;
805 u32 rx_pause_frames_hi;
806 u32 rx_pause_on_frames_lo;
807 u32 rx_pause_on_frames_hi;
808 u32 rx_pause_off_frames_lo;
809 u32 rx_pause_off_frames_hi;
810 u32 rx_frames_too_long_lo;
811 u32 rx_frames_too_long_hi;
812 u32 rx_internal_mac_errors_lo;
813 u32 rx_internal_mac_errors_hi;
814 u32 rx_undersize_packets;
815 u32 rx_oversize_packets;
816 u32 rx_fragment_packets;
817 u32 rx_jabbers;
818 u32 rx_control_frames_lo;
819 u32 rx_control_frames_hi;
820 u32 rx_control_frames_unknown_opcode_lo;
821 u32 rx_control_frames_unknown_opcode_hi;
822 u32 rx_in_range_errors;
823 u32 rx_out_of_range_errors;
Suresh Reddy18fb06a2013-04-25 23:03:21 +0000824 u32 rx_address_filtered;
825 u32 rx_vlan_filtered;
Selvin Xavier005d5692011-05-16 07:36:35 +0000826 u32 rx_dropped_too_small;
827 u32 rx_dropped_too_short;
828 u32 rx_dropped_header_too_small;
829 u32 rx_dropped_invalid_tcp_length;
830 u32 rx_dropped_runt;
831 u32 rx_ip_checksum_errors;
832 u32 rx_tcp_checksum_errors;
833 u32 rx_udp_checksum_errors;
834 u32 rx_non_rss_packets;
835 u32 rsvd_111;
836 u32 rx_ipv4_packets_lo;
837 u32 rx_ipv4_packets_hi;
838 u32 rx_ipv6_packets_lo;
839 u32 rx_ipv6_packets_hi;
840 u32 rx_ipv4_bytes_lo;
841 u32 rx_ipv4_bytes_hi;
842 u32 rx_ipv6_bytes_lo;
843 u32 rx_ipv6_bytes_hi;
844 u32 rx_nic_packets_lo;
845 u32 rx_nic_packets_hi;
846 u32 rx_tcp_packets_lo;
847 u32 rx_tcp_packets_hi;
848 u32 rx_iscsi_packets_lo;
849 u32 rx_iscsi_packets_hi;
850 u32 rx_management_packets_lo;
851 u32 rx_management_packets_hi;
852 u32 rx_switched_unicast_packets_lo;
853 u32 rx_switched_unicast_packets_hi;
854 u32 rx_switched_multicast_packets_lo;
855 u32 rx_switched_multicast_packets_hi;
856 u32 rx_switched_broadcast_packets_lo;
857 u32 rx_switched_broadcast_packets_hi;
858 u32 num_forwards_lo;
859 u32 num_forwards_hi;
860 u32 rx_fifo_overflow;
861 u32 rx_input_fifo_overflow;
862 u32 rx_drops_too_many_frags_lo;
863 u32 rx_drops_too_many_frags_hi;
864 u32 rx_drops_invalid_queue;
865 u32 rsvd_141;
866 u32 rx_drops_mtu_lo;
867 u32 rx_drops_mtu_hi;
868 u32 rx_packets_64_bytes_lo;
869 u32 rx_packets_64_bytes_hi;
870 u32 rx_packets_65_to_127_bytes_lo;
871 u32 rx_packets_65_to_127_bytes_hi;
872 u32 rx_packets_128_to_255_bytes_lo;
873 u32 rx_packets_128_to_255_bytes_hi;
874 u32 rx_packets_256_to_511_bytes_lo;
875 u32 rx_packets_256_to_511_bytes_hi;
876 u32 rx_packets_512_to_1023_bytes_lo;
877 u32 rx_packets_512_to_1023_bytes_hi;
878 u32 rx_packets_1024_to_1518_bytes_lo;
879 u32 rx_packets_1024_to_1518_bytes_hi;
880 u32 rx_packets_1519_to_2047_bytes_lo;
881 u32 rx_packets_1519_to_2047_bytes_hi;
882 u32 rx_packets_2048_to_4095_bytes_lo;
883 u32 rx_packets_2048_to_4095_bytes_hi;
884 u32 rx_packets_4096_to_8191_bytes_lo;
885 u32 rx_packets_4096_to_8191_bytes_hi;
886 u32 rx_packets_8192_to_9216_bytes_lo;
887 u32 rx_packets_8192_to_9216_bytes_hi;
888};
889
890struct pport_stats_params {
891 u16 pport_num;
892 u8 rsvd;
893 u8 reset_stats;
894};
895
896struct lancer_cmd_req_pport_stats {
897 struct be_cmd_req_hdr hdr;
898 union {
899 struct pport_stats_params params;
Sathya Perlaac124ff2011-07-25 19:10:14 +0000900 u8 rsvd[sizeof(struct lancer_pport_stats)];
Selvin Xavier005d5692011-05-16 07:36:35 +0000901 } cmd_params;
902};
903
904struct lancer_cmd_resp_pport_stats {
905 struct be_cmd_resp_hdr hdr;
Sathya Perlaac124ff2011-07-25 19:10:14 +0000906 struct lancer_pport_stats pport_stats;
Selvin Xavier005d5692011-05-16 07:36:35 +0000907};
908
Sathya Perlaac124ff2011-07-25 19:10:14 +0000909static inline struct lancer_pport_stats*
Selvin Xavier005d5692011-05-16 07:36:35 +0000910 pport_stats_from_cmd(struct be_adapter *adapter)
911{
912 struct lancer_cmd_resp_pport_stats *cmd = adapter->stats_cmd.va;
913 return &cmd->pport_stats;
914}
915
Ajit Khaparde609ff3b2011-02-20 11:42:07 +0000916struct be_cmd_req_get_cntl_addnl_attribs {
917 struct be_cmd_req_hdr hdr;
918 u8 rsvd[8];
919};
920
921struct be_cmd_resp_get_cntl_addnl_attribs {
922 struct be_cmd_resp_hdr hdr;
923 u16 ipl_file_number;
924 u8 ipl_file_version;
925 u8 rsvd0;
926 u8 on_die_temperature; /* in degrees centigrade*/
927 u8 rsvd1[3];
928};
929
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700930struct be_cmd_req_vlan_config {
931 struct be_cmd_req_hdr hdr;
932 u8 interface_id;
933 u8 promiscuous;
934 u8 untagged;
935 u8 num_vlan;
936 u16 normal_vlan[64];
937} __packed;
938
Sathya Perla5b8821b2011-08-02 19:57:44 +0000939/******************* RX FILTER ******************************/
Sathya Perlae7b909a2009-11-22 22:01:10 +0000940#define BE_MAX_MC 64 /* set mcast promisc if > 64 */
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700941struct macaddr {
942 u8 byte[ETH_ALEN];
943};
944
Padmanabh Ratnakarecd0bf02011-05-10 05:13:26 +0000945struct be_cmd_req_rx_filter {
946 struct be_cmd_req_hdr hdr;
947 u32 global_flags_mask;
948 u32 global_flags;
949 u32 if_flags_mask;
950 u32 if_flags;
951 u32 if_id;
Sathya Perla5b8821b2011-08-02 19:57:44 +0000952 u32 mcast_num;
953 struct macaddr mcast_mac[BE_MAX_MC];
Padmanabh Ratnakarecd0bf02011-05-10 05:13:26 +0000954};
955
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700956/******************** Link Status Query *******************/
957struct be_cmd_req_link_status {
958 struct be_cmd_req_hdr hdr;
959 u32 rsvd;
960};
961
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700962enum {
963 PHY_LINK_DUPLEX_NONE = 0x0,
964 PHY_LINK_DUPLEX_HALF = 0x1,
965 PHY_LINK_DUPLEX_FULL = 0x2
966};
967
968enum {
969 PHY_LINK_SPEED_ZERO = 0x0, /* => No link */
970 PHY_LINK_SPEED_10MBPS = 0x1,
971 PHY_LINK_SPEED_100MBPS = 0x2,
972 PHY_LINK_SPEED_1GBPS = 0x3,
Vasundhara Volamb971f842013-08-06 09:27:15 +0530973 PHY_LINK_SPEED_10GBPS = 0x4,
974 PHY_LINK_SPEED_20GBPS = 0x5,
975 PHY_LINK_SPEED_25GBPS = 0x6,
976 PHY_LINK_SPEED_40GBPS = 0x7
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700977};
978
979struct be_cmd_resp_link_status {
980 struct be_cmd_resp_hdr hdr;
981 u8 physical_port;
982 u8 mac_duplex;
983 u8 mac_speed;
984 u8 mac_fault;
985 u8 mgmt_mac_duplex;
986 u8 mgmt_mac_speed;
Sarveshwar Bandi0388f252009-10-28 04:15:20 -0700987 u16 link_speed;
Ajit Khapardeb236916a2011-12-30 12:15:40 +0000988 u8 logical_link_status;
989 u8 rsvd1[3];
Sathya Perla6b7c5b92009-03-11 23:32:03 -0700990} __packed;
991
Sarveshwar Bandi0388f252009-10-28 04:15:20 -0700992/******************** Port Identification ***************************/
993/* Identifies the type of port attached to NIC */
994struct be_cmd_req_port_type {
995 struct be_cmd_req_hdr hdr;
996 u32 page_num;
997 u32 port;
998};
999
1000enum {
1001 TR_PAGE_A0 = 0xa0,
1002 TR_PAGE_A2 = 0xa2
1003};
1004
1005struct be_cmd_resp_port_type {
1006 struct be_cmd_resp_hdr hdr;
1007 u32 page_num;
1008 u32 port;
1009 struct data {
1010 u8 identifier;
1011 u8 identifier_ext;
1012 u8 connector;
1013 u8 transceiver[8];
1014 u8 rsvd0[3];
1015 u8 length_km;
1016 u8 length_hm;
1017 u8 length_om1;
1018 u8 length_om2;
1019 u8 length_cu;
1020 u8 length_cu_m;
1021 u8 vendor_name[16];
1022 u8 rsvd;
1023 u8 vendor_oui[3];
1024 u8 vendor_pn[16];
1025 u8 vendor_rev[4];
1026 } data;
1027};
1028
Sathya Perla6b7c5b92009-03-11 23:32:03 -07001029/******************** Get FW Version *******************/
Sathya Perla6b7c5b92009-03-11 23:32:03 -07001030struct be_cmd_req_get_fw_version {
1031 struct be_cmd_req_hdr hdr;
1032 u8 rsvd0[FW_VER_LEN];
1033 u8 rsvd1[FW_VER_LEN];
1034} __packed;
1035
1036struct be_cmd_resp_get_fw_version {
1037 struct be_cmd_resp_hdr hdr;
1038 u8 firmware_version_string[FW_VER_LEN];
1039 u8 fw_on_flash_version_string[FW_VER_LEN];
1040} __packed;
1041
1042/******************** Set Flow Contrl *******************/
1043struct be_cmd_req_set_flow_control {
1044 struct be_cmd_req_hdr hdr;
1045 u16 tx_flow_control;
1046 u16 rx_flow_control;
1047} __packed;
1048
1049/******************** Get Flow Contrl *******************/
1050struct be_cmd_req_get_flow_control {
1051 struct be_cmd_req_hdr hdr;
1052 u32 rsvd;
1053};
1054
1055struct be_cmd_resp_get_flow_control {
1056 struct be_cmd_resp_hdr hdr;
1057 u16 tx_flow_control;
1058 u16 rx_flow_control;
1059} __packed;
1060
1061/******************** Modify EQ Delay *******************/
Sathya Perla2632baf2013-10-01 16:00:00 +05301062struct be_set_eqd {
1063 u32 eq_id;
1064 u32 phase;
1065 u32 delay_multiplier;
1066};
1067
Sathya Perla6b7c5b92009-03-11 23:32:03 -07001068struct be_cmd_req_modify_eq_delay {
1069 struct be_cmd_req_hdr hdr;
1070 u32 num_eq;
Sathya Perla2632baf2013-10-01 16:00:00 +05301071 struct be_set_eqd set_eqd[MAX_EVT_QS];
Sathya Perla6b7c5b92009-03-11 23:32:03 -07001072} __packed;
1073
1074struct be_cmd_resp_modify_eq_delay {
1075 struct be_cmd_resp_hdr hdr;
1076 u32 rsvd0;
1077} __packed;
1078
1079/******************** Get FW Config *******************/
Sathya Perla752961a2011-10-24 02:45:03 +00001080/* The HW can come up in either of the following multi-channel modes
1081 * based on the skew/IPL.
1082 */
Parav Pandit045508a2012-03-26 14:27:13 +00001083#define RDMA_ENABLED 0x4
Sathya Perla752961a2011-10-24 02:45:03 +00001084#define FLEX10_MODE 0x400
1085#define VNIC_MODE 0x20000
1086#define UMC_ENABLED 0x1000000
Sathya Perla6b7c5b92009-03-11 23:32:03 -07001087struct be_cmd_req_query_fw_cfg {
1088 struct be_cmd_req_hdr hdr;
Sathya Perla3abcded2010-10-03 22:12:27 -07001089 u32 rsvd[31];
Sathya Perla6b7c5b92009-03-11 23:32:03 -07001090};
1091
1092struct be_cmd_resp_query_fw_cfg {
1093 struct be_cmd_resp_hdr hdr;
1094 u32 be_config_number;
1095 u32 asic_revision;
1096 u32 phys_port;
Ajit Khaparde3486be22010-07-23 02:04:54 +00001097 u32 function_mode;
Sathya Perla6b7c5b92009-03-11 23:32:03 -07001098 u32 rsvd[26];
Sathya Perla3abcded2010-10-03 22:12:27 -07001099 u32 function_caps;
1100};
1101
Padmanabh Ratnakar73dea392012-07-13 02:45:51 +00001102/******************** RSS Config ****************************************/
1103/* RSS type Input parameters used to compute RX hash
1104 * RSS_ENABLE_IPV4 SRC IPv4, DST IPv4
1105 * RSS_ENABLE_TCP_IPV4 SRC IPv4, DST IPv4, TCP SRC PORT, TCP DST PORT
1106 * RSS_ENABLE_IPV6 SRC IPv6, DST IPv6
1107 * RSS_ENABLE_TCP_IPV6 SRC IPv6, DST IPv6, TCP SRC PORT, TCP DST PORT
1108 * RSS_ENABLE_UDP_IPV4 SRC IPv4, DST IPv4, UDP SRC PORT, UDP DST PORT
1109 * RSS_ENABLE_UDP_IPV6 SRC IPv6, DST IPv6, UDP SRC PORT, UDP DST PORT
1110 *
1111 * When multiple RSS types are enabled, HW picks the best hash policy
1112 * based on the type of the received packet.
1113 */
Sathya Perla3abcded2010-10-03 22:12:27 -07001114#define RSS_ENABLE_NONE 0x0
1115#define RSS_ENABLE_IPV4 0x1
1116#define RSS_ENABLE_TCP_IPV4 0x2
1117#define RSS_ENABLE_IPV6 0x4
1118#define RSS_ENABLE_TCP_IPV6 0x8
Padmanabh Ratnakard3bd3a52012-07-12 03:57:47 +00001119#define RSS_ENABLE_UDP_IPV4 0x10
1120#define RSS_ENABLE_UDP_IPV6 0x20
Sathya Perla3abcded2010-10-03 22:12:27 -07001121
Suresh Reddy594ad542013-04-25 23:03:20 +00001122#define L3_RSS_FLAGS (RXH_IP_DST | RXH_IP_SRC)
1123#define L4_RSS_FLAGS (RXH_L4_B_0_1 | RXH_L4_B_2_3)
1124
Sathya Perla3abcded2010-10-03 22:12:27 -07001125struct be_cmd_req_rss_config {
1126 struct be_cmd_req_hdr hdr;
1127 u32 if_id;
1128 u16 enable_rss;
1129 u16 cpu_table_size_log2;
1130 u32 hash[10];
1131 u8 cpu_table[128];
1132 u8 flush;
1133 u8 rsvd0[3];
Sathya Perla6b7c5b92009-03-11 23:32:03 -07001134};
1135
Sarveshwar Bandifad9ab22009-10-12 04:23:15 -07001136/******************** Port Beacon ***************************/
1137
1138#define BEACON_STATE_ENABLED 0x1
1139#define BEACON_STATE_DISABLED 0x0
1140
1141struct be_cmd_req_enable_disable_beacon {
1142 struct be_cmd_req_hdr hdr;
1143 u8 port_num;
1144 u8 beacon_state;
1145 u8 beacon_duration;
1146 u8 status_duration;
1147} __packed;
1148
1149struct be_cmd_resp_enable_disable_beacon {
1150 struct be_cmd_resp_hdr resp_hdr;
1151 u32 rsvd0;
1152} __packed;
1153
1154struct be_cmd_req_get_beacon_state {
1155 struct be_cmd_req_hdr hdr;
1156 u8 port_num;
1157 u8 rsvd0;
1158 u16 rsvd1;
1159} __packed;
1160
1161struct be_cmd_resp_get_beacon_state {
1162 struct be_cmd_resp_hdr resp_hdr;
1163 u8 beacon_state;
1164 u8 rsvd0[3];
1165} __packed;
1166
Ajit Khaparde84517482009-09-04 03:12:16 +00001167/****************** Firmware Flash ******************/
1168struct flashrom_params {
1169 u32 op_code;
1170 u32 op_type;
1171 u32 data_buf_size;
1172 u32 offset;
Ajit Khaparde84517482009-09-04 03:12:16 +00001173};
1174
1175struct be_cmd_write_flashrom {
1176 struct be_cmd_req_hdr hdr;
1177 struct flashrom_params params;
Padmanabh Ratnakarbe716442012-10-22 23:02:44 +00001178 u8 data_buf[32768];
1179 u8 rsvd[4];
1180} __packed;
Ajit Khaparde84517482009-09-04 03:12:16 +00001181
Padmanabh Ratnakarbe716442012-10-22 23:02:44 +00001182/* cmd to read flash crc */
1183struct be_cmd_read_flash_crc {
1184 struct be_cmd_req_hdr hdr;
1185 struct flashrom_params params;
1186 u8 crc[4];
1187 u8 rsvd[4];
1188};
Shripad Nunjundarao485bf562011-05-16 07:36:59 +00001189/**************** Lancer Firmware Flash ************/
1190struct amap_lancer_write_obj_context {
1191 u8 write_length[24];
1192 u8 reserved1[7];
1193 u8 eof;
1194} __packed;
1195
1196struct lancer_cmd_req_write_object {
1197 struct be_cmd_req_hdr hdr;
1198 u8 context[sizeof(struct amap_lancer_write_obj_context) / 8];
1199 u32 write_offset;
1200 u8 object_name[104];
1201 u32 descriptor_count;
1202 u32 buf_len;
1203 u32 addr_low;
1204 u32 addr_high;
1205};
1206
Padmanabh Ratnakarf67ef7b2012-07-12 03:57:09 +00001207#define LANCER_NO_RESET_NEEDED 0x00
1208#define LANCER_FW_RESET_NEEDED 0x02
Shripad Nunjundarao485bf562011-05-16 07:36:59 +00001209struct lancer_cmd_resp_write_object {
1210 u8 opcode;
1211 u8 subsystem;
1212 u8 rsvd1[2];
1213 u8 status;
1214 u8 additional_status;
1215 u8 rsvd2[2];
1216 u32 resp_len;
1217 u32 actual_resp_len;
1218 u32 actual_write_len;
Padmanabh Ratnakarf67ef7b2012-07-12 03:57:09 +00001219 u8 change_status;
1220 u8 rsvd3[3];
Shripad Nunjundarao485bf562011-05-16 07:36:59 +00001221};
1222
Padmanabh Ratnakarde49bd52011-11-16 02:02:43 +00001223/************************ Lancer Read FW info **************/
1224#define LANCER_READ_FILE_CHUNK (32*1024)
1225#define LANCER_READ_FILE_EOF_MASK 0x80000000
1226
1227#define LANCER_FW_DUMP_FILE "/dbg/dump.bin"
Padmanabh Ratnakaraf5875b2011-11-16 02:03:07 +00001228#define LANCER_VPD_PF_FILE "/vpd/ntr_pf.vpd"
1229#define LANCER_VPD_VF_FILE "/vpd/ntr_vf.vpd"
Padmanabh Ratnakarde49bd52011-11-16 02:02:43 +00001230
1231struct lancer_cmd_req_read_object {
1232 struct be_cmd_req_hdr hdr;
1233 u32 desired_read_len;
1234 u32 read_offset;
1235 u8 object_name[104];
1236 u32 descriptor_count;
1237 u32 buf_len;
1238 u32 addr_low;
1239 u32 addr_high;
1240};
1241
1242struct lancer_cmd_resp_read_object {
1243 u8 opcode;
1244 u8 subsystem;
1245 u8 rsvd1[2];
1246 u8 status;
1247 u8 additional_status;
1248 u8 rsvd2[2];
1249 u32 resp_len;
1250 u32 actual_resp_len;
1251 u32 actual_read_len;
1252 u32 eof;
1253};
1254
Ajit Khaparde71d8d1b2009-12-03 06:16:59 +00001255/************************ WOL *******************************/
1256struct be_cmd_req_acpi_wol_magic_config{
1257 struct be_cmd_req_hdr hdr;
1258 u32 rsvd0[145];
1259 u8 magic_mac[6];
1260 u8 rsvd2[2];
1261} __packed;
1262
Ajit Khaparde4762f6c2012-03-18 06:23:11 +00001263struct be_cmd_req_acpi_wol_magic_config_v1 {
1264 struct be_cmd_req_hdr hdr;
1265 u8 rsvd0[2];
1266 u8 query_options;
1267 u8 rsvd1[5];
1268 u32 rsvd2[288];
1269 u8 magic_mac[6];
1270 u8 rsvd3[22];
1271} __packed;
1272
1273struct be_cmd_resp_acpi_wol_magic_config_v1 {
1274 struct be_cmd_resp_hdr hdr;
1275 u8 rsvd0[2];
1276 u8 wol_settings;
1277 u8 rsvd1[5];
1278 u32 rsvd2[295];
1279} __packed;
1280
1281#define BE_GET_WOL_CAP 2
1282
1283#define BE_WOL_CAP 0x1
1284#define BE_PME_D0_CAP 0x8
1285#define BE_PME_D1_CAP 0x10
1286#define BE_PME_D2_CAP 0x20
1287#define BE_PME_D3HOT_CAP 0x40
1288#define BE_PME_D3COLD_CAP 0x80
1289
Suresh Rff33a6e2009-12-03 16:15:52 -08001290/********************** LoopBack test *********************/
1291struct be_cmd_req_loopback_test {
1292 struct be_cmd_req_hdr hdr;
1293 u32 loopback_type;
1294 u32 num_pkts;
1295 u64 pattern;
1296 u32 src_port;
1297 u32 dest_port;
1298 u32 pkt_size;
1299};
1300
1301struct be_cmd_resp_loopback_test {
1302 struct be_cmd_resp_hdr resp_hdr;
1303 u32 status;
1304 u32 num_txfer;
1305 u32 num_rx;
1306 u32 miscomp_off;
1307 u32 ticks_compl;
1308};
1309
Sarveshwar Bandifced9992009-12-23 04:41:44 +00001310struct be_cmd_req_set_lmode {
1311 struct be_cmd_req_hdr hdr;
1312 u8 src_port;
1313 u8 dest_port;
1314 u8 loopback_type;
1315 u8 loopback_state;
1316};
1317
1318struct be_cmd_resp_set_lmode {
1319 struct be_cmd_resp_hdr resp_hdr;
1320 u8 rsvd0[4];
1321};
1322
Suresh Rff33a6e2009-12-03 16:15:52 -08001323/********************** DDR DMA test *********************/
1324struct be_cmd_req_ddrdma_test {
1325 struct be_cmd_req_hdr hdr;
1326 u64 pattern;
1327 u32 byte_count;
1328 u32 rsvd0;
1329 u8 snd_buff[4096];
1330 u8 rsvd1[4096];
1331};
1332
1333struct be_cmd_resp_ddrdma_test {
1334 struct be_cmd_resp_hdr hdr;
1335 u64 pattern;
1336 u32 byte_cnt;
1337 u32 snd_err;
1338 u8 rsvd0[4096];
1339 u8 rcv_buff[4096];
1340};
1341
Sarveshwar Bandi368c0ca2010-01-08 00:07:27 -08001342/*********************** SEEPROM Read ***********************/
1343
1344#define BE_READ_SEEPROM_LEN 1024
1345struct be_cmd_req_seeprom_read {
1346 struct be_cmd_req_hdr hdr;
1347 u8 rsvd0[BE_READ_SEEPROM_LEN];
1348};
1349
1350struct be_cmd_resp_seeprom_read {
1351 struct be_cmd_req_hdr hdr;
1352 u8 seeprom_data[BE_READ_SEEPROM_LEN];
1353};
1354
Ajit Khapardeee3cb622010-07-01 03:51:00 +00001355enum {
1356 PHY_TYPE_CX4_10GB = 0,
1357 PHY_TYPE_XFP_10GB,
1358 PHY_TYPE_SFP_1GB,
1359 PHY_TYPE_SFP_PLUS_10GB,
1360 PHY_TYPE_KR_10GB,
1361 PHY_TYPE_KX4_10GB,
1362 PHY_TYPE_BASET_10GB,
1363 PHY_TYPE_BASET_1GB,
Ajit Khaparde42f11cf2012-04-21 18:53:22 +00001364 PHY_TYPE_BASEX_1GB,
1365 PHY_TYPE_SGMII,
Ajit Khapardeee3cb622010-07-01 03:51:00 +00001366 PHY_TYPE_DISABLED = 255
1367};
1368
Ajit Khaparde42f11cf2012-04-21 18:53:22 +00001369#define BE_SUPPORTED_SPEED_NONE 0
1370#define BE_SUPPORTED_SPEED_10MBPS 1
1371#define BE_SUPPORTED_SPEED_100MBPS 2
1372#define BE_SUPPORTED_SPEED_1GBPS 4
1373#define BE_SUPPORTED_SPEED_10GBPS 8
1374
1375#define BE_AN_EN 0x2
1376#define BE_PAUSE_SYM_EN 0x80
1377
1378/* MAC speed valid values */
1379#define SPEED_DEFAULT 0x0
1380#define SPEED_FORCED_10GB 0x1
1381#define SPEED_FORCED_1GB 0x2
1382#define SPEED_AUTONEG_10GB 0x3
1383#define SPEED_AUTONEG_1GB 0x4
1384#define SPEED_AUTONEG_100MB 0x5
1385#define SPEED_AUTONEG_10GB_1GB 0x6
1386#define SPEED_AUTONEG_10GB_1GB_100MB 0x7
1387#define SPEED_AUTONEG_1GB_100MB 0x8
1388#define SPEED_AUTONEG_10MB 0x9
1389#define SPEED_AUTONEG_1GB_100MB_10MB 0xa
1390#define SPEED_AUTONEG_100MB_10MB 0xb
1391#define SPEED_FORCED_100MB 0xc
1392#define SPEED_FORCED_10MB 0xd
1393
Ajit Khapardeee3cb622010-07-01 03:51:00 +00001394struct be_cmd_req_get_phy_info {
1395 struct be_cmd_req_hdr hdr;
1396 u8 rsvd0[24];
1397};
Sathya Perla306f1342011-08-02 19:57:45 +00001398
1399struct be_phy_info {
Ajit Khapardeee3cb622010-07-01 03:51:00 +00001400 u16 phy_type;
1401 u16 interface_type;
1402 u32 misc_params;
Ajit Khaparde42f11cf2012-04-21 18:53:22 +00001403 u16 ext_phy_details;
1404 u16 rsvd;
1405 u16 auto_speeds_supported;
1406 u16 fixed_speeds_supported;
1407 u32 future_use[2];
Ajit Khapardeee3cb622010-07-01 03:51:00 +00001408};
1409
Sathya Perla306f1342011-08-02 19:57:45 +00001410struct be_cmd_resp_get_phy_info {
1411 struct be_cmd_req_hdr hdr;
1412 struct be_phy_info phy_info;
1413};
1414
Ajit Khapardee1d18732010-07-23 01:52:13 +00001415/*********************** Set QOS ***********************/
1416
1417#define BE_QOS_BITS_NIC 1
1418
1419struct be_cmd_req_set_qos {
1420 struct be_cmd_req_hdr hdr;
1421 u32 valid_bits;
1422 u32 max_bps_nic;
1423 u32 rsvd[7];
1424};
1425
1426struct be_cmd_resp_set_qos {
1427 struct be_cmd_resp_hdr hdr;
1428 u32 rsvd;
1429};
1430
Ajit Khaparde9e1453c2011-02-20 11:42:22 +00001431/*********************** Controller Attributes ***********************/
1432struct be_cmd_req_cntl_attribs {
1433 struct be_cmd_req_hdr hdr;
1434};
1435
1436struct be_cmd_resp_cntl_attribs {
1437 struct be_cmd_resp_hdr hdr;
1438 struct mgmt_controller_attrib attribs;
1439};
1440
Sathya Perla2e588f82011-03-11 02:49:26 +00001441/*********************** Set driver function ***********************/
1442#define CAPABILITY_SW_TIMESTAMPS 2
1443#define CAPABILITY_BE3_NATIVE_ERX_API 4
1444
1445struct be_cmd_req_set_func_cap {
1446 struct be_cmd_req_hdr hdr;
1447 u32 valid_cap_flags;
1448 u32 cap_flags;
1449 u8 rsvd[212];
1450};
1451
1452struct be_cmd_resp_set_func_cap {
1453 struct be_cmd_resp_hdr hdr;
1454 u32 valid_cap_flags;
1455 u32 cap_flags;
1456 u8 rsvd[212];
1457};
1458
Padmanabh Ratnakarf25b1192012-10-20 06:02:52 +00001459/*********************** Function Privileges ***********************/
1460enum {
1461 BE_PRIV_DEFAULT = 0x1,
1462 BE_PRIV_LNKQUERY = 0x2,
1463 BE_PRIV_LNKSTATS = 0x4,
1464 BE_PRIV_LNKMGMT = 0x8,
1465 BE_PRIV_LNKDIAG = 0x10,
1466 BE_PRIV_UTILQUERY = 0x20,
1467 BE_PRIV_FILTMGMT = 0x40,
1468 BE_PRIV_IFACEMGMT = 0x80,
1469 BE_PRIV_VHADM = 0x100,
1470 BE_PRIV_DEVCFG = 0x200,
1471 BE_PRIV_DEVSEC = 0x400
1472};
1473#define MAX_PRIVILEGES (BE_PRIV_VHADM | BE_PRIV_DEVCFG | \
1474 BE_PRIV_DEVSEC)
1475#define MIN_PRIVILEGES BE_PRIV_DEFAULT
1476
1477struct be_cmd_priv_map {
1478 u8 opcode;
1479 u8 subsystem;
1480 u32 priv_mask;
1481};
1482
1483struct be_cmd_req_get_fn_privileges {
1484 struct be_cmd_req_hdr hdr;
1485 u32 rsvd;
1486};
1487
1488struct be_cmd_resp_get_fn_privileges {
1489 struct be_cmd_resp_hdr hdr;
1490 u32 privilege_mask;
1491};
1492
Sathya Perla04a06022013-07-23 15:25:00 +05301493struct be_cmd_req_set_fn_privileges {
1494 struct be_cmd_req_hdr hdr;
1495 u32 privileges; /* Used by BE3, SH-R */
1496 u32 privileges_lancer; /* Used by Lancer */
1497};
Padmanabh Ratnakarf25b1192012-10-20 06:02:52 +00001498
Padmanabh Ratnakar590c3912011-11-25 05:47:26 +00001499/******************** GET/SET_MACLIST **************************/
1500#define BE_MAX_MAC 64
Padmanabh Ratnakar590c3912011-11-25 05:47:26 +00001501struct be_cmd_req_get_mac_list {
1502 struct be_cmd_req_hdr hdr;
Padmanabh Ratnakare5e1ee82012-02-03 09:50:17 +00001503 u8 mac_type;
1504 u8 perm_override;
1505 u16 iface_id;
1506 u32 mac_id;
1507 u32 rsvd[3];
1508} __packed;
1509
1510struct get_list_macaddr {
1511 u16 mac_addr_size;
1512 union {
1513 u8 macaddr[6];
1514 struct {
1515 u8 rsvd[2];
1516 u32 mac_id;
1517 } __packed s_mac_id;
1518 } __packed mac_addr_id;
Padmanabh Ratnakar590c3912011-11-25 05:47:26 +00001519} __packed;
1520
1521struct be_cmd_resp_get_mac_list {
1522 struct be_cmd_resp_hdr hdr;
Padmanabh Ratnakare5e1ee82012-02-03 09:50:17 +00001523 struct get_list_macaddr fd_macaddr; /* Factory default mac */
1524 struct get_list_macaddr macid_macaddr; /* soft mac */
1525 u8 true_mac_count;
1526 u8 pseudo_mac_count;
1527 u8 mac_list_size;
1528 u8 rsvd;
1529 /* perm override mac */
1530 struct get_list_macaddr macaddr_list[BE_MAX_MAC];
Padmanabh Ratnakar590c3912011-11-25 05:47:26 +00001531} __packed;
1532
1533struct be_cmd_req_set_mac_list {
1534 struct be_cmd_req_hdr hdr;
1535 u8 mac_count;
1536 u8 rsvd1;
1537 u16 rsvd2;
1538 struct macaddr mac[BE_MAX_MAC];
1539} __packed;
1540
Ajit Khapardef1f3ee12012-03-18 06:23:41 +00001541/*********************** HSW Config ***********************/
Ajit Khapardea77dcb82013-08-30 15:01:16 -05001542#define PORT_FWD_TYPE_VEPA 0x3
1543#define PORT_FWD_TYPE_VEB 0x2
1544
Ajit Khapardef1f3ee12012-03-18 06:23:41 +00001545struct amap_set_hsw_context {
1546 u8 interface_id[16];
1547 u8 rsvd0[14];
1548 u8 pvid_valid;
Ajit Khapardea77dcb82013-08-30 15:01:16 -05001549 u8 pport;
1550 u8 rsvd1[6];
1551 u8 port_fwd_type[3];
1552 u8 rsvd2[7];
Ajit Khapardef1f3ee12012-03-18 06:23:41 +00001553 u8 pvid[16];
1554 u8 rsvd3[32];
1555 u8 rsvd4[32];
1556 u8 rsvd5[32];
1557} __packed;
1558
1559struct be_cmd_req_set_hsw_config {
1560 struct be_cmd_req_hdr hdr;
1561 u8 context[sizeof(struct amap_set_hsw_context) / 8];
1562} __packed;
1563
1564struct be_cmd_resp_set_hsw_config {
1565 struct be_cmd_resp_hdr hdr;
1566 u32 rsvd;
1567};
1568
1569struct amap_get_hsw_req_context {
1570 u8 interface_id[16];
1571 u8 rsvd0[14];
1572 u8 pvid_valid;
1573 u8 pport;
1574} __packed;
1575
1576struct amap_get_hsw_resp_context {
Ajit Khapardea77dcb82013-08-30 15:01:16 -05001577 u8 rsvd0[6];
1578 u8 port_fwd_type[3];
1579 u8 rsvd1[7];
Ajit Khapardef1f3ee12012-03-18 06:23:41 +00001580 u8 pvid[16];
1581 u8 rsvd2[32];
1582 u8 rsvd3[32];
1583 u8 rsvd4[32];
1584} __packed;
1585
1586struct be_cmd_req_get_hsw_config {
1587 struct be_cmd_req_hdr hdr;
1588 u8 context[sizeof(struct amap_get_hsw_req_context) / 8];
1589} __packed;
1590
1591struct be_cmd_resp_get_hsw_config {
1592 struct be_cmd_resp_hdr hdr;
1593 u8 context[sizeof(struct amap_get_hsw_resp_context) / 8];
1594 u32 rsvd;
1595};
1596
Padmanabh Ratnakarb4e32a72012-07-12 03:57:35 +00001597/******************* get port names ***************/
1598struct be_cmd_req_get_port_name {
1599 struct be_cmd_req_hdr hdr;
1600 u32 rsvd0;
1601};
1602
1603struct be_cmd_resp_get_port_name {
1604 struct be_cmd_req_hdr hdr;
1605 u8 port_name[4];
1606};
1607
Ajit Khaparde89a88ab2011-05-16 07:36:18 +00001608/*************** HW Stats Get v1 **********************************/
1609#define BE_TXP_SW_SZ 48
1610struct be_port_rxf_stats_v1 {
1611 u32 rsvd0[12];
1612 u32 rx_crc_errors;
1613 u32 rx_alignment_symbol_errors;
1614 u32 rx_pause_frames;
1615 u32 rx_priority_pause_frames;
1616 u32 rx_control_frames;
1617 u32 rx_in_range_errors;
1618 u32 rx_out_range_errors;
1619 u32 rx_frame_too_long;
Suresh Reddy18fb06a2013-04-25 23:03:21 +00001620 u32 rx_address_filtered;
Ajit Khaparde89a88ab2011-05-16 07:36:18 +00001621 u32 rx_dropped_too_small;
1622 u32 rx_dropped_too_short;
1623 u32 rx_dropped_header_too_small;
1624 u32 rx_dropped_tcp_length;
1625 u32 rx_dropped_runt;
1626 u32 rsvd1[10];
1627 u32 rx_ip_checksum_errs;
1628 u32 rx_tcp_checksum_errs;
1629 u32 rx_udp_checksum_errs;
1630 u32 rsvd2[7];
1631 u32 rx_switched_unicast_packets;
1632 u32 rx_switched_multicast_packets;
1633 u32 rx_switched_broadcast_packets;
1634 u32 rsvd3[3];
1635 u32 tx_pauseframes;
1636 u32 tx_priority_pauseframes;
1637 u32 tx_controlframes;
1638 u32 rsvd4[10];
1639 u32 rxpp_fifo_overflow_drop;
1640 u32 rx_input_fifo_overflow_drop;
1641 u32 pmem_fifo_overflow_drop;
1642 u32 jabber_events;
1643 u32 rsvd5[3];
1644};
1645
1646
1647struct be_rxf_stats_v1 {
1648 struct be_port_rxf_stats_v1 port[4];
1649 u32 rsvd0[2];
1650 u32 rx_drops_no_pbuf;
1651 u32 rx_drops_no_txpb;
1652 u32 rx_drops_no_erx_descr;
1653 u32 rx_drops_no_tpre_descr;
1654 u32 rsvd1[6];
1655 u32 rx_drops_too_many_frags;
1656 u32 rx_drops_invalid_ring;
1657 u32 forwarded_packets;
1658 u32 rx_drops_mtu;
1659 u32 rsvd2[14];
1660};
1661
1662struct be_erx_stats_v1 {
1663 u32 rx_drops_no_fragments[68]; /* dwordS 0 to 67*/
1664 u32 rsvd[4];
1665};
1666
Ajit Khaparde61000862013-10-03 16:16:33 -05001667struct be_port_rxf_stats_v2 {
1668 u32 rsvd0[10];
1669 u32 roce_bytes_received_lsd;
1670 u32 roce_bytes_received_msd;
1671 u32 rsvd1[5];
1672 u32 roce_frames_received;
1673 u32 rx_crc_errors;
1674 u32 rx_alignment_symbol_errors;
1675 u32 rx_pause_frames;
1676 u32 rx_priority_pause_frames;
1677 u32 rx_control_frames;
1678 u32 rx_in_range_errors;
1679 u32 rx_out_range_errors;
1680 u32 rx_frame_too_long;
1681 u32 rx_address_filtered;
1682 u32 rx_dropped_too_small;
1683 u32 rx_dropped_too_short;
1684 u32 rx_dropped_header_too_small;
1685 u32 rx_dropped_tcp_length;
1686 u32 rx_dropped_runt;
1687 u32 rsvd2[10];
1688 u32 rx_ip_checksum_errs;
1689 u32 rx_tcp_checksum_errs;
1690 u32 rx_udp_checksum_errs;
1691 u32 rsvd3[7];
1692 u32 rx_switched_unicast_packets;
1693 u32 rx_switched_multicast_packets;
1694 u32 rx_switched_broadcast_packets;
1695 u32 rsvd4[3];
1696 u32 tx_pauseframes;
1697 u32 tx_priority_pauseframes;
1698 u32 tx_controlframes;
1699 u32 rsvd5[10];
1700 u32 rxpp_fifo_overflow_drop;
1701 u32 rx_input_fifo_overflow_drop;
1702 u32 pmem_fifo_overflow_drop;
1703 u32 jabber_events;
1704 u32 rsvd6[3];
1705 u32 rx_drops_payload_size;
1706 u32 rx_drops_clipped_header;
1707 u32 rx_drops_crc;
1708 u32 roce_drops_payload_len;
1709 u32 roce_drops_crc;
1710 u32 rsvd7[19];
1711};
1712
1713struct be_rxf_stats_v2 {
1714 struct be_port_rxf_stats_v2 port[4];
1715 u32 rsvd0[2];
1716 u32 rx_drops_no_pbuf;
1717 u32 rx_drops_no_txpb;
1718 u32 rx_drops_no_erx_descr;
1719 u32 rx_drops_no_tpre_descr;
1720 u32 rsvd1[6];
1721 u32 rx_drops_too_many_frags;
1722 u32 rx_drops_invalid_ring;
1723 u32 forwarded_packets;
1724 u32 rx_drops_mtu;
1725 u32 rsvd2[35];
1726};
1727
Ajit Khaparde89a88ab2011-05-16 07:36:18 +00001728struct be_hw_stats_v1 {
1729 struct be_rxf_stats_v1 rxf;
1730 u32 rsvd0[BE_TXP_SW_SZ];
1731 struct be_erx_stats_v1 erx;
1732 struct be_pmem_stats pmem;
Vasundhara Volam0b3f0e72012-06-13 19:51:45 +00001733 u32 rsvd1[18];
Ajit Khaparde89a88ab2011-05-16 07:36:18 +00001734};
1735
1736struct be_cmd_req_get_stats_v1 {
1737 struct be_cmd_req_hdr hdr;
1738 u8 rsvd[sizeof(struct be_hw_stats_v1)];
1739};
1740
1741struct be_cmd_resp_get_stats_v1 {
1742 struct be_cmd_resp_hdr hdr;
1743 struct be_hw_stats_v1 hw_stats;
1744};
1745
Ajit Khaparde61000862013-10-03 16:16:33 -05001746struct be_erx_stats_v2 {
1747 u32 rx_drops_no_fragments[136]; /* dwordS 0 to 135*/
1748 u32 rsvd[3];
1749};
1750
1751struct be_hw_stats_v2 {
1752 struct be_rxf_stats_v2 rxf;
1753 u32 rsvd0[BE_TXP_SW_SZ];
1754 struct be_erx_stats_v2 erx;
1755 struct be_pmem_stats pmem;
1756 u32 rsvd1[18];
1757};
1758
1759struct be_cmd_req_get_stats_v2 {
1760 struct be_cmd_req_hdr hdr;
1761 u8 rsvd[sizeof(struct be_hw_stats_v2)];
1762};
1763
1764struct be_cmd_resp_get_stats_v2 {
1765 struct be_cmd_resp_hdr hdr;
1766 struct be_hw_stats_v2 hw_stats;
1767};
1768
Somnath Kotur941a77d2012-05-17 22:59:03 +00001769/************** get fat capabilites *******************/
1770#define MAX_MODULES 27
1771#define MAX_MODES 4
1772#define MODE_UART 0
1773#define FW_LOG_LEVEL_DEFAULT 48
1774#define FW_LOG_LEVEL_FATAL 64
1775
1776struct ext_fat_mode {
1777 u8 mode;
1778 u8 rsvd0;
1779 u16 port_mask;
1780 u32 dbg_lvl;
1781 u64 fun_mask;
1782} __packed;
1783
1784struct ext_fat_modules {
1785 u8 modules_str[32];
1786 u32 modules_id;
1787 u32 num_modes;
1788 struct ext_fat_mode trace_lvl[MAX_MODES];
1789} __packed;
1790
1791struct be_fat_conf_params {
1792 u32 max_log_entries;
1793 u32 log_entry_size;
1794 u8 log_type;
1795 u8 max_log_funs;
1796 u8 max_log_ports;
1797 u8 rsvd0;
1798 u32 supp_modes;
1799 u32 num_modules;
1800 struct ext_fat_modules module[MAX_MODULES];
1801} __packed;
1802
1803struct be_cmd_req_get_ext_fat_caps {
1804 struct be_cmd_req_hdr hdr;
1805 u32 parameter_type;
1806};
1807
1808struct be_cmd_resp_get_ext_fat_caps {
1809 struct be_cmd_resp_hdr hdr;
1810 struct be_fat_conf_params get_params;
1811};
1812
1813struct be_cmd_req_set_ext_fat_caps {
1814 struct be_cmd_req_hdr hdr;
1815 struct be_fat_conf_params set_params;
1816};
1817
Vasundhara Volam150d58c2013-08-27 16:57:31 +05301818#define RESOURCE_DESC_SIZE_V0 72
1819#define RESOURCE_DESC_SIZE_V1 88
1820#define PCIE_RESOURCE_DESC_TYPE_V0 0x40
Vasundhara Volama05f99d2013-04-21 23:28:17 +00001821#define NIC_RESOURCE_DESC_TYPE_V0 0x41
Vasundhara Volam150d58c2013-08-27 16:57:31 +05301822#define PCIE_RESOURCE_DESC_TYPE_V1 0x50
Vasundhara Volama05f99d2013-04-21 23:28:17 +00001823#define NIC_RESOURCE_DESC_TYPE_V1 0x51
Vasundhara Volamf93f1602014-02-12 16:09:25 +05301824#define PORT_RESOURCE_DESC_TYPE_V1 0x55
Vasundhara Volam150d58c2013-08-27 16:57:31 +05301825#define MAX_RESOURCE_DESC 264
Padmanabh Ratnakard5c18472012-10-20 06:01:53 +00001826
1827/* QOS unit number */
1828#define QUN 4
1829/* Immediate */
1830#define IMM 6
1831/* No save */
1832#define NOSV 7
1833
Vasundhara Volam150d58c2013-08-27 16:57:31 +05301834struct be_res_desc_hdr {
Padmanabh Ratnakarabb93952012-10-20 06:01:41 +00001835 u8 desc_type;
1836 u8 desc_len;
Vasundhara Volam150d58c2013-08-27 16:57:31 +05301837} __packed;
1838
1839struct be_pcie_res_desc {
1840 struct be_res_desc_hdr hdr;
1841 u8 rsvd0;
1842 u8 flags;
1843 u16 rsvd1;
1844 u8 pf_num;
1845 u8 rsvd2;
1846 u32 rsvd3;
1847 u8 sriov_state;
1848 u8 pf_state;
1849 u8 pf_type;
1850 u8 rsvd4;
1851 u16 num_vfs;
1852 u16 rsvd5;
1853 u32 rsvd6[17];
1854} __packed;
1855
1856struct be_nic_res_desc {
1857 struct be_res_desc_hdr hdr;
Padmanabh Ratnakarabb93952012-10-20 06:01:41 +00001858 u8 rsvd1;
1859 u8 flags;
1860 u8 vf_num;
1861 u8 rsvd2;
1862 u8 pf_num;
1863 u8 rsvd3;
1864 u16 unicast_mac_count;
1865 u8 rsvd4[6];
1866 u16 mcc_count;
1867 u16 vlan_count;
1868 u16 mcast_mac_count;
1869 u16 txq_count;
1870 u16 rq_count;
1871 u16 rssq_count;
1872 u16 lro_count;
1873 u16 cq_count;
1874 u16 toe_conn_count;
1875 u16 eq_count;
1876 u32 rsvd5;
1877 u32 cap_flags;
1878 u8 link_param;
1879 u8 rsvd6[3];
1880 u32 bw_min;
1881 u32 bw_max;
1882 u8 acpi_params;
1883 u8 wol_param;
1884 u16 rsvd7;
Ajit Khaparded44517fd2013-09-27 15:17:31 -05001885 u32 rsvd8[7];
Vasundhara Volam150d58c2013-08-27 16:57:31 +05301886} __packed;
Padmanabh Ratnakarabb93952012-10-20 06:01:41 +00001887
Vasundhara Volamf93f1602014-02-12 16:09:25 +05301888/************ Multi-Channel type ***********/
1889enum mc_type {
1890 MC_NONE = 0x01,
1891 UMC = 0x02,
1892 FLEX10 = 0x03,
1893 vNIC1 = 0x04,
1894 nPAR = 0x05,
1895 UFP = 0x06,
1896 vNIC2 = 0x07
1897};
1898
1899struct be_port_res_desc {
1900 struct be_res_desc_hdr hdr;
1901 u8 rsvd0;
1902 u8 flags;
1903 u8 rsvd1;
1904 u8 mc_type;
1905 u16 rsvd2;
1906 u32 rsvd3[20];
1907} __packed;
1908
1909/* Is BE in a multi-channel mode */
1910static inline bool be_is_mc(struct be_adapter *adapter)
1911{
1912 return adapter->mc_type > MC_NONE;
1913}
1914
Padmanabh Ratnakarabb93952012-10-20 06:01:41 +00001915struct be_cmd_req_get_func_config {
1916 struct be_cmd_req_hdr hdr;
1917};
1918
1919struct be_cmd_resp_get_func_config {
Kalesh AP28710c52013-04-28 22:21:13 +00001920 struct be_cmd_resp_hdr hdr;
Padmanabh Ratnakarabb93952012-10-20 06:01:41 +00001921 u32 desc_count;
Vasundhara Volam150d58c2013-08-27 16:57:31 +05301922 u8 func_param[MAX_RESOURCE_DESC * RESOURCE_DESC_SIZE_V1];
Padmanabh Ratnakarabb93952012-10-20 06:01:41 +00001923};
1924
1925#define ACTIVE_PROFILE_TYPE 0x2
1926struct be_cmd_req_get_profile_config {
1927 struct be_cmd_req_hdr hdr;
1928 u8 rsvd;
1929 u8 type;
1930 u16 rsvd1;
1931};
1932
1933struct be_cmd_resp_get_profile_config {
Vasundhara Volam150d58c2013-08-27 16:57:31 +05301934 struct be_cmd_resp_hdr hdr;
Padmanabh Ratnakarabb93952012-10-20 06:01:41 +00001935 u32 desc_count;
Vasundhara Volam150d58c2013-08-27 16:57:31 +05301936 u8 func_param[MAX_RESOURCE_DESC * RESOURCE_DESC_SIZE_V1];
Vasundhara Volama05f99d2013-04-21 23:28:17 +00001937};
1938
Padmanabh Ratnakard5c18472012-10-20 06:01:53 +00001939struct be_cmd_req_set_profile_config {
1940 struct be_cmd_req_hdr hdr;
1941 u32 rsvd;
1942 u32 desc_count;
Vasundhara Volam150d58c2013-08-27 16:57:31 +05301943 struct be_nic_res_desc nic_desc;
Padmanabh Ratnakard5c18472012-10-20 06:01:53 +00001944};
1945
1946struct be_cmd_resp_set_profile_config {
Vasundhara Volam150d58c2013-08-27 16:57:31 +05301947 struct be_cmd_resp_hdr hdr;
Padmanabh Ratnakard5c18472012-10-20 06:01:53 +00001948};
1949
Vasundhara Volam542963b2014-01-15 13:23:33 +05301950struct be_cmd_req_get_active_profile {
1951 struct be_cmd_req_hdr hdr;
1952 u32 rsvd;
1953} __packed;
1954
1955struct be_cmd_resp_get_active_profile {
1956 struct be_cmd_resp_hdr hdr;
1957 u16 active_profile_id;
1958 u16 next_profile_id;
1959} __packed;
1960
Padmanabh Ratnakardcf7ebb2012-10-20 06:03:49 +00001961struct be_cmd_enable_disable_vf {
1962 struct be_cmd_req_hdr hdr;
1963 u8 enable;
1964 u8 rsvd[3];
1965};
1966
Somnath Kotur68c45a22013-03-14 02:42:07 +00001967struct be_cmd_req_intr_set {
1968 struct be_cmd_req_hdr hdr;
1969 u8 intr_enabled;
1970 u8 rsvd[3];
1971};
1972
Padmanabh Ratnakarf25b1192012-10-20 06:02:52 +00001973static inline bool check_privilege(struct be_adapter *adapter, u32 flags)
1974{
1975 return flags & adapter->cmd_privileges ? true : false;
1976}
1977
Sathya Perla4c876612013-02-03 20:30:11 +00001978/************** Get IFACE LIST *******************/
1979struct be_if_desc {
1980 u32 if_id;
1981 u32 cap_flags;
1982 u32 en_flags;
1983};
1984
1985struct be_cmd_req_get_iface_list {
1986 struct be_cmd_req_hdr hdr;
1987};
1988
1989struct be_cmd_resp_get_iface_list {
1990 struct be_cmd_req_hdr hdr;
1991 u32 if_cnt;
1992 struct be_if_desc if_desc;
1993};
1994
Suresh Reddybdce2ad2014-03-11 18:53:04 +05301995/*************** Set logical link ********************/
1996#define PLINK_TRACK_SHIFT 8
1997struct be_cmd_req_set_ll_link {
1998 struct be_cmd_req_hdr hdr;
1999 u32 link_config; /* Bit 0: UP_DOWN, Bit 9: PLINK */
2000};
2001
Joe Perches31886e82013-09-23 15:11:36 -07002002int be_pci_fnum_get(struct be_adapter *adapter);
2003int be_fw_wait_ready(struct be_adapter *adapter);
2004int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
2005 bool permanent, u32 if_handle, u32 pmac_id);
2006int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr, u32 if_id,
2007 u32 *pmac_id, u32 domain);
2008int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, int pmac_id,
2009 u32 domain);
2010int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags,
2011 u32 *if_handle, u32 domain);
2012int be_cmd_if_destroy(struct be_adapter *adapter, int if_handle, u32 domain);
2013int be_cmd_eq_create(struct be_adapter *adapter, struct be_eq_obj *eqo);
2014int be_cmd_cq_create(struct be_adapter *adapter, struct be_queue_info *cq,
2015 struct be_queue_info *eq, bool no_delay,
2016 int num_cqe_dma_coalesce);
2017int be_cmd_mccq_create(struct be_adapter *adapter, struct be_queue_info *mccq,
2018 struct be_queue_info *cq);
2019int be_cmd_txq_create(struct be_adapter *adapter, struct be_tx_obj *txo);
2020int be_cmd_rxq_create(struct be_adapter *adapter, struct be_queue_info *rxq,
2021 u16 cq_id, u16 frag_size, u32 if_id, u32 rss, u8 *rss_id);
2022int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q,
2023 int type);
2024int be_cmd_rxq_destroy(struct be_adapter *adapter, struct be_queue_info *q);
2025int be_cmd_link_status_query(struct be_adapter *adapter, u16 *link_speed,
2026 u8 *link_status, u32 dom);
2027int be_cmd_reset(struct be_adapter *adapter);
2028int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd);
2029int lancer_cmd_get_pport_stats(struct be_adapter *adapter,
2030 struct be_dma_mem *nonemb_cmd);
2031int be_cmd_get_fw_ver(struct be_adapter *adapter, char *fw_ver,
2032 char *fw_on_flash);
Sathya Perla2632baf2013-10-01 16:00:00 +05302033int be_cmd_modify_eqd(struct be_adapter *adapter, struct be_set_eqd *, int num);
Joe Perches31886e82013-09-23 15:11:36 -07002034int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id, u16 *vtag_array,
Ajit Khaparde012bd382013-11-18 10:44:24 -06002035 u32 num, bool promiscuous);
Joe Perches31886e82013-09-23 15:11:36 -07002036int be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 status);
2037int be_cmd_set_flow_control(struct be_adapter *adapter, u32 tx_fc, u32 rx_fc);
2038int be_cmd_get_flow_control(struct be_adapter *adapter, u32 *tx_fc, u32 *rx_fc);
2039int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num,
Vasundhara Volam0ad31572013-04-21 23:28:16 +00002040 u32 *function_mode, u32 *function_caps, u16 *asic_rev);
Joe Perches31886e82013-09-23 15:11:36 -07002041int be_cmd_reset_function(struct be_adapter *adapter);
2042int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable,
2043 u32 rss_hash_opts, u16 table_size);
2044int be_process_mcc(struct be_adapter *adapter);
2045int be_cmd_set_beacon_state(struct be_adapter *adapter, u8 port_num, u8 beacon,
2046 u8 status, u8 state);
2047int be_cmd_get_beacon_state(struct be_adapter *adapter, u8 port_num,
2048 u32 *state);
2049int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd,
2050 u32 flash_oper, u32 flash_opcode, u32 buf_size);
2051int lancer_cmd_write_object(struct be_adapter *adapter, struct be_dma_mem *cmd,
2052 u32 data_size, u32 data_offset,
2053 const char *obj_name, u32 *data_written,
2054 u8 *change_status, u8 *addn_status);
Padmanabh Ratnakarde49bd52011-11-16 02:02:43 +00002055int lancer_cmd_read_object(struct be_adapter *adapter, struct be_dma_mem *cmd,
Joe Perches31886e82013-09-23 15:11:36 -07002056 u32 data_size, u32 data_offset, const char *obj_name,
2057 u32 *data_read, u32 *eof, u8 *addn_status);
Ajit Khaparde3f0d4562010-02-09 01:30:35 +00002058int be_cmd_get_flash_crc(struct be_adapter *adapter, u8 *flashed_crc,
Joe Perches31886e82013-09-23 15:11:36 -07002059 int offset);
2060int be_cmd_enable_magic_wol(struct be_adapter *adapter, u8 *mac,
2061 struct be_dma_mem *nonemb_cmd);
2062int be_cmd_fw_init(struct be_adapter *adapter);
2063int be_cmd_fw_clean(struct be_adapter *adapter);
2064void be_async_mcc_enable(struct be_adapter *adapter);
2065void be_async_mcc_disable(struct be_adapter *adapter);
2066int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num,
2067 u32 loopback_type, u32 pkt_size, u32 num_pkts,
2068 u64 pattern);
2069int be_cmd_ddr_dma_test(struct be_adapter *adapter, u64 pattern, u32 byte_cnt,
2070 struct be_dma_mem *cmd);
2071int be_cmd_get_seeprom_data(struct be_adapter *adapter,
2072 struct be_dma_mem *nonemb_cmd);
2073int be_cmd_set_loopback(struct be_adapter *adapter, u8 port_num,
2074 u8 loopback_type, u8 enable);
2075int be_cmd_get_phy_info(struct be_adapter *adapter);
2076int be_cmd_set_qos(struct be_adapter *adapter, u32 bps, u32 domain);
2077void be_detect_error(struct be_adapter *adapter);
2078int be_cmd_get_die_temperature(struct be_adapter *adapter);
2079int be_cmd_get_cntl_attributes(struct be_adapter *adapter);
2080int be_cmd_req_native_mode(struct be_adapter *adapter);
2081int be_cmd_get_reg_len(struct be_adapter *adapter, u32 *log_size);
2082void be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf);
2083int be_cmd_get_fn_privileges(struct be_adapter *adapter, u32 *privilege,
2084 u32 domain);
2085int be_cmd_set_fn_privileges(struct be_adapter *adapter, u32 privileges,
2086 u32 vf_num);
2087int be_cmd_get_mac_from_list(struct be_adapter *adapter, u8 *mac,
Suresh Reddyb188f092014-01-15 13:23:39 +05302088 bool *pmac_id_active, u32 *pmac_id,
2089 u32 if_handle, u8 domain);
2090int be_cmd_get_active_mac(struct be_adapter *adapter, u32 pmac_id, u8 *mac,
2091 u32 if_handle, bool active, u32 domain);
Joe Perches31886e82013-09-23 15:11:36 -07002092int be_cmd_get_perm_mac(struct be_adapter *adapter, u8 *mac);
2093int be_cmd_set_mac_list(struct be_adapter *adapter, u8 *mac_array, u8 mac_count,
2094 u32 domain);
2095int be_cmd_set_mac(struct be_adapter *adapter, u8 *mac, int if_id, u32 dom);
2096int be_cmd_set_hsw_config(struct be_adapter *adapter, u16 pvid, u32 domain,
2097 u16 intf_id, u16 hsw_mode);
2098int be_cmd_get_hsw_config(struct be_adapter *adapter, u16 *pvid, u32 domain,
2099 u16 intf_id, u8 *mode);
2100int be_cmd_get_acpi_wol_cap(struct be_adapter *adapter);
Vasundhara Volambaaa08d2014-01-15 13:23:34 +05302101int be_cmd_set_fw_log_level(struct be_adapter *adapter, u32 level);
2102int be_cmd_get_fw_log_level(struct be_adapter *adapter);
Joe Perches31886e82013-09-23 15:11:36 -07002103int be_cmd_get_ext_fat_capabilites(struct be_adapter *adapter,
2104 struct be_dma_mem *cmd);
2105int be_cmd_set_ext_fat_capabilites(struct be_adapter *adapter,
2106 struct be_dma_mem *cmd,
2107 struct be_fat_conf_params *cfgs);
Joe Perches31886e82013-09-23 15:11:36 -07002108int lancer_physdev_ctrl(struct be_adapter *adapter, u32 mask);
2109int lancer_initiate_dump(struct be_adapter *adapter);
2110bool dump_present(struct be_adapter *adapter);
2111int lancer_test_and_set_rdy_state(struct be_adapter *adapter);
2112int be_cmd_query_port_name(struct be_adapter *adapter, u8 *port_name);
Sathya Perla92bf14a2013-08-27 16:57:32 +05302113int be_cmd_get_func_config(struct be_adapter *adapter,
2114 struct be_resources *res);
2115int be_cmd_get_profile_config(struct be_adapter *adapter,
2116 struct be_resources *res, u8 domain);
Joe Perches31886e82013-09-23 15:11:36 -07002117int be_cmd_set_profile_config(struct be_adapter *adapter, u32 bps, u8 domain);
Vasundhara Volam542963b2014-01-15 13:23:33 +05302118int be_cmd_get_active_profile(struct be_adapter *adapter, u16 *profile);
Joe Perches31886e82013-09-23 15:11:36 -07002119int be_cmd_get_if_id(struct be_adapter *adapter, struct be_vf_cfg *vf_cfg,
2120 int vf_num);
2121int be_cmd_enable_vf(struct be_adapter *adapter, u8 domain);
2122int be_cmd_intr_set(struct be_adapter *adapter, bool intr_enable);
Suresh Reddybdce2ad2014-03-11 18:53:04 +05302123int be_cmd_set_logical_link_config(struct be_adapter *adapter,
2124 int link_state, u8 domain);