1: ea1432b53884 ! 1: 663bc853d645 wifi: rtl8xxxu: honour the rate of injected frames on gen1 chips @@ Commit message and 54 Mbps, MCS 0/7/8/15 with long and short GI were all received at the requested rate. Frames without a radiotap rate are unchanged.  + Reviewed-by: Ping-Ke Shih  Signed-off-by: Ahmet Zeren   ## drivers/net/wireless/realtek/rtl8xxxu/core.c ## @@ drivers/net/wireless/realtek/rtl8xxxu/core.c: static void rtl8xxxu_dump_action(s } }  -+/* -+ * Use the rate from the radiotap header of an injected frame, if any. -+ * mac80211 has already checked it against what we advertise. -+ */  +static bool rtl8xxxu_tx_rate_inject(struct ieee80211_tx_info *tx_info,  + u32 *rate, bool *sgi)  +{ 2: bdd178e2de81 ! 2: 2924f1afb880 wifi: rtl8xxxu: honour the retry count of injected frames on gen1 chips @@ drivers/net/wireless/realtek/rtl8xxxu/core.c: rtl8xxxu_fill_txdesc_v1(struct iee if (rtl8xxxu_debug & RTL8XXXU_DEBUG_TX) dev_info(dev, "%s: TX rate: %d, pkt size %u\n",  @@ drivers/net/wireless/realtek/rtl8xxxu/core.c: rtl8xxxu_fill_txdesc_v1(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr, - tx_desc->txdw4 |= cpu_to_le32(TXDESC32_USE_DRIVER_RATE | - TXDESC_DISABLE_DATA_FB); -  -+ if (retries >= 0) { -+ tx_desc->txdw5 &= ~cpu_to_le32(TXDESC32_RETRY_LIMIT_MASK); -+ tx_desc->txdw5 |= cpu_to_le32(retries << TXDESC32_RETRY_LIMIT_SHIFT | -+ TXDESC32_RETRY_LIMIT_ENABLE); + if (ieee80211_is_mgmt(hdr->frame_control)) { + tx_desc->txdw5 = cpu_to_le32(rate); + tx_desc->txdw4 |= cpu_to_le32(TXDESC32_USE_DRIVER_RATE); +- tx_desc->txdw5 |= cpu_to_le32(6 << TXDESC32_RETRY_LIMIT_SHIFT); ++ if (retries < 0) ++ retries = 6;  + }  + - /* - * rts_rate is zero if RTS/CTS or CTS to SELF are not enabled - */ ++ if (retries >= 0) { ++ tx_desc->txdw5 |= le32_encode_bits(retries, ++ TXDESC32_RETRY_LIMIT_MASK); + tx_desc->txdw5 |= cpu_to_le32(TXDESC32_RETRY_LIMIT_ENABLE); + } +   @@ drivers/net/wireless/realtek/rtl8xxxu/core.c: static int rtl8xxxu_probe(struct usb_interface *interface, SET_IEEE80211_PERM_ADDR(hw, priv->mac_addr);  hw->extra_tx_headroom = priv->fops->tx_desc_size; -+ /* The TX descriptor retry limit is 6 bits wide */ -+ hw->max_rate_tries = 64; ++ hw->max_rate_tries = TXDESC32_RETRY_LIMIT_MAX + 1; ieee80211_hw_set(hw, SIGNAL_DBM);  /* + + ## drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h ## +@@ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h: struct rtl8xxxu_txdesc40 { + #define TXDESC32_RETRY_LIMIT_ENABLE BIT(17) + #define TXDESC32_RETRY_LIMIT_SHIFT 18 + #define TXDESC32_RETRY_LIMIT_MASK 0x00fc0000 ++#define TXDESC32_RETRY_LIMIT_MAX 63 +  + /* Word 6 */ + #define TXDESC_MAX_AGG_SHIFT 11 3: d2f1945ddae2 ! 3: 80b842ab4647 wifi: rtl8xxxu: honour the bandwidth of injected frames on gen1 chips @@ Commit message arrive at 40 MHz (without this patch: 20 MHz), requested at 20 MHz they stay at 20 MHz.  + Acked-by: Ping-Ke Shih  Signed-off-by: Ahmet Zeren   ## drivers/net/wireless/realtek/rtl8xxxu/core.c ##  @@ drivers/net/wireless/realtek/rtl8xxxu/core.c: rtl8xxxu_fill_txdesc_v1(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr, - u32 rate = 0; u16 seq_number; int retries; -- bool inject; -+ bool inject, bw40; + bool inject; ++ bool bw40;  inject = rtl8xxxu_tx_rate_inject(tx_info, &rate, &sgi); retries = rtl8xxxu_tx_retry_inject(tx_info);