@@ -25,7 +25,12 @@ static inline void eth_stats_update_bytes_rx(struct net_if *iface,
2525 return ;
2626 }
2727
28- stats = api -> get_stats (net_if_get_device (iface ));
28+ if (api -> get_stats2 != NULL ) {
29+ stats = api -> get_stats2 (net_if_get_device (iface ),
30+ ETHERNET_STATS_TYPE_NATIVE );
31+ } else {
32+ stats = api -> get_stats (net_if_get_device (iface ));
33+ }
2934 if (!stats ) {
3035 return ;
3136 }
@@ -44,7 +49,12 @@ static inline void eth_stats_update_bytes_tx(struct net_if *iface,
4449 return ;
4550 }
4651
47- stats = api -> get_stats (net_if_get_device (iface ));
52+ if (api -> get_stats2 != NULL ) {
53+ stats = api -> get_stats2 (net_if_get_device (iface ),
54+ ETHERNET_STATS_TYPE_NATIVE );
55+ } else {
56+ stats = api -> get_stats (net_if_get_device (iface ));
57+ }
4858 if (!stats ) {
4959 return ;
5060 }
@@ -62,7 +72,12 @@ static inline void eth_stats_update_pkts_rx(struct net_if *iface)
6272 return ;
6373 }
6474
65- stats = api -> get_stats (net_if_get_device (iface ));
75+ if (api -> get_stats2 != NULL ) {
76+ stats = api -> get_stats2 (net_if_get_device (iface ),
77+ ETHERNET_STATS_TYPE_NATIVE );
78+ } else {
79+ stats = api -> get_stats (net_if_get_device (iface ));
80+ }
6681 if (!stats ) {
6782 return ;
6883 }
@@ -80,7 +95,12 @@ static inline void eth_stats_update_pkts_tx(struct net_if *iface)
8095 return ;
8196 }
8297
83- stats = api -> get_stats (net_if_get_device (iface ));
98+ if (api -> get_stats2 != NULL ) {
99+ stats = api -> get_stats2 (net_if_get_device (iface ),
100+ ETHERNET_STATS_TYPE_NATIVE );
101+ } else {
102+ stats = api -> get_stats (net_if_get_device (iface ));
103+ }
84104 if (!stats ) {
85105 return ;
86106 }
@@ -98,7 +118,12 @@ static inline void eth_stats_update_broadcast_rx(struct net_if *iface)
98118 return ;
99119 }
100120
101- stats = api -> get_stats (net_if_get_device (iface ));
121+ if (api -> get_stats2 != NULL ) {
122+ stats = api -> get_stats2 (net_if_get_device (iface ),
123+ ETHERNET_STATS_TYPE_NATIVE );
124+ } else {
125+ stats = api -> get_stats (net_if_get_device (iface ));
126+ }
102127 if (!stats ) {
103128 return ;
104129 }
@@ -116,7 +141,12 @@ static inline void eth_stats_update_broadcast_tx(struct net_if *iface)
116141 return ;
117142 }
118143
119- stats = api -> get_stats (net_if_get_device (iface ));
144+ if (api -> get_stats2 != NULL ) {
145+ stats = api -> get_stats2 (net_if_get_device (iface ),
146+ ETHERNET_STATS_TYPE_NATIVE );
147+ } else {
148+ stats = api -> get_stats (net_if_get_device (iface ));
149+ }
120150 if (!stats ) {
121151 return ;
122152 }
@@ -134,7 +164,12 @@ static inline void eth_stats_update_multicast_rx(struct net_if *iface)
134164 return ;
135165 }
136166
137- stats = api -> get_stats (net_if_get_device (iface ));
167+ if (api -> get_stats2 != NULL ) {
168+ stats = api -> get_stats2 (net_if_get_device (iface ),
169+ ETHERNET_STATS_TYPE_NATIVE );
170+ } else {
171+ stats = api -> get_stats (net_if_get_device (iface ));
172+ }
138173 if (!stats ) {
139174 return ;
140175 }
@@ -152,7 +187,12 @@ static inline void eth_stats_update_multicast_tx(struct net_if *iface)
152187 return ;
153188 }
154189
155- stats = api -> get_stats (net_if_get_device (iface ));
190+ if (api -> get_stats2 != NULL ) {
191+ stats = api -> get_stats2 (net_if_get_device (iface ),
192+ ETHERNET_STATS_TYPE_NATIVE );
193+ } else {
194+ stats = api -> get_stats (net_if_get_device (iface ));
195+ }
156196 if (!stats ) {
157197 return ;
158198 }
@@ -177,7 +217,12 @@ static inline void eth_stats_update_errors_rx(struct net_if *iface)
177217 return ;
178218 }
179219
180- stats = api -> get_stats (net_if_get_device (iface ));
220+ if (api -> get_stats2 != NULL ) {
221+ stats = api -> get_stats2 (net_if_get_device (iface ),
222+ ETHERNET_STATS_TYPE_NATIVE );
223+ } else {
224+ stats = api -> get_stats (net_if_get_device (iface ));
225+ }
181226 if (!stats ) {
182227 return ;
183228 }
@@ -195,7 +240,12 @@ static inline void eth_stats_update_errors_tx(struct net_if *iface)
195240 return ;
196241 }
197242
198- stats = api -> get_stats (net_if_get_device (iface ));
243+ if (api -> get_stats2 != NULL ) {
244+ stats = api -> get_stats2 (net_if_get_device (iface ),
245+ ETHERNET_STATS_TYPE_NATIVE );
246+ } else {
247+ stats = api -> get_stats (net_if_get_device (iface ));
248+ }
199249 if (!stats ) {
200250 return ;
201251 }
@@ -213,7 +263,12 @@ static inline void eth_stats_update_unknown_protocol(struct net_if *iface)
213263 return ;
214264 }
215265
216- stats = api -> get_stats (net_if_get_device (iface ));
266+ if (api -> get_stats2 != NULL ) {
267+ stats = api -> get_stats2 (net_if_get_device (iface ),
268+ ETHERNET_STATS_TYPE_NATIVE );
269+ } else {
270+ stats = api -> get_stats (net_if_get_device (iface ));
271+ }
217272 if (!stats ) {
218273 return ;
219274 }
0 commit comments