From patchwork Wed May 6 21:31:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 1284784 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=hauke-m.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=YoUrbZbE; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49HVF74tdJz9sRf for ; Thu, 7 May 2020 07:32:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5onl4FG2vVFvL9NGhQL6wCYMkO3lzVd4wzerLr8zmzw=; b=YoUrbZbE8Tfs0g rTZL3Wv2nBbhr5mcQwe/Cnqg0AQLkoEx8NIRf/Q+EKKLSqSF7QI3AJYCqrP3eMdvSBMpYcKCa0yU/ FxdmKdRzkIacArKgevdTjIW9gxJ5IWgRCiMdPvE9w1Q/ulFSK1oINQhoOWqGldCH/o7CPyAIUga97 CbMErNJjMTje0rJL95qBiLJcRXup0xpoSjW9kQ6A53b1OLWEfVr0yaqeNHHJA8sj+JM50xXdAtiCK 0HZcvQx/qtps0sWqv5ZFzTGO6ozT/yBxo+CBMUgMUoJZI770Fh8uGvPnhvNUZ4+spQfcPWNTclX00 IDGZAW/CHoYl8OdROIYA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWRex-0000cJ-73; Wed, 06 May 2020 21:32:55 +0000 Received: from mout-p-201.mailbox.org ([2001:67c:2050::465:201]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWReA-0008EK-Kr for openwrt-devel@lists.openwrt.org; Wed, 06 May 2020 21:32:11 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 49HVCp2V19zQl9T; Wed, 6 May 2020 23:31:50 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id wLs7me7EC_bH; Wed, 6 May 2020 23:31:45 +0200 (CEST) From: Hauke Mehrtens To: openwrt-devel@lists.openwrt.org Date: Wed, 6 May 2020 23:31:27 +0200 Message-Id: <20200506213130.15898-2-hauke@hauke-m.de> In-Reply-To: <20200506213130.15898-1-hauke@hauke-m.de> References: <20200506213130.15898-1-hauke@hauke-m.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 69254178B X-Rspamd-Score: -3.91 / 15.00 / 15.00 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200506_143207_005929_0D34C994 X-CRM114-Status: GOOD ( 18.57 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record Subject: [OpenWrt-Devel] [PATCH v2 1/4] mac80211: Update to version 5.4.36-1 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hauke@hauke-m.de, foss@volatilesystems.org, koen.vandeputte@ncentric.com, nbd@nbd.name Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This updates the mac80211 backport to the latest minor version. The removed patch was a backport from the upstream kernel which is now integrated. Signed-off-by: Hauke Mehrtens --- package/kernel/mac80211/Makefile | 8 +- ...-F2-blocksize-and-watermark-for-4359.patch | 2 +- .../subsys/140-tweak-TSQ-setting.patch | 2 +- .../subsys/150-disable_addr_notifier.patch | 8 +- .../300-mac80211-optimize-skb-resizing.patch | 10 +- ...l-remove-divisions-in-tx-status-path.patch | 4 +- ...l_ht-replace-rate-stats-ewma-with-a-.patch | 8 +- ...l_ht-rename-prob_ewma-to-prob_avg-us.patch | 2 +- ...ore-skb-ack-code-to-its-own-function.patch | 4 +- ...the-size-of-ack_frame_id-to-make-roo.patch | 2 +- ...new-sta_info-getter-by-sta-vif-addrs.patch | 2 +- ...t-airtime-calculation-code-from-mt76.patch | 2 +- ...lement-Airtime-based-Queue-Limit-AQL.patch | 16 +- ...time-based-Queue-Limits-AQL-on-packe.patch | 4 +- ...Turn-AQL-into-an-NL80211_EXT_FEATURE.patch | 22 +-- ...ta-frames-without-key-on-encrypted-l.patch | 148 ------------------ .../500-mac80211_configure_antenna_gain.patch | 4 +- 17 files changed, 50 insertions(+), 198 deletions(-) delete mode 100644 package/kernel/mac80211/patches/subsys/314-mac80211-drop-data-frames-without-key-on-encrypted-l.patch diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 26c5ef4b1a37..901c08b0de62 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=5.4.27-1 -PKG_RELEASE:=3 -PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.4.27/ -PKG_HASH:=4c853a2f4c4fcc81cf60a3d59c5efbdb60c3e4acda22996cb192443581753950 +PKG_VERSION:=5.4.36-1 +PKG_RELEASE:=1 +PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.4.36/ +PKG_HASH:=5b39734986fba3b9c24c521d0499a2dc9cb17267bb58c02d9a520205add2d16b PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION) diff --git a/package/kernel/mac80211/patches/brcm/114-v5.6-0002-brcmfmac-set-F2-blocksize-and-watermark-for-4359.patch b/package/kernel/mac80211/patches/brcm/114-v5.6-0002-brcmfmac-set-F2-blocksize-and-watermark-for-4359.patch index bdfe2ae85f73..37ba7f360b3e 100644 --- a/package/kernel/mac80211/patches/brcm/114-v5.6-0002-brcmfmac-set-F2-blocksize-and-watermark-for-4359.patch +++ b/package/kernel/mac80211/patches/brcm/114-v5.6-0002-brcmfmac-set-F2-blocksize-and-watermark-for-4359.patch @@ -57,7 +57,7 @@ Signed-off-by: Kalle Valo #ifdef DEBUG -@@ -4206,6 +4208,19 @@ static void brcmf_sdio_firmware_callback +@@ -4208,6 +4210,19 @@ static void brcmf_sdio_firmware_callback brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl, &err); break; diff --git a/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch b/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch index 64a92a16f6fd..fa12232f1bac 100644 --- a/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch +++ b/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -4024,6 +4024,12 @@ out: +@@ -4048,6 +4048,12 @@ out: netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, struct net_device *dev) { diff --git a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch index ab845c04e57b..3c5d1d63a860 100644 --- a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch +++ b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch @@ -18,7 +18,7 @@ static int ieee80211_ifa6_changed(struct notifier_block *nb, unsigned long data, void *arg) { -@@ -1264,14 +1264,14 @@ int ieee80211_register_hw(struct ieee802 +@@ -1267,14 +1267,14 @@ int ieee80211_register_hw(struct ieee802 rtnl_unlock(); @@ -35,7 +35,7 @@ local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed; result = register_inet6addr_notifier(&local->ifa6_notifier); if (result) -@@ -1280,13 +1280,13 @@ int ieee80211_register_hw(struct ieee802 +@@ -1283,13 +1283,13 @@ int ieee80211_register_hw(struct ieee802 return 0; @@ -51,8 +51,8 @@ +#if defined(__disabled__CONFIG_INET) || defined(__disabled__CONFIG_IPV6) fail_ifa: #endif - rtnl_lock(); -@@ -1314,10 +1314,10 @@ void ieee80211_unregister_hw(struct ieee + wiphy_unregister(local->hw.wiphy); +@@ -1317,10 +1317,10 @@ void ieee80211_unregister_hw(struct ieee tasklet_kill(&local->tx_pending_tasklet); tasklet_kill(&local->tasklet); diff --git a/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch b/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch index 3847b19547b8..dcdb94565d6d 100644 --- a/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch +++ b/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch @@ -50,7 +50,7 @@ Signed-off-by: Felix Fietkau if (WARN_ON_ONCE(skb_headroom(skb) < rtap_len)) { --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -1937,37 +1937,53 @@ static bool ieee80211_tx(struct ieee8021 +@@ -1943,37 +1943,53 @@ static bool ieee80211_tx(struct ieee8021 } /* device xmit handlers */ @@ -123,7 +123,7 @@ Signed-off-by: Felix Fietkau wiphy_debug(local->hw.wiphy, "failed to reallocate TX buffer\n"); return -ENOMEM; -@@ -1983,18 +1999,8 @@ void ieee80211_xmit(struct ieee80211_sub +@@ -1989,18 +2005,8 @@ void ieee80211_xmit(struct ieee80211_sub struct ieee80211_local *local = sdata->local; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_hdr *hdr; @@ -143,7 +143,7 @@ Signed-off-by: Felix Fietkau ieee80211_free_txskb(&local->hw, skb); return; } -@@ -2784,29 +2790,13 @@ static struct sk_buff *ieee80211_build_h +@@ -2790,29 +2796,13 @@ static struct sk_buff *ieee80211_build_h } skb_pull(skb, skip_header_bytes); @@ -179,7 +179,7 @@ Signed-off-by: Felix Fietkau } if (encaps_data) -@@ -3421,7 +3411,6 @@ static bool ieee80211_xmit_fast(struct i +@@ -3427,7 +3417,6 @@ static bool ieee80211_xmit_fast(struct i struct ieee80211_local *local = sdata->local; u16 ethertype = (skb->data[12] << 8) | skb->data[13]; int extra_head = fast_tx->hdr_len - (ETH_HLEN - 2); @@ -187,7 +187,7 @@ Signed-off-by: Felix Fietkau struct ethhdr eth; struct ieee80211_tx_info *info; struct ieee80211_hdr *hdr = (void *)fast_tx->hdr; -@@ -3473,10 +3462,7 @@ static bool ieee80211_xmit_fast(struct i +@@ -3479,10 +3468,7 @@ static bool ieee80211_xmit_fast(struct i * as the may-encrypt argument for the resize to not account for * more room than we already have in 'extra_head' */ diff --git a/package/kernel/mac80211/patches/subsys/301-mac80211-minstrel-remove-divisions-in-tx-status-path.patch b/package/kernel/mac80211/patches/subsys/301-mac80211-minstrel-remove-divisions-in-tx-status-path.patch index 0bdeded52981..91fb92f1b2b7 100644 --- a/package/kernel/mac80211/patches/subsys/301-mac80211-minstrel-remove-divisions-in-tx-status-path.patch +++ b/package/kernel/mac80211/patches/subsys/301-mac80211-minstrel-remove-divisions-in-tx-status-path.patch @@ -57,5 +57,5 @@ Signed-off-by: Felix Fietkau - mp->update_interval = 100; + mp->update_interval = HZ / 10; - #ifdef CPTCFG_MAC80211_DEBUGFS - mp->fixed_rate_idx = (u32) -1; + minstrel_ht_init_cck_rates(mp); + diff --git a/package/kernel/mac80211/patches/subsys/302-mac80211-minstrel_ht-replace-rate-stats-ewma-with-a-.patch b/package/kernel/mac80211/patches/subsys/302-mac80211-minstrel_ht-replace-rate-stats-ewma-with-a-.patch index bce9e753784a..78e8527a5c90 100644 --- a/package/kernel/mac80211/patches/subsys/302-mac80211-minstrel_ht-replace-rate-stats-ewma-with-a-.patch +++ b/package/kernel/mac80211/patches/subsys/302-mac80211-minstrel_ht-replace-rate-stats-ewma-with-a-.patch @@ -222,14 +222,14 @@ Signed-off-by: Felix Fietkau mp->update_interval = HZ / 10; + mp->new_avg = true; - #ifdef CPTCFG_MAC80211_DEBUGFS - mp->fixed_rate_idx = (u32) -1; -@@ -1672,6 +1679,8 @@ minstrel_ht_alloc(struct ieee80211_hw *h + minstrel_ht_init_cck_rates(mp); + +@@ -1682,6 +1689,8 @@ static void minstrel_ht_add_debugfs(stru &mp->fixed_rate_idx); debugfs_create_u32("sample_switch", S_IRUGO | S_IWUSR, debugfsdir, &mp->sample_switch); + debugfs_create_bool("new_avg", S_IRUGO | S_IWUSR, debugfsdir, + &mp->new_avg); + } #endif - minstrel_ht_init_cck_rates(mp); diff --git a/package/kernel/mac80211/patches/subsys/303-mac80211-minstrel_ht-rename-prob_ewma-to-prob_avg-us.patch b/package/kernel/mac80211/patches/subsys/303-mac80211-minstrel_ht-rename-prob_ewma-to-prob_avg-us.patch index 23419afb12c2..f4c4bdb94e90 100644 --- a/package/kernel/mac80211/patches/subsys/303-mac80211-minstrel_ht-rename-prob_ewma-to-prob_avg-us.patch +++ b/package/kernel/mac80211/patches/subsys/303-mac80211-minstrel_ht-rename-prob_ewma-to-prob_avg-us.patch @@ -379,7 +379,7 @@ Signed-off-by: Felix Fietkau minstrel_get_duration(mi->max_prob_rate) * 3 < sample_dur) return -1; -@@ -1705,7 +1705,7 @@ static u32 minstrel_ht_get_expected_thro +@@ -1711,7 +1711,7 @@ static u32 minstrel_ht_get_expected_thro i = mi->max_tp_rate[0] / MCS_GROUP_RATES; j = mi->max_tp_rate[0] % MCS_GROUP_RATES; diff --git a/package/kernel/mac80211/patches/subsys/306-mac80211-move-store-skb-ack-code-to-its-own-function.patch b/package/kernel/mac80211/patches/subsys/306-mac80211-move-store-skb-ack-code-to-its-own-function.patch index 72e3d842d228..4f0a699c808d 100644 --- a/package/kernel/mac80211/patches/subsys/306-mac80211-move-store-skb-ack-code-to-its-own-function.patch +++ b/package/kernel/mac80211/patches/subsys/306-mac80211-move-store-skb-ack-code-to-its-own-function.patch @@ -13,7 +13,7 @@ Signed-off-by: Johannes Berg --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -2439,6 +2439,33 @@ static int ieee80211_lookup_ra_sta(struc +@@ -2445,6 +2445,33 @@ static int ieee80211_lookup_ra_sta(struc return 0; } @@ -47,7 +47,7 @@ Signed-off-by: Johannes Berg /** * ieee80211_build_hdr - build 802.11 header in the given frame * @sdata: virtual interface to build the header for -@@ -2732,26 +2759,8 @@ static struct sk_buff *ieee80211_build_h +@@ -2738,26 +2765,8 @@ static struct sk_buff *ieee80211_build_h } if (unlikely(!multicast && skb->sk && diff --git a/package/kernel/mac80211/patches/subsys/307-mac80211-Shrink-the-size-of-ack_frame_id-to-make-roo.patch b/package/kernel/mac80211/patches/subsys/307-mac80211-Shrink-the-size-of-ack_frame_id-to-make-roo.patch index 9fe2a924df7a..ff25ceff6e18 100644 --- a/package/kernel/mac80211/patches/subsys/307-mac80211-Shrink-the-size-of-ack_frame_id-to-make-roo.patch +++ b/package/kernel/mac80211/patches/subsys/307-mac80211-Shrink-the-size-of-ack_frame_id-to-make-roo.patch @@ -56,7 +56,7 @@ Signed-off-by: Johannes Berg if (id < 0) { --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -2452,7 +2452,7 @@ static int ieee80211_store_ack_skb(struc +@@ -2458,7 +2458,7 @@ static int ieee80211_store_ack_skb(struc spin_lock_irqsave(&local->ack_status_lock, flags); id = idr_alloc(&local->ack_status_frames, ack_skb, diff --git a/package/kernel/mac80211/patches/subsys/308-mac80211-Add-new-sta_info-getter-by-sta-vif-addrs.patch b/package/kernel/mac80211/patches/subsys/308-mac80211-Add-new-sta_info-getter-by-sta-vif-addrs.patch index 75558faac79f..a6b05f4b7497 100644 --- a/package/kernel/mac80211/patches/subsys/308-mac80211-Add-new-sta_info-getter-by-sta-vif-addrs.patch +++ b/package/kernel/mac80211/patches/subsys/308-mac80211-Add-new-sta_info-getter-by-sta-vif-addrs.patch @@ -41,7 +41,7 @@ Signed-off-by: Johannes Berg { --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h -@@ -725,6 +725,10 @@ struct sta_info *sta_info_get(struct iee +@@ -726,6 +726,10 @@ struct sta_info *sta_info_get(struct iee struct sta_info *sta_info_get_bss(struct ieee80211_sub_if_data *sdata, const u8 *addr); diff --git a/package/kernel/mac80211/patches/subsys/309-mac80211-Import-airtime-calculation-code-from-mt76.patch b/package/kernel/mac80211/patches/subsys/309-mac80211-Import-airtime-calculation-code-from-mt76.patch index 7bfe299cf483..7f049b8d0cc9 100644 --- a/package/kernel/mac80211/patches/subsys/309-mac80211-Import-airtime-calculation-code-from-mt76.patch +++ b/package/kernel/mac80211/patches/subsys/309-mac80211-Import-airtime-calculation-code-from-mt76.patch @@ -29,7 +29,7 @@ Signed-off-by: Johannes Berg --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -6417,4 +6417,33 @@ void ieee80211_nan_func_match(struct iee +@@ -6419,4 +6419,33 @@ void ieee80211_nan_func_match(struct iee struct cfg80211_nan_match_params *match, gfp_t gfp); diff --git a/package/kernel/mac80211/patches/subsys/310-mac80211-Implement-Airtime-based-Queue-Limit-AQL.patch b/package/kernel/mac80211/patches/subsys/310-mac80211-Implement-Airtime-based-Queue-Limit-AQL.patch index 690d57cb120e..b76286d15c68 100644 --- a/package/kernel/mac80211/patches/subsys/310-mac80211-Implement-Airtime-based-Queue-Limit-AQL.patch +++ b/package/kernel/mac80211/patches/subsys/310-mac80211-Implement-Airtime-based-Queue-Limit-AQL.patch @@ -182,7 +182,7 @@ Signed-off-by: Johannes Berg /* if the dir failed, don't put all the other things into the root! */ --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c -@@ -197,10 +197,12 @@ static ssize_t sta_airtime_read(struct f +@@ -198,10 +198,12 @@ static ssize_t sta_airtime_read(struct f { struct sta_info *sta = file->private_data; struct ieee80211_local *local = sta->sdata->local; @@ -196,7 +196,7 @@ Signed-off-by: Johannes Berg ssize_t rv; int ac; -@@ -212,19 +214,22 @@ static ssize_t sta_airtime_read(struct f +@@ -213,19 +215,22 @@ static ssize_t sta_airtime_read(struct f rx_airtime += sta->airtime[ac].rx_airtime; tx_airtime += sta->airtime[ac].tx_airtime; deficit[ac] = sta->airtime[ac].deficit; @@ -227,7 +227,7 @@ Signed-off-by: Johannes Berg rv = simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); kfree(buf); -@@ -236,7 +241,25 @@ static ssize_t sta_airtime_write(struct +@@ -237,7 +242,25 @@ static ssize_t sta_airtime_write(struct { struct sta_info *sta = file->private_data; struct ieee80211_local *local = sta->sdata->local; @@ -299,7 +299,7 @@ Signed-off-by: Johannes Berg } for (i = 0; i < IEEE80211_NUM_TIDS; i++) -@@ -1908,6 +1911,41 @@ void ieee80211_sta_register_airtime(stru +@@ -1913,6 +1916,41 @@ void ieee80211_sta_register_airtime(stru } EXPORT_SYMBOL(ieee80211_sta_register_airtime); @@ -343,7 +343,7 @@ Signed-off-by: Johannes Berg { --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h -@@ -127,13 +127,21 @@ enum ieee80211_agg_stop_reason { +@@ -128,13 +128,21 @@ enum ieee80211_agg_stop_reason { /* Debugfs flags to enable/disable use of RX/TX airtime in scheduler */ #define AIRTIME_USE_TX BIT(0) #define AIRTIME_USE_RX BIT(1) @@ -367,7 +367,7 @@ Signed-off-by: Johannes Berg /** --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -3676,7 +3676,8 @@ struct ieee80211_txq *ieee80211_next_txq +@@ -3700,7 +3700,8 @@ struct ieee80211_txq *ieee80211_next_txq { struct ieee80211_local *local = hw_to_local(hw); struct ieee80211_txq *ret = NULL; @@ -377,7 +377,7 @@ Signed-off-by: Johannes Berg spin_lock_bh(&local->active_txq_lock[ac]); -@@ -3687,13 +3688,30 @@ struct ieee80211_txq *ieee80211_next_txq +@@ -3711,13 +3712,30 @@ struct ieee80211_txq *ieee80211_next_txq if (!txqi) goto out; @@ -410,7 +410,7 @@ Signed-off-by: Johannes Berg list_move_tail(&txqi->schedule_order, &local->active_txqs[txqi->txq.ac]); goto begin; -@@ -3747,6 +3765,33 @@ void __ieee80211_schedule_txq(struct iee +@@ -3771,6 +3789,33 @@ void __ieee80211_schedule_txq(struct iee } EXPORT_SYMBOL(__ieee80211_schedule_txq); diff --git a/package/kernel/mac80211/patches/subsys/311-mac80211-Use-Airtime-based-Queue-Limits-AQL-on-packe.patch b/package/kernel/mac80211/patches/subsys/311-mac80211-Use-Airtime-based-Queue-Limits-AQL-on-packe.patch index 103fc4fd52da..a0548d9d057a 100644 --- a/package/kernel/mac80211/patches/subsys/311-mac80211-Use-Airtime-based-Queue-Limits-AQL-on-packe.patch +++ b/package/kernel/mac80211/patches/subsys/311-mac80211-Use-Airtime-based-Queue-Limits-AQL-on-packe.patch @@ -112,7 +112,7 @@ Signed-off-by: Johannes Berg if (sta->status_stats.lost_packets) --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -3553,6 +3553,9 @@ struct sk_buff *ieee80211_tx_dequeue(str +@@ -3559,6 +3559,9 @@ struct sk_buff *ieee80211_tx_dequeue(str WARN_ON_ONCE(softirq_count() == 0); @@ -122,7 +122,7 @@ Signed-off-by: Johannes Berg begin: spin_lock_bh(&fq->lock); -@@ -3663,6 +3666,21 @@ begin: +@@ -3687,6 +3690,21 @@ begin: } IEEE80211_SKB_CB(skb)->control.vif = vif; diff --git a/package/kernel/mac80211/patches/subsys/313-mac80211-Turn-AQL-into-an-NL80211_EXT_FEATURE.patch b/package/kernel/mac80211/patches/subsys/313-mac80211-Turn-AQL-into-an-NL80211_EXT_FEATURE.patch index 9129560f2410..389f2ae225eb 100644 --- a/package/kernel/mac80211/patches/subsys/313-mac80211-Turn-AQL-into-an-NL80211_EXT_FEATURE.patch +++ b/package/kernel/mac80211/patches/subsys/313-mac80211-Turn-AQL-into-an-NL80211_EXT_FEATURE.patch @@ -64,7 +64,7 @@ Signed-off-by: Johannes Berg NUM_NL80211_EXT_FEATURES, --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c -@@ -201,8 +201,6 @@ static ssize_t sta_airtime_read(struct f +@@ -202,8 +202,6 @@ static ssize_t sta_airtime_read(struct f char *buf = kzalloc(bufsz, GFP_KERNEL), *p = buf; u64 rx_airtime = 0, tx_airtime = 0; s64 deficit[IEEE80211_NUM_ACS]; @@ -73,7 +73,7 @@ Signed-off-by: Johannes Berg ssize_t rv; int ac; -@@ -214,6 +212,56 @@ static ssize_t sta_airtime_read(struct f +@@ -215,6 +213,56 @@ static ssize_t sta_airtime_read(struct f rx_airtime += sta->airtime[ac].rx_airtime; tx_airtime += sta->airtime[ac].tx_airtime; deficit[ac] = sta->airtime[ac].deficit; @@ -130,7 +130,7 @@ Signed-off-by: Johannes Berg q_limit_l[ac] = sta->airtime[ac].aql_limit_low; q_limit_h[ac] = sta->airtime[ac].aql_limit_high; spin_unlock_bh(&local->active_txq_lock[ac]); -@@ -221,12 +269,8 @@ static ssize_t sta_airtime_read(struct f +@@ -222,12 +270,8 @@ static ssize_t sta_airtime_read(struct f } p += scnprintf(p, bufsz + buf - p, @@ -143,7 +143,7 @@ Signed-off-by: Johannes Berg q_depth[0], q_depth[1], q_depth[2], q_depth[3], q_limit_l[0], q_limit_h[0], q_limit_l[1], q_limit_h[1], q_limit_l[2], q_limit_h[2], q_limit_l[3], q_limit_h[3]), -@@ -236,11 +280,10 @@ static ssize_t sta_airtime_read(struct f +@@ -237,11 +281,10 @@ static ssize_t sta_airtime_read(struct f return rv; } @@ -156,7 +156,7 @@ Signed-off-by: Johannes Berg u32 ac, q_limit_l, q_limit_h; char _buf[100] = {}, *buf = _buf; -@@ -251,7 +294,7 @@ static ssize_t sta_airtime_write(struct +@@ -252,7 +295,7 @@ static ssize_t sta_airtime_write(struct return -EFAULT; buf[sizeof(_buf) - 1] = '\0'; @@ -165,7 +165,7 @@ Signed-off-by: Johannes Berg != 3) return -EINVAL; -@@ -261,17 +304,10 @@ static ssize_t sta_airtime_write(struct +@@ -262,17 +305,10 @@ static ssize_t sta_airtime_write(struct sta->airtime[ac].aql_limit_low = q_limit_l; sta->airtime[ac].aql_limit_high = q_limit_h; @@ -185,7 +185,7 @@ Signed-off-by: Johannes Berg static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) -@@ -1001,6 +1037,10 @@ void ieee80211_sta_debugfs_add(struct st +@@ -1002,6 +1038,10 @@ void ieee80211_sta_debugfs_add(struct st NL80211_EXT_FEATURE_AIRTIME_FAIRNESS)) DEBUGFS_ADD(airtime); @@ -211,7 +211,7 @@ Signed-off-by: Johannes Berg --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c -@@ -1917,6 +1917,9 @@ void ieee80211_sta_update_pending_airtim +@@ -1922,6 +1922,9 @@ void ieee80211_sta_update_pending_airtim { int tx_pending; @@ -223,7 +223,7 @@ Signed-off-by: Johannes Berg atomic_add(tx_airtime, --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h -@@ -127,7 +127,6 @@ enum ieee80211_agg_stop_reason { +@@ -128,7 +128,6 @@ enum ieee80211_agg_stop_reason { /* Debugfs flags to enable/disable use of RX/TX airtime in scheduler */ #define AIRTIME_USE_TX BIT(0) #define AIRTIME_USE_RX BIT(1) @@ -233,7 +233,7 @@ Signed-off-by: Johannes Berg u64 rx_airtime; --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -3667,7 +3667,7 @@ begin: +@@ -3691,7 +3691,7 @@ begin: IEEE80211_SKB_CB(skb)->control.vif = vif; @@ -242,7 +242,7 @@ Signed-off-by: Johannes Berg u32 airtime; airtime = ieee80211_calc_expected_tx_airtime(hw, vif, txq->sta, -@@ -3789,7 +3789,7 @@ bool ieee80211_txq_airtime_check(struct +@@ -3813,7 +3813,7 @@ bool ieee80211_txq_airtime_check(struct struct sta_info *sta; struct ieee80211_local *local = hw_to_local(hw); diff --git a/package/kernel/mac80211/patches/subsys/314-mac80211-drop-data-frames-without-key-on-encrypted-l.patch b/package/kernel/mac80211/patches/subsys/314-mac80211-drop-data-frames-without-key-on-encrypted-l.patch deleted file mode 100644 index 54e09af3b3a1..000000000000 --- a/package/kernel/mac80211/patches/subsys/314-mac80211-drop-data-frames-without-key-on-encrypted-l.patch +++ /dev/null @@ -1,148 +0,0 @@ -From a0761a301746ec2d92d7fcb82af69c0a6a4339aa Mon Sep 17 00:00:00 2001 -From: Johannes Berg -Date: Thu, 26 Mar 2020 15:09:42 +0200 -Subject: mac80211: drop data frames without key on encrypted links - -If we know that we have an encrypted link (based on having had -a key configured for TX in the past) then drop all data frames -in the key selection handler if there's no key anymore. - -This fixes an issue with mac80211 internal TXQs - there we can -buffer frames for an encrypted link, but then if the key is no -longer there when they're dequeued, the frames are sent without -encryption. This happens if a station is disconnected while the -frames are still on the TXQ. - -Detecting that a link should be encrypted based on a first key -having been configured for TX is fine as there are no use cases -for a connection going from with encryption to no encryption. -With extended key IDs, however, there is a case of having a key -configured for only decryption, so we can't just trigger this -behaviour on a key being configured. - -Cc: stable@vger.kernel.org -Reported-by: Jouni Malinen -Signed-off-by: Johannes Berg -Signed-off-by: Luca Coelho ---- - net/mac80211/debugfs_sta.c | 3 ++- - net/mac80211/key.c | 20 ++++++++++++-------- - net/mac80211/sta_info.h | 1 + - net/mac80211/tx.c | 12 +++++++++--- - 4 files changed, 24 insertions(+), 12 deletions(-) - ---- a/net/mac80211/debugfs_sta.c -+++ b/net/mac80211/debugfs_sta.c -@@ -5,7 +5,7 @@ - * Copyright 2007 Johannes Berg - * Copyright 2013-2014 Intel Mobile Communications GmbH - * Copyright(c) 2016 Intel Deutschland GmbH -- * Copyright (C) 2018 - 2019 Intel Corporation -+ * Copyright (C) 2018 - 2020 Intel Corporation - */ - - #include -@@ -78,6 +78,7 @@ static const char * const sta_flag_names - FLAG(MPSP_OWNER), - FLAG(MPSP_RECIPIENT), - FLAG(PS_DELIVER), -+ FLAG(USES_ENCRYPTION), - #undef FLAG - }; - ---- a/net/mac80211/key.c -+++ b/net/mac80211/key.c -@@ -6,7 +6,7 @@ - * Copyright 2007-2008 Johannes Berg - * Copyright 2013-2014 Intel Mobile Communications GmbH - * Copyright 2015-2017 Intel Deutschland GmbH -- * Copyright 2018-2019 Intel Corporation -+ * Copyright 2018-2020 Intel Corporation - */ - - #include -@@ -262,22 +262,29 @@ static void ieee80211_key_disable_hw_acc - sta ? sta->sta.addr : bcast_addr, ret); - } - --int ieee80211_set_tx_key(struct ieee80211_key *key) -+static int _ieee80211_set_tx_key(struct ieee80211_key *key, bool force) - { - struct sta_info *sta = key->sta; - struct ieee80211_local *local = key->local; - - assert_key_lock(local); - -+ set_sta_flag(sta, WLAN_STA_USES_ENCRYPTION); -+ - sta->ptk_idx = key->conf.keyidx; - -- if (!ieee80211_hw_check(&local->hw, AMPDU_KEYBORDER_SUPPORT)) -+ if (force || !ieee80211_hw_check(&local->hw, AMPDU_KEYBORDER_SUPPORT)) - clear_sta_flag(sta, WLAN_STA_BLOCK_BA); - ieee80211_check_fast_xmit(sta); - - return 0; - } - -+int ieee80211_set_tx_key(struct ieee80211_key *key) -+{ -+ return _ieee80211_set_tx_key(key, false); -+} -+ - static void ieee80211_pairwise_rekey(struct ieee80211_key *old, - struct ieee80211_key *new) - { -@@ -441,11 +448,8 @@ static int ieee80211_key_replace(struct - if (pairwise) { - rcu_assign_pointer(sta->ptk[idx], new); - if (new && -- !(new->conf.flags & IEEE80211_KEY_FLAG_NO_AUTO_TX)) { -- sta->ptk_idx = idx; -- clear_sta_flag(sta, WLAN_STA_BLOCK_BA); -- ieee80211_check_fast_xmit(sta); -- } -+ !(new->conf.flags & IEEE80211_KEY_FLAG_NO_AUTO_TX)) -+ _ieee80211_set_tx_key(new, true); - } else { - rcu_assign_pointer(sta->gtk[idx], new); - } ---- a/net/mac80211/sta_info.h -+++ b/net/mac80211/sta_info.h -@@ -98,6 +98,7 @@ enum ieee80211_sta_info_flags { - WLAN_STA_MPSP_OWNER, - WLAN_STA_MPSP_RECIPIENT, - WLAN_STA_PS_DELIVER, -+ WLAN_STA_USES_ENCRYPTION, - - NUM_WLAN_STA_FLAGS, - }; ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -590,10 +590,13 @@ ieee80211_tx_h_select_key(struct ieee802 - struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; - -- if (unlikely(info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT)) -+ if (unlikely(info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT)) { - tx->key = NULL; -- else if (tx->sta && -- (key = rcu_dereference(tx->sta->ptk[tx->sta->ptk_idx]))) -+ return TX_CONTINUE; -+ } -+ -+ if (tx->sta && -+ (key = rcu_dereference(tx->sta->ptk[tx->sta->ptk_idx]))) - tx->key = key; - else if (ieee80211_is_group_privacy_action(tx->skb) && - (key = rcu_dereference(tx->sdata->default_multicast_key))) -@@ -654,6 +657,9 @@ ieee80211_tx_h_select_key(struct ieee802 - if (!skip_hw && tx->key && - tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) - info->control.hw_key = &tx->key->conf; -+ } else if (!ieee80211_is_mgmt(hdr->frame_control) && tx->sta && -+ test_sta_flag(tx->sta, WLAN_STA_USES_ENCRYPTION)) { -+ return TX_DROP; - } - - return TX_CONTINUE; diff --git a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch index a32f1b8e4dbc..ca028dd833a7 100644 --- a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch +++ b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch @@ -129,7 +129,7 @@ local->hw.max_mtu = IEEE80211_MAX_DATA_LEN; --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -630,6 +630,7 @@ const struct nla_policy nl80211_policy[N +@@ -628,6 +628,7 @@ const struct nla_policy nl80211_policy[N .len = SAE_PASSWORD_MAX_LEN }, [NL80211_ATTR_TWT_RESPONDER] = { .type = NLA_FLAG }, [NL80211_ATTR_HE_OBSS_PD] = NLA_POLICY_NESTED(he_obss_pd_policy), @@ -137,7 +137,7 @@ }; /* policy for the key attributes */ -@@ -2994,6 +2995,20 @@ static int nl80211_set_wiphy(struct sk_b +@@ -2992,6 +2993,20 @@ static int nl80211_set_wiphy(struct sk_b if (result) return result; } From patchwork Wed May 6 21:31:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 1284782 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=hauke-m.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=oqkPBAB5; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49HVDS4V4dz9sRf for ; Thu, 7 May 2020 07:32:24 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oV8d+9PUez2KypVZwD9vwB0u0OGdmLmfbpaWnc0xr1E=; b=oqkPBAB5NIVbDe yXH/7T7uZWiUpKUE1AO/X6SBcHmw/ZBujk7SHpwDzWdddnYJG3E327E++1zNK4ukdx+CCtd2aSfle SRLsJQHLw2d28u61xy0snZAYVtJb0PByim6tg9R2jtmduQOppmDvsaPGKjD2Oi6iP165aKTpOQ1Rp 2k3v1JLFE6OYY4ebD1VkWhYfFKYJ0YuBOdhEnulHDbpvpmAnkfSiZ5YoqU32OHKcSzAPQFi7mAhtm d4iAwGENfrIu9HFBu9Pm3lOYsL5qTHk6bix8XzuqZ+3DswGbxPMwC5JVqRBlbQyRpRxeHR82fK8oT Gry9V+kyBx4PJoB8+sQQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWReN-0008VB-3t; Wed, 06 May 2020 21:32:19 +0000 Received: from mout-p-103.mailbox.org ([80.241.56.161]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWRe6-0008FT-Ox for openwrt-devel@lists.openwrt.org; Wed, 06 May 2020 21:32:07 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 49HVCz49k6zKmVn; Wed, 6 May 2020 23:31:59 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id CRqb3ulwCpsF; Wed, 6 May 2020 23:31:47 +0200 (CEST) From: Hauke Mehrtens To: openwrt-devel@lists.openwrt.org Date: Wed, 6 May 2020 23:31:28 +0200 Message-Id: <20200506213130.15898-3-hauke@hauke-m.de> In-Reply-To: <20200506213130.15898-1-hauke@hauke-m.de> References: <20200506213130.15898-1-hauke@hauke-m.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 50DA91758 X-Rspamd-Score: -11.46 / 15.00 / 15.00 X-Spam-Note: CRM114 run bypassed due to message size (166908 bytes) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [80.241.56.161 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record Subject: [OpenWrt-Devel] [PATCH v2 2/4] mac80211: Update to version 5.5.19 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hauke@hauke-m.de, foss@volatilesystems.org, koen.vandeputte@ncentric.com, nbd@nbd.name Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This updates the mac80211 backport. The removed patches are already integrated in the upstream version. Signed-off-by: Hauke Mehrtens --- package/kernel/mac80211/Makefile | 6 +- .../patches/ath/120-owl-loader-compat.patch | 6 +- .../patches/ath/403-world_regd_fixup.patch | 34 +- ...21-ath10k_init_devices_synchronously.patch | 2 +- .../ath/930-ath10k_add_tpt_led_trigger.patch | 4 +- ...-of-peer_bw_rxnss_override-parameter.patch | 10 +- ...dling-for-VHT160-in-recent-firmwares.patch | 4 +- ...rolling-support-for-various-chipsets.patch | 40 +- ...75-ath10k-use-tpt-trigger-by-default.patch | 4 +- ...980-ath10k-fix-max-antenna-gain-unit.patch | 6 +- ...-power-reduction-for-US-regulatory-d.patch | 8 +- ...on-t-WARN-when-there-are-no-requests.patch | 28 - ...suspend-resume-when-power-is-cut-off.patch | 109 --- ...set-but-not-used-variable-mpnum-nsp-.patch | 58 -- ...rors-when-setting-roaming-parameters.patch | 2 +- ...B-condition-when-setting-interface-c.patch | 10 +- ...-mbss-in-vif-if-firmware-does-not-su.patch | 4 +- ...lify-building-interface-combinations.patch | 6 +- ...add-initial-support-for-monitor-mode.patch | 16 +- ...62-brcmfmac-Disable-power-management.patch | 2 +- .../mac80211/patches/brcm/998-survey.patch | 8 +- .../patches/build/015-ipw200-mtu.patch | 4 +- .../patches/build/050-lib80211_option.patch | 4 +- .../subsys/140-tweak-TSQ-setting.patch | 2 +- .../subsys/150-disable_addr_notifier.patch | 6 +- ...ate-debugfs-only-after-cfg80211-init.patch | 248 +++++++ .../300-mac80211-optimize-skb-resizing.patch | 14 +- ...l-remove-divisions-in-tx-status-path.patch | 61 -- ...l_ht-replace-rate-stats-ewma-with-a-.patch | 235 ------ ...l_ht-rename-prob_ewma-to-prob_avg-us.patch | 424 ----------- ...domize-BA-session-dialog-token-alloc.patch | 2 +- ...80211-fix-tx-status-for-no-ack-cases.patch | 16 +- ...ore-skb-ack-code-to-its-own-function.patch | 78 -- ...the-size-of-ack_frame_id-to-make-roo.patch | 67 -- ...new-sta_info-getter-by-sta-vif-addrs.patch | 78 -- ...t-airtime-calculation-code-from-mt76.patch | 690 ------------------ ...lement-Airtime-based-Queue-Limit-AQL.patch | 446 ----------- ...time-based-Queue-Limits-AQL-on-packe.patch | 146 ---- ...-Fix-an-off-by-one-in-ieee80211_calc.patch | 31 - ...Turn-AQL-into-an-NL80211_EXT_FEATURE.patch | 253 ------- ...80211-use-more-bits-for-ack_frame_id.patch | 70 -- .../500-mac80211_configure_antenna_gain.patch | 22 +- .../utils/iw/patches/001-nl80211_h_sync.patch | 55 +- 43 files changed, 420 insertions(+), 2899 deletions(-) delete mode 100644 package/kernel/mac80211/patches/brcm/101-v5.5-0001-brcmfmac-don-t-WARN-when-there-are-no-requests.patch delete mode 100644 package/kernel/mac80211/patches/brcm/101-v5.5-0002-brcmfmac-fix-suspend-resume-when-power-is-cut-off.patch delete mode 100644 package/kernel/mac80211/patches/brcm/103-v5.5-brcmfmac-remove-set-but-not-used-variable-mpnum-nsp-.patch create mode 100644 package/kernel/mac80211/patches/subsys/250-mac80211-populate-debugfs-only-after-cfg80211-init.patch delete mode 100644 package/kernel/mac80211/patches/subsys/301-mac80211-minstrel-remove-divisions-in-tx-status-path.patch delete mode 100644 package/kernel/mac80211/patches/subsys/302-mac80211-minstrel_ht-replace-rate-stats-ewma-with-a-.patch delete mode 100644 package/kernel/mac80211/patches/subsys/303-mac80211-minstrel_ht-rename-prob_ewma-to-prob_avg-us.patch delete mode 100644 package/kernel/mac80211/patches/subsys/306-mac80211-move-store-skb-ack-code-to-its-own-function.patch delete mode 100644 package/kernel/mac80211/patches/subsys/307-mac80211-Shrink-the-size-of-ack_frame_id-to-make-roo.patch delete mode 100644 package/kernel/mac80211/patches/subsys/308-mac80211-Add-new-sta_info-getter-by-sta-vif-addrs.patch delete mode 100644 package/kernel/mac80211/patches/subsys/309-mac80211-Import-airtime-calculation-code-from-mt76.patch delete mode 100644 package/kernel/mac80211/patches/subsys/310-mac80211-Implement-Airtime-based-Queue-Limit-AQL.patch delete mode 100644 package/kernel/mac80211/patches/subsys/311-mac80211-Use-Airtime-based-Queue-Limits-AQL-on-packe.patch delete mode 100644 package/kernel/mac80211/patches/subsys/312-mac80211-airtime-Fix-an-off-by-one-in-ieee80211_calc.patch delete mode 100644 package/kernel/mac80211/patches/subsys/313-mac80211-Turn-AQL-into-an-NL80211_EXT_FEATURE.patch delete mode 100644 package/kernel/mac80211/patches/subsys/353-mac80211-use-more-bits-for-ack_frame_id.patch diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 901c08b0de62..aedaac4d32dd 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=5.4.36-1 +PKG_VERSION:=5.5.19-1 PKG_RELEASE:=1 -PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.4.36/ -PKG_HASH:=5b39734986fba3b9c24c521d0499a2dc9cb17267bb58c02d9a520205add2d16b +PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.5.19/ +PKG_HASH:=9dd9153df6082eaa079144193a3fab79d200942e1a2a1a80e032c9667b7b92a6 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION) diff --git a/package/kernel/mac80211/patches/ath/120-owl-loader-compat.patch b/package/kernel/mac80211/patches/ath/120-owl-loader-compat.patch index 155f4fc36567..d1d6c9e2e3eb 100644 --- a/package/kernel/mac80211/patches/ath/120-owl-loader-compat.patch +++ b/package/kernel/mac80211/patches/ath/120-owl-loader-compat.patch @@ -11,7 +11,7 @@ Signed-off-by: Christian Lamparter --- a/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c +++ b/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c -@@ -104,6 +104,7 @@ static void owl_fw_cb(const struct firmw +@@ -103,6 +103,7 @@ static void owl_fw_cb(const struct firmw { struct pci_dev *pdev = (struct pci_dev *)context; struct owl_ctx *ctx = (struct owl_ctx *)pci_get_drvdata(pdev); @@ -19,7 +19,7 @@ Signed-off-by: Christian Lamparter struct pci_bus *bus; complete(&ctx->eeprom_load); -@@ -119,6 +120,16 @@ static void owl_fw_cb(const struct firmw +@@ -118,6 +119,16 @@ static void owl_fw_cb(const struct firmw goto release; } @@ -36,7 +36,7 @@ Signed-off-by: Christian Lamparter if (ath9k_pci_fixup(pdev, (const u16 *)fw->data, fw->size)) goto release; -@@ -138,8 +149,14 @@ release: +@@ -137,8 +148,14 @@ release: static const char *owl_get_eeprom_name(struct pci_dev *pdev) { struct device *dev = &pdev->dev; diff --git a/package/kernel/mac80211/patches/ath/403-world_regd_fixup.patch b/package/kernel/mac80211/patches/ath/403-world_regd_fixup.patch index 2043083158f7..ed616b753259 100644 --- a/package/kernel/mac80211/patches/ath/403-world_regd_fixup.patch +++ b/package/kernel/mac80211/patches/ath/403-world_regd_fixup.patch @@ -4,15 +4,15 @@ NL80211_RRF_NO_OFDM) /* We allow IBSS on these on a case by case basis by regulatory domain */ --#define ATH9K_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 80, 0, 30,\ -+#define ATH9K_5GHZ_5150_5350 REG_RULE(5150-10, 5240+10, 80, 0, 30, 0),\ +-#define ATH_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 80, 0, 30,\ ++#define ATH_5GHZ_5150_5350 REG_RULE(5150-10, 5240+10, 80, 0, 30, 0),\ + REG_RULE(5260-10, 5350+10, 80, 0, 30,\ NL80211_RRF_NO_IR) - #define ATH9K_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 80, 0, 30,\ + #define ATH_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 80, 0, 30,\ NL80211_RRF_NO_IR) @@ -62,57 +63,56 @@ static struct reg_dmn_pair_mapping *ath_ - #define ATH9K_5GHZ_NO_MIDBAND ATH9K_5GHZ_5150_5350, \ - ATH9K_5GHZ_5725_5850 + #define ATH_5GHZ_NO_MIDBAND ATH_5GHZ_5150_5350, \ + ATH_5GHZ_5725_5850 +#define REGD_RULES(...) \ + .reg_rules = { __VA_ARGS__ }, \ @@ -25,8 +25,8 @@ .alpha2 = "99", - .reg_rules = { + REGD_RULES( - ATH9K_2GHZ_ALL, - ATH9K_5GHZ_ALL, + ATH_2GHZ_ALL, + ATH_5GHZ_ALL, - } + ) }; @@ -37,9 +37,9 @@ .alpha2 = "99", - .reg_rules = { + REGD_RULES( - ATH9K_2GHZ_CH01_11, - ATH9K_2GHZ_CH12_13, - ATH9K_5GHZ_NO_MIDBAND, + ATH_2GHZ_CH01_11, + ATH_2GHZ_CH12_13, + ATH_5GHZ_NO_MIDBAND, - } + ) }; @@ -50,8 +50,8 @@ .alpha2 = "99", - .reg_rules = { + REGD_RULES( - ATH9K_2GHZ_CH01_11, - ATH9K_5GHZ_NO_MIDBAND, + ATH_2GHZ_CH01_11, + ATH_5GHZ_NO_MIDBAND, - } + ) }; @@ -62,8 +62,8 @@ .alpha2 = "99", - .reg_rules = { + REGD_RULES( - ATH9K_2GHZ_CH01_11, - ATH9K_5GHZ_ALL, + ATH_2GHZ_CH01_11, + ATH_5GHZ_ALL, - } + ) }; @@ -74,9 +74,9 @@ .alpha2 = "99", - .reg_rules = { + REGD_RULES( - ATH9K_2GHZ_CH01_11, - ATH9K_2GHZ_CH12_13, - ATH9K_5GHZ_ALL, + ATH_2GHZ_CH01_11, + ATH_2GHZ_CH12_13, + ATH_5GHZ_ALL, - } + ) }; diff --git a/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch index 69c29f15eea9..728c86effbb4 100644 --- a/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch +++ b/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch @@ -14,7 +14,7 @@ Signed-off-by: Sven Eckelmann --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c -@@ -3074,6 +3074,16 @@ int ath10k_core_register(struct ath10k * +@@ -3105,6 +3105,16 @@ int ath10k_core_register(struct ath10k * queue_work(ar->workqueue, &ar->register_work); diff --git a/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch index 5a79c3370204..6fe551f9d539 100644 --- a/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch +++ b/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -8673,6 +8673,21 @@ static int ath10k_mac_init_rd(struct ath +@@ -8761,6 +8761,21 @@ static int ath10k_mac_init_rd(struct ath return 0; } @@ -22,7 +22,7 @@ int ath10k_mac_register(struct ath10k *ar) { static const u32 cipher_suites[] = { -@@ -9000,6 +9015,12 @@ int ath10k_mac_register(struct ath10k *a +@@ -9088,6 +9103,12 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; diff --git a/package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch b/package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch index c99ba5595585..4d51205b5ed5 100644 --- a/package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch +++ b/package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch @@ -23,7 +23,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling 3 files changed, 52 insertions(+), 23 deletions(-) --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -2515,7 +2515,7 @@ static void ath10k_peer_assoc_h_vht(stru +@@ -2516,7 +2516,7 @@ static void ath10k_peer_assoc_h_vht(stru const u16 *vht_mcs_mask; u8 ampdu_factor; u8 max_nss, vht_mcs; @@ -32,7 +32,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling if (WARN_ON(ath10k_mac_vif_chan(vif, &def))) return; -@@ -2575,23 +2575,45 @@ static void ath10k_peer_assoc_h_vht(stru +@@ -2576,23 +2576,45 @@ static void ath10k_peer_assoc_h_vht(stru __le16_to_cpu(vht_cap->vht_mcs.tx_highest); arg->peer_vht_rates.tx_mcs_set = ath10k_peer_assoc_h_vht_limit( __le16_to_cpu(vht_cap->vht_mcs.tx_mcs_map), vht_mcs_mask); @@ -92,7 +92,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling } static void ath10k_peer_assoc_h_qos(struct ath10k *ar, -@@ -2743,9 +2765,9 @@ static int ath10k_peer_assoc_prepare(str +@@ -2744,9 +2766,9 @@ static int ath10k_peer_assoc_prepare(str ath10k_peer_assoc_h_crypto(ar, vif, sta, arg); ath10k_peer_assoc_h_rates(ar, vif, sta, arg); ath10k_peer_assoc_h_ht(ar, vif, sta, arg); @@ -105,7 +105,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling } --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c -@@ -7552,12 +7552,7 @@ ath10k_wmi_peer_assoc_fill_10_4(struct a +@@ -7601,12 +7601,7 @@ ath10k_wmi_peer_assoc_fill_10_4(struct a struct wmi_10_4_peer_assoc_complete_cmd *cmd = buf; ath10k_wmi_peer_assoc_fill_10_2(ar, buf, arg); @@ -121,7 +121,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling static int --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h -@@ -6478,7 +6478,19 @@ struct wmi_10_2_peer_assoc_complete_cmd +@@ -6501,7 +6501,19 @@ struct wmi_10_2_peer_assoc_complete_cmd __le32 info0; /* WMI_PEER_ASSOC_INFO0_ */ } __packed; diff --git a/package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch b/package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch index d0e293c6dd4c..d6a1ef084989 100644 --- a/package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch +++ b/package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch @@ -13,7 +13,7 @@ v2: fix trailing whitespace issue and fix some typos within the commit note 2 files changed, 8 insertions(+), 10 deletions(-) --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -4575,13 +4575,6 @@ static struct ieee80211_sta_vht_cap ath1 +@@ -4576,13 +4576,6 @@ static struct ieee80211_sta_vht_cap ath1 vht_cap.cap |= val; } @@ -29,7 +29,7 @@ v2: fix trailing whitespace issue and fix some typos within the commit note if ((i < ar->num_rf_chains) && (ar->cfg_tx_chainmask & BIT(i))) --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c -@@ -1700,13 +1700,18 @@ void ath10k_wmi_put_wmi_channel(struct w +@@ -1713,13 +1713,18 @@ void ath10k_wmi_put_wmi_channel(struct w flags |= WMI_CHAN_FLAG_HT40_PLUS; if (arg->chan_radar) flags |= WMI_CHAN_FLAG_DFS; diff --git a/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch index 70af3892d728..d72d515ad3c0 100644 --- a/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch +++ b/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch @@ -124,7 +124,7 @@ v13: WCN36XX= --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c -@@ -24,6 +24,7 @@ +@@ -25,6 +25,7 @@ #include "testmode.h" #include "wmi-ops.h" #include "coredump.h" @@ -132,7 +132,7 @@ v13: unsigned int ath10k_debug_mask; EXPORT_SYMBOL(ath10k_debug_mask); -@@ -60,6 +61,7 @@ static const struct ath10k_hw_params ath +@@ -61,6 +62,7 @@ static const struct ath10k_hw_params ath .dev_id = QCA988X_2_0_DEVICE_ID, .bus = ATH10K_BUS_PCI, .name = "qca988x hw2.0", @@ -140,7 +140,7 @@ v13: .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, -@@ -130,6 +132,7 @@ static const struct ath10k_hw_params ath +@@ -131,6 +133,7 @@ static const struct ath10k_hw_params ath .dev_id = QCA9887_1_0_DEVICE_ID, .bus = ATH10K_BUS_PCI, .name = "qca9887 hw1.0", @@ -148,7 +148,7 @@ v13: .patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, -@@ -337,6 +340,7 @@ static const struct ath10k_hw_params ath +@@ -338,6 +341,7 @@ static const struct ath10k_hw_params ath .dev_id = QCA99X0_2_0_DEVICE_ID, .bus = ATH10K_BUS_PCI, .name = "qca99x0 hw2.0", @@ -156,7 +156,7 @@ v13: .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, .otp_exe_param = 0x00000700, -@@ -378,6 +382,7 @@ static const struct ath10k_hw_params ath +@@ -379,6 +383,7 @@ static const struct ath10k_hw_params ath .dev_id = QCA9984_1_0_DEVICE_ID, .bus = ATH10K_BUS_PCI, .name = "qca9984/qca9994 hw1.0", @@ -164,7 +164,7 @@ v13: .patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, -@@ -426,6 +431,7 @@ static const struct ath10k_hw_params ath +@@ -427,6 +432,7 @@ static const struct ath10k_hw_params ath .dev_id = QCA9888_2_0_DEVICE_ID, .bus = ATH10K_BUS_PCI, .name = "qca9888 hw2.0", @@ -172,7 +172,7 @@ v13: .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, -@@ -2791,6 +2797,10 @@ int ath10k_core_start(struct ath10k *ar, +@@ -2822,6 +2828,10 @@ int ath10k_core_start(struct ath10k *ar, goto err_hif_stop; } @@ -183,7 +183,7 @@ v13: return 0; err_hif_stop: -@@ -3047,9 +3057,18 @@ static void ath10k_core_register_work(st +@@ -3078,9 +3088,18 @@ static void ath10k_core_register_work(st goto err_spectral_destroy; } @@ -202,7 +202,7 @@ v13: err_spectral_destroy: ath10k_spectral_destroy(ar); err_debug_destroy: -@@ -3095,6 +3114,8 @@ void ath10k_core_unregister(struct ath10 +@@ -3126,6 +3145,8 @@ void ath10k_core_unregister(struct ath10 if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) return; @@ -221,7 +221,7 @@ v13: #include "htt.h" #include "htc.h" -@@ -1170,6 +1171,13 @@ struct ath10k { +@@ -1179,6 +1180,13 @@ struct ath10k { } testmode; struct { @@ -237,7 +237,7 @@ v13: u32 fw_warm_reset_counter; --- a/drivers/net/wireless/ath/ath10k/hw.h +++ b/drivers/net/wireless/ath/ath10k/hw.h -@@ -514,6 +514,7 @@ struct ath10k_hw_params { +@@ -517,6 +517,7 @@ struct ath10k_hw_params { const char *name; u32 patch_load_addr; int uart_pin; @@ -397,7 +397,7 @@ v13: +#endif /* _LEDS_H_ */ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -23,6 +23,7 @@ +@@ -24,6 +24,7 @@ #include "wmi-tlv.h" #include "wmi-ops.h" #include "wow.h" @@ -456,7 +456,7 @@ v13: { --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c -@@ -4367,6 +4367,8 @@ static const struct wmi_ops wmi_tlv_ops +@@ -4444,6 +4444,8 @@ static const struct wmi_ops wmi_tlv_ops .gen_echo = ath10k_wmi_tlv_op_gen_echo, .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf, .gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable, @@ -467,7 +467,7 @@ v13: static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = { --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c -@@ -7372,6 +7372,49 @@ ath10k_wmi_op_gen_peer_set_param(struct +@@ -7421,6 +7421,49 @@ ath10k_wmi_op_gen_peer_set_param(struct return skb; } @@ -517,7 +517,7 @@ v13: static struct sk_buff * ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id, enum wmi_sta_ps_mode psmode) -@@ -9029,6 +9072,9 @@ static const struct wmi_ops wmi_ops = { +@@ -9078,6 +9121,9 @@ static const struct wmi_ops wmi_ops = { .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill, .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, .gen_echo = ath10k_wmi_op_gen_echo, @@ -527,7 +527,7 @@ v13: /* .gen_bcn_tmpl not implemented */ /* .gen_prb_tmpl not implemented */ /* .gen_p2p_go_bcn_ie not implemented */ -@@ -9099,6 +9145,8 @@ static const struct wmi_ops wmi_10_1_ops +@@ -9148,6 +9194,8 @@ static const struct wmi_ops wmi_10_1_ops .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, .gen_echo = ath10k_wmi_op_gen_echo, @@ -536,7 +536,7 @@ v13: /* .gen_bcn_tmpl not implemented */ /* .gen_prb_tmpl not implemented */ /* .gen_p2p_go_bcn_ie not implemented */ -@@ -9171,6 +9219,8 @@ static const struct wmi_ops wmi_10_2_ops +@@ -9220,6 +9268,8 @@ static const struct wmi_ops wmi_10_2_ops .gen_delba_send = ath10k_wmi_op_gen_delba_send, .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, @@ -545,7 +545,7 @@ v13: /* .gen_pdev_enable_adaptive_cca not implemented */ }; -@@ -9242,6 +9292,8 @@ static const struct wmi_ops wmi_10_2_4_o +@@ -9291,6 +9341,8 @@ static const struct wmi_ops wmi_10_2_4_o ath10k_wmi_op_gen_pdev_enable_adaptive_cca, .get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype, .gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing, @@ -554,7 +554,7 @@ v13: /* .gen_bcn_tmpl not implemented */ /* .gen_prb_tmpl not implemented */ /* .gen_p2p_go_bcn_ie not implemented */ -@@ -9322,6 +9374,8 @@ static const struct wmi_ops wmi_10_4_ops +@@ -9371,6 +9423,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_echo = ath10k_wmi_op_gen_echo, .gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config, @@ -565,7 +565,7 @@ v13: int ath10k_wmi_attach(struct ath10k *ar) --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h -@@ -3005,6 +3005,41 @@ enum wmi_10_4_feature_mask { +@@ -3007,6 +3007,41 @@ enum wmi_10_4_feature_mask { }; diff --git a/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch index 0763d159e646..3973dc8cb31b 100644 --- a/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch @@ -16,7 +16,7 @@ Signed-off-by: Mathias Kresin --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h -@@ -1219,6 +1219,10 @@ struct ath10k { +@@ -1228,6 +1228,10 @@ struct ath10k { struct ath10k_bus_params bus_param; struct completion peer_delete_done; @@ -42,7 +42,7 @@ Signed-off-by: Mathias Kresin if (ret) --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -9032,7 +9032,7 @@ int ath10k_mac_register(struct ath10k *a +@@ -9120,7 +9120,7 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; #ifdef CPTCFG_MAC80211_LEDS diff --git a/package/kernel/mac80211/patches/ath/980-ath10k-fix-max-antenna-gain-unit.patch b/package/kernel/mac80211/patches/ath/980-ath10k-fix-max-antenna-gain-unit.patch index f60163f941ec..149585b050aa 100644 --- a/package/kernel/mac80211/patches/ath/980-ath10k-fix-max-antenna-gain-unit.patch +++ b/package/kernel/mac80211/patches/ath/980-ath10k-fix-max-antenna-gain-unit.patch @@ -20,7 +20,7 @@ Forwarded: https://patchwork.kernel.org/patch/10986723/ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -1041,7 +1041,7 @@ static int ath10k_monitor_vdev_start(str +@@ -1042,7 +1042,7 @@ static int ath10k_monitor_vdev_start(str arg.channel.min_power = 0; arg.channel.max_power = channel->max_power * 2; arg.channel.max_reg_power = channel->max_reg_power * 2; @@ -29,7 +29,7 @@ Forwarded: https://patchwork.kernel.org/patch/10986723/ reinit_completion(&ar->vdev_setup_done); reinit_completion(&ar->vdev_delete_done); -@@ -1487,7 +1487,7 @@ static int ath10k_vdev_start_restart(str +@@ -1488,7 +1488,7 @@ static int ath10k_vdev_start_restart(str arg.channel.min_power = 0; arg.channel.max_power = chandef->chan->max_power * 2; arg.channel.max_reg_power = chandef->chan->max_reg_power * 2; @@ -38,7 +38,7 @@ Forwarded: https://patchwork.kernel.org/patch/10986723/ if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { arg.ssid = arvif->u.ap.ssid; -@@ -3168,7 +3168,7 @@ static int ath10k_update_channel_list(st +@@ -3169,7 +3169,7 @@ static int ath10k_update_channel_list(st ch->min_power = 0; ch->max_power = channel->max_power * 2; ch->max_reg_power = channel->max_reg_power * 2; diff --git a/package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch b/package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch index 9fbb254127e2..36948e546f4c 100644 --- a/package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch +++ b/package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch @@ -28,7 +28,7 @@ Forwarded: no --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -1009,6 +1009,40 @@ static inline int ath10k_vdev_setup_sync +@@ -1010,6 +1010,40 @@ static inline int ath10k_vdev_setup_sync return ar->last_wmi_vdev_start_status; } @@ -69,7 +69,7 @@ Forwarded: no static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id) { struct cfg80211_chan_def *chandef = NULL; -@@ -1041,7 +1075,8 @@ static int ath10k_monitor_vdev_start(str +@@ -1042,7 +1076,8 @@ static int ath10k_monitor_vdev_start(str arg.channel.min_power = 0; arg.channel.max_power = channel->max_power * 2; arg.channel.max_reg_power = channel->max_reg_power * 2; @@ -79,7 +79,7 @@ Forwarded: no reinit_completion(&ar->vdev_setup_done); reinit_completion(&ar->vdev_delete_done); -@@ -1487,7 +1522,8 @@ static int ath10k_vdev_start_restart(str +@@ -1488,7 +1523,8 @@ static int ath10k_vdev_start_restart(str arg.channel.min_power = 0; arg.channel.max_power = chandef->chan->max_power * 2; arg.channel.max_reg_power = chandef->chan->max_reg_power * 2; @@ -89,7 +89,7 @@ Forwarded: no if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { arg.ssid = arvif->u.ap.ssid; -@@ -3168,7 +3204,8 @@ static int ath10k_update_channel_list(st +@@ -3169,7 +3205,8 @@ static int ath10k_update_channel_list(st ch->min_power = 0; ch->max_power = channel->max_power * 2; ch->max_reg_power = channel->max_reg_power * 2; diff --git a/package/kernel/mac80211/patches/brcm/101-v5.5-0001-brcmfmac-don-t-WARN-when-there-are-no-requests.patch b/package/kernel/mac80211/patches/brcm/101-v5.5-0001-brcmfmac-don-t-WARN-when-there-are-no-requests.patch deleted file mode 100644 index a1311e0a49a7..000000000000 --- a/package/kernel/mac80211/patches/brcm/101-v5.5-0001-brcmfmac-don-t-WARN-when-there-are-no-requests.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 1524cbf3621576c639405e7aabeac415f9617c8d Mon Sep 17 00:00:00 2001 -From: Adrian Ratiu -Date: Wed, 25 Sep 2019 16:44:57 +0300 -Subject: [PATCH] brcmfmac: don't WARN when there are no requests - -When n_reqs == 0 there is nothing to do so it doesn't make sense to -search for requests and issue a warning because none is found. - -Signed-off-by: Martyn Welch -Signed-off-by: Adrian Ratiu -Signed-off-by: Kalle Valo ---- - drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c -@@ -57,6 +57,10 @@ static int brcmf_pno_remove_request(stru - - mutex_lock(&pi->req_lock); - -+ /* Nothing to do if we have no requests */ -+ if (pi->n_reqs == 0) -+ goto done; -+ - /* find request */ - for (i = 0; i < pi->n_reqs; i++) { - if (pi->reqs[i]->reqid == reqid) diff --git a/package/kernel/mac80211/patches/brcm/101-v5.5-0002-brcmfmac-fix-suspend-resume-when-power-is-cut-off.patch b/package/kernel/mac80211/patches/brcm/101-v5.5-0002-brcmfmac-fix-suspend-resume-when-power-is-cut-off.patch deleted file mode 100644 index eafc96b9015d..000000000000 --- a/package/kernel/mac80211/patches/brcm/101-v5.5-0002-brcmfmac-fix-suspend-resume-when-power-is-cut-off.patch +++ /dev/null @@ -1,109 +0,0 @@ -From e0ae4bac22effbd644add326f658a3aeeb8d45ee Mon Sep 17 00:00:00 2001 -From: Adrian Ratiu -Date: Wed, 25 Sep 2019 16:44:58 +0300 -Subject: [PATCH] brcmfmac: fix suspend/resume when power is cut off - -brcmfmac assumed the wifi device always remains powered on and thus -hardcoded the MMC_PM_KEEP_POWER flag expecting the wifi device to -remain on even during suspend/resume cycles. - -This is not always the case, some appliances cut power to everything -connected via SDIO for efficiency reasons and this leads to wifi not -being usable after coming out of suspend because the device was not -correctly reinitialized. - -So we check for the keep_power capability and if it's not present then -we remove the device and probe it again during resume to mirror what's -happening in hardware and ensure correct reinitialization in the case -when MMC_PM_KEEP_POWER is not supported. - -Suggested-by: Gustavo Padovan -Signed-off-by: Adrian Ratiu -Signed-off-by: Kalle Valo ---- - .../broadcom/brcm80211/brcmfmac/bcmsdh.c | 53 ++++++++++++++----- - 1 file changed, 39 insertions(+), 14 deletions(-) - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c -@@ -1108,7 +1108,8 @@ static int brcmf_ops_sdio_suspend(struct - struct sdio_func *func; - struct brcmf_bus *bus_if; - struct brcmf_sdio_dev *sdiodev; -- mmc_pm_flag_t sdio_flags; -+ mmc_pm_flag_t pm_caps, sdio_flags; -+ int ret = 0; - - func = container_of(dev, struct sdio_func, dev); - brcmf_dbg(SDIO, "Enter: F%d\n", func->num); -@@ -1119,19 +1120,33 @@ static int brcmf_ops_sdio_suspend(struct - bus_if = dev_get_drvdata(dev); - sdiodev = bus_if->bus_priv.sdio; - -- brcmf_sdiod_freezer_on(sdiodev); -- brcmf_sdio_wd_timer(sdiodev->bus, 0); -+ pm_caps = sdio_get_host_pm_caps(func); - -- sdio_flags = MMC_PM_KEEP_POWER; -- if (sdiodev->wowl_enabled) { -- if (sdiodev->settings->bus.sdio.oob_irq_supported) -- enable_irq_wake(sdiodev->settings->bus.sdio.oob_irq_nr); -- else -- sdio_flags |= MMC_PM_WAKE_SDIO_IRQ; -+ if (pm_caps & MMC_PM_KEEP_POWER) { -+ /* preserve card power during suspend */ -+ brcmf_sdiod_freezer_on(sdiodev); -+ brcmf_sdio_wd_timer(sdiodev->bus, 0); -+ -+ sdio_flags = MMC_PM_KEEP_POWER; -+ if (sdiodev->wowl_enabled) { -+ if (sdiodev->settings->bus.sdio.oob_irq_supported) -+ enable_irq_wake(sdiodev->settings->bus.sdio.oob_irq_nr); -+ else -+ sdio_flags |= MMC_PM_WAKE_SDIO_IRQ; -+ } -+ -+ if (sdio_set_host_pm_flags(sdiodev->func1, sdio_flags)) -+ brcmf_err("Failed to set pm_flags %x\n", sdio_flags); -+ -+ } else { -+ /* power will be cut so remove device, probe again in resume */ -+ brcmf_sdiod_intr_unregister(sdiodev); -+ ret = brcmf_sdiod_remove(sdiodev); -+ if (ret) -+ brcmf_err("Failed to remove device on suspend\n"); - } -- if (sdio_set_host_pm_flags(sdiodev->func1, sdio_flags)) -- brcmf_err("Failed to set pm_flags %x\n", sdio_flags); -- return 0; -+ -+ return ret; - } - - static int brcmf_ops_sdio_resume(struct device *dev) -@@ -1139,13 +1154,23 @@ static int brcmf_ops_sdio_resume(struct - struct brcmf_bus *bus_if = dev_get_drvdata(dev); - struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; - struct sdio_func *func = container_of(dev, struct sdio_func, dev); -+ mmc_pm_flag_t pm_caps = sdio_get_host_pm_caps(func); -+ int ret = 0; - - brcmf_dbg(SDIO, "Enter: F%d\n", func->num); - if (func->num != 2) - return 0; - -- brcmf_sdiod_freezer_off(sdiodev); -- return 0; -+ if (!(pm_caps & MMC_PM_KEEP_POWER)) { -+ /* bus was powered off and device removed, probe again */ -+ ret = brcmf_sdiod_probe(sdiodev); -+ if (ret) -+ brcmf_err("Failed to probe device on resume\n"); -+ } else { -+ brcmf_sdiod_freezer_off(sdiodev); -+ } -+ -+ return ret; - } - - static const struct dev_pm_ops brcmf_sdio_pm_ops = { diff --git a/package/kernel/mac80211/patches/brcm/103-v5.5-brcmfmac-remove-set-but-not-used-variable-mpnum-nsp-.patch b/package/kernel/mac80211/patches/brcm/103-v5.5-brcmfmac-remove-set-but-not-used-variable-mpnum-nsp-.patch deleted file mode 100644 index 25b3ceb95921..000000000000 --- a/package/kernel/mac80211/patches/brcm/103-v5.5-brcmfmac-remove-set-but-not-used-variable-mpnum-nsp-.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 7af496b9eb0433bc4cb478c9a46f85509cdb5541 Mon Sep 17 00:00:00 2001 -From: zhengbin -Date: Sat, 16 Nov 2019 15:22:47 +0800 -Subject: [PATCH] brcmfmac: remove set but not used variable - 'mpnum','nsp','nmp' - -Fixes gcc '-Wunused-but-set-variable' warning: - -drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c: In function brcmf_chip_dmp_get_regaddr: -drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c:790:5: warning: variable mpnum set but not used [-Wunused-but-set-variable] -drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c: In function brcmf_chip_dmp_erom_scan: -drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c:866:10: warning: variable nsp set but not used [-Wunused-but-set-variable] -drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c: In function brcmf_chip_dmp_erom_scan: -drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c:866:5: warning: variable nmp set but not used [-Wunused-but-set-variable] - -Reported-by: Hulk Robot -Signed-off-by: zhengbin -Signed-off-by: Kalle Valo ---- - drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 6 +----- - 1 file changed, 1 insertion(+), 5 deletions(-) - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c -@@ -778,7 +778,6 @@ static int brcmf_chip_dmp_get_regaddr(st - { - u8 desc; - u32 val, szdesc; -- u8 mpnum = 0; - u8 stype, sztype, wraptype; - - *regbase = 0; -@@ -786,7 +785,6 @@ static int brcmf_chip_dmp_get_regaddr(st - - val = brcmf_chip_dmp_get_desc(ci, eromaddr, &desc); - if (desc == DMP_DESC_MASTER_PORT) { -- mpnum = (val & DMP_MASTER_PORT_NUM) >> DMP_MASTER_PORT_NUM_S; - wraptype = DMP_SLAVE_TYPE_MWRAP; - } else if (desc == DMP_DESC_ADDRESS) { - /* revert erom address */ -@@ -854,7 +852,7 @@ int brcmf_chip_dmp_erom_scan(struct brcm - u8 desc_type = 0; - u32 val; - u16 id; -- u8 nmp, nsp, nmw, nsw, rev; -+ u8 nmw, nsw, rev; - u32 base, wrap; - int err; - -@@ -880,8 +878,6 @@ int brcmf_chip_dmp_erom_scan(struct brcm - return -EFAULT; - - /* only look at cores with master port(s) */ -- nmp = (val & DMP_COMP_NUM_MPORT) >> DMP_COMP_NUM_MPORT_S; -- nsp = (val & DMP_COMP_NUM_SPORT) >> DMP_COMP_NUM_SPORT_S; - nmw = (val & DMP_COMP_NUM_MWRAP) >> DMP_COMP_NUM_MWRAP_S; - nsw = (val & DMP_COMP_NUM_SWRAP) >> DMP_COMP_NUM_SWRAP_S; - rev = (val & DMP_COMP_REVISION) >> DMP_COMP_REVISION_S; diff --git a/package/kernel/mac80211/patches/brcm/114-v5.6-0004-brcmfmac-make-errors-when-setting-roaming-parameters.patch b/package/kernel/mac80211/patches/brcm/114-v5.6-0004-brcmfmac-make-errors-when-setting-roaming-parameters.patch index cd7ccb0439c8..76138fbc684d 100644 --- a/package/kernel/mac80211/patches/brcm/114-v5.6-0004-brcmfmac-make-errors-when-setting-roaming-parameters.patch +++ b/package/kernel/mac80211/patches/brcm/114-v5.6-0004-brcmfmac-make-errors-when-setting-roaming-parameters.patch @@ -16,7 +16,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -5944,19 +5944,17 @@ static s32 brcmf_dongle_roam(struct brcm +@@ -6012,19 +6012,17 @@ static s32 brcmf_dongle_roam(struct brcm roamtrigger[1] = cpu_to_le32(BRCM_BAND_ALL); err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_TRIGGER, (void *)roamtrigger, sizeof(roamtrigger)); diff --git a/package/kernel/mac80211/patches/brcm/114-v5.6-0006-brcmfmac-add-RSDB-condition-when-setting-interface-c.patch b/package/kernel/mac80211/patches/brcm/114-v5.6-0006-brcmfmac-add-RSDB-condition-when-setting-interface-c.patch index d00c59c07c32..09059defe57c 100644 --- a/package/kernel/mac80211/patches/brcm/114-v5.6-0006-brcmfmac-add-RSDB-condition-when-setting-interface-c.patch +++ b/package/kernel/mac80211/patches/brcm/114-v5.6-0006-brcmfmac-add-RSDB-condition-when-setting-interface-c.patch @@ -20,7 +20,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -6452,6 +6452,9 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = +@@ -6520,6 +6520,9 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = * #STA <= 1, #AP <= 1, channels = 1, 2 total * #AP <= 4, matching BI, channels = 1, 4 total * @@ -30,7 +30,7 @@ Signed-off-by: Kalle Valo * p2p, no mchan, and mbss: * * #STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 1, channels = 1, 3 total -@@ -6463,6 +6466,10 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = +@@ -6531,6 +6534,10 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = * #STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 1, channels = 2, 3 total * #STA <= 1, #P2P-DEV <= 1, #AP <= 1, #P2P-CL <= 1, channels = 1, 4 total * #AP <= 4, matching BI, channels = 1, 4 total @@ -41,7 +41,7 @@ Signed-off-by: Kalle Valo */ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) { -@@ -6470,13 +6477,14 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6538,13 +6545,14 @@ static int brcmf_setup_ifmodes(struct wi struct ieee80211_iface_limit *c0_limits = NULL; struct ieee80211_iface_limit *p2p_limits = NULL; struct ieee80211_iface_limit *mbss_limits = NULL; @@ -58,7 +58,7 @@ Signed-off-by: Kalle Valo combo = kcalloc(n_combos, sizeof(*combo), GFP_KERNEL); if (!combo) goto err; -@@ -6487,16 +6495,36 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6555,16 +6563,36 @@ static int brcmf_setup_ifmodes(struct wi c = 0; i = 0; @@ -99,7 +99,7 @@ Signed-off-by: Kalle Valo wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO) | BIT(NL80211_IFTYPE_P2P_DEVICE); -@@ -6505,16 +6533,26 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6573,16 +6601,26 @@ static int brcmf_setup_ifmodes(struct wi c0_limits[i].max = 1; c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO); diff --git a/package/kernel/mac80211/patches/brcm/114-v5.6-0007-brcmfmac-not-set-mbss-in-vif-if-firmware-does-not-su.patch b/package/kernel/mac80211/patches/brcm/114-v5.6-0007-brcmfmac-not-set-mbss-in-vif-if-firmware-does-not-su.patch index 9c211a68d061..1870088bf64e 100644 --- a/package/kernel/mac80211/patches/brcm/114-v5.6-0007-brcmfmac-not-set-mbss-in-vif-if-firmware-does-not-su.patch +++ b/package/kernel/mac80211/patches/brcm/114-v5.6-0007-brcmfmac-not-set-mbss-in-vif-if-firmware-does-not-su.patch @@ -18,7 +18,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -5301,6 +5301,7 @@ struct brcmf_cfg80211_vif *brcmf_alloc_v +@@ -5363,6 +5363,7 @@ struct brcmf_cfg80211_vif *brcmf_alloc_v struct brcmf_cfg80211_vif *vif_walk; struct brcmf_cfg80211_vif *vif; bool mbss; @@ -26,7 +26,7 @@ Signed-off-by: Kalle Valo brcmf_dbg(TRACE, "allocating virtual interface (size=%zu)\n", sizeof(*vif)); -@@ -5313,7 +5314,8 @@ struct brcmf_cfg80211_vif *brcmf_alloc_v +@@ -5375,7 +5376,8 @@ struct brcmf_cfg80211_vif *brcmf_alloc_v brcmf_init_prof(&vif->profile); diff --git a/package/kernel/mac80211/patches/brcm/119-v5.6-0001-brcmfmac-simplify-building-interface-combinations.patch b/package/kernel/mac80211/patches/brcm/119-v5.6-0001-brcmfmac-simplify-building-interface-combinations.patch index d52a7a1cc082..73fc17aa5a70 100644 --- a/package/kernel/mac80211/patches/brcm/119-v5.6-0001-brcmfmac-simplify-building-interface-combinations.patch +++ b/package/kernel/mac80211/patches/brcm/119-v5.6-0001-brcmfmac-simplify-building-interface-combinations.patch @@ -18,7 +18,7 @@ Signed-off-by: Kalle Valo --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -6479,12 +6479,13 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6547,12 +6547,13 @@ static int brcmf_setup_ifmodes(struct wi struct ieee80211_iface_limit *c0_limits = NULL; struct ieee80211_iface_limit *p2p_limits = NULL; struct ieee80211_iface_limit *mbss_limits = NULL; @@ -33,7 +33,7 @@ Signed-off-by: Kalle Valo n_combos = 1 + !!(p2p && !rsdb) + !!mbss; combo = kcalloc(n_combos, sizeof(*combo), GFP_KERNEL); -@@ -6494,6 +6495,10 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6562,6 +6563,10 @@ static int brcmf_setup_ifmodes(struct wi wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_AP); @@ -44,7 +44,7 @@ Signed-off-by: Kalle Valo c = 0; i = 0; -@@ -6505,48 +6510,28 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6573,48 +6578,28 @@ static int brcmf_setup_ifmodes(struct wi c0_limits = kcalloc(2, sizeof(*c0_limits), GFP_KERNEL); if (!c0_limits) goto err; diff --git a/package/kernel/mac80211/patches/brcm/119-v5.6-0002-brcmfmac-add-initial-support-for-monitor-mode.patch b/package/kernel/mac80211/patches/brcm/119-v5.6-0002-brcmfmac-add-initial-support-for-monitor-mode.patch index 08fa1544eca8..0682c0b0ea7e 100644 --- a/package/kernel/mac80211/patches/brcm/119-v5.6-0002-brcmfmac-add-initial-support-for-monitor-mode.patch +++ b/package/kernel/mac80211/patches/brcm/119-v5.6-0002-brcmfmac-add-initial-support-for-monitor-mode.patch @@ -139,7 +139,7 @@ Signed-off-by: Kalle Valo case NL80211_IFTYPE_AP: return brcmf_cfg80211_del_ap_iface(wiphy, wdev); case NL80211_IFTYPE_P2P_CLIENT: -@@ -6479,9 +6558,10 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6547,9 +6626,10 @@ static int brcmf_setup_ifmodes(struct wi struct ieee80211_iface_limit *c0_limits = NULL; struct ieee80211_iface_limit *p2p_limits = NULL; struct ieee80211_iface_limit *mbss_limits = NULL; @@ -152,7 +152,7 @@ Signed-off-by: Kalle Valo mbss = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS); p2p = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_P2P); rsdb = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB); -@@ -6495,6 +6575,8 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6563,6 +6643,8 @@ static int brcmf_setup_ifmodes(struct wi wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_AP); @@ -161,7 +161,7 @@ Signed-off-by: Kalle Valo if (p2p) wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO) | -@@ -6502,18 +6584,18 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6570,18 +6652,18 @@ static int brcmf_setup_ifmodes(struct wi c = 0; i = 0; @@ -186,7 +186,7 @@ Signed-off-by: Kalle Valo if (p2p) { c0_limits[i].max = 1; c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_DEVICE); -@@ -6562,14 +6644,20 @@ static int brcmf_setup_ifmodes(struct wi +@@ -6630,14 +6712,20 @@ static int brcmf_setup_ifmodes(struct wi if (mbss) { c++; i = 0; @@ -312,8 +312,8 @@ Signed-off-by: Kalle Valo { BRCMF_FEAT_MONITOR, "monitor" }, + { BRCMF_FEAT_MONITOR_FLAG, "rtap" }, { BRCMF_FEAT_MONITOR_FMT_RADIOTAP, "rtap" }, - { BRCMF_FEAT_DOT11H, "802.11h" } - }; + { BRCMF_FEAT_DOT11H, "802.11h" }, + { BRCMF_FEAT_SAE, "sae" }, --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h @@ -23,6 +23,7 @@ @@ -324,14 +324,14 @@ Signed-off-by: Kalle Valo * MONITOR_FMT_RADIOTAP: firmware provides monitor packets with radiotap header * MONITOR_FMT_HW_RX_HDR: firmware provides monitor packets with hw/ucode header * DOT11H: firmware supports 802.11h -@@ -43,6 +44,7 @@ +@@ -44,6 +45,7 @@ BRCMF_FEAT_DEF(GSCAN) \ BRCMF_FEAT_DEF(FWSUP) \ BRCMF_FEAT_DEF(MONITOR) \ + BRCMF_FEAT_DEF(MONITOR_FLAG) \ BRCMF_FEAT_DEF(MONITOR_FMT_RADIOTAP) \ BRCMF_FEAT_DEF(MONITOR_FMT_HW_RX_HDR) \ - BRCMF_FEAT_DEF(DOT11H) + BRCMF_FEAT_DEF(DOT11H) \ --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h @@ -49,6 +49,8 @@ diff --git a/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch b/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch index 988ece1f5f18..905fd4b56e84 100644 --- a/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch +++ b/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch @@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -2874,6 +2874,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip +@@ -2936,6 +2936,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip * preference in cfg struct to apply this to * FW later while initializing the dongle */ diff --git a/package/kernel/mac80211/patches/brcm/998-survey.patch b/package/kernel/mac80211/patches/brcm/998-survey.patch index 3c52cec0b915..b98cb0632c46 100644 --- a/package/kernel/mac80211/patches/brcm/998-survey.patch +++ b/package/kernel/mac80211/patches/brcm/998-survey.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -2826,6 +2826,63 @@ done: +@@ -2888,6 +2888,63 @@ done: } static int @@ -64,7 +64,7 @@ brcmf_cfg80211_dump_station(struct wiphy *wiphy, struct net_device *ndev, int idx, u8 *mac, struct station_info *sinfo) { -@@ -2915,6 +2972,7 @@ static s32 brcmf_inform_single_bss(struc +@@ -2977,6 +3034,7 @@ static s32 brcmf_inform_single_bss(struc struct brcmu_chan ch; u16 channel; u32 freq; @@ -72,7 +72,7 @@ u16 notify_capability; u16 notify_interval; u8 *notify_ie; -@@ -2939,6 +2997,17 @@ static s32 brcmf_inform_single_bss(struc +@@ -3001,6 +3059,17 @@ static s32 brcmf_inform_single_bss(struc band = NL80211_BAND_5GHZ; freq = ieee80211_channel_to_frequency(channel, band); @@ -90,7 +90,7 @@ bss_data.chan = ieee80211_get_channel(wiphy, freq); bss_data.scan_width = NL80211_BSS_CHAN_WIDTH_20; bss_data.boottime_ns = ktime_to_ns(ktime_get_boottime()); -@@ -5356,6 +5425,7 @@ static struct cfg80211_ops brcmf_cfg8021 +@@ -5418,6 +5487,7 @@ static struct cfg80211_ops brcmf_cfg8021 .leave_ibss = brcmf_cfg80211_leave_ibss, .get_station = brcmf_cfg80211_get_station, .dump_station = brcmf_cfg80211_dump_station, diff --git a/package/kernel/mac80211/patches/build/015-ipw200-mtu.patch b/package/kernel/mac80211/patches/build/015-ipw200-mtu.patch index 0e51b0ffbc06..59d3b62f9dcf 100644 --- a/package/kernel/mac80211/patches/build/015-ipw200-mtu.patch +++ b/package/kernel/mac80211/patches/build/015-ipw200-mtu.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c -@@ -11482,6 +11482,15 @@ static const struct attribute_group ipw_ +@@ -11479,6 +11479,15 @@ static const struct attribute_group ipw_ .attrs = ipw_sysfs_entries, }; @@ -16,7 +16,7 @@ #ifdef CPTCFG_IPW2200_PROMISCUOUS static int ipw_prom_open(struct net_device *dev) { -@@ -11530,15 +11539,6 @@ static netdev_tx_t ipw_prom_hard_start_x +@@ -11527,15 +11536,6 @@ static netdev_tx_t ipw_prom_hard_start_x return NETDEV_TX_OK; } diff --git a/package/kernel/mac80211/patches/build/050-lib80211_option.patch b/package/kernel/mac80211/patches/build/050-lib80211_option.patch index 1578286c2bd6..c6174449c662 100644 --- a/package/kernel/mac80211/patches/build/050-lib80211_option.patch +++ b/package/kernel/mac80211/patches/build/050-lib80211_option.patch @@ -1,6 +1,6 @@ --- a/net/wireless/Kconfig +++ b/net/wireless/Kconfig -@@ -186,7 +186,7 @@ config CFG80211_WEXT_EXPORT +@@ -187,7 +187,7 @@ config CFG80211_WEXT_EXPORT endif # CFG80211 config LIB80211 @@ -9,7 +9,7 @@ depends on m default n help -@@ -196,18 +196,18 @@ config LIB80211 +@@ -197,18 +197,18 @@ config LIB80211 Drivers should select this themselves if needed. config LIB80211_CRYPT_WEP diff --git a/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch b/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch index fa12232f1bac..3b89013d3c3c 100644 --- a/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch +++ b/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -4048,6 +4048,12 @@ out: +@@ -4116,6 +4116,12 @@ out: netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, struct net_device *dev) { diff --git a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch index 3c5d1d63a860..428c1892d5ab 100644 --- a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch +++ b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch @@ -18,7 +18,7 @@ static int ieee80211_ifa6_changed(struct notifier_block *nb, unsigned long data, void *arg) { -@@ -1267,14 +1267,14 @@ int ieee80211_register_hw(struct ieee802 +@@ -1272,14 +1272,14 @@ int ieee80211_register_hw(struct ieee802 rtnl_unlock(); @@ -35,7 +35,7 @@ local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed; result = register_inet6addr_notifier(&local->ifa6_notifier); if (result) -@@ -1283,13 +1283,13 @@ int ieee80211_register_hw(struct ieee802 +@@ -1288,13 +1288,13 @@ int ieee80211_register_hw(struct ieee802 return 0; @@ -52,7 +52,7 @@ fail_ifa: #endif wiphy_unregister(local->hw.wiphy); -@@ -1317,10 +1317,10 @@ void ieee80211_unregister_hw(struct ieee +@@ -1322,10 +1322,10 @@ void ieee80211_unregister_hw(struct ieee tasklet_kill(&local->tx_pending_tasklet); tasklet_kill(&local->tasklet); diff --git a/package/kernel/mac80211/patches/subsys/250-mac80211-populate-debugfs-only-after-cfg80211-init.patch b/package/kernel/mac80211/patches/subsys/250-mac80211-populate-debugfs-only-after-cfg80211-init.patch new file mode 100644 index 000000000000..efe216c53092 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/250-mac80211-populate-debugfs-only-after-cfg80211-init.patch @@ -0,0 +1,248 @@ +From 6cb5f3ea4654faf8c28b901266e960b1a4787b26 Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Thu, 23 Apr 2020 11:13:49 +0200 +Subject: [PATCH] mac80211: populate debugfs only after cfg80211 init + +When fixing the initialization race, we neglected to account for +the fact that debugfs is initialized in wiphy_register(), and +some debugfs things went missing (or rather were rerooted to the +global debugfs root). + +Fix this by adding debugfs entries only after wiphy_register(). +This requires some changes in the rate control code since it +currently adds debugfs at alloc time, which can no longer be +done after the reordering. + +Reported-by: Jouni Malinen +Reported-by: kernel test robot +Reported-by: Hauke Mehrtens +Reported-by: Felix Fietkau +Cc: stable@vger.kernel.org +Fixes: 52e04b4ce5d0 ("mac80211: fix race in ieee80211_register_hw()") +Signed-off-by: Johannes Berg +Acked-by: Sumit Garg +Link: https://lore.kernel.org/r/20200423111344.0e00d3346f12.Iadc76a03a55093d94391fc672e996a458702875d@changeid +Signed-off-by: Johannes Berg +--- + drivers/net/wireless/intel/iwlegacy/3945-rs.c | 2 +- + drivers/net/wireless/intel/iwlegacy/4965-rs.c | 2 +- + drivers/net/wireless/intel/iwlwifi/dvm/rs.c | 2 +- + drivers/net/wireless/intel/iwlwifi/mvm/rs.c | 2 +- + drivers/net/wireless/realtek/rtlwifi/rc.c | 2 +- + include/net/mac80211.h | 4 +++- + net/mac80211/main.c | 5 ++-- + net/mac80211/rate.c | 15 ++++-------- + net/mac80211/rate.h | 23 +++++++++++++++++++ + net/mac80211/rc80211_minstrel_ht.c | 19 ++++++++++----- + 10 files changed, 51 insertions(+), 25 deletions(-) + +--- a/drivers/net/wireless/intel/iwlegacy/3945-rs.c ++++ b/drivers/net/wireless/intel/iwlegacy/3945-rs.c +@@ -374,7 +374,7 @@ out: + } + + static void * +-il3945_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) ++il3945_rs_alloc(struct ieee80211_hw *hw) + { + return hw->priv; + } +--- a/drivers/net/wireless/intel/iwlegacy/4965-rs.c ++++ b/drivers/net/wireless/intel/iwlegacy/4965-rs.c +@@ -2474,7 +2474,7 @@ il4965_rs_fill_link_cmd(struct il_priv * + } + + static void * +-il4965_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) ++il4965_rs_alloc(struct ieee80211_hw *hw) + { + return hw->priv; + } +--- a/drivers/net/wireless/intel/iwlwifi/dvm/rs.c ++++ b/drivers/net/wireless/intel/iwlwifi/dvm/rs.c +@@ -3019,7 +3019,7 @@ static void rs_fill_link_cmd(struct iwl_ + cpu_to_le16(priv->lib->bt_params->agg_time_limit); + } + +-static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) ++static void *rs_alloc(struct ieee80211_hw *hw) + { + return hw->priv; + } +--- a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c +@@ -3665,7 +3665,7 @@ static void rs_fill_lq_cmd(struct iwl_mv + cpu_to_le16(iwl_mvm_coex_agg_time_limit(mvm, sta)); + } + +-static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) ++static void *rs_alloc(struct ieee80211_hw *hw) + { + return hw->priv; + } +--- a/drivers/net/wireless/realtek/rtlwifi/rc.c ++++ b/drivers/net/wireless/realtek/rtlwifi/rc.c +@@ -261,7 +261,7 @@ static void rtl_rate_update(void *ppriv, + { + } + +-static void *rtl_rate_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) ++static void *rtl_rate_alloc(struct ieee80211_hw *hw) + { + struct rtl_priv *rtlpriv = rtl_priv(hw); + return rtlpriv; +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -5969,7 +5969,9 @@ enum rate_control_capabilities { + struct rate_control_ops { + unsigned long capa; + const char *name; +- void *(*alloc)(struct ieee80211_hw *hw, struct dentry *debugfsdir); ++ void *(*alloc)(struct ieee80211_hw *hw); ++ void (*add_debugfs)(struct ieee80211_hw *hw, void *priv, ++ struct dentry *debugfsdir); + void (*free)(void *priv); + + void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp); +--- a/net/mac80211/main.c ++++ b/net/mac80211/main.c +@@ -1163,8 +1163,6 @@ int ieee80211_register_hw(struct ieee802 + local->tx_headroom = max_t(unsigned int , local->hw.extra_tx_headroom, + IEEE80211_TX_STATUS_HEADROOM); + +- debugfs_hw_add(local); +- + /* + * if the driver doesn't specify a max listen interval we + * use 5 which should be a safe default +@@ -1256,6 +1254,9 @@ int ieee80211_register_hw(struct ieee802 + if (result < 0) + goto fail_wiphy_register; + ++ debugfs_hw_add(local); ++ rate_control_add_debugfs(local); ++ + rtnl_lock(); + + /* add one default STA interface if supported */ +--- a/net/mac80211/rate.c ++++ b/net/mac80211/rate.c +@@ -214,17 +214,16 @@ static ssize_t rcname_read(struct file * + ref->ops->name, len); + } + +-static const struct file_operations rcname_ops = { ++const struct file_operations rcname_ops = { + .read = rcname_read, + .open = simple_open, + .llseek = default_llseek, + }; + #endif + +-static struct rate_control_ref *rate_control_alloc(const char *name, +- struct ieee80211_local *local) ++static struct rate_control_ref * ++rate_control_alloc(const char *name, struct ieee80211_local *local) + { +- struct dentry *debugfsdir = NULL; + struct rate_control_ref *ref; + + ref = kmalloc(sizeof(struct rate_control_ref), GFP_KERNEL); +@@ -234,13 +233,7 @@ static struct rate_control_ref *rate_con + if (!ref->ops) + goto free; + +-#ifdef CPTCFG_MAC80211_DEBUGFS +- debugfsdir = debugfs_create_dir("rc", local->hw.wiphy->debugfsdir); +- local->debugfs.rcdir = debugfsdir; +- debugfs_create_file("name", 0400, debugfsdir, ref, &rcname_ops); +-#endif +- +- ref->priv = ref->ops->alloc(&local->hw, debugfsdir); ++ ref->priv = ref->ops->alloc(&local->hw); + if (!ref->priv) + goto free; + return ref; +--- a/net/mac80211/rate.h ++++ b/net/mac80211/rate.h +@@ -60,6 +60,29 @@ static inline void rate_control_add_sta_ + #endif + } + ++extern const struct file_operations rcname_ops; ++ ++static inline void rate_control_add_debugfs(struct ieee80211_local *local) ++{ ++#ifdef CPTCFG_MAC80211_DEBUGFS ++ struct dentry *debugfsdir; ++ ++ if (!local->rate_ctrl) ++ return; ++ ++ if (!local->rate_ctrl->ops->add_debugfs) ++ return; ++ ++ debugfsdir = debugfs_create_dir("rc", local->hw.wiphy->debugfsdir); ++ local->debugfs.rcdir = debugfsdir; ++ debugfs_create_file("name", 0400, debugfsdir, ++ local->rate_ctrl, &rcname_ops); ++ ++ local->rate_ctrl->ops->add_debugfs(&local->hw, local->rate_ctrl->priv, ++ debugfsdir); ++#endif ++} ++ + void ieee80211_check_rate_mask(struct ieee80211_sub_if_data *sdata); + + /* Get a reference to the rate control algorithm. If `name' is NULL, get the +--- a/net/mac80211/rc80211_minstrel_ht.c ++++ b/net/mac80211/rc80211_minstrel_ht.c +@@ -1635,7 +1635,7 @@ minstrel_ht_init_cck_rates(struct minstr + } + + static void * +-minstrel_ht_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) ++minstrel_ht_alloc(struct ieee80211_hw *hw) + { + struct minstrel_priv *mp; + +@@ -1673,7 +1673,17 @@ minstrel_ht_alloc(struct ieee80211_hw *h + mp->update_interval = HZ / 10; + mp->new_avg = true; + ++ minstrel_ht_init_cck_rates(mp); ++ ++ return mp; ++} ++ + #ifdef CPTCFG_MAC80211_DEBUGFS ++static void minstrel_ht_add_debugfs(struct ieee80211_hw *hw, void *priv, ++ struct dentry *debugfsdir) ++{ ++ struct minstrel_priv *mp = priv; ++ + mp->fixed_rate_idx = (u32) -1; + debugfs_create_u32("fixed_rate_idx", S_IRUGO | S_IWUGO, debugfsdir, + &mp->fixed_rate_idx); +@@ -1681,12 +1691,8 @@ minstrel_ht_alloc(struct ieee80211_hw *h + &mp->sample_switch); + debugfs_create_bool("new_avg", S_IRUGO | S_IWUSR, debugfsdir, + &mp->new_avg); +-#endif +- +- minstrel_ht_init_cck_rates(mp); +- +- return mp; + } ++#endif + + static void + minstrel_ht_free(void *priv) +@@ -1725,6 +1731,7 @@ static const struct rate_control_ops mac + .alloc = minstrel_ht_alloc, + .free = minstrel_ht_free, + #ifdef CPTCFG_MAC80211_DEBUGFS ++ .add_debugfs = minstrel_ht_add_debugfs, + .add_sta_debugfs = minstrel_ht_add_sta_debugfs, + #endif + .get_expected_throughput = minstrel_ht_get_expected_throughput, diff --git a/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch b/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch index dcdb94565d6d..8c019530d173 100644 --- a/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch +++ b/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch @@ -24,7 +24,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1782,6 +1782,9 @@ int ieee80211_tx_control_port(struct wip +@@ -1786,6 +1786,9 @@ int ieee80211_tx_control_port(struct wip const u8 *dest, __be16 proto, bool unencrypted); int ieee80211_probe_mesh_link(struct wiphy *wiphy, struct net_device *dev, const u8 *buf, size_t len); @@ -36,7 +36,7 @@ Signed-off-by: Felix Fietkau void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata, --- a/net/mac80211/status.c +++ b/net/mac80211/status.c -@@ -815,6 +815,11 @@ void ieee80211_tx_monitor(struct ieee802 +@@ -829,6 +829,11 @@ void ieee80211_tx_monitor(struct ieee802 struct net_device *prev_dev = NULL; int rtap_len; @@ -50,7 +50,7 @@ Signed-off-by: Felix Fietkau if (WARN_ON_ONCE(skb_headroom(skb) < rtap_len)) { --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -1943,37 +1943,53 @@ static bool ieee80211_tx(struct ieee8021 +@@ -1936,37 +1936,53 @@ static bool ieee80211_tx(struct ieee8021 } /* device xmit handlers */ @@ -123,7 +123,7 @@ Signed-off-by: Felix Fietkau wiphy_debug(local->hw.wiphy, "failed to reallocate TX buffer\n"); return -ENOMEM; -@@ -1989,18 +2005,8 @@ void ieee80211_xmit(struct ieee80211_sub +@@ -1982,18 +1998,8 @@ void ieee80211_xmit(struct ieee80211_sub struct ieee80211_local *local = sdata->local; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_hdr *hdr; @@ -143,7 +143,7 @@ Signed-off-by: Felix Fietkau ieee80211_free_txskb(&local->hw, skb); return; } -@@ -2790,29 +2796,13 @@ static struct sk_buff *ieee80211_build_h +@@ -2795,29 +2801,13 @@ static struct sk_buff *ieee80211_build_h } skb_pull(skb, skip_header_bytes); @@ -179,7 +179,7 @@ Signed-off-by: Felix Fietkau } if (encaps_data) -@@ -3427,7 +3417,6 @@ static bool ieee80211_xmit_fast(struct i +@@ -3432,7 +3422,6 @@ static bool ieee80211_xmit_fast(struct i struct ieee80211_local *local = sdata->local; u16 ethertype = (skb->data[12] << 8) | skb->data[13]; int extra_head = fast_tx->hdr_len - (ETH_HLEN - 2); @@ -187,7 +187,7 @@ Signed-off-by: Felix Fietkau struct ethhdr eth; struct ieee80211_tx_info *info; struct ieee80211_hdr *hdr = (void *)fast_tx->hdr; -@@ -3479,10 +3468,7 @@ static bool ieee80211_xmit_fast(struct i +@@ -3484,10 +3473,7 @@ static bool ieee80211_xmit_fast(struct i * as the may-encrypt argument for the resize to not account for * more room than we already have in 'extra_head' */ diff --git a/package/kernel/mac80211/patches/subsys/301-mac80211-minstrel-remove-divisions-in-tx-status-path.patch b/package/kernel/mac80211/patches/subsys/301-mac80211-minstrel-remove-divisions-in-tx-status-path.patch deleted file mode 100644 index 91fb92f1b2b7..000000000000 --- a/package/kernel/mac80211/patches/subsys/301-mac80211-minstrel-remove-divisions-in-tx-status-path.patch +++ /dev/null @@ -1,61 +0,0 @@ -From: Felix Fietkau -Date: Sat, 28 Sep 2019 15:44:06 +0200 -Subject: [PATCH] mac80211: minstrel: remove divisions in tx status path - -Use a slightly different threshold for downgrading spatial streams to -make it easier to calculate without divisions. -Slightly reduces CPU overhead. - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/rc80211_minstrel.c -+++ b/net/mac80211/rc80211_minstrel.c -@@ -289,8 +289,7 @@ minstrel_tx_status(void *priv, struct ie - if (mi->sample_deferred > 0) - mi->sample_deferred--; - -- if (time_after(jiffies, mi->last_stats_update + -- (mp->update_interval * HZ) / 1000)) -+ if (time_after(jiffies, mi->last_stats_update + mp->update_interval)) - minstrel_update_stats(mp, mi); - } - ---- a/net/mac80211/rc80211_minstrel_ht.c -+++ b/net/mac80211/rc80211_minstrel_ht.c -@@ -970,23 +970,21 @@ minstrel_ht_tx_status(void *priv, struct - */ - rate = minstrel_get_ratestats(mi, mi->max_tp_rate[0]); - if (rate->attempts > 30 && -- MINSTREL_FRAC(rate->success, rate->attempts) < -- MINSTREL_FRAC(20, 100)) { -+ rate->success < rate->attempts / 4) { - minstrel_downgrade_rate(mi, &mi->max_tp_rate[0], true); - update = true; - } - - rate2 = minstrel_get_ratestats(mi, mi->max_tp_rate[1]); - if (rate2->attempts > 30 && -- MINSTREL_FRAC(rate2->success, rate2->attempts) < -- MINSTREL_FRAC(20, 100)) { -+ rate2->success < rate2->attempts / 4) { - minstrel_downgrade_rate(mi, &mi->max_tp_rate[1], false); - update = true; - } - } - - if (time_after(jiffies, mi->last_stats_update + -- (mp->update_interval / 2 * HZ) / 1000)) { -+ mp->update_interval / 2)) { - update = true; - minstrel_ht_update_stats(mp, mi, true); - } -@@ -1666,7 +1664,7 @@ minstrel_ht_alloc(struct ieee80211_hw *h - mp->has_mrr = true; - - mp->hw = hw; -- mp->update_interval = 100; -+ mp->update_interval = HZ / 10; - - minstrel_ht_init_cck_rates(mp); - diff --git a/package/kernel/mac80211/patches/subsys/302-mac80211-minstrel_ht-replace-rate-stats-ewma-with-a-.patch b/package/kernel/mac80211/patches/subsys/302-mac80211-minstrel_ht-replace-rate-stats-ewma-with-a-.patch deleted file mode 100644 index 78e8527a5c90..000000000000 --- a/package/kernel/mac80211/patches/subsys/302-mac80211-minstrel_ht-replace-rate-stats-ewma-with-a-.patch +++ /dev/null @@ -1,235 +0,0 @@ -From: Felix Fietkau -Date: Sat, 28 Sep 2019 15:46:06 +0200 -Subject: [PATCH] mac80211: minstrel_ht: replace rate stats ewma with a - better moving average - -Rate success probability usually fluctuates a lot under normal conditions. -With a simple EWMA, noise and fluctuation can be reduced by increasing the -window length, but that comes at the cost of introducing lag on sudden -changes. - -This change replaces the EWMA implementation with a moving average that's -designed to significantly reduce lag while keeping a bigger window size -by being better at filtering out noise. - -It is only slightly more expensive than the simple EWMA and still avoids -divisions in its calculation. - -The algorithm is adapted from an implementation intended for a completely -different field (stock market trading), where the tradeoff of lag vs -noise filtering is equally important. - -The algorithm works in the same way as the "smoothing filter" from -http://www.stockspotter.com/files/PredictiveIndicators.pdf adapted for -fixed-point math with some constants, using only addition, bit shifts -and multiplication - -To better make use of the filtering and bigger window size, the update -interval is cut in half. - -For testing, the algorithm can be reverted to the older one via debugfs - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/rc80211_minstrel.c -+++ b/net/mac80211/rc80211_minstrel.c -@@ -157,14 +157,18 @@ minstrel_update_rates(struct minstrel_pr - * Recalculate statistics and counters of a given rate - */ - void --minstrel_calc_rate_stats(struct minstrel_rate_stats *mrs) -+minstrel_calc_rate_stats(struct minstrel_priv *mp, -+ struct minstrel_rate_stats *mrs) - { - unsigned int cur_prob; - - if (unlikely(mrs->attempts > 0)) { - mrs->sample_skipped = 0; - cur_prob = MINSTREL_FRAC(mrs->success, mrs->attempts); -- if (unlikely(!mrs->att_hist)) { -+ if (mp->new_avg) { -+ mrs->prob_ewma = minstrel_filter_avg_add(&mrs->avg, -+ cur_prob); -+ } else if (unlikely(!mrs->att_hist)) { - mrs->prob_ewma = cur_prob; - } else { - /*update exponential weighted moving avarage */ -@@ -200,7 +204,7 @@ minstrel_update_stats(struct minstrel_pr - struct minstrel_rate_stats *tmp_mrs = &mi->r[tmp_prob_rate].stats; - - /* Update statistics of success probability per rate */ -- minstrel_calc_rate_stats(mrs); -+ minstrel_calc_rate_stats(mp, mrs); - - /* Sample less often below the 10% chance of success. - * Sample less often above the 95% chance of success. */ -@@ -289,7 +293,8 @@ minstrel_tx_status(void *priv, struct ie - if (mi->sample_deferred > 0) - mi->sample_deferred--; - -- if (time_after(jiffies, mi->last_stats_update + mp->update_interval)) -+ if (time_after(jiffies, mi->last_stats_update + -+ mp->update_interval / (mp->new_avg ? 2 : 1))) - minstrel_update_stats(mp, mi); - } - ---- a/net/mac80211/rc80211_minstrel.h -+++ b/net/mac80211/rc80211_minstrel.h -@@ -19,6 +19,21 @@ - #define MAX_THR_RATES 4 - - /* -+ * Coefficients for moving average with noise filter (period=16), -+ * scaled by 10 bits -+ * -+ * a1 = exp(-pi * sqrt(2) / period) -+ * coeff2 = 2 * a1 * cos(sqrt(2) * 2 * pi / period) -+ * coeff3 = -sqr(a1) -+ * coeff1 = 1 - coeff2 - coeff3 -+ */ -+#define MINSTREL_AVG_COEFF1 (MINSTREL_FRAC(1, 1) - \ -+ MINSTREL_AVG_COEFF2 - \ -+ MINSTREL_AVG_COEFF3) -+#define MINSTREL_AVG_COEFF2 0x00001499 -+#define MINSTREL_AVG_COEFF3 -0x0000092e -+ -+/* - * Perform EWMA (Exponentially Weighted Moving Average) calculation - */ - static inline int -@@ -32,6 +47,41 @@ minstrel_ewma(int old, int new, int weig - return old + incr; - } - -+struct minstrel_avg_ctx { -+ s32 prev[2]; -+}; -+ -+static inline int minstrel_filter_avg_add(struct minstrel_avg_ctx *ctx, s32 in) -+{ -+ s32 out_1 = ctx->prev[0]; -+ s32 out_2 = ctx->prev[1]; -+ s32 val; -+ -+ if (!in) -+ in += 1; -+ -+ if (!out_1) { -+ val = out_1 = in; -+ goto out; -+ } -+ -+ val = MINSTREL_AVG_COEFF1 * in; -+ val += MINSTREL_AVG_COEFF2 * out_1; -+ val += MINSTREL_AVG_COEFF3 * out_2; -+ val >>= MINSTREL_SCALE; -+ -+ if (val > 1 << MINSTREL_SCALE) -+ val = 1 << MINSTREL_SCALE; -+ if (val < 0) -+ val = 1; -+ -+out: -+ ctx->prev[1] = out_1; -+ ctx->prev[0] = val; -+ -+ return val; -+} -+ - struct minstrel_rate_stats { - /* current / last sampling period attempts/success counters */ - u16 attempts, last_attempts; -@@ -40,6 +90,8 @@ struct minstrel_rate_stats { - /* total attempts/success counters */ - u32 att_hist, succ_hist; - -+ struct minstrel_avg_ctx avg; -+ - /* prob_ewma - exponential weighted moving average of prob */ - u16 prob_ewma; - -@@ -95,6 +147,7 @@ struct minstrel_sta_info { - struct minstrel_priv { - struct ieee80211_hw *hw; - bool has_mrr; -+ bool new_avg; - u32 sample_switch; - unsigned int cw_min; - unsigned int cw_max; -@@ -126,7 +179,8 @@ extern const struct rate_control_ops mac - void minstrel_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir); - - /* Recalculate success probabilities and counters for a given rate using EWMA */ --void minstrel_calc_rate_stats(struct minstrel_rate_stats *mrs); -+void minstrel_calc_rate_stats(struct minstrel_priv *mp, -+ struct minstrel_rate_stats *mrs); - int minstrel_get_tp_avg(struct minstrel_rate *mr, int prob_ewma); - - /* debugfs */ ---- a/net/mac80211/rc80211_minstrel_ht.c -+++ b/net/mac80211/rc80211_minstrel_ht.c -@@ -737,7 +737,7 @@ minstrel_ht_update_stats(struct minstrel - - mrs = &mg->rates[i]; - mrs->retry_updated = false; -- minstrel_calc_rate_stats(mrs); -+ minstrel_calc_rate_stats(mp, mrs); - cur_prob = mrs->prob_ewma; - - if (minstrel_ht_get_tp_avg(mi, group, i, cur_prob) == 0) -@@ -773,6 +773,8 @@ minstrel_ht_update_stats(struct minstrel - - /* try to sample all available rates during each interval */ - mi->sample_count *= 8; -+ if (mp->new_avg) -+ mi->sample_count /= 2; - - if (sample) - minstrel_ht_rate_sample_switch(mp, mi); -@@ -889,6 +891,7 @@ minstrel_ht_tx_status(void *priv, struct - struct ieee80211_tx_rate *ar = info->status.rates; - struct minstrel_rate_stats *rate, *rate2, *rate_sample = NULL; - struct minstrel_priv *mp = priv; -+ u32 update_interval = mp->update_interval / 2; - bool last, update = false; - bool sample_status = false; - int i; -@@ -943,6 +946,10 @@ minstrel_ht_tx_status(void *priv, struct - - switch (mi->sample_mode) { - case MINSTREL_SAMPLE_IDLE: -+ if (mp->new_avg && -+ (mp->hw->max_rates > 1 || -+ mi->total_packets_cur < SAMPLE_SWITCH_THR)) -+ update_interval /= 2; - break; - - case MINSTREL_SAMPLE_ACTIVE: -@@ -983,8 +990,7 @@ minstrel_ht_tx_status(void *priv, struct - } - } - -- if (time_after(jiffies, mi->last_stats_update + -- mp->update_interval / 2)) { -+ if (time_after(jiffies, mi->last_stats_update + update_interval)) { - update = true; - minstrel_ht_update_stats(mp, mi, true); - } -@@ -1665,6 +1671,7 @@ minstrel_ht_alloc(struct ieee80211_hw *h - - mp->hw = hw; - mp->update_interval = HZ / 10; -+ mp->new_avg = true; - - minstrel_ht_init_cck_rates(mp); - -@@ -1682,6 +1689,8 @@ static void minstrel_ht_add_debugfs(stru - &mp->fixed_rate_idx); - debugfs_create_u32("sample_switch", S_IRUGO | S_IWUSR, debugfsdir, - &mp->sample_switch); -+ debugfs_create_bool("new_avg", S_IRUGO | S_IWUSR, debugfsdir, -+ &mp->new_avg); - } - #endif - diff --git a/package/kernel/mac80211/patches/subsys/303-mac80211-minstrel_ht-rename-prob_ewma-to-prob_avg-us.patch b/package/kernel/mac80211/patches/subsys/303-mac80211-minstrel_ht-rename-prob_ewma-to-prob_avg-us.patch deleted file mode 100644 index f4c4bdb94e90..000000000000 --- a/package/kernel/mac80211/patches/subsys/303-mac80211-minstrel_ht-rename-prob_ewma-to-prob_avg-us.patch +++ /dev/null @@ -1,424 +0,0 @@ -From: Felix Fietkau -Date: Tue, 8 Oct 2019 18:54:46 +0200 -Subject: [PATCH] mac80211: minstrel_ht: rename prob_ewma to prob_avg, use it - for the new average - -Reduces per-rate data structure size - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/rc80211_minstrel.c -+++ b/net/mac80211/rc80211_minstrel.c -@@ -70,7 +70,7 @@ rix_to_ndx(struct minstrel_sta_info *mi, - } - - /* return current EMWA throughput */ --int minstrel_get_tp_avg(struct minstrel_rate *mr, int prob_ewma) -+int minstrel_get_tp_avg(struct minstrel_rate *mr, int prob_avg) - { - int usecs; - -@@ -79,13 +79,13 @@ int minstrel_get_tp_avg(struct minstrel_ - usecs = 1000000; - - /* reset thr. below 10% success */ -- if (mr->stats.prob_ewma < MINSTREL_FRAC(10, 100)) -+ if (mr->stats.prob_avg < MINSTREL_FRAC(10, 100)) - return 0; - -- if (prob_ewma > MINSTREL_FRAC(90, 100)) -+ if (prob_avg > MINSTREL_FRAC(90, 100)) - return MINSTREL_TRUNC(100000 * (MINSTREL_FRAC(90, 100) / usecs)); - else -- return MINSTREL_TRUNC(100000 * (prob_ewma / usecs)); -+ return MINSTREL_TRUNC(100000 * (prob_avg / usecs)); - } - - /* find & sort topmost throughput rates */ -@@ -98,8 +98,8 @@ minstrel_sort_best_tp_rates(struct minst - - for (j = MAX_THR_RATES; j > 0; --j) { - tmp_mrs = &mi->r[tp_list[j - 1]].stats; -- if (minstrel_get_tp_avg(&mi->r[i], cur_mrs->prob_ewma) <= -- minstrel_get_tp_avg(&mi->r[tp_list[j - 1]], tmp_mrs->prob_ewma)) -+ if (minstrel_get_tp_avg(&mi->r[i], cur_mrs->prob_avg) <= -+ minstrel_get_tp_avg(&mi->r[tp_list[j - 1]], tmp_mrs->prob_avg)) - break; - } - -@@ -166,15 +166,15 @@ minstrel_calc_rate_stats(struct minstrel - mrs->sample_skipped = 0; - cur_prob = MINSTREL_FRAC(mrs->success, mrs->attempts); - if (mp->new_avg) { -- mrs->prob_ewma = minstrel_filter_avg_add(&mrs->avg, -- cur_prob); -+ minstrel_filter_avg_add(&mrs->prob_avg, -+ &mrs->prob_avg_1, cur_prob); - } else if (unlikely(!mrs->att_hist)) { -- mrs->prob_ewma = cur_prob; -+ mrs->prob_avg = cur_prob; - } else { - /*update exponential weighted moving avarage */ -- mrs->prob_ewma = minstrel_ewma(mrs->prob_ewma, -- cur_prob, -- EWMA_LEVEL); -+ mrs->prob_avg = minstrel_ewma(mrs->prob_avg, -+ cur_prob, -+ EWMA_LEVEL); - } - mrs->att_hist += mrs->attempts; - mrs->succ_hist += mrs->success; -@@ -208,8 +208,8 @@ minstrel_update_stats(struct minstrel_pr - - /* Sample less often below the 10% chance of success. - * Sample less often above the 95% chance of success. */ -- if (mrs->prob_ewma > MINSTREL_FRAC(95, 100) || -- mrs->prob_ewma < MINSTREL_FRAC(10, 100)) { -+ if (mrs->prob_avg > MINSTREL_FRAC(95, 100) || -+ mrs->prob_avg < MINSTREL_FRAC(10, 100)) { - mr->adjusted_retry_count = mrs->retry_count >> 1; - if (mr->adjusted_retry_count > 2) - mr->adjusted_retry_count = 2; -@@ -229,14 +229,14 @@ minstrel_update_stats(struct minstrel_pr - * choose the maximum throughput rate as max_prob_rate - * (2) if all success probabilities < 95%, the rate with - * highest success probability is chosen as max_prob_rate */ -- if (mrs->prob_ewma >= MINSTREL_FRAC(95, 100)) { -- tmp_cur_tp = minstrel_get_tp_avg(mr, mrs->prob_ewma); -+ if (mrs->prob_avg >= MINSTREL_FRAC(95, 100)) { -+ tmp_cur_tp = minstrel_get_tp_avg(mr, mrs->prob_avg); - tmp_prob_tp = minstrel_get_tp_avg(&mi->r[tmp_prob_rate], -- tmp_mrs->prob_ewma); -+ tmp_mrs->prob_avg); - if (tmp_cur_tp >= tmp_prob_tp) - tmp_prob_rate = i; - } else { -- if (mrs->prob_ewma >= tmp_mrs->prob_ewma) -+ if (mrs->prob_avg >= tmp_mrs->prob_avg) - tmp_prob_rate = i; - } - } -@@ -426,7 +426,7 @@ minstrel_get_rate(void *priv, struct iee - * has a probability of >95%, we shouldn't be attempting - * to use it, as this only wastes precious airtime */ - if (!mrr_capable && -- (mi->r[ndx].stats.prob_ewma > MINSTREL_FRAC(95, 100))) -+ (mi->r[ndx].stats.prob_avg > MINSTREL_FRAC(95, 100))) - return; - - mi->prev_sample = true; -@@ -577,7 +577,7 @@ static u32 minstrel_get_expected_through - * computing cur_tp - */ - tmp_mrs = &mi->r[idx].stats; -- tmp_cur_tp = minstrel_get_tp_avg(&mi->r[idx], tmp_mrs->prob_ewma) * 10; -+ tmp_cur_tp = minstrel_get_tp_avg(&mi->r[idx], tmp_mrs->prob_avg) * 10; - tmp_cur_tp = tmp_cur_tp * 1200 * 8 / 1024; - - return tmp_cur_tp; ---- a/net/mac80211/rc80211_minstrel.h -+++ b/net/mac80211/rc80211_minstrel.h -@@ -47,14 +47,10 @@ minstrel_ewma(int old, int new, int weig - return old + incr; - } - --struct minstrel_avg_ctx { -- s32 prev[2]; --}; -- --static inline int minstrel_filter_avg_add(struct minstrel_avg_ctx *ctx, s32 in) -+static inline int minstrel_filter_avg_add(u16 *prev_1, u16 *prev_2, s32 in) - { -- s32 out_1 = ctx->prev[0]; -- s32 out_2 = ctx->prev[1]; -+ s32 out_1 = *prev_1; -+ s32 out_2 = *prev_2; - s32 val; - - if (!in) -@@ -76,8 +72,8 @@ static inline int minstrel_filter_avg_ad - val = 1; - - out: -- ctx->prev[1] = out_1; -- ctx->prev[0] = val; -+ *prev_2 = out_1; -+ *prev_1 = val; - - return val; - } -@@ -90,10 +86,9 @@ struct minstrel_rate_stats { - /* total attempts/success counters */ - u32 att_hist, succ_hist; - -- struct minstrel_avg_ctx avg; -- -- /* prob_ewma - exponential weighted moving average of prob */ -- u16 prob_ewma; -+ /* prob_avg - moving average of prob */ -+ u16 prob_avg; -+ u16 prob_avg_1; - - /* maximum retry counts */ - u8 retry_count; -@@ -181,7 +176,7 @@ void minstrel_add_sta_debugfs(void *priv - /* Recalculate success probabilities and counters for a given rate using EWMA */ - void minstrel_calc_rate_stats(struct minstrel_priv *mp, - struct minstrel_rate_stats *mrs); --int minstrel_get_tp_avg(struct minstrel_rate *mr, int prob_ewma); -+int minstrel_get_tp_avg(struct minstrel_rate *mr, int prob_avg); - - /* debugfs */ - int minstrel_stats_open(struct inode *inode, struct file *file); ---- a/net/mac80211/rc80211_minstrel_debugfs.c -+++ b/net/mac80211/rc80211_minstrel_debugfs.c -@@ -90,8 +90,8 @@ minstrel_stats_open(struct inode *inode, - p += sprintf(p, "%6u ", mr->perfect_tx_time); - - tp_max = minstrel_get_tp_avg(mr, MINSTREL_FRAC(100,100)); -- tp_avg = minstrel_get_tp_avg(mr, mrs->prob_ewma); -- eprob = MINSTREL_TRUNC(mrs->prob_ewma * 1000); -+ tp_avg = minstrel_get_tp_avg(mr, mrs->prob_avg); -+ eprob = MINSTREL_TRUNC(mrs->prob_avg * 1000); - - p += sprintf(p, "%4u.%1u %4u.%1u %3u.%1u" - " %3u %3u %-3u " -@@ -147,8 +147,8 @@ minstrel_stats_csv_open(struct inode *in - p += sprintf(p, "%u,",mr->perfect_tx_time); - - tp_max = minstrel_get_tp_avg(mr, MINSTREL_FRAC(100,100)); -- tp_avg = minstrel_get_tp_avg(mr, mrs->prob_ewma); -- eprob = MINSTREL_TRUNC(mrs->prob_ewma * 1000); -+ tp_avg = minstrel_get_tp_avg(mr, mrs->prob_avg); -+ eprob = MINSTREL_TRUNC(mrs->prob_avg * 1000); - - p += sprintf(p, "%u.%u,%u.%u,%u.%u,%u,%u,%u," - "%llu,%llu,%d,%d\n", ---- a/net/mac80211/rc80211_minstrel_ht.c -+++ b/net/mac80211/rc80211_minstrel_ht.c -@@ -346,12 +346,12 @@ minstrel_ht_avg_ampdu_len(struct minstre - */ - int - minstrel_ht_get_tp_avg(struct minstrel_ht_sta *mi, int group, int rate, -- int prob_ewma) -+ int prob_avg) - { - unsigned int nsecs = 0; - - /* do not account throughput if sucess prob is below 10% */ -- if (prob_ewma < MINSTREL_FRAC(10, 100)) -+ if (prob_avg < MINSTREL_FRAC(10, 100)) - return 0; - - if (group != MINSTREL_CCK_GROUP) -@@ -365,11 +365,11 @@ minstrel_ht_get_tp_avg(struct minstrel_h - * account for collision related packet error rate fluctuation - * (prob is scaled - see MINSTREL_FRAC above) - */ -- if (prob_ewma > MINSTREL_FRAC(90, 100)) -+ if (prob_avg > MINSTREL_FRAC(90, 100)) - return MINSTREL_TRUNC(100000 * ((MINSTREL_FRAC(90, 100) * 1000) - / nsecs)); - else -- return MINSTREL_TRUNC(100000 * ((prob_ewma * 1000) / nsecs)); -+ return MINSTREL_TRUNC(100000 * ((prob_avg * 1000) / nsecs)); - } - - /* -@@ -389,13 +389,13 @@ minstrel_ht_sort_best_tp_rates(struct mi - - cur_group = index / MCS_GROUP_RATES; - cur_idx = index % MCS_GROUP_RATES; -- cur_prob = mi->groups[cur_group].rates[cur_idx].prob_ewma; -+ cur_prob = mi->groups[cur_group].rates[cur_idx].prob_avg; - cur_tp_avg = minstrel_ht_get_tp_avg(mi, cur_group, cur_idx, cur_prob); - - do { - tmp_group = tp_list[j - 1] / MCS_GROUP_RATES; - tmp_idx = tp_list[j - 1] % MCS_GROUP_RATES; -- tmp_prob = mi->groups[tmp_group].rates[tmp_idx].prob_ewma; -+ tmp_prob = mi->groups[tmp_group].rates[tmp_idx].prob_avg; - tmp_tp_avg = minstrel_ht_get_tp_avg(mi, tmp_group, tmp_idx, - tmp_prob); - if (cur_tp_avg < tmp_tp_avg || -@@ -432,7 +432,7 @@ minstrel_ht_set_best_prob_rate(struct mi - - tmp_group = mi->max_prob_rate / MCS_GROUP_RATES; - tmp_idx = mi->max_prob_rate % MCS_GROUP_RATES; -- tmp_prob = mi->groups[tmp_group].rates[tmp_idx].prob_ewma; -+ tmp_prob = mi->groups[tmp_group].rates[tmp_idx].prob_avg; - tmp_tp_avg = minstrel_ht_get_tp_avg(mi, tmp_group, tmp_idx, tmp_prob); - - /* if max_tp_rate[0] is from MCS_GROUP max_prob_rate get selected from -@@ -444,11 +444,11 @@ minstrel_ht_set_best_prob_rate(struct mi - - max_gpr_group = mg->max_group_prob_rate / MCS_GROUP_RATES; - max_gpr_idx = mg->max_group_prob_rate % MCS_GROUP_RATES; -- max_gpr_prob = mi->groups[max_gpr_group].rates[max_gpr_idx].prob_ewma; -+ max_gpr_prob = mi->groups[max_gpr_group].rates[max_gpr_idx].prob_avg; - -- if (mrs->prob_ewma > MINSTREL_FRAC(75, 100)) { -+ if (mrs->prob_avg > MINSTREL_FRAC(75, 100)) { - cur_tp_avg = minstrel_ht_get_tp_avg(mi, cur_group, cur_idx, -- mrs->prob_ewma); -+ mrs->prob_avg); - if (cur_tp_avg > tmp_tp_avg) - mi->max_prob_rate = index; - -@@ -458,9 +458,9 @@ minstrel_ht_set_best_prob_rate(struct mi - if (cur_tp_avg > max_gpr_tp_avg) - mg->max_group_prob_rate = index; - } else { -- if (mrs->prob_ewma > tmp_prob) -+ if (mrs->prob_avg > tmp_prob) - mi->max_prob_rate = index; -- if (mrs->prob_ewma > max_gpr_prob) -+ if (mrs->prob_avg > max_gpr_prob) - mg->max_group_prob_rate = index; - } - } -@@ -482,12 +482,12 @@ minstrel_ht_assign_best_tp_rates(struct - - tmp_group = tmp_cck_tp_rate[0] / MCS_GROUP_RATES; - tmp_idx = tmp_cck_tp_rate[0] % MCS_GROUP_RATES; -- tmp_prob = mi->groups[tmp_group].rates[tmp_idx].prob_ewma; -+ tmp_prob = mi->groups[tmp_group].rates[tmp_idx].prob_avg; - tmp_cck_tp = minstrel_ht_get_tp_avg(mi, tmp_group, tmp_idx, tmp_prob); - - tmp_group = tmp_mcs_tp_rate[0] / MCS_GROUP_RATES; - tmp_idx = tmp_mcs_tp_rate[0] % MCS_GROUP_RATES; -- tmp_prob = mi->groups[tmp_group].rates[tmp_idx].prob_ewma; -+ tmp_prob = mi->groups[tmp_group].rates[tmp_idx].prob_avg; - tmp_mcs_tp = minstrel_ht_get_tp_avg(mi, tmp_group, tmp_idx, tmp_prob); - - if (tmp_cck_tp_rate && tmp_cck_tp > tmp_mcs_tp) { -@@ -518,7 +518,7 @@ minstrel_ht_prob_rate_reduce_streams(str - continue; - - tmp_idx = mg->max_group_prob_rate % MCS_GROUP_RATES; -- tmp_prob = mi->groups[group].rates[tmp_idx].prob_ewma; -+ tmp_prob = mi->groups[group].rates[tmp_idx].prob_avg; - - if (tmp_tp < minstrel_ht_get_tp_avg(mi, group, tmp_idx, tmp_prob) && - (minstrel_mcs_groups[group].streams < tmp_max_streams)) { -@@ -623,7 +623,7 @@ minstrel_ht_rate_sample_switch(struct mi - * If that fails, look again for a rate that is at least as fast - */ - mrs = minstrel_get_ratestats(mi, mi->max_tp_rate[0]); -- faster_rate = mrs->prob_ewma > MINSTREL_FRAC(75, 100); -+ faster_rate = mrs->prob_avg > MINSTREL_FRAC(75, 100); - minstrel_ht_find_probe_rates(mi, rates, &n_rates, faster_rate); - if (!n_rates && faster_rate) - minstrel_ht_find_probe_rates(mi, rates, &n_rates, false); -@@ -738,7 +738,7 @@ minstrel_ht_update_stats(struct minstrel - mrs = &mg->rates[i]; - mrs->retry_updated = false; - minstrel_calc_rate_stats(mp, mrs); -- cur_prob = mrs->prob_ewma; -+ cur_prob = mrs->prob_avg; - - if (minstrel_ht_get_tp_avg(mi, group, i, cur_prob) == 0) - continue; -@@ -1012,7 +1012,7 @@ minstrel_calc_retransmit(struct minstrel - unsigned int overhead = 0, overhead_rtscts = 0; - - mrs = minstrel_get_ratestats(mi, index); -- if (mrs->prob_ewma < MINSTREL_FRAC(1, 10)) { -+ if (mrs->prob_avg < MINSTREL_FRAC(1, 10)) { - mrs->retry_count = 1; - mrs->retry_count_rtscts = 1; - return; -@@ -1069,7 +1069,7 @@ minstrel_ht_set_rate(struct minstrel_pri - if (!mrs->retry_updated) - minstrel_calc_retransmit(mp, mi, index); - -- if (mrs->prob_ewma < MINSTREL_FRAC(20, 100) || !mrs->retry_count) { -+ if (mrs->prob_avg < MINSTREL_FRAC(20, 100) || !mrs->retry_count) { - ratetbl->rate[offset].count = 2; - ratetbl->rate[offset].count_rts = 2; - ratetbl->rate[offset].count_cts = 2; -@@ -1103,11 +1103,11 @@ minstrel_ht_set_rate(struct minstrel_pri - } - - static inline int --minstrel_ht_get_prob_ewma(struct minstrel_ht_sta *mi, int rate) -+minstrel_ht_get_prob_avg(struct minstrel_ht_sta *mi, int rate) - { - int group = rate / MCS_GROUP_RATES; - rate %= MCS_GROUP_RATES; -- return mi->groups[group].rates[rate].prob_ewma; -+ return mi->groups[group].rates[rate].prob_avg; - } - - static int -@@ -1119,7 +1119,7 @@ minstrel_ht_get_max_amsdu_len(struct min - unsigned int duration; - - /* Disable A-MSDU if max_prob_rate is bad */ -- if (mi->groups[group].rates[rate].prob_ewma < MINSTREL_FRAC(50, 100)) -+ if (mi->groups[group].rates[rate].prob_avg < MINSTREL_FRAC(50, 100)) - return 1; - - duration = g->duration[rate]; -@@ -1142,7 +1142,7 @@ minstrel_ht_get_max_amsdu_len(struct min - * data packet size - */ - if (duration > MCS_DURATION(1, 0, 260) || -- (minstrel_ht_get_prob_ewma(mi, mi->max_tp_rate[0]) < -+ (minstrel_ht_get_prob_avg(mi, mi->max_tp_rate[0]) < - MINSTREL_FRAC(75, 100))) - return 3200; - -@@ -1247,7 +1247,7 @@ minstrel_get_sample_rate(struct minstrel - * rate, to avoid wasting airtime. - */ - sample_dur = minstrel_get_duration(sample_idx); -- if (mrs->prob_ewma > MINSTREL_FRAC(95, 100) || -+ if (mrs->prob_avg > MINSTREL_FRAC(95, 100) || - minstrel_get_duration(mi->max_prob_rate) * 3 < sample_dur) - return -1; - -@@ -1711,7 +1711,7 @@ static u32 minstrel_ht_get_expected_thro - - i = mi->max_tp_rate[0] / MCS_GROUP_RATES; - j = mi->max_tp_rate[0] % MCS_GROUP_RATES; -- prob = mi->groups[i].rates[j].prob_ewma; -+ prob = mi->groups[i].rates[j].prob_avg; - - /* convert tp_avg from pkt per second in kbps */ - tp_avg = minstrel_ht_get_tp_avg(mi, i, j, prob) * 10; ---- a/net/mac80211/rc80211_minstrel_ht.h -+++ b/net/mac80211/rc80211_minstrel_ht.h -@@ -119,6 +119,6 @@ struct minstrel_ht_sta_priv { - - void minstrel_ht_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir); - int minstrel_ht_get_tp_avg(struct minstrel_ht_sta *mi, int group, int rate, -- int prob_ewma); -+ int prob_avg); - - #endif ---- a/net/mac80211/rc80211_minstrel_ht_debugfs.c -+++ b/net/mac80211/rc80211_minstrel_ht_debugfs.c -@@ -98,8 +98,8 @@ minstrel_ht_stats_dump(struct minstrel_h - p += sprintf(p, "%6u ", tx_time); - - tp_max = minstrel_ht_get_tp_avg(mi, i, j, MINSTREL_FRAC(100, 100)); -- tp_avg = minstrel_ht_get_tp_avg(mi, i, j, mrs->prob_ewma); -- eprob = MINSTREL_TRUNC(mrs->prob_ewma * 1000); -+ tp_avg = minstrel_ht_get_tp_avg(mi, i, j, mrs->prob_avg); -+ eprob = MINSTREL_TRUNC(mrs->prob_avg * 1000); - - p += sprintf(p, "%4u.%1u %4u.%1u %3u.%1u" - " %3u %3u %-3u " -@@ -243,8 +243,8 @@ minstrel_ht_stats_csv_dump(struct minstr - p += sprintf(p, "%u,", tx_time); - - tp_max = minstrel_ht_get_tp_avg(mi, i, j, MINSTREL_FRAC(100, 100)); -- tp_avg = minstrel_ht_get_tp_avg(mi, i, j, mrs->prob_ewma); -- eprob = MINSTREL_TRUNC(mrs->prob_ewma * 1000); -+ tp_avg = minstrel_ht_get_tp_avg(mi, i, j, mrs->prob_avg); -+ eprob = MINSTREL_TRUNC(mrs->prob_avg * 1000); - - p += sprintf(p, "%u.%u,%u.%u,%u.%u,%u,%u," - "%u,%llu,%llu,", diff --git a/package/kernel/mac80211/patches/subsys/304-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch b/package/kernel/mac80211/patches/subsys/304-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch index dc7cac5ad15a..64ae487be289 100644 --- a/package/kernel/mac80211/patches/subsys/304-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch +++ b/package/kernel/mac80211/patches/subsys/304-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch @@ -28,7 +28,7 @@ Signed-off-by: Johannes Berg --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c -@@ -324,6 +324,7 @@ struct sta_info *sta_info_alloc(struct i +@@ -338,6 +338,7 @@ struct sta_info *sta_info_alloc(struct i INIT_WORK(&sta->drv_deliver_wk, sta_deliver_ps_frames); INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work); mutex_init(&sta->ampdu_mlme.mtx); diff --git a/package/kernel/mac80211/patches/subsys/305-mac80211-fix-tx-status-for-no-ack-cases.patch b/package/kernel/mac80211/patches/subsys/305-mac80211-fix-tx-status-for-no-ack-cases.patch index ee8f5d0277cf..16108c83f3a3 100644 --- a/package/kernel/mac80211/patches/subsys/305-mac80211-fix-tx-status-for-no-ack-cases.patch +++ b/package/kernel/mac80211/patches/subsys/305-mac80211-fix-tx-status-for-no-ack-cases.patch @@ -12,7 +12,7 @@ Signed-off-by: Johannes Berg --- a/net/mac80211/status.c +++ b/net/mac80211/status.c -@@ -881,6 +881,7 @@ static void __ieee80211_tx_status(struct +@@ -895,6 +895,7 @@ static void __ieee80211_tx_status(struct int rates_idx; bool send_to_cooked; bool acked; @@ -20,7 +20,7 @@ Signed-off-by: Johannes Berg struct ieee80211_bar *bar; int shift = 0; int tid = IEEE80211_NUM_TIDS; -@@ -898,6 +899,8 @@ static void __ieee80211_tx_status(struct +@@ -913,6 +914,8 @@ static void __ieee80211_tx_status(struct clear_sta_flag(sta, WLAN_STA_SP); acked = !!(info->flags & IEEE80211_TX_STAT_ACK); @@ -29,7 +29,7 @@ Signed-off-by: Johannes Berg /* mesh Peer Service Period support */ if (ieee80211_vif_is_mesh(&sta->sdata->vif) && -@@ -962,12 +965,12 @@ static void __ieee80211_tx_status(struct +@@ -977,12 +980,12 @@ static void __ieee80211_tx_status(struct ieee80211_handle_filtered_frame(local, sta, skb); return; } else { @@ -44,8 +44,8 @@ Signed-off-by: Johannes Berg sta->status_stats.msdu_failed[tid]++; sta->status_stats.msdu_retries[tid] += -@@ -994,7 +997,7 @@ static void __ieee80211_tx_status(struct - info->status.tx_time, 0); +@@ -1020,7 +1023,7 @@ static void __ieee80211_tx_status(struct + } if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) { - if (info->flags & IEEE80211_TX_STAT_ACK) { @@ -53,7 +53,7 @@ Signed-off-by: Johannes Berg if (sta->status_stats.lost_packets) sta->status_stats.lost_packets = 0; -@@ -1002,6 +1005,8 @@ static void __ieee80211_tx_status(struct +@@ -1028,6 +1031,8 @@ static void __ieee80211_tx_status(struct if (test_sta_flag(sta, WLAN_STA_TDLS_PEER_AUTH)) sta->status_stats.last_tdls_pkt_time = jiffies; @@ -62,7 +62,7 @@ Signed-off-by: Johannes Berg } else { ieee80211_lost_packet(sta, info); } -@@ -1128,7 +1133,7 @@ void ieee80211_tx_status_ext(struct ieee +@@ -1148,7 +1153,7 @@ void ieee80211_tx_status_ext(struct ieee sta = container_of(pubsta, struct sta_info, sta); @@ -71,7 +71,7 @@ Signed-off-by: Johannes Berg sta->status_stats.retry_failed++; sta->status_stats.retry_count += retry_count; -@@ -1143,6 +1148,8 @@ void ieee80211_tx_status_ext(struct ieee +@@ -1163,6 +1168,8 @@ void ieee80211_tx_status_ext(struct ieee sta->status_stats.last_tdls_pkt_time = jiffies; } else if (test_sta_flag(sta, WLAN_STA_PS_STA)) { return; diff --git a/package/kernel/mac80211/patches/subsys/306-mac80211-move-store-skb-ack-code-to-its-own-function.patch b/package/kernel/mac80211/patches/subsys/306-mac80211-move-store-skb-ack-code-to-its-own-function.patch deleted file mode 100644 index 4f0a699c808d..000000000000 --- a/package/kernel/mac80211/patches/subsys/306-mac80211-move-store-skb-ack-code-to-its-own-function.patch +++ /dev/null @@ -1,78 +0,0 @@ -From: John Crispin -Date: Tue, 29 Oct 2019 10:13:02 +0100 -Subject: [PATCH] mac80211: move store skb ack code to its own function - -This patch moves the code handling SKBTX_WIFI_STATUS inside the TX path -into an extra function. This allows us to reuse it inside the 802.11 encap -offloading datapath. - -Signed-off-by: John Crispin -Link: https://lore.kernel.org/r/20191029091304.7330-2-john@phrozen.org -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -2445,6 +2445,33 @@ static int ieee80211_lookup_ra_sta(struc - return 0; - } - -+static int ieee80211_store_ack_skb(struct ieee80211_local *local, -+ struct sk_buff *skb, -+ u32 *info_flags) -+{ -+ struct sk_buff *ack_skb = skb_clone_sk(skb); -+ u16 info_id = 0; -+ -+ if (ack_skb) { -+ unsigned long flags; -+ int id; -+ -+ spin_lock_irqsave(&local->ack_status_lock, flags); -+ id = idr_alloc(&local->ack_status_frames, ack_skb, -+ 1, 0x10000, GFP_ATOMIC); -+ spin_unlock_irqrestore(&local->ack_status_lock, flags); -+ -+ if (id >= 0) { -+ info_id = id; -+ *info_flags |= IEEE80211_TX_CTL_REQ_TX_STATUS; -+ } else { -+ kfree_skb(ack_skb); -+ } -+ } -+ -+ return info_id; -+} -+ - /** - * ieee80211_build_hdr - build 802.11 header in the given frame - * @sdata: virtual interface to build the header for -@@ -2738,26 +2765,8 @@ static struct sk_buff *ieee80211_build_h - } - - if (unlikely(!multicast && skb->sk && -- skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)) { -- struct sk_buff *ack_skb = skb_clone_sk(skb); -- -- if (ack_skb) { -- unsigned long flags; -- int id; -- -- spin_lock_irqsave(&local->ack_status_lock, flags); -- id = idr_alloc(&local->ack_status_frames, ack_skb, -- 1, 0x10000, GFP_ATOMIC); -- spin_unlock_irqrestore(&local->ack_status_lock, flags); -- -- if (id >= 0) { -- info_id = id; -- info_flags |= IEEE80211_TX_CTL_REQ_TX_STATUS; -- } else { -- kfree_skb(ack_skb); -- } -- } -- } -+ skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)) -+ info_id = ieee80211_store_ack_skb(local, skb, &info_flags); - - /* - * If the skb is shared we need to obtain our own copy. diff --git a/package/kernel/mac80211/patches/subsys/307-mac80211-Shrink-the-size-of-ack_frame_id-to-make-roo.patch b/package/kernel/mac80211/patches/subsys/307-mac80211-Shrink-the-size-of-ack_frame_id-to-make-roo.patch deleted file mode 100644 index ff25ceff6e18..000000000000 --- a/package/kernel/mac80211/patches/subsys/307-mac80211-Shrink-the-size-of-ack_frame_id-to-make-roo.patch +++ /dev/null @@ -1,67 +0,0 @@ -From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= -Date: Wed, 23 Oct 2019 11:59:00 +0200 -Subject: [PATCH] mac80211: Shrink the size of ack_frame_id to make room for - tx_time_est -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -To implement airtime queue limiting, we need to keep a running account of -the estimated airtime of all skbs queued into the device. Do to this -correctly, we need to store the airtime estimate into the skb so we can -decrease the outstanding balance when the skb is freed. This means that the -time estimate must be stored somewhere that will survive for the lifetime -of the skb. - -To get this, decrease the size of the ack_frame_id field to 6 bits, and -lower the size of the ID space accordingly. This leaves 10 bits for use for -tx_time_est, which is enough to store a maximum of 4096 us, if we shift the -values so they become units of 4us. - -Signed-off-by: Toke Høiland-Jørgensen -Link: https://lore.kernel.org/r/157182474063.150713.16132669599100802716.stgit@toke.dk -Signed-off-by: Johannes Berg ---- - ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -967,6 +967,7 @@ ieee80211_rate_get_vht_nss(const struct - * @band: the band to transmit on (use for checking for races) - * @hw_queue: HW queue to put the frame on, skb_get_queue_mapping() gives the AC - * @ack_frame_id: internal frame ID for TX status, used internally -+ * @tx_time_est: TX time estimate in units of 4us, used internally - * @control: union part for control data - * @control.rates: TX rates array to try - * @control.rts_cts_rate_idx: rate for RTS or CTS -@@ -1007,7 +1008,8 @@ struct ieee80211_tx_info { - - u8 hw_queue; - -- u16 ack_frame_id; -+ u16 ack_frame_id:6; -+ u16 tx_time_est:10; - - union { - struct { ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -3449,7 +3449,7 @@ int ieee80211_attach_ack_skb(struct ieee - - spin_lock_irqsave(&local->ack_status_lock, spin_flags); - id = idr_alloc(&local->ack_status_frames, ack_skb, -- 1, 0x10000, GFP_ATOMIC); -+ 1, 0x40, GFP_ATOMIC); - spin_unlock_irqrestore(&local->ack_status_lock, spin_flags); - - if (id < 0) { ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -2458,7 +2458,7 @@ static int ieee80211_store_ack_skb(struc - - spin_lock_irqsave(&local->ack_status_lock, flags); - id = idr_alloc(&local->ack_status_frames, ack_skb, -- 1, 0x10000, GFP_ATOMIC); -+ 1, 0x40, GFP_ATOMIC); - spin_unlock_irqrestore(&local->ack_status_lock, flags); - - if (id >= 0) { diff --git a/package/kernel/mac80211/patches/subsys/308-mac80211-Add-new-sta_info-getter-by-sta-vif-addrs.patch b/package/kernel/mac80211/patches/subsys/308-mac80211-Add-new-sta_info-getter-by-sta-vif-addrs.patch deleted file mode 100644 index a6b05f4b7497..000000000000 --- a/package/kernel/mac80211/patches/subsys/308-mac80211-Add-new-sta_info-getter-by-sta-vif-addrs.patch +++ /dev/null @@ -1,78 +0,0 @@ -From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= -Date: Tue, 12 Nov 2019 14:08:35 +0100 -Subject: [PATCH] mac80211: Add new sta_info getter by sta/vif addrs -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -In ieee80211_tx_status() we don't have an sdata struct when looking up the -destination sta. Instead, we just do a lookup by the vif addr that is the -source of the packet being completed. Factor this out into a new sta_info -getter helper, since we need to use it for accounting AQL as well. - -Signed-off-by: Toke Høiland-Jørgensen -Link: https://lore.kernel.org/r/20191112130835.382062-1-toke@redhat.com -[remove internal rcu_read_lock(), document instead] -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/sta_info.c -+++ b/net/mac80211/sta_info.c -@@ -210,6 +210,20 @@ struct sta_info *sta_info_get_bss(struct - return NULL; - } - -+struct sta_info *sta_info_get_by_addrs(struct ieee80211_local *local, -+ const u8 *sta_addr, const u8 *vif_addr) -+{ -+ struct rhlist_head *tmp; -+ struct sta_info *sta; -+ -+ for_each_sta_info(local, sta_addr, sta, tmp) { -+ if (ether_addr_equal(vif_addr, sta->sdata->vif.addr)) -+ return sta; -+ } -+ -+ return NULL; -+} -+ - struct sta_info *sta_info_get_by_idx(struct ieee80211_sub_if_data *sdata, - int idx) - { ---- a/net/mac80211/sta_info.h -+++ b/net/mac80211/sta_info.h -@@ -726,6 +726,10 @@ struct sta_info *sta_info_get(struct iee - struct sta_info *sta_info_get_bss(struct ieee80211_sub_if_data *sdata, - const u8 *addr); - -+/* user must hold sta_mtx or be in RCU critical section */ -+struct sta_info *sta_info_get_by_addrs(struct ieee80211_local *local, -+ const u8 *sta_addr, const u8 *vif_addr); -+ - #define for_each_sta_info(local, _addr, _sta, _tmp) \ - rhl_for_each_entry_rcu(_sta, _tmp, \ - sta_info_hash_lookup(local, _addr), hash_node) ---- a/net/mac80211/status.c -+++ b/net/mac80211/status.c -@@ -1086,19 +1086,13 @@ void ieee80211_tx_status(struct ieee8021 - .skb = skb, - .info = IEEE80211_SKB_CB(skb), - }; -- struct rhlist_head *tmp; - struct sta_info *sta; - - rcu_read_lock(); - -- for_each_sta_info(local, hdr->addr1, sta, tmp) { -- /* skip wrong virtual interface */ -- if (!ether_addr_equal(hdr->addr2, sta->sdata->vif.addr)) -- continue; -- -+ sta = sta_info_get_by_addrs(local, hdr->addr1, hdr->addr2); -+ if (sta) - status.sta = &sta->sta; -- break; -- } - - __ieee80211_tx_status(hw, &status); - rcu_read_unlock(); diff --git a/package/kernel/mac80211/patches/subsys/309-mac80211-Import-airtime-calculation-code-from-mt76.patch b/package/kernel/mac80211/patches/subsys/309-mac80211-Import-airtime-calculation-code-from-mt76.patch deleted file mode 100644 index 7f049b8d0cc9..000000000000 --- a/package/kernel/mac80211/patches/subsys/309-mac80211-Import-airtime-calculation-code-from-mt76.patch +++ /dev/null @@ -1,690 +0,0 @@ -From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= -Date: Mon, 18 Nov 2019 22:06:08 -0800 -Subject: [PATCH] mac80211: Import airtime calculation code from mt76 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Felix recently added code to calculate airtime of packets to the mt76 -driver. Import this into mac80211 so we can use it for airtime queue limit -calculations. - -The airtime.c file is copied verbatim from the mt76 driver, and adjusted to -be usable in mac80211. This involves: - -- Switching to mac80211 data structures. -- Adding support for 160 MHz channels and HE mode. -- Moving the symbol and duration calculations around a bit to avoid - rounding with the higher rates and longer symbol times used for HE rates. - -The per-rate TX rate calculation is also split out to its own function so -it can be used directly for the AQL calculations later. - -Signed-off-by: Toke Høiland-Jørgensen -Link: https://lore.kernel.org/r/20191119060610.76681-3-kyan@google.com -[fix HE_GROUP_IDX() to use 3 * bw, since there are 3 _gi values] -Signed-off-by: Johannes Berg ---- - create mode 100644 net/mac80211/airtime.c - ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -6419,4 +6419,33 @@ void ieee80211_nan_func_match(struct iee - struct cfg80211_nan_match_params *match, - gfp_t gfp); - -+/** -+ * ieee80211_calc_rx_airtime - calculate estimated transmission airtime for RX. -+ * -+ * This function calculates the estimated airtime usage of a frame based on the -+ * rate information in the RX status struct and the frame length. -+ * -+ * @hw: pointer as obtained from ieee80211_alloc_hw() -+ * @status: &struct ieee80211_rx_status containing the transmission rate -+ * information. -+ * @len: frame length in bytes -+ */ -+u32 ieee80211_calc_rx_airtime(struct ieee80211_hw *hw, -+ struct ieee80211_rx_status *status, -+ int len); -+ -+/** -+ * ieee80211_calc_tx_airtime - calculate estimated transmission airtime for TX. -+ * -+ * This function calculates the estimated airtime usage of a frame based on the -+ * rate information in the TX info struct and the frame length. -+ * -+ * @hw: pointer as obtained from ieee80211_alloc_hw() -+ * @info: &struct ieee80211_tx_info of the frame. -+ * @len: frame length in bytes -+ */ -+u32 ieee80211_calc_tx_airtime(struct ieee80211_hw *hw, -+ struct ieee80211_tx_info *info, -+ int len); -+ - #endif /* MAC80211_H */ ---- a/net/mac80211/Makefile -+++ b/net/mac80211/Makefile -@@ -31,7 +31,8 @@ mac80211-y := \ - chan.o \ - trace.o mlme.o \ - tdls.o \ -- ocb.o -+ ocb.o \ -+ airtime.o - - mac80211-$(CPTCFG_MAC80211_LEDS) += led.o - mac80211-$(CPTCFG_MAC80211_DEBUGFS) += \ ---- /dev/null -+++ b/net/mac80211/airtime.c -@@ -0,0 +1,597 @@ -+// SPDX-License-Identifier: ISC -+/* -+ * Copyright (C) 2019 Felix Fietkau -+ */ -+ -+#include -+#include "ieee80211_i.h" -+#include "sta_info.h" -+ -+#define AVG_PKT_SIZE 1024 -+ -+/* Number of bits for an average sized packet */ -+#define MCS_NBITS (AVG_PKT_SIZE << 3) -+ -+/* Number of kilo-symbols (symbols * 1024) for a packet with (bps) bits per -+ * symbol. We use k-symbols to avoid rounding in the _TIME macros below. -+ */ -+#define MCS_N_KSYMS(bps) DIV_ROUND_UP(MCS_NBITS << 10, (bps)) -+ -+/* Transmission time (in 1024 * usec) for a packet containing (ksyms) * 1024 -+ * symbols. -+ */ -+#define MCS_SYMBOL_TIME(sgi, ksyms) \ -+ (sgi ? \ -+ ((ksyms) * 4 * 18) / 20 : /* 3.6 us per sym */ \ -+ ((ksyms) * 4) /* 4.0 us per sym */ \ -+ ) -+ -+/* Transmit duration for the raw data part of an average sized packet */ -+#define MCS_DURATION(streams, sgi, bps) \ -+ ((u32)MCS_SYMBOL_TIME(sgi, MCS_N_KSYMS((streams) * (bps)))) -+ -+#define MCS_DURATION_S(shift, streams, sgi, bps) \ -+ ((u16)((MCS_DURATION(streams, sgi, bps) >> shift))) -+ -+/* These should match the values in enum nl80211_he_gi */ -+#define HE_GI_08 0 -+#define HE_GI_16 1 -+#define HE_GI_32 2 -+ -+/* Transmission time (1024 usec) for a packet containing (ksyms) * k-symbols */ -+#define HE_SYMBOL_TIME(gi, ksyms) \ -+ (gi == HE_GI_08 ? \ -+ ((ksyms) * 16 * 17) / 20 : /* 13.6 us per sym */ \ -+ (gi == HE_GI_16 ? \ -+ ((ksyms) * 16 * 18) / 20 : /* 14.4 us per sym */ \ -+ ((ksyms) * 16) /* 16.0 us per sym */ \ -+ )) -+ -+/* Transmit duration for the raw data part of an average sized packet */ -+#define HE_DURATION(streams, gi, bps) \ -+ ((u32)HE_SYMBOL_TIME(gi, MCS_N_KSYMS((streams) * (bps)))) -+ -+#define HE_DURATION_S(shift, streams, gi, bps) \ -+ (HE_DURATION(streams, gi, bps) >> shift) -+ -+#define BW_20 0 -+#define BW_40 1 -+#define BW_80 2 -+#define BW_160 3 -+ -+/* -+ * Define group sort order: HT40 -> SGI -> #streams -+ */ -+#define IEEE80211_MAX_STREAMS 4 -+#define IEEE80211_HT_STREAM_GROUPS 4 /* BW(=2) * SGI(=2) */ -+#define IEEE80211_VHT_STREAM_GROUPS 8 /* BW(=4) * SGI(=2) */ -+ -+#define IEEE80211_HE_MAX_STREAMS 8 -+#define IEEE80211_HE_STREAM_GROUPS 12 /* BW(=4) * GI(=3) */ -+ -+#define IEEE80211_HT_GROUPS_NB (IEEE80211_MAX_STREAMS * \ -+ IEEE80211_HT_STREAM_GROUPS) -+#define IEEE80211_VHT_GROUPS_NB (IEEE80211_MAX_STREAMS * \ -+ IEEE80211_VHT_STREAM_GROUPS) -+#define IEEE80211_HE_GROUPS_NB (IEEE80211_HE_MAX_STREAMS * \ -+ IEEE80211_HE_STREAM_GROUPS) -+#define IEEE80211_GROUPS_NB (IEEE80211_HT_GROUPS_NB + \ -+ IEEE80211_VHT_GROUPS_NB + \ -+ IEEE80211_HE_GROUPS_NB) -+ -+#define IEEE80211_HT_GROUP_0 0 -+#define IEEE80211_VHT_GROUP_0 (IEEE80211_HT_GROUP_0 + IEEE80211_HT_GROUPS_NB) -+#define IEEE80211_HE_GROUP_0 (IEEE80211_VHT_GROUP_0 + IEEE80211_VHT_GROUPS_NB) -+ -+#define MCS_GROUP_RATES 12 -+ -+#define HT_GROUP_IDX(_streams, _sgi, _ht40) \ -+ IEEE80211_HT_GROUP_0 + \ -+ IEEE80211_MAX_STREAMS * 2 * _ht40 + \ -+ IEEE80211_MAX_STREAMS * _sgi + \ -+ _streams - 1 -+ -+#define _MAX(a, b) (((a)>(b))?(a):(b)) -+ -+#define GROUP_SHIFT(duration) \ -+ _MAX(0, 16 - __builtin_clz(duration)) -+ -+/* MCS rate information for an MCS group */ -+#define __MCS_GROUP(_streams, _sgi, _ht40, _s) \ -+ [HT_GROUP_IDX(_streams, _sgi, _ht40)] = { \ -+ .shift = _s, \ -+ .duration = { \ -+ MCS_DURATION_S(_s, _streams, _sgi, _ht40 ? 54 : 26), \ -+ MCS_DURATION_S(_s, _streams, _sgi, _ht40 ? 108 : 52), \ -+ MCS_DURATION_S(_s, _streams, _sgi, _ht40 ? 162 : 78), \ -+ MCS_DURATION_S(_s, _streams, _sgi, _ht40 ? 216 : 104), \ -+ MCS_DURATION_S(_s, _streams, _sgi, _ht40 ? 324 : 156), \ -+ MCS_DURATION_S(_s, _streams, _sgi, _ht40 ? 432 : 208), \ -+ MCS_DURATION_S(_s, _streams, _sgi, _ht40 ? 486 : 234), \ -+ MCS_DURATION_S(_s, _streams, _sgi, _ht40 ? 540 : 260) \ -+ } \ -+} -+ -+#define MCS_GROUP_SHIFT(_streams, _sgi, _ht40) \ -+ GROUP_SHIFT(MCS_DURATION(_streams, _sgi, _ht40 ? 54 : 26)) -+ -+#define MCS_GROUP(_streams, _sgi, _ht40) \ -+ __MCS_GROUP(_streams, _sgi, _ht40, \ -+ MCS_GROUP_SHIFT(_streams, _sgi, _ht40)) -+ -+#define VHT_GROUP_IDX(_streams, _sgi, _bw) \ -+ (IEEE80211_VHT_GROUP_0 + \ -+ IEEE80211_MAX_STREAMS * 2 * (_bw) + \ -+ IEEE80211_MAX_STREAMS * (_sgi) + \ -+ (_streams) - 1) -+ -+#define BW2VBPS(_bw, r4, r3, r2, r1) \ -+ (_bw == BW_160 ? r4 : _bw == BW_80 ? r3 : _bw == BW_40 ? r2 : r1) -+ -+#define __VHT_GROUP(_streams, _sgi, _bw, _s) \ -+ [VHT_GROUP_IDX(_streams, _sgi, _bw)] = { \ -+ .shift = _s, \ -+ .duration = { \ -+ MCS_DURATION_S(_s, _streams, _sgi, \ -+ BW2VBPS(_bw, 234, 117, 54, 26)), \ -+ MCS_DURATION_S(_s, _streams, _sgi, \ -+ BW2VBPS(_bw, 468, 234, 108, 52)), \ -+ MCS_DURATION_S(_s, _streams, _sgi, \ -+ BW2VBPS(_bw, 702, 351, 162, 78)), \ -+ MCS_DURATION_S(_s, _streams, _sgi, \ -+ BW2VBPS(_bw, 936, 468, 216, 104)), \ -+ MCS_DURATION_S(_s, _streams, _sgi, \ -+ BW2VBPS(_bw, 1404, 702, 324, 156)), \ -+ MCS_DURATION_S(_s, _streams, _sgi, \ -+ BW2VBPS(_bw, 1872, 936, 432, 208)), \ -+ MCS_DURATION_S(_s, _streams, _sgi, \ -+ BW2VBPS(_bw, 2106, 1053, 486, 234)), \ -+ MCS_DURATION_S(_s, _streams, _sgi, \ -+ BW2VBPS(_bw, 2340, 1170, 540, 260)), \ -+ MCS_DURATION_S(_s, _streams, _sgi, \ -+ BW2VBPS(_bw, 2808, 1404, 648, 312)), \ -+ MCS_DURATION_S(_s, _streams, _sgi, \ -+ BW2VBPS(_bw, 3120, 1560, 720, 346)) \ -+ } \ -+} -+ -+#define VHT_GROUP_SHIFT(_streams, _sgi, _bw) \ -+ GROUP_SHIFT(MCS_DURATION(_streams, _sgi, \ -+ BW2VBPS(_bw, 243, 117, 54, 26))) -+ -+#define VHT_GROUP(_streams, _sgi, _bw) \ -+ __VHT_GROUP(_streams, _sgi, _bw, \ -+ VHT_GROUP_SHIFT(_streams, _sgi, _bw)) -+ -+ -+#define HE_GROUP_IDX(_streams, _gi, _bw) \ -+ (IEEE80211_HE_GROUP_0 + \ -+ IEEE80211_HE_MAX_STREAMS * 3 * (_bw) + \ -+ IEEE80211_HE_MAX_STREAMS * (_gi) + \ -+ (_streams) - 1) -+ -+#define __HE_GROUP(_streams, _gi, _bw, _s) \ -+ [HE_GROUP_IDX(_streams, _gi, _bw)] = { \ -+ .shift = _s, \ -+ .duration = { \ -+ HE_DURATION_S(_s, _streams, _gi, \ -+ BW2VBPS(_bw, 979, 489, 230, 115)), \ -+ HE_DURATION_S(_s, _streams, _gi, \ -+ BW2VBPS(_bw, 1958, 979, 475, 230)), \ -+ HE_DURATION_S(_s, _streams, _gi, \ -+ BW2VBPS(_bw, 2937, 1468, 705, 345)), \ -+ HE_DURATION_S(_s, _streams, _gi, \ -+ BW2VBPS(_bw, 3916, 1958, 936, 475)), \ -+ HE_DURATION_S(_s, _streams, _gi, \ -+ BW2VBPS(_bw, 5875, 2937, 1411, 705)), \ -+ HE_DURATION_S(_s, _streams, _gi, \ -+ BW2VBPS(_bw, 7833, 3916, 1872, 936)), \ -+ HE_DURATION_S(_s, _streams, _gi, \ -+ BW2VBPS(_bw, 8827, 4406, 2102, 1051)), \ -+ HE_DURATION_S(_s, _streams, _gi, \ -+ BW2VBPS(_bw, 9806, 4896, 2347, 1166)), \ -+ HE_DURATION_S(_s, _streams, _gi, \ -+ BW2VBPS(_bw, 11764, 5875, 2808, 1411)), \ -+ HE_DURATION_S(_s, _streams, _gi, \ -+ BW2VBPS(_bw, 13060, 6523, 3124, 1555)), \ -+ HE_DURATION_S(_s, _streams, _gi, \ -+ BW2VBPS(_bw, 14702, 7344, 3513, 1756)), \ -+ HE_DURATION_S(_s, _streams, _gi, \ -+ BW2VBPS(_bw, 16329, 8164, 3902, 1944)) \ -+ } \ -+} -+ -+#define HE_GROUP_SHIFT(_streams, _gi, _bw) \ -+ GROUP_SHIFT(HE_DURATION(_streams, _gi, \ -+ BW2VBPS(_bw, 979, 489, 230, 115))) -+ -+#define HE_GROUP(_streams, _gi, _bw) \ -+ __HE_GROUP(_streams, _gi, _bw, \ -+ HE_GROUP_SHIFT(_streams, _gi, _bw)) -+struct mcs_group { -+ u8 shift; -+ u16 duration[MCS_GROUP_RATES]; -+}; -+ -+static const struct mcs_group airtime_mcs_groups[] = { -+ MCS_GROUP(1, 0, BW_20), -+ MCS_GROUP(2, 0, BW_20), -+ MCS_GROUP(3, 0, BW_20), -+ MCS_GROUP(4, 0, BW_20), -+ -+ MCS_GROUP(1, 1, BW_20), -+ MCS_GROUP(2, 1, BW_20), -+ MCS_GROUP(3, 1, BW_20), -+ MCS_GROUP(4, 1, BW_20), -+ -+ MCS_GROUP(1, 0, BW_40), -+ MCS_GROUP(2, 0, BW_40), -+ MCS_GROUP(3, 0, BW_40), -+ MCS_GROUP(4, 0, BW_40), -+ -+ MCS_GROUP(1, 1, BW_40), -+ MCS_GROUP(2, 1, BW_40), -+ MCS_GROUP(3, 1, BW_40), -+ MCS_GROUP(4, 1, BW_40), -+ -+ VHT_GROUP(1, 0, BW_20), -+ VHT_GROUP(2, 0, BW_20), -+ VHT_GROUP(3, 0, BW_20), -+ VHT_GROUP(4, 0, BW_20), -+ -+ VHT_GROUP(1, 1, BW_20), -+ VHT_GROUP(2, 1, BW_20), -+ VHT_GROUP(3, 1, BW_20), -+ VHT_GROUP(4, 1, BW_20), -+ -+ VHT_GROUP(1, 0, BW_40), -+ VHT_GROUP(2, 0, BW_40), -+ VHT_GROUP(3, 0, BW_40), -+ VHT_GROUP(4, 0, BW_40), -+ -+ VHT_GROUP(1, 1, BW_40), -+ VHT_GROUP(2, 1, BW_40), -+ VHT_GROUP(3, 1, BW_40), -+ VHT_GROUP(4, 1, BW_40), -+ -+ VHT_GROUP(1, 0, BW_80), -+ VHT_GROUP(2, 0, BW_80), -+ VHT_GROUP(3, 0, BW_80), -+ VHT_GROUP(4, 0, BW_80), -+ -+ VHT_GROUP(1, 1, BW_80), -+ VHT_GROUP(2, 1, BW_80), -+ VHT_GROUP(3, 1, BW_80), -+ VHT_GROUP(4, 1, BW_80), -+ -+ VHT_GROUP(1, 0, BW_160), -+ VHT_GROUP(2, 0, BW_160), -+ VHT_GROUP(3, 0, BW_160), -+ VHT_GROUP(4, 0, BW_160), -+ -+ VHT_GROUP(1, 1, BW_160), -+ VHT_GROUP(2, 1, BW_160), -+ VHT_GROUP(3, 1, BW_160), -+ VHT_GROUP(4, 1, BW_160), -+ -+ HE_GROUP(1, HE_GI_08, BW_20), -+ HE_GROUP(2, HE_GI_08, BW_20), -+ HE_GROUP(3, HE_GI_08, BW_20), -+ HE_GROUP(4, HE_GI_08, BW_20), -+ HE_GROUP(5, HE_GI_08, BW_20), -+ HE_GROUP(6, HE_GI_08, BW_20), -+ HE_GROUP(7, HE_GI_08, BW_20), -+ HE_GROUP(8, HE_GI_08, BW_20), -+ -+ HE_GROUP(1, HE_GI_16, BW_20), -+ HE_GROUP(2, HE_GI_16, BW_20), -+ HE_GROUP(3, HE_GI_16, BW_20), -+ HE_GROUP(4, HE_GI_16, BW_20), -+ HE_GROUP(5, HE_GI_16, BW_20), -+ HE_GROUP(6, HE_GI_16, BW_20), -+ HE_GROUP(7, HE_GI_16, BW_20), -+ HE_GROUP(8, HE_GI_16, BW_20), -+ -+ HE_GROUP(1, HE_GI_32, BW_20), -+ HE_GROUP(2, HE_GI_32, BW_20), -+ HE_GROUP(3, HE_GI_32, BW_20), -+ HE_GROUP(4, HE_GI_32, BW_20), -+ HE_GROUP(5, HE_GI_32, BW_20), -+ HE_GROUP(6, HE_GI_32, BW_20), -+ HE_GROUP(7, HE_GI_32, BW_20), -+ HE_GROUP(8, HE_GI_32, BW_20), -+ -+ HE_GROUP(1, HE_GI_08, BW_40), -+ HE_GROUP(2, HE_GI_08, BW_40), -+ HE_GROUP(3, HE_GI_08, BW_40), -+ HE_GROUP(4, HE_GI_08, BW_40), -+ HE_GROUP(5, HE_GI_08, BW_40), -+ HE_GROUP(6, HE_GI_08, BW_40), -+ HE_GROUP(7, HE_GI_08, BW_40), -+ HE_GROUP(8, HE_GI_08, BW_40), -+ -+ HE_GROUP(1, HE_GI_16, BW_40), -+ HE_GROUP(2, HE_GI_16, BW_40), -+ HE_GROUP(3, HE_GI_16, BW_40), -+ HE_GROUP(4, HE_GI_16, BW_40), -+ HE_GROUP(5, HE_GI_16, BW_40), -+ HE_GROUP(6, HE_GI_16, BW_40), -+ HE_GROUP(7, HE_GI_16, BW_40), -+ HE_GROUP(8, HE_GI_16, BW_40), -+ -+ HE_GROUP(1, HE_GI_32, BW_40), -+ HE_GROUP(2, HE_GI_32, BW_40), -+ HE_GROUP(3, HE_GI_32, BW_40), -+ HE_GROUP(4, HE_GI_32, BW_40), -+ HE_GROUP(5, HE_GI_32, BW_40), -+ HE_GROUP(6, HE_GI_32, BW_40), -+ HE_GROUP(7, HE_GI_32, BW_40), -+ HE_GROUP(8, HE_GI_32, BW_40), -+ -+ HE_GROUP(1, HE_GI_08, BW_80), -+ HE_GROUP(2, HE_GI_08, BW_80), -+ HE_GROUP(3, HE_GI_08, BW_80), -+ HE_GROUP(4, HE_GI_08, BW_80), -+ HE_GROUP(5, HE_GI_08, BW_80), -+ HE_GROUP(6, HE_GI_08, BW_80), -+ HE_GROUP(7, HE_GI_08, BW_80), -+ HE_GROUP(8, HE_GI_08, BW_80), -+ -+ HE_GROUP(1, HE_GI_16, BW_80), -+ HE_GROUP(2, HE_GI_16, BW_80), -+ HE_GROUP(3, HE_GI_16, BW_80), -+ HE_GROUP(4, HE_GI_16, BW_80), -+ HE_GROUP(5, HE_GI_16, BW_80), -+ HE_GROUP(6, HE_GI_16, BW_80), -+ HE_GROUP(7, HE_GI_16, BW_80), -+ HE_GROUP(8, HE_GI_16, BW_80), -+ -+ HE_GROUP(1, HE_GI_32, BW_80), -+ HE_GROUP(2, HE_GI_32, BW_80), -+ HE_GROUP(3, HE_GI_32, BW_80), -+ HE_GROUP(4, HE_GI_32, BW_80), -+ HE_GROUP(5, HE_GI_32, BW_80), -+ HE_GROUP(6, HE_GI_32, BW_80), -+ HE_GROUP(7, HE_GI_32, BW_80), -+ HE_GROUP(8, HE_GI_32, BW_80), -+ -+ HE_GROUP(1, HE_GI_08, BW_160), -+ HE_GROUP(2, HE_GI_08, BW_160), -+ HE_GROUP(3, HE_GI_08, BW_160), -+ HE_GROUP(4, HE_GI_08, BW_160), -+ HE_GROUP(5, HE_GI_08, BW_160), -+ HE_GROUP(6, HE_GI_08, BW_160), -+ HE_GROUP(7, HE_GI_08, BW_160), -+ HE_GROUP(8, HE_GI_08, BW_160), -+ -+ HE_GROUP(1, HE_GI_16, BW_160), -+ HE_GROUP(2, HE_GI_16, BW_160), -+ HE_GROUP(3, HE_GI_16, BW_160), -+ HE_GROUP(4, HE_GI_16, BW_160), -+ HE_GROUP(5, HE_GI_16, BW_160), -+ HE_GROUP(6, HE_GI_16, BW_160), -+ HE_GROUP(7, HE_GI_16, BW_160), -+ HE_GROUP(8, HE_GI_16, BW_160), -+ -+ HE_GROUP(1, HE_GI_32, BW_160), -+ HE_GROUP(2, HE_GI_32, BW_160), -+ HE_GROUP(3, HE_GI_32, BW_160), -+ HE_GROUP(4, HE_GI_32, BW_160), -+ HE_GROUP(5, HE_GI_32, BW_160), -+ HE_GROUP(6, HE_GI_32, BW_160), -+ HE_GROUP(7, HE_GI_32, BW_160), -+ HE_GROUP(8, HE_GI_32, BW_160), -+}; -+ -+static u32 -+ieee80211_calc_legacy_rate_duration(u16 bitrate, bool short_pre, -+ bool cck, int len) -+{ -+ u32 duration; -+ -+ if (cck) { -+ duration = 144 + 48; /* preamble + PLCP */ -+ if (short_pre) -+ duration >>= 1; -+ -+ duration += 10; /* SIFS */ -+ } else { -+ duration = 20 + 16; /* premable + SIFS */ -+ } -+ -+ len <<= 3; -+ duration += (len * 10) / bitrate; -+ -+ return duration; -+} -+ -+u32 ieee80211_calc_rx_airtime(struct ieee80211_hw *hw, -+ struct ieee80211_rx_status *status, -+ int len) -+{ -+ struct ieee80211_supported_band *sband; -+ const struct ieee80211_rate *rate; -+ bool sgi = status->enc_flags & RX_ENC_FLAG_SHORT_GI; -+ bool sp = status->enc_flags & RX_ENC_FLAG_SHORTPRE; -+ int bw, streams; -+ int group, idx; -+ u32 duration; -+ bool cck; -+ -+ switch (status->bw) { -+ case RATE_INFO_BW_20: -+ bw = BW_20; -+ break; -+ case RATE_INFO_BW_40: -+ bw = BW_40; -+ break; -+ case RATE_INFO_BW_80: -+ bw = BW_80; -+ break; -+ case RATE_INFO_BW_160: -+ bw = BW_160; -+ break; -+ default: -+ WARN_ON_ONCE(1); -+ return 0; -+ } -+ -+ switch (status->encoding) { -+ case RX_ENC_LEGACY: -+ if (WARN_ON_ONCE(status->band > NL80211_BAND_5GHZ)) -+ return 0; -+ -+ sband = hw->wiphy->bands[status->band]; -+ if (!sband || status->rate_idx > sband->n_bitrates) -+ return 0; -+ -+ rate = &sband->bitrates[status->rate_idx]; -+ cck = rate->flags & IEEE80211_RATE_MANDATORY_B; -+ -+ return ieee80211_calc_legacy_rate_duration(rate->bitrate, sp, -+ cck, len); -+ -+ case RX_ENC_VHT: -+ streams = status->nss; -+ idx = status->rate_idx; -+ group = VHT_GROUP_IDX(streams, sgi, bw); -+ break; -+ case RX_ENC_HT: -+ streams = ((status->rate_idx >> 3) & 3) + 1; -+ idx = status->rate_idx & 7; -+ group = HT_GROUP_IDX(streams, sgi, bw); -+ break; -+ case RX_ENC_HE: -+ streams = status->nss; -+ idx = status->rate_idx; -+ group = HE_GROUP_IDX(streams, status->he_gi, bw); -+ break; -+ default: -+ WARN_ON_ONCE(1); -+ return 0; -+ } -+ -+ if (WARN_ON_ONCE((status->encoding != RX_ENC_HE && streams > 4) || -+ (status->encoding == RX_ENC_HE && streams > 8))) -+ return 0; -+ -+ duration = airtime_mcs_groups[group].duration[idx]; -+ duration <<= airtime_mcs_groups[group].shift; -+ duration *= len; -+ duration /= AVG_PKT_SIZE; -+ duration /= 1024; -+ -+ duration += 36 + (streams << 2); -+ -+ return duration; -+} -+EXPORT_SYMBOL_GPL(ieee80211_calc_rx_airtime); -+ -+static u32 ieee80211_calc_tx_airtime_rate(struct ieee80211_hw *hw, -+ struct ieee80211_tx_rate *rate, -+ u8 band, int len) -+{ -+ struct ieee80211_rx_status stat = { -+ .band = band, -+ }; -+ -+ if (rate->idx < 0 || !rate->count) -+ return 0; -+ -+ if (rate->flags & IEEE80211_TX_RC_80_MHZ_WIDTH) -+ stat.bw = RATE_INFO_BW_80; -+ else if (rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH) -+ stat.bw = RATE_INFO_BW_40; -+ else -+ stat.bw = RATE_INFO_BW_20; -+ -+ stat.enc_flags = 0; -+ if (rate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) -+ stat.enc_flags |= RX_ENC_FLAG_SHORTPRE; -+ if (rate->flags & IEEE80211_TX_RC_SHORT_GI) -+ stat.enc_flags |= RX_ENC_FLAG_SHORT_GI; -+ -+ stat.rate_idx = rate->idx; -+ if (rate->flags & IEEE80211_TX_RC_VHT_MCS) { -+ stat.encoding = RX_ENC_VHT; -+ stat.rate_idx = ieee80211_rate_get_vht_mcs(rate); -+ stat.nss = ieee80211_rate_get_vht_nss(rate); -+ } else if (rate->flags & IEEE80211_TX_RC_MCS) { -+ stat.encoding = RX_ENC_HT; -+ } else { -+ stat.encoding = RX_ENC_LEGACY; -+ } -+ -+ return ieee80211_calc_rx_airtime(hw, &stat, len); -+} -+ -+u32 ieee80211_calc_tx_airtime(struct ieee80211_hw *hw, -+ struct ieee80211_tx_info *info, -+ int len) -+{ -+ u32 duration = 0; -+ int i; -+ -+ for (i = 0; i < ARRAY_SIZE(info->status.rates); i++) { -+ struct ieee80211_tx_rate *rate = &info->status.rates[i]; -+ u32 cur_duration; -+ -+ cur_duration = ieee80211_calc_tx_airtime_rate(hw, rate, -+ info->band, len); -+ if (!cur_duration) -+ break; -+ -+ duration += cur_duration * rate->count; -+ } -+ -+ return duration; -+} -+EXPORT_SYMBOL_GPL(ieee80211_calc_tx_airtime); -+ -+u32 ieee80211_calc_expected_tx_airtime(struct ieee80211_hw *hw, -+ struct ieee80211_vif *vif, -+ struct ieee80211_sta *pubsta, -+ int len) -+{ -+ struct ieee80211_supported_band *sband; -+ struct ieee80211_chanctx_conf *conf; -+ int rateidx, shift = 0; -+ bool cck, short_pream; -+ u32 basic_rates; -+ u8 band = 0; -+ u16 rate; -+ -+ len += 38; /* Ethernet header length */ -+ -+ conf = rcu_dereference(vif->chanctx_conf); -+ if (conf) { -+ band = conf->def.chan->band; -+ shift = ieee80211_chandef_get_shift(&conf->def); -+ } -+ -+ if (pubsta) { -+ struct sta_info *sta = container_of(pubsta, struct sta_info, -+ sta); -+ -+ return ieee80211_calc_tx_airtime_rate(hw, -+ &sta->tx_stats.last_rate, -+ band, len); -+ } -+ -+ if (!conf) -+ return 0; -+ -+ /* No station to get latest rate from, so calculate the worst-case -+ * duration using the lowest configured basic rate. -+ */ -+ sband = hw->wiphy->bands[band]; -+ -+ basic_rates = vif->bss_conf.basic_rates; -+ short_pream = vif->bss_conf.use_short_preamble; -+ -+ rateidx = basic_rates ? ffs(basic_rates) - 1 : 0; -+ rate = sband->bitrates[rateidx].bitrate << shift; -+ cck = sband->bitrates[rateidx].flags & IEEE80211_RATE_MANDATORY_B; -+ -+ return ieee80211_calc_legacy_rate_duration(rate, short_pream, cck, len); -+} ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -2253,6 +2253,10 @@ const char *ieee80211_get_reason_code_st - - extern const struct ethtool_ops ieee80211_ethtool_ops; - -+u32 ieee80211_calc_expected_tx_airtime(struct ieee80211_hw *hw, -+ struct ieee80211_vif *vif, -+ struct ieee80211_sta *pubsta, -+ int len); - #ifdef CPTCFG_MAC80211_NOINLINE - #define debug_noinline noinline - #else diff --git a/package/kernel/mac80211/patches/subsys/310-mac80211-Implement-Airtime-based-Queue-Limit-AQL.patch b/package/kernel/mac80211/patches/subsys/310-mac80211-Implement-Airtime-based-Queue-Limit-AQL.patch deleted file mode 100644 index b76286d15c68..000000000000 --- a/package/kernel/mac80211/patches/subsys/310-mac80211-Implement-Airtime-based-Queue-Limit-AQL.patch +++ /dev/null @@ -1,446 +0,0 @@ -From: Kan Yan -Date: Mon, 18 Nov 2019 22:06:09 -0800 -Subject: [PATCH] mac80211: Implement Airtime-based Queue Limit (AQL) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -In order for the Fq_CoDel algorithm integrated in mac80211 layer to operate -effectively to control excessive queueing latency, the CoDel algorithm -requires an accurate measure of how long packets stays in the queue, AKA -sojourn time. The sojourn time measured at the mac80211 layer doesn't -include queueing latency in the lower layer (firmware/hardware) and CoDel -expects lower layer to have a short queue. However, most 802.11ac chipsets -offload tasks such TX aggregation to firmware or hardware, thus have a deep -lower layer queue. - -Without a mechanism to control the lower layer queue size, packets only -stay in mac80211 layer transiently before being sent to firmware queue. -As a result, the sojourn time measured by CoDel in the mac80211 layer is -almost always lower than the CoDel latency target, hence CoDel does little -to control the latency, even when the lower layer queue causes excessive -latency. - -The Byte Queue Limits (BQL) mechanism is commonly used to address the -similar issue with wired network interface. However, this method cannot be -applied directly to the wireless network interface. "Bytes" is not a -suitable measure of queue depth in the wireless network, as the data rate -can vary dramatically from station to station in the same network, from a -few Mbps to over Gbps. - -This patch implements an Airtime-based Queue Limit (AQL) to make CoDel work -effectively with wireless drivers that utilized firmware/hardware -offloading. AQL allows each txq to release just enough packets to the lower -layer to form 1-2 large aggregations to keep hardware fully utilized and -retains the rest of the frames in mac80211 layer to be controlled by the -CoDel algorithm. - -Signed-off-by: Kan Yan -[ Toke: Keep API to set pending airtime internal, fix nits in commit msg ] -Signed-off-by: Toke Høiland-Jørgensen -Link: https://lore.kernel.org/r/20191119060610.76681-4-kyan@google.com -Signed-off-by: Johannes Berg ---- - ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -2603,6 +2603,13 @@ enum wiphy_params_flags { - - #define IEEE80211_DEFAULT_AIRTIME_WEIGHT 256 - -+/* The per TXQ device queue limit in airtime */ -+#define IEEE80211_DEFAULT_AQL_TXQ_LIMIT_L 5000 -+#define IEEE80211_DEFAULT_AQL_TXQ_LIMIT_H 12000 -+ -+/* The per interface airtime threshold to switch to lower queue limit */ -+#define IEEE80211_AQL_THRESHOLD 24000 -+ - /** - * struct cfg80211_pmksa - PMK Security Association - * ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -5559,6 +5559,18 @@ void ieee80211_sta_register_airtime(stru - u32 tx_airtime, u32 rx_airtime); - - /** -+ * ieee80211_txq_airtime_check - check if a txq can send frame to device -+ * -+ * @hw: pointer obtained from ieee80211_alloc_hw() -+ * @txq: pointer obtained from station or virtual interface -+ * -+ * Return true if the AQL's airtime limit has not been reached and the txq can -+ * continue to send more packets to the device. Otherwise return false. -+ */ -+bool -+ieee80211_txq_airtime_check(struct ieee80211_hw *hw, struct ieee80211_txq *txq); -+ -+/** - * ieee80211_iter_keys - iterate keys programmed into the device - * @hw: pointer obtained from ieee80211_alloc_hw() - * @vif: virtual interface to iterate, may be %NULL for all ---- a/net/mac80211/debugfs.c -+++ b/net/mac80211/debugfs.c -@@ -148,6 +148,87 @@ static const struct file_operations aqm_ - .llseek = default_llseek, - }; - -+static ssize_t aql_txq_limit_read(struct file *file, -+ char __user *user_buf, -+ size_t count, -+ loff_t *ppos) -+{ -+ struct ieee80211_local *local = file->private_data; -+ char buf[400]; -+ int len = 0; -+ -+ len = scnprintf(buf, sizeof(buf), -+ "AC AQL limit low AQL limit high\n" -+ "VO %u %u\n" -+ "VI %u %u\n" -+ "BE %u %u\n" -+ "BK %u %u\n", -+ local->aql_txq_limit_low[IEEE80211_AC_VO], -+ local->aql_txq_limit_high[IEEE80211_AC_VO], -+ local->aql_txq_limit_low[IEEE80211_AC_VI], -+ local->aql_txq_limit_high[IEEE80211_AC_VI], -+ local->aql_txq_limit_low[IEEE80211_AC_BE], -+ local->aql_txq_limit_high[IEEE80211_AC_BE], -+ local->aql_txq_limit_low[IEEE80211_AC_BK], -+ local->aql_txq_limit_high[IEEE80211_AC_BK]); -+ return simple_read_from_buffer(user_buf, count, ppos, -+ buf, len); -+} -+ -+static ssize_t aql_txq_limit_write(struct file *file, -+ const char __user *user_buf, -+ size_t count, -+ loff_t *ppos) -+{ -+ struct ieee80211_local *local = file->private_data; -+ char buf[100]; -+ size_t len; -+ u32 ac, q_limit_low, q_limit_high, q_limit_low_old, q_limit_high_old; -+ struct sta_info *sta; -+ -+ if (count > sizeof(buf)) -+ return -EINVAL; -+ -+ if (copy_from_user(buf, user_buf, count)) -+ return -EFAULT; -+ -+ buf[sizeof(buf) - 1] = 0; -+ len = strlen(buf); -+ if (len > 0 && buf[len - 1] == '\n') -+ buf[len - 1] = 0; -+ -+ if (sscanf(buf, "%u %u %u", &ac, &q_limit_low, &q_limit_high) != 3) -+ return -EINVAL; -+ -+ if (ac >= IEEE80211_NUM_ACS) -+ return -EINVAL; -+ -+ q_limit_low_old = local->aql_txq_limit_low[ac]; -+ q_limit_high_old = local->aql_txq_limit_high[ac]; -+ -+ local->aql_txq_limit_low[ac] = q_limit_low; -+ local->aql_txq_limit_high[ac] = q_limit_high; -+ -+ mutex_lock(&local->sta_mtx); -+ list_for_each_entry(sta, &local->sta_list, list) { -+ /* If a sta has customized queue limits, keep it */ -+ if (sta->airtime[ac].aql_limit_low == q_limit_low_old && -+ sta->airtime[ac].aql_limit_high == q_limit_high_old) { -+ sta->airtime[ac].aql_limit_low = q_limit_low; -+ sta->airtime[ac].aql_limit_high = q_limit_high; -+ } -+ } -+ mutex_unlock(&local->sta_mtx); -+ return count; -+} -+ -+static const struct file_operations aql_txq_limit_ops = { -+ .write = aql_txq_limit_write, -+ .read = aql_txq_limit_read, -+ .open = simple_open, -+ .llseek = default_llseek, -+}; -+ - static ssize_t force_tx_status_read(struct file *file, - char __user *user_buf, - size_t count, -@@ -441,6 +522,10 @@ void debugfs_hw_add(struct ieee80211_loc - debugfs_create_u16("airtime_flags", 0600, - phyd, &local->airtime_flags); - -+ DEBUGFS_ADD(aql_txq_limit); -+ debugfs_create_u32("aql_threshold", 0600, -+ phyd, &local->aql_threshold); -+ - statsd = debugfs_create_dir("statistics", phyd); - - /* if the dir failed, don't put all the other things into the root! */ ---- a/net/mac80211/debugfs_sta.c -+++ b/net/mac80211/debugfs_sta.c -@@ -198,10 +198,12 @@ static ssize_t sta_airtime_read(struct f - { - struct sta_info *sta = file->private_data; - struct ieee80211_local *local = sta->sdata->local; -- size_t bufsz = 200; -+ size_t bufsz = 400; - char *buf = kzalloc(bufsz, GFP_KERNEL), *p = buf; - u64 rx_airtime = 0, tx_airtime = 0; - s64 deficit[IEEE80211_NUM_ACS]; -+ u32 q_depth[IEEE80211_NUM_ACS]; -+ u32 q_limit_l[IEEE80211_NUM_ACS], q_limit_h[IEEE80211_NUM_ACS]; - ssize_t rv; - int ac; - -@@ -213,19 +215,22 @@ static ssize_t sta_airtime_read(struct f - rx_airtime += sta->airtime[ac].rx_airtime; - tx_airtime += sta->airtime[ac].tx_airtime; - deficit[ac] = sta->airtime[ac].deficit; -+ q_limit_l[ac] = sta->airtime[ac].aql_limit_low; -+ q_limit_h[ac] = sta->airtime[ac].aql_limit_high; - spin_unlock_bh(&local->active_txq_lock[ac]); -+ q_depth[ac] = atomic_read(&sta->airtime[ac].aql_tx_pending); - } - - p += scnprintf(p, bufsz + buf - p, - "RX: %llu us\nTX: %llu us\nWeight: %u\n" -- "Deficit: VO: %lld us VI: %lld us BE: %lld us BK: %lld us\n", -- rx_airtime, -- tx_airtime, -- sta->airtime_weight, -- deficit[0], -- deficit[1], -- deficit[2], -- deficit[3]); -+ "Deficit: VO: %lld us VI: %lld us BE: %lld us BK: %lld us\n" -+ "Q depth: VO: %u us VI: %u us BE: %u us BK: %u us\n" -+ "Q limit[low/high]: VO: %u/%u VI: %u/%u BE: %u/%u BK: %u/%u\n", -+ rx_airtime, tx_airtime, sta->airtime_weight, -+ deficit[0], deficit[1], deficit[2], deficit[3], -+ q_depth[0], q_depth[1], q_depth[2], q_depth[3], -+ q_limit_l[0], q_limit_h[0], q_limit_l[1], q_limit_h[1], -+ q_limit_l[2], q_limit_h[2], q_limit_l[3], q_limit_h[3]), - - rv = simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); - kfree(buf); -@@ -237,7 +242,25 @@ static ssize_t sta_airtime_write(struct - { - struct sta_info *sta = file->private_data; - struct ieee80211_local *local = sta->sdata->local; -- int ac; -+ u32 ac, q_limit_l, q_limit_h; -+ char _buf[100] = {}, *buf = _buf; -+ -+ if (count > sizeof(_buf)) -+ return -EINVAL; -+ -+ if (copy_from_user(buf, userbuf, count)) -+ return -EFAULT; -+ -+ buf[sizeof(_buf) - 1] = '\0'; -+ if (sscanf(buf, "queue limit %u %u %u", &ac, &q_limit_l, &q_limit_h) -+ != 3) -+ return -EINVAL; -+ -+ if (ac >= IEEE80211_NUM_ACS) -+ return -EINVAL; -+ -+ sta->airtime[ac].aql_limit_low = q_limit_l; -+ sta->airtime[ac].aql_limit_high = q_limit_h; - - for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { - spin_lock_bh(&local->active_txq_lock[ac]); ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -1142,6 +1142,10 @@ struct ieee80211_local { - u16 schedule_round[IEEE80211_NUM_ACS]; - - u16 airtime_flags; -+ u32 aql_txq_limit_low[IEEE80211_NUM_ACS]; -+ u32 aql_txq_limit_high[IEEE80211_NUM_ACS]; -+ u32 aql_threshold; -+ atomic_t aql_total_pending_airtime; - - const struct ieee80211_ops *ops; - ---- a/net/mac80211/main.c -+++ b/net/mac80211/main.c -@@ -669,8 +669,16 @@ struct ieee80211_hw *ieee80211_alloc_hw_ - for (i = 0; i < IEEE80211_NUM_ACS; i++) { - INIT_LIST_HEAD(&local->active_txqs[i]); - spin_lock_init(&local->active_txq_lock[i]); -+ local->aql_txq_limit_low[i] = IEEE80211_DEFAULT_AQL_TXQ_LIMIT_L; -+ local->aql_txq_limit_high[i] = -+ IEEE80211_DEFAULT_AQL_TXQ_LIMIT_H; - } -- local->airtime_flags = AIRTIME_USE_TX | AIRTIME_USE_RX; -+ -+ local->airtime_flags = AIRTIME_USE_TX | -+ AIRTIME_USE_RX | -+ AIRTIME_USE_AQL; -+ local->aql_threshold = IEEE80211_AQL_THRESHOLD; -+ atomic_set(&local->aql_total_pending_airtime, 0); - - INIT_LIST_HEAD(&local->chanctx_list); - mutex_init(&local->chanctx_mtx); ---- a/net/mac80211/sta_info.c -+++ b/net/mac80211/sta_info.c -@@ -411,6 +411,9 @@ struct sta_info *sta_info_alloc(struct i - skb_queue_head_init(&sta->ps_tx_buf[i]); - skb_queue_head_init(&sta->tx_filtered[i]); - sta->airtime[i].deficit = sta->airtime_weight; -+ atomic_set(&sta->airtime[i].aql_tx_pending, 0); -+ sta->airtime[i].aql_limit_low = local->aql_txq_limit_low[i]; -+ sta->airtime[i].aql_limit_high = local->aql_txq_limit_high[i]; - } - - for (i = 0; i < IEEE80211_NUM_TIDS; i++) -@@ -1913,6 +1916,41 @@ void ieee80211_sta_register_airtime(stru - } - EXPORT_SYMBOL(ieee80211_sta_register_airtime); - -+void ieee80211_sta_update_pending_airtime(struct ieee80211_local *local, -+ struct sta_info *sta, u8 ac, -+ u16 tx_airtime, bool tx_completed) -+{ -+ int tx_pending; -+ -+ if (!tx_completed) { -+ if (sta) -+ atomic_add(tx_airtime, -+ &sta->airtime[ac].aql_tx_pending); -+ -+ atomic_add(tx_airtime, &local->aql_total_pending_airtime); -+ return; -+ } -+ -+ if (sta) { -+ tx_pending = atomic_sub_return(tx_airtime, -+ &sta->airtime[ac].aql_tx_pending); -+ if (WARN_ONCE(tx_pending < 0, -+ "STA %pM AC %d txq pending airtime underflow: %u, %u", -+ sta->addr, ac, tx_pending, tx_airtime)) -+ atomic_cmpxchg(&sta->airtime[ac].aql_tx_pending, -+ tx_pending, 0); -+ } -+ -+ tx_pending = atomic_sub_return(tx_airtime, -+ &local->aql_total_pending_airtime); -+ if (WARN_ONCE(tx_pending < 0, -+ "Device %s AC %d pending airtime underflow: %u, %u", -+ wiphy_name(local->hw.wiphy), ac, tx_pending, -+ tx_airtime)) -+ atomic_cmpxchg(&local->aql_total_pending_airtime, -+ tx_pending, 0); -+} -+ - int sta_info_move_state(struct sta_info *sta, - enum ieee80211_sta_state new_state) - { ---- a/net/mac80211/sta_info.h -+++ b/net/mac80211/sta_info.h -@@ -128,13 +128,21 @@ enum ieee80211_agg_stop_reason { - /* Debugfs flags to enable/disable use of RX/TX airtime in scheduler */ - #define AIRTIME_USE_TX BIT(0) - #define AIRTIME_USE_RX BIT(1) -+#define AIRTIME_USE_AQL BIT(2) - - struct airtime_info { - u64 rx_airtime; - u64 tx_airtime; - s64 deficit; -+ atomic_t aql_tx_pending; /* Estimated airtime for frames pending */ -+ u32 aql_limit_low; -+ u32 aql_limit_high; - }; - -+void ieee80211_sta_update_pending_airtime(struct ieee80211_local *local, -+ struct sta_info *sta, u8 ac, -+ u16 tx_airtime, bool tx_completed); -+ - struct sta_info; - - /** ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -3700,7 +3700,8 @@ struct ieee80211_txq *ieee80211_next_txq - { - struct ieee80211_local *local = hw_to_local(hw); - struct ieee80211_txq *ret = NULL; -- struct txq_info *txqi = NULL; -+ struct txq_info *txqi = NULL, *head = NULL; -+ bool found_eligible_txq = false; - - spin_lock_bh(&local->active_txq_lock[ac]); - -@@ -3711,13 +3712,30 @@ struct ieee80211_txq *ieee80211_next_txq - if (!txqi) - goto out; - -+ if (txqi == head) { -+ if (!found_eligible_txq) -+ goto out; -+ else -+ found_eligible_txq = false; -+ } -+ -+ if (!head) -+ head = txqi; -+ - if (txqi->txq.sta) { - struct sta_info *sta = container_of(txqi->txq.sta, -- struct sta_info, sta); -+ struct sta_info, sta); -+ bool aql_check = ieee80211_txq_airtime_check(hw, &txqi->txq); -+ s64 deficit = sta->airtime[txqi->txq.ac].deficit; - -- if (sta->airtime[txqi->txq.ac].deficit < 0) { -+ if (aql_check) -+ found_eligible_txq = true; -+ -+ if (deficit < 0) - sta->airtime[txqi->txq.ac].deficit += - sta->airtime_weight; -+ -+ if (deficit < 0 || !aql_check) { - list_move_tail(&txqi->schedule_order, - &local->active_txqs[txqi->txq.ac]); - goto begin; -@@ -3771,6 +3789,33 @@ void __ieee80211_schedule_txq(struct iee - } - EXPORT_SYMBOL(__ieee80211_schedule_txq); - -+bool ieee80211_txq_airtime_check(struct ieee80211_hw *hw, -+ struct ieee80211_txq *txq) -+{ -+ struct sta_info *sta; -+ struct ieee80211_local *local = hw_to_local(hw); -+ -+ if (!(local->airtime_flags & AIRTIME_USE_AQL)) -+ return true; -+ -+ if (!txq->sta) -+ return true; -+ -+ sta = container_of(txq->sta, struct sta_info, sta); -+ if (atomic_read(&sta->airtime[txq->ac].aql_tx_pending) < -+ sta->airtime[txq->ac].aql_limit_low) -+ return true; -+ -+ if (atomic_read(&local->aql_total_pending_airtime) < -+ local->aql_threshold && -+ atomic_read(&sta->airtime[txq->ac].aql_tx_pending) < -+ sta->airtime[txq->ac].aql_limit_high) -+ return true; -+ -+ return false; -+} -+EXPORT_SYMBOL(ieee80211_txq_airtime_check); -+ - bool ieee80211_txq_may_transmit(struct ieee80211_hw *hw, - struct ieee80211_txq *txq) - { diff --git a/package/kernel/mac80211/patches/subsys/311-mac80211-Use-Airtime-based-Queue-Limits-AQL-on-packe.patch b/package/kernel/mac80211/patches/subsys/311-mac80211-Use-Airtime-based-Queue-Limits-AQL-on-packe.patch deleted file mode 100644 index a0548d9d057a..000000000000 --- a/package/kernel/mac80211/patches/subsys/311-mac80211-Use-Airtime-based-Queue-Limits-AQL-on-packe.patch +++ /dev/null @@ -1,146 +0,0 @@ -From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= -Date: Mon, 18 Nov 2019 22:06:10 -0800 -Subject: [PATCH] mac80211: Use Airtime-based Queue Limits (AQL) on packet - dequeue -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The previous commit added the ability to throttle stations when they queue -too much airtime in the hardware. This commit enables the functionality by -calculating the expected airtime usage of each packet that is dequeued from -the TXQs in mac80211, and accounting that as pending airtime. - -The estimated airtime for each skb is stored in the tx_info, so we can -subtract the same amount from the running total when the skb is freed or -recycled. The throttling mechanism relies on this accounting to be -accurate (i.e., that we are not freeing skbs without subtracting any -airtime they were accounted for), so we put the subtraction into -ieee80211_report_used_skb(). As an optimisation, we also subtract the -airtime on regular TX completion, zeroing out the value stored in the -packet afterwards, to avoid having to do an expensive lookup of the station -from the packet data on every packet. - -This patch does *not* include any mechanism to wake a throttled TXQ again, -on the assumption that this will happen anyway as a side effect of whatever -freed the skb (most commonly a TX completion). - -Signed-off-by: Toke Høiland-Jørgensen -Link: https://lore.kernel.org/r/20191119060610.76681-5-kyan@google.com -Signed-off-by: Johannes Berg ---- - ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -1060,6 +1060,22 @@ struct ieee80211_tx_info { - }; - }; - -+static inline u16 -+ieee80211_info_set_tx_time_est(struct ieee80211_tx_info *info, u16 tx_time_est) -+{ -+ /* We only have 10 bits in tx_time_est, so store airtime -+ * in increments of 4us and clamp the maximum to 2**12-1 -+ */ -+ info->tx_time_est = min_t(u16, tx_time_est, 4095) >> 2; -+ return info->tx_time_est << 2; -+} -+ -+static inline u16 -+ieee80211_info_get_tx_time_est(struct ieee80211_tx_info *info) -+{ -+ return info->tx_time_est << 2; -+} -+ - /** - * struct ieee80211_tx_status - extended tx staus info for rate control - * ---- a/net/mac80211/status.c -+++ b/net/mac80211/status.c -@@ -670,12 +670,26 @@ static void ieee80211_report_used_skb(st - struct sk_buff *skb, bool dropped) - { - struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); -+ u16 tx_time_est = ieee80211_info_get_tx_time_est(info); - struct ieee80211_hdr *hdr = (void *)skb->data; - bool acked = info->flags & IEEE80211_TX_STAT_ACK; - - if (dropped) - acked = false; - -+ if (tx_time_est) { -+ struct sta_info *sta; -+ -+ rcu_read_lock(); -+ -+ sta = sta_info_get_by_addrs(local, hdr->addr1, hdr->addr2); -+ ieee80211_sta_update_pending_airtime(local, sta, -+ skb_get_queue_mapping(skb), -+ tx_time_est, -+ true); -+ rcu_read_unlock(); -+ } -+ - if (info->flags & IEEE80211_TX_INTFL_MLME_CONN_TX) { - struct ieee80211_sub_if_data *sdata; - -@@ -885,6 +899,7 @@ static void __ieee80211_tx_status(struct - struct ieee80211_bar *bar; - int shift = 0; - int tid = IEEE80211_NUM_TIDS; -+ u16 tx_time_est; - - rates_idx = ieee80211_tx_get_rates(hw, info, &retry_count); - -@@ -996,6 +1011,17 @@ static void __ieee80211_tx_status(struct - ieee80211_sta_register_airtime(&sta->sta, tid, - info->status.tx_time, 0); - -+ if ((tx_time_est = ieee80211_info_get_tx_time_est(info)) > 0) { -+ /* Do this here to avoid the expensive lookup of the sta -+ * in ieee80211_report_used_skb(). -+ */ -+ ieee80211_sta_update_pending_airtime(local, sta, -+ skb_get_queue_mapping(skb), -+ tx_time_est, -+ true); -+ ieee80211_info_set_tx_time_est(info, 0); -+ } -+ - if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) { - if (acked) { - if (sta->status_stats.lost_packets) ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -3559,6 +3559,9 @@ struct sk_buff *ieee80211_tx_dequeue(str - - WARN_ON_ONCE(softirq_count() == 0); - -+ if (!ieee80211_txq_airtime_check(hw, txq)) -+ return NULL; -+ - begin: - spin_lock_bh(&fq->lock); - -@@ -3687,6 +3690,21 @@ begin: - } - - IEEE80211_SKB_CB(skb)->control.vif = vif; -+ -+ if (local->airtime_flags & AIRTIME_USE_AQL) { -+ u32 airtime; -+ -+ airtime = ieee80211_calc_expected_tx_airtime(hw, vif, txq->sta, -+ skb->len); -+ if (airtime) { -+ airtime = ieee80211_info_set_tx_time_est(info, airtime); -+ ieee80211_sta_update_pending_airtime(local, tx.sta, -+ txq->ac, -+ airtime, -+ false); -+ } -+ } -+ - return skb; - - out: diff --git a/package/kernel/mac80211/patches/subsys/312-mac80211-airtime-Fix-an-off-by-one-in-ieee80211_calc.patch b/package/kernel/mac80211/patches/subsys/312-mac80211-airtime-Fix-an-off-by-one-in-ieee80211_calc.patch deleted file mode 100644 index 4ff496c12e6d..000000000000 --- a/package/kernel/mac80211/patches/subsys/312-mac80211-airtime-Fix-an-off-by-one-in-ieee80211_calc.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Dan Carpenter -Date: Tue, 26 Nov 2019 15:09:39 +0300 -Subject: [PATCH] mac80211: airtime: Fix an off by one in - ieee80211_calc_rx_airtime() -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This code was copied from mt76 and inherited an off by one bug from -there. The > should be >= so that we don't read one element beyond -the end of the array. - -Fixes: db3e1c40cf2f ("mac80211: Import airtime calculation code from mt76") -Reported-by: Toke Høiland-Jørgensen -Signed-off-by: Dan Carpenter -Acked-by: Toke Høiland-Jørgensen -Link: https://lore.kernel.org/r/20191126120910.ftr4t7me3by32aiz@kili.mountain -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/airtime.c -+++ b/net/mac80211/airtime.c -@@ -442,7 +442,7 @@ u32 ieee80211_calc_rx_airtime(struct iee - return 0; - - sband = hw->wiphy->bands[status->band]; -- if (!sband || status->rate_idx > sband->n_bitrates) -+ if (!sband || status->rate_idx >= sband->n_bitrates) - return 0; - - rate = &sband->bitrates[status->rate_idx]; diff --git a/package/kernel/mac80211/patches/subsys/313-mac80211-Turn-AQL-into-an-NL80211_EXT_FEATURE.patch b/package/kernel/mac80211/patches/subsys/313-mac80211-Turn-AQL-into-an-NL80211_EXT_FEATURE.patch deleted file mode 100644 index 389f2ae225eb..000000000000 --- a/package/kernel/mac80211/patches/subsys/313-mac80211-Turn-AQL-into-an-NL80211_EXT_FEATURE.patch +++ /dev/null @@ -1,253 +0,0 @@ -From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= -Date: Thu, 12 Dec 2019 12:14:37 +0100 -Subject: [PATCH] mac80211: Turn AQL into an NL80211_EXT_FEATURE -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Instead of just having an airtime flag in debugfs, turn AQL into a proper -NL80211_EXT_FEATURE, so drivers can turn it on when they are ready, and so -we also expose the presence of the feature to userspace. - -This also has the effect of flipping the default, so drivers have to opt in -to using AQL instead of getting it by default with TXQs. To keep -functionality the same as pre-patch, we set this feature for ath10k (which -is where it is needed the most). - -While we're at it, split out the debugfs interface so AQL gets its own -per-station debugfs file instead of using the 'airtime' file. - -[Johannes:] -This effectively disables AQL for iwlwifi, where it fixes a number of -issues: - * TSO in iwlwifi is causing underflows and associated warnings in AQL - * HE (802.11ax) rates aren't reported properly so at HE rates, AQL could - never have a valid estimate (it'd use 6 Mbps instead of up to 2400!) - -Signed-off-by: Toke Høiland-Jørgensen -Link: https://lore.kernel.org/r/20191212111437.224294-1-toke@redhat.com -Fixes: 3ace10f5b5ad ("mac80211: Implement Airtime-based Queue Limit (AQL)") -Signed-off-by: Johannes Berg ---- - ---- a/drivers/net/wireless/ath/ath10k/mac.c -+++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -8870,6 +8870,7 @@ int ath10k_mac_register(struct ath10k *a - wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_VHT_IBSS); - wiphy_ext_feature_set(ar->hw->wiphy, - NL80211_EXT_FEATURE_SET_SCAN_DWELL); -+ wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_AQL); - - if (test_bit(WMI_SERVICE_TX_DATA_ACK_RSSI, ar->wmi.svc_map) || - test_bit(WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, ar->wmi.svc_map)) ---- a/include/uapi/linux/nl80211.h -+++ b/include/uapi/linux/nl80211.h -@@ -5484,6 +5484,10 @@ enum nl80211_feature_flags { - * @NL80211_EXT_FEATURE_SAE_OFFLOAD: Device wants to do SAE authentication in - * station mode (SAE password is passed as part of the connect command). - * -+ * @NL80211_EXT_FEATURE_AQL: The driver supports the Airtime Queue Limit (AQL) -+ * feature, which prevents bufferbloat by using the expected transmission -+ * time to limit the amount of data buffered in the hardware. -+ * - * @NUM_NL80211_EXT_FEATURES: number of extended features. - * @MAX_NL80211_EXT_FEATURES: highest extended feature index. - */ -@@ -5529,6 +5533,8 @@ enum nl80211_ext_feature_index { - NL80211_EXT_FEATURE_EXT_KEY_ID, - NL80211_EXT_FEATURE_STA_TX_PWR, - NL80211_EXT_FEATURE_SAE_OFFLOAD, -+ NL80211_EXT_FEATURE_VLAN_OFFLOAD, -+ NL80211_EXT_FEATURE_AQL, - - /* add new features before the definition below */ - NUM_NL80211_EXT_FEATURES, ---- a/net/mac80211/debugfs_sta.c -+++ b/net/mac80211/debugfs_sta.c -@@ -202,8 +202,6 @@ static ssize_t sta_airtime_read(struct f - char *buf = kzalloc(bufsz, GFP_KERNEL), *p = buf; - u64 rx_airtime = 0, tx_airtime = 0; - s64 deficit[IEEE80211_NUM_ACS]; -- u32 q_depth[IEEE80211_NUM_ACS]; -- u32 q_limit_l[IEEE80211_NUM_ACS], q_limit_h[IEEE80211_NUM_ACS]; - ssize_t rv; - int ac; - -@@ -215,6 +213,56 @@ static ssize_t sta_airtime_read(struct f - rx_airtime += sta->airtime[ac].rx_airtime; - tx_airtime += sta->airtime[ac].tx_airtime; - deficit[ac] = sta->airtime[ac].deficit; -+ spin_unlock_bh(&local->active_txq_lock[ac]); -+ } -+ -+ p += scnprintf(p, bufsz + buf - p, -+ "RX: %llu us\nTX: %llu us\nWeight: %u\n" -+ "Deficit: VO: %lld us VI: %lld us BE: %lld us BK: %lld us\n", -+ rx_airtime, tx_airtime, sta->airtime_weight, -+ deficit[0], deficit[1], deficit[2], deficit[3]); -+ -+ rv = simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); -+ kfree(buf); -+ return rv; -+} -+ -+static ssize_t sta_airtime_write(struct file *file, const char __user *userbuf, -+ size_t count, loff_t *ppos) -+{ -+ struct sta_info *sta = file->private_data; -+ struct ieee80211_local *local = sta->sdata->local; -+ int ac; -+ -+ for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { -+ spin_lock_bh(&local->active_txq_lock[ac]); -+ sta->airtime[ac].rx_airtime = 0; -+ sta->airtime[ac].tx_airtime = 0; -+ sta->airtime[ac].deficit = sta->airtime_weight; -+ spin_unlock_bh(&local->active_txq_lock[ac]); -+ } -+ -+ return count; -+} -+STA_OPS_RW(airtime); -+ -+static ssize_t sta_aql_read(struct file *file, char __user *userbuf, -+ size_t count, loff_t *ppos) -+{ -+ struct sta_info *sta = file->private_data; -+ struct ieee80211_local *local = sta->sdata->local; -+ size_t bufsz = 400; -+ char *buf = kzalloc(bufsz, GFP_KERNEL), *p = buf; -+ u32 q_depth[IEEE80211_NUM_ACS]; -+ u32 q_limit_l[IEEE80211_NUM_ACS], q_limit_h[IEEE80211_NUM_ACS]; -+ ssize_t rv; -+ int ac; -+ -+ if (!buf) -+ return -ENOMEM; -+ -+ for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { -+ spin_lock_bh(&local->active_txq_lock[ac]); - q_limit_l[ac] = sta->airtime[ac].aql_limit_low; - q_limit_h[ac] = sta->airtime[ac].aql_limit_high; - spin_unlock_bh(&local->active_txq_lock[ac]); -@@ -222,12 +270,8 @@ static ssize_t sta_airtime_read(struct f - } - - p += scnprintf(p, bufsz + buf - p, -- "RX: %llu us\nTX: %llu us\nWeight: %u\n" -- "Deficit: VO: %lld us VI: %lld us BE: %lld us BK: %lld us\n" - "Q depth: VO: %u us VI: %u us BE: %u us BK: %u us\n" - "Q limit[low/high]: VO: %u/%u VI: %u/%u BE: %u/%u BK: %u/%u\n", -- rx_airtime, tx_airtime, sta->airtime_weight, -- deficit[0], deficit[1], deficit[2], deficit[3], - q_depth[0], q_depth[1], q_depth[2], q_depth[3], - q_limit_l[0], q_limit_h[0], q_limit_l[1], q_limit_h[1], - q_limit_l[2], q_limit_h[2], q_limit_l[3], q_limit_h[3]), -@@ -237,11 +281,10 @@ static ssize_t sta_airtime_read(struct f - return rv; - } - --static ssize_t sta_airtime_write(struct file *file, const char __user *userbuf, -+static ssize_t sta_aql_write(struct file *file, const char __user *userbuf, - size_t count, loff_t *ppos) - { - struct sta_info *sta = file->private_data; -- struct ieee80211_local *local = sta->sdata->local; - u32 ac, q_limit_l, q_limit_h; - char _buf[100] = {}, *buf = _buf; - -@@ -252,7 +295,7 @@ static ssize_t sta_airtime_write(struct - return -EFAULT; - - buf[sizeof(_buf) - 1] = '\0'; -- if (sscanf(buf, "queue limit %u %u %u", &ac, &q_limit_l, &q_limit_h) -+ if (sscanf(buf, "limit %u %u %u", &ac, &q_limit_l, &q_limit_h) - != 3) - return -EINVAL; - -@@ -262,17 +305,10 @@ static ssize_t sta_airtime_write(struct - sta->airtime[ac].aql_limit_low = q_limit_l; - sta->airtime[ac].aql_limit_high = q_limit_h; - -- for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { -- spin_lock_bh(&local->active_txq_lock[ac]); -- sta->airtime[ac].rx_airtime = 0; -- sta->airtime[ac].tx_airtime = 0; -- sta->airtime[ac].deficit = sta->airtime_weight; -- spin_unlock_bh(&local->active_txq_lock[ac]); -- } -- - return count; - } --STA_OPS_RW(airtime); -+STA_OPS_RW(aql); -+ - - static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf, - size_t count, loff_t *ppos) -@@ -1002,6 +1038,10 @@ void ieee80211_sta_debugfs_add(struct st - NL80211_EXT_FEATURE_AIRTIME_FAIRNESS)) - DEBUGFS_ADD(airtime); - -+ if (wiphy_ext_feature_isset(local->hw.wiphy, -+ NL80211_EXT_FEATURE_AQL)) -+ DEBUGFS_ADD(aql); -+ - if (sizeof(sta->driver_buffered_tids) == sizeof(u32)) - debugfs_create_x32("driver_buffered_tids", 0400, - sta->debugfs_dir, ---- a/net/mac80211/main.c -+++ b/net/mac80211/main.c -@@ -674,9 +674,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ - IEEE80211_DEFAULT_AQL_TXQ_LIMIT_H; - } - -- local->airtime_flags = AIRTIME_USE_TX | -- AIRTIME_USE_RX | -- AIRTIME_USE_AQL; -+ local->airtime_flags = AIRTIME_USE_TX | AIRTIME_USE_RX; - local->aql_threshold = IEEE80211_AQL_THRESHOLD; - atomic_set(&local->aql_total_pending_airtime, 0); - ---- a/net/mac80211/sta_info.c -+++ b/net/mac80211/sta_info.c -@@ -1922,6 +1922,9 @@ void ieee80211_sta_update_pending_airtim - { - int tx_pending; - -+ if (!wiphy_ext_feature_isset(local->hw.wiphy, NL80211_EXT_FEATURE_AQL)) -+ return; -+ - if (!tx_completed) { - if (sta) - atomic_add(tx_airtime, ---- a/net/mac80211/sta_info.h -+++ b/net/mac80211/sta_info.h -@@ -128,7 +128,6 @@ enum ieee80211_agg_stop_reason { - /* Debugfs flags to enable/disable use of RX/TX airtime in scheduler */ - #define AIRTIME_USE_TX BIT(0) - #define AIRTIME_USE_RX BIT(1) --#define AIRTIME_USE_AQL BIT(2) - - struct airtime_info { - u64 rx_airtime; ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -3691,7 +3691,7 @@ begin: - - IEEE80211_SKB_CB(skb)->control.vif = vif; - -- if (local->airtime_flags & AIRTIME_USE_AQL) { -+ if (wiphy_ext_feature_isset(local->hw.wiphy, NL80211_EXT_FEATURE_AQL)) { - u32 airtime; - - airtime = ieee80211_calc_expected_tx_airtime(hw, vif, txq->sta, -@@ -3813,7 +3813,7 @@ bool ieee80211_txq_airtime_check(struct - struct sta_info *sta; - struct ieee80211_local *local = hw_to_local(hw); - -- if (!(local->airtime_flags & AIRTIME_USE_AQL)) -+ if (!wiphy_ext_feature_isset(local->hw.wiphy, NL80211_EXT_FEATURE_AQL)) - return true; - - if (!txq->sta) diff --git a/package/kernel/mac80211/patches/subsys/353-mac80211-use-more-bits-for-ack_frame_id.patch b/package/kernel/mac80211/patches/subsys/353-mac80211-use-more-bits-for-ack_frame_id.patch deleted file mode 100644 index a2fb9d4b10bd..000000000000 --- a/package/kernel/mac80211/patches/subsys/353-mac80211-use-more-bits-for-ack_frame_id.patch +++ /dev/null @@ -1,70 +0,0 @@ -From: Johannes Berg -Date: Wed, 15 Jan 2020 12:25:50 +0100 -Subject: [PATCH] mac80211: use more bits for ack_frame_id -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -It turns out that this wasn't a good idea, I hit a test failure in -hwsim due to this. That particular failure was easily worked around, -but it raised questions: if an AP needs to, for example, send action -frames to each connected station, the current limit is nowhere near -enough (especially if those stations are sleeping and the frames are -queued for a while.) - -Shuffle around some bits to make more room for ack_frame_id to allow -up to 8192 queued up frames, that's enough for queueing 4 frames to -each connected station, even at the maximum of 2007 stations on a -single AP. - -We take the bits from band (which currently only 2 but I leave 3 in -case we add another band) and from the hw_queue, which can only need -4 since it has a limit of 16 queues. - -Fixes: 6912daed05e1 ("mac80211: Shrink the size of ack_frame_id to make room for tx_time_est") -Signed-off-by: Johannes Berg -Acked-by: Toke Høiland-Jørgensen ---- - ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -1004,12 +1004,11 @@ ieee80211_rate_get_vht_nss(const struct - struct ieee80211_tx_info { - /* common information */ - u32 flags; -- u8 band; -- -- u8 hw_queue; -- -- u16 ack_frame_id:6; -- u16 tx_time_est:10; -+ u32 band:3, -+ ack_frame_id:13, -+ hw_queue:4, -+ tx_time_est:10; -+ /* 2 free bits */ - - union { - struct { ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -3449,7 +3449,7 @@ int ieee80211_attach_ack_skb(struct ieee - - spin_lock_irqsave(&local->ack_status_lock, spin_flags); - id = idr_alloc(&local->ack_status_frames, ack_skb, -- 1, 0x40, GFP_ATOMIC); -+ 1, 0x2000, GFP_ATOMIC); - spin_unlock_irqrestore(&local->ack_status_lock, spin_flags); - - if (id < 0) { ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -2458,7 +2458,7 @@ static int ieee80211_store_ack_skb(struc - - spin_lock_irqsave(&local->ack_status_lock, flags); - id = idr_alloc(&local->ack_status_frames, ack_skb, -- 1, 0x40, GFP_ATOMIC); -+ 1, 0x2000, GFP_ATOMIC); - spin_unlock_irqrestore(&local->ack_status_lock, flags); - - if (id >= 0) { diff --git a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch index ca028dd833a7..151ca25d18cd 100644 --- a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch +++ b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch @@ -1,6 +1,6 @@ --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -3454,6 +3454,7 @@ struct cfg80211_update_owe_info { +@@ -3458,6 +3458,7 @@ struct cfg80211_update_owe_info { * (as advertised by the nl80211 feature flag.) * @get_tx_power: store the current TX power into the dbm variable; * return 0 if successful @@ -8,7 +8,7 @@ * * @set_wds_peer: set the WDS peer for a WDS interface * -@@ -3769,6 +3770,7 @@ struct cfg80211_ops { +@@ -3773,6 +3774,7 @@ struct cfg80211_ops { enum nl80211_tx_power_setting type, int mbm); int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev, int *dbm); @@ -36,9 +36,9 @@ u8 ps_dtim_period; --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h -@@ -2373,6 +2373,9 @@ enum nl80211_commands { - * the allowed channel bandwidth configurations. (u8 attribute) - * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13. +@@ -2400,6 +2400,9 @@ enum nl80211_commands { + * @NL80211_ATTR_VLAN_ID: VLAN ID (1..4094) for the station and VLAN group key + * (u16). * + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce + * transmit power to stay within regulatory limits. u32, dBi. @@ -46,9 +46,9 @@ * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -2835,6 +2838,8 @@ enum nl80211_attrs { - NL80211_ATTR_WIPHY_EDMG_CHANNELS, - NL80211_ATTR_WIPHY_EDMG_BW_CONFIG, +@@ -2864,6 +2867,8 @@ enum nl80211_attrs { + + NL80211_ATTR_VLAN_ID, + NL80211_ATTR_WIPHY_ANTENNA_GAIN, + @@ -129,15 +129,15 @@ local->hw.max_mtu = IEEE80211_MAX_DATA_LEN; --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -628,6 +628,7 @@ const struct nla_policy nl80211_policy[N - .len = SAE_PASSWORD_MAX_LEN }, +@@ -630,6 +630,7 @@ const struct nla_policy nl80211_policy[N [NL80211_ATTR_TWT_RESPONDER] = { .type = NLA_FLAG }, [NL80211_ATTR_HE_OBSS_PD] = NLA_POLICY_NESTED(he_obss_pd_policy), + [NL80211_ATTR_VLAN_ID] = NLA_POLICY_RANGE(NLA_U16, 1, VLAN_N_VID - 2), + [NL80211_ATTR_WIPHY_ANTENNA_GAIN] = { .type = NLA_U32 }, }; /* policy for the key attributes */ -@@ -2992,6 +2993,20 @@ static int nl80211_set_wiphy(struct sk_b +@@ -2994,6 +2995,20 @@ static int nl80211_set_wiphy(struct sk_b if (result) return result; } diff --git a/package/network/utils/iw/patches/001-nl80211_h_sync.patch b/package/network/utils/iw/patches/001-nl80211_h_sync.patch index 6b65f61846af..57f05b711adf 100644 --- a/package/network/utils/iw/patches/001-nl80211_h_sync.patch +++ b/package/network/utils/iw/patches/001-nl80211_h_sync.patch @@ -1,28 +1,75 @@ --- a/nl80211.h +++ b/nl80211.h -@@ -2373,6 +2373,9 @@ enum nl80211_commands { +@@ -249,6 +249,22 @@ + */ + + /** ++ * DOC: VLAN offload support for setting group keys and binding STAs to VLANs ++ * ++ * By setting @NL80211_EXT_FEATURE_VLAN_OFFLOAD flag drivers can indicate they ++ * support offloading VLAN functionality in a manner where the driver exposes a ++ * single netdev that uses VLAN tagged frames and separate VLAN-specific netdevs ++ * can then be added using RTM_NEWLINK/IFLA_VLAN_ID similarly to the Ethernet ++ * case. Frames received from stations that are not assigned to any VLAN are ++ * delivered on the main netdev and frames to such stations can be sent through ++ * that main netdev. ++ * ++ * %NL80211_CMD_NEW_KEY (for group keys), %NL80211_CMD_NEW_STATION, and ++ * %NL80211_CMD_SET_STATION will optionally specify vlan_id using ++ * %NL80211_ATTR_VLAN_ID. ++ */ ++ ++/** + * enum nl80211_commands - supported nl80211 commands + * + * @NL80211_CMD_UNSPEC: unspecified command to catch errors +@@ -571,6 +587,14 @@ + * set of BSSID,frequency parameters is used (i.e., either the enforcing + * %NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict + * %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT). ++ * Driver shall not modify the IEs specified through %NL80211_ATTR_IE if ++ * %NL80211_ATTR_MAC is included. However, if %NL80211_ATTR_MAC_HINT is ++ * included, these IEs through %NL80211_ATTR_IE are specified by the user ++ * space based on the best possible BSS selected. Thus, if the driver ends ++ * up selecting a different BSS, it can modify these IEs accordingly (e.g. ++ * userspace asks the driver to perform PMKSA caching with BSS1 and the ++ * driver ends up selecting BSS2 with different PMKSA cache entry; RSNIE ++ * has to get updated with the apt PMKID). + * %NL80211_ATTR_PREV_BSSID can be used to request a reassociation within + * the ESS in case the device is already associated and an association with + * a different BSS is desired. +@@ -2373,6 +2397,12 @@ enum nl80211_commands { * the allowed channel bandwidth configurations. (u8 attribute) * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13. * ++ * @NL80211_ATTR_VLAN_ID: VLAN ID (1..4094) for the station and VLAN group key ++ * (u16). ++ * + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce + * transmit power to stay within regulatory limits. u32, dBi. + * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -2835,6 +2838,8 @@ enum nl80211_attrs { +@@ -2835,6 +2865,10 @@ enum nl80211_attrs { NL80211_ATTR_WIPHY_EDMG_CHANNELS, NL80211_ATTR_WIPHY_EDMG_BW_CONFIG, ++ NL80211_ATTR_VLAN_ID, ++ + NL80211_ATTR_WIPHY_ANTENNA_GAIN, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, -@@ -5484,6 +5489,10 @@ enum nl80211_feature_flags { +@@ -5484,6 +5518,14 @@ enum nl80211_feature_flags { * @NL80211_EXT_FEATURE_SAE_OFFLOAD: Device wants to do SAE authentication in * station mode (SAE password is passed as part of the connect command). * ++ * @NL80211_EXT_FEATURE_VLAN_OFFLOAD: The driver supports a single netdev ++ * with VLAN tagged frames and separate VLAN-specific netdevs added using ++ * vconfig similarly to the Ethernet case. ++ * + * @NL80211_EXT_FEATURE_AQL: The driver supports the Airtime Queue Limit (AQL) + * feature, which prevents bufferbloat by using the expected transmission + * time to limit the amount of data buffered in the hardware. @@ -30,7 +77,7 @@ * @NUM_NL80211_EXT_FEATURES: number of extended features. * @MAX_NL80211_EXT_FEATURES: highest extended feature index. */ -@@ -5529,6 +5538,8 @@ enum nl80211_ext_feature_index { +@@ -5529,6 +5571,8 @@ enum nl80211_ext_feature_index { NL80211_EXT_FEATURE_EXT_KEY_ID, NL80211_EXT_FEATURE_STA_TX_PWR, NL80211_EXT_FEATURE_SAE_OFFLOAD, From patchwork Wed May 6 21:31:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 1284783 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=hauke-m.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=IQy0q9wD; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49HVDr0vkdz9sRf for ; Thu, 7 May 2020 07:32:44 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9ltaq1Iuakg4xs4j7X/ox/kroM64NafSEybIbDA4cAU=; b=IQy0q9wDIsrYIN R8KmFxDTch3NHuPd0zglW855vVj1fs8EzNoKY3S2aiTlkArYZ4//fgIg3dw2xevtZdJL+7z5jXe3z udYzH9oIoUS+afxhLzg+Ng77K1XWzaqqkc+fbI2awFWqnZyeAyMqURzx6EvB2mrQ4VZ4jTkop04Rq bWVnTq6W63kPWnHzzkNmw5lZB418JMVWy71Y+y8AAIn9sN87I1FeEAwG3MEE8vqbcfU4DsyV3Nima U35zCFKhaM5qNMuFBwpu/EqneIMyyhuY9azPpbD6gOruPjilYxeYIiPObjiYk35gGmbzvVx7saxmM 2e3Ppi2p9Vc7CGqxzRHA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWReg-0000MI-Fx; Wed, 06 May 2020 21:32:38 +0000 Received: from mout-p-101.mailbox.org ([2001:67c:2050::465:101]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWRe6-0008EZ-Sm for openwrt-devel@lists.openwrt.org; Wed, 06 May 2020 21:32:10 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 49HVCt4H2zzKmmr; Wed, 6 May 2020 23:31:54 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id OedFnuRyNHzk; Wed, 6 May 2020 23:31:48 +0200 (CEST) From: Hauke Mehrtens To: openwrt-devel@lists.openwrt.org Date: Wed, 6 May 2020 23:31:29 +0200 Message-Id: <20200506213130.15898-4-hauke@hauke-m.de> In-Reply-To: <20200506213130.15898-1-hauke@hauke-m.de> References: <20200506213130.15898-1-hauke@hauke-m.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 5F55B1768 X-Rspamd-Score: -10.54 / 15.00 / 15.00 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200506_143203_400098_9642B00D X-CRM114-Status: GOOD ( 15.54 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record Subject: [OpenWrt-Devel] [PATCH v2 3/4] mac80211: Update to version 5.6.8-1 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hauke@hauke-m.de, foss@volatilesystems.org, koen.vandeputte@ncentric.com, nbd@nbd.name Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This updates the mac80211 backport. The removed patches are already integrated in the upstream version. Signed-off-by: Hauke Mehrtens --- package/kernel/mac80211/Makefile | 6 +- .../patches/ath/400-ath_move_debug_code.patch | 2 +- ...21-ath10k_init_devices_synchronously.patch | 2 +- ...h10k-increase-rx-buffer-size-to-2048.patch | 2 +- .../ath/930-ath10k_add_tpt_led_trigger.patch | 4 +- ...-of-peer_bw_rxnss_override-parameter.patch | 2 +- ...rolling-support-for-various-chipsets.patch | 30 +- ...75-ath10k-use-tpt-trigger-by-default.patch | 4 +- ...-interface-carrier-to-off-by-default.patch | 29 -- ...wo-D11-cores-if-chip-has-two-D11-cor.patch | 121 ------ ...-F2-blocksize-and-watermark-for-4359.patch | 79 ---- ...0003-brcmfmac-fix-rambase-for-4359-9.patch | 34 -- ...rors-when-setting-roaming-parameters.patch | 42 --- ...add-support-for-BCM4359-SDIO-chipset.patch | 75 ---- ...B-condition-when-setting-interface-c.patch | 130 ------- ...-mbss-in-vif-if-firmware-does-not-su.patch | 38 -- ...B-wake-interrupt-disabled-when-it-sh.patch | 66 ---- ...mac-use-true-false-for-bool-variable.patch | 27 -- ...lify-building-interface-combinations.patch | 103 ------ ...add-initial-support-for-monitor-mode.patch | 345 ------------------ ...-Remove-always-false-idx-0-statement.patch | 24 -- ...und-bug-with-some-inconsistent-BSSes.patch | 2 +- ...62-brcmfmac-Disable-power-management.patch | 2 +- .../mac80211/patches/brcm/998-survey.patch | 8 +- .../patches/build/060-no_local_ssb_bcma.patch | 4 +- .../602-rt2x00-introduce-rt2x00eeprom.patch | 8 +- ...c-loadable-via-OF-on-rt288x-305x-SoC.patch | 2 +- ...0-rt2x00-change-led-polarity-from-OF.patch | 2 +- .../611-rt2x00-add-AP+STA-support.patch | 2 +- ...dd-support-for-external-PA-on-MT7620.patch | 6 +- ...-rt2x00-add-rf-self-txdc-calibration.patch | 4 +- .../rt2x00/983-rt2x00-add-r-calibration.patch | 4 +- .../984-rt2x00-add-rxdcoc-calibration.patch | 4 +- .../985-rt2x00-add-rxiq-calibration.patch | 4 +- .../986-rt2x00-add-TX-LOFT-calibration.patch | 4 +- .../subsys/140-tweak-TSQ-setting.patch | 2 +- .../subsys/150-disable_addr_notifier.patch | 6 +- ...ate-debugfs-only-after-cfg80211-init.patch | 248 ------------- 38 files changed, 58 insertions(+), 1419 deletions(-) delete mode 100644 package/kernel/mac80211/patches/brcm/112-v5.6-brcmfmac-set-interface-carrier-to-off-by-default.patch delete mode 100644 package/kernel/mac80211/patches/brcm/114-v5.6-0001-brcmfmac-reset-two-D11-cores-if-chip-has-two-D11-cor.patch delete mode 100644 package/kernel/mac80211/patches/brcm/114-v5.6-0002-brcmfmac-set-F2-blocksize-and-watermark-for-4359.patch delete mode 100644 package/kernel/mac80211/patches/brcm/114-v5.6-0003-brcmfmac-fix-rambase-for-4359-9.patch delete mode 100644 package/kernel/mac80211/patches/brcm/114-v5.6-0004-brcmfmac-make-errors-when-setting-roaming-parameters.patch delete mode 100644 package/kernel/mac80211/patches/brcm/114-v5.6-0005-brcmfmac-add-support-for-BCM4359-SDIO-chipset.patch delete mode 100644 package/kernel/mac80211/patches/brcm/114-v5.6-0006-brcmfmac-add-RSDB-condition-when-setting-interface-c.patch delete mode 100644 package/kernel/mac80211/patches/brcm/114-v5.6-0007-brcmfmac-not-set-mbss-in-vif-if-firmware-does-not-su.patch delete mode 100644 package/kernel/mac80211/patches/brcm/116-v5.6-brcmfmac-Keep-OOB-wake-interrupt-disabled-when-it-sh.patch delete mode 100644 package/kernel/mac80211/patches/brcm/117-v5.6-brcmfmac-use-true-false-for-bool-variable.patch delete mode 100644 package/kernel/mac80211/patches/brcm/119-v5.6-0001-brcmfmac-simplify-building-interface-combinations.patch delete mode 100644 package/kernel/mac80211/patches/brcm/119-v5.6-0002-brcmfmac-add-initial-support-for-monitor-mode.patch delete mode 100644 package/kernel/mac80211/patches/brcm/120-v5.6-brcmfmac-Remove-always-false-idx-0-statement.patch delete mode 100644 package/kernel/mac80211/patches/subsys/250-mac80211-populate-debugfs-only-after-cfg80211-init.patch diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index aedaac4d32dd..f85142bbe9d7 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=5.5.19-1 +PKG_VERSION:=5.6.8-1 PKG_RELEASE:=1 -PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.5.19/ -PKG_HASH:=9dd9153df6082eaa079144193a3fab79d200942e1a2a1a80e032c9667b7b92a6 +PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.6.8/ +PKG_HASH:=547c5e17b9e23dd23cdf4d617a7550b80869e02114a7d404911c5ae928ae1da5 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION) diff --git a/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch b/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch index e7df0e14be5d..db10c45104d7 100644 --- a/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch +++ b/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/Makefile +++ b/drivers/net/wireless/ath/Makefile -@@ -14,10 +14,10 @@ ath-objs := main.o \ +@@ -15,10 +15,10 @@ ath-objs := main.o \ regd.o \ hw.o \ key.o \ diff --git a/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch index 728c86effbb4..7409db7cfda0 100644 --- a/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch +++ b/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch @@ -14,7 +14,7 @@ Signed-off-by: Sven Eckelmann --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c -@@ -3105,6 +3105,16 @@ int ath10k_core_register(struct ath10k * +@@ -3094,6 +3094,16 @@ int ath10k_core_register(struct ath10k * queue_work(ar->workqueue, &ar->register_work); diff --git a/package/kernel/mac80211/patches/ath/922-ath10k-increase-rx-buffer-size-to-2048.patch b/package/kernel/mac80211/patches/ath/922-ath10k-increase-rx-buffer-size-to-2048.patch index 55429139fa7c..a8ae3204d31d 100644 --- a/package/kernel/mac80211/patches/ath/922-ath10k-increase-rx-buffer-size-to-2048.patch +++ b/package/kernel/mac80211/patches/ath/922-ath10k-increase-rx-buffer-size-to-2048.patch @@ -26,7 +26,7 @@ Forwarded: https://patchwork.kernel.org/patch/11367055/ --- a/drivers/net/wireless/ath/ath10k/htt.h +++ b/drivers/net/wireless/ath/ath10k/htt.h -@@ -2219,7 +2219,7 @@ struct htt_rx_chan_info { +@@ -2221,7 +2221,7 @@ struct htt_rx_chan_info { * Should be: sizeof(struct htt_host_rx_desc) + max rx MSDU size, * rounded up to a cache line size. */ diff --git a/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch index 6fe551f9d539..ae03951908da 100644 --- a/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch +++ b/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -8761,6 +8761,21 @@ static int ath10k_mac_init_rd(struct ath +@@ -8764,6 +8764,21 @@ static int ath10k_mac_init_rd(struct ath return 0; } @@ -22,7 +22,7 @@ int ath10k_mac_register(struct ath10k *ar) { static const u32 cipher_suites[] = { -@@ -9088,6 +9103,12 @@ int ath10k_mac_register(struct ath10k *a +@@ -9092,6 +9107,12 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; diff --git a/package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch b/package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch index 4d51205b5ed5..dbf30418e073 100644 --- a/package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch +++ b/package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch @@ -105,7 +105,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling } --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c -@@ -7601,12 +7601,7 @@ ath10k_wmi_peer_assoc_fill_10_4(struct a +@@ -7615,12 +7615,7 @@ ath10k_wmi_peer_assoc_fill_10_4(struct a struct wmi_10_4_peer_assoc_complete_cmd *cmd = buf; ath10k_wmi_peer_assoc_fill_10_2(ar, buf, arg); diff --git a/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch index d72d515ad3c0..fb49ed036a0a 100644 --- a/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch +++ b/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch @@ -148,7 +148,7 @@ v13: .patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, -@@ -338,6 +341,7 @@ static const struct ath10k_hw_params ath +@@ -339,6 +342,7 @@ static const struct ath10k_hw_params ath .dev_id = QCA99X0_2_0_DEVICE_ID, .bus = ATH10K_BUS_PCI, .name = "qca99x0 hw2.0", @@ -156,7 +156,7 @@ v13: .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, .otp_exe_param = 0x00000700, -@@ -379,6 +383,7 @@ static const struct ath10k_hw_params ath +@@ -380,6 +384,7 @@ static const struct ath10k_hw_params ath .dev_id = QCA9984_1_0_DEVICE_ID, .bus = ATH10K_BUS_PCI, .name = "qca9984/qca9994 hw1.0", @@ -164,7 +164,7 @@ v13: .patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, -@@ -427,6 +432,7 @@ static const struct ath10k_hw_params ath +@@ -428,6 +433,7 @@ static const struct ath10k_hw_params ath .dev_id = QCA9888_2_0_DEVICE_ID, .bus = ATH10K_BUS_PCI, .name = "qca9888 hw2.0", @@ -172,7 +172,7 @@ v13: .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, -@@ -2822,6 +2828,10 @@ int ath10k_core_start(struct ath10k *ar, +@@ -2811,6 +2817,10 @@ int ath10k_core_start(struct ath10k *ar, goto err_hif_stop; } @@ -183,7 +183,7 @@ v13: return 0; err_hif_stop: -@@ -3078,9 +3088,18 @@ static void ath10k_core_register_work(st +@@ -3067,9 +3077,18 @@ static void ath10k_core_register_work(st goto err_spectral_destroy; } @@ -202,7 +202,7 @@ v13: err_spectral_destroy: ath10k_spectral_destroy(ar); err_debug_destroy: -@@ -3126,6 +3145,8 @@ void ath10k_core_unregister(struct ath10 +@@ -3115,6 +3134,8 @@ void ath10k_core_unregister(struct ath10 if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) return; @@ -221,7 +221,7 @@ v13: #include "htt.h" #include "htc.h" -@@ -1179,6 +1180,13 @@ struct ath10k { +@@ -1180,6 +1181,13 @@ struct ath10k { } testmode; struct { @@ -233,8 +233,8 @@ v13: + + struct { /* protected by data_lock */ + u32 rx_crc_err_drop; u32 fw_crash_counter; - u32 fw_warm_reset_counter; --- a/drivers/net/wireless/ath/ath10k/hw.h +++ b/drivers/net/wireless/ath/ath10k/hw.h @@ -517,6 +517,7 @@ struct ath10k_hw_params { @@ -456,7 +456,7 @@ v13: { --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c -@@ -4444,6 +4444,8 @@ static const struct wmi_ops wmi_tlv_ops +@@ -4447,6 +4447,8 @@ static const struct wmi_ops wmi_tlv_ops .gen_echo = ath10k_wmi_tlv_op_gen_echo, .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf, .gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable, @@ -467,7 +467,7 @@ v13: static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = { --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c -@@ -7421,6 +7421,49 @@ ath10k_wmi_op_gen_peer_set_param(struct +@@ -7435,6 +7435,49 @@ ath10k_wmi_op_gen_peer_set_param(struct return skb; } @@ -517,7 +517,7 @@ v13: static struct sk_buff * ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id, enum wmi_sta_ps_mode psmode) -@@ -9078,6 +9121,9 @@ static const struct wmi_ops wmi_ops = { +@@ -9092,6 +9135,9 @@ static const struct wmi_ops wmi_ops = { .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill, .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, .gen_echo = ath10k_wmi_op_gen_echo, @@ -527,7 +527,7 @@ v13: /* .gen_bcn_tmpl not implemented */ /* .gen_prb_tmpl not implemented */ /* .gen_p2p_go_bcn_ie not implemented */ -@@ -9148,6 +9194,8 @@ static const struct wmi_ops wmi_10_1_ops +@@ -9162,6 +9208,8 @@ static const struct wmi_ops wmi_10_1_ops .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, .gen_echo = ath10k_wmi_op_gen_echo, @@ -536,7 +536,7 @@ v13: /* .gen_bcn_tmpl not implemented */ /* .gen_prb_tmpl not implemented */ /* .gen_p2p_go_bcn_ie not implemented */ -@@ -9220,6 +9268,8 @@ static const struct wmi_ops wmi_10_2_ops +@@ -9234,6 +9282,8 @@ static const struct wmi_ops wmi_10_2_ops .gen_delba_send = ath10k_wmi_op_gen_delba_send, .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, @@ -545,7 +545,7 @@ v13: /* .gen_pdev_enable_adaptive_cca not implemented */ }; -@@ -9291,6 +9341,8 @@ static const struct wmi_ops wmi_10_2_4_o +@@ -9305,6 +9355,8 @@ static const struct wmi_ops wmi_10_2_4_o ath10k_wmi_op_gen_pdev_enable_adaptive_cca, .get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype, .gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing, @@ -554,7 +554,7 @@ v13: /* .gen_bcn_tmpl not implemented */ /* .gen_prb_tmpl not implemented */ /* .gen_p2p_go_bcn_ie not implemented */ -@@ -9371,6 +9423,8 @@ static const struct wmi_ops wmi_10_4_ops +@@ -9385,6 +9437,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_echo = ath10k_wmi_op_gen_echo, .gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config, diff --git a/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch index 3973dc8cb31b..80175367fe82 100644 --- a/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch @@ -16,7 +16,7 @@ Signed-off-by: Mathias Kresin --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h -@@ -1228,6 +1228,10 @@ struct ath10k { +@@ -1230,6 +1230,10 @@ struct ath10k { struct ath10k_bus_params bus_param; struct completion peer_delete_done; @@ -42,7 +42,7 @@ Signed-off-by: Mathias Kresin if (ret) --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -9120,7 +9120,7 @@ int ath10k_mac_register(struct ath10k *a +@@ -9124,7 +9124,7 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; #ifdef CPTCFG_MAC80211_LEDS diff --git a/package/kernel/mac80211/patches/brcm/112-v5.6-brcmfmac-set-interface-carrier-to-off-by-default.patch b/package/kernel/mac80211/patches/brcm/112-v5.6-brcmfmac-set-interface-carrier-to-off-by-default.patch deleted file mode 100644 index bb4782a7a48c..000000000000 --- a/package/kernel/mac80211/patches/brcm/112-v5.6-brcmfmac-set-interface-carrier-to-off-by-default.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 8d9627b05b2c33e4468e65739eb7caf9c3f274d8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Tue, 10 Dec 2019 12:35:55 +0100 -Subject: [PATCH] brcmfmac: set interface carrier to off by default -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -It's important as brcmfmac creates one main interface for each PHY and -doesn't allow deleting it. Not setting carrier could result in other -subsystems misbehaving (e.g. LEDs "netdev" trigger turning LED on). - -Signed-off-by: Rafał Miłecki -Signed-off-by: Kalle Valo ---- - drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c -@@ -678,6 +678,8 @@ int brcmf_net_attach(struct brcmf_if *if - goto fail; - } - -+ netif_carrier_off(ndev); -+ - netdev_set_priv_destructor(ndev, brcmf_cfg80211_free_netdev); - brcmf_dbg(INFO, "%s: Broadcom Dongle Host Driver\n", ndev->name); - return 0; diff --git a/package/kernel/mac80211/patches/brcm/114-v5.6-0001-brcmfmac-reset-two-D11-cores-if-chip-has-two-D11-cor.patch b/package/kernel/mac80211/patches/brcm/114-v5.6-0001-brcmfmac-reset-two-D11-cores-if-chip-has-two-D11-cor.patch deleted file mode 100644 index 19bf41ad9b5b..000000000000 --- a/package/kernel/mac80211/patches/brcm/114-v5.6-0001-brcmfmac-reset-two-D11-cores-if-chip-has-two-D11-cor.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 1b8d2e0a9e4221b99eea375c079507ce8ef655f5 Mon Sep 17 00:00:00 2001 -From: Wright Feng -Date: Thu, 12 Dec 2019 00:52:45 +0100 -Subject: [PATCH 1/7] brcmfmac: reset two D11 cores if chip has two D11 cores - -There are two D11 cores in RSDB chips like 4359. We have to reset two -D11 cores simutaneously before firmware download, or the firmware may -not be initialized correctly and cause "fw initialized failed" error. - -Signed-off-by: Wright Feng -Signed-off-by: Soeren Moch -Reviewed-by: Chi-Hsien Lin -Signed-off-by: Kalle Valo ---- - .../broadcom/brcm80211/brcmfmac/chip.c | 50 +++++++++++++++++++ - .../broadcom/brcm80211/brcmfmac/chip.h | 1 + - .../broadcom/brcm80211/brcmfmac/pcie.c | 2 +- - 3 files changed, 52 insertions(+), 1 deletion(-) - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c -@@ -433,11 +433,25 @@ static void brcmf_chip_ai_resetcore(stru - { - struct brcmf_chip_priv *ci; - int count; -+ struct brcmf_core *d11core2 = NULL; -+ struct brcmf_core_priv *d11priv2 = NULL; - - ci = core->chip; - -+ /* special handle two D11 cores reset */ -+ if (core->pub.id == BCMA_CORE_80211) { -+ d11core2 = brcmf_chip_get_d11core(&ci->pub, 1); -+ if (d11core2) { -+ brcmf_dbg(INFO, "found two d11 cores, reset both\n"); -+ d11priv2 = container_of(d11core2, -+ struct brcmf_core_priv, pub); -+ } -+ } -+ - /* must disable first to work for arbitrary current core state */ - brcmf_chip_ai_coredisable(core, prereset, reset); -+ if (d11priv2) -+ brcmf_chip_ai_coredisable(d11priv2, prereset, reset); - - count = 0; - while (ci->ops->read32(ci->ctx, core->wrapbase + BCMA_RESET_CTL) & -@@ -449,9 +463,30 @@ static void brcmf_chip_ai_resetcore(stru - usleep_range(40, 60); - } - -+ if (d11priv2) { -+ count = 0; -+ while (ci->ops->read32(ci->ctx, -+ d11priv2->wrapbase + BCMA_RESET_CTL) & -+ BCMA_RESET_CTL_RESET) { -+ ci->ops->write32(ci->ctx, -+ d11priv2->wrapbase + BCMA_RESET_CTL, -+ 0); -+ count++; -+ if (count > 50) -+ break; -+ usleep_range(40, 60); -+ } -+ } -+ - ci->ops->write32(ci->ctx, core->wrapbase + BCMA_IOCTL, - postreset | BCMA_IOCTL_CLK); - ci->ops->read32(ci->ctx, core->wrapbase + BCMA_IOCTL); -+ -+ if (d11priv2) { -+ ci->ops->write32(ci->ctx, d11priv2->wrapbase + BCMA_IOCTL, -+ postreset | BCMA_IOCTL_CLK); -+ ci->ops->read32(ci->ctx, d11priv2->wrapbase + BCMA_IOCTL); -+ } - } - - char *brcmf_chip_name(u32 id, u32 rev, char *buf, uint len) -@@ -1109,6 +1144,21 @@ void brcmf_chip_detach(struct brcmf_chip - kfree(chip); - } - -+struct brcmf_core *brcmf_chip_get_d11core(struct brcmf_chip *pub, u8 unit) -+{ -+ struct brcmf_chip_priv *chip; -+ struct brcmf_core_priv *core; -+ -+ chip = container_of(pub, struct brcmf_chip_priv, pub); -+ list_for_each_entry(core, &chip->cores, list) { -+ if (core->pub.id == BCMA_CORE_80211) { -+ if (unit-- == 0) -+ return &core->pub; -+ } -+ } -+ return NULL; -+} -+ - struct brcmf_core *brcmf_chip_get_core(struct brcmf_chip *pub, u16 coreid) - { - struct brcmf_chip_priv *chip; ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h -@@ -74,6 +74,7 @@ struct brcmf_chip *brcmf_chip_attach(voi - const struct brcmf_buscore_ops *ops); - void brcmf_chip_detach(struct brcmf_chip *chip); - struct brcmf_core *brcmf_chip_get_core(struct brcmf_chip *chip, u16 coreid); -+struct brcmf_core *brcmf_chip_get_d11core(struct brcmf_chip *pub, u8 unit); - struct brcmf_core *brcmf_chip_get_chipcommon(struct brcmf_chip *chip); - struct brcmf_core *brcmf_chip_get_pmu(struct brcmf_chip *pub); - bool brcmf_chip_iscoreup(struct brcmf_core *core); ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c -@@ -78,7 +78,7 @@ static const struct brcmf_firmware_mappi - BRCMF_FW_ENTRY(BRCM_CC_4371_CHIP_ID, 0xFFFFFFFF, 4371), - }; - --#define BRCMF_PCIE_FW_UP_TIMEOUT 2000 /* msec */ -+#define BRCMF_PCIE_FW_UP_TIMEOUT 5000 /* msec */ - - #define BRCMF_PCIE_REG_MAP_SIZE (32 * 1024) - diff --git a/package/kernel/mac80211/patches/brcm/114-v5.6-0002-brcmfmac-set-F2-blocksize-and-watermark-for-4359.patch b/package/kernel/mac80211/patches/brcm/114-v5.6-0002-brcmfmac-set-F2-blocksize-and-watermark-for-4359.patch deleted file mode 100644 index 37ba7f360b3e..000000000000 --- a/package/kernel/mac80211/patches/brcm/114-v5.6-0002-brcmfmac-set-F2-blocksize-and-watermark-for-4359.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 172f6854551d48d1c9530f84513b421db944e714 Mon Sep 17 00:00:00 2001 -From: Chung-Hsien Hsu -Date: Thu, 12 Dec 2019 00:52:46 +0100 -Subject: [PATCH 2/7] brcmfmac: set F2 blocksize and watermark for 4359 - -Set F2 blocksize to 256 bytes and watermark to 0x40 for 4359. Also -enable and configure F1 MesBusyCtrl. It fixes DMA error while having -UDP bi-directional traffic. - -Signed-off-by: Chung-Hsien Hsu -[slightly adapted for rebase on mainline linux] -Signed-off-by: Soeren Moch -Reviewed-by: Chi-Hsien Lin -Signed-off-by: Kalle Valo ---- - .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 6 +++++- - .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 15 +++++++++++++++ - 2 files changed, 20 insertions(+), 1 deletion(-) - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c -@@ -43,6 +43,7 @@ - - #define SDIO_FUNC1_BLOCKSIZE 64 - #define SDIO_FUNC2_BLOCKSIZE 512 -+#define SDIO_4359_FUNC2_BLOCKSIZE 256 - /* Maximum milliseconds to wait for F2 to come up */ - #define SDIO_WAIT_F2RDY 3000 - -@@ -903,6 +904,7 @@ static void brcmf_sdiod_host_fixup(struc - static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev) - { - int ret = 0; -+ unsigned int f2_blksz = SDIO_FUNC2_BLOCKSIZE; - - sdio_claim_host(sdiodev->func1); - -@@ -912,7 +914,9 @@ static int brcmf_sdiod_probe(struct brcm - sdio_release_host(sdiodev->func1); - goto out; - } -- ret = sdio_set_block_size(sdiodev->func2, SDIO_FUNC2_BLOCKSIZE); -+ if (sdiodev->func2->device == SDIO_DEVICE_ID_BROADCOM_4359) -+ f2_blksz = SDIO_4359_FUNC2_BLOCKSIZE; -+ ret = sdio_set_block_size(sdiodev->func2, f2_blksz); - if (ret) { - brcmf_err("Failed to set F2 blocksize\n"); - sdio_release_host(sdiodev->func1); ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c -@@ -42,6 +42,8 @@ - #define DEFAULT_F2_WATERMARK 0x8 - #define CY_4373_F2_WATERMARK 0x40 - #define CY_43012_F2_WATERMARK 0x60 -+#define CY_4359_F2_WATERMARK 0x40 -+#define CY_4359_F1_MESBUSYCTRL (CY_4359_F2_WATERMARK | SBSDIO_MESBUSYCTRL_ENAB) - - #ifdef DEBUG - -@@ -4208,6 +4210,19 @@ static void brcmf_sdio_firmware_callback - brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl, - &err); - break; -+ case SDIO_DEVICE_ID_BROADCOM_4359: -+ brcmf_dbg(INFO, "set F2 watermark to 0x%x*4 bytes\n", -+ CY_4359_F2_WATERMARK); -+ brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK, -+ CY_4359_F2_WATERMARK, &err); -+ devctl = brcmf_sdiod_readb(sdiod, SBSDIO_DEVICE_CTL, -+ &err); -+ devctl |= SBSDIO_DEVCTL_F2WM_ENAB; -+ brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl, -+ &err); -+ brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_MESBUSYCTRL, -+ CY_4359_F1_MESBUSYCTRL, &err); -+ break; - default: - brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK, - DEFAULT_F2_WATERMARK, &err); diff --git a/package/kernel/mac80211/patches/brcm/114-v5.6-0003-brcmfmac-fix-rambase-for-4359-9.patch b/package/kernel/mac80211/patches/brcm/114-v5.6-0003-brcmfmac-fix-rambase-for-4359-9.patch deleted file mode 100644 index 7e4e32ffdd6e..000000000000 --- a/package/kernel/mac80211/patches/brcm/114-v5.6-0003-brcmfmac-fix-rambase-for-4359-9.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 6647274ed995a172369cb04754eb5f8b85f68f6d Mon Sep 17 00:00:00 2001 -From: Soeren Moch -Date: Thu, 12 Dec 2019 00:52:47 +0100 -Subject: [PATCH 3/7] brcmfmac: fix rambase for 4359/9 - -Newer 4359 chip revisions need a different rambase address. -This fixes firmware download on such devices which fails otherwise. - -Signed-off-by: Soeren Moch -Acked-by: Chi-Hsien Lin -Signed-off-by: Kalle Valo ---- - drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c -@@ -712,7 +712,6 @@ static u32 brcmf_chip_tcm_rambase(struct - case BRCM_CC_43569_CHIP_ID: - case BRCM_CC_43570_CHIP_ID: - case BRCM_CC_4358_CHIP_ID: -- case BRCM_CC_4359_CHIP_ID: - case BRCM_CC_43602_CHIP_ID: - case BRCM_CC_4371_CHIP_ID: - return 0x180000; -@@ -722,6 +721,8 @@ static u32 brcmf_chip_tcm_rambase(struct - case BRCM_CC_4366_CHIP_ID: - case BRCM_CC_43664_CHIP_ID: - return 0x200000; -+ case BRCM_CC_4359_CHIP_ID: -+ return (ci->pub.chiprev < 9) ? 0x180000 : 0x160000; - case CY_CC_4373_CHIP_ID: - return 0x160000; - default: diff --git a/package/kernel/mac80211/patches/brcm/114-v5.6-0004-brcmfmac-make-errors-when-setting-roaming-parameters.patch b/package/kernel/mac80211/patches/brcm/114-v5.6-0004-brcmfmac-make-errors-when-setting-roaming-parameters.patch deleted file mode 100644 index 76138fbc684d..000000000000 --- a/package/kernel/mac80211/patches/brcm/114-v5.6-0004-brcmfmac-make-errors-when-setting-roaming-parameters.patch +++ /dev/null @@ -1,42 +0,0 @@ -From c12c8913d79c49ceccb38f42714d25b783833758 Mon Sep 17 00:00:00 2001 -From: Soeren Moch -Date: Thu, 12 Dec 2019 00:52:48 +0100 -Subject: [PATCH 4/7] brcmfmac: make errors when setting roaming parameters - non-fatal - -4359 dongles do not support setting roaming parameters (error -52). -Do not fail the 80211 configuration in this case. - -Signed-off-by: Soeren Moch -Acked-by: Chi-Hsien Lin -Signed-off-by: Kalle Valo ---- - .../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 10 ++++------ - 1 file changed, 4 insertions(+), 6 deletions(-) - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -6012,19 +6012,17 @@ static s32 brcmf_dongle_roam(struct brcm - roamtrigger[1] = cpu_to_le32(BRCM_BAND_ALL); - err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_TRIGGER, - (void *)roamtrigger, sizeof(roamtrigger)); -- if (err) { -+ if (err) - bphy_err(drvr, "WLC_SET_ROAM_TRIGGER error (%d)\n", err); -- goto roam_setup_done; -- } - - roam_delta[0] = cpu_to_le32(WL_ROAM_DELTA); - roam_delta[1] = cpu_to_le32(BRCM_BAND_ALL); - err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_DELTA, - (void *)roam_delta, sizeof(roam_delta)); -- if (err) { -+ if (err) - bphy_err(drvr, "WLC_SET_ROAM_DELTA error (%d)\n", err); -- goto roam_setup_done; -- } -+ -+ return 0; - - roam_setup_done: - return err; diff --git a/package/kernel/mac80211/patches/brcm/114-v5.6-0005-brcmfmac-add-support-for-BCM4359-SDIO-chipset.patch b/package/kernel/mac80211/patches/brcm/114-v5.6-0005-brcmfmac-add-support-for-BCM4359-SDIO-chipset.patch deleted file mode 100644 index 0001fb17a79e..000000000000 --- a/package/kernel/mac80211/patches/brcm/114-v5.6-0005-brcmfmac-add-support-for-BCM4359-SDIO-chipset.patch +++ /dev/null @@ -1,75 +0,0 @@ -From d4aef159394d5940bd7158ab789969dab82f7c76 Mon Sep 17 00:00:00 2001 -From: Soeren Moch -Date: Thu, 12 Dec 2019 00:52:49 +0100 -Subject: [PATCH 5/7] brcmfmac: add support for BCM4359 SDIO chipset - -BCM4359 is a 2x2 802.11 abgn+ac Dual-Band HT80 combo chip and it -supports Real Simultaneous Dual Band feature. - -Based on a similar patch by: Wright Feng - -Signed-off-by: Soeren Moch -Acked-by: Chi-Hsien Lin -Acked-by: Ulf Hansson -Signed-off-by: Kalle Valo ---- - drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 2 ++ - drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 1 + - drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 ++ - include/linux/mmc/sdio_ids.h | 2 ++ - 4 files changed, 7 insertions(+) - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c -@@ -973,8 +973,10 @@ static const struct sdio_device_id brcmf - BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43455), - BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354), - BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4356), -+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4359), - BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_4373), - BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_43012), -+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_89359), - { /* end: all zeroes */ } - }; - MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids); ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c -@@ -1408,6 +1408,7 @@ bool brcmf_chip_sr_capable(struct brcmf_ - addr = CORE_CC_REG(base, sr_control0); - reg = chip->ops->read32(chip->ctx, addr); - return (reg & CC_SR_CTL0_ENABLE_MASK) != 0; -+ case BRCM_CC_4359_CHIP_ID: - case CY_CC_43012_CHIP_ID: - addr = CORE_CC_REG(pmu->base, retention_ctl); - reg = chip->ops->read32(chip->ctx, addr); ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c -@@ -616,6 +616,7 @@ BRCMF_FW_DEF(43455, "brcmfmac43455-sdio" - BRCMF_FW_DEF(43456, "brcmfmac43456-sdio"); - BRCMF_FW_DEF(4354, "brcmfmac4354-sdio"); - BRCMF_FW_DEF(4356, "brcmfmac4356-sdio"); -+BRCMF_FW_DEF(4359, "brcmfmac4359-sdio"); - BRCMF_FW_DEF(4373, "brcmfmac4373-sdio"); - BRCMF_FW_DEF(43012, "brcmfmac43012-sdio"); - -@@ -638,6 +639,7 @@ static const struct brcmf_firmware_mappi - BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFDC0, 43455), - BRCMF_FW_ENTRY(BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, 4354), - BRCMF_FW_ENTRY(BRCM_CC_4356_CHIP_ID, 0xFFFFFFFF, 4356), -+ BRCMF_FW_ENTRY(BRCM_CC_4359_CHIP_ID, 0xFFFFFFFF, 4359), - BRCMF_FW_ENTRY(CY_CC_4373_CHIP_ID, 0xFFFFFFFF, 4373), - BRCMF_FW_ENTRY(CY_CC_43012_CHIP_ID, 0xFFFFFFFF, 43012) - }; ---- a/include/linux/mmc/sdio_ids.h -+++ b/include/linux/mmc/sdio_ids.h -@@ -41,8 +41,10 @@ - #define SDIO_DEVICE_ID_BROADCOM_43455 0xa9bf - #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 - #define SDIO_DEVICE_ID_BROADCOM_4356 0x4356 -+#define SDIO_DEVICE_ID_BROADCOM_4359 0x4359 - #define SDIO_DEVICE_ID_CYPRESS_4373 0x4373 - #define SDIO_DEVICE_ID_CYPRESS_43012 43012 -+#define SDIO_DEVICE_ID_CYPRESS_89359 0x4355 - - #define SDIO_VENDOR_ID_INTEL 0x0089 - #define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402 diff --git a/package/kernel/mac80211/patches/brcm/114-v5.6-0006-brcmfmac-add-RSDB-condition-when-setting-interface-c.patch b/package/kernel/mac80211/patches/brcm/114-v5.6-0006-brcmfmac-add-RSDB-condition-when-setting-interface-c.patch deleted file mode 100644 index 09059defe57c..000000000000 --- a/package/kernel/mac80211/patches/brcm/114-v5.6-0006-brcmfmac-add-RSDB-condition-when-setting-interface-c.patch +++ /dev/null @@ -1,130 +0,0 @@ -From 837482e69a3f0d7cbc73922020012f83635f5ddb Mon Sep 17 00:00:00 2001 -From: Wright Feng -Date: Thu, 12 Dec 2019 00:52:50 +0100 -Subject: [PATCH 6/7] brcmfmac: add RSDB condition when setting interface - combinations - -With firmware RSDB feature -1. The maximum support interface is four. -2. The maximum difference channel is two. -3. The maximum interfaces of {station/p2p client/AP} are two. -4. The maximum interface of p2p device is one. - -Signed-off-by: Wright Feng -Signed-off-by: Soeren Moch -Reviewed-by: Chi-Hsien Lin -Signed-off-by: Kalle Valo ---- - .../broadcom/brcm80211/brcmfmac/cfg80211.c | 54 ++++++++++++++++--- - 1 file changed, 46 insertions(+), 8 deletions(-) - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -6520,6 +6520,9 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = - * #STA <= 1, #AP <= 1, channels = 1, 2 total - * #AP <= 4, matching BI, channels = 1, 4 total - * -+ * no p2p and rsdb: -+ * #STA <= 2, #AP <= 2, channels = 2, 4 total -+ * - * p2p, no mchan, and mbss: - * - * #STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 1, channels = 1, 3 total -@@ -6531,6 +6534,10 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = - * #STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 1, channels = 2, 3 total - * #STA <= 1, #P2P-DEV <= 1, #AP <= 1, #P2P-CL <= 1, channels = 1, 4 total - * #AP <= 4, matching BI, channels = 1, 4 total -+ * -+ * p2p, rsdb, and no mbss: -+ * #STA <= 2, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 2, AP <= 2, -+ * channels = 2, 4 total - */ - static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) - { -@@ -6538,13 +6545,14 @@ static int brcmf_setup_ifmodes(struct wi - struct ieee80211_iface_limit *c0_limits = NULL; - struct ieee80211_iface_limit *p2p_limits = NULL; - struct ieee80211_iface_limit *mbss_limits = NULL; -- bool mbss, p2p; -+ bool mbss, p2p, rsdb; - int i, c, n_combos; - - mbss = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS); - p2p = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_P2P); -+ rsdb = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB); - -- n_combos = 1 + !!p2p + !!mbss; -+ n_combos = 1 + !!(p2p && !rsdb) + !!mbss; - combo = kcalloc(n_combos, sizeof(*combo), GFP_KERNEL); - if (!combo) - goto err; -@@ -6555,16 +6563,36 @@ static int brcmf_setup_ifmodes(struct wi - - c = 0; - i = 0; -- c0_limits = kcalloc(p2p ? 3 : 2, sizeof(*c0_limits), GFP_KERNEL); -+ if (p2p && rsdb) -+ c0_limits = kcalloc(4, sizeof(*c0_limits), GFP_KERNEL); -+ else if (p2p) -+ c0_limits = kcalloc(3, sizeof(*c0_limits), GFP_KERNEL); -+ else -+ c0_limits = kcalloc(2, sizeof(*c0_limits), GFP_KERNEL); - if (!c0_limits) - goto err; -- c0_limits[i].max = 1; -- c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION); -- if (p2p) { -+ if (p2p && rsdb) { -+ combo[c].num_different_channels = 2; -+ wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) | -+ BIT(NL80211_IFTYPE_P2P_GO) | -+ BIT(NL80211_IFTYPE_P2P_DEVICE); -+ c0_limits[i].max = 2; -+ c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION); -+ c0_limits[i].max = 1; -+ c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_DEVICE); -+ c0_limits[i].max = 2; -+ c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT) | -+ BIT(NL80211_IFTYPE_P2P_GO); -+ c0_limits[i].max = 2; -+ c0_limits[i++].types = BIT(NL80211_IFTYPE_AP); -+ combo[c].max_interfaces = 5; -+ } else if (p2p) { - if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN)) - combo[c].num_different_channels = 2; - else - combo[c].num_different_channels = 1; -+ c0_limits[i].max = 1; -+ c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION); - wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) | - BIT(NL80211_IFTYPE_P2P_GO) | - BIT(NL80211_IFTYPE_P2P_DEVICE); -@@ -6573,16 +6601,26 @@ static int brcmf_setup_ifmodes(struct wi - c0_limits[i].max = 1; - c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT) | - BIT(NL80211_IFTYPE_P2P_GO); -+ combo[c].max_interfaces = i; -+ } else if (rsdb) { -+ combo[c].num_different_channels = 2; -+ c0_limits[i].max = 2; -+ c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION); -+ c0_limits[i].max = 2; -+ c0_limits[i++].types = BIT(NL80211_IFTYPE_AP); -+ combo[c].max_interfaces = 3; - } else { - combo[c].num_different_channels = 1; - c0_limits[i].max = 1; -+ c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION); -+ c0_limits[i].max = 1; - c0_limits[i++].types = BIT(NL80211_IFTYPE_AP); -+ combo[c].max_interfaces = i; - } -- combo[c].max_interfaces = i; - combo[c].n_limits = i; - combo[c].limits = c0_limits; - -- if (p2p) { -+ if (p2p && !rsdb) { - c++; - i = 0; - p2p_limits = kcalloc(4, sizeof(*p2p_limits), GFP_KERNEL); diff --git a/package/kernel/mac80211/patches/brcm/114-v5.6-0007-brcmfmac-not-set-mbss-in-vif-if-firmware-does-not-su.patch b/package/kernel/mac80211/patches/brcm/114-v5.6-0007-brcmfmac-not-set-mbss-in-vif-if-firmware-does-not-su.patch deleted file mode 100644 index 1870088bf64e..000000000000 --- a/package/kernel/mac80211/patches/brcm/114-v5.6-0007-brcmfmac-not-set-mbss-in-vif-if-firmware-does-not-su.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 2635853ce4ab7654a77ab7080fb56de83408606b Mon Sep 17 00:00:00 2001 -From: Wright Feng -Date: Thu, 12 Dec 2019 00:52:51 +0100 -Subject: [PATCH 7/7] brcmfmac: not set mbss in vif if firmware does not - support MBSS - -With RSDB mode, FMAC and firmware are able to create 2 or more AP, -so we should not set mbss in vif structure if firmware does not -support MBSS feature. - -Signed-off-by: Wright Feng -Signed-off-by: Soeren Moch -Reviewed-by: Chi-Hsien Lin -Signed-off-by: Kalle Valo ---- - drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -5363,6 +5363,7 @@ struct brcmf_cfg80211_vif *brcmf_alloc_v - struct brcmf_cfg80211_vif *vif_walk; - struct brcmf_cfg80211_vif *vif; - bool mbss; -+ struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0); - - brcmf_dbg(TRACE, "allocating virtual interface (size=%zu)\n", - sizeof(*vif)); -@@ -5375,7 +5376,8 @@ struct brcmf_cfg80211_vif *brcmf_alloc_v - - brcmf_init_prof(&vif->profile); - -- if (type == NL80211_IFTYPE_AP) { -+ if (type == NL80211_IFTYPE_AP && -+ brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) { - mbss = false; - list_for_each_entry(vif_walk, &cfg->vif_list, list) { - if (vif_walk->wdev.iftype == NL80211_IFTYPE_AP) { diff --git a/package/kernel/mac80211/patches/brcm/116-v5.6-brcmfmac-Keep-OOB-wake-interrupt-disabled-when-it-sh.patch b/package/kernel/mac80211/patches/brcm/116-v5.6-brcmfmac-Keep-OOB-wake-interrupt-disabled-when-it-sh.patch deleted file mode 100644 index f579e16a7f8f..000000000000 --- a/package/kernel/mac80211/patches/brcm/116-v5.6-brcmfmac-Keep-OOB-wake-interrupt-disabled-when-it-sh.patch +++ /dev/null @@ -1,66 +0,0 @@ -From a32de68edab7b73ded850bcf76cdf6858e92a7e5 Mon Sep 17 00:00:00 2001 -From: Dmitry Osipenko -Date: Sun, 15 Dec 2019 21:42:24 +0300 -Subject: [PATCH] brcmfmac: Keep OOB wake-interrupt disabled when it shouldn't - be enabled - -NVIDIA Tegra SoCs do not like when OOB wake is enabled and WiFi interface -is in DOWN state during suspend. This results in a CPU hang on programming -OOB wake-up state of the GPIO controller during of system's suspend. - -The solution is trivial: don't enable wake for the OOB interrupt when it -should be disabled. - -This fixes hang on Tegra20 (Acer A500) and Tegra30 (Nexus 7) devices which -are using BCM4329 and BCM4330 WiFi chips respectively. - -Signed-off-by: Dmitry Osipenko -Signed-off-by: Kalle Valo ---- - .../net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 10 +++++----- - .../net/wireless/broadcom/brcm80211/brcmfmac/sdio.h | 1 - - 2 files changed, 5 insertions(+), 6 deletions(-) - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c -@@ -120,7 +120,7 @@ int brcmf_sdiod_intr_register(struct brc - brcmf_err("enable_irq_wake failed %d\n", ret); - return ret; - } -- sdiodev->irq_wake = true; -+ disable_irq_wake(pdata->oob_irq_nr); - - sdio_claim_host(sdiodev->func1); - -@@ -179,10 +179,6 @@ void brcmf_sdiod_intr_unregister(struct - sdio_release_host(sdiodev->func1); - - sdiodev->oob_irq_requested = false; -- if (sdiodev->irq_wake) { -- disable_irq_wake(pdata->oob_irq_nr); -- sdiodev->irq_wake = false; -- } - free_irq(pdata->oob_irq_nr, &sdiodev->func1->dev); - sdiodev->irq_en = false; - sdiodev->oob_irq_requested = false; -@@ -1173,6 +1169,10 @@ static int brcmf_ops_sdio_resume(struct - if (ret) - brcmf_err("Failed to probe device on resume\n"); - } else { -+ if (sdiodev->wowl_enabled && -+ sdiodev->settings->bus.sdio.oob_irq_supported) -+ disable_irq_wake(sdiodev->settings->bus.sdio.oob_irq_nr); -+ - brcmf_sdiod_freezer_off(sdiodev); - } - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h -@@ -178,7 +178,6 @@ struct brcmf_sdio_dev { - bool sd_irq_requested; - bool irq_en; /* irq enable flags */ - spinlock_t irq_en_lock; -- bool irq_wake; /* irq wake enable flags */ - bool sg_support; - uint max_request_size; - ushort max_segment_count; diff --git a/package/kernel/mac80211/patches/brcm/117-v5.6-brcmfmac-use-true-false-for-bool-variable.patch b/package/kernel/mac80211/patches/brcm/117-v5.6-brcmfmac-use-true-false-for-bool-variable.patch deleted file mode 100644 index 0eb169c2d35b..000000000000 --- a/package/kernel/mac80211/patches/brcm/117-v5.6-brcmfmac-use-true-false-for-bool-variable.patch +++ /dev/null @@ -1,27 +0,0 @@ -From b92c017deda819e45a0f054f6df6b53e645d7fe4 Mon Sep 17 00:00:00 2001 -From: zhengbin -Date: Tue, 24 Dec 2019 22:16:06 +0800 -Subject: [PATCH] brcmfmac: use true,false for bool variable - -Fixes coccicheck warning: - -drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c:911:2-24: WARNING: Assignment of 0/1 to bool variable - -Reported-by: Hulk Robot -Signed-off-by: zhengbin -Signed-off-by: Kalle Valo ---- - drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c -@@ -908,7 +908,7 @@ static u8 brcmf_fws_hdrpush(struct brcmf - wlh += wlh[1] + 2; - - if (entry->send_tim_signal) { -- entry->send_tim_signal = 0; -+ entry->send_tim_signal = false; - wlh[0] = BRCMF_FWS_TYPE_PENDING_TRAFFIC_BMP; - wlh[1] = BRCMF_FWS_TYPE_PENDING_TRAFFIC_BMP_LEN; - wlh[2] = entry->mac_handle; diff --git a/package/kernel/mac80211/patches/brcm/119-v5.6-0001-brcmfmac-simplify-building-interface-combinations.patch b/package/kernel/mac80211/patches/brcm/119-v5.6-0001-brcmfmac-simplify-building-interface-combinations.patch deleted file mode 100644 index 73fc17aa5a70..000000000000 --- a/package/kernel/mac80211/patches/brcm/119-v5.6-0001-brcmfmac-simplify-building-interface-combinations.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 24332f8068ff6df7f16aefee45d514de1de4de80 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Thu, 26 Dec 2019 14:30:49 +0100 -Subject: [PATCH] brcmfmac: simplify building interface combinations -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Move similar/duplicated code out of combination specific code blocks. -This simplifies code a bit and allows adding more combinations later. -A list of combinations remains unchanged. - -Signed-off-by: Rafał Miłecki -Signed-off-by: Kalle Valo ---- - .../broadcom/brcm80211/brcmfmac/cfg80211.c | 43 ++++++------------- - 1 file changed, 14 insertions(+), 29 deletions(-) - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -6547,12 +6547,13 @@ static int brcmf_setup_ifmodes(struct wi - struct ieee80211_iface_limit *c0_limits = NULL; - struct ieee80211_iface_limit *p2p_limits = NULL; - struct ieee80211_iface_limit *mbss_limits = NULL; -- bool mbss, p2p, rsdb; -+ bool mbss, p2p, rsdb, mchan; - int i, c, n_combos; - - mbss = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS); - p2p = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_P2P); - rsdb = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB); -+ mchan = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN); - - n_combos = 1 + !!(p2p && !rsdb) + !!mbss; - combo = kcalloc(n_combos, sizeof(*combo), GFP_KERNEL); -@@ -6562,6 +6563,10 @@ static int brcmf_setup_ifmodes(struct wi - wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | - BIT(NL80211_IFTYPE_ADHOC) | - BIT(NL80211_IFTYPE_AP); -+ if (p2p) -+ wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) | -+ BIT(NL80211_IFTYPE_P2P_GO) | -+ BIT(NL80211_IFTYPE_P2P_DEVICE); - - c = 0; - i = 0; -@@ -6573,48 +6578,28 @@ static int brcmf_setup_ifmodes(struct wi - c0_limits = kcalloc(2, sizeof(*c0_limits), GFP_KERNEL); - if (!c0_limits) - goto err; -- if (p2p && rsdb) { -- combo[c].num_different_channels = 2; -- wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) | -- BIT(NL80211_IFTYPE_P2P_GO) | -- BIT(NL80211_IFTYPE_P2P_DEVICE); -- c0_limits[i].max = 2; -- c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION); -+ -+ combo[c].num_different_channels = 1 + (rsdb || (p2p && mchan)); -+ c0_limits[i].max = 1 + rsdb; -+ c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION); -+ if (p2p) { - c0_limits[i].max = 1; - c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_DEVICE); -- c0_limits[i].max = 2; -+ c0_limits[i].max = 1 + rsdb; - c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT) | - BIT(NL80211_IFTYPE_P2P_GO); -+ } -+ if (p2p && rsdb) { - c0_limits[i].max = 2; - c0_limits[i++].types = BIT(NL80211_IFTYPE_AP); - combo[c].max_interfaces = 5; - } else if (p2p) { -- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN)) -- combo[c].num_different_channels = 2; -- else -- combo[c].num_different_channels = 1; -- c0_limits[i].max = 1; -- c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION); -- wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) | -- BIT(NL80211_IFTYPE_P2P_GO) | -- BIT(NL80211_IFTYPE_P2P_DEVICE); -- c0_limits[i].max = 1; -- c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_DEVICE); -- c0_limits[i].max = 1; -- c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT) | -- BIT(NL80211_IFTYPE_P2P_GO); - combo[c].max_interfaces = i; - } else if (rsdb) { -- combo[c].num_different_channels = 2; -- c0_limits[i].max = 2; -- c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION); - c0_limits[i].max = 2; - c0_limits[i++].types = BIT(NL80211_IFTYPE_AP); - combo[c].max_interfaces = 3; - } else { -- combo[c].num_different_channels = 1; -- c0_limits[i].max = 1; -- c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION); - c0_limits[i].max = 1; - c0_limits[i++].types = BIT(NL80211_IFTYPE_AP); - combo[c].max_interfaces = i; diff --git a/package/kernel/mac80211/patches/brcm/119-v5.6-0002-brcmfmac-add-initial-support-for-monitor-mode.patch b/package/kernel/mac80211/patches/brcm/119-v5.6-0002-brcmfmac-add-initial-support-for-monitor-mode.patch deleted file mode 100644 index 0682c0b0ea7e..000000000000 --- a/package/kernel/mac80211/patches/brcm/119-v5.6-0002-brcmfmac-add-initial-support-for-monitor-mode.patch +++ /dev/null @@ -1,345 +0,0 @@ -From 20f2c5fa3af060401c72e444999470a4cab641cf Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Thu, 26 Dec 2019 14:30:50 +0100 -Subject: [PATCH] brcmfmac: add initial support for monitor mode -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Report monitor interface availability using cfg80211 and support it in -the add_virtual_intf() and del_virtual_intf() callbacks. This new -feature is conditional and depends on firmware flagging monitor packets. -Receiving monitor frames is already handled by the brcmf_netif_mon_rx(). - -Signed-off-by: Rafał Miłecki -Signed-off-by: Kalle Valo ---- - .../broadcom/brcm80211/brcmfmac/cfg80211.c | 112 ++++++++++++++++-- - .../broadcom/brcm80211/brcmfmac/core.c | 68 ++++++++++- - .../broadcom/brcm80211/brcmfmac/core.h | 2 + - .../broadcom/brcm80211/brcmfmac/feature.c | 1 + - .../broadcom/brcm80211/brcmfmac/feature.h | 2 + - .../broadcom/brcm80211/brcmfmac/fwil.h | 2 + - 6 files changed, 174 insertions(+), 13 deletions(-) - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -11,6 +11,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -619,6 +620,82 @@ static bool brcmf_is_ibssmode(struct brc - return vif->wdev.iftype == NL80211_IFTYPE_ADHOC; - } - -+/** -+ * brcmf_mon_add_vif() - create monitor mode virtual interface -+ * -+ * @wiphy: wiphy device of new interface. -+ * @name: name of the new interface. -+ */ -+static struct wireless_dev *brcmf_mon_add_vif(struct wiphy *wiphy, -+ const char *name) -+{ -+ struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); -+ struct brcmf_cfg80211_vif *vif; -+ struct net_device *ndev; -+ struct brcmf_if *ifp; -+ int err; -+ -+ if (cfg->pub->mon_if) { -+ err = -EEXIST; -+ goto err_out; -+ } -+ -+ vif = brcmf_alloc_vif(cfg, NL80211_IFTYPE_MONITOR); -+ if (IS_ERR(vif)) { -+ err = PTR_ERR(vif); -+ goto err_out; -+ } -+ -+ ndev = alloc_netdev(sizeof(*ifp), name, NET_NAME_UNKNOWN, ether_setup); -+ if (!ndev) { -+ err = -ENOMEM; -+ goto err_free_vif; -+ } -+ ndev->type = ARPHRD_IEEE80211_RADIOTAP; -+ ndev->ieee80211_ptr = &vif->wdev; -+ ndev->needs_free_netdev = true; -+ ndev->priv_destructor = brcmf_cfg80211_free_netdev; -+ SET_NETDEV_DEV(ndev, wiphy_dev(cfg->wiphy)); -+ -+ ifp = netdev_priv(ndev); -+ ifp->vif = vif; -+ ifp->ndev = ndev; -+ ifp->drvr = cfg->pub; -+ -+ vif->ifp = ifp; -+ vif->wdev.netdev = ndev; -+ -+ err = brcmf_net_mon_attach(ifp); -+ if (err) { -+ brcmf_err("Failed to attach %s device\n", ndev->name); -+ free_netdev(ndev); -+ goto err_free_vif; -+ } -+ -+ cfg->pub->mon_if = ifp; -+ -+ return &vif->wdev; -+ -+err_free_vif: -+ brcmf_free_vif(vif); -+err_out: -+ return ERR_PTR(err); -+} -+ -+static int brcmf_mon_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev) -+{ -+ struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); -+ struct net_device *ndev = wdev->netdev; -+ -+ ndev->netdev_ops->ndo_stop(ndev); -+ -+ brcmf_net_detach(ndev, true); -+ -+ cfg->pub->mon_if = NULL; -+ -+ return 0; -+} -+ - static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy *wiphy, - const char *name, - unsigned char name_assign_type, -@@ -641,9 +718,10 @@ static struct wireless_dev *brcmf_cfg802 - case NL80211_IFTYPE_STATION: - case NL80211_IFTYPE_AP_VLAN: - case NL80211_IFTYPE_WDS: -- case NL80211_IFTYPE_MONITOR: - case NL80211_IFTYPE_MESH_POINT: - return ERR_PTR(-EOPNOTSUPP); -+ case NL80211_IFTYPE_MONITOR: -+ return brcmf_mon_add_vif(wiphy, name); - case NL80211_IFTYPE_AP: - wdev = brcmf_ap_add_vif(wiphy, name, params); - break; -@@ -826,9 +904,10 @@ int brcmf_cfg80211_del_iface(struct wiph - case NL80211_IFTYPE_STATION: - case NL80211_IFTYPE_AP_VLAN: - case NL80211_IFTYPE_WDS: -- case NL80211_IFTYPE_MONITOR: - case NL80211_IFTYPE_MESH_POINT: - return -EOPNOTSUPP; -+ case NL80211_IFTYPE_MONITOR: -+ return brcmf_mon_del_vif(wiphy, wdev); - case NL80211_IFTYPE_AP: - return brcmf_cfg80211_del_ap_iface(wiphy, wdev); - case NL80211_IFTYPE_P2P_CLIENT: -@@ -6547,9 +6626,10 @@ static int brcmf_setup_ifmodes(struct wi - struct ieee80211_iface_limit *c0_limits = NULL; - struct ieee80211_iface_limit *p2p_limits = NULL; - struct ieee80211_iface_limit *mbss_limits = NULL; -- bool mbss, p2p, rsdb, mchan; -- int i, c, n_combos; -+ bool mon_flag, mbss, p2p, rsdb, mchan; -+ int i, c, n_combos, n_limits; - -+ mon_flag = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MONITOR_FLAG); - mbss = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS); - p2p = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_P2P); - rsdb = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB); -@@ -6563,6 +6643,8 @@ static int brcmf_setup_ifmodes(struct wi - wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | - BIT(NL80211_IFTYPE_ADHOC) | - BIT(NL80211_IFTYPE_AP); -+ if (mon_flag) -+ wiphy->interface_modes |= BIT(NL80211_IFTYPE_MONITOR); - if (p2p) - wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) | - BIT(NL80211_IFTYPE_P2P_GO) | -@@ -6570,18 +6652,18 @@ static int brcmf_setup_ifmodes(struct wi - - c = 0; - i = 0; -- if (p2p && rsdb) -- c0_limits = kcalloc(4, sizeof(*c0_limits), GFP_KERNEL); -- else if (p2p) -- c0_limits = kcalloc(3, sizeof(*c0_limits), GFP_KERNEL); -- else -- c0_limits = kcalloc(2, sizeof(*c0_limits), GFP_KERNEL); -+ n_limits = 1 + mon_flag + (p2p ? 2 : 0) + (rsdb || !p2p); -+ c0_limits = kcalloc(n_limits, sizeof(*c0_limits), GFP_KERNEL); - if (!c0_limits) - goto err; - - combo[c].num_different_channels = 1 + (rsdb || (p2p && mchan)); - c0_limits[i].max = 1 + rsdb; - c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION); -+ if (mon_flag) { -+ c0_limits[i].max = 1; -+ c0_limits[i++].types = BIT(NL80211_IFTYPE_MONITOR); -+ } - if (p2p) { - c0_limits[i].max = 1; - c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_DEVICE); -@@ -6630,14 +6712,20 @@ static int brcmf_setup_ifmodes(struct wi - if (mbss) { - c++; - i = 0; -- mbss_limits = kcalloc(1, sizeof(*mbss_limits), GFP_KERNEL); -+ n_limits = 1 + mon_flag; -+ mbss_limits = kcalloc(n_limits, sizeof(*mbss_limits), -+ GFP_KERNEL); - if (!mbss_limits) - goto err; - mbss_limits[i].max = 4; - mbss_limits[i++].types = BIT(NL80211_IFTYPE_AP); -+ if (mon_flag) { -+ mbss_limits[i].max = 1; -+ mbss_limits[i++].types = BIT(NL80211_IFTYPE_MONITOR); -+ } - combo[c].beacon_int_infra_match = true; - combo[c].num_different_channels = 1; -- combo[c].max_interfaces = 4; -+ combo[c].max_interfaces = 4 + mon_flag; - combo[c].n_limits = i; - combo[c].limits = mbss_limits; - } ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c -@@ -690,7 +690,7 @@ fail: - return -EBADE; - } - --static void brcmf_net_detach(struct net_device *ndev, bool rtnl_locked) -+void brcmf_net_detach(struct net_device *ndev, bool rtnl_locked) - { - if (ndev->reg_state == NETREG_REGISTERED) { - if (rtnl_locked) -@@ -703,6 +703,72 @@ static void brcmf_net_detach(struct net_ - } - } - -+static int brcmf_net_mon_open(struct net_device *ndev) -+{ -+ struct brcmf_if *ifp = netdev_priv(ndev); -+ struct brcmf_pub *drvr = ifp->drvr; -+ u32 monitor; -+ int err; -+ -+ brcmf_dbg(TRACE, "Enter\n"); -+ -+ err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_MONITOR, &monitor); -+ if (err) { -+ bphy_err(drvr, "BRCMF_C_GET_MONITOR error (%d)\n", err); -+ return err; -+ } else if (monitor) { -+ bphy_err(drvr, "Monitor mode is already enabled\n"); -+ return -EEXIST; -+ } -+ -+ monitor = 3; -+ err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_MONITOR, monitor); -+ if (err) -+ bphy_err(drvr, "BRCMF_C_SET_MONITOR error (%d)\n", err); -+ -+ return err; -+} -+ -+static int brcmf_net_mon_stop(struct net_device *ndev) -+{ -+ struct brcmf_if *ifp = netdev_priv(ndev); -+ struct brcmf_pub *drvr = ifp->drvr; -+ u32 monitor; -+ int err; -+ -+ brcmf_dbg(TRACE, "Enter\n"); -+ -+ monitor = 0; -+ err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_MONITOR, monitor); -+ if (err) -+ bphy_err(drvr, "BRCMF_C_SET_MONITOR error (%d)\n", err); -+ -+ return err; -+} -+ -+static const struct net_device_ops brcmf_netdev_ops_mon = { -+ .ndo_open = brcmf_net_mon_open, -+ .ndo_stop = brcmf_net_mon_stop, -+}; -+ -+int brcmf_net_mon_attach(struct brcmf_if *ifp) -+{ -+ struct brcmf_pub *drvr = ifp->drvr; -+ struct net_device *ndev; -+ int err; -+ -+ brcmf_dbg(TRACE, "Enter\n"); -+ -+ ndev = ifp->ndev; -+ ndev->netdev_ops = &brcmf_netdev_ops_mon; -+ -+ err = register_netdevice(ndev); -+ if (err) -+ bphy_err(drvr, "Failed to register %s device\n", ndev->name); -+ -+ return err; -+} -+ - void brcmf_net_setcarrier(struct brcmf_if *ifp, bool on) - { - struct net_device *ndev; ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h -@@ -210,6 +210,8 @@ void brcmf_txflowblock_if(struct brcmf_i - void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success); - void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb); - void brcmf_netif_mon_rx(struct brcmf_if *ifp, struct sk_buff *skb); -+void brcmf_net_detach(struct net_device *ndev, bool rtnl_locked); -+int brcmf_net_mon_attach(struct brcmf_if *ifp); - void brcmf_net_setcarrier(struct brcmf_if *ifp, bool on); - int __init brcmf_core_init(void); - void __exit brcmf_core_exit(void); ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c -@@ -38,6 +38,7 @@ static const struct brcmf_feat_fwcap brc - { BRCMF_FEAT_MCHAN, "mchan" }, - { BRCMF_FEAT_P2P, "p2p" }, - { BRCMF_FEAT_MONITOR, "monitor" }, -+ { BRCMF_FEAT_MONITOR_FLAG, "rtap" }, - { BRCMF_FEAT_MONITOR_FMT_RADIOTAP, "rtap" }, - { BRCMF_FEAT_DOT11H, "802.11h" }, - { BRCMF_FEAT_SAE, "sae" }, ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h -@@ -23,6 +23,7 @@ - * GSCAN: enhanced scan offload feature. - * FWSUP: Firmware supplicant. - * MONITOR: firmware can pass monitor packets to host. -+ * MONITOR_FLAG: firmware flags monitor packets. - * MONITOR_FMT_RADIOTAP: firmware provides monitor packets with radiotap header - * MONITOR_FMT_HW_RX_HDR: firmware provides monitor packets with hw/ucode header - * DOT11H: firmware supports 802.11h -@@ -44,6 +45,7 @@ - BRCMF_FEAT_DEF(GSCAN) \ - BRCMF_FEAT_DEF(FWSUP) \ - BRCMF_FEAT_DEF(MONITOR) \ -+ BRCMF_FEAT_DEF(MONITOR_FLAG) \ - BRCMF_FEAT_DEF(MONITOR_FMT_RADIOTAP) \ - BRCMF_FEAT_DEF(MONITOR_FMT_HW_RX_HDR) \ - BRCMF_FEAT_DEF(DOT11H) \ ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h -@@ -49,6 +49,8 @@ - #define BRCMF_C_GET_PM 85 - #define BRCMF_C_SET_PM 86 - #define BRCMF_C_GET_REVINFO 98 -+#define BRCMF_C_GET_MONITOR 107 -+#define BRCMF_C_SET_MONITOR 108 - #define BRCMF_C_GET_CURR_RATESET 114 - #define BRCMF_C_GET_AP 117 - #define BRCMF_C_SET_AP 118 diff --git a/package/kernel/mac80211/patches/brcm/120-v5.6-brcmfmac-Remove-always-false-idx-0-statement.patch b/package/kernel/mac80211/patches/brcm/120-v5.6-brcmfmac-Remove-always-false-idx-0-statement.patch deleted file mode 100644 index 9efa7628303c..000000000000 --- a/package/kernel/mac80211/patches/brcm/120-v5.6-brcmfmac-Remove-always-false-idx-0-statement.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 627b0d094240c38393b2f2d40626c33a8fff6103 Mon Sep 17 00:00:00 2001 -From: yuehaibing -Date: Wed, 8 Jan 2020 21:57:48 +0800 -Subject: [PATCH] brcmfmac: Remove always false 'idx < 0' statement - -idx is declared as u32, it will never less than 0. - -Signed-off-by: yuehaibing -Signed-off-by: Kalle Valo ---- - drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c -@@ -365,7 +365,7 @@ brcmf_msgbuf_get_pktid(struct device *de - struct brcmf_msgbuf_pktid *pktid; - struct sk_buff *skb; - -- if (idx < 0 || idx >= pktids->array_size) { -+ if (idx >= pktids->array_size) { - brcmf_err("Invalid packet id %d (max %d)\n", idx, - pktids->array_size); - return NULL; diff --git a/package/kernel/mac80211/patches/brcm/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch b/package/kernel/mac80211/patches/brcm/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch index 37ebb5190b16..81c170c43f6e 100644 --- a/package/kernel/mac80211/patches/brcm/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch +++ b/package/kernel/mac80211/patches/brcm/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch @@ -10,7 +10,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -705,8 +705,36 @@ static struct wireless_dev *brcmf_cfg802 +@@ -711,8 +711,36 @@ static struct wireless_dev *brcmf_cfg802 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); struct brcmf_pub *drvr = cfg->pub; struct wireless_dev *wdev; diff --git a/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch b/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch index 905fd4b56e84..8120af329325 100644 --- a/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch +++ b/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch @@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -2936,6 +2936,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip +@@ -2942,6 +2942,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip * preference in cfg struct to apply this to * FW later while initializing the dongle */ diff --git a/package/kernel/mac80211/patches/brcm/998-survey.patch b/package/kernel/mac80211/patches/brcm/998-survey.patch index b98cb0632c46..6cc370571dbc 100644 --- a/package/kernel/mac80211/patches/brcm/998-survey.patch +++ b/package/kernel/mac80211/patches/brcm/998-survey.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -2888,6 +2888,63 @@ done: +@@ -2894,6 +2894,63 @@ done: } static int @@ -64,7 +64,7 @@ brcmf_cfg80211_dump_station(struct wiphy *wiphy, struct net_device *ndev, int idx, u8 *mac, struct station_info *sinfo) { -@@ -2977,6 +3034,7 @@ static s32 brcmf_inform_single_bss(struc +@@ -2983,6 +3040,7 @@ static s32 brcmf_inform_single_bss(struc struct brcmu_chan ch; u16 channel; u32 freq; @@ -72,7 +72,7 @@ u16 notify_capability; u16 notify_interval; u8 *notify_ie; -@@ -3001,6 +3059,17 @@ static s32 brcmf_inform_single_bss(struc +@@ -3007,6 +3065,17 @@ static s32 brcmf_inform_single_bss(struc band = NL80211_BAND_5GHZ; freq = ieee80211_channel_to_frequency(channel, band); @@ -90,7 +90,7 @@ bss_data.chan = ieee80211_get_channel(wiphy, freq); bss_data.scan_width = NL80211_BSS_CHAN_WIDTH_20; bss_data.boottime_ns = ktime_to_ns(ktime_get_boottime()); -@@ -5418,6 +5487,7 @@ static struct cfg80211_ops brcmf_cfg8021 +@@ -5424,6 +5493,7 @@ static struct cfg80211_ops brcmf_cfg8021 .leave_ibss = brcmf_cfg80211_leave_ibss, .get_station = brcmf_cfg80211_get_station, .dump_station = brcmf_cfg80211_dump_station, diff --git a/package/kernel/mac80211/patches/build/060-no_local_ssb_bcma.patch b/package/kernel/mac80211/patches/build/060-no_local_ssb_bcma.patch index 290d254238a4..12f907dcb5ae 100644 --- a/package/kernel/mac80211/patches/build/060-no_local_ssb_bcma.patch +++ b/package/kernel/mac80211/patches/build/060-no_local_ssb_bcma.patch @@ -1,6 +1,6 @@ --- a/local-symbols +++ b/local-symbols -@@ -412,43 +412,6 @@ USB_SIERRA_NET= +@@ -416,43 +416,6 @@ USB_SIERRA_NET= USB_VL600= USB_NET_CH9200= USB_NET_AQC111= @@ -192,7 +192,7 @@ select BRCMUTIL --- a/Kconfig.local +++ b/Kconfig.local -@@ -1240,117 +1240,6 @@ config BACKPORTED_USB_NET_CH9200 +@@ -1252,117 +1252,6 @@ config BACKPORTED_USB_NET_CH9200 config BACKPORTED_USB_NET_AQC111 tristate default USB_NET_AQC111 diff --git a/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch b/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch index 0c6e5a03b02d..968adb71e2e9 100644 --- a/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch +++ b/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch @@ -1,6 +1,6 @@ --- a/local-symbols +++ b/local-symbols -@@ -313,6 +313,7 @@ RT2X00_LIB_FIRMWARE= +@@ -317,6 +317,7 @@ RT2X00_LIB_FIRMWARE= RT2X00_LIB_CRYPTO= RT2X00_LIB_LEDS= RT2X00_LIB_DEBUGFS= @@ -95,7 +95,7 @@ /* Firmware functions */ static char *rt2800soc_get_firmware_name(struct rt2x00_dev *rt2x00dev) { -@@ -166,7 +153,6 @@ static const struct rt2800_ops rt2800soc +@@ -167,7 +154,6 @@ static const struct rt2800_ops rt2800soc .register_multiread = rt2x00mmio_register_multiread, .register_multiwrite = rt2x00mmio_register_multiwrite, .regbusy_read = rt2x00mmio_regbusy_read, @@ -127,7 +127,7 @@ DECLARE_KFIFO_PTR(txstatus_fifo, u32); --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c -@@ -1418,6 +1418,10 @@ int rt2x00lib_probe_dev(struct rt2x00_de +@@ -1407,6 +1407,10 @@ int rt2x00lib_probe_dev(struct rt2x00_de INIT_DELAYED_WORK(&rt2x00dev->autowakeup_work, rt2x00lib_autowakeup); INIT_WORK(&rt2x00dev->sleep_work, rt2x00lib_sleep); @@ -138,7 +138,7 @@ /* * Let the driver probe the device to detect the capabilities. */ -@@ -1561,6 +1565,11 @@ void rt2x00lib_remove_dev(struct rt2x00_ +@@ -1550,6 +1554,11 @@ void rt2x00lib_remove_dev(struct rt2x00_ * Free the driver data. */ kfree(rt2x00dev->drv_data); diff --git a/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch b/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch index 35714c04d28f..38f8b7717686 100644 --- a/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch +++ b/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch @@ -13,7 +13,7 @@ Signed-off-by: John Crispin --- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c -@@ -223,10 +223,17 @@ static int rt2800soc_probe(struct platfo +@@ -224,10 +224,17 @@ static int rt2800soc_probe(struct platfo return rt2x00soc_probe(pdev, &rt2800soc_ops); } diff --git a/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch b/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch index fb6647350ea1..5f60b60d95cd 100644 --- a/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch +++ b/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch @@ -8,7 +8,7 @@ #include "rt2x00.h" #include "rt2800lib.h" -@@ -9531,6 +9532,17 @@ static int rt2800_init_eeprom(struct rt2 +@@ -9528,6 +9529,17 @@ static int rt2800_init_eeprom(struct rt2 rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC); rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY); diff --git a/package/kernel/mac80211/patches/rt2x00/611-rt2x00-add-AP+STA-support.patch b/package/kernel/mac80211/patches/rt2x00/611-rt2x00-add-AP+STA-support.patch index d909a2e6c62f..15f46fc98adb 100644 --- a/package/kernel/mac80211/patches/rt2x00/611-rt2x00-add-AP+STA-support.patch +++ b/package/kernel/mac80211/patches/rt2x00/611-rt2x00-add-AP+STA-support.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c -@@ -1356,7 +1356,7 @@ static inline void rt2x00lib_set_if_comb +@@ -1345,7 +1345,7 @@ static inline void rt2x00lib_set_if_comb */ if_limit = &rt2x00dev->if_limits_ap; if_limit->max = rt2x00dev->ops->max_ap_intf; diff --git a/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch index df234fe0dfb7..88ce5ec52964 100644 --- a/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch +++ b/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch @@ -30,7 +30,7 @@ Signed-off-by: Tomislav Po=C5=BEega * EEPROM LNA --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -4359,6 +4359,45 @@ static void rt2800_config_channel(struct +@@ -4356,6 +4356,45 @@ static void rt2800_config_channel(struct rt2800_iq_calibrate(rt2x00dev, rf->channel); } @@ -76,7 +76,7 @@ Signed-off-by: Tomislav Po=C5=BEega bbp = rt2800_bbp_read(rt2x00dev, 4); rt2x00_set_field8(&bbp, BBP4_BANDWIDTH, 2 * conf_is_ht40(conf)); rt2800_bbp_write(rt2x00dev, 4, bbp); -@@ -9560,7 +9599,8 @@ static int rt2800_init_eeprom(struct rt2 +@@ -9557,7 +9596,8 @@ static int rt2800_init_eeprom(struct rt2 */ eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1); @@ -86,7 +86,7 @@ Signed-off-by: Tomislav Po=C5=BEega if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_TX0_PA_3352)) __set_bit(CAPABILITY_EXTERNAL_PA_TX0, -@@ -9571,6 +9611,18 @@ static int rt2800_init_eeprom(struct rt2 +@@ -9568,6 +9608,18 @@ static int rt2800_init_eeprom(struct rt2 &rt2x00dev->cap_flags); } diff --git a/package/kernel/mac80211/patches/rt2x00/982-rt2x00-add-rf-self-txdc-calibration.patch b/package/kernel/mac80211/patches/rt2x00/982-rt2x00-add-rf-self-txdc-calibration.patch index 4addb8e54551..6be847478e05 100644 --- a/package/kernel/mac80211/patches/rt2x00/982-rt2x00-add-rf-self-txdc-calibration.patch +++ b/package/kernel/mac80211/patches/rt2x00/982-rt2x00-add-rf-self-txdc-calibration.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -8422,6 +8422,56 @@ static void rt2800_init_rfcsr_5592(struc +@@ -8419,6 +8419,56 @@ static void rt2800_init_rfcsr_5592(struc rt2800_led_open_drain_enable(rt2x00dev); } @@ -57,7 +57,7 @@ static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev, bool set_bw, bool is_ht40) { -@@ -9029,6 +9079,7 @@ static void rt2800_init_rfcsr_6352(struc +@@ -9026,6 +9076,7 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00); rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C); diff --git a/package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch b/package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch index 8041580411c7..3ed0ff7ef533 100644 --- a/package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch +++ b/package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -8472,6 +8472,155 @@ static void rt2800_rf_self_txdc_cal(stru +@@ -8469,6 +8469,155 @@ static void rt2800_rf_self_txdc_cal(stru rt2x00_info(rt2x00dev, "RF Tx self calibration end\n"); } @@ -156,7 +156,7 @@ static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev, bool set_bw, bool is_ht40) { -@@ -9079,6 +9228,7 @@ static void rt2800_init_rfcsr_6352(struc +@@ -9076,6 +9225,7 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00); rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C); diff --git a/package/kernel/mac80211/patches/rt2x00/984-rt2x00-add-rxdcoc-calibration.patch b/package/kernel/mac80211/patches/rt2x00/984-rt2x00-add-rxdcoc-calibration.patch index 89a4ccb961a5..77be986d18b1 100644 --- a/package/kernel/mac80211/patches/rt2x00/984-rt2x00-add-rxdcoc-calibration.patch +++ b/package/kernel/mac80211/patches/rt2x00/984-rt2x00-add-rxdcoc-calibration.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -8621,6 +8621,70 @@ static void rt2800_r_calibration(struct +@@ -8618,6 +8618,70 @@ static void rt2800_r_calibration(struct rt2800_register_write(rt2x00dev, PWR_PIN_CFG, MAC_PWR_PIN_CFG); } @@ -71,7 +71,7 @@ static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev, bool set_bw, bool is_ht40) { -@@ -9230,6 +9294,7 @@ static void rt2800_init_rfcsr_6352(struc +@@ -9227,6 +9291,7 @@ static void rt2800_init_rfcsr_6352(struc rt2800_r_calibration(rt2x00dev); rt2800_rf_self_txdc_cal(rt2x00dev); diff --git a/package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch b/package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch index 9a03efdef858..7352ad036cd5 100644 --- a/package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch +++ b/package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -8685,6 +8685,384 @@ static void rt2800_rxdcoc_calibration(st +@@ -8682,6 +8682,384 @@ static void rt2800_rxdcoc_calibration(st rt2800_rfcsr_write_bank(rt2x00dev, 0, 2, saverfb0r2); } @@ -385,7 +385,7 @@ static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev, bool set_bw, bool is_ht40) { -@@ -9297,6 +9675,7 @@ static void rt2800_init_rfcsr_6352(struc +@@ -9294,6 +9672,7 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rxdcoc_calibration(rt2x00dev); rt2800_bw_filter_calibration(rt2x00dev, true); rt2800_bw_filter_calibration(rt2x00dev, false); diff --git a/package/kernel/mac80211/patches/rt2x00/986-rt2x00-add-TX-LOFT-calibration.patch b/package/kernel/mac80211/patches/rt2x00/986-rt2x00-add-TX-LOFT-calibration.patch index fc5e4ca5d73c..fe0961baa799 100644 --- a/package/kernel/mac80211/patches/rt2x00/986-rt2x00-add-TX-LOFT-calibration.patch +++ b/package/kernel/mac80211/patches/rt2x00/986-rt2x00-add-TX-LOFT-calibration.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -9063,6 +9063,943 @@ restore_value: +@@ -9060,6 +9060,943 @@ restore_value: rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, savemacsysctrl); } @@ -944,7 +944,7 @@ static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev, bool set_bw, bool is_ht40) { -@@ -9675,6 +10612,7 @@ static void rt2800_init_rfcsr_6352(struc +@@ -9672,6 +10609,7 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rxdcoc_calibration(rt2x00dev); rt2800_bw_filter_calibration(rt2x00dev, true); rt2800_bw_filter_calibration(rt2x00dev, false); diff --git a/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch b/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch index 3b89013d3c3c..668064cfa89d 100644 --- a/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch +++ b/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -4116,6 +4116,12 @@ out: +@@ -4113,6 +4113,12 @@ out: netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, struct net_device *dev) { diff --git a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch index 428c1892d5ab..ebc1ef489ef7 100644 --- a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch +++ b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch @@ -18,7 +18,7 @@ static int ieee80211_ifa6_changed(struct notifier_block *nb, unsigned long data, void *arg) { -@@ -1272,14 +1272,14 @@ int ieee80211_register_hw(struct ieee802 +@@ -1273,14 +1273,14 @@ int ieee80211_register_hw(struct ieee802 rtnl_unlock(); @@ -35,7 +35,7 @@ local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed; result = register_inet6addr_notifier(&local->ifa6_notifier); if (result) -@@ -1288,13 +1288,13 @@ int ieee80211_register_hw(struct ieee802 +@@ -1289,13 +1289,13 @@ int ieee80211_register_hw(struct ieee802 return 0; @@ -52,7 +52,7 @@ fail_ifa: #endif wiphy_unregister(local->hw.wiphy); -@@ -1322,10 +1322,10 @@ void ieee80211_unregister_hw(struct ieee +@@ -1323,10 +1323,10 @@ void ieee80211_unregister_hw(struct ieee tasklet_kill(&local->tx_pending_tasklet); tasklet_kill(&local->tasklet); diff --git a/package/kernel/mac80211/patches/subsys/250-mac80211-populate-debugfs-only-after-cfg80211-init.patch b/package/kernel/mac80211/patches/subsys/250-mac80211-populate-debugfs-only-after-cfg80211-init.patch deleted file mode 100644 index efe216c53092..000000000000 --- a/package/kernel/mac80211/patches/subsys/250-mac80211-populate-debugfs-only-after-cfg80211-init.patch +++ /dev/null @@ -1,248 +0,0 @@ -From 6cb5f3ea4654faf8c28b901266e960b1a4787b26 Mon Sep 17 00:00:00 2001 -From: Johannes Berg -Date: Thu, 23 Apr 2020 11:13:49 +0200 -Subject: [PATCH] mac80211: populate debugfs only after cfg80211 init - -When fixing the initialization race, we neglected to account for -the fact that debugfs is initialized in wiphy_register(), and -some debugfs things went missing (or rather were rerooted to the -global debugfs root). - -Fix this by adding debugfs entries only after wiphy_register(). -This requires some changes in the rate control code since it -currently adds debugfs at alloc time, which can no longer be -done after the reordering. - -Reported-by: Jouni Malinen -Reported-by: kernel test robot -Reported-by: Hauke Mehrtens -Reported-by: Felix Fietkau -Cc: stable@vger.kernel.org -Fixes: 52e04b4ce5d0 ("mac80211: fix race in ieee80211_register_hw()") -Signed-off-by: Johannes Berg -Acked-by: Sumit Garg -Link: https://lore.kernel.org/r/20200423111344.0e00d3346f12.Iadc76a03a55093d94391fc672e996a458702875d@changeid -Signed-off-by: Johannes Berg ---- - drivers/net/wireless/intel/iwlegacy/3945-rs.c | 2 +- - drivers/net/wireless/intel/iwlegacy/4965-rs.c | 2 +- - drivers/net/wireless/intel/iwlwifi/dvm/rs.c | 2 +- - drivers/net/wireless/intel/iwlwifi/mvm/rs.c | 2 +- - drivers/net/wireless/realtek/rtlwifi/rc.c | 2 +- - include/net/mac80211.h | 4 +++- - net/mac80211/main.c | 5 ++-- - net/mac80211/rate.c | 15 ++++-------- - net/mac80211/rate.h | 23 +++++++++++++++++++ - net/mac80211/rc80211_minstrel_ht.c | 19 ++++++++++----- - 10 files changed, 51 insertions(+), 25 deletions(-) - ---- a/drivers/net/wireless/intel/iwlegacy/3945-rs.c -+++ b/drivers/net/wireless/intel/iwlegacy/3945-rs.c -@@ -374,7 +374,7 @@ out: - } - - static void * --il3945_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) -+il3945_rs_alloc(struct ieee80211_hw *hw) - { - return hw->priv; - } ---- a/drivers/net/wireless/intel/iwlegacy/4965-rs.c -+++ b/drivers/net/wireless/intel/iwlegacy/4965-rs.c -@@ -2474,7 +2474,7 @@ il4965_rs_fill_link_cmd(struct il_priv * - } - - static void * --il4965_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) -+il4965_rs_alloc(struct ieee80211_hw *hw) - { - return hw->priv; - } ---- a/drivers/net/wireless/intel/iwlwifi/dvm/rs.c -+++ b/drivers/net/wireless/intel/iwlwifi/dvm/rs.c -@@ -3019,7 +3019,7 @@ static void rs_fill_link_cmd(struct iwl_ - cpu_to_le16(priv->lib->bt_params->agg_time_limit); - } - --static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) -+static void *rs_alloc(struct ieee80211_hw *hw) - { - return hw->priv; - } ---- a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c -+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c -@@ -3665,7 +3665,7 @@ static void rs_fill_lq_cmd(struct iwl_mv - cpu_to_le16(iwl_mvm_coex_agg_time_limit(mvm, sta)); - } - --static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) -+static void *rs_alloc(struct ieee80211_hw *hw) - { - return hw->priv; - } ---- a/drivers/net/wireless/realtek/rtlwifi/rc.c -+++ b/drivers/net/wireless/realtek/rtlwifi/rc.c -@@ -261,7 +261,7 @@ static void rtl_rate_update(void *ppriv, - { - } - --static void *rtl_rate_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) -+static void *rtl_rate_alloc(struct ieee80211_hw *hw) - { - struct rtl_priv *rtlpriv = rtl_priv(hw); - return rtlpriv; ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -5969,7 +5969,9 @@ enum rate_control_capabilities { - struct rate_control_ops { - unsigned long capa; - const char *name; -- void *(*alloc)(struct ieee80211_hw *hw, struct dentry *debugfsdir); -+ void *(*alloc)(struct ieee80211_hw *hw); -+ void (*add_debugfs)(struct ieee80211_hw *hw, void *priv, -+ struct dentry *debugfsdir); - void (*free)(void *priv); - - void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp); ---- a/net/mac80211/main.c -+++ b/net/mac80211/main.c -@@ -1163,8 +1163,6 @@ int ieee80211_register_hw(struct ieee802 - local->tx_headroom = max_t(unsigned int , local->hw.extra_tx_headroom, - IEEE80211_TX_STATUS_HEADROOM); - -- debugfs_hw_add(local); -- - /* - * if the driver doesn't specify a max listen interval we - * use 5 which should be a safe default -@@ -1256,6 +1254,9 @@ int ieee80211_register_hw(struct ieee802 - if (result < 0) - goto fail_wiphy_register; - -+ debugfs_hw_add(local); -+ rate_control_add_debugfs(local); -+ - rtnl_lock(); - - /* add one default STA interface if supported */ ---- a/net/mac80211/rate.c -+++ b/net/mac80211/rate.c -@@ -214,17 +214,16 @@ static ssize_t rcname_read(struct file * - ref->ops->name, len); - } - --static const struct file_operations rcname_ops = { -+const struct file_operations rcname_ops = { - .read = rcname_read, - .open = simple_open, - .llseek = default_llseek, - }; - #endif - --static struct rate_control_ref *rate_control_alloc(const char *name, -- struct ieee80211_local *local) -+static struct rate_control_ref * -+rate_control_alloc(const char *name, struct ieee80211_local *local) - { -- struct dentry *debugfsdir = NULL; - struct rate_control_ref *ref; - - ref = kmalloc(sizeof(struct rate_control_ref), GFP_KERNEL); -@@ -234,13 +233,7 @@ static struct rate_control_ref *rate_con - if (!ref->ops) - goto free; - --#ifdef CPTCFG_MAC80211_DEBUGFS -- debugfsdir = debugfs_create_dir("rc", local->hw.wiphy->debugfsdir); -- local->debugfs.rcdir = debugfsdir; -- debugfs_create_file("name", 0400, debugfsdir, ref, &rcname_ops); --#endif -- -- ref->priv = ref->ops->alloc(&local->hw, debugfsdir); -+ ref->priv = ref->ops->alloc(&local->hw); - if (!ref->priv) - goto free; - return ref; ---- a/net/mac80211/rate.h -+++ b/net/mac80211/rate.h -@@ -60,6 +60,29 @@ static inline void rate_control_add_sta_ - #endif - } - -+extern const struct file_operations rcname_ops; -+ -+static inline void rate_control_add_debugfs(struct ieee80211_local *local) -+{ -+#ifdef CPTCFG_MAC80211_DEBUGFS -+ struct dentry *debugfsdir; -+ -+ if (!local->rate_ctrl) -+ return; -+ -+ if (!local->rate_ctrl->ops->add_debugfs) -+ return; -+ -+ debugfsdir = debugfs_create_dir("rc", local->hw.wiphy->debugfsdir); -+ local->debugfs.rcdir = debugfsdir; -+ debugfs_create_file("name", 0400, debugfsdir, -+ local->rate_ctrl, &rcname_ops); -+ -+ local->rate_ctrl->ops->add_debugfs(&local->hw, local->rate_ctrl->priv, -+ debugfsdir); -+#endif -+} -+ - void ieee80211_check_rate_mask(struct ieee80211_sub_if_data *sdata); - - /* Get a reference to the rate control algorithm. If `name' is NULL, get the ---- a/net/mac80211/rc80211_minstrel_ht.c -+++ b/net/mac80211/rc80211_minstrel_ht.c -@@ -1635,7 +1635,7 @@ minstrel_ht_init_cck_rates(struct minstr - } - - static void * --minstrel_ht_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) -+minstrel_ht_alloc(struct ieee80211_hw *hw) - { - struct minstrel_priv *mp; - -@@ -1673,7 +1673,17 @@ minstrel_ht_alloc(struct ieee80211_hw *h - mp->update_interval = HZ / 10; - mp->new_avg = true; - -+ minstrel_ht_init_cck_rates(mp); -+ -+ return mp; -+} -+ - #ifdef CPTCFG_MAC80211_DEBUGFS -+static void minstrel_ht_add_debugfs(struct ieee80211_hw *hw, void *priv, -+ struct dentry *debugfsdir) -+{ -+ struct minstrel_priv *mp = priv; -+ - mp->fixed_rate_idx = (u32) -1; - debugfs_create_u32("fixed_rate_idx", S_IRUGO | S_IWUGO, debugfsdir, - &mp->fixed_rate_idx); -@@ -1681,12 +1691,8 @@ minstrel_ht_alloc(struct ieee80211_hw *h - &mp->sample_switch); - debugfs_create_bool("new_avg", S_IRUGO | S_IWUSR, debugfsdir, - &mp->new_avg); --#endif -- -- minstrel_ht_init_cck_rates(mp); -- -- return mp; - } -+#endif - - static void - minstrel_ht_free(void *priv) -@@ -1725,6 +1731,7 @@ static const struct rate_control_ops mac - .alloc = minstrel_ht_alloc, - .free = minstrel_ht_free, - #ifdef CPTCFG_MAC80211_DEBUGFS -+ .add_debugfs = minstrel_ht_add_debugfs, - .add_sta_debugfs = minstrel_ht_add_sta_debugfs, - #endif - .get_expected_throughput = minstrel_ht_get_expected_throughput, From patchwork Wed May 6 21:31:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 1284785 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=hauke-m.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=p0AWqzM6; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49HVFS5D3Kz9sRf for ; Thu, 7 May 2020 07:33:16 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6vxCElCe4YSrW2SqTMjXi5S06NI7oq+ZX65SqPauLIg=; b=p0AWqzM6bLVTxE l0UxsX7hokAcIztJE4m+4H35kCcXxNXNNG2i9yDkbcztyomlpq6yvLnFq9kcuUrrSNtx1FNLmfCfD L+L4iKFxXy+qpa+AVLn32yBgcE2mlULKFQZsn2jHS/akgwbN4syfJ+MmL3oNoRwvmqFxuD2iS4icS k510M0Nt6fxCpmnT1w71ObPwLd577lX/OFcZstFMSi5pRJJQT/TDSHteatDVK7ZJ1m7qv3R8I8Ypx P0cQNSdsCzcDGTsWgPrzdGjglDn3tAmeU0In7Yrab+Lg1FsQCEBk4601wDRULBgsqzaqTmeddOGkd NAuY0vbf2eFR4uxSEJOA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWRfC-0000uk-WD; Wed, 06 May 2020 21:33:11 +0000 Received: from mout-p-102.mailbox.org ([2001:67c:2050::465:102]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWReE-0008F3-Pl for openwrt-devel@lists.openwrt.org; Wed, 06 May 2020 21:32:16 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 49HVCw48K0zKm5f; Wed, 6 May 2020 23:31:56 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id LVKzD4uUJgth; Wed, 6 May 2020 23:31:49 +0200 (CEST) From: Hauke Mehrtens To: openwrt-devel@lists.openwrt.org Date: Wed, 6 May 2020 23:31:30 +0200 Message-Id: <20200506213130.15898-5-hauke@hauke-m.de> In-Reply-To: <20200506213130.15898-1-hauke@hauke-m.de> References: <20200506213130.15898-1-hauke@hauke-m.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 41D41175C X-Rspamd-Score: -7.93 / 15.00 / 15.00 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200506_143211_316513_BC9EB409 X-CRM114-Status: GOOD ( 18.78 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record Subject: [OpenWrt-Devel] [PATCH v2 4/4] mac80211: Update to version 5.7-rc3-1 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hauke@hauke-m.de, foss@volatilesystems.org, koen.vandeputte@ncentric.com, nbd@nbd.name Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This updates the mac80211 backport. The removed patches are already integrated in the upstream version. The 131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch patch was manually adapted to the changes in kernel 5.7. Signed-off-by: Hauke Mehrtens --- package/kernel/mac80211/Makefile | 6 +- .../patches/ath/404-regd_no_assoc_hints.patch | 4 +- ...21-ath10k_init_devices_synchronously.patch | 2 +- .../ath/930-ath10k_add_tpt_led_trigger.patch | 4 +- ...-of-peer_bw_rxnss_override-parameter.patch | 10 +- ...dling-for-VHT160-in-recent-firmwares.patch | 2 +- ...rolling-support-for-various-chipsets.patch | 22 +- ...75-ath10k-use-tpt-trigger-by-default.patch | 8 +- ...980-ath10k-fix-max-antenna-gain-unit.patch | 6 +- ...-power-reduction-for-US-regulatory-d.patch | 8 +- ...-add-stub-for-monitor-interface-xmit.patch | 100 ----- .../patches/build/060-no_local_ssb_bcma.patch | 4 +- .../602-rt2x00-introduce-rt2x00eeprom.patch | 2 +- .../100-remove-cryptoapi-dependencies.patch | 2 +- .../110-mac80211_keep_keys_on_stop_ap.patch | 2 +- .../patches/subsys/130-disable-fils.patch | 2 +- ...aes-cmac-switch-to-shash-CMAC-driver.patch | 99 +++-- .../subsys/140-tweak-TSQ-setting.patch | 2 +- .../subsys/150-disable_addr_notifier.patch | 10 +- .../300-mac80211-optimize-skb-resizing.patch | 14 +- ...domize-BA-session-dialog-token-alloc.patch | 2 +- ...80211-fix-tx-status-for-no-ack-cases.patch | 82 ---- .../500-mac80211_configure_antenna_gain.patch | 38 +- .../utils/iw/patches/001-nl80211_h_sync.patch | 377 +++++++++++++++++- 24 files changed, 511 insertions(+), 297 deletions(-) delete mode 100644 package/kernel/mac80211/patches/brcm/300-brcmfmac-add-stub-for-monitor-interface-xmit.patch delete mode 100644 package/kernel/mac80211/patches/subsys/305-mac80211-fix-tx-status-for-no-ack-cases.patch diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index f85142bbe9d7..f2279180df90 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=5.6.8-1 +PKG_VERSION:=5.7-rc3-1 PKG_RELEASE:=1 -PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.6.8/ -PKG_HASH:=547c5e17b9e23dd23cdf4d617a7550b80869e02114a7d404911c5ae928ae1da5 +PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.7-rc3/ +PKG_HASH:=7bc785c932f011c65adb75ffa746be2fa90b16ab61a6e1fd883acee403ffeed1 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION) diff --git a/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch b/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch index 8bb1d6c813f6..b186e8fa4781 100644 --- a/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch +++ b/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch @@ -1,6 +1,6 @@ --- a/net/wireless/reg.c +++ b/net/wireless/reg.c -@@ -3039,6 +3039,8 @@ void regulatory_hint_country_ie(struct w +@@ -3041,6 +3041,8 @@ void regulatory_hint_country_ie(struct w enum environment_cap env = ENVIRON_ANY; struct regulatory_request *request = NULL, *lr; @@ -9,7 +9,7 @@ /* IE len must be evenly divisible by 2 */ if (country_ie_len & 0x01) return; -@@ -3290,6 +3292,7 @@ static bool is_wiphy_all_set_reg_flag(en +@@ -3292,6 +3294,7 @@ static bool is_wiphy_all_set_reg_flag(en void regulatory_hint_disconnect(void) { diff --git a/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch index 7409db7cfda0..417dc5843685 100644 --- a/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch +++ b/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch @@ -14,7 +14,7 @@ Signed-off-by: Sven Eckelmann --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c -@@ -3094,6 +3094,16 @@ int ath10k_core_register(struct ath10k * +@@ -3174,6 +3174,16 @@ int ath10k_core_register(struct ath10k * queue_work(ar->workqueue, &ar->register_work); diff --git a/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch index ae03951908da..c95d0764c3a6 100644 --- a/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch +++ b/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -8764,6 +8764,21 @@ static int ath10k_mac_init_rd(struct ath +@@ -8781,6 +8781,21 @@ static int ath10k_mac_init_rd(struct ath return 0; } @@ -22,7 +22,7 @@ int ath10k_mac_register(struct ath10k *ar) { static const u32 cipher_suites[] = { -@@ -9092,6 +9107,12 @@ int ath10k_mac_register(struct ath10k *a +@@ -9109,6 +9124,12 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; diff --git a/package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch b/package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch index dbf30418e073..9cb2198ca23c 100644 --- a/package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch +++ b/package/kernel/mac80211/patches/ath/972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch @@ -23,7 +23,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling 3 files changed, 52 insertions(+), 23 deletions(-) --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -2516,7 +2516,7 @@ static void ath10k_peer_assoc_h_vht(stru +@@ -2517,7 +2517,7 @@ static void ath10k_peer_assoc_h_vht(stru const u16 *vht_mcs_mask; u8 ampdu_factor; u8 max_nss, vht_mcs; @@ -32,7 +32,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling if (WARN_ON(ath10k_mac_vif_chan(vif, &def))) return; -@@ -2576,23 +2576,45 @@ static void ath10k_peer_assoc_h_vht(stru +@@ -2577,23 +2577,45 @@ static void ath10k_peer_assoc_h_vht(stru __le16_to_cpu(vht_cap->vht_mcs.tx_highest); arg->peer_vht_rates.tx_mcs_set = ath10k_peer_assoc_h_vht_limit( __le16_to_cpu(vht_cap->vht_mcs.tx_mcs_map), vht_mcs_mask); @@ -92,7 +92,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling } static void ath10k_peer_assoc_h_qos(struct ath10k *ar, -@@ -2744,9 +2766,9 @@ static int ath10k_peer_assoc_prepare(str +@@ -2745,9 +2767,9 @@ static int ath10k_peer_assoc_prepare(str ath10k_peer_assoc_h_crypto(ar, vif, sta, arg); ath10k_peer_assoc_h_rates(ar, vif, sta, arg); ath10k_peer_assoc_h_ht(ar, vif, sta, arg); @@ -105,7 +105,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling } --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c -@@ -7615,12 +7615,7 @@ ath10k_wmi_peer_assoc_fill_10_4(struct a +@@ -7628,12 +7628,7 @@ ath10k_wmi_peer_assoc_fill_10_4(struct a struct wmi_10_4_peer_assoc_complete_cmd *cmd = buf; ath10k_wmi_peer_assoc_fill_10_2(ar, buf, arg); @@ -121,7 +121,7 @@ v9: use SM/MS macros from code.h to simplify shift/mask handling static int --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h -@@ -6501,7 +6501,19 @@ struct wmi_10_2_peer_assoc_complete_cmd +@@ -6508,7 +6508,19 @@ struct wmi_10_2_peer_assoc_complete_cmd __le32 info0; /* WMI_PEER_ASSOC_INFO0_ */ } __packed; diff --git a/package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch b/package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch index d6a1ef084989..bd0104592d5f 100644 --- a/package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch +++ b/package/kernel/mac80211/patches/ath/973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch @@ -13,7 +13,7 @@ v2: fix trailing whitespace issue and fix some typos within the commit note 2 files changed, 8 insertions(+), 10 deletions(-) --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -4576,13 +4576,6 @@ static struct ieee80211_sta_vht_cap ath1 +@@ -4585,13 +4585,6 @@ static struct ieee80211_sta_vht_cap ath1 vht_cap.cap |= val; } diff --git a/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch index fb49ed036a0a..65899cdd60b2 100644 --- a/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch +++ b/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch @@ -172,7 +172,7 @@ v13: .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, -@@ -2811,6 +2817,10 @@ int ath10k_core_start(struct ath10k *ar, +@@ -2889,6 +2895,10 @@ int ath10k_core_start(struct ath10k *ar, goto err_hif_stop; } @@ -183,7 +183,7 @@ v13: return 0; err_hif_stop: -@@ -3067,9 +3077,18 @@ static void ath10k_core_register_work(st +@@ -3147,9 +3157,18 @@ static void ath10k_core_register_work(st goto err_spectral_destroy; } @@ -202,7 +202,7 @@ v13: err_spectral_destroy: ath10k_spectral_destroy(ar); err_debug_destroy: -@@ -3115,6 +3134,8 @@ void ath10k_core_unregister(struct ath10 +@@ -3195,6 +3214,8 @@ void ath10k_core_unregister(struct ath10 if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) return; @@ -221,7 +221,7 @@ v13: #include "htt.h" #include "htc.h" -@@ -1180,6 +1181,13 @@ struct ath10k { +@@ -1182,6 +1183,13 @@ struct ath10k { } testmode; struct { @@ -467,7 +467,7 @@ v13: static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = { --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c -@@ -7435,6 +7435,49 @@ ath10k_wmi_op_gen_peer_set_param(struct +@@ -7448,6 +7448,49 @@ ath10k_wmi_op_gen_peer_set_param(struct return skb; } @@ -517,7 +517,7 @@ v13: static struct sk_buff * ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id, enum wmi_sta_ps_mode psmode) -@@ -9092,6 +9135,9 @@ static const struct wmi_ops wmi_ops = { +@@ -9105,6 +9148,9 @@ static const struct wmi_ops wmi_ops = { .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill, .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, .gen_echo = ath10k_wmi_op_gen_echo, @@ -527,7 +527,7 @@ v13: /* .gen_bcn_tmpl not implemented */ /* .gen_prb_tmpl not implemented */ /* .gen_p2p_go_bcn_ie not implemented */ -@@ -9162,6 +9208,8 @@ static const struct wmi_ops wmi_10_1_ops +@@ -9175,6 +9221,8 @@ static const struct wmi_ops wmi_10_1_ops .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, .gen_echo = ath10k_wmi_op_gen_echo, @@ -536,7 +536,7 @@ v13: /* .gen_bcn_tmpl not implemented */ /* .gen_prb_tmpl not implemented */ /* .gen_p2p_go_bcn_ie not implemented */ -@@ -9234,6 +9282,8 @@ static const struct wmi_ops wmi_10_2_ops +@@ -9247,6 +9295,8 @@ static const struct wmi_ops wmi_10_2_ops .gen_delba_send = ath10k_wmi_op_gen_delba_send, .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, @@ -545,7 +545,7 @@ v13: /* .gen_pdev_enable_adaptive_cca not implemented */ }; -@@ -9305,6 +9355,8 @@ static const struct wmi_ops wmi_10_2_4_o +@@ -9318,6 +9368,8 @@ static const struct wmi_ops wmi_10_2_4_o ath10k_wmi_op_gen_pdev_enable_adaptive_cca, .get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype, .gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing, @@ -554,7 +554,7 @@ v13: /* .gen_bcn_tmpl not implemented */ /* .gen_prb_tmpl not implemented */ /* .gen_p2p_go_bcn_ie not implemented */ -@@ -9385,6 +9437,8 @@ static const struct wmi_ops wmi_10_4_ops +@@ -9398,6 +9450,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_echo = ath10k_wmi_op_gen_echo, .gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config, @@ -565,7 +565,7 @@ v13: int ath10k_wmi_attach(struct ath10k *ar) --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h -@@ -3007,6 +3007,41 @@ enum wmi_10_4_feature_mask { +@@ -3014,6 +3014,41 @@ enum wmi_10_4_feature_mask { }; diff --git a/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch index 80175367fe82..f10fe85c5f7a 100644 --- a/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch @@ -16,9 +16,9 @@ Signed-off-by: Mathias Kresin --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h -@@ -1230,6 +1230,10 @@ struct ath10k { - struct ath10k_bus_params bus_param; - struct completion peer_delete_done; +@@ -1235,6 +1235,10 @@ struct ath10k { + bool coex_support; + int coex_gpio_pin; +#ifdef CPTCFG_MAC80211_LEDS + const char *led_default_trigger; @@ -42,7 +42,7 @@ Signed-off-by: Mathias Kresin if (ret) --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -9124,7 +9124,7 @@ int ath10k_mac_register(struct ath10k *a +@@ -9141,7 +9141,7 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; #ifdef CPTCFG_MAC80211_LEDS diff --git a/package/kernel/mac80211/patches/ath/980-ath10k-fix-max-antenna-gain-unit.patch b/package/kernel/mac80211/patches/ath/980-ath10k-fix-max-antenna-gain-unit.patch index 149585b050aa..7742c2796664 100644 --- a/package/kernel/mac80211/patches/ath/980-ath10k-fix-max-antenna-gain-unit.patch +++ b/package/kernel/mac80211/patches/ath/980-ath10k-fix-max-antenna-gain-unit.patch @@ -20,7 +20,7 @@ Forwarded: https://patchwork.kernel.org/patch/10986723/ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -1042,7 +1042,7 @@ static int ath10k_monitor_vdev_start(str +@@ -1043,7 +1043,7 @@ static int ath10k_monitor_vdev_start(str arg.channel.min_power = 0; arg.channel.max_power = channel->max_power * 2; arg.channel.max_reg_power = channel->max_reg_power * 2; @@ -29,7 +29,7 @@ Forwarded: https://patchwork.kernel.org/patch/10986723/ reinit_completion(&ar->vdev_setup_done); reinit_completion(&ar->vdev_delete_done); -@@ -1488,7 +1488,7 @@ static int ath10k_vdev_start_restart(str +@@ -1489,7 +1489,7 @@ static int ath10k_vdev_start_restart(str arg.channel.min_power = 0; arg.channel.max_power = chandef->chan->max_power * 2; arg.channel.max_reg_power = chandef->chan->max_reg_power * 2; @@ -38,7 +38,7 @@ Forwarded: https://patchwork.kernel.org/patch/10986723/ if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { arg.ssid = arvif->u.ap.ssid; -@@ -3169,7 +3169,7 @@ static int ath10k_update_channel_list(st +@@ -3170,7 +3170,7 @@ static int ath10k_update_channel_list(st ch->min_power = 0; ch->max_power = channel->max_power * 2; ch->max_reg_power = channel->max_reg_power * 2; diff --git a/package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch b/package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch index 36948e546f4c..1501d4bc0c71 100644 --- a/package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch +++ b/package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch @@ -28,7 +28,7 @@ Forwarded: no --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -1010,6 +1010,40 @@ static inline int ath10k_vdev_setup_sync +@@ -1011,6 +1011,40 @@ static inline int ath10k_vdev_setup_sync return ar->last_wmi_vdev_start_status; } @@ -69,7 +69,7 @@ Forwarded: no static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id) { struct cfg80211_chan_def *chandef = NULL; -@@ -1042,7 +1076,8 @@ static int ath10k_monitor_vdev_start(str +@@ -1043,7 +1077,8 @@ static int ath10k_monitor_vdev_start(str arg.channel.min_power = 0; arg.channel.max_power = channel->max_power * 2; arg.channel.max_reg_power = channel->max_reg_power * 2; @@ -79,7 +79,7 @@ Forwarded: no reinit_completion(&ar->vdev_setup_done); reinit_completion(&ar->vdev_delete_done); -@@ -1488,7 +1523,8 @@ static int ath10k_vdev_start_restart(str +@@ -1489,7 +1524,8 @@ static int ath10k_vdev_start_restart(str arg.channel.min_power = 0; arg.channel.max_power = chandef->chan->max_power * 2; arg.channel.max_reg_power = chandef->chan->max_reg_power * 2; @@ -89,7 +89,7 @@ Forwarded: no if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { arg.ssid = arvif->u.ap.ssid; -@@ -3169,7 +3205,8 @@ static int ath10k_update_channel_list(st +@@ -3170,7 +3206,8 @@ static int ath10k_update_channel_list(st ch->min_power = 0; ch->max_power = channel->max_power * 2; ch->max_reg_power = channel->max_reg_power * 2; diff --git a/package/kernel/mac80211/patches/brcm/300-brcmfmac-add-stub-for-monitor-interface-xmit.patch b/package/kernel/mac80211/patches/brcm/300-brcmfmac-add-stub-for-monitor-interface-xmit.patch deleted file mode 100644 index 8280918fa230..000000000000 --- a/package/kernel/mac80211/patches/brcm/300-brcmfmac-add-stub-for-monitor-interface-xmit.patch +++ /dev/null @@ -1,100 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Fri, 27 Mar 2020 13:40:50 +0100 -Subject: [PATCH] brcmfmac: add stub for monitor interface xmit -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -According to the struct net_device_ops documentation .ndo_start_xmit is -"Required; cannot be NULL.". Missing it may crash kernel easily: - -[ 341.216709] Unable to handle kernel NULL pointer dereference at virtual address 00000000 -[ 341.224836] pgd = 26088755 -[ 341.227544] [00000000] *pgd=00000000 -[ 341.231135] Internal error: Oops: 80000007 [#1] SMP ARM -[ 341.236367] Modules linked in: pppoe ppp_async iptable_nat brcmfmac xt_state xt_nat xt_conntrack xt_REDIRECT xt_MASQU -[ 341.304689] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.24 #0 -[ 341.310621] Hardware name: BCM5301X -[ 341.314116] PC is at 0x0 -[ 341.316664] LR is at dev_hard_start_xmit+0x8c/0x11c -[ 341.321546] pc : [<00000000>] lr : [] psr: 60000113 -[ 341.327821] sp : c0801c30 ip : c610cf00 fp : c08048e4 -[ 341.333051] r10: c073a63a r9 : c08044dc r8 : c6c04e00 -[ 341.338283] r7 : 00000000 r6 : c60f5000 r5 : 00000000 r4 : c6a9c3c0 -[ 341.344820] r3 : 00000000 r2 : bf25a13c r1 : c60f5000 r0 : c6a9c3c0 -[ 341.351358] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none -[ 341.358504] Control: 10c5387d Table: 0611c04a DAC: 00000051 -[ 341.364257] Process swapper/0 (pid: 0, stack limit = 0xc68ed0ca) -[ 341.370271] Stack: (0xc0801c30 to 0xc0802000) -[ 341.374633] 1c20: c6e7d480 c0802d00 c60f5050 c0801c6c -[ 341.382825] 1c40: c60f5000 c6a9c3c0 c6f90000 c6f9005c c6c04e00 c60f5000 00000000 c6f9005c -[ 341.391015] 1c60: 00000000 c04a033c 00f90200 00000010 c6a9c3c0 c6a9c3c0 c6f90000 00000000 -[ 341.399205] 1c80: 00000000 00000000 00000000 c046a7ac c6f9005c 00000001 fffffff4 00000000 -[ 341.407395] 1ca0: c6f90200 00000000 c60f5000 c0479550 00000000 c6f90200 c6a9c3c0 16000000 -[ 341.415586] 1cc0: 0000001c 6f4ad52f c6197040 b6df9387 36000000 c0520404 c073a80c c6a9c3c0 -[ 341.423777] 1ce0: 00000000 c6d643c0 c6a9c3c0 c0800024 00000001 00000001 c6d643c8 c6a9c3c0 -[ 341.431967] 1d00: c081b9c0 c7abca80 c610c840 c081b9c0 0000001c 00400000 c6bc5e6c c0522fb4 -[ 341.440157] 1d20: c6d64400 00000004 c6bc5e0a 00000000 c60f5000 c7abca80 c081b9c0 c0522f54 -[ 341.448348] 1d40: c6a9c3c0 c7abca80 c0803e48 c0549c94 c610c828 0000000a c0801d74 00000003 -[ 341.456538] 1d60: c6ec8f0a 00000000 c60f5000 c7abca80 c081b9c0 c0548520 0000000a 00000000 -[ 341.464728] 1d80: 00000000 003a0000 00000000 00000000 00000000 00000000 00000000 00000000 -[ 341.472919] 1da0: 000002ff 00000000 00000000 16000000 00000000 00000000 00000000 00000000 -[ 341.481110] 1dc0: 00000000 0000008f 00000000 00000000 00000000 2d132a69 c6bc5e40 00000000 -[ 341.489300] 1de0: c6bc5e40 c6a9c3c0 00000000 c6ec8e50 00000001 c054b070 00000001 00000000 -[ 341.497490] 1e00: c0807200 c6bc5e00 00000000 ffffe000 00000100 c054aea4 00000000 00000000 -[ 341.505681] 1e20: 00000122 00400000 c0802d00 c0172e80 6f56a70e ffffffff 6f56a70e c7eb9cc0 -[ 341.513871] 1e40: c7eb82c0 00000000 c0801e60 c017309c 00000000 00000000 07780000 c07382c0 -[ 341.522061] 1e60: 00000000 c7eb9cc0 c0739cc0 c0803f74 c0801e70 c0801e70 c0801ea4 c013d380 -[ 341.530253] 1e80: 00000000 000000a0 00000001 c0802084 c0802080 40000001 ffffe000 00000100 -[ 341.538443] 1ea0: c0802080 c01021e8 c8803100 10c5387d 00000000 c07341f0 c0739880 0000000a -[ 341.546633] 1ec0: c0734180 00001017 c0802d00 c062aa98 00200002 c062aa60 c8803100 c073984c -[ 341.554823] 1ee0: 00000000 00000001 00000000 c7810000 c8803100 10c5387d 00000000 c011c188 -[ 341.563014] 1f00: c073984c c015f0f8 c0804244 c0815ae4 c880210c c8802100 c0801f40 c037c584 -[ 341.571204] 1f20: c01035f8 60000013 ffffffff c0801f74 c080afd4 c0800000 10c5387d c0101a8c -[ 341.579395] 1f40: 00000000 004ac9dc c7eba4b4 c010ee60 ffffe000 c0803e68 c0803ea8 00000001 -[ 341.587587] 1f60: c080afd4 c062ca20 10c5387d 00000000 00000000 c0801f90 c01035f4 c01035f8 -[ 341.595776] 1f80: 60000013 ffffffff 00000051 00000000 ffffe000 c013ff50 000000ce c0803e40 -[ 341.603967] 1fa0: c082216c 00000000 00000001 c072ba38 10c5387d c0140214 c0822184 c0700df8 -[ 341.612157] 1fc0: ffffffff ffffffff 00000000 c070058c c072ba38 2d162e71 00000000 c0700330 -[ 341.620348] 1fe0: 00000051 10c0387d 000000ff 00a521d0 413fc090 00000000 00000000 00000000 -[ 341.628558] [] (dev_hard_start_xmit) from [] (sch_direct_xmit+0xe4/0x2bc) -[ 341.637106] [] (sch_direct_xmit) from [] (__dev_queue_xmit+0x6a4/0x72c) -[ 341.645481] [] (__dev_queue_xmit) from [] (ip6_finish_output2+0x18c/0x434) -[ 341.654112] [] (ip6_finish_output2) from [] (ip6_output+0x5c/0xd0) -[ 341.662053] [] (ip6_output) from [] (mld_sendpack+0x1a0/0x1a8) -[ 341.669640] [] (mld_sendpack) from [] (mld_ifc_timer_expire+0x1cc/0x2e4) -[ 341.678111] [] (mld_ifc_timer_expire) from [] (call_timer_fn.constprop.3+0x24/0x98) -[ 341.687527] [] (call_timer_fn.constprop.3) from [] (run_timer_softirq+0x1a8/0x1e4) -[ 341.696860] [] (run_timer_softirq) from [] (__do_softirq+0x120/0x2b0) -[ 341.705066] [] (__do_softirq) from [] (irq_exit+0x78/0x84) -[ 341.712317] [] (irq_exit) from [] (__handle_domain_irq+0x60/0xb4) -[ 341.720179] [] (__handle_domain_irq) from [] (gic_handle_irq+0x4c/0x90) -[ 341.728549] [] (gic_handle_irq) from [] (__irq_svc+0x6c/0x90) - -Fixes: 20f2c5fa3af0 ("brcmfmac: add initial support for monitor mode") -Signed-off-by: Rafał Miłecki ---- - drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c -@@ -746,9 +746,18 @@ static int brcmf_net_mon_stop(struct net - return err; - } - -+static netdev_tx_t brcmf_net_mon_start_xmit(struct sk_buff *skb, -+ struct net_device *ndev) -+{ -+ dev_kfree_skb_any(skb); -+ -+ return NETDEV_TX_OK; -+} -+ - static const struct net_device_ops brcmf_netdev_ops_mon = { - .ndo_open = brcmf_net_mon_open, - .ndo_stop = brcmf_net_mon_stop, -+ .ndo_start_xmit = brcmf_net_mon_start_xmit, - }; - - int brcmf_net_mon_attach(struct brcmf_if *ifp) diff --git a/package/kernel/mac80211/patches/build/060-no_local_ssb_bcma.patch b/package/kernel/mac80211/patches/build/060-no_local_ssb_bcma.patch index 12f907dcb5ae..93b6992f729c 100644 --- a/package/kernel/mac80211/patches/build/060-no_local_ssb_bcma.patch +++ b/package/kernel/mac80211/patches/build/060-no_local_ssb_bcma.patch @@ -1,6 +1,6 @@ --- a/local-symbols +++ b/local-symbols -@@ -416,43 +416,6 @@ USB_SIERRA_NET= +@@ -417,43 +417,6 @@ USB_SIERRA_NET= USB_VL600= USB_NET_CH9200= USB_NET_AQC111= @@ -192,7 +192,7 @@ select BRCMUTIL --- a/Kconfig.local +++ b/Kconfig.local -@@ -1252,117 +1252,6 @@ config BACKPORTED_USB_NET_CH9200 +@@ -1255,117 +1255,6 @@ config BACKPORTED_USB_NET_CH9200 config BACKPORTED_USB_NET_AQC111 tristate default USB_NET_AQC111 diff --git a/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch b/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch index 968adb71e2e9..6cd504228f05 100644 --- a/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch +++ b/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch @@ -1,6 +1,6 @@ --- a/local-symbols +++ b/local-symbols -@@ -317,6 +317,7 @@ RT2X00_LIB_FIRMWARE= +@@ -318,6 +318,7 @@ RT2X00_LIB_FIRMWARE= RT2X00_LIB_CRYPTO= RT2X00_LIB_LEDS= RT2X00_LIB_DEBUGFS= diff --git a/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch index 5fe76161432a..5556f9b72a65 100644 --- a/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch +++ b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch @@ -687,7 +687,7 @@ #endif /* AES_GMAC_H */ --- a/net/mac80211/key.h +++ b/net/mac80211/key.h -@@ -88,7 +88,7 @@ struct ieee80211_key { +@@ -89,7 +89,7 @@ struct ieee80211_key { * Management frames. */ u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_CCMP_PN_LEN]; diff --git a/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch b/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch index 8e0fddd10ac9..cceb6d5d7ddf 100644 --- a/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch +++ b/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch @@ -2,7 +2,7 @@ Used for AP+STA support in OpenWrt - preserve AP mode keys across STA reconnects --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -1172,7 +1172,6 @@ static int ieee80211_stop_ap(struct wiph +@@ -1186,7 +1186,6 @@ static int ieee80211_stop_ap(struct wiph sdata->vif.bss_conf.ftmr_params = NULL; __sta_info_flush(sdata, true); diff --git a/package/kernel/mac80211/patches/subsys/130-disable-fils.patch b/package/kernel/mac80211/patches/subsys/130-disable-fils.patch index f370dd52ee6a..5ca64d2c730c 100644 --- a/package/kernel/mac80211/patches/subsys/130-disable-fils.patch +++ b/package/kernel/mac80211/patches/subsys/130-disable-fils.patch @@ -21,7 +21,7 @@ Disable FILS support, since it pulls in crypto hash support * FILS AEAD for (Re)Association Request/Response frames --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -571,7 +571,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ +@@ -586,7 +586,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ NL80211_FEATURE_MAC_ON_CREATE | NL80211_FEATURE_USERSPACE_MPM | NL80211_FEATURE_FULL_AP_CLIENT_STATE; diff --git a/package/kernel/mac80211/patches/subsys/131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch b/package/kernel/mac80211/patches/subsys/131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch index 02e523878e0e..c3bf7ccc7abd 100644 --- a/package/kernel/mac80211/patches/subsys/131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch +++ b/package/kernel/mac80211/patches/subsys/131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch @@ -11,14 +11,13 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/aes_cmac.c +++ b/net/mac80211/aes_cmac.c -@@ -19,50 +19,126 @@ +@@ -19,67 +19,151 @@ #define CMAC_TLEN_256 16 /* CMAC TLen = 128 bits (16 octets) */ #define AAD_LEN 20 -static const u8 zero[CMAC_TLEN_256]; -void ieee80211_aes_cmac(struct crypto_shash *tfm, const u8 *aad, -- const u8 *data, size_t data_len, u8 *mic) +void gf_mulx(u8 *pad) +{ + int i, carry; @@ -34,9 +33,7 @@ Signed-off-by: Felix Fietkau +void aes_cmac_vector(struct crypto_cipher *tfm, size_t num_elem, + const u8 *addr[], const size_t *len, u8 *mac, + size_t mac_len) - { -- SHASH_DESC_ON_STACK(desc, tfm); -- u8 out[AES_BLOCK_SIZE]; ++{ + u8 cbc[AES_BLOCK_SIZE], pad[AES_BLOCK_SIZE]; + const u8 *pos, *end; + size_t i, e, left, total_len; @@ -88,30 +85,48 @@ Signed-off-by: Felix Fietkau + crypto_cipher_encrypt_one(tfm, pad, pad); + memcpy(mac, pad, mac_len); +} ++ ++ ++void ieee80211_aes_cmac(struct crypto_cipher *tfm, const u8 *aad, + const u8 *data, size_t data_len, u8 *mic) + { +- SHASH_DESC_ON_STACK(desc, tfm); +- u8 out[AES_BLOCK_SIZE]; ++ const u8 *addr[4]; ++ size_t len[4]; ++ u8 zero[CMAC_TLEN]; + const __le16 *fc; - 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, -+ const u8 *data, size_t data_len, u8 *mic) -+{ -+ const u8 *addr[3]; -+ size_t len[3]; -+ u8 zero[CMAC_TLEN]; -+ + memset(zero, 0, CMAC_TLEN); + addr[0] = aad; + len[0] = AAD_LEN; -+ addr[1] = data; -+ len[1] = data_len - CMAC_TLEN; -+ addr[2] = zero; -+ len[2] = CMAC_TLEN; - + fc = (const __le16 *)aad; + if (ieee80211_is_beacon(*fc)) { + /* mask Timestamp field to zero */ +- crypto_shash_update(desc, zero, 8); +- crypto_shash_update(desc, data + 8, data_len - 8 - CMAC_TLEN); ++ addr[1] = zero; ++ len[1] = 8; ++ addr[2] = data + 8; ++ len[2] = data_len - 8 - CMAC_TLEN; ++ addr[3] = zero; ++ len[3] = CMAC_TLEN; ++ aes_cmac_vector(tfm, 4, addr, len, mic, CMAC_TLEN); + } else { +- crypto_shash_update(desc, data, data_len - CMAC_TLEN); ++ addr[1] = data; ++ len[1] = data_len - CMAC_TLEN; ++ addr[2] = zero; ++ len[2] = CMAC_TLEN; ++ aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN); + } +- crypto_shash_finup(desc, zero, CMAC_TLEN, out); +- - memcpy(mic, out, CMAC_TLEN); -+ aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN); } -void ieee80211_aes_cmac_256(struct crypto_shash *tfm, const u8 *aad, @@ -119,25 +134,41 @@ Signed-off-by: Felix Fietkau const u8 *data, size_t data_len, u8 *mic) { - SHASH_DESC_ON_STACK(desc, tfm); -+ const u8 *addr[3]; -+ size_t len[3]; ++ const u8 *addr[4]; ++ size_t len[4]; + u8 zero[CMAC_TLEN_256]; -+ -+ memset(zero, 0, CMAC_TLEN_256); -+ addr[0] = aad; -+ len[0] = AAD_LEN; -+ addr[1] = data; -+ len[1] = data_len - CMAC_TLEN_256; -+ addr[2] = zero; -+ len[2] = CMAC_TLEN_256; + const __le16 *fc; - desc->tfm = tfm; - - crypto_shash_init(desc); - crypto_shash_update(desc, aad, AAD_LEN); -- crypto_shash_update(desc, data, data_len - CMAC_TLEN_256); ++ memset(zero, 0, CMAC_TLEN_256); ++ addr[0] = aad; ++ len[0] = AAD_LEN; ++ addr[1] = data; + fc = (const __le16 *)aad; + if (ieee80211_is_beacon(*fc)) { + /* mask Timestamp field to zero */ +- crypto_shash_update(desc, zero, 8); +- crypto_shash_update(desc, data + 8, +- data_len - 8 - CMAC_TLEN_256); ++ addr[1] = zero; ++ len[1] = 8; ++ addr[2] = data + 8; ++ len[2] = data_len - 8 - CMAC_TLEN_256; ++ addr[3] = zero; ++ len[3] = CMAC_TLEN_256; ++ aes_cmac_vector(tfm, 4, addr, len, mic, CMAC_TLEN_256); + } else { +- crypto_shash_update(desc, data, data_len - CMAC_TLEN_256); ++ addr[1] = data; ++ len[1] = data_len - CMAC_TLEN_256; ++ addr[2] = zero; ++ len[2] = CMAC_TLEN_256; ++ aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN_256); + } - crypto_shash_finup(desc, zero, CMAC_TLEN_256, mic); -+ aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN_256); } -struct crypto_shash *ieee80211_aes_cmac_key_setup(const u8 key[], @@ -188,7 +219,7 @@ Signed-off-by: Felix Fietkau #endif /* AES_CMAC_H */ --- a/net/mac80211/key.h +++ b/net/mac80211/key.h -@@ -93,7 +93,7 @@ struct ieee80211_key { +@@ -94,7 +94,7 @@ struct ieee80211_key { } ccmp; struct { u8 rx_pn[IEEE80211_CMAC_PN_LEN]; diff --git a/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch b/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch index 668064cfa89d..84cfaea8a4d9 100644 --- a/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch +++ b/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -4113,6 +4113,12 @@ out: +@@ -4119,6 +4119,12 @@ out: netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, struct net_device *dev) { diff --git a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch index ebc1ef489ef7..2f515be8f0c2 100644 --- a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch +++ b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -314,7 +314,7 @@ void ieee80211_restart_hw(struct ieee802 +@@ -316,7 +316,7 @@ void ieee80211_restart_hw(struct ieee802 } EXPORT_SYMBOL(ieee80211_restart_hw); @@ -9,7 +9,7 @@ static int ieee80211_ifa_changed(struct notifier_block *nb, unsigned long data, void *arg) { -@@ -373,7 +373,7 @@ static int ieee80211_ifa_changed(struct +@@ -375,7 +375,7 @@ static int ieee80211_ifa_changed(struct } #endif @@ -18,7 +18,7 @@ static int ieee80211_ifa6_changed(struct notifier_block *nb, unsigned long data, void *arg) { -@@ -1273,14 +1273,14 @@ int ieee80211_register_hw(struct ieee802 +@@ -1292,14 +1292,14 @@ int ieee80211_register_hw(struct ieee802 rtnl_unlock(); @@ -35,7 +35,7 @@ local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed; result = register_inet6addr_notifier(&local->ifa6_notifier); if (result) -@@ -1289,13 +1289,13 @@ int ieee80211_register_hw(struct ieee802 +@@ -1308,13 +1308,13 @@ int ieee80211_register_hw(struct ieee802 return 0; @@ -52,7 +52,7 @@ fail_ifa: #endif wiphy_unregister(local->hw.wiphy); -@@ -1323,10 +1323,10 @@ void ieee80211_unregister_hw(struct ieee +@@ -1342,10 +1342,10 @@ void ieee80211_unregister_hw(struct ieee tasklet_kill(&local->tx_pending_tasklet); tasklet_kill(&local->tasklet); diff --git a/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch b/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch index 8c019530d173..13fb2fd077e4 100644 --- a/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch +++ b/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch @@ -24,7 +24,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1786,6 +1786,9 @@ int ieee80211_tx_control_port(struct wip +@@ -1801,6 +1801,9 @@ int ieee80211_tx_control_port(struct wip const u8 *dest, __be16 proto, bool unencrypted); int ieee80211_probe_mesh_link(struct wiphy *wiphy, struct net_device *dev, const u8 *buf, size_t len); @@ -36,7 +36,7 @@ Signed-off-by: Felix Fietkau void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata, --- a/net/mac80211/status.c +++ b/net/mac80211/status.c -@@ -829,6 +829,11 @@ void ieee80211_tx_monitor(struct ieee802 +@@ -828,6 +828,11 @@ void ieee80211_tx_monitor(struct ieee802 struct net_device *prev_dev = NULL; int rtap_len; @@ -50,7 +50,7 @@ Signed-off-by: Felix Fietkau if (WARN_ON_ONCE(skb_headroom(skb) < rtap_len)) { --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -1936,37 +1936,53 @@ static bool ieee80211_tx(struct ieee8021 +@@ -1937,37 +1937,53 @@ static bool ieee80211_tx(struct ieee8021 } /* device xmit handlers */ @@ -123,7 +123,7 @@ Signed-off-by: Felix Fietkau wiphy_debug(local->hw.wiphy, "failed to reallocate TX buffer\n"); return -ENOMEM; -@@ -1982,18 +1998,8 @@ void ieee80211_xmit(struct ieee80211_sub +@@ -1983,18 +1999,8 @@ void ieee80211_xmit(struct ieee80211_sub struct ieee80211_local *local = sdata->local; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_hdr *hdr; @@ -143,7 +143,7 @@ Signed-off-by: Felix Fietkau ieee80211_free_txskb(&local->hw, skb); return; } -@@ -2795,29 +2801,13 @@ static struct sk_buff *ieee80211_build_h +@@ -2796,29 +2802,13 @@ static struct sk_buff *ieee80211_build_h } skb_pull(skb, skip_header_bytes); @@ -179,7 +179,7 @@ Signed-off-by: Felix Fietkau } if (encaps_data) -@@ -3432,7 +3422,6 @@ static bool ieee80211_xmit_fast(struct i +@@ -3433,7 +3423,6 @@ static bool ieee80211_xmit_fast(struct i struct ieee80211_local *local = sdata->local; u16 ethertype = (skb->data[12] << 8) | skb->data[13]; int extra_head = fast_tx->hdr_len - (ETH_HLEN - 2); @@ -187,7 +187,7 @@ Signed-off-by: Felix Fietkau struct ethhdr eth; struct ieee80211_tx_info *info; struct ieee80211_hdr *hdr = (void *)fast_tx->hdr; -@@ -3484,10 +3473,7 @@ static bool ieee80211_xmit_fast(struct i +@@ -3485,10 +3474,7 @@ static bool ieee80211_xmit_fast(struct i * as the may-encrypt argument for the resize to not account for * more room than we already have in 'extra_head' */ diff --git a/package/kernel/mac80211/patches/subsys/304-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch b/package/kernel/mac80211/patches/subsys/304-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch index 64ae487be289..10d8ad8d716f 100644 --- a/package/kernel/mac80211/patches/subsys/304-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch +++ b/package/kernel/mac80211/patches/subsys/304-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch @@ -28,7 +28,7 @@ Signed-off-by: Johannes Berg --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c -@@ -338,6 +338,7 @@ struct sta_info *sta_info_alloc(struct i +@@ -339,6 +339,7 @@ struct sta_info *sta_info_alloc(struct i INIT_WORK(&sta->drv_deliver_wk, sta_deliver_ps_frames); INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work); mutex_init(&sta->ampdu_mlme.mtx); diff --git a/package/kernel/mac80211/patches/subsys/305-mac80211-fix-tx-status-for-no-ack-cases.patch b/package/kernel/mac80211/patches/subsys/305-mac80211-fix-tx-status-for-no-ack-cases.patch deleted file mode 100644 index 16108c83f3a3..000000000000 --- a/package/kernel/mac80211/patches/subsys/305-mac80211-fix-tx-status-for-no-ack-cases.patch +++ /dev/null @@ -1,82 +0,0 @@ -From: Markus Theil -Date: Wed, 18 Dec 2019 15:27:36 +0100 -Subject: [PATCH] mac80211: fix tx status for no ack cases - -Before this patch, frames which where successfully transmitted without -requiring acks where accounted as lost frames. - -Signed-off-by: Markus Theil -Link: https://lore.kernel.org/r/20191218142736.15843-1-markus.theil@tu-ilmenau.de -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/status.c -+++ b/net/mac80211/status.c -@@ -895,6 +895,7 @@ static void __ieee80211_tx_status(struct - int rates_idx; - bool send_to_cooked; - bool acked; -+ bool noack_success; - struct ieee80211_bar *bar; - int shift = 0; - int tid = IEEE80211_NUM_TIDS; -@@ -913,6 +914,8 @@ static void __ieee80211_tx_status(struct - clear_sta_flag(sta, WLAN_STA_SP); - - acked = !!(info->flags & IEEE80211_TX_STAT_ACK); -+ noack_success = !!(info->flags & -+ IEEE80211_TX_STAT_NOACK_TRANSMITTED); - - /* mesh Peer Service Period support */ - if (ieee80211_vif_is_mesh(&sta->sdata->vif) && -@@ -977,12 +980,12 @@ static void __ieee80211_tx_status(struct - ieee80211_handle_filtered_frame(local, sta, skb); - return; - } else { -- if (!acked) -+ if (!acked && !noack_success) - sta->status_stats.retry_failed++; - sta->status_stats.retry_count += retry_count; - - if (ieee80211_is_data_present(fc)) { -- if (!acked) -+ if (!acked && !noack_success) - sta->status_stats.msdu_failed[tid]++; - - sta->status_stats.msdu_retries[tid] += -@@ -1020,7 +1023,7 @@ static void __ieee80211_tx_status(struct - } - - if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) { -- if (info->flags & IEEE80211_TX_STAT_ACK) { -+ if (acked) { - if (sta->status_stats.lost_packets) - sta->status_stats.lost_packets = 0; - -@@ -1028,6 +1031,8 @@ static void __ieee80211_tx_status(struct - if (test_sta_flag(sta, WLAN_STA_TDLS_PEER_AUTH)) - sta->status_stats.last_tdls_pkt_time = - jiffies; -+ } else if (noack_success) { -+ /* nothing to do here, do not account as lost */ - } else { - ieee80211_lost_packet(sta, info); - } -@@ -1148,7 +1153,7 @@ void ieee80211_tx_status_ext(struct ieee - - sta = container_of(pubsta, struct sta_info, sta); - -- if (!acked) -+ if (!acked && !noack_success) - sta->status_stats.retry_failed++; - sta->status_stats.retry_count += retry_count; - -@@ -1163,6 +1168,8 @@ void ieee80211_tx_status_ext(struct ieee - sta->status_stats.last_tdls_pkt_time = jiffies; - } else if (test_sta_flag(sta, WLAN_STA_PS_STA)) { - return; -+ } else if (noack_success) { -+ /* nothing to do here, do not account as lost */ - } else { - ieee80211_lost_packet(sta, info); - } diff --git a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch index 151ca25d18cd..f4573f124ab9 100644 --- a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch +++ b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch @@ -1,6 +1,6 @@ --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -3458,6 +3458,7 @@ struct cfg80211_update_owe_info { +@@ -3552,6 +3552,7 @@ struct cfg80211_update_owe_info { * (as advertised by the nl80211 feature flag.) * @get_tx_power: store the current TX power into the dbm variable; * return 0 if successful @@ -8,7 +8,7 @@ * * @set_wds_peer: set the WDS peer for a WDS interface * -@@ -3773,6 +3774,7 @@ struct cfg80211_ops { +@@ -3874,6 +3875,7 @@ struct cfg80211_ops { enum nl80211_tx_power_setting type, int mbm); int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev, int *dbm); @@ -18,7 +18,7 @@ const u8 *addr); --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -1501,6 +1501,7 @@ enum ieee80211_smps_mode { +@@ -1504,6 +1504,7 @@ enum ieee80211_smps_mode { * * @power_level: requested transmit power (in dBm), backward compatibility * value only that is set to the minimum of all interfaces @@ -26,7 +26,7 @@ * * @chandef: the channel definition to tune to * @radar_enabled: whether radar detection is enabled -@@ -1521,6 +1522,7 @@ enum ieee80211_smps_mode { +@@ -1524,6 +1525,7 @@ enum ieee80211_smps_mode { struct ieee80211_conf { u32 flags; int power_level, dynamic_ps_timeout; @@ -36,9 +36,9 @@ u8 ps_dtim_period; --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h -@@ -2400,6 +2400,9 @@ enum nl80211_commands { - * @NL80211_ATTR_VLAN_ID: VLAN ID (1..4094) for the station and VLAN group key - * (u16). +@@ -2470,6 +2470,9 @@ enum nl80211_commands { + * no roaming occurs between the reauth threshold and PMK expiration, + * disassociation is still forced. * + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce + * transmit power to stay within regulatory limits. u32, dBi. @@ -46,9 +46,9 @@ * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -2864,6 +2867,8 @@ enum nl80211_attrs { - - NL80211_ATTR_VLAN_ID, +@@ -2945,6 +2948,8 @@ enum nl80211_attrs { + NL80211_ATTR_PMK_LIFETIME, + NL80211_ATTR_PMK_REAUTH_THRESHOLD, + NL80211_ATTR_WIPHY_ANTENNA_GAIN, + @@ -77,7 +77,7 @@ static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev, const u8 *addr) { -@@ -4017,6 +4030,7 @@ const struct cfg80211_ops mac80211_confi +@@ -4004,6 +4017,7 @@ const struct cfg80211_ops mac80211_confi .set_wiphy_params = ieee80211_set_wiphy_params, .set_tx_power = ieee80211_set_tx_power, .get_tx_power = ieee80211_get_tx_power, @@ -87,7 +87,7 @@ CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1376,6 +1376,7 @@ struct ieee80211_local { +@@ -1380,6 +1380,7 @@ struct ieee80211_local { int dynamic_ps_forced_timeout; int user_power_level; /* in dBm, for all interfaces */ @@ -106,7 +106,7 @@ u32 offchannel_flag; offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL; -@@ -150,6 +150,12 @@ static u32 ieee80211_hw_conf_chan(struct +@@ -152,6 +152,12 @@ static u32 ieee80211_hw_conf_chan(struct } rcu_read_unlock(); @@ -119,7 +119,7 @@ if (local->hw.conf.power_level != power) { changed |= IEEE80211_CONF_CHANGE_POWER; local->hw.conf.power_level = power; -@@ -639,6 +645,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ +@@ -656,6 +662,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ IEEE80211_RADIOTAP_MCS_HAVE_BW; local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI | IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH; @@ -129,15 +129,15 @@ local->hw.max_mtu = IEEE80211_MAX_DATA_LEN; --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -630,6 +630,7 @@ const struct nla_policy nl80211_policy[N - [NL80211_ATTR_TWT_RESPONDER] = { .type = NLA_FLAG }, - [NL80211_ATTR_HE_OBSS_PD] = NLA_POLICY_NESTED(he_obss_pd_policy), - [NL80211_ATTR_VLAN_ID] = NLA_POLICY_RANGE(NLA_U16, 1, VLAN_N_VID - 2), +@@ -661,6 +661,7 @@ const struct nla_policy nl80211_policy[N + [NL80211_ATTR_CONTROL_PORT_NO_PREAUTH] = { .type = NLA_FLAG }, + [NL80211_ATTR_PMK_LIFETIME] = NLA_POLICY_MIN(NLA_U32, 1), + [NL80211_ATTR_PMK_REAUTH_THRESHOLD] = NLA_POLICY_RANGE(NLA_U8, 1, 100), + [NL80211_ATTR_WIPHY_ANTENNA_GAIN] = { .type = NLA_U32 }, }; /* policy for the key attributes */ -@@ -2994,6 +2995,20 @@ static int nl80211_set_wiphy(struct sk_b +@@ -3132,6 +3133,20 @@ static int nl80211_set_wiphy(struct sk_b if (result) return result; } diff --git a/package/network/utils/iw/patches/001-nl80211_h_sync.patch b/package/network/utils/iw/patches/001-nl80211_h_sync.patch index 57f05b711adf..5084c5d45fe1 100644 --- a/package/network/utils/iw/patches/001-nl80211_h_sync.patch +++ b/package/network/utils/iw/patches/001-nl80211_h_sync.patch @@ -1,6 +1,15 @@ --- a/nl80211.h +++ b/nl80211.h -@@ -249,6 +249,22 @@ +@@ -11,7 +11,7 @@ + * Copyright 2008 Jouni Malinen + * Copyright 2008 Colin McCabe + * Copyright 2015-2017 Intel Deutschland GmbH +- * Copyright (C) 2018-2019 Intel Corporation ++ * Copyright (C) 2018-2020 Intel Corporation + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above +@@ -249,6 +249,45 @@ */ /** @@ -19,11 +28,34 @@ + * %NL80211_ATTR_VLAN_ID. + */ + ++/** ++ * DOC: TID configuration ++ * ++ * TID config support can be checked in the %NL80211_ATTR_TID_CONFIG ++ * attribute given in wiphy capabilities. ++ * ++ * The necessary configuration parameters are mentioned in ++ * &enum nl80211_tid_config_attr and it will be passed to the ++ * %NL80211_CMD_SET_TID_CONFIG command in %NL80211_ATTR_TID_CONFIG. ++ * ++ * If the configuration needs to be applied for specific peer then the MAC ++ * address of the peer needs to be passed in %NL80211_ATTR_MAC, otherwise the ++ * configuration will be applied for all the connected peers in the vif except ++ * any peers that have peer specific configuration for the TID by default; if ++ * the %NL80211_TID_CONFIG_ATTR_OVERRIDE flag is set, peer specific values ++ * will be overwritten. ++ * ++ * All this configuration is valid only for STA's current connection ++ * i.e. the configuration will be reset to default when the STA connects back ++ * after disconnection/roaming, and this configuration will be cleared when ++ * the interface goes down. ++ */ ++ +/** * enum nl80211_commands - supported nl80211 commands * * @NL80211_CMD_UNSPEC: unspecified command to catch errors -@@ -571,6 +587,14 @@ +@@ -571,6 +610,14 @@ * set of BSSID,frequency parameters is used (i.e., either the enforcing * %NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict * %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT). @@ -38,31 +70,231 @@ * %NL80211_ATTR_PREV_BSSID can be used to request a reassociation within * the ESS in case the device is already associated and an association with * a different BSS is desired. -@@ -2373,6 +2397,12 @@ enum nl80211_commands { +@@ -1101,6 +1148,9 @@ + * peer MAC address and %NL80211_ATTR_FRAME is used to specify the frame + * content. The frame is ethernet data. + * ++ * @NL80211_CMD_SET_TID_CONFIG: Data frame TID specific configuration ++ * is passed using %NL80211_ATTR_TID_CONFIG attribute. ++ * + * @NL80211_CMD_MAX: highest used command number + * @__NL80211_CMD_AFTER_LAST: internal use + */ +@@ -1325,6 +1375,8 @@ enum nl80211_commands { + + NL80211_CMD_PROBE_MESH_LINK, + ++ NL80211_CMD_SET_TID_CONFIG, ++ + /* add new commands above here */ + + /* used to define NL80211_CMD_MAX below */ +@@ -1580,7 +1632,8 @@ enum nl80211_commands { + * flag is included, then control port frames are sent over NL80211 instead + * using %CMD_CONTROL_PORT_FRAME. If control port routing over NL80211 is + * to be used then userspace must also use the %NL80211_ATTR_SOCKET_OWNER +- * flag. ++ * flag. When used with %NL80211_ATTR_CONTROL_PORT_NO_PREAUTH, pre-auth ++ * frames are not forwared over the control port. + * + * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver. + * We recommend using nested, driver-specific attributes within this. +@@ -2373,6 +2426,53 @@ enum nl80211_commands { * the allowed channel bandwidth configurations. (u8 attribute) * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13. * + * @NL80211_ATTR_VLAN_ID: VLAN ID (1..4094) for the station and VLAN group key + * (u16). + * ++ * @NL80211_ATTR_HE_BSS_COLOR: nested attribute for BSS Color Settings. ++ * ++ * @NL80211_ATTR_IFTYPE_AKM_SUITES: nested array attribute, with each entry ++ * using attributes from &enum nl80211_iftype_akm_attributes. This ++ * attribute is sent in a response to %NL80211_CMD_GET_WIPHY indicating ++ * supported AKM suites capability per interface. AKMs advertised in ++ * %NL80211_ATTR_AKM_SUITES are default capabilities if AKM suites not ++ * advertised for a specific interface type. ++ * ++ * @NL80211_ATTR_TID_CONFIG: TID specific configuration in a ++ * nested attribute with &enum nl80211_tid_config_attr sub-attributes; ++ * on output (in wiphy attributes) it contains only the feature sub- ++ * attributes. ++ * ++ * @NL80211_ATTR_CONTROL_PORT_NO_PREAUTH: disable preauth frame rx on control ++ * port in order to forward/receive them as ordinary data frames. ++ * ++ * @NL80211_ATTR_PMK_LIFETIME: Maximum lifetime for PMKSA in seconds (u32, ++ * dot11RSNAConfigPMKReauthThreshold; 0 is not a valid value). ++ * An optional parameter configured through %NL80211_CMD_SET_PMKSA. ++ * Drivers that trigger roaming need to know the lifetime of the ++ * configured PMKSA for triggering the full vs. PMKSA caching based ++ * authentication. This timeout helps authentication methods like SAE, ++ * where PMK gets updated only by going through a full (new SAE) ++ * authentication instead of getting updated during an association for EAP ++ * authentication. No new full authentication within the PMK expiry shall ++ * result in a disassociation at the end of the lifetime. ++ * ++ * @NL80211_ATTR_PMK_REAUTH_THRESHOLD: Reauthentication threshold time, in ++ * terms of percentage of %NL80211_ATTR_PMK_LIFETIME ++ * (u8, dot11RSNAConfigPMKReauthThreshold, 1..100). This is an optional ++ * parameter configured through %NL80211_CMD_SET_PMKSA. Requests the ++ * driver to trigger a full authentication roam (without PMKSA caching) ++ * after the reauthentication threshold time, but before the PMK lifetime ++ * has expired. ++ * ++ * Authentication methods like SAE need to be able to generate a new PMKSA ++ * entry without having to force a disconnection after the PMK timeout. If ++ * no roaming occurs between the reauth threshold and PMK expiration, ++ * disassociation is still forced. ++ * + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce + * transmit power to stay within regulatory limits. u32, dBi. + * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -2835,6 +2865,10 @@ enum nl80211_attrs { +@@ -2835,6 +2935,21 @@ enum nl80211_attrs { NL80211_ATTR_WIPHY_EDMG_CHANNELS, NL80211_ATTR_WIPHY_EDMG_BW_CONFIG, + NL80211_ATTR_VLAN_ID, + ++ NL80211_ATTR_HE_BSS_COLOR, ++ ++ NL80211_ATTR_IFTYPE_AKM_SUITES, ++ ++ NL80211_ATTR_TID_CONFIG, ++ ++ NL80211_ATTR_CONTROL_PORT_NO_PREAUTH, ++ ++ NL80211_ATTR_PMK_LIFETIME, ++ NL80211_ATTR_PMK_REAUTH_THRESHOLD, ++ + NL80211_ATTR_WIPHY_ANTENNA_GAIN, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, -@@ -5484,6 +5518,14 @@ enum nl80211_feature_flags { +@@ -3554,6 +3669,8 @@ enum nl80211_wmm_rule { + * @NL80211_FREQUENCY_ATTR_WMM: this channel has wmm limitations. + * This is a nested attribute that contains the wmm limitation per AC. + * (see &enum nl80211_wmm_rule) ++ * @NL80211_FREQUENCY_ATTR_NO_HE: HE operation is not allowed on this channel ++ * in current regulatory domain. + * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number + * currently defined + * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use +@@ -3583,6 +3700,7 @@ enum nl80211_frequency_attr { + NL80211_FREQUENCY_ATTR_NO_20MHZ, + NL80211_FREQUENCY_ATTR_NO_10MHZ, + NL80211_FREQUENCY_ATTR_WMM, ++ NL80211_FREQUENCY_ATTR_NO_HE, + + /* keep last */ + __NL80211_FREQUENCY_ATTR_AFTER_LAST, +@@ -3780,6 +3898,7 @@ enum nl80211_sched_scan_match_attr { + * @NL80211_RRF_NO_HT40PLUS: channels can't be used in HT40+ operation + * @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed + * @NL80211_RRF_NO_160MHZ: 160MHz operation not allowed ++ * @NL80211_RRF_NO_HE: HE operation not allowed + */ + enum nl80211_reg_rule_flags { + NL80211_RRF_NO_OFDM = 1<<0, +@@ -3797,6 +3916,7 @@ enum nl80211_reg_rule_flags { + NL80211_RRF_NO_HT40PLUS = 1<<14, + NL80211_RRF_NO_80MHZ = 1<<15, + NL80211_RRF_NO_160MHZ = 1<<16, ++ NL80211_RRF_NO_HE = 1<<17, + }; + + #define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR +@@ -4503,6 +4623,7 @@ enum nl80211_key_default_types { + * See &enum nl80211_key_default_types. + * @NL80211_KEY_MODE: the mode from enum nl80211_key_mode. + * Defaults to @NL80211_KEY_RX_TX. ++ * @NL80211_KEY_DEFAULT_BEACON: flag indicating default Beacon frame key + * + * @__NL80211_KEY_AFTER_LAST: internal + * @NL80211_KEY_MAX: highest key attribute +@@ -4518,6 +4639,7 @@ enum nl80211_key_attributes { + NL80211_KEY_TYPE, + NL80211_KEY_DEFAULT_TYPES, + NL80211_KEY_MODE, ++ NL80211_KEY_DEFAULT_BEACON, + + /* keep last */ + __NL80211_KEY_AFTER_LAST, +@@ -4674,6 +4796,69 @@ enum nl80211_tx_power_setting { + }; + + /** ++ * enum nl80211_tid_config - TID config state ++ * @NL80211_TID_CONFIG_ENABLE: Enable config for the TID ++ * @NL80211_TID_CONFIG_DISABLE: Disable config for the TID ++ */ ++enum nl80211_tid_config { ++ NL80211_TID_CONFIG_ENABLE, ++ NL80211_TID_CONFIG_DISABLE, ++}; ++ ++/* enum nl80211_tid_config_attr - TID specific configuration. ++ * @NL80211_TID_CONFIG_ATTR_PAD: pad attribute for 64-bit values ++ * @NL80211_TID_CONFIG_ATTR_VIF_SUPP: a bitmap (u64) of attributes supported ++ * for per-vif configuration; doesn't list the ones that are generic ++ * (%NL80211_TID_CONFIG_ATTR_TIDS, %NL80211_TID_CONFIG_ATTR_OVERRIDE). ++ * @NL80211_TID_CONFIG_ATTR_PEER_SUPP: same as the previous per-vif one, but ++ * per peer instead. ++ * @NL80211_TID_CONFIG_ATTR_OVERRIDE: flag attribue, if no peer ++ * is selected, if set indicates that the new configuration overrides ++ * all previous peer configurations, otherwise previous peer specific ++ * configurations should be left untouched. If peer is selected then ++ * it will reset particular TID configuration of that peer and it will ++ * not accept other TID config attributes along with peer. ++ * @NL80211_TID_CONFIG_ATTR_TIDS: a bitmask value of TIDs (bit 0 to 7) ++ * Its type is u16. ++ * @NL80211_TID_CONFIG_ATTR_NOACK: Configure ack policy for the TID. ++ * specified in %NL80211_TID_CONFIG_ATTR_TID. see %enum nl80211_tid_config. ++ * Its type is u8. ++ * @NL80211_TID_CONFIG_ATTR_RETRY_SHORT: Number of retries used with data frame ++ * transmission, user-space sets this configuration in ++ * &NL80211_CMD_SET_TID_CONFIG. It is u8 type, min value is 1 and ++ * the max value is advertised by the driver in this attribute on ++ * output in wiphy capabilities. ++ * @NL80211_TID_CONFIG_ATTR_RETRY_LONG: Number of retries used with data frame ++ * transmission, user-space sets this configuration in ++ * &NL80211_CMD_SET_TID_CONFIG. Its type is u8, min value is 1 and ++ * the max value is advertised by the driver in this attribute on ++ * output in wiphy capabilities. ++ * @NL80211_TID_CONFIG_ATTR_AMPDU_CTRL: Enable/Disable aggregation for the TIDs ++ * specified in %NL80211_TID_CONFIG_ATTR_TIDS. Its type is u8, using ++ * the values from &nl80211_tid_config. ++ * @NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL: Enable/Disable RTS_CTS for the TIDs ++ * specified in %NL80211_TID_CONFIG_ATTR_TIDS. It is u8 type, using ++ * the values from &nl80211_tid_config. ++ */ ++enum nl80211_tid_config_attr { ++ __NL80211_TID_CONFIG_ATTR_INVALID, ++ NL80211_TID_CONFIG_ATTR_PAD, ++ NL80211_TID_CONFIG_ATTR_VIF_SUPP, ++ NL80211_TID_CONFIG_ATTR_PEER_SUPP, ++ NL80211_TID_CONFIG_ATTR_OVERRIDE, ++ NL80211_TID_CONFIG_ATTR_TIDS, ++ NL80211_TID_CONFIG_ATTR_NOACK, ++ NL80211_TID_CONFIG_ATTR_RETRY_SHORT, ++ NL80211_TID_CONFIG_ATTR_RETRY_LONG, ++ NL80211_TID_CONFIG_ATTR_AMPDU_CTRL, ++ NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL, ++ ++ /* keep last */ ++ __NL80211_TID_CONFIG_ATTR_AFTER_LAST, ++ NL80211_TID_CONFIG_ATTR_MAX = __NL80211_TID_CONFIG_ATTR_AFTER_LAST - 1 ++}; ++ ++/** + * enum nl80211_packet_pattern_attr - packet pattern attribute + * @__NL80211_PKTPAT_INVALID: invalid number for nested attribute + * @NL80211_PKTPAT_PATTERN: the pattern, values where the mask has +@@ -5484,6 +5669,26 @@ enum nl80211_feature_flags { * @NL80211_EXT_FEATURE_SAE_OFFLOAD: Device wants to do SAE authentication in * station mode (SAE password is passed as part of the connect command). * @@ -73,16 +305,149 @@ + * @NL80211_EXT_FEATURE_AQL: The driver supports the Airtime Queue Limit (AQL) + * feature, which prevents bufferbloat by using the expected transmission + * time to limit the amount of data buffered in the hardware. ++ * ++ * @NL80211_EXT_FEATURE_BEACON_PROTECTION: The driver supports Beacon protection ++ * and can receive key configuration for BIGTK using key indexes 6 and 7. ++ * ++ * @NL80211_EXT_FEATURE_CONTROL_PORT_NO_PREAUTH: The driver can disable the ++ * forwarding of preauth frames over the control port. They are then ++ * handled as ordinary data frames. ++ * ++ * @NL80211_EXT_FEATURE_PROTECTED_TWT: Driver supports protected TWT frames ++ * ++ * @NL80211_EXT_FEATURE_DEL_IBSS_STA: The driver supports removing stations ++ * in IBSS mode, essentially by dropping their state. + * * @NUM_NL80211_EXT_FEATURES: number of extended features. * @MAX_NL80211_EXT_FEATURES: highest extended feature index. */ -@@ -5529,6 +5571,8 @@ enum nl80211_ext_feature_index { +@@ -5529,6 +5734,12 @@ enum nl80211_ext_feature_index { NL80211_EXT_FEATURE_EXT_KEY_ID, NL80211_EXT_FEATURE_STA_TX_PWR, NL80211_EXT_FEATURE_SAE_OFFLOAD, + NL80211_EXT_FEATURE_VLAN_OFFLOAD, + NL80211_EXT_FEATURE_AQL, ++ NL80211_EXT_FEATURE_BEACON_PROTECTION, ++ NL80211_EXT_FEATURE_CONTROL_PORT_NO_PREAUTH, ++ NL80211_EXT_FEATURE_PROTECTED_TWT, ++ NL80211_EXT_FEATURE_DEL_IBSS_STA, /* add new features before the definition below */ NUM_NL80211_EXT_FEATURES, +@@ -6151,12 +6362,14 @@ enum nl80211_ftm_responder_stats { + * @NL80211_PREAMBLE_HT: HT preamble + * @NL80211_PREAMBLE_VHT: VHT preamble + * @NL80211_PREAMBLE_DMG: DMG preamble ++ * @NL80211_PREAMBLE_HE: HE preamble + */ + enum nl80211_preamble { + NL80211_PREAMBLE_LEGACY, + NL80211_PREAMBLE_HT, + NL80211_PREAMBLE_VHT, + NL80211_PREAMBLE_DMG, ++ NL80211_PREAMBLE_HE, + }; + + /** +@@ -6349,6 +6562,10 @@ enum nl80211_peer_measurement_attrs { + * is valid) + * @NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST: u32 attribute indicating + * the maximum FTMs per burst (if not present anything is valid) ++ * @NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED: flag attribute indicating if ++ * trigger based ranging measurement is supported ++ * @NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED: flag attribute indicating ++ * if non trigger based ranging measurement is supported + * + * @NUM_NL80211_PMSR_FTM_CAPA_ATTR: internal + * @NL80211_PMSR_FTM_CAPA_ATTR_MAX: highest attribute number +@@ -6364,6 +6581,8 @@ enum nl80211_peer_measurement_ftm_capa { + NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS, + NL80211_PMSR_FTM_CAPA_ATTR_MAX_BURSTS_EXPONENT, + NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST, ++ NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED, ++ NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED, + + /* keep last */ + NUM_NL80211_PMSR_FTM_CAPA_ATTR, +@@ -6393,6 +6612,20 @@ enum nl80211_peer_measurement_ftm_capa { + * @NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI: request LCI data (flag) + * @NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC: request civic location data + * (flag) ++ * @NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED: request trigger based ranging ++ * measurement (flag). ++ * This attribute and %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED are ++ * mutually exclusive. ++ * if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor ++ * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based ++ * ranging will be used. ++ * @NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED: request non trigger based ++ * ranging measurement (flag) ++ * This attribute and %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED are ++ * mutually exclusive. ++ * if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor ++ * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based ++ * ranging will be used. + * + * @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal + * @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number +@@ -6409,6 +6642,8 @@ enum nl80211_peer_measurement_ftm_req { + NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES, + NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI, + NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC, ++ NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED, ++ NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED, + + /* keep last */ + NUM_NL80211_PMSR_FTM_REQ_ATTR, +@@ -6548,5 +6783,51 @@ enum nl80211_obss_pd_attributes { + NL80211_HE_OBSS_PD_ATTR_MAX = __NL80211_HE_OBSS_PD_ATTR_LAST - 1, + }; + ++/** ++ * enum nl80211_bss_color_attributes - BSS Color attributes ++ * @__NL80211_HE_BSS_COLOR_ATTR_INVALID: Invalid ++ * ++ * @NL80211_HE_BSS_COLOR_ATTR_COLOR: the current BSS Color. ++ * @NL80211_HE_BSS_COLOR_ATTR_DISABLED: is BSS coloring disabled. ++ * @NL80211_HE_BSS_COLOR_ATTR_PARTIAL: the AID equation to be used.. ++ * ++ * @__NL80211_HE_BSS_COLOR_ATTR_LAST: Internal ++ * @NL80211_HE_BSS_COLOR_ATTR_MAX: highest BSS Color attribute. ++ */ ++enum nl80211_bss_color_attributes { ++ __NL80211_HE_BSS_COLOR_ATTR_INVALID, ++ ++ NL80211_HE_BSS_COLOR_ATTR_COLOR, ++ NL80211_HE_BSS_COLOR_ATTR_DISABLED, ++ NL80211_HE_BSS_COLOR_ATTR_PARTIAL, ++ ++ /* keep last */ ++ __NL80211_HE_BSS_COLOR_ATTR_LAST, ++ NL80211_HE_BSS_COLOR_ATTR_MAX = __NL80211_HE_BSS_COLOR_ATTR_LAST - 1, ++}; ++ ++/** ++ * enum nl80211_iftype_akm_attributes - interface type AKM attributes ++ * @__NL80211_IFTYPE_AKM_ATTR_INVALID: Invalid ++ * ++ * @NL80211_IFTYPE_AKM_ATTR_IFTYPES: nested attribute containing a flag ++ * attribute for each interface type that supports AKM suites specified in ++ * %NL80211_IFTYPE_AKM_ATTR_SUITES ++ * @NL80211_IFTYPE_AKM_ATTR_SUITES: an array of u32. Used to indicate supported ++ * AKM suites for the specified interface types. ++ * ++ * @__NL80211_IFTYPE_AKM_ATTR_LAST: Internal ++ * @NL80211_IFTYPE_AKM_ATTR_MAX: highest interface type AKM attribute. ++ */ ++enum nl80211_iftype_akm_attributes { ++ __NL80211_IFTYPE_AKM_ATTR_INVALID, ++ ++ NL80211_IFTYPE_AKM_ATTR_IFTYPES, ++ NL80211_IFTYPE_AKM_ATTR_SUITES, ++ ++ /* keep last */ ++ __NL80211_IFTYPE_AKM_ATTR_LAST, ++ NL80211_IFTYPE_AKM_ATTR_MAX = __NL80211_IFTYPE_AKM_ATTR_LAST - 1, ++}; + + #endif /* __LINUX_NL80211_H */