mac80211: refresh patches
authorFelix Fietkau <nbd@nbd.name>
Sun, 14 Feb 2021 18:24:05 +0000 (19:24 +0100)
committerFelix Fietkau <nbd@nbd.name>
Sun, 14 Feb 2021 18:41:07 +0000 (19:41 +0100)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 files changed:
package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch
package/kernel/mac80211/patches/ath/351-ath9k_hw-issue-external-reset-for-QCA955x.patch
package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch
package/kernel/mac80211/patches/ath/530-ath9k_extra_leds.patch
package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch
package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch
package/kernel/mac80211/patches/rt2x00/991-rt2x00-mt7620-differentiate-based-on-SoC-CHIP_VER.patch
package/kernel/mac80211/patches/rt2x00/992-rt2x00-save-survey-for-every-channel-visited.patch
package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
package/kernel/mac80211/patches/subsys/341-mac80211-minstrel_ht-improve-ampdu-length-estimation.patch
package/kernel/mac80211/patches/subsys/349-mac80211-minstrel_ht-significantly-redesign-the-rate.patch

index de6f9d9..55d48da 100644 (file)
@@ -37,7 +37,7 @@
  void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature);
 --- a/local-symbols
 +++ b/local-symbols
  void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature);
 --- a/local-symbols
 +++ b/local-symbols
-@@ -142,6 +142,7 @@ ATH10K_SNOC=
+@@ -143,6 +143,7 @@ ATH10K_SNOC=
  ATH10K_DEBUG=
  ATH10K_DEBUGFS=
  ATH10K_SPECTRAL=
  ATH10K_DEBUG=
  ATH10K_DEBUGFS=
  ATH10K_SPECTRAL=
index 5f265b8..d3248f9 100644 (file)
@@ -29,21 +29,6 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 -              npend = ath9k_hw_numtxpending(ah, i);
 -              if (npend)
 -                      break;
 -              npend = ath9k_hw_numtxpending(ah, i);
 -              if (npend)
 -                      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)
 +              return true;
 +
 +      if (type == ATH9K_RESET_COLD)
 +              return true;
 +
@@ -59,35 +44,47 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +              for (i = 0; i < AR_NUM_QCU; i++) {
 +                      if (ath9k_hw_numtxpending(ah, i))
 +                              return true;
 +              for (i = 0; i < AR_NUM_QCU; i++) {
 +                      if (ath9k_hw_numtxpending(ah, i))
 +                              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)
 +{
 +      int err;
 +static bool ath9k_hw_external_reset(struct ath_hw *ah, int type)
 +{
 +      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))
 +              return true;
 +      if (!ah->external_reset || !ath9k_hw_need_external_reset(ah, type))
 +              return true;
-+
-+      ath_dbg(ath9k_hw_common(ah), RESET,
-+              "reset MAC via external reset\n");
  
 -              REG_WRITE(ah, AR_RTC_RESET, 1);
  
 -              REG_WRITE(ah, AR_RTC_RESET, 1);
++      ath_dbg(ath9k_hw_common(ah), RESET,
++              "reset MAC via external reset\n");
++
 +      err = ah->external_reset();
 +      if (err) {
 +              ath_err(ath9k_hw_common(ah),
 +                      "External reset failed, err=%d\n", err);
 +              return false;
 +      err = ah->external_reset();
 +      if (err) {
 +              ath_err(ath9k_hw_common(ah),
 +                      "External reset failed, err=%d\n", err);
 +              return false;
-       }
++      }
++
 +      if (AR_SREV_9550(ah)) {
 +              REG_WRITE(ah, AR_RTC_RESET, 0);
 +              udelay(10);
 +      if (AR_SREV_9550(ah)) {
 +              REG_WRITE(ah, AR_RTC_RESET, 0);
 +              udelay(10);
-+      }
-+
+       }
 +      REG_WRITE(ah, AR_RTC_RESET, 1);
 +      udelay(10);
 +
 +      REG_WRITE(ah, AR_RTC_RESET, 1);
 +      udelay(10);
 +
index bf87d35..3c9180b 100644 (file)
@@ -82,7 +82,7 @@
        help
 --- a/local-symbols
 +++ b/local-symbols
        help
 --- a/local-symbols
 +++ b/local-symbols
-@@ -85,6 +85,7 @@ ADM8211=
+@@ -86,6 +86,7 @@ ADM8211=
  ATH_COMMON=
  WLAN_VENDOR_ATH=
  ATH_DEBUG=
  ATH_COMMON=
  WLAN_VENDOR_ATH=
  ATH_DEBUG=
index 1f19483..30b6bdc 100644 (file)
 +                    GFP_KERNEL);
 +      if (!led)
 +              return -ENOMEM;
 +                    GFP_KERNEL);
 +      if (!led)
 +              return -ENOMEM;
