mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-20 10:51:27 +00:00
75 lines
2.0 KiB
Diff
75 lines
2.0 KiB
Diff
--- a/net/mac80211/debugfs_netdev.c
|
|
+++ b/net/mac80211/debugfs_netdev.c
|
|
@@ -300,6 +300,32 @@ static ssize_t ieee80211_if_parse_smps(s
|
|
}
|
|
IEEE80211_IF_FILE_RW(smps);
|
|
|
|
+static ssize_t ieee80211_if_fmt_disable_offload(const struct ieee80211_sub_if_data *sdata,
|
|
+ char *buf, int buflen)
|
|
+{
|
|
+ return snprintf(buf, buflen, "%u\n", sdata->disable_offload);
|
|
+}
|
|
+
|
|
+static ssize_t ieee80211_if_parse_disable_offload(struct ieee80211_sub_if_data *sdata,
|
|
+ const char *buf, int buflen)
|
|
+{
|
|
+ int ret;
|
|
+ u8 val;
|
|
+
|
|
+ ret = kstrtou8(buf, 0, &val);
|
|
+ if (ret)
|
|
+ return ret;
|
|
+
|
|
+ if (!val)
|
|
+ return -EINVAL;
|
|
+
|
|
+ sdata->disable_offload = val;
|
|
+ ieee80211_recalc_offload(sdata->local);
|
|
+
|
|
+ return buflen;
|
|
+}
|
|
+IEEE80211_IF_FILE_RW(disable_offload);
|
|
+
|
|
int ieee80211_if_fmt_bmiss_threshold(const struct ieee80211_sub_if_data *sdata,
|
|
char *buf, int buflen)
|
|
{
|
|
@@ -680,6 +706,7 @@ static void add_common_files(struct ieee
|
|
DEBUGFS_ADD(rc_rateidx_mcs_mask_5ghz);
|
|
DEBUGFS_ADD(rc_rateidx_vht_mcs_mask_2ghz);
|
|
DEBUGFS_ADD(rc_rateidx_vht_mcs_mask_5ghz);
|
|
+ DEBUGFS_ADD_MODE(disable_offload, 0600);
|
|
DEBUGFS_ADD(hw_queues);
|
|
|
|
if (sdata->local->ops->wake_tx_queue &&
|
|
--- a/net/mac80211/ieee80211_i.h
|
|
+++ b/net/mac80211/ieee80211_i.h
|
|
@@ -942,6 +942,7 @@ struct ieee80211_sub_if_data {
|
|
bool control_port_no_encrypt;
|
|
bool control_port_no_preauth;
|
|
bool control_port_over_nl80211;
|
|
+ bool disable_offload;
|
|
int encrypt_headroom;
|
|
|
|
atomic_t num_tx_queued;
|
|
--- a/net/mac80211/iface.c
|
|
+++ b/net/mac80211/iface.c
|
|
@@ -909,6 +909,9 @@ static bool ieee80211_set_sdata_offload_
|
|
flags &= ~IEEE80211_OFFLOAD_DECAP_ENABLED;
|
|
}
|
|
|
|
+ if (sdata->disable_offload)
|
|
+ flags = 0;
|
|
+
|
|
if (sdata->vif.offload_flags == flags)
|
|
return false;
|
|
|
|
@@ -939,6 +942,8 @@ static void ieee80211_set_vif_encap_ops(
|
|
if (sdata->wdev.use_4addr &&
|
|
!(bss->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_4ADDR))
|
|
enabled = false;
|
|
+ if (bss->disable_offload)
|
|
+ enabled = false;
|
|
|
|
sdata->dev->netdev_ops = enabled ? &ieee80211_dataif_8023_ops :
|
|
&ieee80211_dataif_ops;
|