stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Ilan Peer <ilan.peer@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>,
	Johannes Berg <johannes.berg@intel.com>,
	Sasha Levin <sashal@kernel.org>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 4.19 82/87] mac80211: Fix calculation of minimal channel width
Date: Tue, 22 Dec 2020 21:20:58 -0500	[thread overview]
Message-ID: <20201223022103.2792705-82-sashal@kernel.org> (raw)
In-Reply-To: <20201223022103.2792705-1-sashal@kernel.org>

From: Ilan Peer <ilan.peer@intel.com>

[ Upstream commit bbf31e88df2f5da20ce613c340ce508d732046b3 ]

When calculating the minimal channel width for channel context,
the current operation Rx channel width of a station was used and not
the overall channel width capability of the station, i.e., both for
Tx and Rx.

Fix ieee80211_get_sta_bw() to use the maximal channel width the
station is capable. While at it make the function static.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20201206145305.4387040b99a0.I74bcf19238f75a5960c4098b10e355123d933281@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/mac80211/chan.c        | 10 ++++++----
 net/mac80211/ieee80211_i.h |  1 -
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index d9558ffb8acf7..b58813568c9ff 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -190,11 +190,13 @@ ieee80211_find_reservation_chanctx(struct ieee80211_local *local,
 	return NULL;
 }
 
-enum nl80211_chan_width ieee80211_get_sta_bw(struct ieee80211_sta *sta)
+static enum nl80211_chan_width ieee80211_get_sta_bw(struct sta_info *sta)
 {
-	switch (sta->bandwidth) {
+	enum ieee80211_sta_rx_bandwidth width = ieee80211_sta_cap_rx_bw(sta);
+
+	switch (width) {
 	case IEEE80211_STA_RX_BW_20:
-		if (sta->ht_cap.ht_supported)
+		if (sta->sta.ht_cap.ht_supported)
 			return NL80211_CHAN_WIDTH_20;
 		else
 			return NL80211_CHAN_WIDTH_20_NOHT;
@@ -231,7 +233,7 @@ ieee80211_get_max_required_bw(struct ieee80211_sub_if_data *sdata)
 		    !(sta->sdata->bss && sta->sdata->bss == sdata->bss))
 			continue;
 
-		max_bw = max(max_bw, ieee80211_get_sta_bw(&sta->sta));
+		max_bw = max(max_bw, ieee80211_get_sta_bw(sta));
 	}
 	rcu_read_unlock();
 
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 43edb903be693..285a541549aaa 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2165,7 +2165,6 @@ int ieee80211_check_combinations(struct ieee80211_sub_if_data *sdata,
 				 enum ieee80211_chanctx_mode chanmode,
 				 u8 radar_detect);
 int ieee80211_max_num_channels(struct ieee80211_local *local);
-enum nl80211_chan_width ieee80211_get_sta_bw(struct ieee80211_sta *sta);
 void ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local,
 				       struct ieee80211_chanctx *ctx);
 
-- 
2.27.0


  parent reply	other threads:[~2020-12-23  2:44 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23  2:19 [PATCH AUTOSEL 4.19 01/87] locks: Fix UBSAN undefined behaviour in flock64_to_posix_lock Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 02/87] tomoyo: fix clang pointer arithmetic warning Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 03/87] crypto: omap-aes - fix the reference count leak of omap device Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 04/87] staging: wimax: depends on NET Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 05/87] scsi: pm80xx: Avoid busywait in FW ready check Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 06/87] scsi: pm80xx: Fix pm8001_mpi_get_nvmd_resp() race condition Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 07/87] fcntl: Fix potential deadlock in send_sig{io, urg}() Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 08/87] staging: ks7010: fix missing destroy_workqueue() on error in ks7010_sdio_probe Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 09/87] staging: rtl8192u: fix wrong judgement in rtl8192_rx_isr Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 10/87] mips: ar7: add missing iounmap() on error in ar7_gpio_init Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 11/87] mips: cm: add missing iounmap() on error in mips_cm_probe() Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 12/87] locktorture: Prevent hangs for invalid arguments Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 13/87] torture: Prevent jitter processes from delaying failed run Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 14/87] rcutorture: Prevent hangs for invalid arguments Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 15/87] rsi: Fix TX EAPOL packet handling against iwlwifi AP Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 16/87] drm: panel: simple: add missing platform_driver_unregister() in panel_simple_init Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 17/87] drm/ast: Fixed 1920x1080 sync. polarity issue Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 18/87] s390/trng: set quality to 1024 Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 19/87] Bluetooth: hidp: use correct wait queue when removing ctrl_wait Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 20/87] net: skb_vlan_untag(): don't reset transport offset if set by GRO layer Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 21/87] drm/omap: Fix runtime PM imbalance on error Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 22/87] mwifiex: pcie: skip cancel_work_sync() on reset failure path Sasha Levin