-+
+-      ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, val);
 +      led->gpio = gpio = (struct gpio_led *) (led + 1);
 +      _name = (char *) (led->gpio + 1);
 +
 +      led->gpio = gpio = (struct gpio_led *) (led + 1);
 +      _name = (char *) (led->gpio + 1);
 +
 +      ret = ath_add_led(sc, led);
 +      if (unlikely(ret < 0))
 +              kfree(led);
 +      ret = ath_add_led(sc, led);
 +      if (unlikely(ret < 0))
 +              kfree(led);
--      ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, val);
++
 +      return ret;
  }
  
 +      return ret;
  }
  
  {
 -      if (!sc->led_registered)
 -              return;
  {
 -      if (!sc->led_registered)
 -              return;
-+      struct ath_led *led;
+-
 -      ath_led_brightness(&sc->led_cdev, LED_OFF);
 -      led_classdev_unregister(&sc->led_cdev);
 -      ath_led_brightness(&sc->led_cdev, LED_OFF);
 -      led_classdev_unregister(&sc->led_cdev);
--
++      struct ath_led *led;
 -      ath9k_hw_gpio_free(sc->sc_ah, sc->sc_ah->led_pin);
 +      while (!list_empty(&sc->leds)) {
 +              led = list_first_entry(&sc->leds, struct ath_led, list);
 -      ath9k_hw_gpio_free(sc->sc_ah, sc->sc_ah->led_pin);
 +      while (!list_empty(&sc->leds)) {
 +              led = list_first_entry(&sc->leds, struct ath_led, list);
index 7e3e123..96187be 100644 (file)
  
 --- a/local-symbols
 +++ b/local-symbols
  
 --- a/local-symbols
 +++ b/local-symbols
-@@ -112,6 +112,7 @@ ATH9K_WOW=
+@@ -113,6 +113,7 @@ ATH9K_WOW=
  ATH9K_RFKILL=
  ATH9K_CHANNEL_CONTEXT=
  ATH9K_PCOEM=
  ATH9K_RFKILL=
  ATH9K_CHANNEL_CONTEXT=
  ATH9K_PCOEM=
index 403d1e5..511cf59 100644 (file)
@@ -114,7 +114,7 @@ v13:
  ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o
 --- a/local-symbols
 +++ b/local-symbols
  ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o
 --- a/local-symbols
 +++ b/local-symbols
-@@ -145,6 +145,7 @@ ATH10K_DEBUG=
+@@ -146,6 +146,7 @@ ATH10K_DEBUG=
  ATH10K_DEBUGFS=
  ATH10K_SPECTRAL=
  ATH10K_THERMAL=
  ATH10K_DEBUGFS=
  ATH10K_SPECTRAL=
  ATH10K_THERMAL=
index e74d9a9..1c52132 100644 (file)
@@ -1,6 +1,6 @@
 --- a/local-symbols
 +++ b/local-symbols
 --- a/local-symbols
 +++ b/local-symbols
-@@ -332,6 +332,7 @@ RT2X00_LIB_FIRMWARE=
+@@ -333,6 +333,7 @@ RT2X00_LIB_FIRMWARE=
  RT2X00_LIB_CRYPTO=
  RT2X00_LIB_LEDS=
  RT2X00_LIB_DEBUGFS=
  RT2X00_LIB_CRYPTO=
  RT2X00_LIB_LEDS=
  RT2X00_LIB_DEBUGFS=
index 3de00b2..c82258c 100644 (file)
 -      rfcsr = rt2800_rfcsr_read(rt2x00dev, 16);
 -      rt2x00_set_field8(&rfcsr, RFCSR16_SDM_MODE_MT7620, 0x80);
 -      rt2800_rfcsr_write(rt2x00dev, 16, rfcsr);
 -      rfcsr = rt2800_rfcsr_read(rt2x00dev, 16);
 -      rt2x00_set_field8(&rfcsr, RFCSR16_SDM_MODE_MT7620, 0x80);
 -      rt2800_rfcsr_write(rt2x00dev, 16, rfcsr);
--
--      rfcsr = rt2800_rfcsr_read(rt2x00dev, 21);
--      rt2x00_set_field8(&rfcsr, RFCSR21_BIT8, 1);
--      rt2800_rfcsr_write(rt2x00dev, 21, rfcsr);
 +      if (rt2800_hw_get_chipver(rt2x00dev) > 1) {
 +              /* Default: XO=20MHz , SDM mode */
 +              rfcsr = rt2800_rfcsr_read(rt2x00dev, 16);
 +              rt2x00_set_field8(&rfcsr, RFCSR16_SDM_MODE_MT7620, 0x80);
 +              rt2800_rfcsr_write(rt2x00dev, 16, rfcsr);
 +      if (rt2800_hw_get_chipver(rt2x00dev) > 1) {
 +              /* Default: XO=20MHz , SDM mode */
 +              rfcsr = rt2800_rfcsr_read(rt2x00dev, 16);
 +              rt2x00_set_field8(&rfcsr, RFCSR16_SDM_MODE_MT7620, 0x80);
 +              rt2800_rfcsr_write(rt2x00dev, 16, rfcsr);
-+
+-      rfcsr = rt2800_rfcsr_read(rt2x00dev, 21);
+-      rt2x00_set_field8(&rfcsr, RFCSR21_BIT8, 1);
+-      rt2800_rfcsr_write(rt2x00dev, 21, rfcsr);
 +              rfcsr = rt2800_rfcsr_read(rt2x00dev, 21);
 +              rt2x00_set_field8(&rfcsr, RFCSR21_BIT8, 1);
 +              rt2800_rfcsr_write(rt2x00dev, 21, rfcsr);
 +              rfcsr = rt2800_rfcsr_read(rt2x00dev, 21);
 +              rt2x00_set_field8(&rfcsr, RFCSR21_BIT8, 1);
 +              rt2800_rfcsr_write(rt2x00dev, 21, rfcsr);
 -      rt2800_rfcsr_write(rt2x00dev, 28, 0x61);
 -      rt2800_rfcsr_write(rt2x00dev, 29, 0xB5);
 -      rt2800_rfcsr_write(rt2x00dev, 43, 0x02);
 -      rt2800_rfcsr_write(rt2x00dev, 28, 0x61);
 -      rt2800_rfcsr_write(rt2x00dev, 29, 0xB5);
 -      rt2800_rfcsr_write(rt2x00dev, 43, 0x02);
--
--      rt2800_rfcsr_write(rt2x00dev, 28, 0x62);
--      rt2800_rfcsr_write(rt2x00dev, 29, 0xAD);
--      rt2800_rfcsr_write(rt2x00dev, 39, 0x80);
 +      if (rt2800_hw_get_chipver(rt2x00dev) > 1) {
 +              rt2800_rfcsr_write(rt2x00dev, 11, 0x21);
 +              if (rt2800_clk_is_20mhz(rt2x00dev))
 +      if (rt2800_hw_get_chipver(rt2x00dev) > 1) {
 +              rt2800_rfcsr_write(rt2x00dev, 11, 0x21);
 +              if (rt2800_clk_is_20mhz(rt2x00dev))
 +              rt2800_rfcsr_write(rt2x00dev, 29, 0xB5);
 +              rt2800_rfcsr_write(rt2x00dev, 43, 0x02);
 +      }
 +              rt2800_rfcsr_write(rt2x00dev, 29, 0xB5);
 +              rt2800_rfcsr_write(rt2x00dev, 43, 0x02);
 +      }
-+
+-      rt2800_rfcsr_write(rt2x00dev, 28, 0x62);
+-      rt2800_rfcsr_write(rt2x00dev, 29, 0xAD);
+-      rt2800_rfcsr_write(rt2x00dev, 39, 0x80);
 +      if (rt2800_hw_get_chipver(rt2x00dev) > 1 &&
 +          rt2800_hw_get_chipeco(rt2x00dev) >= 2) {
 +              rt2800_rfcsr_write(rt2x00dev, 28, 0x62);
 +      if (rt2800_hw_get_chipver(rt2x00dev) > 1 &&
 +          rt2800_hw_get_chipeco(rt2x00dev) >= 2) {
 +              rt2800_rfcsr_write(rt2x00dev, 28, 0x62);
 -      rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0x6B);
 -      rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xF7);
 -      rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x09);
 -      rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0x6B);
 -      rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xF7);
 -      rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x09);
--
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 10, 0x51);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x06);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 19, 0xA7);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 28, 0x2C);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x64);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 8, 0x51);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 9, 0x36);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 11, 0x53);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x16);
--
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x6C);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xFC);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x1F);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x27);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x66);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0x6B);
--
--      /* Initialize RF channel register for DRQFN */
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0xD3);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0xE3);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0xE5);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x28);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x68);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xF7);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x02);
--      rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xC7);
 +      if (rt2800_hw_get_chipver(rt2x00dev) > 1) {
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 9, 0x47);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 10, 0x71);
 +      if (rt2800_hw_get_chipver(rt2x00dev) > 1) {
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 9, 0x47);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 10, 0x71);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xF7);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x09);
 +      }
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xF7);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x09);
 +      }
