ath9k: fix handling of tx headroom for padding

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

Backport of r47042

git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@47044 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
Felix Fietkau 2015-09-24 15:43:24 +00:00
parent 1898cdc737
commit d0a48c1d42
7 changed files with 34 additions and 12 deletions

View File

@ -0,0 +1,22 @@
From: Felix Fietkau <nbd@openwrt.org>
Date: Thu, 24 Sep 2015 16:57:37 +0200
Subject: [PATCH] ath9k: declare required extra tx headroom
ath9k inserts padding between the 802.11 header and the data area (to
align it). Since it didn't declare this extra required headroom, this
led to some nasty issues like randomly dropped packets in some setups.
Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -867,6 +867,7 @@ static void ath9k_set_hw_capab(struct at
hw->max_rate_tries = 10;
hw->sta_data_size = sizeof(struct ath_node);
hw->vif_data_size = sizeof(struct ath_vif);
+ hw->extra_tx_headroom = 4;
hw->wiphy->available_antennas_rx = BIT(ah->caps.max_rxchains) - 1;
hw->wiphy->available_antennas_tx = BIT(ah->caps.max_txchains) - 1;

View File

@ -1,6 +1,6 @@
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -1299,6 +1299,53 @@ void ath9k_deinit_debug(struct ath_softc
@@ -1301,6 +1301,53 @@ void ath9k_deinit_debug(struct ath_softc
ath9k_cmn_spectral_deinit_debug(&sc->spec_priv);
}
@ -54,7 +54,7 @@
int ath9k_init_debug(struct ath_hw *ah)
{
struct ath_common *common = ath9k_hw_common(ah);
@@ -1318,6 +1365,8 @@ int ath9k_init_debug(struct ath_hw *ah)
@@ -1320,6 +1367,8 @@ int ath9k_init_debug(struct ath_hw *ah)
ath9k_tx99_init_debug(sc);
ath9k_cmn_spectral_init_debug(&sc->spec_priv, sc->debug.debugfs_phy);

View File

@ -1,6 +1,6 @@
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -1023,23 +1023,23 @@ static int __init ath9k_init(void)
@@ -1024,23 +1024,23 @@ static int __init ath9k_init(void)
{
int error;

View File

@ -1,6 +1,6 @@
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -1346,6 +1346,52 @@ static const struct file_operations fops
@@ -1348,6 +1348,52 @@ static const struct file_operations fops
.owner = THIS_MODULE
};
@ -53,7 +53,7 @@
int ath9k_init_debug(struct ath_hw *ah)
{
struct ath_common *common = ath9k_hw_common(ah);
@@ -1367,6 +1413,8 @@ int ath9k_init_debug(struct ath_hw *ah)
@@ -1369,6 +1415,8 @@ int ath9k_init_debug(struct ath_hw *ah)
debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
&fops_eeprom);

View File

@ -165,7 +165,7 @@
void ath_fill_led_pin(struct ath_softc *sc)
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -935,7 +935,7 @@ int ath9k_init_device(u16 devid, struct
@@ -936,7 +936,7 @@ int ath9k_init_device(u16 devid, struct
#ifdef CPTCFG_MAC80211_LEDS
/* must be initialized before ieee80211_register_hw */
@ -176,7 +176,7 @@
#endif
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -1391,6 +1391,61 @@ static const struct file_operations fops
@@ -1393,6 +1393,61 @@ static const struct file_operations fops
.llseek = default_llseek,
};
@ -238,7 +238,7 @@
int ath9k_init_debug(struct ath_hw *ah)
{
@@ -1415,6 +1470,10 @@ int ath9k_init_debug(struct ath_hw *ah)
@@ -1417,6 +1472,10 @@ int ath9k_init_debug(struct ath_hw *ah)
&fops_eeprom);
debugfs_create_file("chanbw", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
sc, &fops_chanbw);

View File

@ -1,6 +1,6 @@
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -1447,6 +1447,50 @@ static const struct file_operations fops
@@ -1449,6 +1449,50 @@ static const struct file_operations fops
#endif
@ -51,7 +51,7 @@
int ath9k_init_debug(struct ath_hw *ah)
{
struct ath_common *common = ath9k_hw_common(ah);
@@ -1474,6 +1518,8 @@ int ath9k_init_debug(struct ath_hw *ah)
@@ -1476,6 +1520,8 @@ int ath9k_init_debug(struct ath_hw *ah)
debugfs_create_file("gpio_led", S_IWUSR,
sc->debug.debugfs_phy, sc, &fops_gpio_led);
#endif

View File

@ -65,7 +65,7 @@
}
static const struct ieee80211_iface_limit if_limits[] = {
@@ -895,6 +896,18 @@ static void ath9k_set_hw_capab(struct at
@@ -896,6 +897,18 @@ static void ath9k_set_hw_capab(struct at
SET_IEEE80211_PERM_ADDR(hw, common->macaddr);
}
@ -84,7 +84,7 @@
int ath9k_init_device(u16 devid, struct ath_softc *sc,
const struct ath_bus_ops *bus_ops)
{
@@ -940,6 +953,8 @@ int ath9k_init_device(u16 devid, struct
@@ -941,6 +954,8 @@ int ath9k_init_device(u16 devid, struct
ARRAY_SIZE(ath9k_tpt_blink));
#endif