* [PATCH 1/2] brcmfmac: improve code handling bandwidth of firmware reported channels
@ 2019-02-11 22:04 Rafał Miłecki
2019-02-11 22:04 ` [PATCH 2/2] brcmfmac: support firmware reporting 160 MHz channels Rafał Miłecki
2019-02-19 15:06 ` [PATCH 1/2] brcmfmac: improve code handling bandwidth of firmware reported channels Kalle Valo
0 siblings, 2 replies; 3+ messages in thread
From: Rafał Miłecki @ 2019-02-11 22:04 UTC (permalink / raw)
To: Kalle Valo
Cc: Arend van Spriel, linux-wireless, brcm80211-dev-list.pdl,
brcm80211-dev-list, Rafał Miłecki
From: Rafał Miłecki <rafal@milecki.pl>
1) Use switch to simplify/improve the code & avoid some duplication
2) Add warning for unsupported values
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
.../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index b5e291ed9496..fa752ec04f22 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -6049,11 +6049,18 @@ static int brcmf_construct_chaninfo(struct brcmf_cfg80211_info *cfg,
/* assuming the chanspecs order is HT20,
* HT40 upper, HT40 lower, and VHT80.
*/
- if (ch.bw == BRCMU_CHAN_BW_80) {
+ switch (ch.bw) {
+ case BRCMU_CHAN_BW_80:
channel->flags &= ~IEEE80211_CHAN_NO_80MHZ;
- } else if (ch.bw == BRCMU_CHAN_BW_40) {
+ break;
+ case BRCMU_CHAN_BW_40:
brcmf_update_bw40_channel_flag(channel, &ch);
- } else {
+ break;
+ default:
+ wiphy_warn(wiphy, "Firmware reported unsupported bandwidth %d\n",
+ ch.bw);
+ /* fall through */
+ case BRCMU_CHAN_BW_20:
/* enable the channel and disable other bandwidths
* for now as mentioned order assure they are enabled
* for subsequent chanspecs.
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] brcmfmac: support firmware reporting 160 MHz channels
2019-02-11 22:04 [PATCH 1/2] brcmfmac: improve code handling bandwidth of firmware reported channels Rafał Miłecki
@ 2019-02-11 22:04 ` Rafał Miłecki
2019-02-19 15:06 ` [PATCH 1/2] brcmfmac: improve code handling bandwidth of firmware reported channels Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Rafał Miłecki @ 2019-02-11 22:04 UTC (permalink / raw)
To: Kalle Valo
Cc: Arend van Spriel, linux-wireless, brcm80211-dev-list.pdl,
brcm80211-dev-list, Rafał Miłecki
From: Rafał Miłecki <rafal@milecki.pl>
So far 160 MHz channels were treated as 20 MHz ones which was breaking
support for 40/80 MHz due to the brcmf_construct_chaninfo() logic and
its assumptions.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index fa752ec04f22..b3611f0f68bf 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -6050,6 +6050,9 @@ static int brcmf_construct_chaninfo(struct brcmf_cfg80211_info *cfg,
* HT40 upper, HT40 lower, and VHT80.
*/
switch (ch.bw) {
+ case BRCMU_CHAN_BW_160:
+ channel->flags &= ~IEEE80211_CHAN_NO_160MHZ;
+ break;
case BRCMU_CHAN_BW_80:
channel->flags &= ~IEEE80211_CHAN_NO_80MHZ;
break;
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] brcmfmac: improve code handling bandwidth of firmware reported channels
2019-02-11 22:04 [PATCH 1/2] brcmfmac: improve code handling bandwidth of firmware reported channels Rafał Miłecki
2019-02-11 22:04 ` [PATCH 2/2] brcmfmac: support firmware reporting 160 MHz channels Rafał Miłecki
@ 2019-02-19 15:06 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2019-02-19 15:06 UTC (permalink / raw)
To: Rafał Miłecki
Cc: Arend van Spriel, linux-wireless, brcm80211-dev-list.pdl,
brcm80211-dev-list, Rafał Miłecki
Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
>
> 1) Use switch to simplify/improve the code & avoid some duplication
> 2) Add warning for unsupported values
>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2 patches applied to wireless-drivers-next.git, thanks.
f4e183293b87 brcmfmac: improve code handling bandwidth of firmware reported channels
30519cbe339a brcmfmac: support firmware reporting 160 MHz channels
--
https://patchwork.kernel.org/patch/10806865/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-02-19 15:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-11 22:04 [PATCH 1/2] brcmfmac: improve code handling bandwidth of firmware reported channels Rafał Miłecki
2019-02-11 22:04 ` [PATCH 2/2] brcmfmac: support firmware reporting 160 MHz channels Rafał Miłecki
2019-02-19 15:06 ` [PATCH 1/2] brcmfmac: improve code handling bandwidth of firmware reported channels Kalle Valo
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).