-+
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 10, 0x51);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x06);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 19, 0xA7);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 28, 0x2C);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x64);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 8, 0x51);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 9, 0x36);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 11, 0x53);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x16);
 +      if (rt2800_hw_get_chipver(rt2x00dev) > 1 &&
 +          rt2800_hw_get_chipeco(rt2x00dev) >= 2) {
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 10, 0x51);
 +      if (rt2800_hw_get_chipver(rt2x00dev) > 1 &&
 +          rt2800_hw_get_chipeco(rt2x00dev) >= 2) {
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 10, 0x51);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 9, 0x36);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 11, 0x53);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x16);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 9, 0x36);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 11, 0x53);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x16);
-+
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x6C);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xFC);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x1F);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x27);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x66);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0x6B);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x6C);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xFC);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x1F);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x6C);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xFC);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x1F);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x66);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0x6B);
 +      }
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x66);
 +              rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0x6B);
 +      }
-+
+-      /* Initialize RF channel register for DRQFN */
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0xD3);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0xE3);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0xE5);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x28);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x68);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xF7);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x02);
+-      rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xC7);
 +      if (rt2800_hw_get_chippkg(rt2x00dev) == 0 &&
 +          rt2800_hw_get_chipver(rt2x00dev) == 1) {
 +              /* Initialize RF channel register for DRQFN */
 +      if (rt2800_hw_get_chippkg(rt2x00dev) == 0 &&
 +          rt2800_hw_get_chipver(rt2x00dev) == 1) {
 +              /* Initialize RF channel register for DRQFN */
index 31a7bae..205c10b 100644 (file)
 -      idle = rt2800_register_read(rt2x00dev, CH_IDLE_STA);
 -      busy = rt2800_register_read(rt2x00dev, CH_BUSY_STA);
 -      busy_ext = rt2800_register_read(rt2x00dev, CH_BUSY_STA_SEC);
 -      idle = rt2800_register_read(rt2x00dev, CH_IDLE_STA);
 -      busy = rt2800_register_read(rt2x00dev, CH_BUSY_STA);
 -      busy_ext = rt2800_register_read(rt2x00dev, CH_BUSY_STA_SEC);
--
++      survey->channel = &rt2x00dev->bands[band].channels[idx];
 -      if (idle || busy) {
 -              survey->filled = SURVEY_INFO_TIME |
 -                               SURVEY_INFO_TIME_BUSY |
 -                               SURVEY_INFO_TIME_EXT_BUSY;
 -      if (idle || busy) {
 -              survey->filled = SURVEY_INFO_TIME |
 -                               SURVEY_INFO_TIME_BUSY |
 -                               SURVEY_INFO_TIME_EXT_BUSY;
--
++      survey->filled = SURVEY_INFO_TIME |
++                       SURVEY_INFO_TIME_BUSY |
++                       SURVEY_INFO_TIME_EXT_BUSY;
 -              survey->time = (idle + busy) / 1000;
 -              survey->time_busy = busy / 1000;
 -              survey->time_ext_busy = busy_ext / 1000;
 -      }
 -              survey->time = (idle + busy) / 1000;
 -              survey->time_busy = busy / 1000;
 -              survey->time_ext_busy = busy_ext / 1000;
 -      }
-+      survey->channel = &rt2x00dev->bands[band].channels[idx];
-+
-+      survey->filled = SURVEY_INFO_TIME |
-+                       SURVEY_INFO_TIME_BUSY |
-+                       SURVEY_INFO_TIME_EXT_BUSY;
-+
 +      survey->time = div_u64(chan_survey->time_idle + chan_survey->time_busy, 1000);
 +      survey->time_busy = div_u64(chan_survey->time_busy, 1000);
 +      survey->time_ext_busy = div_u64(chan_survey->time_ext_busy, 1000);
 +      survey->time = div_u64(chan_survey->time_idle + chan_survey->time_busy, 1000);
 +      survey->time_busy = div_u64(chan_survey->time_busy, 1000);
 +      survey->time_ext_busy = div_u64(chan_survey->time_ext_busy, 1000);
index 7b036e4..ac78e62 100644 (file)
  #define AES_CCM_H
  
 -#include "aead_api.h"
  #define AES_CCM_H
  
 -#include "aead_api.h"
-+#include <linux/crypto.h>
+-
 -#define CCM_AAD_LEN   32
 -
 -static inline struct crypto_aead *
 -#define CCM_AAD_LEN   32
 -
 -static inline struct crypto_aead *
 -                          be16_to_cpup((__be16 *)aad),
 -                          data, data_len, mic);
 -}
 -                          be16_to_cpup((__be16 *)aad),
 -                          data, data_len, mic);
 -}
