-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcompat.c
More file actions
109 lines (99 loc) · 2.78 KB
/
Copy pathcompat.c
File metadata and controls
109 lines (99 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
* Copyright (C) 2026 Espressif Systems (Shanghai) CO LTD
*/
#include "compat.h"
void cfg80211_cac_event_compat(struct net_device *netdev,
const struct cfg80211_chan_def *chandef,
enum nl80211_radar_event event, gfp_t gfp,
unsigned int link_id)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
cfg80211_cac_event(netdev, chandef, event, gfp, link_id);
#else
cfg80211_cac_event(netdev, chandef, event, gfp);
#endif
}
struct sk_buff *ieee80211_beacon_get_compat(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
unsigned int link_id)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
return ieee80211_beacon_get(hw, vif, link_id);
#else
return ieee80211_beacon_get(hw, vif);
#endif
}
void espwl_ops_bss_info_changed(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *info,
ESPWL_CHANGED_TYPE changed)
{
espwl_bss_info_changed_impl(hw, vif, info, (u64)changed);
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
int espwl_ops_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
unsigned int link_id, u16 queue,
const struct ieee80211_tx_queue_params *params)
{
return espwl_conf_tx_impl(hw, vif, link_id, queue, params);
}
#else
int espwl_ops_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u16 queue, const struct ieee80211_tx_queue_params *params)
{
return espwl_conf_tx_impl(hw, vif, 0, queue, params);
}
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
void espwl_ops_stop(struct ieee80211_hw *hw, bool suspend)
{
espwl_ops_stop_impl(hw, suspend);
}
#else
void espwl_ops_stop(struct ieee80211_hw *hw)
{
espwl_ops_stop_impl(hw, false);
}
#endif
bool ieee80211_is_trigger_compat(__le16 fc)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
return ieee80211_is_trigger(fc);
#else
return false;
#endif
}
void wifi_parse_trigger_frame_compat(uint16_t aid, struct ieee80211_hdr *hdr,
void *mpdu_info)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
wifi_parse_trigger_frame(aid, hdr, mpdu_info);
#else
return;
#endif
}
void netif_napi_add_compat(struct net_device *dev, struct napi_struct *napi,
int (*poll)(struct napi_struct *, int))
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
netif_napi_add(dev, napi, poll);
#else
netif_napi_add(dev, napi, poll, 64);
#endif
}
EXPORT_SYMBOL(netif_napi_add_compat);
void espwl_set_he_6ghz_capa(struct ieee80211_sband_iftype_data *data, u16 capa)
{
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 7, 0)
data->he_6ghz_capa.capa = capa;
#endif
}
void ieee80211_tx_status_compat(struct ieee80211_hw *hw, struct sk_buff *skb)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)
ieee80211_tx_status_skb(hw, skb);
#else
ieee80211_tx_status(hw, skb);
#endif
}