2 * Copyright (c) 2007 Mellanox Technologies. All rights reserved.
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34 #ifndef _MLX4_EN_PORT_H_
35 #define _MLX4_EN_PORT_H_
38 #define SET_PORT_PROMISC_SHIFT 31
39 #define SET_PORT_MC_PROMISC_SHIFT 30
41 #define MLX4_EN_NUM_TC 8
43 #define VLAN_FLTR_SIZE 128
44 struct mlx4_set_vlan_fltr_mbox
{
45 __be32 entry
[VLAN_FLTR_SIZE
];
50 MLX4_MCAST_CONFIG
= 0,
51 MLX4_MCAST_DISABLE
= 1,
52 MLX4_MCAST_ENABLE
= 2,
56 MLX4_1000BASE_CX_SGMII
= 0,
67 MLX4_40GBASE_SR4
= 15,
68 MLX4_56GBASE_CR4
= 17,
69 MLX4_56GBASE_SR4
= 18,
75 #define MLX4_PROT_MASK(link_mode) (1<<link_mode)
78 MLX4_EN_100M_SPEED
= 0x04,
79 MLX4_EN_10G_SPEED_XAUI
= 0x00,
80 MLX4_EN_10G_SPEED_XFI
= 0x01,
81 MLX4_EN_1G_SPEED
= 0x02,
82 MLX4_EN_20G_SPEED
= 0x08,
83 MLX4_EN_40G_SPEED
= 0x40,
84 MLX4_EN_56G_SPEED
= 0x20,
85 MLX4_EN_OTHER_SPEED
= 0x0f,
88 struct mlx4_en_query_port_context
{
90 #define MLX4_EN_LINK_UP_MASK 0x80
91 #define MLX4_EN_ANC_MASK 0x40
93 #define MLX4_EN_AUTONEG_MASK 0x80
97 #define MLX4_EN_SPEED_MASK 0x6f
104 struct mlx4_en_stat_out_mbox
{
105 /* Received frames with a length of 64 octets */
115 /* Received frames with a length of 127 octets */
125 /* Received frames with a length of 255 octets */
135 /* Received frames with a length of 511 octets */
145 /* Received frames with a length of 1023 octets */
155 /* Received frames with a length of 1518 octets */
165 /* Received frames with a length of 1522 octets */
175 /* Received frames with a length of 1548 octets */
185 /* Received frames with a length of 1548 < octets < MTU */
195 /* Received frames with a length of MTU< octets and good CRC */
196 __be64 RGIANT_prio_0
;
197 __be64 RGIANT_prio_1
;
198 __be64 RGIANT_prio_2
;
199 __be64 RGIANT_prio_3
;
200 __be64 RGIANT_prio_4
;
201 __be64 RGIANT_prio_5
;
202 __be64 RGIANT_prio_6
;
203 __be64 RGIANT_prio_7
;
204 __be64 RGIANT_novlan
;
205 /* Received broadcast frames with good CRC */
206 __be64 RBCAST_prio_0
;
207 __be64 RBCAST_prio_1
;
208 __be64 RBCAST_prio_2
;
209 __be64 RBCAST_prio_3
;
210 __be64 RBCAST_prio_4
;
211 __be64 RBCAST_prio_5
;
212 __be64 RBCAST_prio_6
;
213 __be64 RBCAST_prio_7
;
214 __be64 RBCAST_novlan
;
215 /* Received multicast frames with good CRC */
225 /* Received unicast not short or GIANT frames with good CRC */
236 /* Count of total octets of received frames, includes framing characters */
237 __be64 RTTLOCT_prio_0
;
238 /* Count of total octets of received frames, not including framing
240 __be64 RTTLOCT_NOFRM_prio_0
;
241 /* Count of Total number of octets received
242 (only for frames without errors) */
245 __be64 RTTLOCT_prio_1
;
246 __be64 RTTLOCT_NOFRM_prio_1
;
249 __be64 RTTLOCT_prio_2
;
250 __be64 RTTLOCT_NOFRM_prio_2
;
253 __be64 RTTLOCT_prio_3
;
254 __be64 RTTLOCT_NOFRM_prio_3
;
257 __be64 RTTLOCT_prio_4
;
258 __be64 RTTLOCT_NOFRM_prio_4
;
261 __be64 RTTLOCT_prio_5
;
262 __be64 RTTLOCT_NOFRM_prio_5
;
265 __be64 RTTLOCT_prio_6
;
266 __be64 RTTLOCT_NOFRM_prio_6
;
269 __be64 RTTLOCT_prio_7
;
270 __be64 RTTLOCT_NOFRM_prio_7
;
273 __be64 RTTLOCT_novlan
;
274 __be64 RTTLOCT_NOFRM_novlan
;
277 /* Count of Total received frames including bad frames */
279 /* Count of Total number of received frames with 802.1Q encapsulation */
315 /* Total number of Successfully Received Control Frames */
320 /* Count of received frames with a length/type field value between 46
321 (42 for VLANtagged frames) and 1500 (also 1500 for VLAN-tagged frames),
323 __be64 RInRangeLengthErr
;
324 /* Count of received frames with length/type field between 1501 and 1535
325 decimal, inclusive */
326 __be64 ROutRangeLengthErr
;
327 /* Count of received frames that are longer than max allowed size for
328 802.3 frames (1518/1522) */
330 /* Count frames received with PCS error */
333 /* Transmit frames with a length of 64 octets */
344 /* Transmit frames with a length of 65 to 127 octets. */
355 /* Transmit frames with a length of 128 to 255 octets */
366 /* Transmit frames with a length of 256 to 511 octets */
377 /* Transmit frames with a length of 512 to 1023 octets */
388 /* Transmit frames with a length of 1024 to 1518 octets */
399 /* Counts transmit frames with a length of 1519 to 1522 bytes */
410 /* Transmit frames with a length of 1523 to 1548 octets */
421 /* Counts transmit frames with a length of 1549 to MTU bytes */
432 /* Transmit frames with a length greater than MTU octets and a good CRC. */
433 __be64 TGIANT_prio_0
;
434 __be64 TGIANT_prio_1
;
435 __be64 TGIANT_prio_2
;
436 __be64 TGIANT_prio_3
;
437 __be64 TGIANT_prio_4
;
438 __be64 TGIANT_prio_5
;
439 __be64 TGIANT_prio_6
;
440 __be64 TGIANT_prio_7
;
441 __be64 TGIANT_novlan
;
442 __be64 TGIANT_loopbk
;
443 /* Transmit broadcast frames with a good CRC */
444 __be64 TBCAST_prio_0
;
445 __be64 TBCAST_prio_1
;
446 __be64 TBCAST_prio_2
;
447 __be64 TBCAST_prio_3
;
448 __be64 TBCAST_prio_4
;
449 __be64 TBCAST_prio_5
;
450 __be64 TBCAST_prio_6
;
451 __be64 TBCAST_prio_7
;
452 __be64 TBCAST_novlan
;
453 __be64 TBCAST_loopbk
;
454 /* Transmit multicast frames with a good CRC */
455 __be64 TMCAST_prio_0
;
456 __be64 TMCAST_prio_1
;
457 __be64 TMCAST_prio_2
;
458 __be64 TMCAST_prio_3
;
459 __be64 TMCAST_prio_4
;
460 __be64 TMCAST_prio_5
;
461 __be64 TMCAST_prio_6
;
462 __be64 TMCAST_prio_7
;
463 __be64 TMCAST_novlan
;
464 __be64 TMCAST_loopbk
;
465 /* Transmit good frames that are neither broadcast nor multicast */
477 /* total octets of transmitted frames, including framing characters */
478 __be64 TTTLOCT_prio_0
;
479 /* total octets of transmitted frames, not including framing characters */
480 __be64 TTTLOCT_NOFRM_prio_0
;
484 __be64 TTTLOCT_prio_1
;
485 __be64 TTTLOCT_NOFRM_prio_1
;
488 __be64 TTTLOCT_prio_2
;
489 __be64 TTTLOCT_NOFRM_prio_2
;
492 __be64 TTTLOCT_prio_3
;
493 __be64 TTTLOCT_NOFRM_prio_3
;
496 __be64 TTTLOCT_prio_4
;
497 __be64 TTTLOCT_NOFRM_prio_4
;
500 __be64 TTTLOCT_prio_5
;
501 __be64 TTTLOCT_NOFRM_prio_5
;
504 __be64 TTTLOCT_prio_6
;
505 __be64 TTTLOCT_NOFRM_prio_6
;
508 __be64 TTTLOCT_prio_7
;
509 __be64 TTTLOCT_NOFRM_prio_7
;
512 __be64 TTTLOCT_novlan
;
513 __be64 TTTLOCT_NOFRM_novlan
;
516 __be64 TTTLOCT_loopbk
;
517 __be64 TTTLOCT_NOFRM_loopbk
;
520 /* Total frames transmitted with a good CRC that are not aborted */
522 /* Total number of frames transmitted with 802.1Q encapsulation */
562 /* Received frames with a length greater than MTU octets and a bad CRC */
564 /* Received frames with a bad CRC that are not runts, jabbers,
565 or alignment errors */
567 /* Received frames with SFD with a length of less than 64 octets and a
570 /* Received frames with a length less than 64 octets and a good CRC */
572 /* Total Number of Received Packets Dropped */
574 /* Drop due to overflow */
576 /* Drop due to overflow */
578 /* Total of good frames. Does not include frames received with
579 frame-too-long, FCS, or length errors */
581 /* Total dropped Xmited packets */