1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018-2021 Beijing WangXun Technology Co., Ltd.
5 #ifndef _NGBE_TYPE_DUMMY_H_
6 #define _NGBE_TYPE_DUMMY_H_
9 #elif defined(__GNUC__)
10 #define TUP(x) x##_unused ngbe_unused
11 #elif defined(__LCLINT__)
12 #define TUP(x) x /*@unused@*/
27 /* struct ngbe_bus_operations */
28 static inline void ngbe_bus_set_lan_id_dummy(struct ngbe_hw *TUP0)
31 /* struct ngbe_rom_operations */
32 static inline s32 ngbe_rom_init_params_dummy(struct ngbe_hw *TUP0)
34 return NGBE_ERR_OPS_DUMMY;
36 static inline s32 ngbe_rom_read32_dummy(struct ngbe_hw *TUP0, u32 TUP1,
39 return NGBE_ERR_OPS_DUMMY;
41 static inline s32 ngbe_rom_validate_checksum_dummy(struct ngbe_hw *TUP0,
44 return NGBE_ERR_OPS_DUMMY;
46 /* struct ngbe_mac_operations */
47 static inline s32 ngbe_mac_init_hw_dummy(struct ngbe_hw *TUP0)
49 return NGBE_ERR_OPS_DUMMY;
51 static inline s32 ngbe_mac_reset_hw_dummy(struct ngbe_hw *TUP0)
53 return NGBE_ERR_OPS_DUMMY;
55 static inline s32 ngbe_mac_start_hw_dummy(struct ngbe_hw *TUP0)
57 return NGBE_ERR_OPS_DUMMY;
59 static inline s32 ngbe_mac_stop_hw_dummy(struct ngbe_hw *TUP0)
61 return NGBE_ERR_OPS_DUMMY;
63 static inline s32 ngbe_mac_clear_hw_cntrs_dummy(struct ngbe_hw *TUP0)
65 return NGBE_ERR_OPS_DUMMY;
67 static inline s32 ngbe_mac_get_mac_addr_dummy(struct ngbe_hw *TUP0, u8 *TUP1)
69 return NGBE_ERR_OPS_DUMMY;
71 static inline s32 ngbe_mac_enable_rx_dma_dummy(struct ngbe_hw *TUP0, u32 TUP1)
73 return NGBE_ERR_OPS_DUMMY;
75 static inline s32 ngbe_mac_disable_sec_rx_path_dummy(struct ngbe_hw *TUP0)
77 return NGBE_ERR_OPS_DUMMY;
79 static inline s32 ngbe_mac_enable_sec_rx_path_dummy(struct ngbe_hw *TUP0)
81 return NGBE_ERR_OPS_DUMMY;
83 static inline s32 ngbe_mac_acquire_swfw_sync_dummy(struct ngbe_hw *TUP0,
86 return NGBE_ERR_OPS_DUMMY;
88 static inline void ngbe_mac_release_swfw_sync_dummy(struct ngbe_hw *TUP0,
92 static inline s32 ngbe_mac_setup_link_dummy(struct ngbe_hw *TUP0, u32 TUP1,
95 return NGBE_ERR_OPS_DUMMY;
97 static inline s32 ngbe_mac_check_link_dummy(struct ngbe_hw *TUP0, u32 *TUP1,
98 bool *TUP3, bool TUP4)
100 return NGBE_ERR_OPS_DUMMY;
102 static inline s32 ngbe_mac_get_link_capabilities_dummy(struct ngbe_hw *TUP0,
103 u32 *TUP1, bool *TUP2)
105 return NGBE_ERR_OPS_DUMMY;
107 static inline s32 ngbe_mac_set_rar_dummy(struct ngbe_hw *TUP0, u32 TUP1,
108 u8 *TUP2, u32 TUP3, u32 TUP4)
110 return NGBE_ERR_OPS_DUMMY;
112 static inline s32 ngbe_mac_clear_rar_dummy(struct ngbe_hw *TUP0, u32 TUP1)
114 return NGBE_ERR_OPS_DUMMY;
116 static inline s32 ngbe_mac_set_vmdq_dummy(struct ngbe_hw *TUP0, u32 TUP1,
119 return NGBE_ERR_OPS_DUMMY;
121 static inline s32 ngbe_mac_clear_vmdq_dummy(struct ngbe_hw *TUP0, u32 TUP1,
124 return NGBE_ERR_OPS_DUMMY;
126 static inline s32 ngbe_mac_init_rx_addrs_dummy(struct ngbe_hw *TUP0)
128 return NGBE_ERR_OPS_DUMMY;
130 static inline s32 ngbe_mac_update_mc_addr_list_dummy(struct ngbe_hw *TUP0,
131 u8 *TUP1, u32 TUP2, ngbe_mc_addr_itr TUP3, bool TUP4)
133 return NGBE_ERR_OPS_DUMMY;
135 static inline s32 ngbe_mac_clear_vfta_dummy(struct ngbe_hw *TUP0)
137 return NGBE_ERR_OPS_DUMMY;
139 static inline s32 ngbe_mac_set_vfta_dummy(struct ngbe_hw *TUP0, u32 TUP1,
140 u32 TUP2, bool TUP3, bool TUP4)
142 return NGBE_ERR_OPS_DUMMY;
144 static inline s32 ngbe_mac_set_vlvf_dummy(struct ngbe_hw *TUP0, u32 TUP1,
145 u32 TUP2, bool TUP3, u32 *TUP4, u32 TUP5, bool TUP6)
147 return NGBE_ERR_OPS_DUMMY;
149 static inline void ngbe_mac_set_mac_anti_spoofing_dummy(struct ngbe_hw *TUP0,
153 static inline void ngbe_mac_set_vlan_anti_spoofing_dummy(struct ngbe_hw *TUP0,
157 static inline s32 ngbe_mac_fc_enable_dummy(struct ngbe_hw *TUP0)
159 return NGBE_ERR_OPS_DUMMY;
161 static inline s32 ngbe_mac_setup_fc_dummy(struct ngbe_hw *TUP0)
163 return NGBE_ERR_OPS_DUMMY;
165 static inline void ngbe_mac_fc_autoneg_dummy(struct ngbe_hw *TUP0)
168 static inline s32 ngbe_mac_init_thermal_ssth_dummy(struct ngbe_hw *TUP0)
170 return NGBE_ERR_OPS_DUMMY;
172 static inline s32 ngbe_mac_check_overtemp_dummy(struct ngbe_hw *TUP0)
174 return NGBE_ERR_OPS_DUMMY;
176 /* struct ngbe_phy_operations */
177 static inline s32 ngbe_phy_identify_dummy(struct ngbe_hw *TUP0)
179 return NGBE_ERR_OPS_DUMMY;
181 static inline s32 ngbe_phy_init_hw_dummy(struct ngbe_hw *TUP0)
183 return NGBE_ERR_OPS_DUMMY;
185 static inline s32 ngbe_phy_reset_hw_dummy(struct ngbe_hw *TUP0)
187 return NGBE_ERR_OPS_DUMMY;
189 static inline s32 ngbe_phy_read_reg_dummy(struct ngbe_hw *TUP0, u32 TUP1,
192 return NGBE_ERR_OPS_DUMMY;
194 static inline s32 ngbe_phy_write_reg_dummy(struct ngbe_hw *TUP0, u32 TUP1,
197 return NGBE_ERR_OPS_DUMMY;
199 static inline s32 ngbe_phy_read_reg_unlocked_dummy(struct ngbe_hw *TUP0,
200 u32 TUP1, u32 TUP2, u16 *TUP3)
202 return NGBE_ERR_OPS_DUMMY;
204 static inline s32 ngbe_phy_write_reg_unlocked_dummy(struct ngbe_hw *TUP0,
205 u32 TUP1, u32 TUP2, u16 TUP3)
207 return NGBE_ERR_OPS_DUMMY;
209 static inline s32 ngbe_phy_setup_link_dummy(struct ngbe_hw *TUP0,
212 return NGBE_ERR_OPS_DUMMY;
214 static inline s32 ngbe_phy_check_link_dummy(struct ngbe_hw *TUP0, u32 *TUP1,
217 return NGBE_ERR_OPS_DUMMY;
219 static inline s32 ngbe_get_phy_advertised_pause_dummy(struct ngbe_hw *TUP0,
222 return NGBE_ERR_OPS_DUMMY;
224 static inline s32 ngbe_get_phy_lp_advertised_pause_dummy(struct ngbe_hw *TUP0,
227 return NGBE_ERR_OPS_DUMMY;
229 static inline s32 ngbe_set_phy_pause_adv_dummy(struct ngbe_hw *TUP0, u16 TUP1)
231 return NGBE_ERR_OPS_DUMMY;
234 /* struct ngbe_mbx_operations */
235 static inline void ngbe_mbx_init_params_dummy(struct ngbe_hw *TUP0)
238 static inline s32 ngbe_mbx_read_dummy(struct ngbe_hw *TUP0, u32 *TUP1,
241 return NGBE_ERR_OPS_DUMMY;
243 static inline s32 ngbe_mbx_write_dummy(struct ngbe_hw *TUP0, u32 *TUP1,
246 return NGBE_ERR_OPS_DUMMY;
248 static inline s32 ngbe_mbx_check_for_msg_dummy(struct ngbe_hw *TUP0, u16 TUP1)
250 return NGBE_ERR_OPS_DUMMY;
252 static inline s32 ngbe_mbx_check_for_ack_dummy(struct ngbe_hw *TUP0, u16 TUP1)
254 return NGBE_ERR_OPS_DUMMY;
256 static inline s32 ngbe_mbx_check_for_rst_dummy(struct ngbe_hw *TUP0, u16 TUP1)
258 return NGBE_ERR_OPS_DUMMY;
261 static inline void ngbe_init_ops_dummy(struct ngbe_hw *hw)
263 hw->bus.set_lan_id = ngbe_bus_set_lan_id_dummy;
264 hw->rom.init_params = ngbe_rom_init_params_dummy;
265 hw->rom.read32 = ngbe_rom_read32_dummy;
266 hw->rom.validate_checksum = ngbe_rom_validate_checksum_dummy;
267 hw->mac.init_hw = ngbe_mac_init_hw_dummy;
268 hw->mac.reset_hw = ngbe_mac_reset_hw_dummy;
269 hw->mac.start_hw = ngbe_mac_start_hw_dummy;
270 hw->mac.stop_hw = ngbe_mac_stop_hw_dummy;
271 hw->mac.clear_hw_cntrs = ngbe_mac_clear_hw_cntrs_dummy;
272 hw->mac.get_mac_addr = ngbe_mac_get_mac_addr_dummy;
273 hw->mac.enable_rx_dma = ngbe_mac_enable_rx_dma_dummy;
274 hw->mac.disable_sec_rx_path = ngbe_mac_disable_sec_rx_path_dummy;
275 hw->mac.enable_sec_rx_path = ngbe_mac_enable_sec_rx_path_dummy;
276 hw->mac.acquire_swfw_sync = ngbe_mac_acquire_swfw_sync_dummy;
277 hw->mac.release_swfw_sync = ngbe_mac_release_swfw_sync_dummy;
278 hw->mac.setup_link = ngbe_mac_setup_link_dummy;
279 hw->mac.check_link = ngbe_mac_check_link_dummy;
280 hw->mac.get_link_capabilities = ngbe_mac_get_link_capabilities_dummy;
281 hw->mac.set_rar = ngbe_mac_set_rar_dummy;
282 hw->mac.clear_rar = ngbe_mac_clear_rar_dummy;
283 hw->mac.set_vmdq = ngbe_mac_set_vmdq_dummy;
284 hw->mac.clear_vmdq = ngbe_mac_clear_vmdq_dummy;
285 hw->mac.init_rx_addrs = ngbe_mac_init_rx_addrs_dummy;
286 hw->mac.update_mc_addr_list = ngbe_mac_update_mc_addr_list_dummy;
287 hw->mac.clear_vfta = ngbe_mac_clear_vfta_dummy;
288 hw->mac.set_vfta = ngbe_mac_set_vfta_dummy;
289 hw->mac.set_vlvf = ngbe_mac_set_vlvf_dummy;
290 hw->mac.set_mac_anti_spoofing = ngbe_mac_set_mac_anti_spoofing_dummy;
291 hw->mac.set_vlan_anti_spoofing = ngbe_mac_set_vlan_anti_spoofing_dummy;
292 hw->mac.fc_enable = ngbe_mac_fc_enable_dummy;
293 hw->mac.setup_fc = ngbe_mac_setup_fc_dummy;
294 hw->mac.fc_autoneg = ngbe_mac_fc_autoneg_dummy;
295 hw->mac.init_thermal_sensor_thresh = ngbe_mac_init_thermal_ssth_dummy;
296 hw->mac.check_overtemp = ngbe_mac_check_overtemp_dummy;
297 hw->phy.identify = ngbe_phy_identify_dummy;
298 hw->phy.init_hw = ngbe_phy_init_hw_dummy;
299 hw->phy.reset_hw = ngbe_phy_reset_hw_dummy;
300 hw->phy.read_reg = ngbe_phy_read_reg_dummy;
301 hw->phy.write_reg = ngbe_phy_write_reg_dummy;
302 hw->phy.read_reg_unlocked = ngbe_phy_read_reg_unlocked_dummy;
303 hw->phy.write_reg_unlocked = ngbe_phy_write_reg_unlocked_dummy;
304 hw->phy.setup_link = ngbe_phy_setup_link_dummy;
305 hw->phy.check_link = ngbe_phy_check_link_dummy;
306 hw->phy.get_adv_pause = ngbe_get_phy_advertised_pause_dummy;
307 hw->phy.get_lp_adv_pause = ngbe_get_phy_lp_advertised_pause_dummy;
308 hw->phy.set_pause_adv = ngbe_set_phy_pause_adv_dummy;
309 hw->mbx.init_params = ngbe_mbx_init_params_dummy;
310 hw->mbx.read = ngbe_mbx_read_dummy;
311 hw->mbx.write = ngbe_mbx_write_dummy;
312 hw->mbx.check_for_msg = ngbe_mbx_check_for_msg_dummy;
313 hw->mbx.check_for_ack = ngbe_mbx_check_for_ack_dummy;
314 hw->mbx.check_for_rst = ngbe_mbx_check_for_rst_dummy;
317 #endif /* _NGBE_TYPE_DUMMY_H_ */