--
++#include <linux/crypto.h>
 -static inline void ieee80211_aes_key_free(struct crypto_aead *tfm)
 -{
 -      return aead_key_free(tfm);
 -static inline void ieee80211_aes_key_free(struct crypto_aead *tfm)
 -{
 -      return aead_key_free(tfm);
  #define AES_GCM_H
  
 -#include "aead_api.h"
  #define AES_GCM_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,
 -                                          u8 *j_0, u8 *aad,  u8 *data,
 -                                          size_t data_len, u8 *mic)
 -static inline int ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm,
 -                                          u8 *j_0, u8 *aad,  u8 *data,
 -                                          size_t data_len, u8 *mic)
index a8e6e89..f450ca9 100644 (file)
@@ -27,7 +27,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 -      if (!mi->avg_ampdu_len)
 -              return AVG_AMPDU_SIZE;
 +      int duration;
 -      if (!mi->avg_ampdu_len)
 -              return AVG_AMPDU_SIZE;
 +      int duration;
-+
+-      return MINSTREL_TRUNC(mi->avg_ampdu_len);
 +      if (mi->avg_ampdu_len)
 +              return MINSTREL_TRUNC(mi->avg_ampdu_len);
 +
 +      if (mi->avg_ampdu_len)
 +              return MINSTREL_TRUNC(mi->avg_ampdu_len);
 +