2020-12-23  2:19 ` [PATCH AUTOSEL 4.19 23/87] MIPS: BMC47xx: fix kconfig dependency bug for BCM47XX_SSB Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 24/87] net: ipconfig: Avoid spurious blank lines in boot log Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 25/87] jfs: Fix memleak in dbAdjCtl Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 26/87] media: zr364xx: propagate errors from zr364xx_start_readpipe() Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 27/87] media: cec-core: first mark device unregistered, then wake up fhs Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 28/87] media: isif: reset global state Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 29/87] s390/dasd: Fix operational path inconsistency Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 30/87] media: usb: dvb-usb-v2: zd1301: fix missing platform_device_unregister() Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 31/87] media: dvbdev: Fix memleak in dvb_register_device Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 32/87] mmc: tmio: do not print real IOMEM pointer Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 33/87] ARM: OMAP2+: Fix memleak in omap2xxx_clkt_vps_init Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 34/87] MIPS: kvm: Use vm_get_page_prot to get protection bits Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 35/87] scsi: ufs: Atomic update for clkgating_enable Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 36/87] Bluetooth: hci_h5: Add OBDA0623 ACPI HID Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 37/87] ALSA: usb-audio: Don't call usb_set_interface() at trigger callback Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 38/87] rxrpc: Don't leak the service-side session key to userspace Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 39/87] scsi: atari_scsi: Fix race condition between .queuecommand and EH Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 40/87] ARM: dts: hisilicon: fix errors detected by snps-dw-apb-uart.yaml Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 41/87] ARM: dts: hisilicon: fix errors detected by pl011.yaml Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 42/87] ARM: dts: hisilicon: fix errors detected by usb yaml Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 43/87] ARM: dts: hisilicon: fix errors detected by simple-bus.yaml Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 44/87] ARM: dts: hisilicon: fix errors detected by spi-pl022.yaml Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 45/87] selftests/x86/fsgsbase: Fix GS == 1, 2, and 3 tests Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 46/87] brcmsmac: ampdu: Check BA window size before checking block ack Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 47/87] i40e: report correct VF link speed when link state is set to enable Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 48/87] hv_netvsc: Validate number of allocated sub-channels Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 49/87] iommu/tegra-smmu: Expand mutex protection range Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 50/87] HID: mf: add support for 0079:1846 Mayflash/Dragonrise USB Gamecube Adapter Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 51/87] arm64: tegra: Fix GIC400 missing GICH/GICV register regions Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 52/87] crypto: qce - Fix SHA result buffer corruption issues Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 53/87] media: gp8psk: initialize stats at power control logic Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 54/87] net/lapb: fix t1 timer handling for LAPB_STATE_0 Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 55/87] x86/pci: Fix the function type for check_reserved_t Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 56/87] x86/mce: Panic for LMCE only if mca_cfg.tolerant < 3 Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 57/87] bridge: switchdev: Notify about VLAN protocol changes Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 58/87] media: cx23885: add more quirks for reset DMA on some AMD IOMMU Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 59/87] tty/serial/imx: Enable TXEN bit in imx_poll_init() Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 60/87] MIPS: KASLR: Avoid endless loop in sync_icache if synci_step is zero Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 61/87] ALSA: rawmidi: Access runtime->avail always in spinlock Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 62/87] cpufreq: sti-cpufreq: fix mem leak in sti_cpufreq_set_opp_info() Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 63/87] cpufreq: mediatek: add missing platform_driver_unregister() on error in mtk_cpufreq_driver_init Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 64/87] media: rcar-vin: Mask VNCSI_IFMD register Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 65/87] clocksource/drivers/sh_cmt: Fix potential deadlock when calling runtime PM Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 66/87] mwifiex: Fix possible buffer overflows in mwifiex_cmd_802_11_ad_hoc_start Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 67/87] ASoC: Intel: bytcr_rt5640: Add quirk for ARCHOS Cesium 140 Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 68/87] ARM: zynq: Fix leds subnode name for zc702/zybo-z7 Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 69/87] btrfs: fix race leading to unnecessary transaction commit when logging inode Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 70/87] driver core: Reorder devices on successful probe Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 71/87] misc: vmw_vmci: fix kernel info-leak by initializing dbells in vmci_ctx_get_chkpt_doorbells() Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 72/87] iwlwifi: pcie: validate RX descriptor length Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 73/87] iwlwifi: trans: consider firmware dead after errors Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 74/87] iwlwifi: add an extra firmware state in the transport Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 75/87] USB: typec: tcpm: Fix PR_SWAP error handling Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 76/87] USB: typec: tcpm: Add a 30ms room for tPSSourceOn in PR_SWAP Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 77/87] nl80211: always accept scan request with the duration set Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 78/87] cfg80211: Save the regulatory domain when setting custom regulatory Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 79/87] mac80211: disallow band-switch during CSA Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 80/87] mac80211: support Rx timestamp calculation for all preamble types Sasha Levin
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 81/87] mac80211: use bitfield helpers for BA session action frames Sasha Levin
2020-12-23  2:20 ` Sasha Levin [this message]
2020-12-23  2:20 ` [PATCH AUTOSEL 4.19 83/87] mac80211: don't filter out beacons once we start CSA Sasha Levin
2020-12-23  2:21 ` [PATCH AUTOSEL 4.19 84/87] mac80211: Update rate control on channel change Sasha Levin
2020-12-23  2:21 ` [PATCH AUTOSEL 4.19 85/87] ALSA: hda/hdmi: packet buffer index must be set before reading value Sasha Levin
2020-12-23  2:21 ` [PATCH AUTOSEL 4.19 86/87] cdrom: Reset sector_size back it is not 2048 Sasha Levin
2020-12-23  2:21 ` [PATCH AUTOSEL 4.19 87/87] PCI: Add function 1 DMA alias quirk for Marvell 9215 SATA controller Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201223022103.2792705-82-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=ilan.peer@intel.com \
    --cc=johannes.berg@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).