1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018-2021 Beijing WangXun Technology Co., Ltd.
3 * Copyright(c) 2010-2017 Intel Corporation
9 #define NGBE_FRAME_SIZE_DFT (1522) /* Default frame size, +FCS */
11 #define NGBE_ALIGN 128 /* as intel did */
12 #define NGBE_ISB_SIZE 16
14 #include "ngbe_status.h"
15 #include "ngbe_osdep.h"
16 #include "ngbe_devids.h"
18 struct ngbe_thermal_diode_data {
24 struct ngbe_thermal_sensor_data {
25 struct ngbe_thermal_diode_data sensor[1];
28 enum ngbe_eeprom_type {
29 ngbe_eeprom_unknown = 0,
32 ngbe_eeprom_none /* No NVM support */
54 enum ngbe_media_type {
55 ngbe_media_type_unknown = 0,
56 ngbe_media_type_fiber,
57 ngbe_media_type_fiber_qsfp,
58 ngbe_media_type_copper,
59 ngbe_media_type_backplane,
61 ngbe_media_type_virtual
66 struct ngbe_addr_filter_info {
71 struct ngbe_bus_info {
72 void (*set_lan_id)(struct ngbe_hw *hw);
78 struct ngbe_rom_info {
79 s32 (*init_params)(struct ngbe_hw *hw);
80 s32 (*validate_checksum)(struct ngbe_hw *hw, u16 *checksum_val);
82 enum ngbe_eeprom_type type;
92 struct ngbe_mac_info {
93 s32 (*init_hw)(struct ngbe_hw *hw);
94 s32 (*reset_hw)(struct ngbe_hw *hw);
95 s32 (*stop_hw)(struct ngbe_hw *hw);
96 s32 (*get_mac_addr)(struct ngbe_hw *hw, u8 *mac_addr);
97 s32 (*acquire_swfw_sync)(struct ngbe_hw *hw, u32 mask);
98 void (*release_swfw_sync)(struct ngbe_hw *hw, u32 mask);
101 s32 (*set_rar)(struct ngbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
103 s32 (*clear_rar)(struct ngbe_hw *hw, u32 index);
104 s32 (*set_vmdq)(struct ngbe_hw *hw, u32 rar, u32 vmdq);
105 s32 (*clear_vmdq)(struct ngbe_hw *hw, u32 rar, u32 vmdq);
106 s32 (*init_rx_addrs)(struct ngbe_hw *hw);
108 /* Manageability interface */
109 s32 (*init_thermal_sensor_thresh)(struct ngbe_hw *hw);
110 s32 (*check_overtemp)(struct ngbe_hw *hw);
112 enum ngbe_mac_type type;
113 u8 addr[ETH_ADDR_LEN];
114 u8 perm_addr[ETH_ADDR_LEN];
120 struct ngbe_thermal_sensor_data thermal_sensor_data;
124 struct ngbe_phy_info {
125 s32 (*identify)(struct ngbe_hw *hw);
126 s32 (*reset_hw)(struct ngbe_hw *hw);
127 s32 (*read_reg)(struct ngbe_hw *hw, u32 reg_addr,
128 u32 device_type, u16 *phy_data);
129 s32 (*write_reg)(struct ngbe_hw *hw, u32 reg_addr,
130 u32 device_type, u16 phy_data);
131 s32 (*read_reg_unlocked)(struct ngbe_hw *hw, u32 reg_addr,
132 u32 device_type, u16 *phy_data);
133 s32 (*write_reg_unlocked)(struct ngbe_hw *hw, u32 reg_addr,
134 u32 device_type, u16 phy_data);
136 enum ngbe_media_type media_type;
137 enum ngbe_phy_type type;
141 u32 phy_semaphore_mask;
148 struct ngbe_mac_info mac;
149 struct ngbe_addr_filter_info addr_ctrl;
150 struct ngbe_phy_info phy;
151 struct ngbe_rom_info rom;
152 struct ngbe_bus_info bus;
157 bool adapter_stopped;
165 #include "ngbe_regs.h"
166 #include "ngbe_dummy.h"
168 #endif /* _NGBE_TYPE_H_ */