@@ -35,8 +36,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +              return 1;
 +
 +      duration = minstrel_get_duration(mi->max_tp_rate[0]);
 +              return 1;
 +
 +      duration = minstrel_get_duration(mi->max_tp_rate[0]);
--      return MINSTREL_TRUNC(mi->avg_ampdu_len);
++
 +      if (duration > 400 * 1000)
 +              return 2;
 +
 +      if (duration > 400 * 1000)
 +              return 2;
 +
index 09f6fd2..7af1366 100644 (file)
@@ -179,14 +179,14 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +      if (!rate)
                return;
 -      }
 +      if (!rate)
                return;
 -      }
--
 -      i = 0;
 -      if (n_rates > 1) {
 -              random = prandom_u32();
 -              i = random % n_rates;
 -      }
 -      probe_rate = rates[i];
 -      i = 0;
 -      if (n_rates > 1) {
 -              random = prandom_u32();
 -              i = random % n_rates;
 -      }
 -      probe_rate = rates[i];
+-
 -out:
 -      mi->sample_rate = probe_rate;
 +      mi->sample_rate = rate;
 -out:
 -      mi->sample_rate = probe_rate;
 +      mi->sample_rate = rate;
@@ -584,13 +584,13 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 -
 -      if (!(mi->supported[sample_group] & BIT(sample_idx)))
 -              return -1;
 -
 -      if (!(mi->supported[sample_group] & BIT(sample_idx)))
 -              return -1;
