Initial commit
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
--- a/drivers/net/wireless/ath/Kconfig
|
||||
+++ b/drivers/net/wireless/ath/Kconfig
|
||||
@@ -1,6 +1,6 @@
|
||||
# SPDX-License-Identifier: ISC
|
||||
config ATH_COMMON
|
||||
- tristate
|
||||
+ tristate "ath.ko"
|
||||
depends on m
|
||||
|
||||
config WLAN_VENDOR_ATH
|
||||
@@ -0,0 +1,31 @@
|
||||
--- a/drivers/net/wireless/ath/Makefile
|
||||
+++ b/drivers/net/wireless/ath/Makefile
|
||||
@@ -15,10 +15,10 @@ ath-objs := main.o \
|
||||
regd.o \
|
||||
hw.o \
|
||||
key.o \
|
||||
+ debug.o \
|
||||
dfs_pattern_detector.o \
|
||||
dfs_pri_detector.o
|
||||
|
||||
-ath-$(CPTCFG_ATH_DEBUG) += debug.o
|
||||
ath-$(CPTCFG_ATH_TRACEPOINTS) += trace.o
|
||||
|
||||
CFLAGS_trace.o := -I$(src)
|
||||
--- a/drivers/net/wireless/ath/ath.h
|
||||
+++ b/drivers/net/wireless/ath/ath.h
|
||||
@@ -317,14 +317,7 @@ void _ath_dbg(struct ath_common *common,
|
||||
#endif /* CPTCFG_ATH_DEBUG */
|
||||
|
||||
/** Returns string describing opmode, or NULL if unknown mode. */
|
||||
-#ifdef CPTCFG_ATH_DEBUG
|
||||
const char *ath_opmode_to_string(enum nl80211_iftype opmode);
|
||||
-#else
|
||||
-static inline const char *ath_opmode_to_string(enum nl80211_iftype opmode)
|
||||
-{
|
||||
- return "UNKNOWN";
|
||||
-}
|
||||
-#endif
|
||||
|
||||
extern const char *ath_bus_type_strings[];
|
||||
static inline const char *ath_bus_type_to_string(enum ath_bus_type bustype)
|
||||
@@ -0,0 +1,92 @@
|
||||
--- a/drivers/net/wireless/ath/regd.c
|
||||
+++ b/drivers/net/wireless/ath/regd.c
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "regd_common.h"
|
||||
|
||||
static int __ath_regd_init(struct ath_regulatory *reg);
|
||||
+static struct reg_dmn_pair_mapping *ath_get_regpair(int regdmn);
|
||||
|
||||
/*
|
||||
* This is a set of common rules used by our world regulatory domains.
|
||||
@@ -116,6 +117,9 @@ static const struct ieee80211_regdomain
|
||||
|
||||
static bool dynamic_country_user_possible(struct ath_regulatory *reg)
|
||||
{
|
||||
+ if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
|
||||
+ return true;
|
||||
+
|
||||
if (IS_ENABLED(CPTCFG_ATH_REG_DYNAMIC_USER_CERT_TESTING))
|
||||
return true;
|
||||
|
||||
@@ -188,6 +192,8 @@ static bool dynamic_country_user_possibl
|
||||
|
||||
static bool ath_reg_dyn_country_user_allow(struct ath_regulatory *reg)
|
||||
{
|
||||
+ if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
|
||||
+ return true;
|
||||
if (!IS_ENABLED(CPTCFG_ATH_REG_DYNAMIC_USER_REG_HINTS))
|
||||
return false;
|
||||
if (!dynamic_country_user_possible(reg))
|
||||
@@ -345,6 +351,9 @@ ath_reg_apply_beaconing_flags(struct wip
|
||||
struct ieee80211_channel *ch;
|
||||
unsigned int i;
|
||||
|
||||
+ if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
|
||||
+ return;
|
||||
+
|
||||
for (band = 0; band < NUM_NL80211_BANDS; band++) {
|
||||
if (!wiphy->bands[band])
|
||||
continue;
|
||||
@@ -378,6 +387,9 @@ ath_reg_apply_ir_flags(struct wiphy *wip
|
||||
{
|
||||
struct ieee80211_supported_band *sband;
|
||||
|
||||
+ if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
|
||||
+ return;
|
||||
+
|
||||
sband = wiphy->bands[NL80211_BAND_2GHZ];
|
||||
if (!sband)
|
||||
return;
|
||||
@@ -407,6 +419,9 @@ static void ath_reg_apply_radar_flags(st
|
||||
struct ieee80211_channel *ch;
|
||||
unsigned int i;
|
||||
|
||||
+ if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
|
||||
+ return;
|
||||
+
|
||||
if (!wiphy->bands[NL80211_BAND_5GHZ])
|
||||
return;
|
||||
|
||||
@@ -639,6 +654,10 @@ ath_regd_init_wiphy(struct ath_regulator
|
||||
const struct ieee80211_regdomain *regd;
|
||||
|
||||
wiphy->reg_notifier = reg_notifier;
|
||||
+
|
||||
+ if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
|
||||
+ return 0;
|
||||
+
|
||||
wiphy->regulatory_flags |= REGULATORY_STRICT_REG |
|
||||
REGULATORY_CUSTOM_REG;
|
||||
|
||||
--- a/drivers/net/wireless/ath/Kconfig
|
||||
+++ b/drivers/net/wireless/ath/Kconfig
|
||||
@@ -24,6 +24,9 @@ config WLAN_VENDOR_ATH
|
||||
|
||||
if WLAN_VENDOR_ATH
|
||||
|
||||
+config ATH_USER_REGD
|
||||
+ bool "Do not enforce EEPROM regulatory restrictions"
|
||||
+
|
||||
config ATH_DEBUG
|
||||
bool "Atheros wireless debugging"
|
||||
help
|
||||
--- a/local-symbols
|
||||
+++ b/local-symbols
|
||||
@@ -85,6 +85,7 @@ ADM8211=
|
||||
ATH_COMMON=
|
||||
WLAN_VENDOR_ATH=
|
||||
ATH_DEBUG=
|
||||
+ATH_USER_REGD=
|
||||
ATH_TRACEPOINTS=
|
||||
ATH_REG_DYNAMIC_USER_REG_HINTS=
|
||||
ATH_REG_DYNAMIC_USER_CERT_TESTING=
|
||||
@@ -0,0 +1,84 @@
|
||||
--- a/drivers/net/wireless/ath/regd.c
|
||||
+++ b/drivers/net/wireless/ath/regd.c
|
||||
@@ -44,7 +44,8 @@ static struct reg_dmn_pair_mapping *ath_
|
||||
NL80211_RRF_NO_OFDM)
|
||||
|
||||
/* We allow IBSS on these on a case by case basis by regulatory domain */
|
||||
-#define ATH_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 80, 0, 30,\
|
||||
+#define ATH_5GHZ_5150_5350 REG_RULE(5150-10, 5240+10, 80, 0, 30, 0),\
|
||||
+ REG_RULE(5260-10, 5350+10, 80, 0, 30,\
|
||||
NL80211_RRF_NO_IR)
|
||||
#define ATH_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 80, 0, 30,\
|
||||
NL80211_RRF_NO_IR)
|
||||
@@ -62,57 +63,56 @@ static struct reg_dmn_pair_mapping *ath_
|
||||
#define ATH_5GHZ_NO_MIDBAND ATH_5GHZ_5150_5350, \
|
||||
ATH_5GHZ_5725_5850
|
||||
|
||||
+#define REGD_RULES(...) \
|
||||
+ .reg_rules = { __VA_ARGS__ }, \
|
||||
+ .n_reg_rules = ARRAY_SIZE(((struct ieee80211_reg_rule[]) { __VA_ARGS__ }))
|
||||
+
|
||||
/* Can be used for:
|
||||
* 0x60, 0x61, 0x62 */
|
||||
static const struct ieee80211_regdomain ath_world_regdom_60_61_62 = {
|
||||
- .n_reg_rules = 5,
|
||||
.alpha2 = "99",
|
||||
- .reg_rules = {
|
||||
+ REGD_RULES(
|
||||
ATH_2GHZ_ALL,
|
||||
ATH_5GHZ_ALL,
|
||||
- }
|
||||
+ )
|
||||
};
|
||||
|
||||
/* Can be used by 0x63 and 0x65 */
|
||||
static const struct ieee80211_regdomain ath_world_regdom_63_65 = {
|
||||
- .n_reg_rules = 4,
|
||||
.alpha2 = "99",
|
||||
- .reg_rules = {
|
||||
+ REGD_RULES(
|
||||
ATH_2GHZ_CH01_11,
|
||||
ATH_2GHZ_CH12_13,
|
||||
ATH_5GHZ_NO_MIDBAND,
|
||||
- }
|
||||
+ )
|
||||
};
|
||||
|
||||
/* Can be used by 0x64 only */
|
||||
static const struct ieee80211_regdomain ath_world_regdom_64 = {
|
||||
- .n_reg_rules = 3,
|
||||
.alpha2 = "99",
|
||||
- .reg_rules = {
|
||||
+ REGD_RULES(
|
||||
ATH_2GHZ_CH01_11,
|
||||
ATH_5GHZ_NO_MIDBAND,
|
||||
- }
|
||||
+ )
|
||||
};
|
||||
|
||||
/* Can be used by 0x66 and 0x69 */
|
||||
static const struct ieee80211_regdomain ath_world_regdom_66_69 = {
|
||||
- .n_reg_rules = 3,
|
||||
.alpha2 = "99",
|
||||
- .reg_rules = {
|
||||
+ REGD_RULES(
|
||||
ATH_2GHZ_CH01_11,
|
||||
ATH_5GHZ_ALL,
|
||||
- }
|
||||
+ )
|
||||
};
|
||||
|
||||
/* Can be used by 0x67, 0x68, 0x6A and 0x6C */
|
||||
static const struct ieee80211_regdomain ath_world_regdom_67_68_6A_6C = {
|
||||
- .n_reg_rules = 4,
|
||||
.alpha2 = "99",
|
||||
- .reg_rules = {
|
||||
+ REGD_RULES(
|
||||
ATH_2GHZ_CH01_11,
|
||||
ATH_2GHZ_CH12_13,
|
||||
ATH_5GHZ_ALL,
|
||||
- }
|
||||
+ )
|
||||
};
|
||||
|
||||
static bool dynamic_country_user_possible(struct ath_regulatory *reg)
|
||||
@@ -0,0 +1,19 @@
|
||||
--- a/net/wireless/reg.c
|
||||
+++ b/net/wireless/reg.c
|
||||
@@ -3252,6 +3252,8 @@ void regulatory_hint_country_ie(struct w
|
||||
enum environment_cap env = ENVIRON_ANY;
|
||||
struct regulatory_request *request = NULL, *lr;
|
||||
|
||||
+ return;
|
||||
+
|
||||
/* IE len must be evenly divisible by 2 */
|
||||
if (country_ie_len & 0x01)
|
||||
return;
|
||||
@@ -3503,6 +3505,7 @@ static bool is_wiphy_all_set_reg_flag(en
|
||||
|
||||
void regulatory_hint_disconnect(void)
|
||||
{
|
||||
+ return;
|
||||
/* Restore of regulatory settings is not required when wiphy(s)
|
||||
* ignore IE from connected access point but clearance of beacon hints
|
||||
* is required when wiphy(s) supports beacon hints.
|
||||
26
package/kernel/mac80211/patches/ath/405-ath_regd_us.patch
Normal file
26
package/kernel/mac80211/patches/ath/405-ath_regd_us.patch
Normal file
@@ -0,0 +1,26 @@
|
||||
--- a/drivers/net/wireless/ath/regd_common.h
|
||||
+++ b/drivers/net/wireless/ath/regd_common.h
|
||||
@@ -32,6 +32,7 @@ enum EnumRd {
|
||||
FCC2_WORLD = 0x21,
|
||||
FCC2_ETSIC = 0x22,
|
||||
FCC6_WORLD = 0x23,
|
||||
+ FCC3_FCCA_2 = 0x2A,
|
||||
FRANCE_RES = 0x31,
|
||||
FCC3_FCCA = 0x3A,
|
||||
FCC3_WORLD = 0x3B,
|
||||
@@ -172,6 +173,7 @@ static struct reg_dmn_pair_mapping regDo
|
||||
{FCC2_WORLD, CTL_FCC, CTL_ETSI},
|
||||
{FCC2_ETSIC, CTL_FCC, CTL_ETSI},
|
||||
{FCC3_FCCA, CTL_FCC, CTL_FCC},
|
||||
+ {FCC3_FCCA_2, CTL_FCC, CTL_FCC},
|
||||
{FCC3_WORLD, CTL_FCC, CTL_ETSI},
|
||||
{FCC3_ETSIC, CTL_FCC, CTL_ETSI},
|
||||
{FCC4_FCCA, CTL_FCC, CTL_FCC},
|
||||
@@ -483,6 +485,7 @@ static struct country_code_to_enum_rd al
|
||||
{CTRY_UAE, NULL1_WORLD, "AE"},
|
||||
{CTRY_UNITED_KINGDOM, ETSI1_WORLD, "GB"},
|
||||
{CTRY_UNITED_STATES, FCC3_FCCA, "US"},
|
||||
+ {CTRY_UNITED_STATES, FCC3_FCCA_2, "US"},
|
||||
{CTRY_UNITED_STATES2, FCC3_FCCA, "US"},
|
||||
{CTRY_UNITED_STATES3, FCC3_FCCA, "US"},
|
||||
/* This "PS" is for US public safety actually... to support this we
|
||||
@@ -0,0 +1,51 @@
|
||||
--- a/drivers/net/wireless/ath/regd.c
|
||||
+++ b/drivers/net/wireless/ath/regd.c
|
||||
@@ -115,6 +115,16 @@ static const struct ieee80211_regdomain
|
||||
)
|
||||
};
|
||||
|
||||
+static u16 ath_regd_get_eepromRD(struct ath_regulatory *reg)
|
||||
+{
|
||||
+ return reg->current_rd & ~WORLDWIDE_ROAMING_FLAG;
|
||||
+}
|
||||
+
|
||||
+static bool is_default_regd(struct ath_regulatory *reg)
|
||||
+{
|
||||
+ return ath_regd_get_eepromRD(reg) == CTRY_DEFAULT;
|
||||
+}
|
||||
+
|
||||
static bool dynamic_country_user_possible(struct ath_regulatory *reg)
|
||||
{
|
||||
if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
|
||||
@@ -123,6 +133,9 @@ static bool dynamic_country_user_possibl
|
||||
if (IS_ENABLED(CPTCFG_ATH_REG_DYNAMIC_USER_CERT_TESTING))
|
||||
return true;
|
||||
|
||||
+ if (is_default_regd(reg))
|
||||
+ return true;
|
||||
+
|
||||
switch (reg->country_code) {
|
||||
case CTRY_UNITED_STATES:
|
||||
case CTRY_JAPAN1:
|
||||
@@ -208,11 +221,6 @@ static inline bool is_wwr_sku(u16 regd)
|
||||
(regd == WORLD));
|
||||
}
|
||||
|
||||
-static u16 ath_regd_get_eepromRD(struct ath_regulatory *reg)
|
||||
-{
|
||||
- return reg->current_rd & ~WORLDWIDE_ROAMING_FLAG;
|
||||
-}
|
||||
-
|
||||
bool ath_is_world_regd(struct ath_regulatory *reg)
|
||||
{
|
||||
return is_wwr_sku(ath_regd_get_eepromRD(reg));
|
||||
@@ -658,6 +666,9 @@ ath_regd_init_wiphy(struct ath_regulator
|
||||
if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
|
||||
return 0;
|
||||
|
||||
+ if (is_default_regd(reg))
|
||||
+ return 0;
|
||||
+
|
||||
wiphy->regulatory_flags |= REGULATORY_STRICT_REG |
|
||||
REGULATORY_CUSTOM_REG;
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
--- a/drivers/net/wireless/ath/ath5k/pci.c
|
||||
+++ b/drivers/net/wireless/ath/ath5k/pci.c
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <linux/pci.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/module.h>
|
||||
+#include <linux/ath5k_platform.h>
|
||||
#include "../ath.h"
|
||||
#include "ath5k.h"
|
||||
#include "debug.h"
|
||||
@@ -71,7 +72,7 @@ static void ath5k_pci_read_cachesize(str
|
||||
}
|
||||
|
||||
/*
|
||||
- * Read from eeprom
|
||||
+ * Read from eeprom or platform_data
|
||||
*/
|
||||
static bool
|
||||
ath5k_pci_eeprom_read(struct ath_common *common, u32 offset, u16 *data)
|
||||
@@ -79,6 +80,19 @@ ath5k_pci_eeprom_read(struct ath_common
|
||||
struct ath5k_hw *ah = (struct ath5k_hw *) common->ah;
|
||||
u32 status, timeout;
|
||||
|
||||
+ struct ath5k_platform_data *pdata = NULL;
|
||||
+
|
||||
+ if (ah->pdev)
|
||||
+ pdata = ah->pdev->dev.platform_data;
|
||||
+
|
||||
+ if (pdata && pdata->eeprom_data && pdata->eeprom_data[61] == AR5K_EEPROM_MAGIC_VALUE) {
|
||||
+ if (offset >= ATH5K_PLAT_EEP_MAX_WORDS)
|
||||
+ return false;
|
||||
+
|
||||
+ *data = pdata->eeprom_data[offset];
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Initialize EEPROM access
|
||||
*/
|
||||
@@ -122,6 +136,16 @@ static int ath5k_pci_eeprom_read_mac(str
|
||||
u16 data;
|
||||
int octet;
|
||||
|
||||
+ struct ath5k_platform_data *pdata = NULL;
|
||||
+
|
||||
+ if (ah->pdev)
|
||||
+ pdata = ah->pdev->dev.platform_data;
|
||||
+
|
||||
+ if (pdata && pdata->macaddr) {
|
||||
+ memcpy(mac, pdata->macaddr, ETH_ALEN);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
AR5K_EEPROM_READ(0x20, data);
|
||||
|
||||
for (offset = 0x1f, octet = 0, total = 0; offset >= 0x1d; offset--) {
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/drivers/net/wireless/ath/ath10k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/mac.c
|
||||
@@ -4718,6 +4718,7 @@ static void ath10k_mac_setup_ht_vht_cap(
|
||||
if (ar->phy_capability & WHAL_WLAN_11G_CAPABILITY) {
|
||||
band = &ar->mac.sbands[NL80211_BAND_2GHZ];
|
||||
band->ht_cap = ht_cap;
|
||||
+ band->vht_cap = vht_cap;
|
||||
}
|
||||
if (ar->phy_capability & WHAL_WLAN_11A_CAPABILITY) {
|
||||
band = &ar->mac.sbands[NL80211_BAND_5GHZ];
|
||||
@@ -0,0 +1,337 @@
|
||||
--- a/drivers/net/wireless/ath/ath10k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/core.c
|
||||
@@ -35,6 +35,7 @@ static bool uart_print;
|
||||
static bool skip_otp;
|
||||
static bool rawmode;
|
||||
static bool fw_diag_log;
|
||||
+static bool ethernetmode = true;
|
||||
|
||||
unsigned long ath10k_coredump_mask = BIT(ATH10K_FW_CRASH_DUMP_REGISTERS) |
|
||||
BIT(ATH10K_FW_CRASH_DUMP_CE_DATA);
|
||||
@@ -47,6 +48,7 @@ module_param(skip_otp, bool, 0644);
|
||||
module_param(rawmode, bool, 0644);
|
||||
module_param(fw_diag_log, bool, 0644);
|
||||
module_param_named(coredump_mask, ath10k_coredump_mask, ulong, 0444);
|
||||
+module_param(ethernetmode, bool, 0644);
|
||||
|
||||
MODULE_PARM_DESC(debug_mask, "Debugging mask");
|
||||
MODULE_PARM_DESC(uart_print, "Uart target debugging");
|
||||
@@ -55,6 +57,7 @@ MODULE_PARM_DESC(cryptmode, "Crypto mode
|
||||
MODULE_PARM_DESC(rawmode, "Use raw 802.11 frame datapath");
|
||||
MODULE_PARM_DESC(coredump_mask, "Bitfield of what to include in firmware crash file");
|
||||
MODULE_PARM_DESC(fw_diag_log, "Diag based fw log debugging");
|
||||
+MODULE_PARM_DESC(ethernetmode, "Use ethernet frame datapath");
|
||||
|
||||
static const struct ath10k_hw_params ath10k_hw_params_list[] = {
|
||||
{
|
||||
@@ -3135,6 +3138,14 @@ static void ath10k_core_register_work(st
|
||||
/* peer stats are enabled by default */
|
||||
set_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags);
|
||||
|
||||
+ if (ethernetmode && rawmode) {
|
||||
+ ath10k_err(ar, "invalid configuration, ethernet and rawmode data path can not coexist\n");
|
||||
+ status = -EINVAL;
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ ar->ethernetmode = ethernetmode;
|
||||
+
|
||||
status = ath10k_core_probe_fw(ar);
|
||||
if (status) {
|
||||
ath10k_err(ar, "could not probe fw (%d)\n", status);
|
||||
--- a/drivers/net/wireless/ath/ath10k/core.h
|
||||
+++ b/drivers/net/wireless/ath/ath10k/core.h
|
||||
@@ -113,6 +113,7 @@ enum ath10k_skb_flags {
|
||||
ATH10K_SKB_F_QOS = BIT(4),
|
||||
ATH10K_SKB_F_RAW_TX = BIT(5),
|
||||
ATH10K_SKB_F_NOACK_TID = BIT(6),
|
||||
+ ATH10K_SKB_F_HW_80211_ENCAP = BIT(7),
|
||||
};
|
||||
|
||||
struct ath10k_skb_cb {
|
||||
@@ -1294,6 +1295,8 @@ struct ath10k {
|
||||
const char *led_default_trigger;
|
||||
#endif
|
||||
|
||||
+ bool ethernetmode;
|
||||
+
|
||||
/* must be last */
|
||||
u8 drv_priv[] __aligned(sizeof(void *));
|
||||
};
|
||||
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
|
||||
@@ -1187,6 +1187,10 @@ static u8 ath10k_htt_tx_get_tid(struct s
|
||||
struct ieee80211_hdr *hdr = (void *)skb->data;
|
||||
struct ath10k_skb_cb *cb = ATH10K_SKB_CB(skb);
|
||||
|
||||
+ /* Firmware takes care of tid classification for ethernet format */
|
||||
+ if (cb->flags & ATH10K_SKB_F_HW_80211_ENCAP)
|
||||
+ return skb->priority & IEEE80211_QOS_CTL_TID_MASK;
|
||||
+
|
||||
if (!is_eth && ieee80211_is_mgmt(hdr->frame_control))
|
||||
return HTT_DATA_TX_EXT_TID_MGMT;
|
||||
else if (cb->flags & ATH10K_SKB_F_QOS)
|
||||
@@ -1434,15 +1438,17 @@ static int ath10k_htt_tx_32(struct ath10
|
||||
txbuf_paddr = htt->txbuf.paddr +
|
||||
(sizeof(struct ath10k_htt_txbuf_32) * msdu_id);
|
||||
|
||||
- if ((ieee80211_is_action(hdr->frame_control) ||
|
||||
- ieee80211_is_deauth(hdr->frame_control) ||
|
||||
- ieee80211_is_disassoc(hdr->frame_control)) &&
|
||||
- ieee80211_has_protected(hdr->frame_control)) {
|
||||
- skb_put(msdu, IEEE80211_CCMP_MIC_LEN);
|
||||
- } else if (!(skb_cb->flags & ATH10K_SKB_F_NO_HWCRYPT) &&
|
||||
- txmode == ATH10K_HW_TXRX_RAW &&
|
||||
- ieee80211_has_protected(hdr->frame_control)) {
|
||||
- skb_put(msdu, IEEE80211_CCMP_MIC_LEN);
|
||||
+ if (!(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP)) {
|
||||
+ if ((ieee80211_is_action(hdr->frame_control) ||
|
||||
+ ieee80211_is_deauth(hdr->frame_control) ||
|
||||
+ ieee80211_is_disassoc(hdr->frame_control)) &&
|
||||
+ ieee80211_has_protected(hdr->frame_control)) {
|
||||
+ skb_put(msdu, IEEE80211_CCMP_MIC_LEN);
|
||||
+ } else if (!(skb_cb->flags & ATH10K_SKB_F_NO_HWCRYPT) &&
|
||||
+ txmode == ATH10K_HW_TXRX_RAW &&
|
||||
+ ieee80211_has_protected(hdr->frame_control)) {
|
||||
+ skb_put(msdu, IEEE80211_CCMP_MIC_LEN);
|
||||
+ }
|
||||
}
|
||||
|
||||
skb_cb->paddr = dma_map_single(dev, msdu->data, msdu->len,
|
||||
--- a/drivers/net/wireless/ath/ath10k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/mac.c
|
||||
@@ -3573,12 +3573,16 @@ ath10k_mac_tx_h_get_txmode(struct ath10k
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
const struct ieee80211_hdr *hdr = (void *)skb->data;
|
||||
+ struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
|
||||
const struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
|
||||
__le16 fc = hdr->frame_control;
|
||||
|
||||
if (!vif || vif->type == NL80211_IFTYPE_MONITOR)
|
||||
return ATH10K_HW_TXRX_RAW;
|
||||
|
||||
+ if (tx_info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP)
|
||||
+ return ATH10K_HW_TXRX_ETHERNET;
|
||||
+
|
||||
if (ieee80211_is_mgmt(fc))
|
||||
return ATH10K_HW_TXRX_MGMT;
|
||||
|
||||
@@ -3736,6 +3740,15 @@ static void ath10k_mac_tx_h_fill_cb(stru
|
||||
bool noack = false;
|
||||
|
||||
cb->flags = 0;
|
||||
+ cb->vif = vif;
|
||||
+ cb->txq = txq;
|
||||
+ cb->airtime_est = airtime;
|
||||
+
|
||||
+ if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) {
|
||||
+ cb->flags |= ATH10K_SKB_F_HW_80211_ENCAP;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (!ath10k_tx_h_use_hwcrypto(vif, skb))
|
||||
cb->flags |= ATH10K_SKB_F_NO_HWCRYPT;
|
||||
|
||||
@@ -3774,9 +3787,6 @@ static void ath10k_mac_tx_h_fill_cb(stru
|
||||
cb->flags |= ATH10K_SKB_F_RAW_TX;
|
||||
}
|
||||
|
||||
- cb->vif = vif;
|
||||
- cb->txq = txq;
|
||||
- cb->airtime_est = airtime;
|
||||
if (sta) {
|
||||
arsta = (struct ath10k_sta *)sta->drv_priv;
|
||||
spin_lock_bh(&ar->data_lock);
|
||||
@@ -3892,6 +3902,9 @@ static int ath10k_mac_tx(struct ath10k *
|
||||
const struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
|
||||
int ret;
|
||||
|
||||
+ if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP)
|
||||
+ goto skip_encap;
|
||||
+
|
||||
/* We should disable CCK RATE due to P2P */
|
||||
if (info->flags & IEEE80211_TX_CTL_NO_CCK_RATE)
|
||||
ath10k_dbg(ar, ATH10K_DBG_MAC, "IEEE80211_TX_CTL_NO_CCK_RATE\n");
|
||||
@@ -3915,6 +3928,7 @@ static int ath10k_mac_tx(struct ath10k *
|
||||
}
|
||||
}
|
||||
|
||||
+skip_encap:
|
||||
if (!noque_offchan && info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) {
|
||||
if (!ath10k_mac_tx_frm_has_freq(ar)) {
|
||||
ath10k_dbg(ar, ATH10K_DBG_MAC, "mac queued offchannel skb %pK len %d\n",
|
||||
@@ -3964,6 +3978,7 @@ void ath10k_offchan_tx_work(struct work_
|
||||
int ret;
|
||||
unsigned long time_left;
|
||||
bool tmp_peer_created = false;
|
||||
+ struct ieee80211_tx_info *info;
|
||||
|
||||
/* FW requirement: We must create a peer before FW will send out
|
||||
* an offchannel frame. Otherwise the frame will be stuck and
|
||||
@@ -3983,8 +3998,14 @@ void ath10k_offchan_tx_work(struct work_
|
||||
ath10k_dbg(ar, ATH10K_DBG_MAC, "mac offchannel skb %pK len %d\n",
|
||||
skb, skb->len);
|
||||
|
||||
- hdr = (struct ieee80211_hdr *)skb->data;
|
||||
- peer_addr = ieee80211_get_DA(hdr);
|
||||
+ info = IEEE80211_SKB_CB(skb);
|
||||
+
|
||||
+ if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) {
|
||||
+ peer_addr = skb->data;
|
||||
+ } else {
|
||||
+ hdr = (struct ieee80211_hdr *)skb->data;
|
||||
+ peer_addr = ieee80211_get_DA(hdr);
|
||||
+ }
|
||||
|
||||
spin_lock_bh(&ar->data_lock);
|
||||
vdev_id = ar->scan.vdev_id;
|
||||
@@ -4517,7 +4538,7 @@ static void ath10k_mac_op_tx(struct ieee
|
||||
struct ieee80211_vif *vif = info->control.vif;
|
||||
struct ieee80211_sta *sta = control->sta;
|
||||
struct ieee80211_txq *txq = NULL;
|
||||
- struct ieee80211_hdr *hdr = (void *)skb->data;
|
||||
+ struct ieee80211_hdr *hdr;
|
||||
enum ath10k_hw_txrx_mode txmode;
|
||||
enum ath10k_mac_tx_path txpath;
|
||||
bool is_htt;
|
||||
@@ -4537,7 +4558,6 @@ static void ath10k_mac_op_tx(struct ieee
|
||||
|
||||
if (is_htt) {
|
||||
spin_lock_bh(&ar->htt.tx_lock);
|
||||
- is_presp = ieee80211_is_probe_resp(hdr->frame_control);
|
||||
|
||||
ret = ath10k_htt_tx_inc_pending(htt);
|
||||
if (ret) {
|
||||
@@ -4548,14 +4568,19 @@ static void ath10k_mac_op_tx(struct ieee
|
||||
return;
|
||||
}
|
||||
|
||||
- ret = ath10k_htt_tx_mgmt_inc_pending(htt, is_mgmt, is_presp);
|
||||
- if (ret) {
|
||||
- ath10k_dbg(ar, ATH10K_DBG_MAC, "failed to increase tx mgmt pending count: %d, dropping\n",
|
||||
- ret);
|
||||
- ath10k_htt_tx_dec_pending(htt);
|
||||
- spin_unlock_bh(&ar->htt.tx_lock);
|
||||
- ieee80211_free_txskb(ar->hw, skb);
|
||||
- return;
|
||||
+ if (is_mgmt) {
|
||||
+ hdr = (struct ieee80211_hdr *)skb->data;
|
||||
+ is_presp = ieee80211_is_probe_resp(hdr->frame_control);
|
||||
+
|
||||
+ ret = ath10k_htt_tx_mgmt_inc_pending(htt, is_mgmt, is_presp);
|
||||
+ if (ret) {
|
||||
+ ath10k_dbg(ar, ATH10K_DBG_MAC, "failed to increase tx mgmt pending count: %d, dropping\n",
|
||||
+ ret);
|
||||
+ ath10k_htt_tx_dec_pending(htt);
|
||||
+ spin_unlock_bh(&ar->htt.tx_lock);
|
||||
+ ieee80211_free_txskb(ar->hw, skb);
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
spin_unlock_bh(&ar->htt.tx_lock);
|
||||
}
|
||||
@@ -5378,6 +5403,36 @@ static int ath10k_mac_set_txbf_conf(stru
|
||||
ar->wmi.vdev_param->txbf, value);
|
||||
}
|
||||
|
||||
+static void ath10k_mac_op_update_vif_offload(struct ieee80211_hw *hw,
|
||||
+ struct ieee80211_vif *vif)
|
||||
+{
|
||||
+ struct ath10k *ar = hw->priv;
|
||||
+ struct ath10k_vif *arvif = (void *)vif->drv_priv;
|
||||
+
|
||||
+ u32 vdev_param, param_value;
|
||||
+ int ret;
|
||||
+
|
||||
+ vdev_param = ar->wmi.vdev_param->tx_encap_type;
|
||||
+ if (!ar->ethernetmode ||
|
||||
+ (vif->type != NL80211_IFTYPE_STATION &&
|
||||
+ vif->type != NL80211_IFTYPE_AP))
|
||||
+ vif->offload_flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED;
|
||||
+
|
||||
+ if (vif->offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED)
|
||||
+ param_value = ATH10K_HW_TXRX_ETHERNET;
|
||||
+ else
|
||||
+ param_value = ATH10K_HW_TXRX_NATIVE_WIFI;
|
||||
+
|
||||
+ ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
|
||||
+ param_value);
|
||||
+
|
||||
+ if (ret) {
|
||||
+ ath10k_info(ar, "failed to set vdev %i TX encapsulation: %d\n",
|
||||
+ arvif->vdev_id, ret);
|
||||
+ vif->offload_flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* TODO:
|
||||
* Figure out how to handle WMI_VDEV_SUBTYPE_P2P_DEVICE,
|
||||
@@ -5571,15 +5626,7 @@ static int ath10k_add_interface(struct i
|
||||
|
||||
arvif->def_wep_key_idx = -1;
|
||||
|
||||
- vdev_param = ar->wmi.vdev_param->tx_encap_type;
|
||||
- ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
|
||||
- ATH10K_HW_TXRX_NATIVE_WIFI);
|
||||
- /* 10.X firmware does not support this VDEV parameter. Do not warn */
|
||||
- if (ret && ret != -EOPNOTSUPP) {
|
||||
- ath10k_warn(ar, "failed to set vdev %i TX encapsulation: %d\n",
|
||||
- arvif->vdev_id, ret);
|
||||
- goto err_vdev_delete;
|
||||
- }
|
||||
+ ath10k_mac_op_update_vif_offload(hw, vif);
|
||||
|
||||
/* Configuring number of spatial stream for monitor interface is causing
|
||||
* target assert in qca9888 and qca6174.
|
||||
@@ -9260,6 +9307,7 @@ static const struct ieee80211_ops ath10k
|
||||
.config = ath10k_config,
|
||||
.add_interface = ath10k_add_interface,
|
||||
.remove_interface = ath10k_remove_interface,
|
||||
+ .update_vif_offload = ath10k_mac_op_update_vif_offload,
|
||||
.configure_filter = ath10k_configure_filter,
|
||||
.bss_info_changed = ath10k_bss_info_changed,
|
||||
.set_coverage_class = ath10k_mac_op_set_coverage_class,
|
||||
@@ -9886,6 +9934,9 @@ int ath10k_mac_register(struct ath10k *a
|
||||
ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG);
|
||||
ieee80211_hw_set(ar->hw, REPORTS_LOW_ACK);
|
||||
|
||||
+ if(ar->ethernetmode)
|
||||
+ ieee80211_hw_set(ar->hw, SUPPORTS_TX_ENCAP_OFFLOAD);
|
||||
+
|
||||
if (!test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags))
|
||||
ieee80211_hw_set(ar->hw, SW_CRYPTO_CONTROL);
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath10k/txrx.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/txrx.c
|
||||
@@ -50,6 +50,7 @@ int ath10k_txrx_tx_unref(struct ath10k_h
|
||||
struct ath10k_skb_cb *skb_cb;
|
||||
struct ath10k_txq *artxq;
|
||||
struct sk_buff *msdu;
|
||||
+ struct ieee80211_vif *vif;
|
||||
u8 flags;
|
||||
|
||||
ath10k_dbg(ar, ATH10K_DBG_HTT,
|
||||
@@ -80,6 +81,8 @@ int ath10k_txrx_tx_unref(struct ath10k_h
|
||||
}
|
||||
|
||||
flags = skb_cb->flags;
|
||||
+ vif = skb_cb->vif;
|
||||
+
|
||||
ath10k_htt_tx_free_msdu_id(htt, tx_done->msdu_id);
|
||||
ath10k_htt_tx_dec_pending(htt);
|
||||
if (htt->num_pending_tx == 0)
|
||||
@@ -130,7 +133,11 @@ int ath10k_txrx_tx_unref(struct ath10k_h
|
||||
info->status.is_valid_ack_signal = true;
|
||||
}
|
||||
|
||||
- ieee80211_tx_status(htt->ar->hw, msdu);
|
||||
+ if (flags & ATH10K_SKB_F_HW_80211_ENCAP)
|
||||
+ ieee80211_tx_status_8023(htt->ar->hw, vif, msdu);
|
||||
+ else
|
||||
+ ieee80211_tx_status(htt->ar->hw, msdu);
|
||||
+
|
||||
/* we do not own the msdu anymore */
|
||||
|
||||
return 0;
|
||||
Reference in New Issue
Block a user