net/ngbe: add mailbox process operations
[dpdk.git] / drivers / net / ngbe / base / ngbe_dummy.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018-2021 Beijing WangXun Technology Co., Ltd.
3  */
4
5 #ifndef _NGBE_TYPE_DUMMY_H_
6 #define _NGBE_TYPE_DUMMY_H_
7
8 #ifdef TUP
9 #elif defined(__GNUC__)
10 #define TUP(x) x##_unused ngbe_unused
11 #elif defined(__LCLINT__)
12 #define TUP(x) x /*@unused@*/
13 #else
14 #define TUP(x) x
15 #endif /*TUP*/
16 #define TUP0 TUP(p0)
17 #define TUP1 TUP(p1)
18 #define TUP2 TUP(p2)
19 #define TUP3 TUP(p3)
20 #define TUP4 TUP(p4)
21 #define TUP5 TUP(p5)
22 #define TUP6 TUP(p6)
23 #define TUP7 TUP(p7)
24 #define TUP8 TUP(p8)
25 #define TUP9 TUP(p9)
26
27 /* struct ngbe_bus_operations */
28 static inline void ngbe_bus_set_lan_id_dummy(struct ngbe_hw *TUP0)
29 {
30 }
31 /* struct ngbe_rom_operations */
32 static inline s32 ngbe_rom_init_params_dummy(struct ngbe_hw *TUP0)
33 {
34         return NGBE_ERR_OPS_DUMMY;
35 }
36 static inline s32 ngbe_rom_read32_dummy(struct ngbe_hw *TUP0, u32 TUP1,
37                                         u32 *TUP2)
38 {
39         return NGBE_ERR_OPS_DUMMY;
40 }
41 static inline s32 ngbe_rom_validate_checksum_dummy(struct ngbe_hw *TUP0,
42                                         u16 *TUP1)
43 {
44         return NGBE_ERR_OPS_DUMMY;
45 }
46 /* struct ngbe_mac_operations */
47 static inline s32 ngbe_mac_init_hw_dummy(struct ngbe_hw *TUP0)
48 {
49         return NGBE_ERR_OPS_DUMMY;
50 }
51 static inline s32 ngbe_mac_reset_hw_dummy(struct ngbe_hw *TUP0)
52 {
53         return NGBE_ERR_OPS_DUMMY;
54 }
55 static inline s32 ngbe_mac_start_hw_dummy(struct ngbe_hw *TUP0)
56 {
57         return NGBE_ERR_OPS_DUMMY;
58 }
59 static inline s32 ngbe_mac_stop_hw_dummy(struct ngbe_hw *TUP0)
60 {
61         return NGBE_ERR_OPS_DUMMY;
62 }
63 static inline s32 ngbe_mac_clear_hw_cntrs_dummy(struct ngbe_hw *TUP0)
64 {
65         return NGBE_ERR_OPS_DUMMY;
66 }
67 static inline s32 ngbe_mac_get_mac_addr_dummy(struct ngbe_hw *TUP0, u8 *TUP1)
68 {
69         return NGBE_ERR_OPS_DUMMY;
70 }
71 static inline s32 ngbe_mac_enable_rx_dma_dummy(struct ngbe_hw *TUP0, u32 TUP1)
72 {
73         return NGBE_ERR_OPS_DUMMY;
74 }
75 static inline s32 ngbe_mac_disable_sec_rx_path_dummy(struct ngbe_hw *TUP0)
76 {
77         return NGBE_ERR_OPS_DUMMY;
78 }
79 static inline s32 ngbe_mac_enable_sec_rx_path_dummy(struct ngbe_hw *TUP0)
80 {
81         return NGBE_ERR_OPS_DUMMY;
82 }
83 static inline s32 ngbe_mac_acquire_swfw_sync_dummy(struct ngbe_hw *TUP0,
84                                         u32 TUP1)
85 {
86         return NGBE_ERR_OPS_DUMMY;
87 }
88 static inline void ngbe_mac_release_swfw_sync_dummy(struct ngbe_hw *TUP0,
89                                         u32 TUP1)
90 {
91 }
92 static inline s32 ngbe_mac_setup_link_dummy(struct ngbe_hw *TUP0, u32 TUP1,
93                                         bool TUP2)
94 {
95         return NGBE_ERR_OPS_DUMMY;
96 }
97 static inline s32 ngbe_mac_check_link_dummy(struct ngbe_hw *TUP0, u32 *TUP1,
98                                         bool *TUP3, bool TUP4)
99 {
100         return NGBE_ERR_OPS_DUMMY;
101 }
102 static inline s32 ngbe_mac_get_link_capabilities_dummy(struct ngbe_hw *TUP0,
103                                         u32 *TUP1, bool *TUP2)
104 {
105         return NGBE_ERR_OPS_DUMMY;
106 }
107 static inline s32 ngbe_mac_set_rar_dummy(struct ngbe_hw *TUP0, u32 TUP1,
108                                         u8 *TUP2, u32 TUP3, u32 TUP4)
109 {
110         return NGBE_ERR_OPS_DUMMY;
111 }
112 static inline s32 ngbe_mac_clear_rar_dummy(struct ngbe_hw *TUP0, u32 TUP1)
113 {
114         return NGBE_ERR_OPS_DUMMY;
115 }
116 static inline s32 ngbe_mac_set_vmdq_dummy(struct ngbe_hw *TUP0, u32 TUP1,
117                                         u32 TUP2)
118 {
119         return NGBE_ERR_OPS_DUMMY;
120 }
121 static inline s32 ngbe_mac_clear_vmdq_dummy(struct ngbe_hw *TUP0, u32 TUP1,
122                                         u32 TUP2)
123 {
124         return NGBE_ERR_OPS_DUMMY;
125 }
126 static inline s32 ngbe_mac_init_rx_addrs_dummy(struct ngbe_hw *TUP0)
127 {
128         return NGBE_ERR_OPS_DUMMY;
129 }
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)
132 {
133         return NGBE_ERR_OPS_DUMMY;
134 }
135 static inline s32 ngbe_mac_clear_vfta_dummy(struct ngbe_hw *TUP0)
136 {
137         return NGBE_ERR_OPS_DUMMY;
138 }
139 static inline s32 ngbe_mac_set_vfta_dummy(struct ngbe_hw *TUP0, u32 TUP1,
140                                         u32 TUP2, bool TUP3, bool TUP4)
141 {
142         return NGBE_ERR_OPS_DUMMY;
143 }
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)
146 {
147         return NGBE_ERR_OPS_DUMMY;
148 }
149 static inline void ngbe_mac_set_mac_anti_spoofing_dummy(struct ngbe_hw *TUP0,
150                                         bool TUP1, int TUP2)
151 {
152 }
153 static inline void ngbe_mac_set_vlan_anti_spoofing_dummy(struct ngbe_hw *TUP0,
154                                         bool TUP1, int TUP2)
155 {
156 }
157 static inline s32 ngbe_mac_init_thermal_ssth_dummy(struct ngbe_hw *TUP0)
158 {
159         return NGBE_ERR_OPS_DUMMY;
160 }
161 static inline s32 ngbe_mac_check_overtemp_dummy(struct ngbe_hw *TUP0)
162 {
163         return NGBE_ERR_OPS_DUMMY;
164 }
165 /* struct ngbe_phy_operations */
166 static inline s32 ngbe_phy_identify_dummy(struct ngbe_hw *TUP0)
167 {
168         return NGBE_ERR_OPS_DUMMY;
169 }
170 static inline s32 ngbe_phy_init_hw_dummy(struct ngbe_hw *TUP0)
171 {
172         return NGBE_ERR_OPS_DUMMY;
173 }
174 static inline s32 ngbe_phy_reset_hw_dummy(struct ngbe_hw *TUP0)
175 {
176         return NGBE_ERR_OPS_DUMMY;
177 }
178 static inline s32 ngbe_phy_read_reg_dummy(struct ngbe_hw *TUP0, u32 TUP1,
179                                         u32 TUP2, u16 *TUP3)
180 {
181         return NGBE_ERR_OPS_DUMMY;
182 }
183 static inline s32 ngbe_phy_write_reg_dummy(struct ngbe_hw *TUP0, u32 TUP1,
184                                         u32 TUP2, u16 TUP3)
185 {
186         return NGBE_ERR_OPS_DUMMY;
187 }
188 static inline s32 ngbe_phy_read_reg_unlocked_dummy(struct ngbe_hw *TUP0,
189                                         u32 TUP1, u32 TUP2, u16 *TUP3)
190 {
191         return NGBE_ERR_OPS_DUMMY;
192 }
193 static inline s32 ngbe_phy_write_reg_unlocked_dummy(struct ngbe_hw *TUP0,
194                                         u32 TUP1, u32 TUP2, u16 TUP3)
195 {
196         return NGBE_ERR_OPS_DUMMY;
197 }
198 static inline s32 ngbe_phy_setup_link_dummy(struct ngbe_hw *TUP0,
199                                         u32 TUP1, bool TUP2)
200 {
201         return NGBE_ERR_OPS_DUMMY;
202 }
203 static inline s32 ngbe_phy_check_link_dummy(struct ngbe_hw *TUP0, u32 *TUP1,
204                                         bool *TUP2)
205 {
206         return NGBE_ERR_OPS_DUMMY;
207 }
208
209 /* struct ngbe_mbx_operations */
210 static inline void ngbe_mbx_init_params_dummy(struct ngbe_hw *TUP0)
211 {
212 }
213 static inline s32 ngbe_mbx_read_dummy(struct ngbe_hw *TUP0, u32 *TUP1,
214                                         u16 TUP2, u16 TUP3)
215 {
216         return NGBE_ERR_OPS_DUMMY;
217 }
218 static inline s32 ngbe_mbx_write_dummy(struct ngbe_hw *TUP0, u32 *TUP1,
219                                         u16 TUP2, u16 TUP3)
220 {
221         return NGBE_ERR_OPS_DUMMY;
222 }
223 static inline s32 ngbe_mbx_check_for_msg_dummy(struct ngbe_hw *TUP0, u16 TUP1)
224 {
225         return NGBE_ERR_OPS_DUMMY;
226 }
227 static inline s32 ngbe_mbx_check_for_ack_dummy(struct ngbe_hw *TUP0, u16 TUP1)
228 {
229         return NGBE_ERR_OPS_DUMMY;
230 }
231 static inline s32 ngbe_mbx_check_for_rst_dummy(struct ngbe_hw *TUP0, u16 TUP1)
232 {
233         return NGBE_ERR_OPS_DUMMY;
234 }
235
236 static inline void ngbe_init_ops_dummy(struct ngbe_hw *hw)
237 {
238         hw->bus.set_lan_id = ngbe_bus_set_lan_id_dummy;
239         hw->rom.init_params = ngbe_rom_init_params_dummy;
240         hw->rom.read32 = ngbe_rom_read32_dummy;
241         hw->rom.validate_checksum = ngbe_rom_validate_checksum_dummy;
242         hw->mac.init_hw = ngbe_mac_init_hw_dummy;
243         hw->mac.reset_hw = ngbe_mac_reset_hw_dummy;
244         hw->mac.start_hw = ngbe_mac_start_hw_dummy;
245         hw->mac.stop_hw = ngbe_mac_stop_hw_dummy;
246         hw->mac.clear_hw_cntrs = ngbe_mac_clear_hw_cntrs_dummy;
247         hw->mac.get_mac_addr = ngbe_mac_get_mac_addr_dummy;
248         hw->mac.enable_rx_dma = ngbe_mac_enable_rx_dma_dummy;
249         hw->mac.disable_sec_rx_path = ngbe_mac_disable_sec_rx_path_dummy;
250         hw->mac.enable_sec_rx_path = ngbe_mac_enable_sec_rx_path_dummy;
251         hw->mac.acquire_swfw_sync = ngbe_mac_acquire_swfw_sync_dummy;
252         hw->mac.release_swfw_sync = ngbe_mac_release_swfw_sync_dummy;
253         hw->mac.setup_link = ngbe_mac_setup_link_dummy;
254         hw->mac.check_link = ngbe_mac_check_link_dummy;
255         hw->mac.get_link_capabilities = ngbe_mac_get_link_capabilities_dummy;
256         hw->mac.set_rar = ngbe_mac_set_rar_dummy;
257         hw->mac.clear_rar = ngbe_mac_clear_rar_dummy;
258         hw->mac.set_vmdq = ngbe_mac_set_vmdq_dummy;
259         hw->mac.clear_vmdq = ngbe_mac_clear_vmdq_dummy;
260         hw->mac.init_rx_addrs = ngbe_mac_init_rx_addrs_dummy;
261         hw->mac.update_mc_addr_list = ngbe_mac_update_mc_addr_list_dummy;
262         hw->mac.clear_vfta = ngbe_mac_clear_vfta_dummy;
263         hw->mac.set_vfta = ngbe_mac_set_vfta_dummy;
264         hw->mac.set_vlvf = ngbe_mac_set_vlvf_dummy;
265         hw->mac.set_mac_anti_spoofing = ngbe_mac_set_mac_anti_spoofing_dummy;
266         hw->mac.set_vlan_anti_spoofing = ngbe_mac_set_vlan_anti_spoofing_dummy;
267         hw->mac.init_thermal_sensor_thresh = ngbe_mac_init_thermal_ssth_dummy;
268         hw->mac.check_overtemp = ngbe_mac_check_overtemp_dummy;
269         hw->phy.identify = ngbe_phy_identify_dummy;
270         hw->phy.init_hw = ngbe_phy_init_hw_dummy;
271         hw->phy.reset_hw = ngbe_phy_reset_hw_dummy;
272         hw->phy.read_reg = ngbe_phy_read_reg_dummy;
273         hw->phy.write_reg = ngbe_phy_write_reg_dummy;
274         hw->phy.read_reg_unlocked = ngbe_phy_read_reg_unlocked_dummy;
275         hw->phy.write_reg_unlocked = ngbe_phy_write_reg_unlocked_dummy;
276         hw->phy.setup_link = ngbe_phy_setup_link_dummy;
277         hw->phy.check_link = ngbe_phy_check_link_dummy;
278         hw->mbx.init_params = ngbe_mbx_init_params_dummy;
279         hw->mbx.read = ngbe_mbx_read_dummy;
280         hw->mbx.write = ngbe_mbx_write_dummy;
281         hw->mbx.check_for_msg = ngbe_mbx_check_for_msg_dummy;
282         hw->mbx.check_for_ack = ngbe_mbx_check_for_ack_dummy;
283         hw->mbx.check_for_rst = ngbe_mbx_check_for_rst_dummy;
284 }
285
286 #endif /* _NGBE_TYPE_DUMMY_H_ */
287