2 * Copyright (C) 2005 - 2011 Emulex
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.
10 * Contact Information:
11 * linux-drivers@emulex.com
15 * Costa Mesa, CA 92626
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.
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 */
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 */
42 u8 embedded_payload
[236]; /* used by embedded cmds */
43 struct be_sge sgl
[19]; /* used by non-embedded cmds */
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)
52 /* Completion Status */
54 MCC_STATUS_SUCCESS
= 0x0,
55 /* The client does not have sufficient privileges to execute the command */
56 MCC_STATUS_INSUFFICIENT_PRIVILEGES
= 0x1,
57 /* A parameter in the command was invalid. */
58 MCC_STATUS_INVALID_PARAMETER
= 0x2,
59 /* There are insufficient chip resources to execute the command */
60 MCC_STATUS_INSUFFICIENT_RESOURCES
= 0x3,
61 /* The command is completing because the queue was getting flushed */
62 MCC_STATUS_QUEUE_FLUSHING
= 0x4,
63 /* The command is completing with a DMA error */
64 MCC_STATUS_DMA_FAILED
= 0x5,
65 MCC_STATUS_NOT_SUPPORTED
= 66
68 #define CQE_STATUS_COMPL_MASK 0xFFFF
69 #define CQE_STATUS_COMPL_SHIFT 0 /* bits 0 - 15 */
70 #define CQE_STATUS_EXTD_MASK 0xFFFF
71 #define CQE_STATUS_EXTD_SHIFT 16 /* bits 16 - 31 */
74 u32 status
; /* dword 0 */
75 u32 tag0
; /* dword 1 */
76 u32 tag1
; /* dword 2 */
77 u32 flags
; /* dword 3 */
80 /* When the async bit of mcc_compl is set, the last 4 bytes of
81 * mcc_compl is interpreted as follows:
83 #define ASYNC_TRAILER_EVENT_CODE_SHIFT 8 /* bits 8 - 15 */
84 #define ASYNC_TRAILER_EVENT_CODE_MASK 0xFF
85 #define ASYNC_TRAILER_EVENT_TYPE_SHIFT 16
86 #define ASYNC_TRAILER_EVENT_TYPE_MASK 0xFF
87 #define ASYNC_EVENT_CODE_LINK_STATE 0x1
88 #define ASYNC_EVENT_CODE_GRP_5 0x5
89 #define ASYNC_EVENT_QOS_SPEED 0x1
90 #define ASYNC_EVENT_COS_PRIORITY 0x2
91 #define ASYNC_EVENT_PVID_STATE 0x3
92 struct be_async_event_trailer
{
97 ASYNC_EVENT_LINK_DOWN
= 0x0,
98 ASYNC_EVENT_LINK_UP
= 0x1
101 /* When the event code of an async trailer is link-state, the mcc_compl
102 * must be interpreted as follows
104 struct be_async_event_link_state
{
111 struct be_async_event_trailer trailer
;
114 /* When the event code of an async trailer is GRP-5 and event_type is QOS_SPEED
115 * the mcc_compl must be interpreted as follows
117 struct be_async_event_grp5_qos_link_speed
{
122 struct be_async_event_trailer trailer
;
125 /* When the event code of an async trailer is GRP5 and event type is
126 * CoS-Priority, the mcc_compl must be interpreted as follows
128 struct be_async_event_grp5_cos_priority
{
130 u8 available_priority_bmap
;
131 u8 reco_default_priority
;
135 struct be_async_event_trailer trailer
;
138 /* When the event code of an async trailer is GRP5 and event type is
139 * PVID state, the mcc_compl must be interpreted as follows
141 struct be_async_event_grp5_pvid_state
{
147 struct be_async_event_trailer trailer
;
150 struct be_mcc_mailbox
{
151 struct be_mcc_wrb wrb
;
152 struct be_mcc_compl
compl;
155 #define CMD_SUBSYSTEM_COMMON 0x1
156 #define CMD_SUBSYSTEM_ETH 0x3
157 #define CMD_SUBSYSTEM_LOWLEVEL 0xb
159 #define OPCODE_COMMON_NTWK_MAC_QUERY 1
160 #define OPCODE_COMMON_NTWK_MAC_SET 2
161 #define OPCODE_COMMON_NTWK_MULTICAST_SET 3
162 #define OPCODE_COMMON_NTWK_VLAN_CONFIG 4
163 #define OPCODE_COMMON_NTWK_LINK_STATUS_QUERY 5
164 #define OPCODE_COMMON_READ_FLASHROM 6
165 #define OPCODE_COMMON_WRITE_FLASHROM 7
166 #define OPCODE_COMMON_CQ_CREATE 12
167 #define OPCODE_COMMON_EQ_CREATE 13
168 #define OPCODE_COMMON_MCC_CREATE 21
169 #define OPCODE_COMMON_SET_QOS 28
170 #define OPCODE_COMMON_MCC_CREATE_EXT 90
171 #define OPCODE_COMMON_SEEPROM_READ 30
172 #define OPCODE_COMMON_GET_CNTL_ATTRIBUTES 32
173 #define OPCODE_COMMON_NTWK_RX_FILTER 34
174 #define OPCODE_COMMON_GET_FW_VERSION 35
175 #define OPCODE_COMMON_SET_FLOW_CONTROL 36
176 #define OPCODE_COMMON_GET_FLOW_CONTROL 37
177 #define OPCODE_COMMON_SET_FRAME_SIZE 39
178 #define OPCODE_COMMON_MODIFY_EQ_DELAY 41
179 #define OPCODE_COMMON_FIRMWARE_CONFIG 42
180 #define OPCODE_COMMON_NTWK_INTERFACE_CREATE 50
181 #define OPCODE_COMMON_NTWK_INTERFACE_DESTROY 51
182 #define OPCODE_COMMON_MCC_DESTROY 53
183 #define OPCODE_COMMON_CQ_DESTROY 54
184 #define OPCODE_COMMON_EQ_DESTROY 55
185 #define OPCODE_COMMON_QUERY_FIRMWARE_CONFIG 58
186 #define OPCODE_COMMON_NTWK_PMAC_ADD 59
187 #define OPCODE_COMMON_NTWK_PMAC_DEL 60
188 #define OPCODE_COMMON_FUNCTION_RESET 61
189 #define OPCODE_COMMON_MANAGE_FAT 68
190 #define OPCODE_COMMON_ENABLE_DISABLE_BEACON 69
191 #define OPCODE_COMMON_GET_BEACON_STATE 70
192 #define OPCODE_COMMON_READ_TRANSRECV_DATA 73
193 #define OPCODE_COMMON_GET_PHY_DETAILS 102
194 #define OPCODE_COMMON_SET_DRIVER_FUNCTION_CAP 103
195 #define OPCODE_COMMON_GET_CNTL_ADDITIONAL_ATTRIBUTES 121
197 #define OPCODE_ETH_RSS_CONFIG 1
198 #define OPCODE_ETH_ACPI_CONFIG 2
199 #define OPCODE_ETH_PROMISCUOUS 3
200 #define OPCODE_ETH_GET_STATISTICS 4
201 #define OPCODE_ETH_TX_CREATE 7
202 #define OPCODE_ETH_RX_CREATE 8
203 #define OPCODE_ETH_TX_DESTROY 9
204 #define OPCODE_ETH_RX_DESTROY 10
205 #define OPCODE_ETH_ACPI_WOL_MAGIC_CONFIG 12
207 #define OPCODE_LOWLEVEL_HOST_DDR_DMA 17
208 #define OPCODE_LOWLEVEL_LOOPBACK_TEST 18
209 #define OPCODE_LOWLEVEL_SET_LOOPBACK_MODE 19
211 struct be_cmd_req_hdr
{
212 u8 opcode
; /* dword 0 */
213 u8 subsystem
; /* dword 0 */
214 u8 port_number
; /* dword 0 */
215 u8 domain
; /* dword 0 */
216 u32 timeout
; /* dword 1 */
217 u32 request_length
; /* dword 2 */
218 u8 version
; /* dword 3 */
219 u8 rsvd
[3]; /* dword 3 */
222 #define RESP_HDR_INFO_OPCODE_SHIFT 0 /* bits 0 - 7 */
223 #define RESP_HDR_INFO_SUBSYS_SHIFT 8 /* bits 8 - 15 */
224 struct be_cmd_resp_hdr
{
225 u32 info
; /* dword 0 */
226 u32 status
; /* dword 1 */
227 u32 response_length
; /* dword 2 */
228 u32 actual_resp_len
; /* dword 3 */
236 /**************************
237 * BE Command definitions *
238 **************************/
240 /* Pseudo amap definition in which each bit of the actual structure is defined
241 * as a byte: used to calculate offset/shift/mask of each field */
242 struct amap_eq_context
{
243 u8 cidx
[13]; /* dword 0*/
244 u8 rsvd0
[3]; /* dword 0*/
245 u8 epidx
[13]; /* dword 0*/
246 u8 valid
; /* dword 0*/
247 u8 rsvd1
; /* dword 0*/
248 u8 size
; /* dword 0*/
249 u8 pidx
[13]; /* dword 1*/
250 u8 rsvd2
[3]; /* dword 1*/
251 u8 pd
[10]; /* dword 1*/
252 u8 count
[3]; /* dword 1*/
253 u8 solevent
; /* dword 1*/
254 u8 stalled
; /* dword 1*/
255 u8 armed
; /* dword 1*/
256 u8 rsvd3
[4]; /* dword 2*/
257 u8 func
[8]; /* dword 2*/
258 u8 rsvd4
; /* dword 2*/
259 u8 delaymult
[10]; /* dword 2*/
260 u8 rsvd5
[2]; /* dword 2*/
261 u8 phase
[2]; /* dword 2*/
262 u8 nodelay
; /* dword 2*/
263 u8 rsvd6
[4]; /* dword 2*/
264 u8 rsvd7
[32]; /* dword 3*/
267 struct be_cmd_req_eq_create
{
268 struct be_cmd_req_hdr hdr
;
269 u16 num_pages
; /* sword */
270 u16 rsvd0
; /* sword */
271 u8 context
[sizeof(struct amap_eq_context
) / 8];
272 struct phys_addr pages
[8];
275 struct be_cmd_resp_eq_create
{
276 struct be_cmd_resp_hdr resp_hdr
;
277 u16 eq_id
; /* sword */
278 u16 rsvd0
; /* sword */
281 /******************** Mac query ***************************/
283 MAC_ADDRESS_TYPE_STORAGE
= 0x0,
284 MAC_ADDRESS_TYPE_NETWORK
= 0x1,
285 MAC_ADDRESS_TYPE_PD
= 0x2,
286 MAC_ADDRESS_TYPE_MANAGEMENT
= 0x3
294 struct be_cmd_req_mac_query
{
295 struct be_cmd_req_hdr hdr
;
301 struct be_cmd_resp_mac_query
{
302 struct be_cmd_resp_hdr hdr
;
306 /******************** PMac Add ***************************/
307 struct be_cmd_req_pmac_add
{
308 struct be_cmd_req_hdr hdr
;
310 u8 mac_address
[ETH_ALEN
];
314 struct be_cmd_resp_pmac_add
{
315 struct be_cmd_resp_hdr hdr
;
319 /******************** PMac Del ***************************/
320 struct be_cmd_req_pmac_del
{
321 struct be_cmd_req_hdr hdr
;
326 /******************** Create CQ ***************************/
327 /* Pseudo amap definition in which each bit of the actual structure is defined
328 * as a byte: used to calculate offset/shift/mask of each field */
329 struct amap_cq_context_be
{
330 u8 cidx
[11]; /* dword 0*/
331 u8 rsvd0
; /* dword 0*/
332 u8 coalescwm
[2]; /* dword 0*/
333 u8 nodelay
; /* dword 0*/
334 u8 epidx
[11]; /* dword 0*/
335 u8 rsvd1
; /* dword 0*/
336 u8 count
[2]; /* dword 0*/
337 u8 valid
; /* dword 0*/
338 u8 solevent
; /* dword 0*/
339 u8 eventable
; /* dword 0*/
340 u8 pidx
[11]; /* dword 1*/
341 u8 rsvd2
; /* dword 1*/
342 u8 pd
[10]; /* dword 1*/
343 u8 eqid
[8]; /* dword 1*/
344 u8 stalled
; /* dword 1*/
345 u8 armed
; /* dword 1*/
346 u8 rsvd3
[4]; /* dword 2*/
347 u8 func
[8]; /* dword 2*/
348 u8 rsvd4
[20]; /* dword 2*/
349 u8 rsvd5
[32]; /* dword 3*/
352 struct amap_cq_context_lancer
{
353 u8 rsvd0
[12]; /* dword 0*/
354 u8 coalescwm
[2]; /* dword 0*/
355 u8 nodelay
; /* dword 0*/
356 u8 rsvd1
[12]; /* dword 0*/
357 u8 count
[2]; /* dword 0*/
358 u8 valid
; /* dword 0*/
359 u8 rsvd2
; /* dword 0*/
360 u8 eventable
; /* dword 0*/
361 u8 eqid
[16]; /* dword 1*/
362 u8 rsvd3
[15]; /* dword 1*/
363 u8 armed
; /* dword 1*/
364 u8 rsvd4
[32]; /* dword 2*/
365 u8 rsvd5
[32]; /* dword 3*/
368 struct be_cmd_req_cq_create
{
369 struct be_cmd_req_hdr hdr
;
373 u8 context
[sizeof(struct amap_cq_context_be
) / 8];
374 struct phys_addr pages
[8];
378 struct be_cmd_resp_cq_create
{
379 struct be_cmd_resp_hdr hdr
;
384 struct be_cmd_req_get_fat
{
385 struct be_cmd_req_hdr hdr
;
389 u32 data_buffer_size
;
393 struct be_cmd_resp_get_fat
{
394 struct be_cmd_resp_hdr hdr
;
402 /******************** Create MCCQ ***************************/
403 /* Pseudo amap definition in which each bit of the actual structure is defined
404 * as a byte: used to calculate offset/shift/mask of each field */
405 struct amap_mcc_context_be
{
420 struct amap_mcc_context_lancer
{
426 u8 async_cq_valid
[1];
431 struct be_cmd_req_mcc_create
{
432 struct be_cmd_req_hdr hdr
;
435 u32 async_event_bitmap
[1];
436 u8 context
[sizeof(struct amap_mcc_context_be
) / 8];
437 struct phys_addr pages
[8];
440 struct be_cmd_resp_mcc_create
{
441 struct be_cmd_resp_hdr hdr
;
446 /******************** Create TxQ ***************************/
447 #define BE_ETH_TX_RING_TYPE_STANDARD 2
448 #define BE_ULP1_NUM 1
450 /* Pseudo amap definition in which each bit of the actual structure is defined
451 * as a byte: used to calculate offset/shift/mask of each field */
452 struct amap_tx_context
{
453 u8 if_id
[16]; /* dword 0 */
454 u8 tx_ring_size
[4]; /* dword 0 */
455 u8 rsvd1
[26]; /* dword 0 */
456 u8 pci_func_id
[8]; /* dword 1 */
457 u8 rsvd2
[9]; /* dword 1 */
458 u8 ctx_valid
; /* dword 1 */
459 u8 cq_id_send
[16]; /* dword 2 */
460 u8 rsvd3
[16]; /* dword 2 */
461 u8 rsvd4
[32]; /* dword 3 */
462 u8 rsvd5
[32]; /* dword 4 */
463 u8 rsvd6
[32]; /* dword 5 */
464 u8 rsvd7
[32]; /* dword 6 */
465 u8 rsvd8
[32]; /* dword 7 */
466 u8 rsvd9
[32]; /* dword 8 */
467 u8 rsvd10
[32]; /* dword 9 */
468 u8 rsvd11
[32]; /* dword 10 */
469 u8 rsvd12
[32]; /* dword 11 */
470 u8 rsvd13
[32]; /* dword 12 */
471 u8 rsvd14
[32]; /* dword 13 */
472 u8 rsvd15
[32]; /* dword 14 */
473 u8 rsvd16
[32]; /* dword 15 */
476 struct be_cmd_req_eth_tx_create
{
477 struct be_cmd_req_hdr hdr
;
482 u8 context
[sizeof(struct amap_tx_context
) / 8];
483 struct phys_addr pages
[8];
486 struct be_cmd_resp_eth_tx_create
{
487 struct be_cmd_resp_hdr hdr
;
492 /******************** Create RxQ ***************************/
493 struct be_cmd_req_eth_rx_create
{
494 struct be_cmd_req_hdr hdr
;
498 struct phys_addr pages
[2];
505 struct be_cmd_resp_eth_rx_create
{
506 struct be_cmd_resp_hdr hdr
;
512 /******************** Q Destroy ***************************/
513 /* Type of Queue to be destroyed */
522 struct be_cmd_req_q_destroy
{
523 struct be_cmd_req_hdr hdr
;
525 u16 bypass_flush
; /* valid only for rx q destroy */
528 /************ I/f Create (it's actually I/f Config Create)**********/
530 /* Capability flags for the i/f */
532 BE_IF_FLAGS_RSS
= 0x4,
533 BE_IF_FLAGS_PROMISCUOUS
= 0x8,
534 BE_IF_FLAGS_BROADCAST
= 0x10,
535 BE_IF_FLAGS_UNTAGGED
= 0x20,
536 BE_IF_FLAGS_ULP
= 0x40,
537 BE_IF_FLAGS_VLAN_PROMISCUOUS
= 0x80,
538 BE_IF_FLAGS_VLAN
= 0x100,
539 BE_IF_FLAGS_MCAST_PROMISCUOUS
= 0x200,
540 BE_IF_FLAGS_PASS_L2_ERRORS
= 0x400,
541 BE_IF_FLAGS_PASS_L3L4_ERRORS
= 0x800,
542 BE_IF_FLAGS_MULTICAST
= 0x1000
545 /* An RX interface is an object with one or more MAC addresses and
546 * filtering capabilities. */
547 struct be_cmd_req_if_create
{
548 struct be_cmd_req_hdr hdr
;
549 u32 version
; /* ignore currently */
550 u32 capability_flags
;
552 u8 mac_addr
[ETH_ALEN
];
554 u8 pmac_invalid
; /* if set, don't attach the mac addr to the i/f */
555 u32 vlan_tag
; /* not used currently */
558 struct be_cmd_resp_if_create
{
559 struct be_cmd_resp_hdr hdr
;
564 /****** I/f Destroy(it's actually I/f Config Destroy )**********/
565 struct be_cmd_req_if_destroy
{
566 struct be_cmd_req_hdr hdr
;
570 /*************** HW Stats Get **********************************/
571 struct be_port_rxf_stats
{
572 u32 rx_bytes_lsd
; /* dword 0*/
573 u32 rx_bytes_msd
; /* dword 1*/
574 u32 rx_total_frames
; /* dword 2*/
575 u32 rx_unicast_frames
; /* dword 3*/
576 u32 rx_multicast_frames
; /* dword 4*/
577 u32 rx_broadcast_frames
; /* dword 5*/
578 u32 rx_crc_errors
; /* dword 6*/
579 u32 rx_alignment_symbol_errors
; /* dword 7*/
580 u32 rx_pause_frames
; /* dword 8*/
581 u32 rx_control_frames
; /* dword 9*/
582 u32 rx_in_range_errors
; /* dword 10*/
583 u32 rx_out_range_errors
; /* dword 11*/
584 u32 rx_frame_too_long
; /* dword 12*/
585 u32 rx_address_match_errors
; /* dword 13*/
586 u32 rx_vlan_mismatch
; /* dword 14*/
587 u32 rx_dropped_too_small
; /* dword 15*/
588 u32 rx_dropped_too_short
; /* dword 16*/
589 u32 rx_dropped_header_too_small
; /* dword 17*/
590 u32 rx_dropped_tcp_length
; /* dword 18*/
591 u32 rx_dropped_runt
; /* dword 19*/
592 u32 rx_64_byte_packets
; /* dword 20*/
593 u32 rx_65_127_byte_packets
; /* dword 21*/
594 u32 rx_128_256_byte_packets
; /* dword 22*/
595 u32 rx_256_511_byte_packets
; /* dword 23*/
596 u32 rx_512_1023_byte_packets
; /* dword 24*/
597 u32 rx_1024_1518_byte_packets
; /* dword 25*/
598 u32 rx_1519_2047_byte_packets
; /* dword 26*/
599 u32 rx_2048_4095_byte_packets
; /* dword 27*/
600 u32 rx_4096_8191_byte_packets
; /* dword 28*/
601 u32 rx_8192_9216_byte_packets
; /* dword 29*/
602 u32 rx_ip_checksum_errs
; /* dword 30*/
603 u32 rx_tcp_checksum_errs
; /* dword 31*/
604 u32 rx_udp_checksum_errs
; /* dword 32*/
605 u32 rx_non_rss_packets
; /* dword 33*/
606 u32 rx_ipv4_packets
; /* dword 34*/
607 u32 rx_ipv6_packets
; /* dword 35*/
608 u32 rx_ipv4_bytes_lsd
; /* dword 36*/
609 u32 rx_ipv4_bytes_msd
; /* dword 37*/
610 u32 rx_ipv6_bytes_lsd
; /* dword 38*/
611 u32 rx_ipv6_bytes_msd
; /* dword 39*/
612 u32 rx_chute1_packets
; /* dword 40*/
613 u32 rx_chute2_packets
; /* dword 41*/
614 u32 rx_chute3_packets
; /* dword 42*/
615 u32 rx_management_packets
; /* dword 43*/
616 u32 rx_switched_unicast_packets
; /* dword 44*/
617 u32 rx_switched_multicast_packets
; /* dword 45*/
618 u32 rx_switched_broadcast_packets
; /* dword 46*/
619 u32 tx_bytes_lsd
; /* dword 47*/
620 u32 tx_bytes_msd
; /* dword 48*/
621 u32 tx_unicastframes
; /* dword 49*/
622 u32 tx_multicastframes
; /* dword 50*/
623 u32 tx_broadcastframes
; /* dword 51*/
624 u32 tx_pauseframes
; /* dword 52*/
625 u32 tx_controlframes
; /* dword 53*/
626 u32 tx_64_byte_packets
; /* dword 54*/
627 u32 tx_65_127_byte_packets
; /* dword 55*/
628 u32 tx_128_256_byte_packets
; /* dword 56*/
629 u32 tx_256_511_byte_packets
; /* dword 57*/
630 u32 tx_512_1023_byte_packets
; /* dword 58*/
631 u32 tx_1024_1518_byte_packets
; /* dword 59*/
632 u32 tx_1519_2047_byte_packets
; /* dword 60*/
633 u32 tx_2048_4095_byte_packets
; /* dword 61*/
634 u32 tx_4096_8191_byte_packets
; /* dword 62*/
635 u32 tx_8192_9216_byte_packets
; /* dword 63*/
636 u32 rx_fifo_overflow
; /* dword 64*/
637 u32 rx_input_fifo_overflow
; /* dword 65*/
640 struct be_rxf_stats
{
641 struct be_port_rxf_stats port
[2];
642 u32 rx_drops_no_pbuf
; /* dword 132*/
643 u32 rx_drops_no_txpb
; /* dword 133*/
644 u32 rx_drops_no_erx_descr
; /* dword 134*/
645 u32 rx_drops_no_tpre_descr
; /* dword 135*/
646 u32 management_rx_port_packets
; /* dword 136*/
647 u32 management_rx_port_bytes
; /* dword 137*/
648 u32 management_rx_port_pause_frames
; /* dword 138*/
649 u32 management_rx_port_errors
; /* dword 139*/
650 u32 management_tx_port_packets
; /* dword 140*/
651 u32 management_tx_port_bytes
; /* dword 141*/
652 u32 management_tx_port_pause
; /* dword 142*/
653 u32 management_rx_port_rxfifo_overflow
; /* dword 143*/
654 u32 rx_drops_too_many_frags
; /* dword 144*/
655 u32 rx_drops_invalid_ring
; /* dword 145*/
656 u32 forwarded_packets
; /* dword 146*/
657 u32 rx_drops_mtu
; /* dword 147*/
659 u32 port0_jabber_events
;
660 u32 port1_jabber_events
;
664 struct be_erx_stats
{
665 u32 rx_drops_no_fragments
[44]; /* dwordS 0 to 43*/
666 u32 debug_wdma_sent_hold
; /* dword 44*/
667 u32 debug_wdma_pbfree_sent_hold
; /* dword 45*/
668 u32 debug_wdma_zerobyte_pbfree_sent_hold
; /* dword 46*/
669 u32 debug_pmem_pbuf_dealloc
; /* dword 47*/
672 struct be_pmem_stats
{
678 struct be_rxf_stats rxf
;
680 struct be_erx_stats erx
;
681 struct be_pmem_stats pmem
;
684 struct be_cmd_req_get_stats
{
685 struct be_cmd_req_hdr hdr
;
686 u8 rsvd
[sizeof(struct be_hw_stats
)];
689 struct be_cmd_resp_get_stats
{
690 struct be_cmd_resp_hdr hdr
;
691 struct be_hw_stats hw_stats
;
694 struct be_cmd_req_get_cntl_addnl_attribs
{
695 struct be_cmd_req_hdr hdr
;
699 struct be_cmd_resp_get_cntl_addnl_attribs
{
700 struct be_cmd_resp_hdr hdr
;
704 u8 on_die_temperature
; /* in degrees centigrade*/
708 struct be_cmd_req_vlan_config
{
709 struct be_cmd_req_hdr hdr
;
717 struct be_cmd_req_promiscuous_config
{
718 struct be_cmd_req_hdr hdr
;
719 u8 port0_promiscuous
;
720 u8 port1_promiscuous
;
724 /******************** Multicast MAC Config *******************/
725 #define BE_MAX_MC 64 /* set mcast promisc if > 64 */
730 struct be_cmd_req_mcast_mac_config
{
731 struct be_cmd_req_hdr hdr
;
735 struct macaddr mac
[BE_MAX_MC
];
738 static inline struct be_hw_stats
*
739 hw_stats_from_cmd(struct be_cmd_resp_get_stats
*cmd
)
741 return &cmd
->hw_stats
;
744 /******************** Link Status Query *******************/
745 struct be_cmd_req_link_status
{
746 struct be_cmd_req_hdr hdr
;
751 PHY_LINK_DUPLEX_NONE
= 0x0,
752 PHY_LINK_DUPLEX_HALF
= 0x1,
753 PHY_LINK_DUPLEX_FULL
= 0x2
757 PHY_LINK_SPEED_ZERO
= 0x0, /* => No link */
758 PHY_LINK_SPEED_10MBPS
= 0x1,
759 PHY_LINK_SPEED_100MBPS
= 0x2,
760 PHY_LINK_SPEED_1GBPS
= 0x3,
761 PHY_LINK_SPEED_10GBPS
= 0x4
764 struct be_cmd_resp_link_status
{
765 struct be_cmd_resp_hdr hdr
;
776 /******************** Port Identification ***************************/
777 /* Identifies the type of port attached to NIC */
778 struct be_cmd_req_port_type
{
779 struct be_cmd_req_hdr hdr
;
789 struct be_cmd_resp_port_type
{
790 struct be_cmd_resp_hdr hdr
;
813 /******************** Get FW Version *******************/
814 struct be_cmd_req_get_fw_version
{
815 struct be_cmd_req_hdr hdr
;
816 u8 rsvd0
[FW_VER_LEN
];
817 u8 rsvd1
[FW_VER_LEN
];
820 struct be_cmd_resp_get_fw_version
{
821 struct be_cmd_resp_hdr hdr
;
822 u8 firmware_version_string
[FW_VER_LEN
];
823 u8 fw_on_flash_version_string
[FW_VER_LEN
];
826 /******************** Set Flow Contrl *******************/
827 struct be_cmd_req_set_flow_control
{
828 struct be_cmd_req_hdr hdr
;
833 /******************** Get Flow Contrl *******************/
834 struct be_cmd_req_get_flow_control
{
835 struct be_cmd_req_hdr hdr
;
839 struct be_cmd_resp_get_flow_control
{
840 struct be_cmd_resp_hdr hdr
;
845 /******************** Modify EQ Delay *******************/
846 struct be_cmd_req_modify_eq_delay
{
847 struct be_cmd_req_hdr hdr
;
852 u32 delay_multiplier
;
856 struct be_cmd_resp_modify_eq_delay
{
857 struct be_cmd_resp_hdr hdr
;
861 /******************** Get FW Config *******************/
862 #define BE_FUNCTION_CAPS_RSS 0x2
863 struct be_cmd_req_query_fw_cfg
{
864 struct be_cmd_req_hdr hdr
;
868 struct be_cmd_resp_query_fw_cfg
{
869 struct be_cmd_resp_hdr hdr
;
870 u32 be_config_number
;
878 /******************** RSS Config *******************/
880 #define RSS_ENABLE_NONE 0x0
881 #define RSS_ENABLE_IPV4 0x1
882 #define RSS_ENABLE_TCP_IPV4 0x2
883 #define RSS_ENABLE_IPV6 0x4
884 #define RSS_ENABLE_TCP_IPV6 0x8
886 struct be_cmd_req_rss_config
{
887 struct be_cmd_req_hdr hdr
;
890 u16 cpu_table_size_log2
;
897 /******************** Port Beacon ***************************/
899 #define BEACON_STATE_ENABLED 0x1
900 #define BEACON_STATE_DISABLED 0x0
902 struct be_cmd_req_enable_disable_beacon
{
903 struct be_cmd_req_hdr hdr
;
910 struct be_cmd_resp_enable_disable_beacon
{
911 struct be_cmd_resp_hdr resp_hdr
;
915 struct be_cmd_req_get_beacon_state
{
916 struct be_cmd_req_hdr hdr
;
922 struct be_cmd_resp_get_beacon_state
{
923 struct be_cmd_resp_hdr resp_hdr
;
928 /****************** Firmware Flash ******************/
929 struct flashrom_params
{
937 struct be_cmd_write_flashrom
{
938 struct be_cmd_req_hdr hdr
;
939 struct flashrom_params params
;
942 /************************ WOL *******************************/
943 struct be_cmd_req_acpi_wol_magic_config
{
944 struct be_cmd_req_hdr hdr
;
950 /********************** LoopBack test *********************/
951 struct be_cmd_req_loopback_test
{
952 struct be_cmd_req_hdr hdr
;
961 struct be_cmd_resp_loopback_test
{
962 struct be_cmd_resp_hdr resp_hdr
;
970 struct be_cmd_req_set_lmode
{
971 struct be_cmd_req_hdr hdr
;
978 struct be_cmd_resp_set_lmode
{
979 struct be_cmd_resp_hdr resp_hdr
;
983 /********************** DDR DMA test *********************/
984 struct be_cmd_req_ddrdma_test
{
985 struct be_cmd_req_hdr hdr
;
993 struct be_cmd_resp_ddrdma_test
{
994 struct be_cmd_resp_hdr hdr
;
1002 /*********************** SEEPROM Read ***********************/
1004 #define BE_READ_SEEPROM_LEN 1024
1005 struct be_cmd_req_seeprom_read
{
1006 struct be_cmd_req_hdr hdr
;
1007 u8 rsvd0
[BE_READ_SEEPROM_LEN
];
1010 struct be_cmd_resp_seeprom_read
{
1011 struct be_cmd_req_hdr hdr
;
1012 u8 seeprom_data
[BE_READ_SEEPROM_LEN
];
1016 PHY_TYPE_CX4_10GB
= 0,
1019 PHY_TYPE_SFP_PLUS_10GB
,
1022 PHY_TYPE_BASET_10GB
,
1024 PHY_TYPE_DISABLED
= 255
1027 struct be_cmd_req_get_phy_info
{
1028 struct be_cmd_req_hdr hdr
;
1031 struct be_cmd_resp_get_phy_info
{
1032 struct be_cmd_req_hdr hdr
;
1039 /*********************** Set QOS ***********************/
1041 #define BE_QOS_BITS_NIC 1
1043 struct be_cmd_req_set_qos
{
1044 struct be_cmd_req_hdr hdr
;
1050 struct be_cmd_resp_set_qos
{
1051 struct be_cmd_resp_hdr hdr
;
1055 /*********************** Controller Attributes ***********************/
1056 struct be_cmd_req_cntl_attribs
{
1057 struct be_cmd_req_hdr hdr
;
1060 struct be_cmd_resp_cntl_attribs
{
1061 struct be_cmd_resp_hdr hdr
;
1062 struct mgmt_controller_attrib attribs
;
1065 /*********************** Set driver function ***********************/
1066 #define CAPABILITY_SW_TIMESTAMPS 2
1067 #define CAPABILITY_BE3_NATIVE_ERX_API 4
1069 struct be_cmd_req_set_func_cap
{
1070 struct be_cmd_req_hdr hdr
;
1071 u32 valid_cap_flags
;
1076 struct be_cmd_resp_set_func_cap
{
1077 struct be_cmd_resp_hdr hdr
;
1078 u32 valid_cap_flags
;
1083 extern int be_pci_fnum_get(struct be_adapter
*adapter
);
1084 extern int be_cmd_POST(struct be_adapter
*adapter
);
1085 extern int be_cmd_mac_addr_query(struct be_adapter
*adapter
, u8
*mac_addr
,
1086 u8 type
, bool permanent
, u32 if_handle
);
1087 extern int be_cmd_pmac_add(struct be_adapter
*adapter
, u8
*mac_addr
,
1088 u32 if_id
, u32
*pmac_id
, u32 domain
);
1089 extern int be_cmd_pmac_del(struct be_adapter
*adapter
, u32 if_id
,
1090 u32 pmac_id
, u32 domain
);
1091 extern int be_cmd_if_create(struct be_adapter
*adapter
, u32 cap_flags
,
1092 u32 en_flags
, u8
*mac
, bool pmac_invalid
,
1093 u32
*if_handle
, u32
*pmac_id
, u32 domain
);
1094 extern int be_cmd_if_destroy(struct be_adapter
*adapter
, u32 if_handle
,
1096 extern int be_cmd_eq_create(struct be_adapter
*adapter
,
1097 struct be_queue_info
*eq
, int eq_delay
);
1098 extern int be_cmd_cq_create(struct be_adapter
*adapter
,
1099 struct be_queue_info
*cq
, struct be_queue_info
*eq
,
1100 bool sol_evts
, bool no_delay
,
1101 int num_cqe_dma_coalesce
);
1102 extern int be_cmd_mccq_create(struct be_adapter
*adapter
,
1103 struct be_queue_info
*mccq
,
1104 struct be_queue_info
*cq
);
1105 extern int be_cmd_txq_create(struct be_adapter
*adapter
,
1106 struct be_queue_info
*txq
,
1107 struct be_queue_info
*cq
);
1108 extern int be_cmd_rxq_create(struct be_adapter
*adapter
,
1109 struct be_queue_info
*rxq
, u16 cq_id
,
1110 u16 frag_size
, u16 max_frame_size
, u32 if_id
,
1111 u32 rss
, u8
*rss_id
);
1112 extern int be_cmd_q_destroy(struct be_adapter
*adapter
, struct be_queue_info
*q
,
1114 extern int be_cmd_link_status_query(struct be_adapter
*adapter
,
1115 bool *link_up
, u8
*mac_speed
, u16
*link_speed
, u32 dom
);
1116 extern int be_cmd_reset(struct be_adapter
*adapter
);
1117 extern int be_cmd_get_stats(struct be_adapter
*adapter
,
1118 struct be_dma_mem
*nonemb_cmd
);
1119 extern int be_cmd_get_fw_ver(struct be_adapter
*adapter
, char *fw_ver
);
1121 extern int be_cmd_modify_eqd(struct be_adapter
*adapter
, u32 eq_id
, u32 eqd
);
1122 extern int be_cmd_vlan_config(struct be_adapter
*adapter
, u32 if_id
,
1123 u16
*vtag_array
, u32 num
, bool untagged
,
1125 extern int be_cmd_promiscuous_config(struct be_adapter
*adapter
,
1126 u8 port_num
, bool en
);
1127 extern int be_cmd_multicast_set(struct be_adapter
*adapter
, u32 if_id
,
1128 struct net_device
*netdev
, struct be_dma_mem
*mem
);
1129 extern int be_cmd_set_flow_control(struct be_adapter
*adapter
,
1130 u32 tx_fc
, u32 rx_fc
);
1131 extern int be_cmd_get_flow_control(struct be_adapter
*adapter
,
1132 u32
*tx_fc
, u32
*rx_fc
);
1133 extern int be_cmd_query_fw_cfg(struct be_adapter
*adapter
,
1134 u32
*port_num
, u32
*function_mode
, u32
*function_caps
);
1135 extern int be_cmd_reset_function(struct be_adapter
*adapter
);
1136 extern int be_cmd_rss_config(struct be_adapter
*adapter
, u8
*rsstable
,
1138 extern int be_process_mcc(struct be_adapter
*adapter
, int *status
);
1139 extern int be_cmd_set_beacon_state(struct be_adapter
*adapter
,
1140 u8 port_num
, u8 beacon
, u8 status
, u8 state
);
1141 extern int be_cmd_get_beacon_state(struct be_adapter
*adapter
,
1142 u8 port_num
, u32
*state
);
1143 extern int be_cmd_write_flashrom(struct be_adapter
*adapter
,
1144 struct be_dma_mem
*cmd
, u32 flash_oper
,
1145 u32 flash_opcode
, u32 buf_size
);
1146 int be_cmd_get_flash_crc(struct be_adapter
*adapter
, u8
*flashed_crc
,
1148 extern int be_cmd_enable_magic_wol(struct be_adapter
*adapter
, u8
*mac
,
1149 struct be_dma_mem
*nonemb_cmd
);
1150 extern int be_cmd_fw_init(struct be_adapter
*adapter
);
1151 extern int be_cmd_fw_clean(struct be_adapter
*adapter
);
1152 extern void be_async_mcc_enable(struct be_adapter
*adapter
);
1153 extern void be_async_mcc_disable(struct be_adapter
*adapter
);
1154 extern int be_cmd_loopback_test(struct be_adapter
*adapter
, u32 port_num
,
1155 u32 loopback_type
, u32 pkt_size
,
1156 u32 num_pkts
, u64 pattern
);
1157 extern int be_cmd_ddr_dma_test(struct be_adapter
*adapter
, u64 pattern
,
1158 u32 byte_cnt
, struct be_dma_mem
*cmd
);
1159 extern int be_cmd_get_seeprom_data(struct be_adapter
*adapter
,
1160 struct be_dma_mem
*nonemb_cmd
);
1161 extern int be_cmd_set_loopback(struct be_adapter
*adapter
, u8 port_num
,
1162 u8 loopback_type
, u8 enable
);
1163 extern int be_cmd_get_phy_info(struct be_adapter
*adapter
,
1164 struct be_dma_mem
*cmd
);
1165 extern int be_cmd_set_qos(struct be_adapter
*adapter
, u32 bps
, u32 domain
);
1166 extern void be_detect_dump_ue(struct be_adapter
*adapter
);
1167 extern int be_cmd_get_die_temperature(struct be_adapter
*adapter
);
1168 extern int be_cmd_get_cntl_attributes(struct be_adapter
*adapter
);
1169 extern int be_cmd_check_native_mode(struct be_adapter
*adapter
);
1170 extern int be_cmd_get_reg_len(struct be_adapter
*adapter
, u32
*log_size
);
1171 extern void be_cmd_get_regs(struct be_adapter
*adapter
, u32 buf_len
, void *buf
);