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
67 struct ngbe_bus_info {
68 void (*set_lan_id)(struct ngbe_hw *hw);
74 struct ngbe_rom_info {
75 s32 (*init_params)(struct ngbe_hw *hw);
76 s32 (*validate_checksum)(struct ngbe_hw *hw, u16 *checksum_val);
78 enum ngbe_eeprom_type type;
88 struct ngbe_mac_info {
89 s32 (*init_hw)(struct ngbe_hw *hw);
90 s32 (*reset_hw)(struct ngbe_hw *hw);
91 s32 (*stop_hw)(struct ngbe_hw *hw);
92 s32 (*acquire_swfw_sync)(struct ngbe_hw *hw, u32 mask);
93 void (*release_swfw_sync)(struct ngbe_hw *hw, u32 mask);
95 /* Manageability interface */
96 s32 (*init_thermal_sensor_thresh)(struct ngbe_hw *hw);
97 s32 (*check_overtemp)(struct ngbe_hw *hw);
99 enum ngbe_mac_type type;
102 struct ngbe_thermal_sensor_data thermal_sensor_data;
106 struct ngbe_phy_info {
107 s32 (*identify)(struct ngbe_hw *hw);
108 s32 (*reset_hw)(struct ngbe_hw *hw);
109 s32 (*read_reg)(struct ngbe_hw *hw, u32 reg_addr,
110 u32 device_type, u16 *phy_data);
111 s32 (*write_reg)(struct ngbe_hw *hw, u32 reg_addr,
112 u32 device_type, u16 phy_data);
113 s32 (*read_reg_unlocked)(struct ngbe_hw *hw, u32 reg_addr,
114 u32 device_type, u16 *phy_data);
115 s32 (*write_reg_unlocked)(struct ngbe_hw *hw, u32 reg_addr,
116 u32 device_type, u16 phy_data);
118 enum ngbe_media_type media_type;
119 enum ngbe_phy_type type;
123 u32 phy_semaphore_mask;
130 struct ngbe_mac_info mac;
131 struct ngbe_phy_info phy;
132 struct ngbe_rom_info rom;
133 struct ngbe_bus_info bus;
138 bool adapter_stopped;
146 #include "ngbe_regs.h"
147 #include "ngbe_dummy.h"
149 #endif /* _NGBE_TYPE_H_ */