mac80211: drop 355-ath9k-limit-retries-for-powersave-response-frames.patch
several people reported this bug to be causing drop out issues Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
		| @@ -21,11 +21,9 @@ Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> | |||||||
|  drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | 7 +++---- |  drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | 7 +++---- | ||||||
|  1 file changed, 3 insertions(+), 4 deletions(-) |  1 file changed, 3 insertions(+), 4 deletions(-) | ||||||
|  |  | ||||||
| diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c |  | ||||||
| index a6884e73d2ab..7ddee980048b 100644 |  | ||||||
| --- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | --- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | ||||||
| +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | ||||||
| @@ -372,16 +372,15 @@ static void rt2x00queue_create_tx_descriptor_ht(struct rt2x00_dev *rt2x00dev, | @@ -372,16 +372,15 @@ static void rt2x00queue_create_tx_descri | ||||||
|   |   | ||||||
|  	/* |  	/* | ||||||
|  	 * Determine IFS values |  	 * Determine IFS values | ||||||
|   | |||||||
| @@ -173,7 +173,8 @@ | |||||||
|  #define AES_CCM_H |  #define AES_CCM_H | ||||||
|   |   | ||||||
| -#include "aead_api.h" | -#include "aead_api.h" | ||||||
| - | +#include <linux/crypto.h> | ||||||
|  |   | ||||||
| -#define CCM_AAD_LEN	32 | -#define CCM_AAD_LEN	32 | ||||||
| - | - | ||||||
| -static inline struct crypto_aead * | -static inline struct crypto_aead * | ||||||
| @@ -201,8 +202,7 @@ | |||||||
| -			    be16_to_cpup((__be16 *)aad), | -			    be16_to_cpup((__be16 *)aad), | ||||||
| -			    data, data_len, mic); | -			    data, data_len, mic); | ||||||
| -} | -} | ||||||
| +#include <linux/crypto.h> | - | ||||||
|   |  | ||||||
| -static inline void ieee80211_aes_key_free(struct crypto_aead *tfm) | -static inline void ieee80211_aes_key_free(struct crypto_aead *tfm) | ||||||
| -{ | -{ | ||||||
| -	return aead_key_free(tfm); | -	return aead_key_free(tfm); | ||||||
| @@ -338,10 +338,10 @@ | |||||||
|  #define AES_GCM_H |  #define AES_GCM_H | ||||||
|   |   | ||||||
| -#include "aead_api.h" | -#include "aead_api.h" | ||||||
| - |  | ||||||
| -#define GCM_AAD_LEN	32 |  | ||||||
| +#include <linux/crypto.h> | +#include <linux/crypto.h> | ||||||
|   |   | ||||||
|  | -#define GCM_AAD_LEN	32 | ||||||
|  | - | ||||||
| -static inline int ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, | -static inline int ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, | ||||||
| -					    u8 *j_0, u8 *aad,  u8 *data, | -					    u8 *j_0, u8 *aad,  u8 *data, | ||||||
| -					    size_t data_len, u8 *mic) | -					    size_t data_len, u8 *mic) | ||||||
|   | |||||||
| @@ -20,12 +20,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
| -void ieee80211_aes_cmac(struct crypto_shash *tfm, const u8 *aad, | -void ieee80211_aes_cmac(struct crypto_shash *tfm, const u8 *aad, | ||||||
| -			const u8 *data, size_t data_len, u8 *mic) | -			const u8 *data, size_t data_len, u8 *mic) | ||||||
| +void gf_mulx(u8 *pad) | +void gf_mulx(u8 *pad) | ||||||
|  { | +{ | ||||||
| -	SHASH_DESC_ON_STACK(desc, tfm); |  | ||||||
| -	u8 out[AES_BLOCK_SIZE]; |  | ||||||
| +	int i, carry; | +	int i, carry; | ||||||
|   | + | ||||||
| -	desc->tfm = tfm; |  | ||||||
| +	carry = pad[0] & 0x80; | +	carry = pad[0] & 0x80; | ||||||
| +	for (i = 0; i < AES_BLOCK_SIZE - 1; i++) | +	for (i = 0; i < AES_BLOCK_SIZE - 1; i++) | ||||||
| +		pad[i] = (pad[i] << 1) | (pad[i + 1] >> 7); | +		pad[i] = (pad[i] << 1) | (pad[i + 1] >> 7); | ||||||
| @@ -33,20 +30,17 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
| +	if (carry) | +	if (carry) | ||||||
| +		pad[AES_BLOCK_SIZE - 1] ^= 0x87; | +		pad[AES_BLOCK_SIZE - 1] ^= 0x87; | ||||||
| +} | +} | ||||||
|   | + | ||||||
| -	crypto_shash_init(desc); |  | ||||||
| -	crypto_shash_update(desc, aad, AAD_LEN); |  | ||||||
| -	crypto_shash_update(desc, data, data_len - CMAC_TLEN); |  | ||||||
| -	crypto_shash_finup(desc, zero, CMAC_TLEN, out); |  | ||||||
| +void aes_cmac_vector(struct crypto_cipher *tfm, size_t num_elem, | +void aes_cmac_vector(struct crypto_cipher *tfm, size_t num_elem, | ||||||
| +		     const u8 *addr[], const size_t *len, u8 *mac, | +		     const u8 *addr[], const size_t *len, u8 *mac, | ||||||
| +		     size_t mac_len) | +		     size_t mac_len) | ||||||
| +{ |  { | ||||||
|  | -	SHASH_DESC_ON_STACK(desc, tfm); | ||||||
|  | -	u8 out[AES_BLOCK_SIZE]; | ||||||
| +	u8 cbc[AES_BLOCK_SIZE], pad[AES_BLOCK_SIZE]; | +	u8 cbc[AES_BLOCK_SIZE], pad[AES_BLOCK_SIZE]; | ||||||
| +	const u8 *pos, *end; | +	const u8 *pos, *end; | ||||||
| +	size_t i, e, left, total_len; | +	size_t i, e, left, total_len; | ||||||
|   | + | ||||||
| -	memcpy(mic, out, CMAC_TLEN); |  | ||||||
| +	memset(cbc, 0, AES_BLOCK_SIZE); | +	memset(cbc, 0, AES_BLOCK_SIZE); | ||||||
| + | + | ||||||
| +	total_len = 0; | +	total_len = 0; | ||||||
| @@ -93,10 +87,14 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
| +		pad[i] ^= cbc[i]; | +		pad[i] ^= cbc[i]; | ||||||
| +	crypto_cipher_encrypt_one(tfm, pad, pad); | +	crypto_cipher_encrypt_one(tfm, pad, pad); | ||||||
| +	memcpy(mac, pad, mac_len); | +	memcpy(mac, pad, mac_len); | ||||||
|  } | +} | ||||||
|   |   | ||||||
| -void ieee80211_aes_cmac_256(struct crypto_shash *tfm, const u8 *aad, | -	desc->tfm = tfm; | ||||||
| + |   | ||||||
|  | -	crypto_shash_init(desc); | ||||||
|  | -	crypto_shash_update(desc, aad, AAD_LEN); | ||||||
|  | -	crypto_shash_update(desc, data, data_len - CMAC_TLEN); | ||||||
|  | -	crypto_shash_finup(desc, zero, CMAC_TLEN, out); | ||||||
| +void ieee80211_aes_cmac(struct crypto_cipher *tfm, const u8 *aad, | +void ieee80211_aes_cmac(struct crypto_cipher *tfm, const u8 *aad, | ||||||
| +			const u8 *data, size_t data_len, u8 *mic) | +			const u8 *data, size_t data_len, u8 *mic) | ||||||
| +{ | +{ | ||||||
| @@ -111,10 +109,12 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
| +	len[1] = data_len - CMAC_TLEN; | +	len[1] = data_len - CMAC_TLEN; | ||||||
| +	addr[2] = zero; | +	addr[2] = zero; | ||||||
| +	len[2] = CMAC_TLEN; | +	len[2] = CMAC_TLEN; | ||||||
| + |   | ||||||
|  | -	memcpy(mic, out, CMAC_TLEN); | ||||||
| +	aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN); | +	aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN); | ||||||
| +} |  } | ||||||
| + |   | ||||||
|  | -void ieee80211_aes_cmac_256(struct crypto_shash *tfm, const u8 *aad, | ||||||
| +void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad, | +void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad, | ||||||
|  			    const u8 *data, size_t data_len, u8 *mic) |  			    const u8 *data, size_t data_len, u8 *mic) | ||||||
|  { |  { | ||||||
| @@ -122,8 +122,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
| +	const u8 *addr[3]; | +	const u8 *addr[3]; | ||||||
| +	size_t len[3]; | +	size_t len[3]; | ||||||
| +	u8 zero[CMAC_TLEN_256]; | +	u8 zero[CMAC_TLEN_256]; | ||||||
|   | + | ||||||
| -	desc->tfm = tfm; |  | ||||||
| +	memset(zero, 0, CMAC_TLEN_256); | +	memset(zero, 0, CMAC_TLEN_256); | ||||||
| +	addr[0] = aad; | +	addr[0] = aad; | ||||||
| +	len[0] = AAD_LEN; | +	len[0] = AAD_LEN; | ||||||
| @@ -132,6 +131,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
| +	addr[2] = zero; | +	addr[2] = zero; | ||||||
| +	len[2] = CMAC_TLEN_256; | +	len[2] = CMAC_TLEN_256; | ||||||
|   |   | ||||||
|  | -	desc->tfm = tfm; | ||||||
|  | - | ||||||
| -	crypto_shash_init(desc); | -	crypto_shash_init(desc); | ||||||
| -	crypto_shash_update(desc, aad, AAD_LEN); | -	crypto_shash_update(desc, aad, AAD_LEN); | ||||||
| -	crypto_shash_update(desc, data, data_len - CMAC_TLEN_256); | -	crypto_shash_update(desc, data, data_len - CMAC_TLEN_256); | ||||||
|   | |||||||
| @@ -88,7 +88,7 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org> | |||||||
| -			spec_scan = true; | -			spec_scan = true; | ||||||
| -		} else | -		} else | ||||||
| -			brcmf_dbg(SCAN, "Broadcast scan\n"); | -			brcmf_dbg(SCAN, "Broadcast scan\n"); | ||||||
|   | - | ||||||
| -		passive_scan = cfg->active_scan ? 0 : 1; | -		passive_scan = cfg->active_scan ? 0 : 1; | ||||||
| -		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PASSIVE_SCAN, | -		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PASSIVE_SCAN, | ||||||
| -					    passive_scan); | -					    passive_scan); | ||||||
| @@ -105,15 +105,17 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org> | |||||||
| -					  ssid_le.SSID); | -					  ssid_le.SSID); | ||||||
| -			else | -			else | ||||||
| -				brcmf_err("WLC_SCAN error (%d)\n", err); | -				brcmf_err("WLC_SCAN error (%d)\n", err); | ||||||
| +	cfg->escan_info.run = brcmf_run_escan; | - | ||||||
| +	err = brcmf_p2p_scan_prep(wiphy, request, vif); |  | ||||||
| +	if (err) |  | ||||||
| +		goto scan_out; |  | ||||||
|   |  | ||||||
| -			brcmf_scan_config_mpc(ifp, 1); | -			brcmf_scan_config_mpc(ifp, 1); | ||||||
| -			goto scan_out; | -			goto scan_out; | ||||||
| -		} | -		} | ||||||
| -	} | -	} | ||||||
|  | + | ||||||
|  | +	cfg->escan_info.run = brcmf_run_escan; | ||||||
|  | +	err = brcmf_p2p_scan_prep(wiphy, request, vif); | ||||||
|  | +	if (err) | ||||||
|  | +		goto scan_out; | ||||||
|  | + | ||||||
| +	err = brcmf_do_escan(vif->ifp, request); | +	err = brcmf_do_escan(vif->ifp, request); | ||||||
| +	if (err) | +	if (err) | ||||||
| +		goto scan_out; | +		goto scan_out; | ||||||
|   | |||||||
| @@ -141,12 +141,12 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org> | |||||||
| -		func = SDIO_FUNC_0; | -		func = SDIO_FUNC_0; | ||||||
| -	else | -	else | ||||||
| -		func = SDIO_FUNC_1; | -		func = SDIO_FUNC_1; | ||||||
|   | - | ||||||
| -	do { | -	do { | ||||||
| -		/* for retry wait for 1 ms till bus get settled down */ | -		/* for retry wait for 1 ms till bus get settled down */ | ||||||
| -		if (retry) | -		if (retry) | ||||||
| -			usleep_range(1000, 2000); | -			usleep_range(1000, 2000); | ||||||
| - |   | ||||||
| -		ret = brcmf_sdiod_request_data(sdiodev, func, addr, regsz, | -		ret = brcmf_sdiod_request_data(sdiodev, func, addr, regsz, | ||||||
| -					       data, true); | -					       data, true); | ||||||
| - | - | ||||||
|   | |||||||
| @@ -198,14 +198,14 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org> | |||||||
|  	int retval; |  	int retval; | ||||||
|   |   | ||||||
| -	retval = brcmf_sdiod_reg_read(sdiodev, addr, 1, &data); | -	retval = brcmf_sdiod_reg_read(sdiodev, addr, 1, &data); | ||||||
| +	retval = brcmf_sdiod_addrprep(sdiodev, &addr); | - | ||||||
|   |  | ||||||
| -	if (ret) | -	if (ret) | ||||||
| -		*ret = retval; | -		*ret = retval; | ||||||
| - | - | ||||||
| -	return data; | -	return data; | ||||||
| -} | -} | ||||||
| - | +	retval = brcmf_sdiod_addrprep(sdiodev, &addr); | ||||||
|  |   | ||||||
| -u32 brcmf_sdiod_regrl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret) | -u32 brcmf_sdiod_regrl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret) | ||||||
| -{ | -{ | ||||||
| -	u32 data; | -	u32 data; | ||||||
|   | |||||||
| @@ -62,10 +62,10 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org> | |||||||
| +	if (!err) | +	if (!err) | ||||||
|  		sdiodev->sbwad = bar0; |  		sdiodev->sbwad = bar0; | ||||||
| -	} | -	} | ||||||
| - |   | ||||||
| -	*addr &= SBSDIO_SB_OFT_ADDR_MASK; | -	*addr &= SBSDIO_SB_OFT_ADDR_MASK; | ||||||
| -	*addr |= SBSDIO_SB_ACCESS_2_4B_FLAG; | -	*addr |= SBSDIO_SB_ACCESS_2_4B_FLAG; | ||||||
|   | - | ||||||
| -	return 0; | -	return 0; | ||||||
| +	return err; | +	return err; | ||||||
|  } |  } | ||||||
| @@ -99,14 +99,14 @@ Signed-off-by: Kalle Valo <kvalo@codeaurora.org> | |||||||
| +	retval = brcmf_sdiod_set_backplane_window(sdiodev, addr); | +	retval = brcmf_sdiod_set_backplane_window(sdiodev, addr); | ||||||
| +	if (retval) | +	if (retval) | ||||||
| +		goto out; | +		goto out; | ||||||
| + |  | ||||||
| +	addr &= SBSDIO_SB_OFT_ADDR_MASK; |  | ||||||
| +	addr |= SBSDIO_SB_ACCESS_2_4B_FLAG; |  | ||||||
|   |   | ||||||
| -	if (!retval) | -	if (!retval) | ||||||
| -		sdio_writel(sdiodev->func[1], data, addr, &retval); | -		sdio_writel(sdiodev->func[1], data, addr, &retval); | ||||||
| +	sdio_writel(sdiodev->func[1], data, addr, &retval); | +	addr &= SBSDIO_SB_OFT_ADDR_MASK; | ||||||
|  | +	addr |= SBSDIO_SB_ACCESS_2_4B_FLAG; | ||||||
|   |   | ||||||
|  | +	sdio_writel(sdiodev->func[1], data, addr, &retval); | ||||||
|  | + | ||||||
| +out: | +out: | ||||||
|  	if (ret) |  	if (ret) | ||||||
|  		*ret = retval; |  		*ret = retval; | ||||||
|   | |||||||
| @@ -29,6 +29,21 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
| -		npend = ath9k_hw_numtxpending(ah, i); | -		npend = ath9k_hw_numtxpending(ah, i); | ||||||
| -		if (npend) | -		if (npend) | ||||||
| -			break; | -			break; | ||||||
|  | -	} | ||||||
|  | - | ||||||
|  | -	if (ah->external_reset && | ||||||
|  | -	    (npend || type == ATH9K_RESET_COLD)) { | ||||||
|  | -		int reset_err = 0; | ||||||
|  | - | ||||||
|  | -		ath_dbg(ath9k_hw_common(ah), RESET, | ||||||
|  | -			"reset MAC via external reset\n"); | ||||||
|  | - | ||||||
|  | -		reset_err = ah->external_reset(); | ||||||
|  | -		if (reset_err) { | ||||||
|  | -			ath_err(ath9k_hw_common(ah), | ||||||
|  | -				"External reset failed, err=%d\n", | ||||||
|  | -				reset_err); | ||||||
|  | -			return false; | ||||||
| +	if (type == ATH9K_RESET_COLD) | +	if (type == ATH9K_RESET_COLD) | ||||||
| +		return true; | +		return true; | ||||||
| + | + | ||||||
| @@ -44,47 +59,35 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
| +		for (i = 0; i < AR_NUM_QCU; i++) { | +		for (i = 0; i < AR_NUM_QCU; i++) { | ||||||
| +			if (ath9k_hw_numtxpending(ah, i)) | +			if (ath9k_hw_numtxpending(ah, i)) | ||||||
| +				return true; | +				return true; | ||||||
| +		} |  | ||||||
|  		} |  		} | ||||||
|   | +	} | ||||||
| -	if (ah->external_reset && | + | ||||||
| -	    (npend || type == ATH9K_RESET_COLD)) { |  | ||||||
| -		int reset_err = 0; |  | ||||||
| +	return false; | +	return false; | ||||||
| +} | +} | ||||||
|   | + | ||||||
| -		ath_dbg(ath9k_hw_common(ah), RESET, |  | ||||||
| -			"reset MAC via external reset\n"); |  | ||||||
| +static bool ath9k_hw_external_reset(struct ath_hw *ah, int type) | +static bool ath9k_hw_external_reset(struct ath_hw *ah, int type) | ||||||
| +{ | +{ | ||||||
| +	int err; | +	int err; | ||||||
|   | + | ||||||
| -		reset_err = ah->external_reset(); |  | ||||||
| -		if (reset_err) { |  | ||||||
| -			ath_err(ath9k_hw_common(ah), |  | ||||||
| -				"External reset failed, err=%d\n", |  | ||||||
| -				reset_err); |  | ||||||
| -			return false; |  | ||||||
| -		} |  | ||||||
| +	if (!ah->external_reset || !ath9k_hw_need_external_reset(ah, type)) | +	if (!ah->external_reset || !ath9k_hw_need_external_reset(ah, type)) | ||||||
| +		return true; | +		return true; | ||||||
|   | + | ||||||
| -		REG_WRITE(ah, AR_RTC_RESET, 1); |  | ||||||
| +	ath_dbg(ath9k_hw_common(ah), RESET, | +	ath_dbg(ath9k_hw_common(ah), RESET, | ||||||
| +		"reset MAC via external reset\n"); | +		"reset MAC via external reset\n"); | ||||||
| + |   | ||||||
|  | -		REG_WRITE(ah, AR_RTC_RESET, 1); | ||||||
| +	err = ah->external_reset(); | +	err = ah->external_reset(); | ||||||
| +	if (err) { | +	if (err) { | ||||||
| +		ath_err(ath9k_hw_common(ah), | +		ath_err(ath9k_hw_common(ah), | ||||||
| +			"External reset failed, err=%d\n", err); | +			"External reset failed, err=%d\n", err); | ||||||
| +		return false; | +		return false; | ||||||
| +	} |  	} | ||||||
| + |   | ||||||
| +	if (AR_SREV_9550(ah)) { | +	if (AR_SREV_9550(ah)) { | ||||||
| +		REG_WRITE(ah, AR_RTC_RESET, 0); | +		REG_WRITE(ah, AR_RTC_RESET, 0); | ||||||
| +		udelay(10); | +		udelay(10); | ||||||
|  	} | +	} | ||||||
|   | + | ||||||
| +	REG_WRITE(ah, AR_RTC_RESET, 1); | +	REG_WRITE(ah, AR_RTC_RESET, 1); | ||||||
| +	udelay(10); | +	udelay(10); | ||||||
| + | + | ||||||
|   | |||||||
| @@ -1,96 +0,0 @@ | |||||||
| From: Felix Fietkau <nbd@openwrt.org> |  | ||||||
| Date: Thu, 2 Jul 2015 15:20:56 +0200 |  | ||||||
| Subject: [PATCH] ath9k: limit retries for powersave response frames |  | ||||||
|  |  | ||||||
| In some cases, the channel might be busy enough that an ath9k AP's |  | ||||||
| response to PS-Poll frames might be too slow and the station has already |  | ||||||
| gone to sleep. To avoid wasting too much airtime on this, limit the |  | ||||||
| number of retries on such frames and ensure that no sample rate gets |  | ||||||
| used. |  | ||||||
|  |  | ||||||
| Signed-off-by: Felix Fietkau <nbd@openwrt.org> |  | ||||||
| --- |  | ||||||
|  |  | ||||||
| --- a/drivers/net/wireless/ath/ath9k/xmit.c |  | ||||||
| +++ b/drivers/net/wireless/ath/ath9k/xmit.c |  | ||||||
| @@ -188,10 +188,25 @@ static void ath_send_bar(struct ath_atx_ |  | ||||||
|  } |  | ||||||
|   |  | ||||||
|  static void ath_set_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta, |  | ||||||
| -			  struct ath_buf *bf) |  | ||||||
| +			  struct ath_buf *bf, bool ps) |  | ||||||
|  { |  | ||||||
| +	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(bf->bf_mpdu); |  | ||||||
| + |  | ||||||
| +	if (ps) { |  | ||||||
| +		/* Clear the first rate to avoid using a sample rate for PS frames */ |  | ||||||
| +		info->control.rates[0].idx = -1; |  | ||||||
| +		info->control.rates[0].count = 0; |  | ||||||
| +	} |  | ||||||
| + |  | ||||||
|  	ieee80211_get_tx_rates(vif, sta, bf->bf_mpdu, bf->rates, |  | ||||||
|  			       ARRAY_SIZE(bf->rates)); |  | ||||||
| +	if (!ps) |  | ||||||
| +		return; |  | ||||||
| + |  | ||||||
| +	if (bf->rates[0].count > 2) |  | ||||||
| +		bf->rates[0].count = 2; |  | ||||||
| + |  | ||||||
| +	bf->rates[1].idx = -1; |  | ||||||
|  } |  | ||||||
|   |  | ||||||
|  static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq, |  | ||||||
| @@ -1502,7 +1517,7 @@ ath_tx_form_burst(struct ath_softc *sc, |  | ||||||
|  			break; |  | ||||||
|  		} |  | ||||||
|   |  | ||||||
| -		ath_set_rates(tid->an->vif, tid->an->sta, bf); |  | ||||||
| +		ath_set_rates(tid->an->vif, tid->an->sta, bf, false); |  | ||||||
|  	} while (1); |  | ||||||
|  } |  | ||||||
|   |  | ||||||
| @@ -1532,7 +1547,7 @@ static bool ath_tx_sched_aggr(struct ath |  | ||||||
|  		return false; |  | ||||||
|  	} |  | ||||||
|   |  | ||||||
| -	ath_set_rates(tid->an->vif, tid->an->sta, bf); |  | ||||||
| +	ath_set_rates(tid->an->vif, tid->an->sta, bf, false); |  | ||||||
|  	if (aggr) |  | ||||||
|  		aggr_len = ath_tx_form_aggr(sc, txq, tid, &bf_q, bf); |  | ||||||
|  	else |  | ||||||
| @@ -1690,7 +1705,7 @@ void ath9k_release_buffered_frames(struc |  | ||||||
|  				break; |  | ||||||
|   |  | ||||||
|  			list_add_tail(&bf->list, &bf_q); |  | ||||||
| -			ath_set_rates(tid->an->vif, tid->an->sta, bf); |  | ||||||
| +			ath_set_rates(tid->an->vif, tid->an->sta, bf, true); |  | ||||||
|  			if (bf_isampdu(bf)) { |  | ||||||
|  				ath_tx_addto_baw(sc, tid, bf); |  | ||||||
|  				bf->bf_state.bf_type &= ~BUF_AGGR; |  | ||||||
| @@ -2390,7 +2405,7 @@ int ath_tx_start(struct ieee80211_hw *hw |  | ||||||
|  	if (txctl->paprd) |  | ||||||
|  		bf->bf_state.bfs_paprd_timestamp = jiffies; |  | ||||||
|   |  | ||||||
| -	ath_set_rates(vif, sta, bf); |  | ||||||
| +	ath_set_rates(vif, sta, bf, ps_resp); |  | ||||||
|  	ath_tx_send_normal(sc, txq, tid, skb); |  | ||||||
|   |  | ||||||
|  out: |  | ||||||
| @@ -2429,7 +2444,7 @@ void ath_tx_cabq(struct ieee80211_hw *hw |  | ||||||
|  			break; |  | ||||||
|   |  | ||||||
|  		bf->bf_lastbf = bf; |  | ||||||
| -		ath_set_rates(vif, NULL, bf); |  | ||||||
| +		ath_set_rates(vif, NULL, bf, false); |  | ||||||
|  		ath_buf_set_rate(sc, bf, &info, fi->framelen, false); |  | ||||||
|  		duration += info.rates[0].PktDuration; |  | ||||||
|  		if (bf_tail) |  | ||||||
| @@ -2946,7 +2961,7 @@ int ath9k_tx99_send(struct ath_softc *sc |  | ||||||
|  		return -EINVAL; |  | ||||||
|  	} |  | ||||||
|   |  | ||||||
| -	ath_set_rates(sc->tx99_vif, NULL, bf); |  | ||||||
| +	ath_set_rates(sc->tx99_vif, NULL, bf, false); |  | ||||||
|   |  | ||||||
|  	ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, bf->bf_daddr); |  | ||||||
|  	ath9k_hw_tx99_start(sc->sc_ah, txctl->txq->axq_qnum); |  | ||||||
| @@ -7,7 +7,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  |  | ||||||
| --- a/drivers/net/wireless/ath/ath9k/xmit.c | --- a/drivers/net/wireless/ath/ath9k/xmit.c | ||||||
| +++ b/drivers/net/wireless/ath/ath9k/xmit.c | +++ b/drivers/net/wireless/ath/ath9k/xmit.c | ||||||
| @@ -1674,6 +1674,22 @@ void ath_tx_aggr_wakeup(struct ath_softc | @@ -1659,6 +1659,22 @@ void ath_tx_aggr_wakeup(struct ath_softc | ||||||
|  	} |  	} | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -30,15 +30,15 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  void ath9k_release_buffered_frames(struct ieee80211_hw *hw, |  void ath9k_release_buffered_frames(struct ieee80211_hw *hw, | ||||||
|  				   struct ieee80211_sta *sta, |  				   struct ieee80211_sta *sta, | ||||||
|  				   u16 tids, int nframes, |  				   u16 tids, int nframes, | ||||||
| @@ -1704,6 +1720,7 @@ void ath9k_release_buffered_frames(struc | @@ -1689,6 +1705,7 @@ void ath9k_release_buffered_frames(struc | ||||||
|  			if (!bf) |  			if (!bf) | ||||||
|  				break; |  				break; | ||||||
|   |   | ||||||
| +			ath9k_set_moredata(sc, bf, true); | +			ath9k_set_moredata(sc, bf, true); | ||||||
|  			list_add_tail(&bf->list, &bf_q); |  			list_add_tail(&bf->list, &bf_q); | ||||||
|  			ath_set_rates(tid->an->vif, tid->an->sta, bf, true); |  			ath_set_rates(tid->an->vif, tid->an->sta, bf); | ||||||
|  			if (bf_isampdu(bf)) { |  			if (bf_isampdu(bf)) { | ||||||
| @@ -1727,6 +1744,9 @@ void ath9k_release_buffered_frames(struc | @@ -1712,6 +1729,9 @@ void ath9k_release_buffered_frames(struc | ||||||
|  	if (list_empty(&bf_q)) |  	if (list_empty(&bf_q)) | ||||||
|  		return; |  		return; | ||||||
|   |   | ||||||
|   | |||||||
| @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  |  | ||||||
| --- a/drivers/net/wireless/ath/ath9k/xmit.c | --- a/drivers/net/wireless/ath/ath9k/xmit.c | ||||||
| +++ b/drivers/net/wireless/ath/ath9k/xmit.c | +++ b/drivers/net/wireless/ath/ath9k/xmit.c | ||||||
| @@ -984,7 +984,8 @@ ath_tx_get_tid_subframe(struct ath_softc | @@ -969,7 +969,8 @@ ath_tx_get_tid_subframe(struct ath_softc | ||||||
|  		bf->bf_lastbf = bf; |  		bf->bf_lastbf = bf; | ||||||
|   |   | ||||||
|  		tx_info = IEEE80211_SKB_CB(skb); |  		tx_info = IEEE80211_SKB_CB(skb); | ||||||
|   | |||||||
| @@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, |  static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, | ||||||
|  					   struct ath_txq *txq, |  					   struct ath_txq *txq, | ||||||
|  					   struct ath_atx_tid *tid, |  					   struct ath_atx_tid *tid, | ||||||
| @@ -311,7 +311,7 @@ static void ath_tx_flush_tid(struct ath_ | @@ -296,7 +296,7 @@ static void ath_tx_flush_tid(struct ath_ | ||||||
|  		} |  		} | ||||||
|   |   | ||||||
|  		if (fi->baw_tracked) { |  		if (fi->baw_tracked) { | ||||||
| @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  			sendbar = true; |  			sendbar = true; | ||||||
|  		} |  		} | ||||||
|   |   | ||||||
| @@ -327,10 +327,15 @@ static void ath_tx_flush_tid(struct ath_ | @@ -312,10 +312,15 @@ static void ath_tx_flush_tid(struct ath_ | ||||||
|  } |  } | ||||||
|   |   | ||||||
|  static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid, |  static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid, | ||||||
| @@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  	index  = ATH_BA_INDEX(tid->seq_start, seqno); |  	index  = ATH_BA_INDEX(tid->seq_start, seqno); | ||||||
|  	cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); |  	cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); | ||||||
|   |   | ||||||
| @@ -351,6 +356,9 @@ static void ath_tx_addto_baw(struct ath_ | @@ -336,6 +341,9 @@ static void ath_tx_addto_baw(struct ath_ | ||||||
|  	u16 seqno = bf->bf_state.seqno; |  	u16 seqno = bf->bf_state.seqno; | ||||||
|  	int index, cindex; |  	int index, cindex; | ||||||
|   |   | ||||||
| @@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  	index  = ATH_BA_INDEX(tid->seq_start, seqno); |  	index  = ATH_BA_INDEX(tid->seq_start, seqno); | ||||||
|  	cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); |  	cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); | ||||||
|  	__set_bit(cindex, tid->tx_buf); |  	__set_bit(cindex, tid->tx_buf); | ||||||
| @@ -627,7 +635,7 @@ static void ath_tx_complete_aggr(struct | @@ -612,7 +620,7 @@ static void ath_tx_complete_aggr(struct | ||||||
|  			 * complete the acked-ones/xretried ones; update |  			 * complete the acked-ones/xretried ones; update | ||||||
|  			 * block-ack window |  			 * block-ack window | ||||||
|  			 */ |  			 */ | ||||||
| @@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|   |   | ||||||
|  			if (rc_update && (acked_cnt == 1 || txfail_cnt == 1)) { |  			if (rc_update && (acked_cnt == 1 || txfail_cnt == 1)) { | ||||||
|  				memcpy(tx_info->control.rates, rates, sizeof(rates)); |  				memcpy(tx_info->control.rates, rates, sizeof(rates)); | ||||||
| @@ -657,7 +665,7 @@ static void ath_tx_complete_aggr(struct | @@ -642,7 +650,7 @@ static void ath_tx_complete_aggr(struct | ||||||
|  				 * run out of tx buf. |  				 * run out of tx buf. | ||||||
|  				 */ |  				 */ | ||||||
|  				if (!tbf) { |  				if (!tbf) { | ||||||
| @@ -75,7 +75,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|   |   | ||||||
|  					ath_tx_complete_buf(sc, bf, txq, |  					ath_tx_complete_buf(sc, bf, txq, | ||||||
|  							    &bf_head, NULL, ts, |  							    &bf_head, NULL, ts, | ||||||
| @@ -1026,11 +1034,14 @@ ath_tx_get_tid_subframe(struct ath_softc | @@ -1011,11 +1019,14 @@ ath_tx_get_tid_subframe(struct ath_softc | ||||||
|   |   | ||||||
|  			INIT_LIST_HEAD(&bf_head); |  			INIT_LIST_HEAD(&bf_head); | ||||||
|  			list_add(&bf->list, &bf_head); |  			list_add(&bf->list, &bf_head); | ||||||
| @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  		return bf; |  		return bf; | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
| @@ -1088,8 +1099,6 @@ ath_tx_form_aggr(struct ath_softc *sc, s | @@ -1073,8 +1084,6 @@ ath_tx_form_aggr(struct ath_softc *sc, s | ||||||
|  		bf->bf_next = NULL; |  		bf->bf_next = NULL; | ||||||
|   |   | ||||||
|  		/* link buffers of this frame to the aggregate */ |  		/* link buffers of this frame to the aggregate */ | ||||||
| @@ -100,10 +100,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  		bf->bf_state.ndelim = ndelim; |  		bf->bf_state.ndelim = ndelim; | ||||||
|   |   | ||||||
|  		list_add_tail(&bf->list, bf_q); |  		list_add_tail(&bf->list, bf_q); | ||||||
| @@ -1725,10 +1734,8 @@ void ath9k_release_buffered_frames(struc | @@ -1710,10 +1719,8 @@ void ath9k_release_buffered_frames(struc | ||||||
|  			ath9k_set_moredata(sc, bf, true); |  			ath9k_set_moredata(sc, bf, true); | ||||||
|  			list_add_tail(&bf->list, &bf_q); |  			list_add_tail(&bf->list, &bf_q); | ||||||
|  			ath_set_rates(tid->an->vif, tid->an->sta, bf, true); |  			ath_set_rates(tid->an->vif, tid->an->sta, bf); | ||||||
| -			if (bf_isampdu(bf)) { | -			if (bf_isampdu(bf)) { | ||||||
| -				ath_tx_addto_baw(sc, tid, bf); | -				ath_tx_addto_baw(sc, tid, bf); | ||||||
| +			if (bf_isampdu(bf)) | +			if (bf_isampdu(bf)) | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  |  | ||||||
| --- a/drivers/net/wireless/ath/ath9k/xmit.c | --- a/drivers/net/wireless/ath/ath9k/xmit.c | ||||||
| +++ b/drivers/net/wireless/ath/ath9k/xmit.c | +++ b/drivers/net/wireless/ath/ath9k/xmit.c | ||||||
| @@ -2451,7 +2451,6 @@ void ath_tx_cabq(struct ieee80211_hw *hw | @@ -2436,7 +2436,6 @@ void ath_tx_cabq(struct ieee80211_hw *hw | ||||||
|  		.txq = sc->beacon.cabq |  		.txq = sc->beacon.cabq | ||||||
|  	}; |  	}; | ||||||
|  	struct ath_tx_info info = {}; |  	struct ath_tx_info info = {}; | ||||||
| @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
|  	struct ath_buf *bf_tail = NULL; |  	struct ath_buf *bf_tail = NULL; | ||||||
|  	struct ath_buf *bf; |  	struct ath_buf *bf; | ||||||
|  	LIST_HEAD(bf_q); |  	LIST_HEAD(bf_q); | ||||||
| @@ -2495,15 +2494,10 @@ void ath_tx_cabq(struct ieee80211_hw *hw | @@ -2480,15 +2479,10 @@ void ath_tx_cabq(struct ieee80211_hw *hw | ||||||
|  	if (list_empty(&bf_q)) |  	if (list_empty(&bf_q)) | ||||||
|  		return; |  		return; | ||||||
|   |   | ||||||
|   | |||||||
| @@ -136,72 +136,82 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> | |||||||
| -	MCS_GROUP(1, 0, BW_20), | -	MCS_GROUP(1, 0, BW_20), | ||||||
| -	MCS_GROUP(2, 0, BW_20), | -	MCS_GROUP(2, 0, BW_20), | ||||||
| -	MCS_GROUP(3, 0, BW_20), | -	MCS_GROUP(3, 0, BW_20), | ||||||
| +	MCS_GROUP(1, 0, BW_20, 5), | - | ||||||
| +	MCS_GROUP(2, 0, BW_20, 4), |  | ||||||
| +	MCS_GROUP(3, 0, BW_20, 4), |  | ||||||
|   |  | ||||||
| -	MCS_GROUP(1, 1, BW_20), | -	MCS_GROUP(1, 1, BW_20), | ||||||
| -	MCS_GROUP(2, 1, BW_20), | -	MCS_GROUP(2, 1, BW_20), | ||||||
| -	MCS_GROUP(3, 1, BW_20), | -	MCS_GROUP(3, 1, BW_20), | ||||||
| +	MCS_GROUP(1, 1, BW_20, 5), | - | ||||||
| +	MCS_GROUP(2, 1, BW_20, 4), |  | ||||||
| +	MCS_GROUP(3, 1, BW_20, 4), |  | ||||||
|   |  | ||||||
| -	MCS_GROUP(1, 0, BW_40), | -	MCS_GROUP(1, 0, BW_40), | ||||||
| -	MCS_GROUP(2, 0, BW_40), | -	MCS_GROUP(2, 0, BW_40), | ||||||
| -	MCS_GROUP(3, 0, BW_40), | -	MCS_GROUP(3, 0, BW_40), | ||||||
| +	MCS_GROUP(1, 0, BW_40, 4), | - | ||||||
| +	MCS_GROUP(2, 0, BW_40, 4), |  | ||||||
| +	MCS_GROUP(3, 0, BW_40, 4), |  | ||||||
|   |  | ||||||
| -	MCS_GROUP(1, 1, BW_40), | -	MCS_GROUP(1, 1, BW_40), | ||||||
| -	MCS_GROUP(2, 1, BW_40), | -	MCS_GROUP(2, 1, BW_40), | ||||||
| -	MCS_GROUP(3, 1, BW_40), | -	MCS_GROUP(3, 1, BW_40), | ||||||
| +	MCS_GROUP(1, 1, BW_40, 4), | - | ||||||
| +	MCS_GROUP(2, 1, BW_40, 4), |  | ||||||
| +	MCS_GROUP(3, 1, BW_40, 4), |  | ||||||
|   |  | ||||||
| -	CCK_GROUP, | -	CCK_GROUP, | ||||||
| +	CCK_GROUP(8), | - | ||||||
|   |  | ||||||
| -	VHT_GROUP(1, 0, BW_20), | -	VHT_GROUP(1, 0, BW_20), | ||||||
| -	VHT_GROUP(2, 0, BW_20), | -	VHT_GROUP(2, 0, BW_20), | ||||||
| -	VHT_GROUP(3, 0, BW_20), | -	VHT_GROUP(3, 0, BW_20), | ||||||
| +	VHT_GROUP(1, 0, BW_20, 5), | - | ||||||
| +	VHT_GROUP(2, 0, BW_20, 4), |  | ||||||
| +	VHT_GROUP(3, 0, BW_20, 4), |  | ||||||
|   |  | ||||||
| -	VHT_GROUP(1, 1, BW_20), | -	VHT_GROUP(1, 1, BW_20), | ||||||
| -	VHT_GROUP(2, 1, BW_20), | -	VHT_GROUP(2, 1, BW_20), | ||||||
| -	VHT_GROUP(3, 1, BW_20), | -	VHT_GROUP(3, 1, BW_20), | ||||||
| +	VHT_GROUP(1, 1, BW_20, 5), | - | ||||||
| +	VHT_GROUP(2, 1, BW_20, 4), |  | ||||||
| +	VHT_GROUP(3, 1, BW_20, 4), |  | ||||||
|   |  | ||||||
| -	VHT_GROUP(1, 0, BW_40), | -	VHT_GROUP(1, 0, BW_40), | ||||||
| -	VHT_GROUP(2, 0, BW_40), | -	VHT_GROUP(2, 0, BW_40), | ||||||
| -	VHT_GROUP(3, 0, BW_40), | -	VHT_GROUP(3, 0, BW_40), | ||||||
| +	VHT_GROUP(1, 0, BW_40, 4), | - | ||||||
| +	VHT_GROUP(2, 0, BW_40, 4), |  | ||||||
| +	VHT_GROUP(3, 0, BW_40, 4), |  | ||||||
|   |  | ||||||
| -	VHT_GROUP(1, 1, BW_40), | -	VHT_GROUP(1, 1, BW_40), | ||||||
| -	VHT_GROUP(2, 1, BW_40), | -	VHT_GROUP(2, 1, BW_40), | ||||||
| -	VHT_GROUP(3, 1, BW_40), | -	VHT_GROUP(3, 1, BW_40), | ||||||
| +	VHT_GROUP(1, 1, BW_40, 4), | - | ||||||
| +	VHT_GROUP(2, 1, BW_40, 4), |  | ||||||
| +	VHT_GROUP(3, 1, BW_40, 4), |  | ||||||
|   |  | ||||||
| -	VHT_GROUP(1, 0, BW_80), | -	VHT_GROUP(1, 0, BW_80), | ||||||
| -	VHT_GROUP(2, 0, BW_80), | -	VHT_GROUP(2, 0, BW_80), | ||||||
| -	VHT_GROUP(3, 0, BW_80), | -	VHT_GROUP(3, 0, BW_80), | ||||||
| +	VHT_GROUP(1, 0, BW_80, 4), | - | ||||||
| +	VHT_GROUP(2, 0, BW_80, 4), |  | ||||||
| +	VHT_GROUP(3, 0, BW_80, 4), |  | ||||||
|   |  | ||||||
| -	VHT_GROUP(1, 1, BW_80), | -	VHT_GROUP(1, 1, BW_80), | ||||||
| -	VHT_GROUP(2, 1, BW_80), | -	VHT_GROUP(2, 1, BW_80), | ||||||
| -	VHT_GROUP(3, 1, BW_80), | -	VHT_GROUP(3, 1, BW_80), | ||||||
|  | +	MCS_GROUP(1, 0, BW_20, 5), | ||||||
|  | +	MCS_GROUP(2, 0, BW_20, 4), | ||||||
|  | +	MCS_GROUP(3, 0, BW_20, 4), | ||||||
|  | + | ||||||
|  | +	MCS_GROUP(1, 1, BW_20, 5), | ||||||
|  | +	MCS_GROUP(2, 1, BW_20, 4), | ||||||
|  | +	MCS_GROUP(3, 1, BW_20, 4), | ||||||
|  | + | ||||||
|  | +	MCS_GROUP(1, 0, BW_40, 4), | ||||||
|  | +	MCS_GROUP(2, 0, BW_40, 4), | ||||||
|  | +	MCS_GROUP(3, 0, BW_40, 4), | ||||||
|  | + | ||||||
|  | +	MCS_GROUP(1, 1, BW_40, 4), | ||||||
|  | +	MCS_GROUP(2, 1, BW_40, 4), | ||||||
|  | +	MCS_GROUP(3, 1, BW_40, 4), | ||||||
|  | + | ||||||
|  | +	CCK_GROUP(8), | ||||||
|  | + | ||||||
|  | +	VHT_GROUP(1, 0, BW_20, 5), | ||||||
|  | +	VHT_GROUP(2, 0, BW_20, 4), | ||||||
|  | +	VHT_GROUP(3, 0, BW_20, 4), | ||||||
|  | + | ||||||
|  | +	VHT_GROUP(1, 1, BW_20, 5), | ||||||
|  | +	VHT_GROUP(2, 1, BW_20, 4), | ||||||
|  | +	VHT_GROUP(3, 1, BW_20, 4), | ||||||
|  | + | ||||||
|  | +	VHT_GROUP(1, 0, BW_40, 4), | ||||||
|  | +	VHT_GROUP(2, 0, BW_40, 4), | ||||||
|  | +	VHT_GROUP(3, 0, BW_40, 4), | ||||||
|  | + | ||||||
|  | +	VHT_GROUP(1, 1, BW_40, 4), | ||||||
|  | +	VHT_GROUP(2, 1, BW_40, 4), | ||||||
|  | +	VHT_GROUP(3, 1, BW_40, 4), | ||||||
|  | + | ||||||
|  | +	VHT_GROUP(1, 0, BW_80, 4), | ||||||
|  | +	VHT_GROUP(2, 0, BW_80, 4), | ||||||
|  | +	VHT_GROUP(3, 0, BW_80, 4), | ||||||
|  | + | ||||||
| +	VHT_GROUP(1, 1, BW_80, 4), | +	VHT_GROUP(1, 1, BW_80, 4), | ||||||
| +	VHT_GROUP(2, 1, BW_80, 4), | +	VHT_GROUP(2, 1, BW_80, 4), | ||||||
| +	VHT_GROUP(3, 1, BW_80, 4), | +	VHT_GROUP(3, 1, BW_80, 4), | ||||||
|   | |||||||
| @@ -23,7 +23,7 @@ Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk> | |||||||
|  |  | ||||||
| --- a/drivers/net/wireless/ath/ath9k/xmit.c | --- a/drivers/net/wireless/ath/ath9k/xmit.c | ||||||
| +++ b/drivers/net/wireless/ath/ath9k/xmit.c | +++ b/drivers/net/wireless/ath/ath9k/xmit.c | ||||||
| @@ -2930,6 +2930,8 @@ void ath_tx_node_cleanup(struct ath_soft | @@ -2915,6 +2915,8 @@ void ath_tx_node_cleanup(struct ath_soft | ||||||
|  	struct ath_txq *txq; |  	struct ath_txq *txq; | ||||||
|  	int tidno; |  	int tidno; | ||||||
|   |   | ||||||
| @@ -32,7 +32,7 @@ Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk> | |||||||
|  	for (tidno = 0; tidno < IEEE80211_NUM_TIDS; tidno++) { |  	for (tidno = 0; tidno < IEEE80211_NUM_TIDS; tidno++) { | ||||||
|  		tid = ath_node_to_tid(an, tidno); |  		tid = ath_node_to_tid(an, tidno); | ||||||
|  		txq = tid->txq; |  		txq = tid->txq; | ||||||
| @@ -2947,6 +2949,8 @@ void ath_tx_node_cleanup(struct ath_soft | @@ -2932,6 +2934,8 @@ void ath_tx_node_cleanup(struct ath_soft | ||||||
|  		if (!an->sta) |  		if (!an->sta) | ||||||
|  			break; /* just one multicast ath_atx_tid */ |  			break; /* just one multicast ath_atx_tid */ | ||||||
|  	} |  	} | ||||||
|   | |||||||
| @@ -103,8 +103,7 @@ | |||||||
| +		      GFP_KERNEL); | +		      GFP_KERNEL); | ||||||
| +	if (!led) | +	if (!led) | ||||||
| +		return -ENOMEM; | +		return -ENOMEM; | ||||||
|   | + | ||||||
| -	ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, val); |  | ||||||
| +	led->gpio = gpio = (struct gpio_led *) (led + 1); | +	led->gpio = gpio = (struct gpio_led *) (led + 1); | ||||||
| +	_name = (char *) (led->gpio + 1); | +	_name = (char *) (led->gpio + 1); | ||||||
| + | + | ||||||
| @@ -117,7 +116,8 @@ | |||||||
| +	ret = ath_add_led(sc, led); | +	ret = ath_add_led(sc, led); | ||||||
| +	if (unlikely(ret < 0)) | +	if (unlikely(ret < 0)) | ||||||
| +		kfree(led); | +		kfree(led); | ||||||
| + |   | ||||||
|  | -	ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, val); | ||||||
| +	return ret; | +	return ret; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -125,11 +125,11 @@ | |||||||
|  { |  { | ||||||
| -	if (!sc->led_registered) | -	if (!sc->led_registered) | ||||||
| -		return; | -		return; | ||||||
| - |  | ||||||
| -	ath_led_brightness(&sc->led_cdev, LED_OFF); |  | ||||||
| -	led_classdev_unregister(&sc->led_cdev); |  | ||||||
| +	struct ath_led *led; | +	struct ath_led *led; | ||||||
|   |   | ||||||
|  | -	ath_led_brightness(&sc->led_cdev, LED_OFF); | ||||||
|  | -	led_classdev_unregister(&sc->led_cdev); | ||||||
|  | - | ||||||
| -	ath9k_hw_gpio_free(sc->sc_ah, sc->sc_ah->led_pin); | -	ath9k_hw_gpio_free(sc->sc_ah, sc->sc_ah->led_pin); | ||||||
| +	while (!list_empty(&sc->leds)) { | +	while (!list_empty(&sc->leds)) { | ||||||
| +		led = list_first_entry(&sc->leds, struct ath_led, list); | +		led = list_first_entry(&sc->leds, struct ath_led, list); | ||||||
|   | |||||||
| @@ -1,7 +1,5 @@ | |||||||
| Index: backports-2017-11-01/drivers/net/wireless/ath/ath9k/ahb.c | --- a/drivers/net/wireless/ath/ath9k/ahb.c | ||||||
| =================================================================== | +++ b/drivers/net/wireless/ath/ath9k/ahb.c | ||||||
| --- backports-2017-11-01.orig/drivers/net/wireless/ath/ath9k/ahb.c |  | ||||||
| +++ backports-2017-11-01/drivers/net/wireless/ath/ath9k/ahb.c |  | ||||||
| @@ -19,7 +19,15 @@ | @@ -19,7 +19,15 @@ | ||||||
|  #include <linux/nl80211.h> |  #include <linux/nl80211.h> | ||||||
|  #include <linux/platform_device.h> |  #include <linux/platform_device.h> | ||||||
| @@ -310,10 +308,8 @@ Index: backports-2017-11-01/drivers/net/wireless/ath/ath9k/ahb.c | |||||||
|  	}, |  	}, | ||||||
|  	.id_table    = ath9k_platform_id_table, |  	.id_table    = ath9k_platform_id_table, | ||||||
|  }; |  }; | ||||||
| Index: backports-2017-11-01/drivers/net/wireless/ath/ath9k/ath9k.h | --- a/drivers/net/wireless/ath/ath9k/ath9k.h | ||||||
| =================================================================== | +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | ||||||
| --- backports-2017-11-01.orig/drivers/net/wireless/ath/ath9k/ath9k.h |  | ||||||
| +++ backports-2017-11-01/drivers/net/wireless/ath/ath9k/ath9k.h |  | ||||||
| @@ -25,6 +25,7 @@ | @@ -25,6 +25,7 @@ | ||||||
|  #include <linux/time.h> |  #include <linux/time.h> | ||||||
|  #include <linux/hw_random.h> |  #include <linux/hw_random.h> | ||||||
|   | |||||||
| @@ -10,7 +10,7 @@ consider that this patch will not work with older firmwares anymore. to avoid un | |||||||
|  2 files changed, 8 insertions(+), 10 deletions(-) |  2 files changed, 8 insertions(+), 10 deletions(-) | ||||||
| --- a/drivers/net/wireless/ath/ath10k/mac.c | --- a/drivers/net/wireless/ath/ath10k/mac.c | ||||||
| +++ b/drivers/net/wireless/ath/ath10k/mac.c | +++ b/drivers/net/wireless/ath/ath10k/mac.c | ||||||
| @@ -4416,13 +4416,6 @@ static struct ieee80211_sta_vht_cap ath1 | @@ -4415,13 +4415,6 @@ static struct ieee80211_sta_vht_cap ath1 | ||||||
|  		vht_cap.cap |= val; |  		vht_cap.cap |= val; | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
|   | |||||||
| @@ -475,7 +475,7 @@ v13: | |||||||
|  static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = { |  static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = { | ||||||
| --- a/drivers/net/wireless/ath/ath10k/wmi.c | --- a/drivers/net/wireless/ath/ath10k/wmi.c | ||||||
| +++ b/drivers/net/wireless/ath/ath10k/wmi.c | +++ b/drivers/net/wireless/ath/ath10k/wmi.c | ||||||
| @@ -6575,6 +6575,49 @@ ath10k_wmi_op_gen_peer_set_param(struct | @@ -6580,6 +6580,49 @@ ath10k_wmi_op_gen_peer_set_param(struct | ||||||
|  	return skb; |  	return skb; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -525,7 +525,7 @@ v13: | |||||||
|  static struct sk_buff * |  static struct sk_buff * | ||||||
|  ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id, |  ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id, | ||||||
|  			     enum wmi_sta_ps_mode psmode) |  			     enum wmi_sta_ps_mode psmode) | ||||||
| @@ -8076,6 +8119,9 @@ static const struct wmi_ops wmi_ops = { | @@ -8081,6 +8124,9 @@ static const struct wmi_ops wmi_ops = { | ||||||
|  	.fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill, |  	.fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill, | ||||||
|  	.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, |  	.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, | ||||||
|  	.gen_echo = ath10k_wmi_op_gen_echo, |  	.gen_echo = ath10k_wmi_op_gen_echo, | ||||||
| @@ -535,7 +535,7 @@ v13: | |||||||
|  	/* .gen_bcn_tmpl not implemented */ |  	/* .gen_bcn_tmpl not implemented */ | ||||||
|  	/* .gen_prb_tmpl not implemented */ |  	/* .gen_prb_tmpl not implemented */ | ||||||
|  	/* .gen_p2p_go_bcn_ie not implemented */ |  	/* .gen_p2p_go_bcn_ie not implemented */ | ||||||
| @@ -8146,6 +8192,8 @@ static const struct wmi_ops wmi_10_1_ops | @@ -8151,6 +8197,8 @@ static const struct wmi_ops wmi_10_1_ops | ||||||
|  	.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, |  	.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, | ||||||
|  	.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, |  	.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, | ||||||
|  	.gen_echo = ath10k_wmi_op_gen_echo, |  	.gen_echo = ath10k_wmi_op_gen_echo, | ||||||
| @@ -544,7 +544,7 @@ v13: | |||||||
|  	/* .gen_bcn_tmpl not implemented */ |  	/* .gen_bcn_tmpl not implemented */ | ||||||
|  	/* .gen_prb_tmpl not implemented */ |  	/* .gen_prb_tmpl not implemented */ | ||||||
|  	/* .gen_p2p_go_bcn_ie not implemented */ |  	/* .gen_p2p_go_bcn_ie not implemented */ | ||||||
| @@ -8217,6 +8265,8 @@ static const struct wmi_ops wmi_10_2_ops | @@ -8222,6 +8270,8 @@ static const struct wmi_ops wmi_10_2_ops | ||||||
|  	.gen_delba_send = ath10k_wmi_op_gen_delba_send, |  	.gen_delba_send = ath10k_wmi_op_gen_delba_send, | ||||||
|  	.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, |  	.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, | ||||||
|  	.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, |  	.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, | ||||||
| @@ -553,7 +553,7 @@ v13: | |||||||
|  	/* .gen_pdev_enable_adaptive_cca not implemented */ |  	/* .gen_pdev_enable_adaptive_cca not implemented */ | ||||||
|  }; |  }; | ||||||
|   |   | ||||||
| @@ -8287,6 +8337,8 @@ static const struct wmi_ops wmi_10_2_4_o | @@ -8292,6 +8342,8 @@ static const struct wmi_ops wmi_10_2_4_o | ||||||
|  	.gen_pdev_enable_adaptive_cca = |  	.gen_pdev_enable_adaptive_cca = | ||||||
|  		ath10k_wmi_op_gen_pdev_enable_adaptive_cca, |  		ath10k_wmi_op_gen_pdev_enable_adaptive_cca, | ||||||
|  	.get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype, |  	.get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype, | ||||||
| @@ -562,7 +562,7 @@ v13: | |||||||
|  	/* .gen_bcn_tmpl not implemented */ |  	/* .gen_bcn_tmpl not implemented */ | ||||||
|  	/* .gen_prb_tmpl not implemented */ |  	/* .gen_prb_tmpl not implemented */ | ||||||
|  	/* .gen_p2p_go_bcn_ie not implemented */ |  	/* .gen_p2p_go_bcn_ie not implemented */ | ||||||
| @@ -8362,6 +8414,8 @@ static const struct wmi_ops wmi_10_4_ops | @@ -8367,6 +8419,8 @@ static const struct wmi_ops wmi_10_4_ops | ||||||
|  	.gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info, |  	.gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info, | ||||||
|  	.gen_echo = ath10k_wmi_op_gen_echo, |  	.gen_echo = ath10k_wmi_op_gen_echo, | ||||||
|  	.gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config, |  	.gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 John Crispin
					John Crispin