iPXE
mlx_link_speed.h
Go to the documentation of this file.
1 #ifndef MLX_LINK_SPEED_H_
2 #define MLX_LINK_SPEED_H_
3 
4 /*
5  * Copyright (C) 2015 Mellanox Technologies Ltd.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of the
10  * License, or any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20  * 02110-1301, USA.
21  */
22 
23 FILE_LICENCE ( GPL2_OR_LATER );
24 
25 #include "../../mlx_lib/mlx_reg_access/mlx_reg_access.h"
26 #include "../../include/public/mlx_utils.h"
27 
28 #define LINK_SPEED_100GB_MASK (ETH_SPEED_ENABLE_MASK_100GBASECR4 | ETH_SPEED_ENABLE_MASK_100GBASESR4 | ETH_SPEED_ENABLE_MASK_100GBASEKR4 | ETH_SPEED_ENABLE_MASK_100GBASELR4)
29 #define LINK_SPEED_56GB_MASK (ETH_SPEED_ENABLE_MASK_56GBASER4)
30 #define LINK_SPEED_50GB_MASK (ETH_SPEED_ENABLE_MASK_50GBASECR2 | ETH_SPEED_ENABLE_MASK_50GBASEKR2)
31 #define LINK_SPEED_40GB_MASK (ETH_SPEED_ENABLE_MASK_40GBASECR4 | ETH_SPEED_ENABLE_MASK_40GBASEKR4 | ETH_SPEED_ENABLE_MASK_40GBASESR4 | ETH_SPEED_ENABLE_MASK_40GBASELR4)
32 #define LINK_SPEED_25GB_MASK (ETH_SPEED_ENABLE_MASK_25GBASECR | ETH_SPEED_ENABLE_MASK_25GBASEKR | ETH_SPEED_ENABLE_MASK_25GBASESR)
33 #define LINK_SPEED_20GB_MASK (ETH_SPEED_ENABLE_MASK_20GBASER2)
34 #define LINK_SPEED_10GB_MASK (ETH_SPEED_ENABLE_MASK_10GBASECR | ETH_SPEED_ENABLE_MASK_10GBASESR | ETH_SPEED_ENABLE_MASK_10GBASELR | ETH_SPEED_ENABLE_MASK_10GBASEKR)
35 #define LINK_SPEED_1GB_MASK (ETH_SPEED_ENABLE_MASK_1000BASECX | ETH_SPEED_ENABLE_MASK_1000BASEKX | ETH_SPEED_ENABLE_MASK_100BaseTX | ETH_SPEED_ENABLE_MASK_1000BASET)
36 
37 #define LINK_SPEED_SDR_MASK 0x1
38 #define LINK_SPEED_DDR_MASK 0x2
39 #define LINK_SPEED_QDR_MASK 0xC
40 #define LINK_SPEED_FDR_MASK 0x10
41 #define LINK_SPEED_EDR20_MASK 0x200
42 #define LINK_SPEED_EDR_MASK 0x20
43 
44 #define LINK_SPEED_WITDH_1_MASK 0x1
45 #define LINK_SPEED_WITDH_2_MASK 0x2
46 #define LINK_SPEED_WITDH_4_MASK 0x4
47 #define LINK_SPEED_WITDH_8_MASK 0x8
48 #define LINK_SPEED_WITDH_12_MASK 0x10
49 
50 #define GIGA_TO_BIT 0x40000000
51 
52 enum {
81 };
82 
83 
84 typedef enum {
89 
90 typedef enum {
97 } LINK_SPEED;
98 
104  /* -------------- */
106  /* -------------- */
108  /* -------------- */
110  /* -------------- */
113  /* -------------- */
115  /* -------------- */
117  /* -------------- */
120  /* -------------- */
122  /* -------------- */
124  /* -------------- */
127  /* -------------- */
129  /* -------------- */
132 };
133 
136  IN mlx_utils *utils,
139  IN LINK_SPEED speed
140  );
141 
144  IN mlx_utils *utils,
147  OUT mlx_uint64 *speed
148  );
149 
150 #endif /* MLX_LINK_SPEED_H_ */
uint8_t type
Type.
Definition: ena.h:16
uint32_t mlx_uint32
#define OUT
Definition: mlx_utils.h:29
#define IN
Definition: mlx_utils.h:28
__be16 port_num
Definition: CIB_PRM.h:31
uint8_t mlx_uint8
int mlx_status
uint64_t mlx_uint64