net/ngbe: support basic statistics
[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_validate_checksum_dummy(struct ngbe_hw *TUP0,
37                                         u16 *TUP1)
38 {
39         return NGBE_ERR_OPS_DUMMY;
40 }
41 /* struct ngbe_mac_operations */
42 static inline s32 ngbe_mac_init_hw_dummy(struct ngbe_hw *TUP0)
43 {
44         return NGBE_ERR_OPS_DUMMY;
45 }
46 static inline s32 ngbe_mac_reset_hw_dummy(struct ngbe_hw *TUP0)
47 {
48         return NGBE_ERR_OPS_DUMMY;
49 }
50 static inline s32 ngbe_mac_start_hw_dummy(struct ngbe_hw *TUP0)
51 {
52         return NGBE_ERR_OPS_DUMMY;
53 }
54 static inline s32 ngbe_mac_stop_hw_dummy(struct ngbe_hw *TUP0)
55 {
56         return NGBE_ERR_OPS_DUMMY;
57 }
58 static inline s32 ngbe_mac_clear_hw_cntrs_dummy(struct ngbe_hw *TUP0)
59 {
60         return NGBE_ERR_OPS_DUMMY;
61 }
62 static inline s32 ngbe_mac_get_mac_addr_dummy(struct ngbe_hw *TUP0, u8 *TUP1)
63 {
64         return NGBE_ERR_OPS_DUMMY;
65 }
66 static inline s32 ngbe_mac_enable_rx_dma_dummy(struct ngbe_hw *TUP0, u32 TUP1)
67 {
68         return NGBE_ERR_OPS_DUMMY;
69 }
70 static inline s32 ngbe_mac_disable_sec_rx_path_dummy(struct ngbe_hw *TUP0)
71 {
72         return NGBE_ERR_OPS_DUMMY;
73 }
74 static inline s32 ngbe_mac_enable_sec_rx_path_dummy(struct ngbe_hw *TUP0)
75 {
76         return NGBE_ERR_OPS_DUMMY;
77 }
78 static inline s32 ngbe_mac_acquire_swfw_sync_dummy(struct ngbe_hw *TUP0,
79                                         u32 TUP1)
80 {
81         return NGBE_ERR_OPS_DUMMY;
82 }
83 static inline void ngbe_mac_release_swfw_sync_dummy(struct ngbe_hw *TUP0,
84                                         u32 TUP1)
85 {
86 }
87 static inline s32 ngbe_mac_setup_link_dummy(struct ngbe_hw *TUP0, u32 TUP1,
88                                         bool TUP2)
89 {
90         return NGBE_ERR_OPS_DUMMY;
91 }
92 static inline s32 ngbe_mac_check_link_dummy(struct ngbe_hw *TUP0, u32 *TUP1,
93                                         bool *TUP3, bool TUP4)
94 {
95         return NGBE_ERR_OPS_DUMMY;
96 }
97 static inline s32 ngbe_mac_get_link_capabilities_dummy(struct ngbe_hw *TUP0,
98                                         u32 *TUP1, bool *TUP2)
99 {
100         return NGBE_ERR_OPS_DUMMY;
101 }
102 static inline s32 ngbe_mac_set_rar_dummy(struct ngbe_hw *TUP0, u32 TUP1,
103                                         u8 *TUP2, u32 TUP3, u32 TUP4)
104 {
105         return NGBE_ERR_OPS_DUMMY;
106 }
107 static inline s32 ngbe_mac_clear_rar_dummy(struct ngbe_hw *TUP0, u32 TUP1)
108 {
109         return NGBE_ERR_OPS_DUMMY;
110 }
111 static inline s32 ngbe_mac_set_vmdq_dummy(struct ngbe_hw *TUP0, u32 TUP1,
112                                         u32 TUP2)
113 {
114         return NGBE_ERR_OPS_DUMMY;
115 }
116 static inline s32 ngbe_mac_clear_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_init_rx_addrs_dummy(struct ngbe_hw *TUP0)
122 {
123         return NGBE_ERR_OPS_DUMMY;
124 }
125 static inline s32 ngbe_mac_clear_vfta_dummy(struct ngbe_hw *TUP0)
126 {
127         return NGBE_ERR_OPS_DUMMY;
128 }
129 static inline s32 ngbe_mac_init_thermal_ssth_dummy(struct ngbe_hw *TUP0)
130 {
131         return NGBE_ERR_OPS_DUMMY;
132 }
133 static inline s32 ngbe_mac_check_overtemp_dummy(struct ngbe_hw *TUP0)
134 {
135         return NGBE_ERR_OPS_DUMMY;
136 }
137 /* struct ngbe_phy_operations */
138 static inline s32 ngbe_phy_identify_dummy(struct ngbe_hw *TUP0)
139 {
140         return NGBE_ERR_OPS_DUMMY;
141 }
142 static inline s32 ngbe_phy_init_hw_dummy(struct ngbe_hw *TUP0)
143 {
144         return NGBE_ERR_OPS_DUMMY;
145 }
146 static inline s32 ngbe_phy_reset_hw_dummy(struct ngbe_hw *TUP0)
147 {
148         return NGBE_ERR_OPS_DUMMY;
149 }
150 static inline s32 ngbe_phy_read_reg_dummy(struct ngbe_hw *TUP0, u32 TUP1,
151                                         u32 TUP2, u16 *TUP3)
152 {
153         return NGBE_ERR_OPS_DUMMY;
154 }
155 static inline s32 ngbe_phy_write_reg_dummy(struct ngbe_hw *TUP0, u32 TUP1,
156                                         u32 TUP2, u16 TUP3)
157 {
158         return NGBE_ERR_OPS_DUMMY;
159 }
160 static inline s32 ngbe_phy_read_reg_unlocked_dummy(struct ngbe_hw *TUP0,
161                                         u32 TUP1, u32 TUP2, u16 *TUP3)
162 {
163         return NGBE_ERR_OPS_DUMMY;
164 }
165 static inline s32 ngbe_phy_write_reg_unlocked_dummy(struct ngbe_hw *TUP0,
166                                         u32 TUP1, u32 TUP2, u16 TUP3)
167 {
168         return NGBE_ERR_OPS_DUMMY;
169 }
170 static inline s32 ngbe_phy_setup_link_dummy(struct ngbe_hw *TUP0,
171                                         u32 TUP1, bool TUP2)
172 {
173         return NGBE_ERR_OPS_DUMMY;
174 }
175 static inline s32 ngbe_phy_check_link_dummy(struct ngbe_hw *TUP0, u32 *TUP1,
176                                         bool *TUP2)
177 {
178         return NGBE_ERR_OPS_DUMMY;
179 }
180 static inline void ngbe_init_ops_dummy(struct ngbe_hw *hw)
181 {
182         hw->bus.set_lan_id = ngbe_bus_set_lan_id_dummy;
183         hw->rom.init_params = ngbe_rom_init_params_dummy;
184         hw->rom.validate_checksum = ngbe_rom_validate_checksum_dummy;
185         hw->mac.init_hw = ngbe_mac_init_hw_dummy;
186         hw->mac.reset_hw = ngbe_mac_reset_hw_dummy;
187         hw->mac.start_hw = ngbe_mac_start_hw_dummy;
188         hw->mac.stop_hw = ngbe_mac_stop_hw_dummy;
189         hw->mac.clear_hw_cntrs = ngbe_mac_clear_hw_cntrs_dummy;
190         hw->mac.get_mac_addr = ngbe_mac_get_mac_addr_dummy;
191         hw->mac.enable_rx_dma = ngbe_mac_enable_rx_dma_dummy;
192         hw->mac.disable_sec_rx_path = ngbe_mac_disable_sec_rx_path_dummy;
193         hw->mac.enable_sec_rx_path = ngbe_mac_enable_sec_rx_path_dummy;
194         hw->mac.acquire_swfw_sync = ngbe_mac_acquire_swfw_sync_dummy;
195         hw->mac.release_swfw_sync = ngbe_mac_release_swfw_sync_dummy;
196         hw->mac.setup_link = ngbe_mac_setup_link_dummy;
197         hw->mac.check_link = ngbe_mac_check_link_dummy;
198         hw->mac.get_link_capabilities = ngbe_mac_get_link_capabilities_dummy;
199         hw->mac.set_rar = ngbe_mac_set_rar_dummy;
200         hw->mac.clear_rar = ngbe_mac_clear_rar_dummy;
201         hw->mac.set_vmdq = ngbe_mac_set_vmdq_dummy;
202         hw->mac.clear_vmdq = ngbe_mac_clear_vmdq_dummy;
203         hw->mac.init_rx_addrs = ngbe_mac_init_rx_addrs_dummy;
204         hw->mac.clear_vfta = ngbe_mac_clear_vfta_dummy;
205         hw->mac.init_thermal_sensor_thresh = ngbe_mac_init_thermal_ssth_dummy;
206         hw->mac.check_overtemp = ngbe_mac_check_overtemp_dummy;
207         hw->phy.identify = ngbe_phy_identify_dummy;
208         hw->phy.init_hw = ngbe_phy_init_hw_dummy;
209         hw->phy.reset_hw = ngbe_phy_reset_hw_dummy;
210         hw->phy.read_reg = ngbe_phy_read_reg_dummy;
211         hw->phy.write_reg = ngbe_phy_write_reg_dummy;
212         hw->phy.read_reg_unlocked = ngbe_phy_read_reg_unlocked_dummy;
213         hw->phy.write_reg_unlocked = ngbe_phy_write_reg_unlocked_dummy;
214         hw->phy.setup_link = ngbe_phy_setup_link_dummy;
215         hw->phy.check_link = ngbe_phy_check_link_dummy;
216 }
217
218 #endif /* _NGBE_TYPE_DUMMY_H_ */
219