-+      u8 seq;
+-
 -      mrs = &mg->rates[sample_idx];
 -      sample_idx += MI_RATE(sample_group, 0);
 -
 -      tp_rate1 = mi->max_tp_rate[0];
 -      mrs = &mg->rates[sample_idx];
 -      sample_idx += MI_RATE(sample_group, 0);
 -
 -      tp_rate1 = mi->max_tp_rate[0];
--
++      u8 seq;
 -      /* Set tp_rate2 to the second highest max_tp_rate */
 -      if (minstrel_get_duration(mi->max_tp_rate[0]) >
 -          minstrel_get_duration(mi->max_tp_rate[1])) {
 -      /* Set tp_rate2 to the second highest max_tp_rate */
 -      if (minstrel_get_duration(mi->max_tp_rate[0]) >
 -          minstrel_get_duration(mi->max_tp_rate[1])) {
@@ -673,7 +673,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 -      else
 -              sample_idx = minstrel_get_sample_rate(mp, mi);
 +              return;
 -      else
 -              sample_idx = minstrel_get_sample_rate(mp, mi);
 +              return;
-+
+-      if (sample_idx < 0)
 +      if (mp->hw->max_rates == 1 && mp->sample_switch &&
 +          (mi->total_packets_cur >= SAMPLE_SWITCH_THR ||
 +           mp->sample_switch == 1))
 +      if (mp->hw->max_rates == 1 && mp->sample_switch &&
 +          (mi->total_packets_cur >= SAMPLE_SWITCH_THR ||
 +           mp->sample_switch == 1))
@@ -681,8 +682,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +
 +      if (time_is_before_jiffies(mi->sample_time))
 +              return;
 +
 +      if (time_is_before_jiffies(mi->sample_time))
 +              return;
--      if (sample_idx < 0)
++
 +      mi->sample_time = jiffies + MINSTREL_SAMPLE_INTERVAL;
 +      sample_idx = minstrel_ht_get_sample_rate(mp, mi);
 +      if (!sample_idx)
 +      mi->sample_time = jiffies + MINSTREL_SAMPLE_INTERVAL;
 +      sample_idx = minstrel_ht_get_sample_rate(mp, mi);
 +      if (!sample_idx)