@@ -1207,7 +1207,79 @@ ieee80211_get_he_sta_cap(const struct ieee80211_supported_band *sband)
12071207 return NULL ;
12081208}
12091209
1210- #endif
1210+ static inline void
1211+ ieee80211_sband_set_num_iftypes_data (struct ieee80211_supported_band * sband ,
1212+ u16 n )
1213+ {
1214+ }
1215+
1216+ static inline u16
1217+ ieee80211_sband_get_num_iftypes_data (struct ieee80211_supported_band * sband )
1218+ {
1219+ return 0 ;
1220+ }
1221+
1222+ static inline void
1223+ ieee80211_sband_set_iftypes_data (struct ieee80211_supported_band * sband ,
1224+ const struct ieee80211_sband_iftype_data * data )
1225+ {
1226+ }
1227+
1228+ static inline struct ieee80211_sband_iftype_data *
1229+ ieee80211_sband_get_iftypes_data (struct ieee80211_supported_band * sband )
1230+ {
1231+ return NULL ;
1232+ }
1233+
1234+ static inline struct ieee80211_sband_iftype_data *
1235+ ieee80211_sband_get_iftypes_data_entry (struct ieee80211_supported_band * sband ,
1236+ u16 i )
1237+ {
1238+ WARN_ONCE (1 ,
1239+ "Tried to use unsupported sband iftype data\n" );
1240+ return NULL ;
1241+ }
1242+
1243+ static inline const struct ieee80211_sband_iftype_data *
1244+ ieee80211_get_sband_iftype_data (const struct ieee80211_supported_band * sband ,
1245+ u8 iftype )
1246+ {
1247+ return NULL ;
1248+ }
1249+ #else /* CFG80211_VERSION < KERNEL_VERSION(4,19,0) */
1250+ static inline void
1251+ ieee80211_sband_set_num_iftypes_data (struct ieee80211_supported_band * sband ,
1252+ u16 n )
1253+ {
1254+ sband -> n_iftype_data = n ;
1255+ }
1256+
1257+ static inline u16
1258+ ieee80211_sband_get_num_iftypes_data (struct ieee80211_supported_band * sband )
1259+ {
1260+ return sband -> n_iftype_data ;
1261+ }
1262+
1263+ static inline void
1264+ ieee80211_sband_set_iftypes_data (struct ieee80211_supported_band * sband ,
1265+ const struct ieee80211_sband_iftype_data * data )
1266+ {
1267+ sband -> iftype_data = data ;
1268+ }
1269+
1270+ static inline const struct ieee80211_sband_iftype_data *
1271+ ieee80211_sband_get_iftypes_data (struct ieee80211_supported_band * sband )
1272+ {
1273+ return sband -> iftype_data ;
1274+ }
1275+
1276+ static inline const struct ieee80211_sband_iftype_data *
1277+ ieee80211_sband_get_iftypes_data_entry (struct ieee80211_supported_band * sband ,
1278+ u16 i )
1279+ {
1280+ return & sband -> iftype_data [i ];
1281+ }
1282+ #endif /* CFG80211_VERSION < KERNEL_VERSION(4,19,0) */
12111283
12121284#if CFG80211_VERSION < KERNEL_VERSION (5 ,8 ,0 )
12131285/**
@@ -1240,6 +1312,12 @@ static inline const struct ieee80211_sta_he_cap *
12401312ieee80211_get_he_iftype_cap (const struct ieee80211_supported_band * sband ,
12411313 u8 iftype )
12421314{
1315+ const struct ieee80211_sband_iftype_data * data =
1316+ ieee80211_get_sband_iftype_data (sband , iftype );
1317+
1318+ if (data && data -> he_cap .has_he )
1319+ return & data -> he_cap ;
1320+
12431321 return NULL ;
12441322}
12451323
@@ -1957,81 +2035,6 @@ static inline void u64_to_ether_addr(u64 u, u8 *addr)
19572035}
19582036#endif /* < 4,11,0 */
19592037
1960- #if CFG80211_VERSION < KERNEL_VERSION (4 , 19 , 0 )
1961- static inline void
1962- ieee80211_sband_set_num_iftypes_data (struct ieee80211_supported_band * sband ,
1963- u16 n )
1964- {
1965- }
1966-
1967- static inline u16
1968- ieee80211_sband_get_num_iftypes_data (struct ieee80211_supported_band * sband )
1969- {
1970- return 0 ;
1971- }
1972-
1973- static inline void
1974- ieee80211_sband_set_iftypes_data (struct ieee80211_supported_band * sband ,
1975- const struct ieee80211_sband_iftype_data * data )
1976- {
1977- }
1978-
1979- static inline struct ieee80211_sband_iftype_data *
1980- ieee80211_sband_get_iftypes_data (struct ieee80211_supported_band * sband )
1981- {
1982- return NULL ;
1983- }
1984-
1985- static inline struct ieee80211_sband_iftype_data *
1986- ieee80211_sband_get_iftypes_data_entry (struct ieee80211_supported_band * sband ,
1987- u16 i )
1988- {
1989- WARN_ONCE (1 ,
1990- "Tried to use unsupported sband iftype data\n" );
1991- return NULL ;
1992- }
1993-
1994- static inline const struct ieee80211_sband_iftype_data *
1995- ieee80211_get_sband_iftype_data (const struct ieee80211_supported_band * sband ,
1996- u8 iftype )
1997- {
1998- return NULL ;
1999- }
2000- #else /* CFG80211_VERSION < KERNEL_VERSION(4,19,0) */
2001- static inline void
2002- ieee80211_sband_set_num_iftypes_data (struct ieee80211_supported_band * sband ,
2003- u16 n )
2004- {
2005- sband -> n_iftype_data = n ;
2006- }
2007-
2008- static inline u16
2009- ieee80211_sband_get_num_iftypes_data (struct ieee80211_supported_band * sband )
2010- {
2011- return sband -> n_iftype_data ;
2012- }
2013-
2014- static inline void
2015- ieee80211_sband_set_iftypes_data (struct ieee80211_supported_band * sband ,
2016- const struct ieee80211_sband_iftype_data * data )
2017- {
2018- sband -> iftype_data = data ;
2019- }
2020-
2021- static inline const struct ieee80211_sband_iftype_data *
2022- ieee80211_sband_get_iftypes_data (struct ieee80211_supported_band * sband )
2023- {
2024- return sband -> iftype_data ;
2025- }
2026-
2027- static inline const struct ieee80211_sband_iftype_data *
2028- ieee80211_sband_get_iftypes_data_entry (struct ieee80211_supported_band * sband ,
2029- u16 i )
2030- {
2031- return & sband -> iftype_data [i ];
2032- }
2033- #endif /* CFG80211_VERSION < KERNEL_VERSION(4,19,0) */
2034-
20352038#if CFG80211_VERSION < KERNEL_VERSION (5 ,1 ,0 )
20362039static inline int cfg80211_vendor_cmd_get_sender (struct wiphy * wiphy )
20372040{
@@ -2165,7 +2168,7 @@ static inline size_t cfg80211_rekey_akm(struct cfg80211_gtk_rekey_data *data)
21652168#endif
21662169}
21672170
2168- #if CFG80211_VERSION < KERNEL_VERSION (5 ,7 ,0 )
2171+ #if CFG80211_VERSION < KERNEL_VERSION (5 ,4 ,0 )
21692172/**
21702173 * struct cfg80211_he_bss_color - AP settings for BSS coloring
21712174 *
@@ -2178,6 +2181,9 @@ struct cfg80211_he_bss_color {
21782181 bool disabled ;
21792182 bool partial ;
21802183};
2184+ #endif
2185+
2186+ #if CFG80211_VERSION < KERNEL_VERSION (5 ,7 ,0 )
21812187
21822188/**
21832189 * enum nl80211_tid_config - TID config state
@@ -2563,18 +2569,6 @@ static inline void dev_sw_netstats_rx_add(struct net_device *dev, unsigned int l
25632569 u64_stats_update_end (& tstats -> syncp );
25642570}
25652571
2566- static inline void dev_sw_netstats_tx_add (struct net_device * dev ,
2567- unsigned int packets ,
2568- unsigned int len )
2569- {
2570- struct pcpu_sw_netstats * tstats = this_cpu_ptr (dev -> tstats );
2571-
2572- u64_stats_update_begin (& tstats -> syncp );
2573- tstats -> tx_bytes += len ;
2574- tstats -> tx_packets += packets ;
2575- u64_stats_update_end (& tstats -> syncp );
2576- }
2577-
25782572#define bp_ieee80211_set_unsol_bcast_probe_resp (sdata , params ) 0
25792573#define bp_unsol_bcast_probe_resp_interval (params ) 0
25802574
@@ -2587,21 +2581,9 @@ static inline void dev_sw_netstats_tx_add(struct net_device *dev,
25872581
25882582#endif /* < 5.10 */
25892583
2590- #if CFG80211_VERSION < KERNEL_VERSION (5 ,13 ,0 )
2591- #define ieee80211_data_to_8023_exthdr iwl7000_ieee80211_data_to_8023_exthdr
2592- int ieee80211_data_to_8023_exthdr (struct sk_buff * skb , struct ethhdr * ehdr ,
2593- const u8 * addr , enum nl80211_iftype iftype ,
2594- u8 data_offset , bool is_amsdu );
2595-
2596- #define ieee80211_data_to_8023 iwl7000_ieee80211_data_to_8023
2597- static inline int ieee80211_data_to_8023 (struct sk_buff * skb , const u8 * addr ,
2598- enum nl80211_iftype iftype )
2599- {
2600- return ieee80211_data_to_8023_exthdr (skb , NULL , addr , iftype , 0 , false);
2601- }
2602- #endif /* CFG80211_VERSION < KERNEL_VERSION(5,13,0) */
2603-
2604- #if CFG80211_VERSION < KERNEL_VERSION (5 ,4 ,0 )
2584+ #if CFG80211_VERSION < KERNEL_VERSION (5 ,11 ,0 ) && \
2585+ (CFG80211_VERSION < KERNEL_VERSION (5 ,4 ,0 ) || \
2586+ CFG80211_VERSION >= KERNEL_VERSION (5 ,5 ,0 ))
26052587enum nl80211_sar_type {
26062588 NL80211_SAR_TYPE_NONE ,
26072589};
@@ -2657,3 +2639,36 @@ static inline bool cfg80211_any_usable_channels(struct wiphy *wiphy,
26572639 return false;
26582640}
26592641#endif /* < 5.12.0 */
2642+
2643+ #if LINUX_VERSION_IS_LESS (5 ,11 ,0 )
2644+ static inline u64 skb_get_kcov_handle (struct sk_buff * skb )
2645+ {
2646+ return 0 ;
2647+ }
2648+
2649+ static inline void dev_sw_netstats_tx_add (struct net_device * dev ,
2650+ unsigned int packets ,
2651+ unsigned int len )
2652+ {
2653+ struct pcpu_sw_netstats * tstats = this_cpu_ptr (dev -> tstats );
2654+
2655+ u64_stats_update_begin (& tstats -> syncp );
2656+ tstats -> tx_bytes += len ;
2657+ tstats -> tx_packets += packets ;
2658+ u64_stats_update_end (& tstats -> syncp );
2659+ }
2660+ #endif
2661+
2662+ #if CFG80211_VERSION < KERNEL_VERSION (5 ,13 ,0 )
2663+ #define ieee80211_data_to_8023_exthdr iwl7000_ieee80211_data_to_8023_exthdr
2664+ int ieee80211_data_to_8023_exthdr (struct sk_buff * skb , struct ethhdr * ehdr ,
2665+ const u8 * addr , enum nl80211_iftype iftype ,
2666+ u8 data_offset , bool is_amsdu );
2667+
2668+ #define ieee80211_data_to_8023 iwl7000_ieee80211_data_to_8023
2669+ static inline int ieee80211_data_to_8023 (struct sk_buff * skb , const u8 * addr ,
2670+ enum nl80211_iftype iftype )
2671+ {
2672+ return ieee80211_data_to_8023_exthdr (skb , NULL , addr , iftype , 0 , false);
2673+ }
2674+ #endif /* CFG80211_VERSION < KERNEL_VERSION(5,13,0) */
0 commit comments