* [PATCH v5 1/4] wcn36xx: Define INIT_HAL_MSG_V1()
2020-09-10 15:08 [PATCH v5 0/4] wcn36xx: Enable VHT when supported Bryan O'Donoghue
@ 2020-09-10 15:08 ` Bryan O'Donoghue
2020-09-22 7:39 ` Kalle Valo
2020-09-10 15:08 ` [PATCH v5 2/4] wcn36xx: Convert to VHT parameter structure on wcn3680 Bryan O'Donoghue
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Bryan O'Donoghue @ 2020-09-10 15:08 UTC (permalink / raw)
To: kvalo, wcn36xx, linux-wireless; +Cc: bryan.odonoghue, shawn.guo, loic.poulain
In order to pass 802.11ac VHT parameters from the SoC to wcn36xx we need to
use the V1 data structures associated with BSS and STA parameters.
The means of identifying a V1 data-structure is via the SMD version field.
This patch defines a INIT_HAL_MSG_V1() which operates the same way as
INIT_HAL_MSG() with the exception that it defines VERSION1 as opposed to
VERSION0.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
drivers/net/wireless/ath/wcn36xx/smd.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index dde43a2b0d81..0f5952003fff 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -466,14 +466,20 @@ static void init_hal_msg(struct wcn36xx_hal_msg_header *hdr,
hdr->len = msg_size + sizeof(*hdr);
}
-#define INIT_HAL_MSG(msg_body, type) \
+#define __INIT_HAL_MSG(msg_body, type, version) \
do { \
memset(&msg_body, 0, sizeof(msg_body)); \
msg_body.header.msg_type = type; \
- msg_body.header.msg_version = WCN36XX_HAL_MSG_VERSION0; \
+ msg_body.header.msg_version = version; \
msg_body.header.len = sizeof(msg_body); \
} while (0) \
+#define INIT_HAL_MSG(msg_body, type) \
+ __INIT_HAL_MSG(msg_body, type, WCN36XX_HAL_MSG_VERSION0)
+
+#define INIT_HAL_MSG_V1(msg_body, type) \
+ __INIT_HAL_MSG(msg_body, type, WCN36XX_HAL_MSG_VERSION1)
+
#define INIT_HAL_PTT_MSG(p_msg_body, ppt_msg_len) \
do { \
memset(p_msg_body, 0, sizeof(*p_msg_body) + ppt_msg_len); \
--
2.27.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v5 2/4] wcn36xx: Convert to VHT parameter structure on wcn3680
2020-09-10 15:08 [PATCH v5 0/4] wcn36xx: Enable VHT when supported Bryan O'Donoghue
2020-09-10 15:08 ` [PATCH v5 1/4] wcn36xx: Define INIT_HAL_MSG_V1() Bryan O'Donoghue
@ 2020-09-10 15:08 ` Bryan O'Donoghue
2020-09-10 15:08 ` [PATCH v5 3/4] wcn36xx: Add VHT rates to wcn36xx_update_allowed_rates() Bryan O'Donoghue
2020-09-10 15:08 ` [PATCH v5 4/4] wcn36xx: Advertise ieee802.11 VHT flags Bryan O'Donoghue
3 siblings, 0 replies; 6+ messages in thread
From: Bryan O'Donoghue @ 2020-09-10 15:08 UTC (permalink / raw)
To: kvalo, wcn36xx, linux-wireless; +Cc: bryan.odonoghue, shawn.guo, loic.poulain
In order to send VHT parameters to wcn3680 we need to pass the extended V1
parameter structures to the firmware. These commands need to have the
version number set to 1.
This patch makes the conversion. The conversion consists of
1. Setting the version number for wcn3680 or leaving it at 0 otherwise
2. Setting the size of the packet header lower for wcn3620 and wcn3660
Once done all three chips can continue to use the same code to pass
parameters to their respective firmware. In the case of the wcn3680 the
passed structures will be slightly larger to accommodate communication of
VHT descriptors.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
drivers/net/wireless/ath/wcn36xx/smd.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 0f5952003fff..e74abc153153 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1446,8 +1446,12 @@ static int wcn36xx_smd_config_sta_v1(struct wcn36xx *wcn,
struct wcn36xx_hal_config_sta_req_msg_v1 msg_body;
struct wcn36xx_hal_config_sta_params_v1 *sta_params;
- INIT_HAL_MSG(msg_body, WCN36XX_HAL_CONFIG_STA_REQ);
- msg_body.header.len -= WCN36XX_DIFF_STA_PARAMS_V1_NOVHT;
+ if (wcn->rf_id == RF_IRIS_WCN3680) {
+ INIT_HAL_MSG_V1(msg_body, WCN36XX_HAL_CONFIG_STA_REQ);
+ } else {
+ INIT_HAL_MSG(msg_body, WCN36XX_HAL_CONFIG_STA_REQ);
+ msg_body.header.len -= WCN36XX_DIFF_STA_PARAMS_V1_NOVHT;
+ }
sta_params = &msg_body.sta_params;
@@ -1627,8 +1631,12 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn,
if (!msg_body)
return -ENOMEM;
- INIT_HAL_MSG((*msg_body), WCN36XX_HAL_CONFIG_BSS_REQ);
- msg_body->header.len -= WCN36XX_DIFF_BSS_PARAMS_V1_NOVHT;
+ if (wcn->rf_id == RF_IRIS_WCN3680) {
+ INIT_HAL_MSG_V1((*msg_body), WCN36XX_HAL_CONFIG_BSS_REQ);
+ } else {
+ INIT_HAL_MSG((*msg_body), WCN36XX_HAL_CONFIG_BSS_REQ);
+ msg_body->header.len -= WCN36XX_DIFF_BSS_PARAMS_V1_NOVHT;
+ }
bss = &msg_body->bss_params;
sta = &bss->sta;
--
2.27.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v5 3/4] wcn36xx: Add VHT rates to wcn36xx_update_allowed_rates()
2020-09-10 15:08 [PATCH v5 0/4] wcn36xx: Enable VHT when supported Bryan O'Donoghue
2020-09-10 15:08 ` [PATCH v5 1/4] wcn36xx: Define INIT_HAL_MSG_V1() Bryan O'Donoghue
2020-09-10 15:08 ` [PATCH v5 2/4] wcn36xx: Convert to VHT parameter structure on wcn3680 Bryan O'Donoghue
@ 2020-09-10 15:08 ` Bryan O'Donoghue
2020-09-10 15:08 ` [PATCH v5 4/4] wcn36xx: Advertise ieee802.11 VHT flags Bryan O'Donoghue
3 siblings, 0 replies; 6+ messages in thread
From: Bryan O'Donoghue @ 2020-09-10 15:08 UTC (permalink / raw)
To: kvalo, wcn36xx, linux-wireless; +Cc: bryan.odonoghue, shawn.guo, loic.poulain
This commit adds VHT rates to the wcn36xx_update_allowed_rates() routine.
Thus allowing the driver to latch the declared rates and transmit them to
the firmware in the same way as other 80211.n rates are.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
drivers/net/wireless/ath/wcn36xx/main.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index 36cfa7043bc3..720d3fa8ddcb 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -766,6 +766,14 @@ static void wcn36xx_update_allowed_rates(struct ieee80211_sta *sta,
sta->ht_cap.mcs.rx_mask,
sizeof(sta->ht_cap.mcs.rx_mask));
}
+
+ if (sta->vht_cap.vht_supported) {
+ sta_priv->supported_rates.op_rate_mode = STA_11ac;
+ sta_priv->supported_rates.vht_rx_mcs_map =
+ sta->vht_cap.vht_mcs.rx_mcs_map;
+ sta_priv->supported_rates.vht_tx_mcs_map =
+ sta->vht_cap.vht_mcs.tx_mcs_map;
+ }
}
void wcn36xx_set_default_rates(struct wcn36xx_hal_supported_rates *rates)
{
--
2.27.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v5 4/4] wcn36xx: Advertise ieee802.11 VHT flags
2020-09-10 15:08 [PATCH v5 0/4] wcn36xx: Enable VHT when supported Bryan O'Donoghue
` (2 preceding siblings ...)
2020-09-10 15:08 ` [PATCH v5 3/4] wcn36xx: Add VHT rates to wcn36xx_update_allowed_rates() Bryan O'Donoghue
@ 2020-09-10 15:08 ` Bryan O'Donoghue
3 siblings, 0 replies; 6+ messages in thread
From: Bryan O'Donoghue @ 2020-09-10 15:08 UTC (permalink / raw)
To: kvalo, wcn36xx, linux-wireless; +Cc: bryan.odonoghue, shawn.guo, loic.poulain
This patch adds ieee802.11 VHT flags for the wcn3680b.
- RX_STBC1
- SU Beamformee
- MU Beamformee
- VHT80 SGI
- Single spatial stream
RX LDPC is declared as supported in the datasheet but not enabled at this
time.
After this patch is applied an AP should see the wcn3680 as an 802.11ac
capable device.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
drivers/net/wireless/ath/wcn36xx/main.c | 32 +++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index 720d3fa8ddcb..43596b919ed7 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -1200,6 +1200,35 @@ static const struct ieee80211_ops wcn36xx_ops = {
CFG80211_TESTMODE_CMD(wcn36xx_tm_cmd)
};
+static void
+wcn36xx_set_ieee80211_vht_caps(struct ieee80211_sta_vht_cap *vht_cap)
+{
+ vht_cap->vht_supported = true;
+
+ vht_cap->cap = (IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 |
+ IEEE80211_VHT_CAP_SHORT_GI_80 |
+ IEEE80211_VHT_CAP_RXSTBC_1 |
+ IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
+ IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE |
+ 3 << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT |
+ 7 << IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT);
+
+ vht_cap->vht_mcs.rx_mcs_map =
+ cpu_to_le16(IEEE80211_VHT_MCS_SUPPORT_0_9 |
+ IEEE80211_VHT_MCS_NOT_SUPPORTED << 2 |
+ IEEE80211_VHT_MCS_NOT_SUPPORTED << 4 |
+ IEEE80211_VHT_MCS_NOT_SUPPORTED << 6 |
+ IEEE80211_VHT_MCS_NOT_SUPPORTED << 8 |
+ IEEE80211_VHT_MCS_NOT_SUPPORTED << 10 |
+ IEEE80211_VHT_MCS_NOT_SUPPORTED << 12 |
+ IEEE80211_VHT_MCS_NOT_SUPPORTED << 14);
+
+ vht_cap->vht_mcs.rx_highest = cpu_to_le16(433);
+ vht_cap->vht_mcs.tx_highest = vht_cap->vht_mcs.rx_highest;
+
+ vht_cap->vht_mcs.tx_mcs_map = vht_cap->vht_mcs.rx_mcs_map;
+}
+
static int wcn36xx_init_ieee80211(struct wcn36xx *wcn)
{
static const u32 cipher_suites[] = {
@@ -1226,6 +1255,9 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn)
if (wcn->rf_id != RF_IRIS_WCN3620)
wcn->hw->wiphy->bands[NL80211_BAND_5GHZ] = &wcn_band_5ghz;
+ if (wcn->rf_id == RF_IRIS_WCN3680)
+ wcn36xx_set_ieee80211_vht_caps(&wcn_band_5ghz.vht_cap);
+
wcn->hw->wiphy->max_scan_ssids = WCN36XX_MAX_SCAN_SSIDS;
wcn->hw->wiphy->max_scan_ie_len = WCN36XX_MAX_SCAN_IE_LEN;
--
2.27.0
^ permalink raw reply related [flat|nested] 6+ messages in thread