ipq40xx: backport ath10k hw802.11 for kernel 4.14

This commit is contained in:
LEAN-ESX 2019-11-26 21:51:20 -08:00
parent 6773af4631
commit 049a40ee66

View File

@ -2,34 +2,33 @@ diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/a
index 4f76ba5d78a9..eef0d931dd4e 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -34,6 +34,7 @@ static bool uart_print;
@@ -38,18 +38,21 @@
static bool uart_print;
static bool skip_otp;
static bool rawmode;
static bool fw_diag_log;
+static bool ethernetmode = true;
+static bool ethernetmode;
unsigned long ath10k_coredump_mask = BIT(ATH10K_FW_CRASH_DUMP_REGISTERS) |
BIT(ATH10K_FW_CRASH_DUMP_CE_DATA);
@@ -46,6 +47,7 @@ module_param(skip_otp, bool, 0644);
module_param_named(debug_mask, ath10k_debug_mask, uint, 0644);
module_param_named(cryptmode, ath10k_cryptmode_param, uint, 0644);
module_param(uart_print, bool, 0644);
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");
@@ -54,6 +56,7 @@ MODULE_PARM_DESC(cryptmode, "Crypto mode: 0-hardware, 1-software");
MODULE_PARM_DESC(skip_otp, "Skip otp failure for calibration in testmode");
MODULE_PARM_DESC(cryptmode, "Crypto mode: 0-hardware, 1-software");
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[] = {
{
@@ -3041,6 +3044,14 @@ static void ath10k_core_register_work(struct work_struct *work)
@@ -2390,6 +2393,15 @@
/* peer stats are enabled by default */
set_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags);
+
+ if (ethernetmode && rawmode) {
+ ath10k_err(ar, "ethernet and raw mode cannot co-exist\n");
+ status = -EINVAL;
@ -38,30 +37,30 @@ index 4f76ba5d78a9..eef0d931dd4e 100644
+
+ ar->ethernetmode = ethernetmode;
+
status = ath10k_core_probe_fw(ar);
if (status) {
ath10k_err(ar, "could not probe fw (%d)\n", status);
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index af68eb5d0776..251fb57cbe8f 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -109,6 +109,7 @@ enum ath10k_skb_flags {
@@ -117,6 +117,7 @@
ATH10K_SKB_F_DELIVER_CAB = BIT(2),
ATH10K_SKB_F_MGMT = BIT(3),
ATH10K_SKB_F_QOS = BIT(4),
ATH10K_SKB_F_RAW_TX = BIT(5),
+ ATH10K_SKB_F_HW_80211_ENCAP = BIT(6),
};
struct ath10k_skb_cb {
@@ -1220,6 +1221,8 @@ struct ath10k {
struct ath10k_bus_params bus_param;
struct completion peer_delete_done;
@@ -999,6 +1000,8 @@
u32 ampdu_reference;
+ bool ethernetmode;
void *ce_priv;
+
+ bool ethernetmode;
/* must be last */
u8 drv_priv[0] __aligned(sizeof(void *));
};
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index a182c0944cc7..0ca0705fe69a 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
@ -108,25 +107,23 @@ diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/at
index 83cc8778ca1e..0ea0d0be74a1 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3427,12 +3427,16 @@ ath10k_mac_tx_h_get_txmode(struct ath10k *ar,
@@ -3363,10 +3363,14 @@
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->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP)
+ return ATH10K_HW_TXRX_ETHERNET;
+
if (ieee80211_is_mgmt(fc))
return ATH10K_HW_TXRX_MGMT;
@@ -3585,6 +3589,15 @@ static void ath10k_mac_tx_h_fill_cb(struct ath10k *ar,
ieee80211_is_data_qos(hdr->frame_control);
@@ -3516,6 +3520,15 @@
struct ath10k_skb_cb *cb = ATH10K_SKB_CB(skb);
cb->flags = 0;
+ cb->vif = vif;
@ -141,36 +138,36 @@ index 83cc8778ca1e..0ea0d0be74a1 100644
if (!ath10k_tx_h_use_hwcrypto(vif, skb))
cb->flags |= ATH10K_SKB_F_NO_HWCRYPT;
@@ -3603,10 +3616,6 @@ static void ath10k_mac_tx_h_fill_cb(struct ath10k *ar,
cb->flags |= ATH10K_SKB_F_NO_HWCRYPT;
cb->flags |= ATH10K_SKB_F_RAW_TX;
}
-
@@ -3525,8 +3538,6 @@
if (ieee80211_is_data_qos(hdr->frame_control))
cb->flags |= ATH10K_SKB_F_QOS;
- cb->vif = vif;
- cb->txq = txq;
- cb->airtime_est = airtime;
}
bool ath10k_mac_tx_frm_has_freq(struct ath10k *ar)
@@ -3716,6 +3725,9 @@ static int ath10k_mac_tx(struct ath10k *ar,
const struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
int ret;
@@ -3631,7 +3642,10 @@
{
struct ieee80211_hw *hw = ar->hw;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
- int ret;
+ int ret;.
+
+ if (info->control.flags & IEEE80211_TX_CTRL_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");
@@ -3739,6 +3751,7 @@ static int ath10k_mac_tx(struct ath10k *ar,
@@ -3655,6 +3669,7 @@
}
}
+skip_encap:
if (!noque_offchan && info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) {
if (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",
@@ -3788,6 +3801,7 @@ void ath10k_offchan_tx_work(struct work_struct *work)
ath10k_dbg(ar, ATH10K_DBG_MAC, "queued offchannel skb %pK\n",
@@ -3704,6 +3719,7 @@
int ret;
unsigned long time_left;
bool tmp_peer_created = false;
@ -178,9 +175,9 @@ index 83cc8778ca1e..0ea0d0be74a1 100644
/* FW requirement: We must create a peer before FW will send out
* an offchannel frame. Otherwise the frame will be stuck and
@@ -3807,8 +3821,14 @@ void ath10k_offchan_tx_work(struct work_struct *work)
ath10k_dbg(ar, ATH10K_DBG_MAC, "mac offchannel skb %pK len %d\n",
skb, skb->len);
@@ -3723,8 +3739,15 @@
ath10k_dbg(ar, ATH10K_DBG_MAC, "mac offchannel skb %pK\n",
skb);
- hdr = (struct ieee80211_hdr *)skb->data;
- peer_addr = ieee80211_get_DA(hdr);
@ -192,10 +189,11 @@ index 83cc8778ca1e..0ea0d0be74a1 100644
+ hdr = (struct ieee80211_hdr *)skb->data;
+ peer_addr = ieee80211_get_DA(hdr);
+ }
+
spin_lock_bh(&ar->data_lock);
vdev_id = ar->scan.vdev_id;
@@ -4338,7 +4358,7 @@ static void ath10k_mac_op_tx(struct ieee80211_hw *hw,
@@ -4198,7 +4221,7 @@
struct ieee80211_vif *vif = info->control.vif;
struct ieee80211_sta *sta = control->sta;
struct ieee80211_txq *txq = NULL;
@ -204,7 +202,7 @@ index 83cc8778ca1e..0ea0d0be74a1 100644
enum ath10k_hw_txrx_mode txmode;
enum ath10k_mac_tx_path txpath;
bool is_htt;
@@ -4369,14 +4389,20 @@ static void ath10k_mac_op_tx(struct ieee80211_hw *hw,
@@ -4227,14 +4250,20 @@
return;
}
@ -233,7 +231,7 @@ index 83cc8778ca1e..0ea0d0be74a1 100644
}
spin_unlock_bh(&ar->htt.tx_lock);
}
@@ -5209,10 +5235,12 @@ static int ath10k_mac_set_txbf_conf(struct ath10k_vif *arvif)
@@ -4929,10 +4958,12 @@
static int ath10k_add_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
{
@ -246,10 +244,11 @@ index 83cc8778ca1e..0ea0d0be74a1 100644
int ret = 0;
u32 value;
int bit;
@@ -5304,6 +5332,21 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
@@ -5023,6 +5054,21 @@
WARN_ON(1);
break;
}
+
+ switch (vif->type) {
+ case NL80211_IFTYPE_STATION:
+ case NL80211_IFTYPE_AP_VLAN:
@ -264,11 +263,10 @@ index 83cc8778ca1e..0ea0d0be74a1 100644
+ }
+
+ ieee80211_set_hw_80211_encap(vif, ar->ethernetmode & hw_encap);
+
/* Using vdev_id as queue number will make it very easy to do per-vif
* tx queue locking. This shouldn't wrap due to interface combinations
* but do a modulo for correctness sake and prevent using offchannel tx
@@ -8880,6 +8923,8 @@ int ath10k_mac_register(struct ath10k *ar)
@@ -8208,6 +8254,8 @@
ieee80211_hw_set(ar->hw, QUEUE_CONTROL);
ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG);
ieee80211_hw_set(ar->hw, REPORTS_LOW_ACK);