Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 1 | /* |
Vasundhara Volam | 4026382 | 2014-02-12 16:09:07 +0530 | [diff] [blame] | 2 | * Copyright (C) 2005 - 2014 Emulex |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 3 | * 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 Khaparde | d2145cd | 2011-03-16 08:20:46 +0000 | [diff] [blame] | 11 | * linux-drivers@emulex.com |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 12 | * |
Ajit Khaparde | d2145cd | 2011-03-16 08:20:46 +0000 | [diff] [blame] | 13 | * Emulex |
| 14 | * 3333 Susan Street |
| 15 | * Costa Mesa, CA 92626 |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 16 | */ |
| 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 | |
| 26 | struct 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 */ |
| 35 | struct 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 */ |
| 53 | enum { |
Sathya Perla | 2b3f291 | 2011-06-29 23:32:56 +0000 | [diff] [blame] | 54 | 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 Khaparde | 4964384 | 2009-10-05 02:22:05 +0000 | [diff] [blame] | 60 | MCC_STATUS_NOT_SUPPORTED = 66 |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 61 | }; |
| 62 | |
Ajit Khaparde | d9d604f | 2013-09-27 15:17:58 -0500 | [diff] [blame] | 63 | #define MCC_ADDL_STS_INSUFFICIENT_RESOURCES 0x16 |
| 64 | |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 65 | #define CQE_STATUS_COMPL_MASK 0xFFFF |
| 66 | #define CQE_STATUS_COMPL_SHIFT 0 /* bits 0 - 15 */ |
| 67 | #define CQE_STATUS_EXTD_MASK 0xFFFF |
Sathya Perla | f5209b4 | 2009-11-06 00:31:01 -0800 | [diff] [blame] | 68 | #define CQE_STATUS_EXTD_SHIFT 16 /* bits 16 - 31 */ |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 69 | |
Sathya Perla | efd2e40 | 2009-07-27 22:53:10 +0000 | [diff] [blame] | 70 | struct be_mcc_compl { |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 71 | u32 status; /* dword 0 */ |
| 72 | u32 tag0; /* dword 1 */ |
| 73 | u32 tag1; /* dword 2 */ |
| 74 | u32 flags; /* dword 3 */ |
| 75 | }; |
| 76 | |
Sathya Perla | a8f447bd | 2009-06-18 00:10:27 +0000 | [diff] [blame] | 77 | /* 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 Kotur | cc4ce02 | 2010-10-21 07:11:14 -0700 | [diff] [blame] | 82 | #define ASYNC_TRAILER_EVENT_TYPE_SHIFT 16 |
| 83 | #define ASYNC_TRAILER_EVENT_TYPE_MASK 0xFF |
Sathya Perla | a8f447bd | 2009-06-18 00:10:27 +0000 | [diff] [blame] | 84 | #define ASYNC_EVENT_CODE_LINK_STATE 0x1 |
Somnath Kotur | cc4ce02 | 2010-10-21 07:11:14 -0700 | [diff] [blame] | 85 | #define ASYNC_EVENT_CODE_GRP_5 0x5 |
| 86 | #define ASYNC_EVENT_QOS_SPEED 0x1 |
| 87 | #define ASYNC_EVENT_COS_PRIORITY 0x2 |
Ajit Khaparde | 3968fa1 | 2011-02-20 11:41:53 +0000 | [diff] [blame] | 88 | #define ASYNC_EVENT_PVID_STATE 0x3 |
Ajit Khaparde | bc0c340 | 2013-04-24 11:52:50 +0000 | [diff] [blame] | 89 | #define ASYNC_EVENT_CODE_QNQ 0x6 |
| 90 | #define ASYNC_DEBUG_EVENT_TYPE_QNQ 1 |
| 91 | |
Sathya Perla | a8f447bd | 2009-06-18 00:10:27 +0000 | [diff] [blame] | 92 | struct be_async_event_trailer { |
| 93 | u32 code; |
| 94 | }; |
| 95 | |
| 96 | enum { |
Sathya Perla | ea172a0 | 2011-08-02 19:57:42 +0000 | [diff] [blame] | 97 | LINK_DOWN = 0x0, |
| 98 | LINK_UP = 0x1 |
Sathya Perla | a8f447bd | 2009-06-18 00:10:27 +0000 | [diff] [blame] | 99 | }; |
Sathya Perla | ea172a0 | 2011-08-02 19:57:42 +0000 | [diff] [blame] | 100 | #define LINK_STATUS_MASK 0x1 |
Padmanabh Ratnakar | 2e177a5 | 2012-07-18 02:52:15 +0000 | [diff] [blame] | 101 | #define LOGICAL_LINK_STATUS_MASK 0x2 |
Sathya Perla | a8f447bd | 2009-06-18 00:10:27 +0000 | [diff] [blame] | 102 | |
| 103 | /* When the event code of an async trailer is link-state, the mcc_compl |
| 104 | * must be interpreted as follows |
| 105 | */ |
| 106 | struct 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 Kotur | cc4ce02 | 2010-10-21 07:11:14 -0700 | [diff] [blame] | 116 | /* 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 | */ |
| 119 | struct 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 | */ |
| 130 | struct 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 Khaparde | 3968fa1 | 2011-02-20 11:41:53 +0000 | [diff] [blame] | 140 | /* 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 | */ |
| 143 | struct 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 Khaparde | bc0c340 | 2013-04-24 11:52:50 +0000 | [diff] [blame] | 152 | /* async event indicating outer VLAN tag in QnQ */ |
| 153 | struct 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 Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 162 | struct be_mcc_mailbox { |
| 163 | struct be_mcc_wrb wrb; |
Sathya Perla | efd2e40 | 2009-07-27 22:53:10 +0000 | [diff] [blame] | 164 | struct be_mcc_compl compl; |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 165 | }; |
| 166 | |
| 167 | #define CMD_SUBSYSTEM_COMMON 0x1 |
| 168 | #define CMD_SUBSYSTEM_ETH 0x3 |
Suresh R | ff33a6e | 2009-12-03 16:15:52 -0800 | [diff] [blame] | 169 | #define CMD_SUBSYSTEM_LOWLEVEL 0xb |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 170 | |
| 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 Bandi | fa9a6fe | 2009-11-20 14:23:47 -0800 | [diff] [blame] | 176 | #define OPCODE_COMMON_READ_FLASHROM 6 |
Ajit Khaparde | 8451748 | 2009-09-04 03:12:16 +0000 | [diff] [blame] | 177 | #define OPCODE_COMMON_WRITE_FLASHROM 7 |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 178 | #define OPCODE_COMMON_CQ_CREATE 12 |
| 179 | #define OPCODE_COMMON_EQ_CREATE 13 |
Somnath Kotur | cc4ce02 | 2010-10-21 07:11:14 -0700 | [diff] [blame] | 180 | #define OPCODE_COMMON_MCC_CREATE 21 |
Ajit Khaparde | e1d1873 | 2010-07-23 01:52:13 +0000 | [diff] [blame] | 181 | #define OPCODE_COMMON_SET_QOS 28 |
Somnath Kotur | cc4ce02 | 2010-10-21 07:11:14 -0700 | [diff] [blame] | 182 | #define OPCODE_COMMON_MCC_CREATE_EXT 90 |
Sarveshwar Bandi | 368c0ca | 2010-01-08 00:07:27 -0800 | [diff] [blame] | 183 | #define OPCODE_COMMON_SEEPROM_READ 30 |
Ajit Khaparde | 9e1453c | 2011-02-20 11:42:22 +0000 | [diff] [blame] | 184 | #define OPCODE_COMMON_GET_CNTL_ATTRIBUTES 32 |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 185 | #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 Perla | 5fb379e | 2009-06-18 00:02:59 +0000 | [diff] [blame] | 194 | #define OPCODE_COMMON_MCC_DESTROY 53 |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 195 | #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 |
sarveshwarb | 14074ea | 2009-08-05 13:05:24 -0700 | [diff] [blame] | 200 | #define OPCODE_COMMON_FUNCTION_RESET 61 |
Somnath Kotur | 311fddc | 2011-03-16 21:22:43 +0000 | [diff] [blame] | 201 | #define OPCODE_COMMON_MANAGE_FAT 68 |
Sarveshwar Bandi | fad9ab2 | 2009-10-12 04:23:15 -0700 | [diff] [blame] | 202 | #define OPCODE_COMMON_ENABLE_DISABLE_BEACON 69 |
| 203 | #define OPCODE_COMMON_GET_BEACON_STATE 70 |
Sarveshwar Bandi | 0388f25 | 2009-10-28 04:15:20 -0700 | [diff] [blame] | 204 | #define OPCODE_COMMON_READ_TRANSRECV_DATA 73 |
Padmanabh Ratnakar | b4e32a7 | 2012-07-12 03:57:35 +0000 | [diff] [blame] | 205 | #define OPCODE_COMMON_GET_PORT_NAME 77 |
Suresh Reddy | bdce2ad | 2014-03-11 18:53:04 +0530 | [diff] [blame^] | 206 | #define OPCODE_COMMON_SET_LOGICAL_LINK_CONFIG 80 |
Somnath Kotur | 68c45a2 | 2013-03-14 02:42:07 +0000 | [diff] [blame] | 207 | #define OPCODE_COMMON_SET_INTERRUPT_ENABLE 89 |
Sathya Perla | 04a0602 | 2013-07-23 15:25:00 +0530 | [diff] [blame] | 208 | #define OPCODE_COMMON_SET_FN_PRIVILEGES 100 |
Ajit Khaparde | ee3cb62 | 2010-07-01 03:51:00 +0000 | [diff] [blame] | 209 | #define OPCODE_COMMON_GET_PHY_DETAILS 102 |
Sathya Perla | 2e588f8 | 2011-03-11 02:49:26 +0000 | [diff] [blame] | 210 | #define OPCODE_COMMON_SET_DRIVER_FUNCTION_CAP 103 |
Ajit Khaparde | 609ff3b | 2011-02-20 11:42:07 +0000 | [diff] [blame] | 211 | #define OPCODE_COMMON_GET_CNTL_ADDITIONAL_ATTRIBUTES 121 |
Somnath Kotur | 941a77d | 2012-05-17 22:59:03 +0000 | [diff] [blame] | 212 | #define OPCODE_COMMON_GET_EXT_FAT_CAPABILITES 125 |
| 213 | #define OPCODE_COMMON_SET_EXT_FAT_CAPABILITES 126 |
Padmanabh Ratnakar | 590c391 | 2011-11-25 05:47:26 +0000 | [diff] [blame] | 214 | #define OPCODE_COMMON_GET_MAC_LIST 147 |
| 215 | #define OPCODE_COMMON_SET_MAC_LIST 148 |
Ajit Khaparde | f1f3ee1 | 2012-03-18 06:23:41 +0000 | [diff] [blame] | 216 | #define OPCODE_COMMON_GET_HSW_CONFIG 152 |
Padmanabh Ratnakar | abb9395 | 2012-10-20 06:01:41 +0000 | [diff] [blame] | 217 | #define OPCODE_COMMON_GET_FUNC_CONFIG 160 |
| 218 | #define OPCODE_COMMON_GET_PROFILE_CONFIG 164 |
Padmanabh Ratnakar | d5c1847 | 2012-10-20 06:01:53 +0000 | [diff] [blame] | 219 | #define OPCODE_COMMON_SET_PROFILE_CONFIG 165 |
Vasundhara Volam | 542963b | 2014-01-15 13:23:33 +0530 | [diff] [blame] | 220 | #define OPCODE_COMMON_GET_ACTIVE_PROFILE 167 |
Ajit Khaparde | f1f3ee1 | 2012-03-18 06:23:41 +0000 | [diff] [blame] | 221 | #define OPCODE_COMMON_SET_HSW_CONFIG 153 |
Padmanabh Ratnakar | f25b119 | 2012-10-20 06:02:52 +0000 | [diff] [blame] | 222 | #define OPCODE_COMMON_GET_FN_PRIVILEGES 170 |
Padmanabh Ratnakar | de49bd5 | 2011-11-16 02:02:43 +0000 | [diff] [blame] | 223 | #define OPCODE_COMMON_READ_OBJECT 171 |
Shripad Nunjundarao | 485bf56 | 2011-05-16 07:36:59 +0000 | [diff] [blame] | 224 | #define OPCODE_COMMON_WRITE_OBJECT 172 |
Sathya Perla | 4c87661 | 2013-02-03 20:30:11 +0000 | [diff] [blame] | 225 | #define OPCODE_COMMON_GET_IFACE_LIST 194 |
Padmanabh Ratnakar | dcf7ebb | 2012-10-20 06:03:49 +0000 | [diff] [blame] | 226 | #define OPCODE_COMMON_ENABLE_DISABLE_VF 196 |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 227 | |
Sathya Perla | 3abcded | 2010-10-03 22:12:27 -0700 | [diff] [blame] | 228 | #define OPCODE_ETH_RSS_CONFIG 1 |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 229 | #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 Khaparde | 71d8d1b | 2009-12-03 06:16:59 +0000 | [diff] [blame] | 236 | #define OPCODE_ETH_ACPI_WOL_MAGIC_CONFIG 12 |
Selvin Xavier | 005d569 | 2011-05-16 07:36:35 +0000 | [diff] [blame] | 237 | #define OPCODE_ETH_GET_PPORT_STATS 18 |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 238 | |
Suresh R | ff33a6e | 2009-12-03 16:15:52 -0800 | [diff] [blame] | 239 | #define OPCODE_LOWLEVEL_HOST_DDR_DMA 17 |
| 240 | #define OPCODE_LOWLEVEL_LOOPBACK_TEST 18 |
Sarveshwar Bandi | fced999 | 2009-12-23 04:41:44 +0000 | [diff] [blame] | 241 | #define OPCODE_LOWLEVEL_SET_LOOPBACK_MODE 19 |
Suresh R | ff33a6e | 2009-12-03 16:15:52 -0800 | [diff] [blame] | 242 | |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 243 | struct 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 Khaparde | 7b139c8 | 2010-01-27 21:56:44 +0000 | [diff] [blame] | 250 | u8 version; /* dword 3 */ |
| 251 | u8 rsvd[3]; /* dword 3 */ |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 252 | }; |
| 253 | |
| 254 | #define RESP_HDR_INFO_OPCODE_SHIFT 0 /* bits 0 - 7 */ |
| 255 | #define RESP_HDR_INFO_SUBSYS_SHIFT 8 /* bits 8 - 15 */ |
| 256 | struct be_cmd_resp_hdr { |
Padmanabh Ratnakar | 652bf64 | 2012-04-25 01:47:03 +0000 | [diff] [blame] | 257 | 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 Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 263 | u32 response_length; /* dword 2 */ |
| 264 | u32 actual_resp_len; /* dword 3 */ |
| 265 | }; |
| 266 | |
| 267 | struct 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 */ |
| 278 | struct 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 | |
| 303 | struct 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 | |
| 311 | struct be_cmd_resp_eq_create { |
| 312 | struct be_cmd_resp_hdr resp_hdr; |
| 313 | u16 eq_id; /* sword */ |
Sathya Perla | f2f781a | 2013-08-27 16:57:30 +0530 | [diff] [blame] | 314 | u16 msix_idx; /* available only in v2 */ |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 315 | } __packed; |
| 316 | |
| 317 | /******************** Mac query ***************************/ |
| 318 | enum { |
| 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 | |
| 325 | struct mac_addr { |
| 326 | u16 size_of_struct; |
| 327 | u8 addr[ETH_ALEN]; |
| 328 | } __packed; |
| 329 | |
| 330 | struct be_cmd_req_mac_query { |
| 331 | struct be_cmd_req_hdr hdr; |
| 332 | u8 type; |
| 333 | u8 permanent; |
| 334 | u16 if_id; |
Padmanabh Ratnakar | 590c391 | 2011-11-25 05:47:26 +0000 | [diff] [blame] | 335 | u32 pmac_id; |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 336 | } __packed; |
| 337 | |
| 338 | struct be_cmd_resp_mac_query { |
| 339 | struct be_cmd_resp_hdr hdr; |
| 340 | struct mac_addr mac; |
| 341 | }; |
| 342 | |
| 343 | /******************** PMac Add ***************************/ |
| 344 | struct 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 | |
| 351 | struct be_cmd_resp_pmac_add { |
| 352 | struct be_cmd_resp_hdr hdr; |
| 353 | u32 pmac_id; |
| 354 | }; |
| 355 | |
| 356 | /******************** PMac Del ***************************/ |
| 357 | struct 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 Perla | fe6d2a3 | 2010-11-21 23:25:50 +0000 | [diff] [blame] | 366 | struct amap_cq_context_be { |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 367 | 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 Khaparde | bbdc42f | 2013-05-01 09:37:17 +0000 | [diff] [blame] | 389 | struct amap_cq_context_v2 { |
Sathya Perla | fe6d2a3 | 2010-11-21 23:25:50 +0000 | [diff] [blame] | 390 | 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 Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 405 | struct be_cmd_req_cq_create { |
| 406 | struct be_cmd_req_hdr hdr; |
| 407 | u16 num_pages; |
Sathya Perla | fe6d2a3 | 2010-11-21 23:25:50 +0000 | [diff] [blame] | 408 | u8 page_size; |
| 409 | u8 rsvd0; |
| 410 | u8 context[sizeof(struct amap_cq_context_be) / 8]; |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 411 | struct phys_addr pages[8]; |
| 412 | } __packed; |
| 413 | |
Sathya Perla | fe6d2a3 | 2010-11-21 23:25:50 +0000 | [diff] [blame] | 414 | |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 415 | struct be_cmd_resp_cq_create { |
| 416 | struct be_cmd_resp_hdr hdr; |
| 417 | u16 cq_id; |
| 418 | u16 rsvd0; |
| 419 | } __packed; |
| 420 | |
Somnath Kotur | 311fddc | 2011-03-16 21:22:43 +0000 | [diff] [blame] | 421 | struct 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 | |
| 430 | struct 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 Perla | 5fb379e | 2009-06-18 00:02:59 +0000 | [diff] [blame] | 439 | /******************** 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 Perla | fe6d2a3 | 2010-11-21 23:25:50 +0000 | [diff] [blame] | 442 | struct amap_mcc_context_be { |
Sathya Perla | 5fb379e | 2009-06-18 00:02:59 +0000 | [diff] [blame] | 443 | 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 Volam | 666d39c | 2014-01-15 13:23:31 +0530 | [diff] [blame] | 457 | struct amap_mcc_context_v1 { |
Sathya Perla | fe6d2a3 | 2010-11-21 23:25:50 +0000 | [diff] [blame] | 458 | 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 Perla | 5fb379e | 2009-06-18 00:02:59 +0000 | [diff] [blame] | 468 | struct be_cmd_req_mcc_create { |
| 469 | struct be_cmd_req_hdr hdr; |
| 470 | u16 num_pages; |
Sathya Perla | fe6d2a3 | 2010-11-21 23:25:50 +0000 | [diff] [blame] | 471 | u16 cq_id; |
Somnath Kotur | 34b1ef0 | 2011-06-01 00:33:22 +0000 | [diff] [blame] | 472 | u8 context[sizeof(struct amap_mcc_context_be) / 8]; |
| 473 | struct phys_addr pages[8]; |
| 474 | } __packed; |
| 475 | |
| 476 | struct be_cmd_req_mcc_ext_create { |
| 477 | struct be_cmd_req_hdr hdr; |
| 478 | u16 num_pages; |
| 479 | u16 cq_id; |
Somnath Kotur | cc4ce02 | 2010-10-21 07:11:14 -0700 | [diff] [blame] | 480 | u32 async_event_bitmap[1]; |
Vasundhara Volam | 666d39c | 2014-01-15 13:23:31 +0530 | [diff] [blame] | 481 | u8 context[sizeof(struct amap_mcc_context_v1) / 8]; |
Sathya Perla | 5fb379e | 2009-06-18 00:02:59 +0000 | [diff] [blame] | 482 | struct phys_addr pages[8]; |
| 483 | } __packed; |
| 484 | |
| 485 | struct be_cmd_resp_mcc_create { |
| 486 | struct be_cmd_resp_hdr hdr; |
| 487 | u16 id; |
| 488 | u16 rsvd0; |
| 489 | } __packed; |
| 490 | |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 491 | /******************** Create TxQ ***************************/ |
| 492 | #define BE_ETH_TX_RING_TYPE_STANDARD 2 |
| 493 | #define BE_ULP1_NUM 1 |
| 494 | |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 495 | struct be_cmd_req_eth_tx_create { |
| 496 | struct be_cmd_req_hdr hdr; |
| 497 | u8 num_pages; |
| 498 | u8 ulp_num; |
Vasundhara Volam | 94d73aa | 2013-04-21 23:28:14 +0000 | [diff] [blame] | 499 | 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 Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 507 | struct phys_addr pages[8]; |
| 508 | } __packed; |
| 509 | |
| 510 | struct be_cmd_resp_eth_tx_create { |
| 511 | struct be_cmd_resp_hdr hdr; |
| 512 | u16 cid; |
Vasundhara Volam | 94d73aa | 2013-04-21 23:28:14 +0000 | [diff] [blame] | 513 | u16 rid; |
| 514 | u32 db_offset; |
| 515 | u32 rsvd0[4]; |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 516 | } __packed; |
| 517 | |
| 518 | /******************** Create RxQ ***************************/ |
| 519 | struct 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 | |
| 531 | struct be_cmd_resp_eth_rx_create { |
| 532 | struct be_cmd_resp_hdr hdr; |
| 533 | u16 id; |
Sathya Perla | 3abcded | 2010-10-03 22:12:27 -0700 | [diff] [blame] | 534 | u8 rss_id; |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 535 | u8 rsvd0; |
| 536 | } __packed; |
| 537 | |
| 538 | /******************** Q Destroy ***************************/ |
| 539 | /* Type of Queue to be destroyed */ |
| 540 | enum { |
| 541 | QTYPE_EQ = 1, |
| 542 | QTYPE_CQ, |
| 543 | QTYPE_TXQ, |
Sathya Perla | 5fb379e | 2009-06-18 00:02:59 +0000 | [diff] [blame] | 544 | QTYPE_RXQ, |
| 545 | QTYPE_MCCQ |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 546 | }; |
| 547 | |
| 548 | struct 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 */ |
| 557 | enum 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 Ratnakar | f21b538 | 2011-03-07 03:09:36 +0000 | [diff] [blame] | 567 | BE_IF_FLAGS_PASS_L3L4_ERRORS = 0x800, |
| 568 | BE_IF_FLAGS_MULTICAST = 0x1000 |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 569 | }; |
| 570 | |
Sarveshwar Bandi | 3da988c | 2013-08-14 13:21:47 +0530 | [diff] [blame] | 571 | #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 Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 577 | /* An RX interface is an object with one or more MAC addresses and |
| 578 | * filtering capabilities. */ |
| 579 | struct be_cmd_req_if_create { |
| 580 | struct be_cmd_req_hdr hdr; |
André Goddard Rosa | af901ca | 2009-11-14 13:09:05 -0200 | [diff] [blame] | 581 | u32 version; /* ignore currently */ |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 582 | 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 | |
| 590 | struct 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 )**********/ |
| 597 | struct be_cmd_req_if_destroy { |
| 598 | struct be_cmd_req_hdr hdr; |
| 599 | u32 interface_id; |
| 600 | }; |
| 601 | |
| 602 | /*************** HW Stats Get **********************************/ |
Ajit Khaparde | 89a88ab | 2011-05-16 07:36:18 +0000 | [diff] [blame] | 603 | struct be_port_rxf_stats_v0 { |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 604 | 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 Reddy | 18fb06a | 2013-04-25 23:03:21 +0000 | [diff] [blame] | 617 | u32 rx_address_filtered; /* dword 13*/ |
| 618 | u32 rx_vlan_filtered; /* dword 14*/ |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 619 | 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 Khaparde | 89a88ab | 2011-05-16 07:36:18 +0000 | [diff] [blame] | 672 | struct be_rxf_stats_v0 { |
| 673 | struct be_port_rxf_stats_v0 port[2]; |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 674 | 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 Khaparde | f6c4bf3 | 2011-02-20 11:41:04 +0000 | [diff] [blame] | 690 | u32 rsvd0[7]; |
| 691 | u32 port0_jabber_events; |
| 692 | u32 port1_jabber_events; |
| 693 | u32 rsvd1[6]; |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 694 | }; |
| 695 | |
Ajit Khaparde | 89a88ab | 2011-05-16 07:36:18 +0000 | [diff] [blame] | 696 | struct be_erx_stats_v0 { |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 697 | u32 rx_drops_no_fragments[44]; /* dwordS 0 to 43*/ |
Ajit Khaparde | 89a88ab | 2011-05-16 07:36:18 +0000 | [diff] [blame] | 698 | u32 rsvd[4]; |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 699 | }; |
| 700 | |
Ajit Khaparde | f6c4bf3 | 2011-02-20 11:41:04 +0000 | [diff] [blame] | 701 | struct be_pmem_stats { |
| 702 | u32 eth_red_drops; |
Ajit Khaparde | 89a88ab | 2011-05-16 07:36:18 +0000 | [diff] [blame] | 703 | u32 rsvd[5]; |
Ajit Khaparde | f6c4bf3 | 2011-02-20 11:41:04 +0000 | [diff] [blame] | 704 | }; |
| 705 | |
Ajit Khaparde | 89a88ab | 2011-05-16 07:36:18 +0000 | [diff] [blame] | 706 | struct be_hw_stats_v0 { |
| 707 | struct be_rxf_stats_v0 rxf; |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 708 | u32 rsvd[48]; |
Ajit Khaparde | 89a88ab | 2011-05-16 07:36:18 +0000 | [diff] [blame] | 709 | struct be_erx_stats_v0 erx; |
Ajit Khaparde | f6c4bf3 | 2011-02-20 11:41:04 +0000 | [diff] [blame] | 710 | struct be_pmem_stats pmem; |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 711 | }; |
| 712 | |
Ajit Khaparde | 89a88ab | 2011-05-16 07:36:18 +0000 | [diff] [blame] | 713 | struct be_cmd_req_get_stats_v0 { |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 714 | struct be_cmd_req_hdr hdr; |
Ajit Khaparde | 89a88ab | 2011-05-16 07:36:18 +0000 | [diff] [blame] | 715 | u8 rsvd[sizeof(struct be_hw_stats_v0)]; |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 716 | }; |
| 717 | |
Ajit Khaparde | 89a88ab | 2011-05-16 07:36:18 +0000 | [diff] [blame] | 718 | struct be_cmd_resp_get_stats_v0 { |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 719 | struct be_cmd_resp_hdr hdr; |
Ajit Khaparde | 89a88ab | 2011-05-16 07:36:18 +0000 | [diff] [blame] | 720 | struct be_hw_stats_v0 hw_stats; |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 721 | }; |
| 722 | |
Sathya Perla | ac124ff | 2011-07-25 19:10:14 +0000 | [diff] [blame] | 723 | struct lancer_pport_stats { |
Selvin Xavier | 005d569 | 2011-05-16 07:36:35 +0000 | [diff] [blame] | 724 | 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 Reddy | 18fb06a | 2013-04-25 23:03:21 +0000 | [diff] [blame] | 824 | u32 rx_address_filtered; |
| 825 | u32 rx_vlan_filtered; |
Selvin Xavier | 005d569 | 2011-05-16 07:36:35 +0000 | [diff] [blame] | 826 | 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 | |
| 890 | struct pport_stats_params { |
| 891 | u16 pport_num; |
| 892 | u8 rsvd; |
| 893 | u8 reset_stats; |
| 894 | }; |
| 895 | |
| 896 | struct lancer_cmd_req_pport_stats { |
| 897 | struct be_cmd_req_hdr hdr; |
| 898 | union { |
| 899 | struct pport_stats_params params; |
Sathya Perla | ac124ff | 2011-07-25 19:10:14 +0000 | [diff] [blame] | 900 | u8 rsvd[sizeof(struct lancer_pport_stats)]; |
Selvin Xavier | 005d569 | 2011-05-16 07:36:35 +0000 | [diff] [blame] | 901 | } cmd_params; |
| 902 | }; |
| 903 | |
| 904 | struct lancer_cmd_resp_pport_stats { |
| 905 | struct be_cmd_resp_hdr hdr; |
Sathya Perla | ac124ff | 2011-07-25 19:10:14 +0000 | [diff] [blame] | 906 | struct lancer_pport_stats pport_stats; |
Selvin Xavier | 005d569 | 2011-05-16 07:36:35 +0000 | [diff] [blame] | 907 | }; |
| 908 | |
Sathya Perla | ac124ff | 2011-07-25 19:10:14 +0000 | [diff] [blame] | 909 | static inline struct lancer_pport_stats* |
Selvin Xavier | 005d569 | 2011-05-16 07:36:35 +0000 | [diff] [blame] | 910 | 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 Khaparde | 609ff3b | 2011-02-20 11:42:07 +0000 | [diff] [blame] | 916 | struct be_cmd_req_get_cntl_addnl_attribs { |
| 917 | struct be_cmd_req_hdr hdr; |
| 918 | u8 rsvd[8]; |
| 919 | }; |
| 920 | |
| 921 | struct 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 Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 930 | struct 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 Perla | 5b8821b | 2011-08-02 19:57:44 +0000 | [diff] [blame] | 939 | /******************* RX FILTER ******************************/ |
Sathya Perla | e7b909a | 2009-11-22 22:01:10 +0000 | [diff] [blame] | 940 | #define BE_MAX_MC 64 /* set mcast promisc if > 64 */ |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 941 | struct macaddr { |
| 942 | u8 byte[ETH_ALEN]; |
| 943 | }; |
| 944 | |
Padmanabh Ratnakar | ecd0bf0 | 2011-05-10 05:13:26 +0000 | [diff] [blame] | 945 | struct 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 Perla | 5b8821b | 2011-08-02 19:57:44 +0000 | [diff] [blame] | 952 | u32 mcast_num; |
| 953 | struct macaddr mcast_mac[BE_MAX_MC]; |
Padmanabh Ratnakar | ecd0bf0 | 2011-05-10 05:13:26 +0000 | [diff] [blame] | 954 | }; |
| 955 | |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 956 | /******************** Link Status Query *******************/ |
| 957 | struct be_cmd_req_link_status { |
| 958 | struct be_cmd_req_hdr hdr; |
| 959 | u32 rsvd; |
| 960 | }; |
| 961 | |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 962 | enum { |
| 963 | PHY_LINK_DUPLEX_NONE = 0x0, |
| 964 | PHY_LINK_DUPLEX_HALF = 0x1, |
| 965 | PHY_LINK_DUPLEX_FULL = 0x2 |
| 966 | }; |
| 967 | |
| 968 | enum { |
| 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 Volam | b971f84 | 2013-08-06 09:27:15 +0530 | [diff] [blame] | 973 | PHY_LINK_SPEED_10GBPS = 0x4, |
| 974 | PHY_LINK_SPEED_20GBPS = 0x5, |
| 975 | PHY_LINK_SPEED_25GBPS = 0x6, |
| 976 | PHY_LINK_SPEED_40GBPS = 0x7 |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 977 | }; |
| 978 | |
| 979 | struct 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 Bandi | 0388f25 | 2009-10-28 04:15:20 -0700 | [diff] [blame] | 987 | u16 link_speed; |
Ajit Khaparde | b236916a | 2011-12-30 12:15:40 +0000 | [diff] [blame] | 988 | u8 logical_link_status; |
| 989 | u8 rsvd1[3]; |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 990 | } __packed; |
| 991 | |
Sarveshwar Bandi | 0388f25 | 2009-10-28 04:15:20 -0700 | [diff] [blame] | 992 | /******************** Port Identification ***************************/ |
| 993 | /* Identifies the type of port attached to NIC */ |
| 994 | struct be_cmd_req_port_type { |
| 995 | struct be_cmd_req_hdr hdr; |
| 996 | u32 page_num; |
| 997 | u32 port; |
| 998 | }; |
| 999 | |
| 1000 | enum { |
| 1001 | TR_PAGE_A0 = 0xa0, |
| 1002 | TR_PAGE_A2 = 0xa2 |
| 1003 | }; |
| 1004 | |
| 1005 | struct 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 Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 1029 | /******************** Get FW Version *******************/ |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 1030 | struct 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 | |
| 1036 | struct 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 *******************/ |
| 1043 | struct 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 *******************/ |
| 1050 | struct be_cmd_req_get_flow_control { |
| 1051 | struct be_cmd_req_hdr hdr; |
| 1052 | u32 rsvd; |
| 1053 | }; |
| 1054 | |
| 1055 | struct 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 Perla | 2632baf | 2013-10-01 16:00:00 +0530 | [diff] [blame] | 1062 | struct be_set_eqd { |
| 1063 | u32 eq_id; |
| 1064 | u32 phase; |
| 1065 | u32 delay_multiplier; |
| 1066 | }; |
| 1067 | |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 1068 | struct be_cmd_req_modify_eq_delay { |
| 1069 | struct be_cmd_req_hdr hdr; |
| 1070 | u32 num_eq; |
Sathya Perla | 2632baf | 2013-10-01 16:00:00 +0530 | [diff] [blame] | 1071 | struct be_set_eqd set_eqd[MAX_EVT_QS]; |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 1072 | } __packed; |
| 1073 | |
| 1074 | struct be_cmd_resp_modify_eq_delay { |
| 1075 | struct be_cmd_resp_hdr hdr; |
| 1076 | u32 rsvd0; |
| 1077 | } __packed; |
| 1078 | |
| 1079 | /******************** Get FW Config *******************/ |
Sathya Perla | 752961a | 2011-10-24 02:45:03 +0000 | [diff] [blame] | 1080 | /* The HW can come up in either of the following multi-channel modes |
| 1081 | * based on the skew/IPL. |
| 1082 | */ |
Parav Pandit | 045508a | 2012-03-26 14:27:13 +0000 | [diff] [blame] | 1083 | #define RDMA_ENABLED 0x4 |
Sathya Perla | 752961a | 2011-10-24 02:45:03 +0000 | [diff] [blame] | 1084 | #define FLEX10_MODE 0x400 |
| 1085 | #define VNIC_MODE 0x20000 |
| 1086 | #define UMC_ENABLED 0x1000000 |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 1087 | struct be_cmd_req_query_fw_cfg { |
| 1088 | struct be_cmd_req_hdr hdr; |
Sathya Perla | 3abcded | 2010-10-03 22:12:27 -0700 | [diff] [blame] | 1089 | u32 rsvd[31]; |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 1090 | }; |
| 1091 | |
| 1092 | struct 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 Khaparde | 3486be2 | 2010-07-23 02:04:54 +0000 | [diff] [blame] | 1097 | u32 function_mode; |
Sathya Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 1098 | u32 rsvd[26]; |
Sathya Perla | 3abcded | 2010-10-03 22:12:27 -0700 | [diff] [blame] | 1099 | u32 function_caps; |
| 1100 | }; |
| 1101 | |
Padmanabh Ratnakar | 73dea39 | 2012-07-13 02:45:51 +0000 | [diff] [blame] | 1102 | /******************** 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 Perla | 3abcded | 2010-10-03 22:12:27 -0700 | [diff] [blame] | 1114 | #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 Ratnakar | d3bd3a5 | 2012-07-12 03:57:47 +0000 | [diff] [blame] | 1119 | #define RSS_ENABLE_UDP_IPV4 0x10 |
| 1120 | #define RSS_ENABLE_UDP_IPV6 0x20 |
Sathya Perla | 3abcded | 2010-10-03 22:12:27 -0700 | [diff] [blame] | 1121 | |
Suresh Reddy | 594ad54 | 2013-04-25 23:03:20 +0000 | [diff] [blame] | 1122 | #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 Perla | 3abcded | 2010-10-03 22:12:27 -0700 | [diff] [blame] | 1125 | struct 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 Perla | 6b7c5b9 | 2009-03-11 23:32:03 -0700 | [diff] [blame] | 1134 | }; |
| 1135 | |
Sarveshwar Bandi | fad9ab2 | 2009-10-12 04:23:15 -0700 | [diff] [blame] | 1136 | /******************** Port Beacon ***************************/ |
| 1137 | |
| 1138 | #define BEACON_STATE_ENABLED 0x1 |
| 1139 | #define BEACON_STATE_DISABLED 0x0 |
| 1140 | |
| 1141 | struct 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 | |
| 1149 | struct be_cmd_resp_enable_disable_beacon { |
| 1150 | struct be_cmd_resp_hdr resp_hdr; |
| 1151 | u32 rsvd0; |
| 1152 | } __packed; |
| 1153 | |
| 1154 | struct 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 | |
| 1161 | struct 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 Khaparde | 8451748 | 2009-09-04 03:12:16 +0000 | [diff] [blame] | 1167 | /****************** Firmware Flash ******************/ |
| 1168 | struct flashrom_params { |
| 1169 | u32 op_code; |
| 1170 | u32 op_type; |
| 1171 | u32 data_buf_size; |
| 1172 | u32 offset; |
Ajit Khaparde | 8451748 | 2009-09-04 03:12:16 +0000 | [diff] [blame] | 1173 | }; |
| 1174 | |
| 1175 | struct be_cmd_write_flashrom { |
| 1176 | struct be_cmd_req_hdr hdr; |
| 1177 | struct flashrom_params params; |
Padmanabh Ratnakar | be71644 | 2012-10-22 23:02:44 +0000 | [diff] [blame] | 1178 | u8 data_buf[32768]; |
| 1179 | u8 rsvd[4]; |
| 1180 | } __packed; |
Ajit Khaparde | 8451748 | 2009-09-04 03:12:16 +0000 | [diff] [blame] | 1181 | |
Padmanabh Ratnakar | be71644 | 2012-10-22 23:02:44 +0000 | [diff] [blame] | 1182 | /* cmd to read flash crc */ |
| 1183 | struct 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 Nunjundarao | 485bf56 | 2011-05-16 07:36:59 +0000 | [diff] [blame] | 1189 | /**************** Lancer Firmware Flash ************/ |
| 1190 | struct amap_lancer_write_obj_context { |
| 1191 | u8 write_length[24]; |
| 1192 | u8 reserved1[7]; |
| 1193 | u8 eof; |
| 1194 | } __packed; |
| 1195 | |
| 1196 | struct 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 Ratnakar | f67ef7b | 2012-07-12 03:57:09 +0000 | [diff] [blame] | 1207 | #define LANCER_NO_RESET_NEEDED 0x00 |
| 1208 | #define LANCER_FW_RESET_NEEDED 0x02 |
Shripad Nunjundarao | 485bf56 | 2011-05-16 07:36:59 +0000 | [diff] [blame] | 1209 | struct 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 Ratnakar | f67ef7b | 2012-07-12 03:57:09 +0000 | [diff] [blame] | 1219 | u8 change_status; |
| 1220 | u8 rsvd3[3]; |
Shripad Nunjundarao | 485bf56 | 2011-05-16 07:36:59 +0000 | [diff] [blame] | 1221 | }; |
| 1222 | |
Padmanabh Ratnakar | de49bd5 | 2011-11-16 02:02:43 +0000 | [diff] [blame] | 1223 | /************************ 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 Ratnakar | af5875b | 2011-11-16 02:03:07 +0000 | [diff] [blame] | 1228 | #define LANCER_VPD_PF_FILE "/vpd/ntr_pf.vpd" |
| 1229 | #define LANCER_VPD_VF_FILE "/vpd/ntr_vf.vpd" |
Padmanabh Ratnakar | de49bd5 | 2011-11-16 02:02:43 +0000 | [diff] [blame] | 1230 | |
| 1231 | struct 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 | |
| 1242 | struct 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 Khaparde | 71d8d1b | 2009-12-03 06:16:59 +0000 | [diff] [blame] | 1255 | /************************ WOL *******************************/ |
| 1256 | struct 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 Khaparde | 4762f6c | 2012-03-18 06:23:11 +0000 | [diff] [blame] | 1263 | struct 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 | |
| 1273 | struct 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 R | ff33a6e | 2009-12-03 16:15:52 -0800 | [diff] [blame] | 1290 | /********************** LoopBack test *********************/ |
| 1291 | struct 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 | |
| 1301 | struct 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 Bandi | fced999 | 2009-12-23 04:41:44 +0000 | [diff] [blame] | 1310 | struct 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 | |
| 1318 | struct be_cmd_resp_set_lmode { |
| 1319 | struct be_cmd_resp_hdr resp_hdr; |
| 1320 | u8 rsvd0[4]; |
| 1321 | }; |
| 1322 | |
Suresh R | ff33a6e | 2009-12-03 16:15:52 -0800 | [diff] [blame] | 1323 | /********************** DDR DMA test *********************/ |
| 1324 | struct 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 | |
| 1333 | struct 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 Bandi | 368c0ca | 2010-01-08 00:07:27 -0800 | [diff] [blame] | 1342 | /*********************** SEEPROM Read ***********************/ |
| 1343 | |
| 1344 | #define BE_READ_SEEPROM_LEN 1024 |
| 1345 | struct be_cmd_req_seeprom_read { |
| 1346 | struct be_cmd_req_hdr hdr; |
| 1347 | u8 rsvd0[BE_READ_SEEPROM_LEN]; |
| 1348 | }; |
| 1349 | |
| 1350 | struct be_cmd_resp_seeprom_read { |
| 1351 | struct be_cmd_req_hdr hdr; |
| 1352 | u8 seeprom_data[BE_READ_SEEPROM_LEN]; |
| 1353 | }; |
| 1354 | |
Ajit Khaparde | ee3cb62 | 2010-07-01 03:51:00 +0000 | [diff] [blame] | 1355 | enum { |
| 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 Khaparde | 42f11cf | 2012-04-21 18:53:22 +0000 | [diff] [blame] | 1364 | PHY_TYPE_BASEX_1GB, |
| 1365 | PHY_TYPE_SGMII, |
Ajit Khaparde | ee3cb62 | 2010-07-01 03:51:00 +0000 | [diff] [blame] | 1366 | PHY_TYPE_DISABLED = 255 |
| 1367 | }; |
| 1368 | |
Ajit Khaparde | 42f11cf | 2012-04-21 18:53:22 +0000 | [diff] [blame] | 1369 | #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 Khaparde | ee3cb62 | 2010-07-01 03:51:00 +0000 | [diff] [blame] | 1394 | struct be_cmd_req_get_phy_info { |
| 1395 | struct be_cmd_req_hdr hdr; |
| 1396 | u8 rsvd0[24]; |
| 1397 | }; |
Sathya Perla | 306f134 | 2011-08-02 19:57:45 +0000 | [diff] [blame] | 1398 | |
| 1399 | struct be_phy_info { |
Ajit Khaparde | ee3cb62 | 2010-07-01 03:51:00 +0000 | [diff] [blame] | 1400 | u16 phy_type; |
| 1401 | u16 interface_type; |
| 1402 | u32 misc_params; |
Ajit Khaparde | 42f11cf | 2012-04-21 18:53:22 +0000 | [diff] [blame] | 1403 | u16 ext_phy_details; |
| 1404 | u16 rsvd; |
| 1405 | u16 auto_speeds_supported; |
| 1406 | u16 fixed_speeds_supported; |
| 1407 | u32 future_use[2]; |
Ajit Khaparde | ee3cb62 | 2010-07-01 03:51:00 +0000 | [diff] [blame] | 1408 | }; |
| 1409 | |
Sathya Perla | 306f134 | 2011-08-02 19:57:45 +0000 | [diff] [blame] | 1410 | struct be_cmd_resp_get_phy_info { |
| 1411 | struct be_cmd_req_hdr hdr; |
| 1412 | struct be_phy_info phy_info; |
| 1413 | }; |
| 1414 | |
Ajit Khaparde | e1d1873 | 2010-07-23 01:52:13 +0000 | [diff] [blame] | 1415 | /*********************** Set QOS ***********************/ |
| 1416 | |
| 1417 | #define BE_QOS_BITS_NIC 1 |
| 1418 | |
| 1419 | struct 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 | |
| 1426 | struct be_cmd_resp_set_qos { |
| 1427 | struct be_cmd_resp_hdr hdr; |
| 1428 | u32 rsvd; |
| 1429 | }; |
| 1430 | |
Ajit Khaparde | 9e1453c | 2011-02-20 11:42:22 +0000 | [diff] [blame] | 1431 | /*********************** Controller Attributes ***********************/ |
| 1432 | struct be_cmd_req_cntl_attribs { |
| 1433 | struct be_cmd_req_hdr hdr; |
| 1434 | }; |
| 1435 | |
| 1436 | struct be_cmd_resp_cntl_attribs { |
| 1437 | struct be_cmd_resp_hdr hdr; |
| 1438 | struct mgmt_controller_attrib attribs; |
| 1439 | }; |
| 1440 | |
Sathya Perla | 2e588f8 | 2011-03-11 02:49:26 +0000 | [diff] [blame] | 1441 | /*********************** Set driver function ***********************/ |
| 1442 | #define CAPABILITY_SW_TIMESTAMPS 2 |
| 1443 | #define CAPABILITY_BE3_NATIVE_ERX_API 4 |
| 1444 | |
| 1445 | struct 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 | |
| 1452 | struct 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 Ratnakar | f25b119 | 2012-10-20 06:02:52 +0000 | [diff] [blame] | 1459 | /*********************** Function Privileges ***********************/ |
| 1460 | enum { |
| 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 | |
| 1477 | struct be_cmd_priv_map { |
| 1478 | u8 opcode; |
| 1479 | u8 subsystem; |
| 1480 | u32 priv_mask; |
| 1481 | }; |
| 1482 | |
| 1483 | struct be_cmd_req_get_fn_privileges { |
| 1484 | struct be_cmd_req_hdr hdr; |
| 1485 | u32 rsvd; |
| 1486 | }; |
| 1487 | |
| 1488 | struct be_cmd_resp_get_fn_privileges { |
| 1489 | struct be_cmd_resp_hdr hdr; |
| 1490 | u32 privilege_mask; |
| 1491 | }; |
| 1492 | |
Sathya Perla | 04a0602 | 2013-07-23 15:25:00 +0530 | [diff] [blame] | 1493 | struct 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 Ratnakar | f25b119 | 2012-10-20 06:02:52 +0000 | [diff] [blame] | 1498 | |
Padmanabh Ratnakar | 590c391 | 2011-11-25 05:47:26 +0000 | [diff] [blame] | 1499 | /******************** GET/SET_MACLIST **************************/ |
| 1500 | #define BE_MAX_MAC 64 |
Padmanabh Ratnakar | 590c391 | 2011-11-25 05:47:26 +0000 | [diff] [blame] | 1501 | struct be_cmd_req_get_mac_list { |
| 1502 | struct be_cmd_req_hdr hdr; |
Padmanabh Ratnakar | e5e1ee8 | 2012-02-03 09:50:17 +0000 | [diff] [blame] | 1503 | u8 mac_type; |
| 1504 | u8 perm_override; |
| 1505 | u16 iface_id; |
| 1506 | u32 mac_id; |
| 1507 | u32 rsvd[3]; |
| 1508 | } __packed; |
| 1509 | |
| 1510 | struct 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 Ratnakar | 590c391 | 2011-11-25 05:47:26 +0000 | [diff] [blame] | 1519 | } __packed; |
| 1520 | |
| 1521 | struct be_cmd_resp_get_mac_list { |
| 1522 | struct be_cmd_resp_hdr hdr; |
Padmanabh Ratnakar | e5e1ee8 | 2012-02-03 09:50:17 +0000 | [diff] [blame] | 1523 | 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 Ratnakar | 590c391 | 2011-11-25 05:47:26 +0000 | [diff] [blame] | 1531 | } __packed; |
| 1532 | |
| 1533 | struct 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 Khaparde | f1f3ee1 | 2012-03-18 06:23:41 +0000 | [diff] [blame] | 1541 | /*********************** HSW Config ***********************/ |
Ajit Khaparde | a77dcb8 | 2013-08-30 15:01:16 -0500 | [diff] [blame] | 1542 | #define PORT_FWD_TYPE_VEPA 0x3 |
| 1543 | #define PORT_FWD_TYPE_VEB 0x2 |
| 1544 | |
Ajit Khaparde | f1f3ee1 | 2012-03-18 06:23:41 +0000 | [diff] [blame] | 1545 | struct amap_set_hsw_context { |
| 1546 | u8 interface_id[16]; |
| 1547 | u8 rsvd0[14]; |
| 1548 | u8 pvid_valid; |
Ajit Khaparde | a77dcb8 | 2013-08-30 15:01:16 -0500 | [diff] [blame] | 1549 | u8 pport; |
| 1550 | u8 rsvd1[6]; |
| 1551 | u8 port_fwd_type[3]; |
| 1552 | u8 rsvd2[7]; |
Ajit Khaparde | f1f3ee1 | 2012-03-18 06:23:41 +0000 | [diff] [blame] | 1553 | u8 pvid[16]; |
| 1554 | u8 rsvd3[32]; |
| 1555 | u8 rsvd4[32]; |
| 1556 | u8 rsvd5[32]; |
| 1557 | } __packed; |
| 1558 | |
| 1559 | struct 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 | |
| 1564 | struct be_cmd_resp_set_hsw_config { |
| 1565 | struct be_cmd_resp_hdr hdr; |
| 1566 | u32 rsvd; |
| 1567 | }; |
| 1568 | |
| 1569 | struct amap_get_hsw_req_context { |
| 1570 | u8 interface_id[16]; |
| 1571 | u8 rsvd0[14]; |
| 1572 | u8 pvid_valid; |
| 1573 | u8 pport; |
| 1574 | } __packed; |
| 1575 | |
| 1576 | struct amap_get_hsw_resp_context { |
Ajit Khaparde | a77dcb8 | 2013-08-30 15:01:16 -0500 | [diff] [blame] | 1577 | u8 rsvd0[6]; |
| 1578 | u8 port_fwd_type[3]; |
| 1579 | u8 rsvd1[7]; |
Ajit Khaparde | f1f3ee1 | 2012-03-18 06:23:41 +0000 | [diff] [blame] | 1580 | u8 pvid[16]; |
| 1581 | u8 rsvd2[32]; |
| 1582 | u8 rsvd3[32]; |
| 1583 | u8 rsvd4[32]; |
| 1584 | } __packed; |
| 1585 | |
| 1586 | struct 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 | |
| 1591 | struct 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 Ratnakar | b4e32a7 | 2012-07-12 03:57:35 +0000 | [diff] [blame] | 1597 | /******************* get port names ***************/ |
| 1598 | struct be_cmd_req_get_port_name { |
| 1599 | struct be_cmd_req_hdr hdr; |
| 1600 | u32 rsvd0; |
| 1601 | }; |
| 1602 | |
| 1603 | struct be_cmd_resp_get_port_name { |
| 1604 | struct be_cmd_req_hdr hdr; |
| 1605 | u8 port_name[4]; |
| 1606 | }; |
| 1607 | |
Ajit Khaparde | 89a88ab | 2011-05-16 07:36:18 +0000 | [diff] [blame] | 1608 | /*************** HW Stats Get v1 **********************************/ |
| 1609 | #define BE_TXP_SW_SZ 48 |
| 1610 | struct 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 Reddy | 18fb06a | 2013-04-25 23:03:21 +0000 | [diff] [blame] | 1620 | u32 rx_address_filtered; |
Ajit Khaparde | 89a88ab | 2011-05-16 07:36:18 +0000 | [diff] [blame] | 1621 | 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 | |
| 1647 | struct 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 | |
| 1662 | struct be_erx_stats_v1 { |
| 1663 | u32 rx_drops_no_fragments[68]; /* dwordS 0 to 67*/ |
| 1664 | u32 rsvd[4]; |
| 1665 | }; |
| 1666 | |
Ajit Khaparde | 6100086 | 2013-10-03 16:16:33 -0500 | [diff] [blame] | 1667 | struct 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 | |
| 1713 | struct 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 Khaparde | 89a88ab | 2011-05-16 07:36:18 +0000 | [diff] [blame] | 1728 | struct 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 Volam | 0b3f0e7 | 2012-06-13 19:51:45 +0000 | [diff] [blame] | 1733 | u32 rsvd1[18]; |
Ajit Khaparde | 89a88ab | 2011-05-16 07:36:18 +0000 | [diff] [blame] | 1734 | }; |
| 1735 | |
| 1736 | struct be_cmd_req_get_stats_v1 { |
| 1737 | struct be_cmd_req_hdr hdr; |
| 1738 | u8 rsvd[sizeof(struct be_hw_stats_v1)]; |
| 1739 | }; |
| 1740 | |
| 1741 | struct be_cmd_resp_get_stats_v1 { |
| 1742 | struct be_cmd_resp_hdr hdr; |
| 1743 | struct be_hw_stats_v1 hw_stats; |
| 1744 | }; |
| 1745 | |
Ajit Khaparde | 6100086 | 2013-10-03 16:16:33 -0500 | [diff] [blame] | 1746 | struct be_erx_stats_v2 { |
| 1747 | u32 rx_drops_no_fragments[136]; /* dwordS 0 to 135*/ |
| 1748 | u32 rsvd[3]; |
| 1749 | }; |
| 1750 | |
| 1751 | struct 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 | |
| 1759 | struct be_cmd_req_get_stats_v2 { |
| 1760 | struct be_cmd_req_hdr hdr; |
| 1761 | u8 rsvd[sizeof(struct be_hw_stats_v2)]; |
| 1762 | }; |
| 1763 | |
| 1764 | struct be_cmd_resp_get_stats_v2 { |
| 1765 | struct be_cmd_resp_hdr hdr; |
| 1766 | struct be_hw_stats_v2 hw_stats; |
| 1767 | }; |
| 1768 | |
Somnath Kotur | 941a77d | 2012-05-17 22:59:03 +0000 | [diff] [blame] | 1769 | /************** 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 | |
| 1776 | struct ext_fat_mode { |
| 1777 | u8 mode; |
| 1778 | u8 rsvd0; |
| 1779 | u16 port_mask; |
| 1780 | u32 dbg_lvl; |
| 1781 | u64 fun_mask; |
| 1782 | } __packed; |
| 1783 | |
| 1784 | struct 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 | |
| 1791 | struct 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 | |
| 1803 | struct be_cmd_req_get_ext_fat_caps { |
| 1804 | struct be_cmd_req_hdr hdr; |
| 1805 | u32 parameter_type; |
| 1806 | }; |
| 1807 | |
| 1808 | struct be_cmd_resp_get_ext_fat_caps { |
| 1809 | struct be_cmd_resp_hdr hdr; |
| 1810 | struct be_fat_conf_params get_params; |
| 1811 | }; |
| 1812 | |
| 1813 | struct 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 Volam | 150d58c | 2013-08-27 16:57:31 +0530 | [diff] [blame] | 1818 | #define RESOURCE_DESC_SIZE_V0 72 |
| 1819 | #define RESOURCE_DESC_SIZE_V1 88 |
| 1820 | #define PCIE_RESOURCE_DESC_TYPE_V0 0x40 |
Vasundhara Volam | a05f99d | 2013-04-21 23:28:17 +0000 | [diff] [blame] | 1821 | #define NIC_RESOURCE_DESC_TYPE_V0 0x41 |
Vasundhara Volam | 150d58c | 2013-08-27 16:57:31 +0530 | [diff] [blame] | 1822 | #define PCIE_RESOURCE_DESC_TYPE_V1 0x50 |
Vasundhara Volam | a05f99d | 2013-04-21 23:28:17 +0000 | [diff] [blame] | 1823 | #define NIC_RESOURCE_DESC_TYPE_V1 0x51 |
Vasundhara Volam | f93f160 | 2014-02-12 16:09:25 +0530 | [diff] [blame] | 1824 | #define PORT_RESOURCE_DESC_TYPE_V1 0x55 |
Vasundhara Volam | 150d58c | 2013-08-27 16:57:31 +0530 | [diff] [blame] | 1825 | #define MAX_RESOURCE_DESC 264 |
Padmanabh Ratnakar | d5c1847 | 2012-10-20 06:01:53 +0000 | [diff] [blame] | 1826 | |
| 1827 | /* QOS unit number */ |
| 1828 | #define QUN 4 |
| 1829 | /* Immediate */ |
| 1830 | #define IMM 6 |
| 1831 | /* No save */ |
| 1832 | #define NOSV 7 |
| 1833 | |
Vasundhara Volam | 150d58c | 2013-08-27 16:57:31 +0530 | [diff] [blame] | 1834 | struct be_res_desc_hdr { |
Padmanabh Ratnakar | abb9395 | 2012-10-20 06:01:41 +0000 | [diff] [blame] | 1835 | u8 desc_type; |
| 1836 | u8 desc_len; |
Vasundhara Volam | 150d58c | 2013-08-27 16:57:31 +0530 | [diff] [blame] | 1837 | } __packed; |
| 1838 | |
| 1839 | struct 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 | |
| 1856 | struct be_nic_res_desc { |
| 1857 | struct be_res_desc_hdr hdr; |
Padmanabh Ratnakar | abb9395 | 2012-10-20 06:01:41 +0000 | [diff] [blame] | 1858 | 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 Khaparde | d44517fd | 2013-09-27 15:17:31 -0500 | [diff] [blame] | 1885 | u32 rsvd8[7]; |
Vasundhara Volam | 150d58c | 2013-08-27 16:57:31 +0530 | [diff] [blame] | 1886 | } __packed; |
Padmanabh Ratnakar | abb9395 | 2012-10-20 06:01:41 +0000 | [diff] [blame] | 1887 | |
Vasundhara Volam | f93f160 | 2014-02-12 16:09:25 +0530 | [diff] [blame] | 1888 | /************ Multi-Channel type ***********/ |
| 1889 | enum 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 | |
| 1899 | struct 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 */ |
| 1910 | static inline bool be_is_mc(struct be_adapter *adapter) |
| 1911 | { |
| 1912 | return adapter->mc_type > MC_NONE; |
| 1913 | } |
| 1914 | |
Padmanabh Ratnakar | abb9395 | 2012-10-20 06:01:41 +0000 | [diff] [blame] | 1915 | struct be_cmd_req_get_func_config { |
| 1916 | struct be_cmd_req_hdr hdr; |
| 1917 | }; |
| 1918 | |
| 1919 | struct be_cmd_resp_get_func_config { |
Kalesh AP | 28710c5 | 2013-04-28 22:21:13 +0000 | [diff] [blame] | 1920 | struct be_cmd_resp_hdr hdr; |
Padmanabh Ratnakar | abb9395 | 2012-10-20 06:01:41 +0000 | [diff] [blame] | 1921 | u32 desc_count; |
Vasundhara Volam | 150d58c | 2013-08-27 16:57:31 +0530 | [diff] [blame] | 1922 | u8 func_param[MAX_RESOURCE_DESC * RESOURCE_DESC_SIZE_V1]; |
Padmanabh Ratnakar | abb9395 | 2012-10-20 06:01:41 +0000 | [diff] [blame] | 1923 | }; |
| 1924 | |
| 1925 | #define ACTIVE_PROFILE_TYPE 0x2 |
| 1926 | struct be_cmd_req_get_profile_config { |
| 1927 | struct be_cmd_req_hdr hdr; |
| 1928 | u8 rsvd; |
| 1929 | u8 type; |
| 1930 | u16 rsvd1; |
| 1931 | }; |
| 1932 | |
| 1933 | struct be_cmd_resp_get_profile_config { |
Vasundhara Volam | 150d58c | 2013-08-27 16:57:31 +0530 | [diff] [blame] | 1934 | struct be_cmd_resp_hdr hdr; |
Padmanabh Ratnakar | abb9395 | 2012-10-20 06:01:41 +0000 | [diff] [blame] | 1935 | u32 desc_count; |
Vasundhara Volam | 150d58c | 2013-08-27 16:57:31 +0530 | [diff] [blame] | 1936 | u8 func_param[MAX_RESOURCE_DESC * RESOURCE_DESC_SIZE_V1]; |
Vasundhara Volam | a05f99d | 2013-04-21 23:28:17 +0000 | [diff] [blame] | 1937 | }; |
| 1938 | |
Padmanabh Ratnakar | d5c1847 | 2012-10-20 06:01:53 +0000 | [diff] [blame] | 1939 | struct be_cmd_req_set_profile_config { |
| 1940 | struct be_cmd_req_hdr hdr; |
| 1941 | u32 rsvd; |
| 1942 | u32 desc_count; |
Vasundhara Volam | 150d58c | 2013-08-27 16:57:31 +0530 | [diff] [blame] | 1943 | struct be_nic_res_desc nic_desc; |
Padmanabh Ratnakar | d5c1847 | 2012-10-20 06:01:53 +0000 | [diff] [blame] | 1944 | }; |
| 1945 | |
| 1946 | struct be_cmd_resp_set_profile_config { |
Vasundhara Volam | 150d58c | 2013-08-27 16:57:31 +0530 | [diff] [blame] | 1947 | struct be_cmd_resp_hdr hdr; |
Padmanabh Ratnakar | d5c1847 | 2012-10-20 06:01:53 +0000 | [diff] [blame] | 1948 | }; |
| 1949 | |
Vasundhara Volam | 542963b | 2014-01-15 13:23:33 +0530 | [diff] [blame] | 1950 | struct be_cmd_req_get_active_profile { |
| 1951 | struct be_cmd_req_hdr hdr; |
| 1952 | u32 rsvd; |
| 1953 | } __packed; |
| 1954 | |
| 1955 | struct 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 Ratnakar | dcf7ebb | 2012-10-20 06:03:49 +0000 | [diff] [blame] | 1961 | struct be_cmd_enable_disable_vf { |
| 1962 | struct be_cmd_req_hdr hdr; |
| 1963 | u8 enable; |
| 1964 | u8 rsvd[3]; |
| 1965 | }; |
| 1966 | |
Somnath Kotur | 68c45a2 | 2013-03-14 02:42:07 +0000 | [diff] [blame] | 1967 | struct be_cmd_req_intr_set { |
| 1968 | struct be_cmd_req_hdr hdr; |
| 1969 | u8 intr_enabled; |
| 1970 | u8 rsvd[3]; |
| 1971 | }; |
| 1972 | |
Padmanabh Ratnakar | f25b119 | 2012-10-20 06:02:52 +0000 | [diff] [blame] | 1973 | static inline bool check_privilege(struct be_adapter *adapter, u32 flags) |
| 1974 | { |
| 1975 | return flags & adapter->cmd_privileges ? true : false; |
| 1976 | } |
| 1977 | |
Sathya Perla | 4c87661 | 2013-02-03 20:30:11 +0000 | [diff] [blame] | 1978 | /************** Get IFACE LIST *******************/ |
| 1979 | struct be_if_desc { |
| 1980 | u32 if_id; |
| 1981 | u32 cap_flags; |
| 1982 | u32 en_flags; |
| 1983 | }; |
| 1984 | |
| 1985 | struct be_cmd_req_get_iface_list { |
| 1986 | struct be_cmd_req_hdr hdr; |
| 1987 | }; |
| 1988 | |
| 1989 | struct 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 Reddy | bdce2ad | 2014-03-11 18:53:04 +0530 | [diff] [blame^] | 1995 | /*************** Set logical link ********************/ |
| 1996 | #define PLINK_TRACK_SHIFT 8 |
| 1997 | struct 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 Perches | 31886e8 | 2013-09-23 15:11:36 -0700 | [diff] [blame] | 2002 | int be_pci_fnum_get(struct be_adapter *adapter); |
| 2003 | int be_fw_wait_ready(struct be_adapter *adapter); |
| 2004 | int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr, |
| 2005 | bool permanent, u32 if_handle, u32 pmac_id); |
| 2006 | int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr, u32 if_id, |
| 2007 | u32 *pmac_id, u32 domain); |
| 2008 | int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, int pmac_id, |
| 2009 | u32 domain); |
| 2010 | int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags, |
| 2011 | u32 *if_handle, u32 domain); |
| 2012 | int be_cmd_if_destroy(struct be_adapter *adapter, int if_handle, u32 domain); |
| 2013 | int be_cmd_eq_create(struct be_adapter *adapter, struct be_eq_obj *eqo); |
| 2014 | int 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); |
| 2017 | int be_cmd_mccq_create(struct be_adapter *adapter, struct be_queue_info *mccq, |
| 2018 | struct be_queue_info *cq); |
| 2019 | int be_cmd_txq_create(struct be_adapter *adapter, struct be_tx_obj *txo); |
| 2020 | int 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); |
| 2022 | int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q, |
| 2023 | int type); |
| 2024 | int be_cmd_rxq_destroy(struct be_adapter *adapter, struct be_queue_info *q); |
| 2025 | int be_cmd_link_status_query(struct be_adapter *adapter, u16 *link_speed, |
| 2026 | u8 *link_status, u32 dom); |
| 2027 | int be_cmd_reset(struct be_adapter *adapter); |
| 2028 | int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd); |
| 2029 | int lancer_cmd_get_pport_stats(struct be_adapter *adapter, |
| 2030 | struct be_dma_mem *nonemb_cmd); |
| 2031 | int be_cmd_get_fw_ver(struct be_adapter *adapter, char *fw_ver, |
| 2032 | char *fw_on_flash); |
Sathya Perla | 2632baf | 2013-10-01 16:00:00 +0530 | [diff] [blame] | 2033 | int be_cmd_modify_eqd(struct be_adapter *adapter, struct be_set_eqd *, int num); |
Joe Perches | 31886e8 | 2013-09-23 15:11:36 -0700 | [diff] [blame] | 2034 | int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id, u16 *vtag_array, |
Ajit Khaparde | 012bd38 | 2013-11-18 10:44:24 -0600 | [diff] [blame] | 2035 | u32 num, bool promiscuous); |
Joe Perches | 31886e8 | 2013-09-23 15:11:36 -0700 | [diff] [blame] | 2036 | int be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 status); |
| 2037 | int be_cmd_set_flow_control(struct be_adapter *adapter, u32 tx_fc, u32 rx_fc); |
| 2038 | int be_cmd_get_flow_control(struct be_adapter *adapter, u32 *tx_fc, u32 *rx_fc); |
| 2039 | int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num, |
Vasundhara Volam | 0ad3157 | 2013-04-21 23:28:16 +0000 | [diff] [blame] | 2040 | u32 *function_mode, u32 *function_caps, u16 *asic_rev); |
Joe Perches | 31886e8 | 2013-09-23 15:11:36 -0700 | [diff] [blame] | 2041 | int be_cmd_reset_function(struct be_adapter *adapter); |
| 2042 | int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable, |
| 2043 | u32 rss_hash_opts, u16 table_size); |
| 2044 | int be_process_mcc(struct be_adapter *adapter); |
| 2045 | int be_cmd_set_beacon_state(struct be_adapter *adapter, u8 port_num, u8 beacon, |
| 2046 | u8 status, u8 state); |
| 2047 | int be_cmd_get_beacon_state(struct be_adapter *adapter, u8 port_num, |
| 2048 | u32 *state); |
| 2049 | int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd, |
| 2050 | u32 flash_oper, u32 flash_opcode, u32 buf_size); |
| 2051 | int 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 Ratnakar | de49bd5 | 2011-11-16 02:02:43 +0000 | [diff] [blame] | 2055 | int lancer_cmd_read_object(struct be_adapter *adapter, struct be_dma_mem *cmd, |
Joe Perches | 31886e8 | 2013-09-23 15:11:36 -0700 | [diff] [blame] | 2056 | u32 data_size, u32 data_offset, const char *obj_name, |
| 2057 | u32 *data_read, u32 *eof, u8 *addn_status); |
Ajit Khaparde | 3f0d456 | 2010-02-09 01:30:35 +0000 | [diff] [blame] | 2058 | int be_cmd_get_flash_crc(struct be_adapter *adapter, u8 *flashed_crc, |
Joe Perches | 31886e8 | 2013-09-23 15:11:36 -0700 | [diff] [blame] | 2059 | int offset); |
| 2060 | int be_cmd_enable_magic_wol(struct be_adapter *adapter, u8 *mac, |
| 2061 | struct be_dma_mem *nonemb_cmd); |
| 2062 | int be_cmd_fw_init(struct be_adapter *adapter); |
| 2063 | int be_cmd_fw_clean(struct be_adapter *adapter); |
| 2064 | void be_async_mcc_enable(struct be_adapter *adapter); |
| 2065 | void be_async_mcc_disable(struct be_adapter *adapter); |
| 2066 | int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num, |
| 2067 | u32 loopback_type, u32 pkt_size, u32 num_pkts, |
| 2068 | u64 pattern); |
| 2069 | int be_cmd_ddr_dma_test(struct be_adapter *adapter, u64 pattern, u32 byte_cnt, |
| 2070 | struct be_dma_mem *cmd); |
| 2071 | int be_cmd_get_seeprom_data(struct be_adapter *adapter, |
| 2072 | struct be_dma_mem *nonemb_cmd); |
| 2073 | int be_cmd_set_loopback(struct be_adapter *adapter, u8 port_num, |
| 2074 | u8 loopback_type, u8 enable); |
| 2075 | int be_cmd_get_phy_info(struct be_adapter *adapter); |
| 2076 | int be_cmd_set_qos(struct be_adapter *adapter, u32 bps, u32 domain); |
| 2077 | void be_detect_error(struct be_adapter *adapter); |
| 2078 | int be_cmd_get_die_temperature(struct be_adapter *adapter); |
| 2079 | int be_cmd_get_cntl_attributes(struct be_adapter *adapter); |
| 2080 | int be_cmd_req_native_mode(struct be_adapter *adapter); |
| 2081 | int be_cmd_get_reg_len(struct be_adapter *adapter, u32 *log_size); |
| 2082 | void be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf); |
| 2083 | int be_cmd_get_fn_privileges(struct be_adapter *adapter, u32 *privilege, |
| 2084 | u32 domain); |
| 2085 | int be_cmd_set_fn_privileges(struct be_adapter *adapter, u32 privileges, |
| 2086 | u32 vf_num); |
| 2087 | int be_cmd_get_mac_from_list(struct be_adapter *adapter, u8 *mac, |
Suresh Reddy | b188f09 | 2014-01-15 13:23:39 +0530 | [diff] [blame] | 2088 | bool *pmac_id_active, u32 *pmac_id, |
| 2089 | u32 if_handle, u8 domain); |
| 2090 | int be_cmd_get_active_mac(struct be_adapter *adapter, u32 pmac_id, u8 *mac, |
| 2091 | u32 if_handle, bool active, u32 domain); |
Joe Perches | 31886e8 | 2013-09-23 15:11:36 -0700 | [diff] [blame] | 2092 | int be_cmd_get_perm_mac(struct be_adapter *adapter, u8 *mac); |
| 2093 | int be_cmd_set_mac_list(struct be_adapter *adapter, u8 *mac_array, u8 mac_count, |
| 2094 | u32 domain); |
| 2095 | int be_cmd_set_mac(struct be_adapter *adapter, u8 *mac, int if_id, u32 dom); |
| 2096 | int be_cmd_set_hsw_config(struct be_adapter *adapter, u16 pvid, u32 domain, |
| 2097 | u16 intf_id, u16 hsw_mode); |
| 2098 | int be_cmd_get_hsw_config(struct be_adapter *adapter, u16 *pvid, u32 domain, |
| 2099 | u16 intf_id, u8 *mode); |
| 2100 | int be_cmd_get_acpi_wol_cap(struct be_adapter *adapter); |
Vasundhara Volam | baaa08d | 2014-01-15 13:23:34 +0530 | [diff] [blame] | 2101 | int be_cmd_set_fw_log_level(struct be_adapter *adapter, u32 level); |
| 2102 | int be_cmd_get_fw_log_level(struct be_adapter *adapter); |
Joe Perches | 31886e8 | 2013-09-23 15:11:36 -0700 | [diff] [blame] | 2103 | int be_cmd_get_ext_fat_capabilites(struct be_adapter *adapter, |
| 2104 | struct be_dma_mem *cmd); |
| 2105 | int be_cmd_set_ext_fat_capabilites(struct be_adapter *adapter, |
| 2106 | struct be_dma_mem *cmd, |
| 2107 | struct be_fat_conf_params *cfgs); |
Joe Perches | 31886e8 | 2013-09-23 15:11:36 -0700 | [diff] [blame] | 2108 | int lancer_physdev_ctrl(struct be_adapter *adapter, u32 mask); |
| 2109 | int lancer_initiate_dump(struct be_adapter *adapter); |
| 2110 | bool dump_present(struct be_adapter *adapter); |
| 2111 | int lancer_test_and_set_rdy_state(struct be_adapter *adapter); |
| 2112 | int be_cmd_query_port_name(struct be_adapter *adapter, u8 *port_name); |
Sathya Perla | 92bf14a | 2013-08-27 16:57:32 +0530 | [diff] [blame] | 2113 | int be_cmd_get_func_config(struct be_adapter *adapter, |
| 2114 | struct be_resources *res); |
| 2115 | int be_cmd_get_profile_config(struct be_adapter *adapter, |
| 2116 | struct be_resources *res, u8 domain); |
Joe Perches | 31886e8 | 2013-09-23 15:11:36 -0700 | [diff] [blame] | 2117 | int be_cmd_set_profile_config(struct be_adapter *adapter, u32 bps, u8 domain); |
Vasundhara Volam | 542963b | 2014-01-15 13:23:33 +0530 | [diff] [blame] | 2118 | int be_cmd_get_active_profile(struct be_adapter *adapter, u16 *profile); |
Joe Perches | 31886e8 | 2013-09-23 15:11:36 -0700 | [diff] [blame] | 2119 | int be_cmd_get_if_id(struct be_adapter *adapter, struct be_vf_cfg *vf_cfg, |
| 2120 | int vf_num); |
| 2121 | int be_cmd_enable_vf(struct be_adapter *adapter, u8 domain); |
| 2122 | int be_cmd_intr_set(struct be_adapter *adapter, bool intr_enable); |
Suresh Reddy | bdce2ad | 2014-03-11 18:53:04 +0530 | [diff] [blame^] | 2123 | int be_cmd_set_logical_link_config(struct be_adapter *adapter, |
| 2124 | int link_state, u8 domain); |