* [PATCH v2 0/5] wcn36xx: PHY modifications to support 80MHz operation @ 2020-08-29 3:39 Bryan O'Donoghue 2020-08-29 3:39 ` [PATCH v2 1/5] wcn36xx: Add accessor macro HW_VALUE_CHANNEL for hardware channels Bryan O'Donoghue ` (4 more replies) 0 siblings, 5 replies; 8+ messages in thread From: Bryan O'Donoghue @ 2020-08-29 3:39 UTC (permalink / raw) To: kvalo, wcn36xx, linux-wireless; +Cc: bryan.odonoghue, shawn.guo, loic.poulain This series is four of a set of five to add support for wcn3680 at 802.11ac data-rates. In this set we add the ability to configure up the wcn3680 PHY to get onto 80MHz channels. To do that, the upper unused bits of the hw_value field of the struct ieee80211_channel are used to encode additional PHY settings. Accessor macros are provided to encode and decode this additional information. Depending on which channel we are on, we need to configure the PHY into one of four modes representing four potential adjacent 20MHz channels. The modes describe where the primary channel sits in relation to the other three channels giving us 20MHz + 20MHz + 20MHz + 20MHz to get 80MHz. V2: - No difference between V2 and V1 below V1: https://lore.kernel.org/linux-wireless/87eensldhi.fsf@codeaurora.org/T/#t Bryan O'Donoghue (5): wcn36xx: Add accessor macro HW_VALUE_CHANNEL for hardware channels wcn36xx: Use HW_VALUE_CHANNEL macro to get channel number wcn36xx: Add accessor macro HW_VALUE_PHY for PHY settings wcn36xx: Encode PHY mode for 80MHz channel in hw_value wcn36xx: Set PHY into correct mode for 80MHz channel width drivers/net/wireless/ath/wcn36xx/main.c | 50 +++++++++++----------- drivers/net/wireless/ath/wcn36xx/smd.c | 15 +++++-- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 6 ++- 3 files changed, 42 insertions(+), 29 deletions(-) -- 2.27.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/5] wcn36xx: Add accessor macro HW_VALUE_CHANNEL for hardware channels 2020-08-29 3:39 [PATCH v2 0/5] wcn36xx: PHY modifications to support 80MHz operation Bryan O'Donoghue @ 2020-08-29 3:39 ` Bryan O'Donoghue 2020-08-29 3:39 ` [PATCH v2 2/5] wcn36xx: Use HW_VALUE_CHANNEL macro to get channel number Bryan O'Donoghue ` (3 subsequent siblings) 4 siblings, 0 replies; 8+ messages in thread From: Bryan O'Donoghue @ 2020-08-29 3:39 UTC (permalink / raw) To: kvalo, wcn36xx, linux-wireless; +Cc: bryan.odonoghue, shawn.guo, loic.poulain Adds HW_VALUE_CHANNEL(hw_value) an access macro that will be used to extract the channel number from struct ieee80211_channel->hw_value in preparation for also storing PHY settings for 802.11ac in the upper bits of hw_value. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> --- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 2da81d9926c4..ebce1ed7adf7 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -83,7 +83,9 @@ enum wcn36xx_ampdu_state { WCN36XX_AMPDU_OPERATIONAL, }; -#define WCN36XX_HW_CHANNEL(__wcn) (__wcn->hw->conf.chandef.chan->hw_value) +#define HW_VALUE_CHANNEL(hw_value) ((hw_value) & 0xFF) +#define WCN36XX_HW_CHANNEL(__wcn)\ + HW_VALUE_CHANNEL(__wcn->hw->conf.chandef.chan->hw_value) #define WCN36XX_BAND(__wcn) (__wcn->hw->conf.chandef.chan->band) #define WCN36XX_CENTER_FREQ(__wcn) (__wcn->hw->conf.chandef.chan->center_freq) #define WCN36XX_LISTEN_INTERVAL(__wcn) (__wcn->hw->conf.listen_interval) -- 2.27.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/5] wcn36xx: Use HW_VALUE_CHANNEL macro to get channel number 2020-08-29 3:39 [PATCH v2 0/5] wcn36xx: PHY modifications to support 80MHz operation Bryan O'Donoghue 2020-08-29 3:39 ` [PATCH v2 1/5] wcn36xx: Add accessor macro HW_VALUE_CHANNEL for hardware channels Bryan O'Donoghue @ 2020-08-29 3:39 ` Bryan O'Donoghue 2020-08-29 3:39 ` [PATCH v2 3/5] wcn36xx: Add accessor macro HW_VALUE_PHY for PHY settings Bryan O'Donoghue ` (2 subsequent siblings) 4 siblings, 0 replies; 8+ messages in thread From: Bryan O'Donoghue @ 2020-08-29 3:39 UTC (permalink / raw) To: kvalo, wcn36xx, linux-wireless; +Cc: bryan.odonoghue, shawn.guo, loic.poulain Uses HW_VALUE_CHANNEL() to extract the channel number from a struct ieee80211_channel->hw_value. Once done we can use the upper bits of the hw_value to encode PHY related data. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> --- drivers/net/wireless/ath/wcn36xx/smd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 2c58f7050836..729708d96586 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -764,8 +764,10 @@ int wcn36xx_smd_start_hw_scan(struct wcn36xx *wcn, struct ieee80211_vif *vif, msg_body->num_channel = min_t(u8, req->n_channels, sizeof(msg_body->channels)); - for (i = 0; i < msg_body->num_channel; i++) - msg_body->channels[i] = req->channels[i]->hw_value; + for (i = 0; i < msg_body->num_channel; i++) { + msg_body->channels[i] = + HW_VALUE_CHANNEL(req->channels[i]->hw_value); + } msg_body->header.len -= WCN36XX_MAX_SCAN_IE_LEN; -- 2.27.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/5] wcn36xx: Add accessor macro HW_VALUE_PHY for PHY settings 2020-08-29 3:39 [PATCH v2 0/5] wcn36xx: PHY modifications to support 80MHz operation Bryan O'Donoghue 2020-08-29 3:39 ` [PATCH v2 1/5] wcn36xx: Add accessor macro HW_VALUE_CHANNEL for hardware channels Bryan O'Donoghue 2020-08-29 3:39 ` [PATCH v2 2/5] wcn36xx: Use HW_VALUE_CHANNEL macro to get channel number Bryan O'Donoghue @ 2020-08-29 3:39 ` Bryan O'Donoghue 2020-08-29 3:39 ` [PATCH v2 4/5] wcn36xx: Encode PHY mode for 80MHz channel in hw_value Bryan O'Donoghue 2020-08-29 3:39 ` [PATCH v2 5/5] wcn36xx: Set PHY into correct mode for 80MHz channel width Bryan O'Donoghue 4 siblings, 0 replies; 8+ messages in thread From: Bryan O'Donoghue @ 2020-08-29 3:39 UTC (permalink / raw) To: kvalo, wcn36xx, linux-wireless; +Cc: bryan.odonoghue, shawn.guo, loic.poulain Adds HW_VALUE_PHY(hw_value) an access macro that will be used to extract a hardware specific PHY setting for a given channel. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> --- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index ebce1ed7adf7..71fa9992b118 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -83,6 +83,8 @@ enum wcn36xx_ampdu_state { WCN36XX_AMPDU_OPERATIONAL, }; +#define HW_VALUE_PHY_SHIFT 8 +#define HW_VALUE_PHY(hw_value) ((hw_value) >> HW_VALUE_PHY_SHIFT) #define HW_VALUE_CHANNEL(hw_value) ((hw_value) & 0xFF) #define WCN36XX_HW_CHANNEL(__wcn)\ HW_VALUE_CHANNEL(__wcn->hw->conf.chandef.chan->hw_value) -- 2.27.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 4/5] wcn36xx: Encode PHY mode for 80MHz channel in hw_value 2020-08-29 3:39 [PATCH v2 0/5] wcn36xx: PHY modifications to support 80MHz operation Bryan O'Donoghue ` (2 preceding siblings ...) 2020-08-29 3:39 ` [PATCH v2 3/5] wcn36xx: Add accessor macro HW_VALUE_PHY for PHY settings Bryan O'Donoghue @ 2020-08-29 3:39 ` Bryan O'Donoghue 2020-08-29 3:39 ` [PATCH v2 5/5] wcn36xx: Set PHY into correct mode for 80MHz channel width Bryan O'Donoghue 4 siblings, 0 replies; 8+ messages in thread From: Bryan O'Donoghue @ 2020-08-29 3:39 UTC (permalink / raw) To: kvalo, wcn36xx, linux-wireless; +Cc: bryan.odonoghue, shawn.guo, loic.poulain This commit encodes the 802.11ac PHY mode for a given channel in the upper bits of the hw_value field. This allows for a neat read-out and application of the relevant PHY setting. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> --- drivers/net/wireless/ath/wcn36xx/main.c | 50 ++++++++++++------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index e92907a33443..9e97513feeb5 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -39,10 +39,10 @@ MODULE_PARM_DESC(debug_mask, "Debugging mask"); .max_power = 25, \ } -#define CHAN5G(_freq, _idx) { \ +#define CHAN5G(_freq, _idx, _phy_val) { \ .band = NL80211_BAND_5GHZ, \ .center_freq = (_freq), \ - .hw_value = (_idx), \ + .hw_value = (_phy_val) << HW_VALUE_PHY_SHIFT | HW_VALUE_CHANNEL(_idx), \ .max_power = 25, \ } @@ -67,29 +67,29 @@ static struct ieee80211_channel wcn_2ghz_channels[] = { }; static struct ieee80211_channel wcn_5ghz_channels[] = { - CHAN5G(5180, 36), - CHAN5G(5200, 40), - CHAN5G(5220, 44), - CHAN5G(5240, 48), - CHAN5G(5260, 52), - CHAN5G(5280, 56), - CHAN5G(5300, 60), - CHAN5G(5320, 64), - CHAN5G(5500, 100), - CHAN5G(5520, 104), - CHAN5G(5540, 108), - CHAN5G(5560, 112), - CHAN5G(5580, 116), - CHAN5G(5600, 120), - CHAN5G(5620, 124), - CHAN5G(5640, 128), - CHAN5G(5660, 132), - CHAN5G(5700, 140), - CHAN5G(5745, 149), - CHAN5G(5765, 153), - CHAN5G(5785, 157), - CHAN5G(5805, 161), - CHAN5G(5825, 165) + CHAN5G(5180, 36, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW), + CHAN5G(5200, 40, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW), + CHAN5G(5220, 44, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH), + CHAN5G(5240, 48, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH), + CHAN5G(5260, 52, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW), + CHAN5G(5280, 56, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW), + CHAN5G(5300, 60, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH), + CHAN5G(5320, 64, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH), + CHAN5G(5500, 100, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW), + CHAN5G(5520, 104, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW), + CHAN5G(5540, 108, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH), + CHAN5G(5560, 112, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH), + CHAN5G(5580, 116, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW), + CHAN5G(5600, 120, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW), + CHAN5G(5620, 124, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH), + CHAN5G(5640, 128, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH), + CHAN5G(5660, 132, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW), + CHAN5G(5700, 140, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH), + CHAN5G(5745, 149, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW), + CHAN5G(5765, 153, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW), + CHAN5G(5785, 157, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH), + CHAN5G(5805, 161, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH), + CHAN5G(5825, 165, 0) }; #define RATE(_bitrate, _hw_rate, _flags) { \ -- 2.27.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 5/5] wcn36xx: Set PHY into correct mode for 80MHz channel width 2020-08-29 3:39 [PATCH v2 0/5] wcn36xx: PHY modifications to support 80MHz operation Bryan O'Donoghue ` (3 preceding siblings ...) 2020-08-29 3:39 ` [PATCH v2 4/5] wcn36xx: Encode PHY mode for 80MHz channel in hw_value Bryan O'Donoghue @ 2020-08-29 3:39 ` Bryan O'Donoghue 2020-08-31 10:08 ` Loic Poulain 4 siblings, 1 reply; 8+ messages in thread From: Bryan O'Donoghue @ 2020-08-29 3:39 UTC (permalink / raw) To: kvalo, wcn36xx, linux-wireless; +Cc: bryan.odonoghue, shawn.guo, loic.poulain For the 80MHz channel we need to set the PHY mode to one of four PHY modes that span the 80MHz range. This patch latches the hw_value PHY field previously defined for 5GHz channels directly to the parameter passed to the firmware. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> --- drivers/net/wireless/ath/wcn36xx/smd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 729708d96586..4b967f8ba949 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1493,6 +1493,7 @@ int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, struct ieee80211_vif *vif, struct wcn36xx_hal_config_bss_params_v1 *bss; struct wcn36xx_hal_config_bss_params bss_v0; struct wcn36xx_hal_config_sta_params_v1 *sta; + struct cfg80211_chan_def *chandef; int ret; msg_body = kzalloc(sizeof(*msg_body), GFP_KERNEL); @@ -1536,7 +1537,13 @@ int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, struct ieee80211_vif *vif, bss->dtim_period = bss_v0.dtim_period; bss->tx_channel_width_set = bss_v0.tx_channel_width_set; bss->oper_channel = bss_v0.oper_channel; - bss->ext_channel = bss_v0.ext_channel; + + if (wcn->hw->conf.chandef.width == NL80211_CHAN_WIDTH_80) { + chandef = &wcn->hw->conf.chandef; + bss->ext_channel = HW_VALUE_PHY(chandef->chan->hw_value); + } else { + bss->ext_channel = bss_v0.ext_channel; + } bss->reserved = bss_v0.reserved; -- 2.27.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 5/5] wcn36xx: Set PHY into correct mode for 80MHz channel width 2020-08-29 3:39 ` [PATCH v2 5/5] wcn36xx: Set PHY into correct mode for 80MHz channel width Bryan O'Donoghue @ 2020-08-31 10:08 ` Loic Poulain 2020-08-31 11:30 ` Bryan O'Donoghue 0 siblings, 1 reply; 8+ messages in thread From: Loic Poulain @ 2020-08-31 10:08 UTC (permalink / raw) To: Bryan O'Donoghue; +Cc: Kalle Valo, wcn36xx, linux-wireless, Shawn Guo Hi Bryan, On Sat, 29 Aug 2020 at 05:39, Bryan O'Donoghue <bryan.odonoghue@linaro.org> wrote: > > For the 80MHz channel we need to set the PHY mode to one of four PHY modes > that span the 80MHz range. What about 40Mhz bonding? > > This patch latches the hw_value PHY field previously defined for 5GHz > channels directly to the parameter passed to the firmware. > > Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> > --- > drivers/net/wireless/ath/wcn36xx/smd.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c > index 729708d96586..4b967f8ba949 100644 > --- a/drivers/net/wireless/ath/wcn36xx/smd.c > +++ b/drivers/net/wireless/ath/wcn36xx/smd.c > @@ -1493,6 +1493,7 @@ int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, struct ieee80211_vif *vif, > struct wcn36xx_hal_config_bss_params_v1 *bss; > struct wcn36xx_hal_config_bss_params bss_v0; > struct wcn36xx_hal_config_sta_params_v1 *sta; > + struct cfg80211_chan_def *chandef; > int ret; > > msg_body = kzalloc(sizeof(*msg_body), GFP_KERNEL); > @@ -1536,7 +1537,13 @@ int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, struct ieee80211_vif *vif, > bss->dtim_period = bss_v0.dtim_period; > bss->tx_channel_width_set = bss_v0.tx_channel_width_set; > bss->oper_channel = bss_v0.oper_channel; > - bss->ext_channel = bss_v0.ext_channel; > + > + if (wcn->hw->conf.chandef.width == NL80211_CHAN_WIDTH_80) { > + chandef = &wcn->hw->conf.chandef; > + bss->ext_channel = HW_VALUE_PHY(chandef->chan->hw_value); > + } else { > + bss->ext_channel = bss_v0.ext_channel; > + } > > bss->reserved = bss_v0.reserved; > > -- > 2.27.0 > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 5/5] wcn36xx: Set PHY into correct mode for 80MHz channel width 2020-08-31 10:08 ` Loic Poulain @ 2020-08-31 11:30 ` Bryan O'Donoghue 0 siblings, 0 replies; 8+ messages in thread From: Bryan O'Donoghue @ 2020-08-31 11:30 UTC (permalink / raw) To: Loic Poulain; +Cc: Kalle Valo, wcn36xx, linux-wireless, Shawn Guo On 31/08/2020 11:08, Loic Poulain wrote: > Hi Bryan, > > On Sat, 29 Aug 2020 at 05:39, Bryan O'Donoghue > <bryan.odonoghue@linaro.org> wrote: >> >> For the 80MHz channel we need to set the PHY mode to one of four PHY modes >> that span the 80MHz range. > > What about 40Mhz bonding? The existing code handles 40MHz HT in wcn36xx_smd_join() ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-08-31 11:31 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-08-29 3:39 [PATCH v2 0/5] wcn36xx: PHY modifications to support 80MHz operation Bryan O'Donoghue 2020-08-29 3:39 ` [PATCH v2 1/5] wcn36xx: Add accessor macro HW_VALUE_CHANNEL for hardware channels Bryan O'Donoghue 2020-08-29 3:39 ` [PATCH v2 2/5] wcn36xx: Use HW_VALUE_CHANNEL macro to get channel number Bryan O'Donoghue 2020-08-29 3:39 ` [PATCH v2 3/5] wcn36xx: Add accessor macro HW_VALUE_PHY for PHY settings Bryan O'Donoghue 2020-08-29 3:39 ` [PATCH v2 4/5] wcn36xx: Encode PHY mode for 80MHz channel in hw_value Bryan O'Donoghue 2020-08-29 3:39 ` [PATCH v2 5/5] wcn36xx: Set PHY into correct mode for 80MHz channel width Bryan O'Donoghue 2020-08-31 10:08 ` Loic Poulain 2020-08-31 11:30 ` Bryan O'Donoghue
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).