linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac
@ 2020-08-03  3:10 Bryan O'Donoghue
  2020-08-03  3:10 ` [PATCH 01/36] wcn36xx: Add ability to identify WCN3680 Bryan O'Donoghue
                   ` (36 more replies)
  0 siblings, 37 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:10 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

This series adds support for the 802.11ac data-rates available on the WCN3680.

WCN3680:
- Has one spatial stream
- MCS9 80Mhz 400ns guard interval
- 433.3 Mbps
- RX STBC
- LDPC (host dependant)
- MU-MIMO (host dependant)
- Tx beamformee (host dependant)

Declared data-rates are around 200 Mbps
https://preview.tinyurl.com/y2w3jb2b

iw wlan0 link
Connected to 04:d4:c4:3a:fd:f4 (on wlan0)
        SSID: linaro-test_5G
        freq: 5300
        RX: 761467 bytes (4302 packets)
        TX: 2492 bytes (28 packets)
        signal: -29 dBm
        rx bitrate: 433.3 MBit/s VHT-MCS 9 80MHz short GI VHT-NSS 1
        tx bitrate: 6.0 MBit/s

        bss flags:      short-slot-time
        dtim period:    3
        beacon int:     100

Test Hardware:
20MHz channels
[ ID] Interval            Bitrate
[  5]   0.00-60.00  sec   51.6 Mbits/sec 
[  5]   0.00-60.16  sec   51.4 Mbits/sec 

40MHz channels
[  5]   0.00-60.00  sec   109 Mbits/sec
[  5]   0.00-60.15  sec   109 Mbits/sec

80MHz channels
[  5]   0.00-60.00  sec   141 Mbits/sec
[  5]   0.00-60.01  sec   141 Mbits/sec

db410c:
[ ID] Interval            Bitrate
[  5]   0.00-60.00  sec   47.9 Mbits/sec
[  5]   0.00-60.02  sec   47.7 Mbits/sec

Sony M4 Aqua - believed to contain a 3680 with 3.10 downstream prima:
20MHz channels
[ ID] Interval            Bitrate
[  5]   0.00-60.00  sec   25.5 Mbits/sec 
[  5]   0.00-60.16  sec   25.5 Mbits/sec 

40MHz channels
[  5]   0.00-60.00  sec   50 Mbits/sec
[  5]   0.00-60.15  sec   50 Mbits/sec

80MHz channels
[  5]   0.00-60.00  sec   67.8 Mbits/sec
[  5]   0.00-60.01  sec   67.8 Mbits/sec


The wcn3680 uses the same parameter passing mechanism as earlier versions
3620 and 3660 however it also supports extended VHT parameters for STA and
BSS setup.

I've taken the downstream firmware config almost as-is in terms of
parameters send over the SMD bus to the target with the caveat of switching
off power-save offload.

I do have some housekeeping patches in the middle of this series where I
functionally decompose some of the existing code, which in my opinion
needed some attention before adding any more code to it.

Lastly, I've tested on wcn3680 and wcn3620, since the extended VHT
parameters only apply to wcn3680 the code-paths for wcn3620 should be the
same for wcn3660.

Bryan O'Donoghue (36):
  wcn36xx: Add ability to identify WCN3680
  wcn36xx: Add ieee802.11 VHT flags
  wcn36xx: Add 802.11ac MCS rates
  wcn36xx: Specify ieee80211_rx_status.nss
  wcn36xx: Add 802.11ac HAL param bitfields
  wcn36xx: Add Supported rates V1 structure
  wcn36xx: Use existing pointers in wcn36xx_smd_config_bss_v1
  wcn36xx: Set feature DOT11AC for wcn3680
  wcn36xx: Add VHT fields to parameter data structures
  wcn36xx: Use V1 data structure to store supported rates
  wcn36xx: Add wcn36xx_set_default_rates_v1
  wcn36xx: Add VHT rates to wcn36xx_update_allowed_rates()
  wcn36xx: Add wcn36xx_smd_set_sta_default_vht_params()
  wcn36xx: Add wcn36xx_smd_set_sta_default_ht_ldpc_params()
  wcn36xx: Add wcn36xx_smd_set_sta_vht_params()
  wcn36xx: Add wcn36xx_smd_set_sta_ht_ldpc_params()
  wcn36xx: Add wcn36xx_smd_set_bss_vht_params()
  wcn36xx: Add wrapper function wcn36xx_smd_set_sta_params_v1()
  wcn36xx: Define INIT_HAL_MSG_V1()
  wcn36xx: Convert to VHT parameter structure on wcn3680
  wcn36xx: Functionally decompose wcn36xx_smd_config_sta()
  wcn36xx: Move wcn36xx_smd_set_sta_params() inside
    wcn36xx_smd_config_bss()
  wcn36xx: Move BSS parameter setup to wcn36xx_smd_set_bss_params()
  wcn36xx: Add wcn36xx_smd_config_bss_v0
  wcn36xx: Update wcn36xx_smd_config_bss_v1() to operate internally
  wcn36xx: Convert to using wcn36xx_smd_config_bss_v0()
  wcn36xx: Remove dead code in wcn36xx_smd_config_bss()
  wcn36xx: Latch VHT specific BSS parameters to firmware
  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
  wcn36xx: Extend HAL param config list
  wcn36xx: Define wcn3680 specific firmware parameters
  wcn36xx: Add ability to download wcn3680 specific firmware parameters

 drivers/net/wireless/ath/wcn36xx/hal.h     | 214 ++++++-
 drivers/net/wireless/ath/wcn36xx/main.c    |  99 ++-
 drivers/net/wireless/ath/wcn36xx/smd.c     | 678 ++++++++++++++-------
 drivers/net/wireless/ath/wcn36xx/txrx.c    | 110 +++-
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h |  10 +-
 5 files changed, 861 insertions(+), 250 deletions(-)

-- 
2.27.0


^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 01/36] wcn36xx: Add ability to identify WCN3680
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
@ 2020-08-03  3:10 ` Bryan O'Donoghue
  2020-08-26 15:28   ` Kalle Valo
  2020-08-03  3:10 ` [PATCH 02/36] wcn36xx: Add ieee802.11 VHT flags Bryan O'Donoghue
                   ` (35 subsequent siblings)
  36 siblings, 1 reply; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:10 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

The WCN3680 has some specific behaviours that we want to capture to
distinguish it from the WCN3620 and WCN3660 respectively.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/main.c    | 2 ++
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index f389cd4676e3..73ba30a4d727 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -1298,6 +1298,8 @@ static int wcn36xx_platform_get_resources(struct wcn36xx *wcn,
 	if (iris_node) {
 		if (of_device_is_compatible(iris_node, "qcom,wcn3620"))
 			wcn->rf_id = RF_IRIS_WCN3620;
+		if (of_device_is_compatible(iris_node, "qcom,wcn3680"))
+			wcn->rf_id = RF_IRIS_WCN3680;
 		of_node_put(iris_node);
 	}
 
diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
index 3221fed15620..821c4ce61afd 100644
--- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
+++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
@@ -92,6 +92,7 @@ enum wcn36xx_ampdu_state {
 
 #define RF_UNKNOWN	0x0000
 #define RF_IRIS_WCN3620	0x3620
+#define RF_IRIS_WCN3680	0x3680
 
 static inline void buff_to_be(u32 *buf, size_t len)
 {
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 02/36] wcn36xx: Add ieee802.11 VHT flags
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
  2020-08-03  3:10 ` [PATCH 01/36] wcn36xx: Add ability to identify WCN3680 Bryan O'Donoghue
@ 2020-08-03  3:10 ` Bryan O'Donoghue
  2020-08-03  3:10 ` [PATCH 03/36] wcn36xx: Add 802.11ac MCS rates Bryan O'Donoghue
                   ` (34 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:10 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

This patch adds ieee802.11 VHT flags for the wcn3680b.

- RX_STBC1
- SU Beamformee
- VHT80 SGI
- Single spatial stream

RX LDPC is declared as supported in the datasheet but not enabled at this
time.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/main.c | 31 +++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index 73ba30a4d727..3b27ff6f6dac 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -1175,6 +1175,34 @@ 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 |
+			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[] = {
@@ -1201,6 +1229,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] 41+ messages in thread

* [PATCH 03/36] wcn36xx: Add 802.11ac MCS rates
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
  2020-08-03  3:10 ` [PATCH 01/36] wcn36xx: Add ability to identify WCN3680 Bryan O'Donoghue
  2020-08-03  3:10 ` [PATCH 02/36] wcn36xx: Add ieee802.11 VHT flags Bryan O'Donoghue
@ 2020-08-03  3:10 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 04/36] wcn36xx: Specify ieee80211_rx_status.nss Bryan O'Donoghue
                   ` (33 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:10 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

This commit incorporates the 802.11ac table defined in downstream into
upstream wcn36xx.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/txrx.c | 109 +++++++++++++++++++++++-
 1 file changed, 108 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c
index e20dbe0271f8..05a84f82584c 100644
--- a/drivers/net/wireless/ath/wcn36xx/txrx.c
+++ b/drivers/net/wireless/ath/wcn36xx/txrx.c
@@ -114,7 +114,114 @@ static const struct wcn36xx_rate wcn36xx_rate_table[] = {
 	{ 1215, 6, RX_ENC_HT, RX_ENC_FLAG_HT_GF, RATE_INFO_BW_40 },
 	{ 1350, 7, RX_ENC_HT, RX_ENC_FLAG_HT_GF, RATE_INFO_BW_40 },
 
-	/* TODO: AC rates */
+	/* 11ac reserved indices */
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+
+	/* 11ac 20 MHz 800ns GI MCS 0-8 */
+	{   65, 0, RX_ENC_HT, 0, RATE_INFO_BW_20 },
+	{  130, 1, RX_ENC_HT, 0, RATE_INFO_BW_20 },
+	{  195, 2, RX_ENC_HT, 0, RATE_INFO_BW_20 },
+	{  260, 3, RX_ENC_HT, 0, RATE_INFO_BW_20 },
+	{  390, 4, RX_ENC_HT, 0, RATE_INFO_BW_20 },
+	{  520, 5, RX_ENC_HT, 0, RATE_INFO_BW_20 },
+	{  585, 6, RX_ENC_HT, 0, RATE_INFO_BW_20 },
+	{  650, 7, RX_ENC_HT, 0, RATE_INFO_BW_20 },
+	{  780, 8, RX_ENC_HT, 0, RATE_INFO_BW_20 },
+
+	/* 11ac reserved indices */
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+
+	/* 11ac 20 MHz 400ns SGI MCS 6-8 */
+	{  655, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_20 },
+	{  722, 7, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_20 },
+	{  866, 8, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_20 },
+
+	/* 11ac reserved indices */
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+
+	/* 11ac 40 MHz 800ns GI MCS 0-9 */
+	{  135, 0, RX_ENC_HT, 0, RATE_INFO_BW_40 },
+	{  270, 1, RX_ENC_HT, 0, RATE_INFO_BW_40 },
+	{  405, 2, RX_ENC_HT, 0, RATE_INFO_BW_40 },
+	{  540, 3, RX_ENC_HT, 0, RATE_INFO_BW_40 },
+	{  810, 4, RX_ENC_HT, 0, RATE_INFO_BW_40 },
+	{ 1080, 5, RX_ENC_HT, 0, RATE_INFO_BW_40 },
+	{ 1215, 6, RX_ENC_HT, 0, RATE_INFO_BW_40 },
+	{ 1350, 7, RX_ENC_HT, 0, RATE_INFO_BW_40 },
+	{ 1350, 7, RX_ENC_HT, 0, RATE_INFO_BW_40 },
+	{ 1620, 8, RX_ENC_HT, 0, RATE_INFO_BW_40 },
+	{ 1800, 9, RX_ENC_HT, 0, RATE_INFO_BW_40 },
+
+	/* 11ac reserved indices */
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+
+	/* 11ac 40 MHz 400ns SGI MCS 5-7 */
+	{ 1200, 5, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1500, 7, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+
+	/* 11ac reserved index */
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+
+	/* 11ac 40 MHz 400ns SGI MCS 5-7 */
+	{ 1800, 8, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 2000, 9, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+
+	/* 11ac reserved index */
+	{ 1350, 6, RX_ENC_HT,  RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+
+	/* 11ac 80 MHz 800ns GI MCS 0-7 */
+	{  292, 0, RX_ENC_HT, 0, RATE_INFO_BW_80},
+	{  585, 1, RX_ENC_HT, 0, RATE_INFO_BW_80},
+	{  877, 2, RX_ENC_HT, 0, RATE_INFO_BW_80},
+	{ 1170, 3, RX_ENC_HT, 0, RATE_INFO_BW_80},
+	{ 1755, 4, RX_ENC_HT, 0, RATE_INFO_BW_80},
+	{ 2340, 5, RX_ENC_HT, 0, RATE_INFO_BW_80},
+	{ 2632, 6, RX_ENC_HT, 0, RATE_INFO_BW_80},
+	{ 2925, 7, RX_ENC_HT, 0, RATE_INFO_BW_80},
+
+	/* 11 ac reserved index */
+	{ 1350, 6, RX_ENC_HT,  RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+
+	/* 11ac 80 MHz 800 ns GI MCS 8-9 */
+	{ 3510, 8, RX_ENC_HT, 0, RATE_INFO_BW_80},
+	{ 3900, 9, RX_ENC_HT, 0, RATE_INFO_BW_80},
+
+	/* 11 ac reserved indices */
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+	{ 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+
+	/* 11ac 80 MHz 400 ns SGI MCS 6-7 */
+	{ 2925, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_80 },
+	{ 3250, 7, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_80 },
+
+	/* 11ac reserved index */
+	{ 1350, 6, RX_ENC_HT,  RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 },
+
+	/* 11ac 80 MHz 400ns SGI MCS 8-9 */
+	{ 3900, 8, RX_ENC_VHT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_80 },
+	{ 4333, 9, RX_ENC_VHT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_80 },
 };
 
 int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb)
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 04/36] wcn36xx: Specify ieee80211_rx_status.nss
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (2 preceding siblings ...)
  2020-08-03  3:10 ` [PATCH 03/36] wcn36xx: Add 802.11ac MCS rates Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 05/36] wcn36xx: Add 802.11ac HAL param bitfields Bryan O'Donoghue
                   ` (32 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

Specify the number of spatial streams in ieee80211_rx_status. For non VHT
data-rates the wireless core doesn't care about this field, however for VHT
data-rates it does.

Every version of wcn36xx has one spatial stream, so specify nss for
wcn3620, wcn3660 and wcn3680 now.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/txrx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c
index 05a84f82584c..903b47b55728 100644
--- a/drivers/net/wireless/ath/wcn36xx/txrx.c
+++ b/drivers/net/wireless/ath/wcn36xx/txrx.c
@@ -272,6 +272,7 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb)
 		status.bw = rate->bw;
 		status.rate_idx = rate->mcs_or_legacy_index;
 		sband = wcn->hw->wiphy->bands[status.band];
+		status.nss = 1;
 
 		if (status.band == NL80211_BAND_5GHZ &&
 		    status.encoding == RX_ENC_LEGACY &&
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 05/36] wcn36xx: Add 802.11ac HAL param bitfields
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (3 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 04/36] wcn36xx: Specify ieee80211_rx_status.nss Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 06/36] wcn36xx: Add Supported rates V1 structure Bryan O'Donoghue
                   ` (31 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

This patch enumerates four previously unused bits in
wcn36xx_hal_config_sta_params_v1 describing

- HT LDPC enable
- VHT LDPC enable
- VHT TX BF enable
- VHT MU Beamformee enable

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/hal.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h
index aab5a58616fc..8df3184a348d 100644
--- a/drivers/net/wireless/ath/wcn36xx/hal.h
+++ b/drivers/net/wireless/ath/wcn36xx/hal.h
@@ -1507,7 +1507,11 @@ struct wcn36xx_hal_config_sta_params_v1 {
 	u8 p2p;
 
 	/* Reserved to align next field on a dword boundary */
-	u8 reserved;
+	u8 ht_ldpc_enabled:1;
+	u8 vht_ldpc_enabled:1;
+	u8 vht_tx_bf_enabled:1;
+	u8 vht_tx_mu_beamformee_capable:1;
+	u8 reserved:4;
 
 	/* These rates are the intersection of peer and self capabilities. */
 	struct wcn36xx_hal_supported_rates supported_rates;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 06/36] wcn36xx: Add Supported rates V1 structure
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (4 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 05/36] wcn36xx: Add 802.11ac HAL param bitfields Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 07/36] wcn36xx: Use existing pointers in wcn36xx_smd_config_bss_v1 Bryan O'Donoghue
                   ` (30 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

This commit adds the supported rates V1 structure as defined in Prima
riva/inc/wlan_hal_msg.h

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/hal.h | 70 ++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h
index 8df3184a348d..5daac448d4e2 100644
--- a/drivers/net/wireless/ath/wcn36xx/hal.h
+++ b/drivers/net/wireless/ath/wcn36xx/hal.h
@@ -1405,6 +1405,76 @@ struct wcn36xx_hal_config_sta_req_msg {
 	struct wcn36xx_hal_config_sta_params sta_params;
 } __packed;
 
+struct wcn36xx_hal_supported_rates_v1 {
+	/* For Self STA Entry: this represents Self Mode.
+	 * For Peer Stations, this represents the mode of the peer.
+	 * On Station:
+	 *
+	 * --this mode is updated when PE adds the Self Entry.
+	 *
+	 * -- OR when PE sends 'ADD_BSS' message and station context in BSS
+	 *    is used to indicate the mode of the AP.
+	 *
+	 * ON AP:
+	 *
+	 * -- this mode is updated when PE sends 'ADD_BSS' and Sta entry
+	 *     for that BSS is used to indicate the self mode of the AP.
+	 *
+	 * -- OR when a station is associated, PE sends 'ADD_STA' message
+	 *    with this mode updated.
+	 */
+
+	enum sta_rate_mode op_rate_mode;
+
+	/* 11b, 11a and aniLegacyRates are IE rates which gives rate in
+	 * unit of 500Kbps
+	 */
+	u16 dsss_rates[WCN36XX_HAL_NUM_DSSS_RATES];
+	u16 ofdm_rates[WCN36XX_HAL_NUM_OFDM_RATES];
+	u16 legacy_rates[WCN36XX_HAL_NUM_POLARIS_RATES];
+	u16 reserved;
+
+	/* Taurus only supports 26 Titan Rates(no ESF/concat Rates will be
+	 * supported) First 26 bits are reserved for those Titan rates and
+	 * the last 4 bits(bit28-31) for Taurus, 2(bit26-27) bits are
+	 * reserved
+	 * Titan and Taurus Rates
+	 */
+	u32 enhanced_rate_bitmap;
+
+	/* 0-76 bits used, remaining reserved
+	 * bits 0-15 and 32 should be set.
+	 */
+	u8 supported_mcs_set[WCN36XX_HAL_MAC_MAX_SUPPORTED_MCS_SET];
+
+	/* RX Highest Supported Data Rate defines the highest data
+	 * rate that the STA is able to receive, in unites of 1Mbps.
+	 * This value is derived from "Supported MCS Set field" inside
+	 * the HT capability element.
+	 */
+	u16 rx_highest_data_rate;
+
+	/* Indicates the Maximum MCS that can be received for each spatial
+	 * stream.
+	 */
+	u16 vht_rx_mcs_map;
+
+	/* Indicates the highest VHT data rate that the STA is able to
+	 * receive.
+	 */
+	u16 vht_rx_highest_data_rate;
+
+	/* Indicates the Maximum MCS that can be transmitted for each spatial
+	 * stream.
+	 */
+	u16 vht_tx_mcs_map;
+
+	/* Indicates the highest VHT data rate that the STA is able to
+	 * transmit.
+	 */
+	u16 vht_tx_highest_data_rate;
+} __packed;
+
 struct wcn36xx_hal_config_sta_params_v1 {
 	/* BSSID of STA */
 	u8 bssid[ETH_ALEN];
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 07/36] wcn36xx: Use existing pointers in wcn36xx_smd_config_bss_v1
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (5 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 06/36] wcn36xx: Add Supported rates V1 structure Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 08/36] wcn36xx: Set feature DOT11AC for wcn3680 Bryan O'Donoghue
                   ` (29 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

Two pointers are already defined in this function "bss" and "sta" which
point to fields within msg_body->bss_params.

We can substantially reduce the amount of extraneous text in this function
by making use of those pointers. This change makes the code easier to read
and modify.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 110 +++++++++++--------------
 1 file changed, 47 insertions(+), 63 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 218f70283809..05835cf6e409 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1298,87 +1298,71 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn,
 	sta = &bss->sta;
 
 	/* convert orig to v1 */
-	memcpy(&msg_body->bss_params.bssid,
-	       &orig->bss_params.bssid, ETH_ALEN);
-	memcpy(&msg_body->bss_params.self_mac_addr,
-	       &orig->bss_params.self_mac_addr, ETH_ALEN);
+	memcpy(bss->bssid, &orig->bss_params.bssid, ETH_ALEN);
+	memcpy(bss->self_mac_addr, &orig->bss_params.self_mac_addr, ETH_ALEN);
 
-	msg_body->bss_params.bss_type = orig->bss_params.bss_type;
-	msg_body->bss_params.oper_mode = orig->bss_params.oper_mode;
-	msg_body->bss_params.nw_type = orig->bss_params.nw_type;
+	bss->bss_type = orig->bss_params.bss_type;
+	bss->oper_mode = orig->bss_params.oper_mode;
+	bss->nw_type = orig->bss_params.nw_type;
 
-	msg_body->bss_params.short_slot_time_supported =
+	bss->short_slot_time_supported =
 		orig->bss_params.short_slot_time_supported;
-	msg_body->bss_params.lla_coexist = orig->bss_params.lla_coexist;
-	msg_body->bss_params.llb_coexist = orig->bss_params.llb_coexist;
-	msg_body->bss_params.llg_coexist = orig->bss_params.llg_coexist;
-	msg_body->bss_params.ht20_coexist = orig->bss_params.ht20_coexist;
-	msg_body->bss_params.lln_non_gf_coexist =
-		orig->bss_params.lln_non_gf_coexist;
-
-	msg_body->bss_params.lsig_tx_op_protection_full_support =
+	bss->lla_coexist = orig->bss_params.lla_coexist;
+	bss->llb_coexist = orig->bss_params.llb_coexist;
+	bss->llg_coexist = orig->bss_params.llg_coexist;
+	bss->ht20_coexist = orig->bss_params.ht20_coexist;
+	bss->lln_non_gf_coexist = orig->bss_params.lln_non_gf_coexist;
+
+	bss->lsig_tx_op_protection_full_support =
 		orig->bss_params.lsig_tx_op_protection_full_support;
-	msg_body->bss_params.rifs_mode = orig->bss_params.rifs_mode;
-	msg_body->bss_params.beacon_interval = orig->bss_params.beacon_interval;
-	msg_body->bss_params.dtim_period = orig->bss_params.dtim_period;
-	msg_body->bss_params.tx_channel_width_set =
-		orig->bss_params.tx_channel_width_set;
-	msg_body->bss_params.oper_channel = orig->bss_params.oper_channel;
-	msg_body->bss_params.ext_channel = orig->bss_params.ext_channel;
-
-	msg_body->bss_params.reserved = orig->bss_params.reserved;
-
-	memcpy(&msg_body->bss_params.ssid,
-	       &orig->bss_params.ssid,
+	bss->rifs_mode = orig->bss_params.rifs_mode;
+	bss->beacon_interval = orig->bss_params.beacon_interval;
+	bss->dtim_period = orig->bss_params.dtim_period;
+	bss->tx_channel_width_set = orig->bss_params.tx_channel_width_set;
+	bss->oper_channel = orig->bss_params.oper_channel;
+	bss->ext_channel = orig->bss_params.ext_channel;
+
+	bss->reserved = orig->bss_params.reserved;
+
+	memcpy(&bss->ssid, &orig->bss_params.ssid,
 	       sizeof(orig->bss_params.ssid));
 
-	msg_body->bss_params.action = orig->bss_params.action;
-	msg_body->bss_params.rateset = orig->bss_params.rateset;
-	msg_body->bss_params.ht = orig->bss_params.ht;
-	msg_body->bss_params.obss_prot_enabled =
-		orig->bss_params.obss_prot_enabled;
-	msg_body->bss_params.rmf = orig->bss_params.rmf;
-	msg_body->bss_params.ht_oper_mode = orig->bss_params.ht_oper_mode;
-	msg_body->bss_params.dual_cts_protection =
-		orig->bss_params.dual_cts_protection;
-
-	msg_body->bss_params.max_probe_resp_retry_limit =
+	bss->action = orig->bss_params.action;
+	bss->rateset = orig->bss_params.rateset;
+	bss->ht = orig->bss_params.ht;
+	bss->obss_prot_enabled = orig->bss_params.obss_prot_enabled;
+	bss->rmf = orig->bss_params.rmf;
+	bss->ht_oper_mode = orig->bss_params.ht_oper_mode;
+	bss->dual_cts_protection = orig->bss_params.dual_cts_protection;
+
+	bss->max_probe_resp_retry_limit =
 		orig->bss_params.max_probe_resp_retry_limit;
-	msg_body->bss_params.hidden_ssid = orig->bss_params.hidden_ssid;
-	msg_body->bss_params.proxy_probe_resp =
-		orig->bss_params.proxy_probe_resp;
-	msg_body->bss_params.edca_params_valid =
-		orig->bss_params.edca_params_valid;
-
-	memcpy(&msg_body->bss_params.acbe,
-	       &orig->bss_params.acbe,
+	bss->hidden_ssid = orig->bss_params.hidden_ssid;
+	bss->proxy_probe_resp =	orig->bss_params.proxy_probe_resp;
+	bss->edca_params_valid = orig->bss_params.edca_params_valid;
+
+	memcpy(&bss->acbe, &orig->bss_params.acbe,
 	       sizeof(orig->bss_params.acbe));
-	memcpy(&msg_body->bss_params.acbk,
-	       &orig->bss_params.acbk,
+	memcpy(&bss->acbk, &orig->bss_params.acbk,
 	       sizeof(orig->bss_params.acbk));
-	memcpy(&msg_body->bss_params.acvi,
-	       &orig->bss_params.acvi,
+	memcpy(&bss->acvi, &orig->bss_params.acvi,
 	       sizeof(orig->bss_params.acvi));
-	memcpy(&msg_body->bss_params.acvo,
-	       &orig->bss_params.acvo,
+	memcpy(&bss->acvo, &orig->bss_params.acvo,
 	       sizeof(orig->bss_params.acvo));
 
-	msg_body->bss_params.ext_set_sta_key_param_valid =
+	bss->ext_set_sta_key_param_valid =
 		orig->bss_params.ext_set_sta_key_param_valid;
 
-	memcpy(&msg_body->bss_params.ext_set_sta_key_param,
+	memcpy(&bss->ext_set_sta_key_param,
 	       &orig->bss_params.ext_set_sta_key_param,
 	       sizeof(orig->bss_params.acvo));
 
-	msg_body->bss_params.wcn36xx_hal_persona =
-		orig->bss_params.wcn36xx_hal_persona;
-	msg_body->bss_params.spectrum_mgt_enable =
-		orig->bss_params.spectrum_mgt_enable;
-	msg_body->bss_params.tx_mgmt_power = orig->bss_params.tx_mgmt_power;
-	msg_body->bss_params.max_tx_power = orig->bss_params.max_tx_power;
+	bss->wcn36xx_hal_persona = orig->bss_params.wcn36xx_hal_persona;
+	bss->spectrum_mgt_enable = orig->bss_params.spectrum_mgt_enable;
+	bss->tx_mgmt_power = orig->bss_params.tx_mgmt_power;
+	bss->max_tx_power = orig->bss_params.max_tx_power;
 
-	wcn36xx_smd_convert_sta_to_v1(wcn, &orig->bss_params.sta,
-				      &msg_body->bss_params.sta);
+	wcn36xx_smd_convert_sta_to_v1(wcn, &orig->bss_params.sta, sta);
 
 	PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body));
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 08/36] wcn36xx: Set feature DOT11AC for wcn3680
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (6 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 07/36] wcn36xx: Use existing pointers in wcn36xx_smd_config_bss_v1 Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 09/36] wcn36xx: Add VHT fields to parameter data structures Bryan O'Donoghue
                   ` (28 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

In order for the firmware to process extended V1 parameters with the
addtional VHT fields added we need to first enable the feature bit DOT11AC.
Once done the version number in the HAL message header will be acted upon
by the firmware.

Extended V1 parameters are a prerequisite for 802.11ac speeds since we
cannot communicate VHT parameters to the firmware absent the extended data
structures.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 05835cf6e409..661742cba1c0 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -2083,6 +2083,8 @@ int wcn36xx_smd_feature_caps_exchange(struct wcn36xx *wcn)
 	INIT_HAL_MSG(msg_body, WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_REQ);
 
 	set_feat_caps(msg_body.feat_caps, STA_POWERSAVE);
+	if (wcn->rf_id == RF_IRIS_WCN3680)
+		set_feat_caps(msg_body.feat_caps, DOT11AC);
 
 	PREPARE_HAL_BUF(wcn->hal_buf, msg_body);
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 09/36] wcn36xx: Add VHT fields to parameter data structures
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (7 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 08/36] wcn36xx: Set feature DOT11AC for wcn3680 Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 10/36] wcn36xx: Use V1 data structure to store supported rates Bryan O'Donoghue
                   ` (27 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

In order to pass VHT parameters to wcn3680 we need to use a super-set of
the V1 data-structures with additional VHT parameters tacked on.

This patch adds the additional fields to the STA and BSS parameter
structures with some utility macros to make calculation of the structure
size easier.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/hal.h | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h
index 5daac448d4e2..10ce05110d11 100644
--- a/drivers/net/wireless/ath/wcn36xx/hal.h
+++ b/drivers/net/wireless/ath/wcn36xx/hal.h
@@ -1584,9 +1584,15 @@ struct wcn36xx_hal_config_sta_params_v1 {
 	u8 reserved:4;
 
 	/* These rates are the intersection of peer and self capabilities. */
-	struct wcn36xx_hal_supported_rates supported_rates;
+	struct wcn36xx_hal_supported_rates_v1 supported_rates;
+
+	u8 vht_capable;
+	u8 vht_tx_channel_width_set;
+
 } __packed;
 
+#define WCN36XX_DIFF_STA_PARAMS_V1_NOVHT 10
+
 struct wcn36xx_hal_config_sta_req_msg_v1 {
 	struct wcn36xx_hal_msg_header header;
 	struct wcn36xx_hal_config_sta_params_v1 sta_params;
@@ -2007,8 +2013,14 @@ struct wcn36xx_hal_config_bss_params_v1 {
 	 *  "STA context"
 	 */
 	struct wcn36xx_hal_config_sta_params_v1 sta;
+
+	u8 vht_capable;
+	u8 vht_tx_channel_width_set;
+
 } __packed;
 
+#define WCN36XX_DIFF_BSS_PARAMS_V1_NOVHT (WCN36XX_DIFF_STA_PARAMS_V1_NOVHT + 2)
+
 struct wcn36xx_hal_config_bss_req_msg_v1 {
 	struct wcn36xx_hal_msg_header header;
 	struct wcn36xx_hal_config_bss_params_v1 bss_params;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 10/36] wcn36xx: Use V1 data structure to store supported rates
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (8 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 09/36] wcn36xx: Add VHT fields to parameter data structures Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 11/36] wcn36xx: Add wcn36xx_set_default_rates_v1 Bryan O'Donoghue
                   ` (26 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

This patch converts the internal data structure used to store data-rates
from version 0 to version 1.

This allows us to extend out the internal storage to represent VHT
parameters.

Using the extended version 1 data-structure allows us to avoid a whole raft
of version 1 specific fixup functions.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c     | 5 +++--
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 661742cba1c0..a4e45114991b 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -241,9 +241,10 @@ static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn,
 		sta_params->aid = sta_priv->aid;
 		wcn36xx_smd_set_sta_ht_params(sta, sta_params);
 		memcpy(&sta_params->supported_rates, &sta_priv->supported_rates,
-			sizeof(sta_priv->supported_rates));
+			sizeof(struct wcn36xx_hal_supported_rates));
 	} else {
-		wcn36xx_set_default_rates(&sta_params->supported_rates);
+		wcn36xx_set_default_rates((struct wcn36xx_hal_supported_rates *)
+					  &sta_params->supported_rates);
 		wcn36xx_smd_set_sta_default_ht_params(sta_params);
 	}
 }
diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
index 821c4ce61afd..c3615704b543 100644
--- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
+++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
@@ -168,7 +168,7 @@ struct wcn36xx_sta {
 	u8 bss_dpu_desc_index;
 	bool is_data_encrypted;
 	/* Rates */
-	struct wcn36xx_hal_supported_rates supported_rates;
+	struct wcn36xx_hal_supported_rates_v1 supported_rates;
 
 	spinlock_t ampdu_lock;		/* protects next two fields */
 	enum wcn36xx_ampdu_state ampdu_state[16];
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 11/36] wcn36xx: Add wcn36xx_set_default_rates_v1
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (9 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 10/36] wcn36xx: Use V1 data structure to store supported rates Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 12/36] wcn36xx: Add VHT rates to wcn36xx_update_allowed_rates() Bryan O'Donoghue
                   ` (25 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

Add a routine to set some additional default parameters associated with the
V1 data structure.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/main.c    | 8 ++++++++
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index 3b27ff6f6dac..9f56f1af6dc4 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -785,6 +785,14 @@ void wcn36xx_set_default_rates(struct wcn36xx_hal_supported_rates *rates)
 		sizeof(*ofdm_rates) * WCN36XX_HAL_NUM_OFDM_RATES);
 	rates->supported_mcs_set[0] = 0xFF;
 }
+
+void wcn36xx_set_default_rates_v1(struct wcn36xx_hal_supported_rates_v1 *rates)
+{
+	rates->op_rate_mode = STA_11ac;
+	rates->vht_rx_mcs_map = IEEE80211_VHT_MCS_SUPPORT_0_9;
+	rates->vht_tx_mcs_map = IEEE80211_VHT_MCS_SUPPORT_0_9;
+}
+
 static void wcn36xx_bss_info_changed(struct ieee80211_hw *hw,
 				     struct ieee80211_vif *vif,
 				     struct ieee80211_bss_conf *bss_conf,
diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
index c3615704b543..18ccc6c31a38 100644
--- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
+++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
@@ -270,6 +270,7 @@ static inline bool wcn36xx_is_fw_version(struct wcn36xx *wcn,
 		wcn->fw_revision == revision);
 }
 void wcn36xx_set_default_rates(struct wcn36xx_hal_supported_rates *rates);
+void wcn36xx_set_default_rates_v1(struct wcn36xx_hal_supported_rates_v1 *rates);
 
 static inline
 struct ieee80211_sta *wcn36xx_priv_to_sta(struct wcn36xx_sta *sta_priv)
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 12/36] wcn36xx: Add VHT rates to wcn36xx_update_allowed_rates()
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (10 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 11/36] wcn36xx: Add wcn36xx_set_default_rates_v1 Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 13/36] wcn36xx: Add wcn36xx_smd_set_sta_default_vht_params() Bryan O'Donoghue
                   ` (24 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

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 9f56f1af6dc4..6a85bb699d10 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -758,6 +758,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] 41+ messages in thread

* [PATCH 13/36] wcn36xx: Add wcn36xx_smd_set_sta_default_vht_params()
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (11 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 12/36] wcn36xx: Add VHT rates to wcn36xx_update_allowed_rates() Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 14/36] wcn36xx: Add wcn36xx_smd_set_sta_default_ht_ldpc_params() Bryan O'Donoghue
                   ` (23 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

This commit adds support for setting default VHT parameters, which are
exposed by the extended version 1 STA parameter type.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index a4e45114991b..df7e2125b503 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -189,6 +189,22 @@ static void wcn36xx_smd_set_sta_default_ht_params(
 	sta_params->dsss_cck_mode_40mhz = 1;
 }
 
+static void wcn36xx_smd_set_sta_default_vht_params(struct wcn36xx *wcn,
+		struct wcn36xx_hal_config_sta_params_v1 *sta_params)
+{
+	if (wcn->rf_id == RF_IRIS_WCN3680) {
+		sta_params->vht_capable = 1;
+		sta_params->vht_tx_mu_beamformee_capable = 1;
+	} else {
+		sta_params->vht_capable = 0;
+		sta_params->vht_tx_mu_beamformee_capable = 0;
+	}
+
+	sta_params->vht_ldpc_enabled = 0;
+	sta_params->vht_tx_channel_width_set = 0;
+	sta_params->vht_tx_bf_enabled = 0;
+}
+
 static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn,
 		struct ieee80211_vif *vif,
 		struct ieee80211_sta *sta,
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 14/36] wcn36xx: Add wcn36xx_smd_set_sta_default_ht_ldpc_params()
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (12 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 13/36] wcn36xx: Add wcn36xx_smd_set_sta_default_vht_params() Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 15/36] wcn36xx: Add wcn36xx_smd_set_sta_vht_params() Bryan O'Donoghue
                   ` (22 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

Toggling the LDPC enabled bit is possible only via the extended V1
data-structure. This function provides a means of setting the default
depending on chip-type.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index df7e2125b503..88fb4b7f1356 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -205,6 +205,15 @@ static void wcn36xx_smd_set_sta_default_vht_params(struct wcn36xx *wcn,
 	sta_params->vht_tx_bf_enabled = 0;
 }
 
+static void wcn36xx_smd_set_sta_default_ht_ldpc_params(struct wcn36xx *wcn,
+		struct wcn36xx_hal_config_sta_params_v1 *sta_params)
+{
+	if (wcn->rf_id == RF_IRIS_WCN3680)
+		sta_params->ht_ldpc_enabled = 1;
+	else
+		sta_params->ht_ldpc_enabled = 0;
+}
+
 static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn,
 		struct ieee80211_vif *vif,
 		struct ieee80211_sta *sta,
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 15/36] wcn36xx: Add wcn36xx_smd_set_sta_vht_params()
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (13 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 14/36] wcn36xx: Add wcn36xx_smd_set_sta_default_ht_ldpc_params() Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 16/36] wcn36xx: Add wcn36xx_smd_set_sta_ht_ldpc_params() Bryan O'Donoghue
                   ` (21 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

This commit adds support for setting VHT parameters based on the declared
VHT capability bits in the VHT capability structure.

The bit-field TX-BF is purposefully left out since wcn3680 is the only
wcn36xx that can do VHT/80211.ac and is not TX beamformer capable. TX-BF is
a dead bit.

Similarly we cannot do 160MHz so VHT Channel width set should be zero.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 88fb4b7f1356..2632ea2ad9fa 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -173,6 +173,21 @@ static void wcn36xx_smd_set_sta_ht_params(struct ieee80211_sta *sta,
 	}
 }
 
+static void wcn36xx_smd_set_sta_vht_params(struct ieee80211_sta *sta,
+		struct wcn36xx_hal_config_sta_params_v1 *sta_params)
+{
+	if (sta->vht_cap.vht_supported) {
+		unsigned long caps = sta->vht_cap.cap;
+
+		sta_params->vht_capable = sta->vht_cap.vht_supported;
+		sta_params->vht_ldpc_enabled =
+			is_cap_supported(caps, IEEE80211_VHT_CAP_RXLDPC);
+		sta_params->vht_tx_mu_beamformee_capable =
+			is_cap_supported(caps, IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE);
+		sta_params->vht_tx_channel_width_set = 0;
+	}
+}
+
 static void wcn36xx_smd_set_sta_default_ht_params(
 		struct wcn36xx_hal_config_sta_params *sta_params)
 {
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 16/36] wcn36xx: Add wcn36xx_smd_set_sta_ht_ldpc_params()
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (14 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 15/36] wcn36xx: Add wcn36xx_smd_set_sta_vht_params() Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 17/36] wcn36xx: Add wcn36xx_smd_set_bss_vht_params() Bryan O'Donoghue
                   ` (20 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

Adds a routine to allow setting the LDPC bit for HT parameter passing
inside the version 1 STA parameters data structure.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 2632ea2ad9fa..8bb24fe9bde3 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -188,6 +188,15 @@ static void wcn36xx_smd_set_sta_vht_params(struct ieee80211_sta *sta,
 	}
 }
 
+static void wcn36xx_smd_set_sta_ht_ldpc_params(struct ieee80211_sta *sta,
+		struct wcn36xx_hal_config_sta_params_v1 *sta_params)
+{
+	if (sta->ht_cap.ht_supported) {
+		sta_params->ht_ldpc_enabled =
+			is_cap_supported(sta->ht_cap.cap, IEEE80211_HT_CAP_LDPC_CODING);
+	}
+}
+
 static void wcn36xx_smd_set_sta_default_ht_params(
 		struct wcn36xx_hal_config_sta_params *sta_params)
 {
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 17/36] wcn36xx: Add wcn36xx_smd_set_bss_vht_params()
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (15 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 16/36] wcn36xx: Add wcn36xx_smd_set_sta_ht_ldpc_params() Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 18/36] wcn36xx: Add wrapper function wcn36xx_smd_set_sta_params_v1() Bryan O'Donoghue
                   ` (19 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

This commit adds wcn36xx_smd_set_bss_vht_params(). The job of this function
is to decide if the BSS is VHT capable and if so set the appropriate bit
in the BSS parameter structure for passing to the firmware.

VHT Channel width set is not set since we don't support 160MHz.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 8bb24fe9bde3..ab9f0361aec4 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -145,6 +145,15 @@ static void wcn36xx_smd_set_bss_ht_params(struct ieee80211_vif *vif,
 	}
 }
 
+static void
+wcn36xx_smd_set_bss_vht_params(struct ieee80211_vif *vif,
+			       struct ieee80211_sta *sta,
+			       struct wcn36xx_hal_config_bss_params_v1 *bss)
+{
+	if (sta && sta->vht_cap.vht_supported)
+		bss->vht_capable = 1;
+}
+
 static void wcn36xx_smd_set_sta_ht_params(struct ieee80211_sta *sta,
 		struct wcn36xx_hal_config_sta_params *sta_params)
 {
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 18/36] wcn36xx: Add wrapper function wcn36xx_smd_set_sta_params_v1()
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (16 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 17/36] wcn36xx: Add wcn36xx_smd_set_bss_vht_params() Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 19/36] wcn36xx: Define INIT_HAL_MSG_V1() Bryan O'Donoghue
                   ` (18 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

This commit adds a wrapper function wcn36xx_smd_set_sta_params_v1() which
calls into wcn36xx_smd_set_sta_params() and then subsequently sets
version-1 specific parameters.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index ab9f0361aec4..f61516988953 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1241,6 +1241,31 @@ static void wcn36xx_smd_convert_sta_to_v1(struct wcn36xx *wcn,
 	v1->p2p = orig->p2p;
 }
 
+static void
+wcn36xx_smd_set_sta_params_v1(struct wcn36xx *wcn,
+			      struct ieee80211_vif *vif,
+			      struct ieee80211_sta *sta,
+			      struct wcn36xx_hal_config_sta_params_v1 *sta_par)
+{
+	struct wcn36xx_sta *sta_priv = NULL;
+	struct wcn36xx_hal_config_sta_params sta_par_v0;
+
+	wcn36xx_smd_set_sta_params(wcn, vif, sta, &sta_par_v0);
+	wcn36xx_smd_convert_sta_to_v1(wcn, &sta_par_v0, sta_par);
+
+	if (sta) {
+		sta_priv = wcn36xx_sta_to_priv(sta);
+		wcn36xx_smd_set_sta_vht_params(sta, sta_par);
+		wcn36xx_smd_set_sta_ht_ldpc_params(sta, sta_par);
+		memcpy(&sta_par->supported_rates, &sta_priv->supported_rates,
+		       sizeof(sta_par->supported_rates));
+	} else {
+		wcn36xx_set_default_rates_v1(&sta_par->supported_rates);
+		wcn36xx_smd_set_sta_default_vht_params(wcn, sta_par);
+		wcn36xx_smd_set_sta_default_ht_ldpc_params(wcn, sta_par);
+	}
+}
+
 static int wcn36xx_smd_config_sta_rsp(struct wcn36xx *wcn,
 				      struct ieee80211_sta *sta,
 				      void *buf,
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 19/36] wcn36xx: Define INIT_HAL_MSG_V1()
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (17 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 18/36] wcn36xx: Add wrapper function wcn36xx_smd_set_sta_params_v1() Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 20/36] wcn36xx: Convert to VHT parameter structure on wcn3680 Bryan O'Donoghue
                   ` (17 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

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 f61516988953..6a03d5956fc2 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -349,14 +349,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] 41+ messages in thread

* [PATCH 20/36] wcn36xx: Convert to VHT parameter structure on wcn3680
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (18 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 19/36] wcn36xx: Define INIT_HAL_MSG_V1() Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 21/36] wcn36xx: Functionally decompose wcn36xx_smd_config_sta() Bryan O'Donoghue
                   ` (16 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

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 sizeo 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 | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 6a03d5956fc2..2d6779cfa59c 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1311,7 +1311,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 = &msg_body.sta_params;
 
-	INIT_HAL_MSG(msg_body, WCN36XX_HAL_CONFIG_STA_REQ);
+	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;
+	}
 
 	wcn36xx_smd_convert_sta_to_v1(wcn, &orig->sta_params,
 				      &msg_body.sta_params);
@@ -1382,7 +1387,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);
+	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] 41+ messages in thread

* [PATCH 21/36] wcn36xx: Functionally decompose wcn36xx_smd_config_sta()
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (19 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 20/36] wcn36xx: Convert to VHT parameter structure on wcn3680 Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 22/36] wcn36xx: Move wcn36xx_smd_set_sta_params() inside wcn36xx_smd_config_bss() Bryan O'Donoghue
                   ` (15 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

This commit functionally decomposes wcn36xx_smd_config_sta into a clearly
defined wcn36xx_smd_config_sta_v0 and wcn36xx_smd_config_sta_v1 path.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 53 ++++++++++++++++----------
 1 file changed, 32 insertions(+), 21 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 2d6779cfa59c..7ad75faf8c4b 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1306,10 +1306,11 @@ static int wcn36xx_smd_config_sta_rsp(struct wcn36xx *wcn,
 }
 
 static int wcn36xx_smd_config_sta_v1(struct wcn36xx *wcn,
-		     const struct wcn36xx_hal_config_sta_req_msg *orig)
+				     struct ieee80211_vif *vif,
+				     struct ieee80211_sta *sta)
 {
 	struct wcn36xx_hal_config_sta_req_msg_v1 msg_body;
-	struct wcn36xx_hal_config_sta_params_v1 *sta = &msg_body.sta_params;
+	struct wcn36xx_hal_config_sta_params_v1 *sta_params;
 
 	if (wcn->rf_id == RF_IRIS_WCN3680) {
 		INIT_HAL_MSG_V1(msg_body, WCN36XX_HAL_CONFIG_STA_REQ);
@@ -1318,46 +1319,56 @@ static int wcn36xx_smd_config_sta_v1(struct wcn36xx *wcn,
 		msg_body.header.len -= WCN36XX_DIFF_STA_PARAMS_V1_NOVHT;
 	}
 
-	wcn36xx_smd_convert_sta_to_v1(wcn, &orig->sta_params,
-				      &msg_body.sta_params);
+	sta_params = &msg_body.sta_params;
+
+	wcn36xx_smd_set_sta_params_v1(wcn, vif, sta, sta_params);
 
 	PREPARE_HAL_BUF(wcn->hal_buf, msg_body);
 
 	wcn36xx_dbg(WCN36XX_DBG_HAL,
 		    "hal config sta v1 action %d sta_index %d bssid_index %d bssid %pM type %d mac %pM aid %d\n",
-		    sta->action, sta->sta_index, sta->bssid_index,
-		    sta->bssid, sta->type, sta->mac, sta->aid);
+		    sta_params->action, sta_params->sta_index, sta_params->bssid_index,
+		    sta_params->bssid, sta_params->type, sta_params->mac, sta_params->aid);
 
 	return wcn36xx_smd_send_and_wait(wcn, msg_body.header.len);
 }
 
-int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif,
-			   struct ieee80211_sta *sta)
+static int wcn36xx_smd_config_sta_v0(struct wcn36xx *wcn,
+				     struct ieee80211_vif *vif,
+				     struct ieee80211_sta *sta)
 {
 	struct wcn36xx_hal_config_sta_req_msg msg;
 	struct wcn36xx_hal_config_sta_params *sta_params;
-	int ret;
 
-	mutex_lock(&wcn->hal_mutex);
 	INIT_HAL_MSG(msg, WCN36XX_HAL_CONFIG_STA_REQ);
 
 	sta_params = &msg.sta_params;
 
 	wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params);
 
-	if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) {
-		ret = wcn36xx_smd_config_sta_v1(wcn, &msg);
-	} else {
-		PREPARE_HAL_BUF(wcn->hal_buf, msg);
+	PREPARE_HAL_BUF(wcn->hal_buf, msg);
 
-		wcn36xx_dbg(WCN36XX_DBG_HAL,
-			    "hal config sta action %d sta_index %d bssid_index %d bssid %pM type %d mac %pM aid %d\n",
-			    sta_params->action, sta_params->sta_index,
-			    sta_params->bssid_index, sta_params->bssid,
-			    sta_params->type, sta_params->mac, sta_params->aid);
+	wcn36xx_dbg(WCN36XX_DBG_HAL,
+		    "hal config sta action %d sta_index %d bssid_index %d bssid %pM type %d mac %pM aid %d\n",
+		    sta_params->action, sta_params->sta_index,
+		    sta_params->bssid_index, sta_params->bssid,
+		    sta_params->type, sta_params->mac, sta_params->aid);
+
+	return wcn36xx_smd_send_and_wait(wcn, msg.header.len);
+}
+
+int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif,
+			   struct ieee80211_sta *sta)
+{
+	int ret;
+
+	mutex_lock(&wcn->hal_mutex);
+
+	if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24))
+		ret = wcn36xx_smd_config_sta_v1(wcn, vif, sta);
+	else
+		ret = wcn36xx_smd_config_sta_v0(wcn, vif, sta);
 
-		ret = wcn36xx_smd_send_and_wait(wcn, msg.header.len);
-	}
 	if (ret) {
 		wcn36xx_err("Sending hal_config_sta failed\n");
 		goto out;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 22/36] wcn36xx: Move wcn36xx_smd_set_sta_params() inside wcn36xx_smd_config_bss()
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (20 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 21/36] wcn36xx: Functionally decompose wcn36xx_smd_config_sta() Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 23/36] wcn36xx: Move BSS parameter setup to wcn36xx_smd_set_bss_params() Bryan O'Donoghue
                   ` (14 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

In order to facilitate functional decomposition of
wcn36xx_smd_config_bss() we need to move wcn36xx_smd_set_sta_params() later
in function.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 7ad75faf8c4b..6232e64fb298 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1612,7 +1612,6 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 		bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_NONE;
 
 	bss->reserved = 0;
-	wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params);
 
 	/* wcn->ssid is only valid in AP and IBSS mode */
 	bss->ssid.length = vif_priv->ssid.length;
@@ -1638,6 +1637,8 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 
 	vif_priv->bss_type = bss->bss_type;
 
+	wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params);
+
 	wcn36xx_dbg(WCN36XX_DBG_HAL,
 		    "hal config bss bssid %pM self_mac_addr %pM bss_type %d oper_mode %d nw_type %d\n",
 		    bss->bssid, bss->self_mac_addr, bss->bss_type,
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 23/36] wcn36xx: Move BSS parameter setup to wcn36xx_smd_set_bss_params()
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (21 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 22/36] wcn36xx: Move wcn36xx_smd_set_sta_params() inside wcn36xx_smd_config_bss() Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 24/36] wcn36xx: Add wcn36xx_smd_config_bss_v0 Bryan O'Donoghue
                   ` (13 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

This commit moves BSS parameter setup to a separate function
wcn36xx_smd_set_bss_params(). This will allow for further functional
decomposition and fewer kzalloc() operations in subsequent patches.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 172 +++++++++++++------------
 1 file changed, 92 insertions(+), 80 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 6232e64fb298..5fda63f79ca7 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1386,6 +1386,97 @@ int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 	return ret;
 }
 
+static void wcn36xx_smd_set_bss_params(struct wcn36xx *wcn,
+				       struct ieee80211_vif *vif,
+				       struct ieee80211_sta *sta,
+				       const u8 *bssid,
+				       bool update,
+				       struct wcn36xx_hal_config_bss_params *bss)
+{
+	struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
+	struct wcn36xx_hal_config_sta_params *sta_params;
+
+	sta_params = &bss->sta;
+
+	WARN_ON(is_zero_ether_addr(bssid));
+
+	memcpy(&bss->bssid, bssid, ETH_ALEN);
+
+	memcpy(bss->self_mac_addr, vif->addr, ETH_ALEN);
+
+	if (vif->type == NL80211_IFTYPE_STATION) {
+		bss->bss_type = WCN36XX_HAL_INFRASTRUCTURE_MODE;
+
+		/* STA */
+		bss->oper_mode = 1;
+		bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_MODE;
+	} else if (vif->type == NL80211_IFTYPE_AP ||
+		   vif->type == NL80211_IFTYPE_MESH_POINT) {
+		bss->bss_type = WCN36XX_HAL_INFRA_AP_MODE;
+
+		/* AP */
+		bss->oper_mode = 0;
+		bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_SAP_MODE;
+	} else if (vif->type == NL80211_IFTYPE_ADHOC) {
+		bss->bss_type = WCN36XX_HAL_IBSS_MODE;
+
+		/* STA */
+		bss->oper_mode = 1;
+	} else {
+		wcn36xx_warn("Unknown type for bss config: %d\n", vif->type);
+	}
+
+	if (vif->type == NL80211_IFTYPE_STATION)
+		wcn36xx_smd_set_bss_nw_type(wcn, sta, bss);
+	else
+		bss->nw_type = WCN36XX_HAL_11N_NW_TYPE;
+
+	bss->short_slot_time_supported = vif->bss_conf.use_short_slot;
+	bss->lla_coexist = 0;
+	bss->llb_coexist = 0;
+	bss->llg_coexist = 0;
+	bss->rifs_mode = 0;
+	bss->beacon_interval = vif->bss_conf.beacon_int;
+	bss->dtim_period = vif_priv->dtim_period;
+
+	wcn36xx_smd_set_bss_ht_params(vif, sta, bss);
+
+	bss->oper_channel = WCN36XX_HW_CHANNEL(wcn);
+
+	if (conf_is_ht40_minus(&wcn->hw->conf))
+		bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
+	else if (conf_is_ht40_plus(&wcn->hw->conf))
+		bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
+	else
+		bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_NONE;
+
+	bss->reserved = 0;
+
+	/* wcn->ssid is only valid in AP and IBSS mode */
+	bss->ssid.length = vif_priv->ssid.length;
+	memcpy(bss->ssid.ssid, vif_priv->ssid.ssid, vif_priv->ssid.length);
+
+	bss->obss_prot_enabled = 0;
+	bss->rmf = 0;
+	bss->max_probe_resp_retry_limit = 0;
+	bss->hidden_ssid = vif->bss_conf.hidden_ssid;
+	bss->proxy_probe_resp = 0;
+	bss->edca_params_valid = 0;
+
+	/* FIXME: set acbe, acbk, acvi and acvo */
+
+	bss->ext_set_sta_key_param_valid = 0;
+
+	/* FIXME: set ext_set_sta_key_param */
+
+	bss->spectrum_mgt_enable = 0;
+	bss->tx_mgmt_power = 0;
+	bss->max_tx_power = WCN36XX_MAX_POWER(wcn);
+	bss->action = update;
+
+	vif_priv->bss_type = bss->bss_type;
+}
+
 static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn,
 			const struct wcn36xx_hal_config_bss_req_msg *orig)
 {
@@ -1493,7 +1584,6 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn,
 	return ret;
 }
 
-
 static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn,
 				      struct ieee80211_vif *vif,
 				      struct ieee80211_sta *sta,
@@ -1545,7 +1635,6 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 	struct wcn36xx_hal_config_bss_req_msg *msg;
 	struct wcn36xx_hal_config_bss_params *bss;
 	struct wcn36xx_hal_config_sta_params *sta_params;
-	struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
 	int ret;
 
 	mutex_lock(&wcn->hal_mutex);
@@ -1559,84 +1648,7 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 	bss = &msg->bss_params;
 	sta_params = &bss->sta;
 
-	WARN_ON(is_zero_ether_addr(bssid));
-
-	memcpy(&bss->bssid, bssid, ETH_ALEN);
-
-	memcpy(bss->self_mac_addr, vif->addr, ETH_ALEN);
-
-	if (vif->type == NL80211_IFTYPE_STATION) {
-		bss->bss_type = WCN36XX_HAL_INFRASTRUCTURE_MODE;
-
-		/* STA */
-		bss->oper_mode = 1;
-		bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_MODE;
-	} else if (vif->type == NL80211_IFTYPE_AP ||
-		   vif->type == NL80211_IFTYPE_MESH_POINT) {
-		bss->bss_type = WCN36XX_HAL_INFRA_AP_MODE;
-
-		/* AP */
-		bss->oper_mode = 0;
-		bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_SAP_MODE;
-	} else if (vif->type == NL80211_IFTYPE_ADHOC) {
-		bss->bss_type = WCN36XX_HAL_IBSS_MODE;
-
-		/* STA */
-		bss->oper_mode = 1;
-	} else {
-		wcn36xx_warn("Unknown type for bss config: %d\n", vif->type);
-	}
-
-	if (vif->type == NL80211_IFTYPE_STATION)
-		wcn36xx_smd_set_bss_nw_type(wcn, sta, bss);
-	else
-		bss->nw_type = WCN36XX_HAL_11N_NW_TYPE;
-
-	bss->short_slot_time_supported = vif->bss_conf.use_short_slot;
-	bss->lla_coexist = 0;
-	bss->llb_coexist = 0;
-	bss->llg_coexist = 0;
-	bss->rifs_mode = 0;
-	bss->beacon_interval = vif->bss_conf.beacon_int;
-	bss->dtim_period = vif_priv->dtim_period;
-
-	wcn36xx_smd_set_bss_ht_params(vif, sta, bss);
-
-	bss->oper_channel = WCN36XX_HW_CHANNEL(wcn);
-
-	if (conf_is_ht40_minus(&wcn->hw->conf))
-		bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
-	else if (conf_is_ht40_plus(&wcn->hw->conf))
-		bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
-	else
-		bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_NONE;
-
-	bss->reserved = 0;
-
-	/* wcn->ssid is only valid in AP and IBSS mode */
-	bss->ssid.length = vif_priv->ssid.length;
-	memcpy(bss->ssid.ssid, vif_priv->ssid.ssid, vif_priv->ssid.length);
-
-	bss->obss_prot_enabled = 0;
-	bss->rmf = 0;
-	bss->max_probe_resp_retry_limit = 0;
-	bss->hidden_ssid = vif->bss_conf.hidden_ssid;
-	bss->proxy_probe_resp = 0;
-	bss->edca_params_valid = 0;
-
-	/* FIXME: set acbe, acbk, acvi and acvo */
-
-	bss->ext_set_sta_key_param_valid = 0;
-
-	/* FIXME: set ext_set_sta_key_param */
-
-	bss->spectrum_mgt_enable = 0;
-	bss->tx_mgmt_power = 0;
-	bss->max_tx_power = WCN36XX_MAX_POWER(wcn);
-	bss->action = update;
-
-	vif_priv->bss_type = bss->bss_type;
-
+	wcn36xx_smd_set_bss_params(wcn, vif, sta, bssid, update, bss);
 	wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params);
 
 	wcn36xx_dbg(WCN36XX_DBG_HAL,
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 24/36] wcn36xx: Add wcn36xx_smd_config_bss_v0
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (22 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 23/36] wcn36xx: Move BSS parameter setup to wcn36xx_smd_set_bss_params() Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 25/36] wcn36xx: Update wcn36xx_smd_config_bss_v1() to operate internally Bryan O'Donoghue
                   ` (12 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

This commit adds wcn36xx_smd_config_bss_v0() as a step along the road of
functionally decomposing wcn36xx_smd_config_bss().

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 41 ++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 5fda63f79ca7..43021b13b5b0 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1584,6 +1584,47 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn,
 	return ret;
 }
 
+int wcn36xx_smd_config_bss_v0(struct wcn36xx *wcn, struct ieee80211_vif *vif,
+			      struct ieee80211_sta *sta, const u8 *bssid,
+			      bool update)
+{
+	struct wcn36xx_hal_config_bss_req_msg *msg;
+	struct wcn36xx_hal_config_bss_params *bss;
+	struct wcn36xx_hal_config_sta_params *sta_params;
+	int ret;
+
+	msg = kzalloc(sizeof(*msg), GFP_KERNEL);
+	if (!msg)
+		return -ENOMEM;
+
+	INIT_HAL_MSG((*msg), WCN36XX_HAL_CONFIG_BSS_REQ);
+
+	bss = &msg->bss_params;
+	sta_params = &bss->sta;
+
+	wcn36xx_smd_set_bss_params(wcn, vif, sta, bssid, update, bss);
+	wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params);
+
+	PREPARE_HAL_BUF(wcn->hal_buf, (*msg));
+
+	wcn36xx_dbg(WCN36XX_DBG_HAL,
+		    "hal config bss bssid %pM self_mac_addr %pM bss_type %d oper_mode %d nw_type %d\n",
+		    bss->bssid, bss->self_mac_addr, bss->bss_type,
+		    bss->oper_mode, bss->nw_type);
+
+	wcn36xx_dbg(WCN36XX_DBG_HAL,
+		    "- sta bssid %pM action %d sta_index %d bssid_index %d aid %d type %d mac %pM\n",
+		    sta_params->bssid, sta_params->action,
+		    sta_params->sta_index, sta_params->bssid_index,
+		    sta_params->aid, sta_params->type,
+		    sta_params->mac);
+
+	ret = wcn36xx_smd_send_and_wait(wcn, msg->header.len);
+	kfree(msg);
+
+	return ret;
+}
+
 static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn,
 				      struct ieee80211_vif *vif,
 				      struct ieee80211_sta *sta,
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 25/36] wcn36xx: Update wcn36xx_smd_config_bss_v1() to operate internally
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (23 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 24/36] wcn36xx: Add wcn36xx_smd_config_bss_v0 Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 26/36] wcn36xx: Convert to using wcn36xx_smd_config_bss_v0() Bryan O'Donoghue
                   ` (11 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

This patch updates wcn36xx_smd_config_bss_v1() to update on internally
derived parameters only, specifically making use of STA v1 wrapper routines
previously added.

Once done we no longer need to pass a struct wcn36xx_hal_config_bss_req_msg
which gives us options in later patches to eliminate the kzalloc() in
wcn36xx_smd_config_bss entirely.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 115 +++++++++++++------------
 1 file changed, 59 insertions(+), 56 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 43021b13b5b0..50559871d109 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1477,11 +1477,13 @@ static void wcn36xx_smd_set_bss_params(struct wcn36xx *wcn,
 	vif_priv->bss_type = bss->bss_type;
 }
 
-static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn,
-			const struct wcn36xx_hal_config_bss_req_msg *orig)
+int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, struct ieee80211_vif *vif,
+			      struct ieee80211_sta *sta_80211, const u8 *bssid,
+			      bool update)
 {
 	struct wcn36xx_hal_config_bss_req_msg_v1 *msg_body;
 	struct wcn36xx_hal_config_bss_params_v1 *bss;
+	struct wcn36xx_hal_config_bss_params bss_v0;
 	struct wcn36xx_hal_config_sta_params_v1 *sta;
 	int ret;
 
@@ -1499,72 +1501,73 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn,
 	bss = &msg_body->bss_params;
 	sta = &bss->sta;
 
+	wcn36xx_smd_set_bss_params(wcn, vif, sta_80211, bssid, update, &bss_v0);
+	wcn36xx_smd_set_sta_params_v1(wcn, vif, sta_80211, sta);
+
 	/* convert orig to v1 */
-	memcpy(bss->bssid, &orig->bss_params.bssid, ETH_ALEN);
-	memcpy(bss->self_mac_addr, &orig->bss_params.self_mac_addr, ETH_ALEN);
+	memcpy(bss->bssid, &bss_v0.bssid, ETH_ALEN);
+	memcpy(bss->self_mac_addr, &bss_v0.self_mac_addr, ETH_ALEN);
 
-	bss->bss_type = orig->bss_params.bss_type;
-	bss->oper_mode = orig->bss_params.oper_mode;
-	bss->nw_type = orig->bss_params.nw_type;
+	bss->bss_type = bss_v0.bss_type;
+	bss->oper_mode = bss_v0.oper_mode;
+	bss->nw_type = bss_v0.nw_type;
 
 	bss->short_slot_time_supported =
-		orig->bss_params.short_slot_time_supported;
-	bss->lla_coexist = orig->bss_params.lla_coexist;
-	bss->llb_coexist = orig->bss_params.llb_coexist;
-	bss->llg_coexist = orig->bss_params.llg_coexist;
-	bss->ht20_coexist = orig->bss_params.ht20_coexist;
-	bss->lln_non_gf_coexist = orig->bss_params.lln_non_gf_coexist;
+		bss_v0.short_slot_time_supported;
+	bss->lla_coexist = bss_v0.lla_coexist;
+	bss->llb_coexist = bss_v0.llb_coexist;
+	bss->llg_coexist = bss_v0.llg_coexist;
+	bss->ht20_coexist = bss_v0.ht20_coexist;
+	bss->lln_non_gf_coexist = bss_v0.lln_non_gf_coexist;
 
 	bss->lsig_tx_op_protection_full_support =
-		orig->bss_params.lsig_tx_op_protection_full_support;
-	bss->rifs_mode = orig->bss_params.rifs_mode;
-	bss->beacon_interval = orig->bss_params.beacon_interval;
-	bss->dtim_period = orig->bss_params.dtim_period;
-	bss->tx_channel_width_set = orig->bss_params.tx_channel_width_set;
-	bss->oper_channel = orig->bss_params.oper_channel;
-	bss->ext_channel = orig->bss_params.ext_channel;
-
-	bss->reserved = orig->bss_params.reserved;
-
-	memcpy(&bss->ssid, &orig->bss_params.ssid,
-	       sizeof(orig->bss_params.ssid));
-
-	bss->action = orig->bss_params.action;
-	bss->rateset = orig->bss_params.rateset;
-	bss->ht = orig->bss_params.ht;
-	bss->obss_prot_enabled = orig->bss_params.obss_prot_enabled;
-	bss->rmf = orig->bss_params.rmf;
-	bss->ht_oper_mode = orig->bss_params.ht_oper_mode;
-	bss->dual_cts_protection = orig->bss_params.dual_cts_protection;
+		bss_v0.lsig_tx_op_protection_full_support;
+	bss->rifs_mode = bss_v0.rifs_mode;
+	bss->beacon_interval = bss_v0.beacon_interval;
+	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;
+
+	bss->reserved = bss_v0.reserved;
+
+	memcpy(&bss->ssid, &bss_v0.ssid,
+	       sizeof(bss_v0.ssid));
+
+	bss->action = bss_v0.action;
+	bss->rateset = bss_v0.rateset;
+	bss->ht = bss_v0.ht;
+	bss->obss_prot_enabled = bss_v0.obss_prot_enabled;
+	bss->rmf = bss_v0.rmf;
+	bss->ht_oper_mode = bss_v0.ht_oper_mode;
+	bss->dual_cts_protection = bss_v0.dual_cts_protection;
 
 	bss->max_probe_resp_retry_limit =
-		orig->bss_params.max_probe_resp_retry_limit;
-	bss->hidden_ssid = orig->bss_params.hidden_ssid;
-	bss->proxy_probe_resp =	orig->bss_params.proxy_probe_resp;
-	bss->edca_params_valid = orig->bss_params.edca_params_valid;
-
-	memcpy(&bss->acbe, &orig->bss_params.acbe,
-	       sizeof(orig->bss_params.acbe));
-	memcpy(&bss->acbk, &orig->bss_params.acbk,
-	       sizeof(orig->bss_params.acbk));
-	memcpy(&bss->acvi, &orig->bss_params.acvi,
-	       sizeof(orig->bss_params.acvi));
-	memcpy(&bss->acvo, &orig->bss_params.acvo,
-	       sizeof(orig->bss_params.acvo));
+		bss_v0.max_probe_resp_retry_limit;
+	bss->hidden_ssid = bss_v0.hidden_ssid;
+	bss->proxy_probe_resp =	bss_v0.proxy_probe_resp;
+	bss->edca_params_valid = bss_v0.edca_params_valid;
+
+	memcpy(&bss->acbe, &bss_v0.acbe,
+	       sizeof(bss_v0.acbe));
+	memcpy(&bss->acbk, &bss_v0.acbk,
+	       sizeof(bss_v0.acbk));
+	memcpy(&bss->acvi, &bss_v0.acvi,
+	       sizeof(bss_v0.acvi));
+	memcpy(&bss->acvo, &bss_v0.acvo,
+	       sizeof(bss_v0.acvo));
 
 	bss->ext_set_sta_key_param_valid =
-		orig->bss_params.ext_set_sta_key_param_valid;
+		bss_v0.ext_set_sta_key_param_valid;
 
 	memcpy(&bss->ext_set_sta_key_param,
-	       &orig->bss_params.ext_set_sta_key_param,
-	       sizeof(orig->bss_params.acvo));
-
-	bss->wcn36xx_hal_persona = orig->bss_params.wcn36xx_hal_persona;
-	bss->spectrum_mgt_enable = orig->bss_params.spectrum_mgt_enable;
-	bss->tx_mgmt_power = orig->bss_params.tx_mgmt_power;
-	bss->max_tx_power = orig->bss_params.max_tx_power;
+	       &bss_v0.ext_set_sta_key_param,
+	       sizeof(bss_v0.acvo));
 
-	wcn36xx_smd_convert_sta_to_v1(wcn, &orig->bss_params.sta, sta);
+	bss->wcn36xx_hal_persona = bss_v0.wcn36xx_hal_persona;
+	bss->spectrum_mgt_enable = bss_v0.spectrum_mgt_enable;
+	bss->tx_mgmt_power = bss_v0.tx_mgmt_power;
+	bss->max_tx_power = bss_v0.max_tx_power;
 
 	PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body));
 
@@ -1705,7 +1708,7 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 		    sta_params->mac);
 
 	if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) {
-		ret = wcn36xx_smd_config_bss_v1(wcn, msg);
+		ret = wcn36xx_smd_config_bss_v1(wcn, vif, sta, bssid, update);
 	} else {
 		PREPARE_HAL_BUF(wcn->hal_buf, (*msg));
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 26/36] wcn36xx: Convert to using wcn36xx_smd_config_bss_v0()
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (24 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 25/36] wcn36xx: Update wcn36xx_smd_config_bss_v1() to operate internally Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 27/36] wcn36xx: Remove dead code in wcn36xx_smd_config_bss() Bryan O'Donoghue
                   ` (10 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

A previous patch added wcn36xx_smd_config_bss_v0() this patch converts the
version 0 data-path in wcn36xx_smd_config_bss() to use
wcn36xx_smd_config_bss_v0().

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 50559871d109..033afe52dd9c 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1710,9 +1710,7 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 	if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) {
 		ret = wcn36xx_smd_config_bss_v1(wcn, vif, sta, bssid, update);
 	} else {
-		PREPARE_HAL_BUF(wcn->hal_buf, (*msg));
-
-		ret = wcn36xx_smd_send_and_wait(wcn, msg->header.len);
+		ret = wcn36xx_smd_config_bss_v0(wcn, vif, sta, bssid, update);
 	}
 	if (ret) {
 		wcn36xx_err("Sending hal_config_bss failed\n");
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 27/36] wcn36xx: Remove dead code in wcn36xx_smd_config_bss()
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (25 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 26/36] wcn36xx: Convert to using wcn36xx_smd_config_bss_v0() Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 28/36] wcn36xx: Latch VHT specific BSS parameters to firmware Bryan O'Donoghue
                   ` (9 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

wcn36xx_smd_config_bss_v0() and wcn36xx_smd_config_bss_v1() have been
designed to operate in standalone fashion. As a result we can drop the
dead code now present in wcn36xx_smd_config_bss() and happily remove one
kzalloc from the BSS config path as we do so.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 39 ++++----------------------
 1 file changed, 5 insertions(+), 34 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 033afe52dd9c..1eb13765e1f2 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1676,42 +1676,15 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 			   struct ieee80211_sta *sta, const u8 *bssid,
 			   bool update)
 {
-	struct wcn36xx_hal_config_bss_req_msg *msg;
-	struct wcn36xx_hal_config_bss_params *bss;
-	struct wcn36xx_hal_config_sta_params *sta_params;
 	int ret;
 
 	mutex_lock(&wcn->hal_mutex);
-	msg = kzalloc(sizeof(*msg), GFP_KERNEL);
-	if (!msg) {
-		ret = -ENOMEM;
-		goto out;
-	}
-	INIT_HAL_MSG((*msg), WCN36XX_HAL_CONFIG_BSS_REQ);
-
-	bss = &msg->bss_params;
-	sta_params = &bss->sta;
-
-	wcn36xx_smd_set_bss_params(wcn, vif, sta, bssid, update, bss);
-	wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params);
-
-	wcn36xx_dbg(WCN36XX_DBG_HAL,
-		    "hal config bss bssid %pM self_mac_addr %pM bss_type %d oper_mode %d nw_type %d\n",
-		    bss->bssid, bss->self_mac_addr, bss->bss_type,
-		    bss->oper_mode, bss->nw_type);
 
-	wcn36xx_dbg(WCN36XX_DBG_HAL,
-		    "- sta bssid %pM action %d sta_index %d bssid_index %d aid %d type %d mac %pM\n",
-		    sta_params->bssid, sta_params->action,
-		    sta_params->sta_index, sta_params->bssid_index,
-		    sta_params->aid, sta_params->type,
-		    sta_params->mac);
-
-	if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) {
+	if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24))
 		ret = wcn36xx_smd_config_bss_v1(wcn, vif, sta, bssid, update);
-	} else {
+	else
 		ret = wcn36xx_smd_config_bss_v0(wcn, vif, sta, bssid, update);
-	}
+
 	if (ret) {
 		wcn36xx_err("Sending hal_config_bss failed\n");
 		goto out;
@@ -1721,12 +1694,10 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 					 sta,
 					 wcn->hal_buf,
 					 wcn->hal_rsp_len);
-	if (ret) {
+	if (ret)
 		wcn36xx_err("hal_config_bss response failed err=%d\n", ret);
-		goto out;
-	}
+
 out:
-	kfree(msg);
 	mutex_unlock(&wcn->hal_mutex);
 	return ret;
 }
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 28/36] wcn36xx: Latch VHT specific BSS parameters to firmware
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (26 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 27/36] wcn36xx: Remove dead code in wcn36xx_smd_config_bss() Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 29/36] wcn36xx: Add accessor macro HW_VALUE_CHANNEL for hardware channels Bryan O'Donoghue
                   ` (8 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

This commit makes use of wcn36xx_smd_set_bss_vht_params() to extract VHT
parameters from the 80211_sta structure and latch appropriate bits in the
bss_params_v1 structure for transmission to the wcnss firmware.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 1eb13765e1f2..cedf4391a69a 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1569,6 +1569,8 @@ int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 	bss->tx_mgmt_power = bss_v0.tx_mgmt_power;
 	bss->max_tx_power = bss_v0.max_tx_power;
 
+	wcn36xx_smd_set_bss_vht_params(vif, sta_80211, bss);
+
 	PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body));
 
 	wcn36xx_dbg(WCN36XX_DBG_HAL,
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 29/36] wcn36xx: Add accessor macro HW_VALUE_CHANNEL for hardware channels
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (27 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 28/36] wcn36xx: Latch VHT specific BSS parameters to firmware Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 30/36] wcn36xx: Use HW_VALUE_CHANNEL macro to get channel number Bryan O'Donoghue
                   ` (7 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

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 18ccc6c31a38..ae8bda76d573 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] 41+ messages in thread

* [PATCH 30/36] wcn36xx: Use HW_VALUE_CHANNEL macro to get channel number
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (28 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 29/36] wcn36xx: Add accessor macro HW_VALUE_CHANNEL for hardware channels Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 31/36] wcn36xx: Add accessor macro HW_VALUE_PHY for PHY settings Bryan O'Donoghue
                   ` (6 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

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 cedf4391a69a..9a7e6f96f0b6 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -758,8 +758,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] 41+ messages in thread

* [PATCH 31/36] wcn36xx: Add accessor macro HW_VALUE_PHY for PHY settings
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (29 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 30/36] wcn36xx: Use HW_VALUE_CHANNEL macro to get channel number Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 32/36] wcn36xx: Encode PHY mode for 80MHz channel in hw_value Bryan O'Donoghue
                   ` (5 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

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 ae8bda76d573..38d68161d9fd 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] 41+ messages in thread

* [PATCH 32/36] wcn36xx: Encode PHY mode for 80MHz channel in hw_value
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (30 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 31/36] wcn36xx: Add accessor macro HW_VALUE_PHY for PHY settings Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 33/36] wcn36xx: Set PHY into correct mode for 80MHz channel width Bryan O'Donoghue
                   ` (4 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

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 6a85bb699d10..c96ae33a80d5 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] 41+ messages in thread

* [PATCH 33/36] wcn36xx: Set PHY into correct mode for 80MHz channel width
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (31 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 32/36] wcn36xx: Encode PHY mode for 80MHz channel in hw_value Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 34/36] wcn36xx: Extend HAL param config list Bryan O'Donoghue
                   ` (3 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

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 9a7e6f96f0b6..527da56a1386 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1487,6 +1487,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);
@@ -1529,7 +1530,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] 41+ messages in thread

* [PATCH 34/36] wcn36xx: Extend HAL param config list
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (32 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 33/36] wcn36xx: Set PHY into correct mode for 80MHz channel width Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 35/36] wcn36xx: Define wcn3680 specific firmware parameters Bryan O'Donoghue
                   ` (2 subsequent siblings)
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

In order to get 802.11ac working the way we want, additional parameters
need to be passed down to the firmware.

This patch takes the full remaining set of parameters defined in the
downstream riva/inc/wlan_hal_cfg.h and imports them into hal.h with some
minor name length adjustments.

This addition will allow us to pass a larger firmware configuration set
later on.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/hal.h | 124 ++++++++++++++++++++++++-
 1 file changed, 123 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h
index 10ce05110d11..35b72b1b9bbf 100644
--- a/drivers/net/wireless/ath/wcn36xx/hal.h
+++ b/drivers/net/wireless/ath/wcn36xx/hal.h
@@ -726,7 +726,129 @@ enum pe_stats_mask {
 #define WCN36XX_HAL_CFG_AP_LINK_MONITOR_TIMEOUT		102
 #define WCN36XX_HAL_CFG_BTC_DWELL_TIME_MULTIPLIER	103
 #define WCN36XX_HAL_CFG_ENABLE_TDLS_OXYGEN_MODE		104
-#define WCN36XX_HAL_CFG_MAX_PARAMS			105
+#define WCN36XX_HAL_CFG_ENABLE_NAT_KEEP_ALIVE_FILTER	105
+#define WCN36XX_HAL_CFG_ENABLE_SAP_OBSS_PROT		106
+#define WCN36XX_HAL_CFG_PSPOLL_DATA_RECEP_TIMEOUT	107
+#define WCN36XX_HAL_CFG_TDLS_PUAPSD_BUFFER_STA_CAPABLE	108
+#define WCN36XX_HAL_CFG_TDLS_PUAPSD_MASK		109
+#define WCN36XX_HAL_CFG_TDLS_PUAPSD_INACTIVITY_TIME	110
+#define WCN36XX_HAL_CFG_TDLS_PUAPSD_RX_FRAME_THRESHOLD	111
+#define WCN36XX_HAL_CFG_ANTENNA_DIVERSITY		112
+#define WCN36XX_HAL_CFG_ATH_DISABLE			113
+#define WCN36XX_HAL_CFG_FLEXCONNECT_POWER_FACTOR	114
+#define WCN36XX_HAL_CFG_ENABLE_ADAPTIVE_RX_DRAIN	115
+#define WCN36XX_HAL_CFG_TDLS_OFF_CHANNEL_CAPABLE	116
+#define WCN36XX_HAL_CFG_MWS_COEX_V1_WAN_FREQ		117
+#define WCN36XX_HAL_CFG_MWS_COEX_V1_WLAN_FREQ		118
+#define WCN36XX_HAL_CFG_MWS_COEX_V1_CONFIG		119
+#define WCN36XX_HAL_CFG_MWS_COEX_V1_CONFIG2		120
+#define WCN36XX_HAL_CFG_MWS_COEX_V2_WAN_FREQ		121
+#define WCN36XX_HAL_CFG_MWS_COEX_V2_WLAN_FREQ		122
+#define WCN36XX_HAL_CFG_MWS_COEX_V2_CONFIG		123
+#define WCN36XX_HAL_CFG_MWS_COEX_V2_CONFIG2		124
+#define WCN36XX_HAL_CFG_MWS_COEX_V3_WAN_FREQ		125
+#define WCN36XX_HAL_CFG_MWS_COEX_V3_WLAN_FREQ		126
+#define WCN36XX_HAL_CFG_MWS_COEX_V3_CONFIG		127
+#define WCN36XX_HAL_CFG_MWS_COEX_V3_CONFIG2		128
+#define WCN36XX_HAL_CFG_MWS_COEX_V4_WAN_FREQ		129
+#define WCN36XX_HAL_CFG_MWS_COEX_V4_WLAN_FREQ		130
+#define WCN36XX_HAL_CFG_MWS_COEX_V4_CONFIG		131
+#define WCN36XX_HAL_CFG_MWS_COEX_V4_CONFIG2		132
+#define WCN36XX_HAL_CFG_MWS_COEX_V5_WAN_FREQ		133
+#define WCN36XX_HAL_CFG_MWS_COEX_V5_WLAN_FREQ		134
+#define WCN36XX_HAL_CFG_MWS_COEX_V5_CONFIG		135
+#define WCN36XX_HAL_CFG_MWS_COEX_V5_CONFIG2		136
+#define WCN36XX_HAL_CFG_MWS_COEX_V6_WAN_FREQ		137
+#define WCN36XX_HAL_CFG_MWS_COEX_V6_WLAN_FREQ		138
+#define WCN36XX_HAL_CFG_MWS_COEX_V6_CONFIG		139
+#define WCN36XX_HAL_CFG_MWS_COEX_V6_CONFIG2		140
+#define WCN36XX_HAL_CFG_MWS_COEX_V7_WAN_FREQ		141
+#define WCN36XX_HAL_CFG_MWS_COEX_V7_WLAN_FREQ		142
+#define WCN36XX_HAL_CFG_MWS_COEX_V7_CONFIG		143
+#define WCN36XX_HAL_CFG_MWS_COEX_V7_CONFIG2		144
+#define WCN36XX_HAL_CFG_MWS_COEX_V8_WAN_FREQ		145
+#define WCN36XX_HAL_CFG_MWS_COEX_V8_WLAN_FREQ		146
+#define WCN36XX_HAL_CFG_MWS_COEX_V8_CONFIG		147
+#define WCN36XX_HAL_CFG_MWS_COEX_V8_CONFIG2		148
+#define WCN36XX_HAL_CFG_MWS_COEX_V9_WAN_FREQ		149
+#define WCN36XX_HAL_CFG_MWS_COEX_V9_WLAN_FREQ		150
+#define WCN36XX_HAL_CFG_MWS_COEX_V9_CONFIG		151
+#define WCN36XX_HAL_CFG_MWS_COEX_V9_CONFIG2		152
+#define WCN36XX_HAL_CFG_MWS_COEX_V10_WAN_FREQ		153
+#define WCN36XX_HAL_CFG_MWS_COEX_V10_WLAN_FREQ		154
+#define WCN36XX_HAL_CFG_MWS_COEX_V10_CONFIG		155
+#define WCN36XX_HAL_CFG_MWS_COEX_V10_CONFIG2		156
+#define WCN36XX_HAL_CFG_MWS_COEX_MODEM_BACKOFF		157
+#define WCN36XX_HAL_CFG_MWS_COEX_CONFIG1		158
+#define WCN36XX_HAL_CFG_MWS_COEX_CONFIG2		159
+#define WCN36XX_HAL_CFG_MWS_COEX_CONFIG3		160
+#define WCN36XX_HAL_CFG_MWS_COEX_CONFIG4		161
+#define WCN36XX_HAL_CFG_MWS_COEX_CONFIG5		162
+#define WCN36XX_HAL_CFG_MWS_COEX_CONFIG6		163
+#define WCN36XX_HAL_CFG_SAR_POWER_BACKOFF		164
+#define WCN36XX_HAL_CFG_GO_LINK_MONITOR_TIMEOUT		165
+#define WCN36XX_HAL_CFG_BTC_STATIC_OPP_WLAN_ACTIVE_WLAN_LEN	166
+#define WCN36XX_HAL_CFG_BTC_STATIC_OPP_WLAN_ACTIVE_BT_LEN	167
+#define WCN36XX_HAL_CFG_BTC_SAP_STATIC_OPP_ACTIVE_WLAN_LEN	168
+#define WCN36XX_HAL_CFG_BTC_SAP_STATIC_OPP_ACTIVE_BT_LEN	169
+#define WCN36XX_HAL_CFG_RMC_FIXED_RATE			170
+#define WCN36XX_HAL_CFG_ASD_PROBE_INTERVAL		171
+#define WCN36XX_HAL_CFG_ASD_TRIGGER_THRESHOLD		172
+#define WCN36XX_HAL_CFG_ASD_RTT_RSSI_HYST_THRESHOLD	173
+#define WCN36XX_HAL_CFG_BTC_CTS2S_ON_STA_DURING_SCO	174
+#define WCN36XX_HAL_CFG_SHORT_PREAMBLE			175
+#define WCN36XX_HAL_CFG_SHORT_SLOT_TIME			176
+#define WCN36XX_HAL_CFG_DELAYED_BA			177
+#define WCN36XX_HAL_CFG_IMMEDIATE_BA			178
+#define WCN36XX_HAL_CFG_DOT11_MODE			179
+#define WCN36XX_HAL_CFG_HT_CAPS				180
+#define WCN36XX_HAL_CFG_AMPDU_PARAMS			181
+#define WCN36XX_HAL_CFG_TX_BF_INFO			182
+#define WCN36XX_HAL_CFG_ASC_CAP_INFO			183
+#define WCN36XX_HAL_CFG_EXT_HT_CAPS			184
+#define WCN36XX_HAL_CFG_QOS_ENABLED			185
+#define WCN36XX_HAL_CFG_WME_ENABLED			186
+#define WCN36XX_HAL_CFG_WSM_ENABLED			187
+#define WCN36XX_HAL_CFG_WMM_ENABLED			188
+#define WCN36XX_HAL_CFG_UAPSD_PER_AC_BITMASK		189
+#define WCN36XX_HAL_CFG_MCS_RATES			190
+#define WCN36XX_HAL_CFG_VHT_CAPS			191
+#define WCN36XX_HAL_CFG_VHT_RX_SUPP_MCS			192
+#define WCN36XX_HAL_CFG_VHT_TX_SUPP_MCS			193
+#define WCN36XX_HAL_CFG_RA_FILTER_ENABLE		194
+#define WCN36XX_HAL_CFG_RA_RATE_LIMIT_INTERVAL		195
+#define WCN36XX_HAL_CFG_BTC_FATAL_HID_NSNIFF_BLK	196
+#define WCN36XX_HAL_CFG_BTC_CRITICAL_HID_NSNIFF_BLK	197
+#define WCN36XX_HAL_CFG_BTC_DYN_A2DP_TX_QUEUE_THOLD	198
+#define WCN36XX_HAL_CFG_BTC_DYN_OPP_TX_QUEUE_THOLD	199
+#define WCN36XX_HAL_CFG_LINK_FAIL_TIMEOUT		200
+#define WCN36XX_HAL_CFG_MAX_UAPSD_CONSEC_SP		201
+#define WCN36XX_HAL_CFG_MAX_UAPSD_CONSEC_RX_CNT		202
+#define WCN36XX_HAL_CFG_MAX_UAPSD_CONSEC_TX_CNT		203
+#define WCN36XX_HAL_CFG_MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW	204
+#define WCN36XX_HAL_CFG_MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW	205
+#define WCN36XX_HAL_CFG_MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE	206
+#define WCN36XX_HAL_CFG_MAX_UAPSD_INACTIVITY_INTERVALS	207
+#define WCN36XX_HAL_CFG_ENABLE_DYNAMIC_WMMPS		208
+#define WCN36XX_HAL_CFG_BURST_MODE_BE_TXOP_VALUE	209
+#define WCN36XX_HAL_CFG_ENABLE_DYNAMIC_RA_START_RATE	210
+#define WCN36XX_HAL_CFG_BTC_FAST_WLAN_CONN_PREF		211
+#define WCN36XX_HAL_CFG_ENABLE_RTSCTS_HTVHT		212
+#define WCN36XX_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN	213
+#define WCN36XX_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN	214
+#define WCN36XX_HAL_CFG_LINK_FAIL_TX_CNT		215
+#define WCN36XX_HAL_CFG_TOGGLE_ARP_BDRATES		216
+#define WCN36XX_HAL_CFG_OPTIMIZE_CA_EVENT		217
+#define WCN36XX_HAL_CFG_EXT_SCAN_CONC_MODE		218
+#define WCN36XX_HAL_CFG_BAR_WAKEUP_HOST_DISABLE		219
+#define WCN36XX_HAL_CFG_SAR_BOFFSET_CORRECTION_ENABLE	220
+#define WCN36XX_HAL_CFG_UNITS_OF_BCN_WAIT_TIME		221
+#define WCN36XX_HAL_CFG_CONS_BCNMISS_COUNT		222
+#define WCN36XX_HAL_CFG_BTC_DISABLE_WLAN_LINK_CRITICAL	223
+#define WCN36XX_HAL_CFG_DISABLE_SCAN_DURING_SCO		224
+#define WCN36XX_HAL_CFG_TRIGGER_NULLFRAME_BEFORE_HB	225
+#define WCN36XX_HAL_CFG_ENABLE_POWERSAVE_OFFLOAD	226
+#define WCN36XX_HAL_CFG_MAX_PARAMS			227
 
 /* Message definitons - All the messages below need to be packed */
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 35/36] wcn36xx: Define wcn3680 specific firmware parameters
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (33 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 34/36] wcn36xx: Extend HAL param config list Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-03  3:11 ` [PATCH 36/36] wcn36xx: Add ability to download " Bryan O'Donoghue
  2020-08-26 15:27 ` [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Kalle Valo
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

This commit defines a firmware configuration for the wcn3680 which
represents a working downstream configuration. This configuration has been
successfully applied to the upstream driver with antecedent patches
resulting in the same or better through-put in comparison to the
downstream driver on the test hardware.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 96 ++++++++++++++++++++++++++
 1 file changed, 96 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 527da56a1386..925d82dc0e88 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -79,6 +79,102 @@ static struct wcn36xx_cfg_val wcn36xx_cfg_vals[] = {
 	WCN36XX_CFG_VAL(ENABLE_MCC_ADAPTIVE_SCHEDULER, 0),
 };
 
+static struct wcn36xx_cfg_val wcn3680_cfg_vals[] = {
+	WCN36XX_CFG_VAL(CURRENT_TX_ANTENNA, 1),
+	WCN36XX_CFG_VAL(CURRENT_RX_ANTENNA, 1),
+	WCN36XX_CFG_VAL(LOW_GAIN_OVERRIDE, 0),
+	WCN36XX_CFG_VAL(POWER_STATE_PER_CHAIN, 785),
+	WCN36XX_CFG_VAL(CAL_PERIOD, 5),
+	WCN36XX_CFG_VAL(CAL_CONTROL, 1),
+	WCN36XX_CFG_VAL(PROXIMITY, 0),
+	WCN36XX_CFG_VAL(NETWORK_DENSITY, 3),
+	WCN36XX_CFG_VAL(MAX_MEDIUM_TIME, 4096),
+	WCN36XX_CFG_VAL(MAX_MPDUS_IN_AMPDU, 64),
+	WCN36XX_CFG_VAL(RTS_THRESHOLD, 2347),
+	WCN36XX_CFG_VAL(SHORT_RETRY_LIMIT, 15),
+	WCN36XX_CFG_VAL(LONG_RETRY_LIMIT, 15),
+	WCN36XX_CFG_VAL(FRAGMENTATION_THRESHOLD, 8000),
+	WCN36XX_CFG_VAL(DYNAMIC_THRESHOLD_ZERO, 5),
+	WCN36XX_CFG_VAL(DYNAMIC_THRESHOLD_ONE, 10),
+	WCN36XX_CFG_VAL(DYNAMIC_THRESHOLD_TWO, 15),
+	WCN36XX_CFG_VAL(FIXED_RATE, 0),
+	WCN36XX_CFG_VAL(RETRYRATE_POLICY, 4),
+	WCN36XX_CFG_VAL(RETRYRATE_SECONDARY, 0),
+	WCN36XX_CFG_VAL(RETRYRATE_TERTIARY, 0),
+	WCN36XX_CFG_VAL(FORCE_POLICY_PROTECTION, 5),
+	WCN36XX_CFG_VAL(FIXED_RATE_MULTICAST_24GHZ, 1),
+	WCN36XX_CFG_VAL(FIXED_RATE_MULTICAST_5GHZ, 5),
+	WCN36XX_CFG_VAL(DEFAULT_RATE_INDEX_24GHZ, 1),
+	WCN36XX_CFG_VAL(DEFAULT_RATE_INDEX_5GHZ, 5),
+	WCN36XX_CFG_VAL(MAX_BA_SESSIONS, 40),
+	WCN36XX_CFG_VAL(PS_DATA_INACTIVITY_TIMEOUT, 200),
+	WCN36XX_CFG_VAL(PS_ENABLE_BCN_FILTER, 1),
+	WCN36XX_CFG_VAL(PS_ENABLE_RSSI_MONITOR, 1),
+	WCN36XX_CFG_VAL(NUM_BEACON_PER_RSSI_AVERAGE, 20),
+	WCN36XX_CFG_VAL(STATS_PERIOD, 10),
+	WCN36XX_CFG_VAL(CFP_MAX_DURATION, 30000),
+	WCN36XX_CFG_VAL(FRAME_TRANS_ENABLED, 0),
+	WCN36XX_CFG_VAL(BA_THRESHOLD_HIGH, 128),
+	WCN36XX_CFG_VAL(MAX_BA_BUFFERS, 2560),
+	WCN36XX_CFG_VAL(DYNAMIC_PS_POLL_VALUE, 0),
+	WCN36XX_CFG_VAL(TX_PWR_CTRL_ENABLE, 1),
+	WCN36XX_CFG_VAL(ENABLE_CLOSE_LOOP, 1),
+	WCN36XX_CFG_VAL(ENABLE_LPWR_IMG_TRANSITION, 0),
+	WCN36XX_CFG_VAL(BTC_STATIC_LEN_LE_BT, 120000),
+	WCN36XX_CFG_VAL(BTC_STATIC_LEN_LE_WLAN, 30000),
+	WCN36XX_CFG_VAL(MAX_ASSOC_LIMIT, 10),
+	WCN36XX_CFG_VAL(ENABLE_MCC_ADAPTIVE_SCHEDULER, 0),
+	WCN36XX_CFG_VAL(TDLS_PUAPSD_MASK, 0),
+	WCN36XX_CFG_VAL(TDLS_PUAPSD_BUFFER_STA_CAPABLE, 1),
+	WCN36XX_CFG_VAL(TDLS_PUAPSD_INACTIVITY_TIME, 0),
+	WCN36XX_CFG_VAL(TDLS_PUAPSD_RX_FRAME_THRESHOLD, 10),
+	WCN36XX_CFG_VAL(TDLS_OFF_CHANNEL_CAPABLE, 1),
+	WCN36XX_CFG_VAL(ENABLE_ADAPTIVE_RX_DRAIN, 1),
+	WCN36XX_CFG_VAL(FLEXCONNECT_POWER_FACTOR, 0),
+	WCN36XX_CFG_VAL(ANTENNA_DIVERSITY, 3),
+	WCN36XX_CFG_VAL(ATH_DISABLE, 0),
+	WCN36XX_CFG_VAL(BTC_STATIC_OPP_WLAN_ACTIVE_WLAN_LEN, 60000),
+	WCN36XX_CFG_VAL(BTC_STATIC_OPP_WLAN_ACTIVE_BT_LEN, 90000),
+	WCN36XX_CFG_VAL(BTC_SAP_STATIC_OPP_ACTIVE_WLAN_LEN, 30000),
+	WCN36XX_CFG_VAL(BTC_SAP_STATIC_OPP_ACTIVE_BT_LEN, 30000),
+	WCN36XX_CFG_VAL(ASD_PROBE_INTERVAL, 50),
+	WCN36XX_CFG_VAL(ASD_TRIGGER_THRESHOLD, -60),
+	WCN36XX_CFG_VAL(ASD_RTT_RSSI_HYST_THRESHOLD, 3),
+	WCN36XX_CFG_VAL(BTC_CTS2S_ON_STA_DURING_SCO, 0),
+	WCN36XX_CFG_VAL(RA_FILTER_ENABLE, 0),
+	WCN36XX_CFG_VAL(RA_RATE_LIMIT_INTERVAL, 60),
+	WCN36XX_CFG_VAL(BTC_FATAL_HID_NSNIFF_BLK, 2),
+	WCN36XX_CFG_VAL(BTC_CRITICAL_HID_NSNIFF_BLK, 1),
+	WCN36XX_CFG_VAL(BTC_DYN_A2DP_TX_QUEUE_THOLD, 0),
+	WCN36XX_CFG_VAL(BTC_DYN_OPP_TX_QUEUE_THOLD, 1),
+	WCN36XX_CFG_VAL(MAX_UAPSD_CONSEC_SP, 10),
+	WCN36XX_CFG_VAL(MAX_UAPSD_CONSEC_RX_CNT, 50),
+	WCN36XX_CFG_VAL(MAX_UAPSD_CONSEC_TX_CNT, 50),
+	WCN36XX_CFG_VAL(MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW, 500),
+	WCN36XX_CFG_VAL(MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW, 500),
+	WCN36XX_CFG_VAL(MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE, 0),
+	WCN36XX_CFG_VAL(MAX_UAPSD_INACTIVITY_INTERVALS, 10),
+	WCN36XX_CFG_VAL(ENABLE_DYNAMIC_WMMPS, 1),
+	WCN36XX_CFG_VAL(BURST_MODE_BE_TXOP_VALUE, 0),
+	WCN36XX_CFG_VAL(ENABLE_DYNAMIC_RA_START_RATE, 0),
+	WCN36XX_CFG_VAL(BTC_FAST_WLAN_CONN_PREF, 1),
+	WCN36XX_CFG_VAL(ENABLE_RTSCTS_HTVHT, 0),
+	WCN36XX_CFG_VAL(BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN, 30000),
+	WCN36XX_CFG_VAL(BTC_STATIC_OPP_WLAN_IDLE_BT_LEN, 120000),
+	WCN36XX_CFG_VAL(LINK_FAIL_TX_CNT, 200),
+	WCN36XX_CFG_VAL(TOGGLE_ARP_BDRATES, 0),
+	WCN36XX_CFG_VAL(OPTIMIZE_CA_EVENT, 0),
+	WCN36XX_CFG_VAL(EXT_SCAN_CONC_MODE, 0),
+	WCN36XX_CFG_VAL(BAR_WAKEUP_HOST_DISABLE, 0),
+	WCN36XX_CFG_VAL(SAR_BOFFSET_CORRECTION_ENABLE, 0),
+	WCN36XX_CFG_VAL(BTC_DISABLE_WLAN_LINK_CRITICAL, 5),
+	WCN36XX_CFG_VAL(DISABLE_SCAN_DURING_SCO, 2),
+	WCN36XX_CFG_VAL(CONS_BCNMISS_COUNT, 0),
+	WCN36XX_CFG_VAL(UNITS_OF_BCN_WAIT_TIME, 0),
+	WCN36XX_CFG_VAL(TRIGGER_NULLFRAME_BEFORE_HB, 0),
+	WCN36XX_CFG_VAL(ENABLE_POWERSAVE_OFFLOAD, 0),
+};
+
 static int put_cfg_tlv_u32(struct wcn36xx *wcn, size_t *len, u32 id, u32 value)
 {
 	struct wcn36xx_hal_cfg *entry;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 36/36] wcn36xx: Add ability to download wcn3680 specific firmware parameters
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (34 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 35/36] wcn36xx: Define wcn3680 specific firmware parameters Bryan O'Donoghue
@ 2020-08-03  3:11 ` Bryan O'Donoghue
  2020-08-26 15:27 ` [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Kalle Valo
  36 siblings, 0 replies; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-03  3:11 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

This commit modifies wcn36xx_smd_start() so that it can download wcn3680
specific firmware parameters if we are talking to the wcn3680. If not the
original generic firmware parameter table should continue to be used for
wcn3620 and wcn3660.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 925d82dc0e88..542c5d160ebe 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -610,6 +610,8 @@ int wcn36xx_smd_start(struct wcn36xx *wcn)
 	int ret;
 	int i;
 	size_t len;
+	int cfg_elements;
+	static struct wcn36xx_cfg_val *cfg_vals;
 
 	mutex_lock(&wcn->hal_mutex);
 	INIT_HAL_MSG(msg_body, WCN36XX_HAL_START_REQ);
@@ -622,9 +624,17 @@ int wcn36xx_smd_start(struct wcn36xx *wcn)
 	body = (struct wcn36xx_hal_mac_start_req_msg *)wcn->hal_buf;
 	len = body->header.len;
 
-	for (i = 0; i < ARRAY_SIZE(wcn36xx_cfg_vals); i++) {
-		ret = put_cfg_tlv_u32(wcn, &len, wcn36xx_cfg_vals[i].cfg_id,
-				      wcn36xx_cfg_vals[i].value);
+	if (wcn->rf_id == RF_IRIS_WCN3680) {
+		cfg_vals = wcn3680_cfg_vals;
+		cfg_elements = ARRAY_SIZE(wcn3680_cfg_vals);
+	} else {
+		cfg_vals = wcn36xx_cfg_vals;
+		cfg_elements = ARRAY_SIZE(wcn36xx_cfg_vals);
+	}
+
+	for (i = 0; i < cfg_elements; i++) {
+		ret = put_cfg_tlv_u32(wcn, &len, cfg_vals[i].cfg_id,
+				      cfg_vals[i].value);
 		if (ret)
 			goto out;
 	}
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* Re: [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac
  2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
                   ` (35 preceding siblings ...)
  2020-08-03  3:11 ` [PATCH 36/36] wcn36xx: Add ability to download " Bryan O'Donoghue
@ 2020-08-26 15:27 ` Kalle Valo
  2020-08-26 16:17   ` Bryan O'Donoghue
  36 siblings, 1 reply; 41+ messages in thread
From: Kalle Valo @ 2020-08-26 15:27 UTC (permalink / raw)
  To: Bryan O'Donoghue; +Cc: wcn36xx, linux-wireless, shawn.guo

Bryan O'Donoghue <bryan.odonoghue@linaro.org> writes:

> This series adds support for the 802.11ac data-rates available on the WCN3680.

To review 36 patches is just too much, so I'm going to take this in
smaller pieces.

In the future please limit the patchset size:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#maximum_of_7-12_patches_per_patchset

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 01/36] wcn36xx: Add ability to identify WCN3680
  2020-08-03  3:10 ` [PATCH 01/36] wcn36xx: Add ability to identify WCN3680 Bryan O'Donoghue
@ 2020-08-26 15:28   ` Kalle Valo
  0 siblings, 0 replies; 41+ messages in thread
From: Kalle Valo @ 2020-08-26 15:28 UTC (permalink / raw)
  To: Bryan O'Donoghue; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, shawn.guo

Bryan O'Donoghue <bryan.odonoghue@linaro.org> wrote:

> The WCN3680 has some specific behaviours that we want to capture to
> distinguish it from the WCN3620 and WCN3660 respectively.
> 
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>

First 8 patches already failed to apply:

error: patch failed: drivers/net/wireless/ath/wcn36xx/txrx.c:272
error: drivers/net/wireless/ath/wcn36xx/txrx.c: patch does not apply
stg import: Diff does not apply cleanly

8 patches set to Changes Requested.

11696999 [01/36] wcn36xx: Add ability to identify WCN3680
11697001 [02/36] wcn36xx: Add ieee802.11 VHT flags
11697003 [03/36] wcn36xx: Add 802.11ac MCS rates
11697005 [04/36] wcn36xx: Specify ieee80211_rx_status.nss
11697007 [05/36] wcn36xx: Add 802.11ac HAL param bitfields
11697009 [06/36] wcn36xx: Add Supported rates V1 structure
11697011 [07/36] wcn36xx: Use existing pointers in wcn36xx_smd_config_bss_v1
11697013 [08/36] wcn36xx: Set feature DOT11AC for wcn3680

-- 
https://patchwork.kernel.org/patch/11696999/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac
  2020-08-26 15:27 ` [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Kalle Valo
@ 2020-08-26 16:17   ` Bryan O'Donoghue
  2020-08-27  8:06     ` Kalle Valo
  0 siblings, 1 reply; 41+ messages in thread
From: Bryan O'Donoghue @ 2020-08-26 16:17 UTC (permalink / raw)
  To: Kalle Valo; +Cc: wcn36xx, linux-wireless, shawn.guo

On 26/08/2020 16:27, Kalle Valo wrote:
> Bryan O'Donoghue <bryan.odonoghue@linaro.org> writes:
> 
>> This series adds support for the 802.11ac data-rates available on the WCN3680.
> 
> To review 36 patches is just too much, so I'm going to take this in
> smaller pieces.
> 
> In the future please limit the patchset size:
> 
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#maximum_of_7-12_patches_per_patchset
> 

OK, I will break this up into groups of 8-10 patches on the rebase.

---
bod

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac
  2020-08-26 16:17   ` Bryan O'Donoghue
@ 2020-08-27  8:06     ` Kalle Valo
  0 siblings, 0 replies; 41+ messages in thread
From: Kalle Valo @ 2020-08-27  8:06 UTC (permalink / raw)
  To: Bryan O'Donoghue; +Cc: wcn36xx, linux-wireless, shawn.guo

Bryan O'Donoghue <bryan.odonoghue@linaro.org> writes:

> On 26/08/2020 16:27, Kalle Valo wrote:
>> Bryan O'Donoghue <bryan.odonoghue@linaro.org> writes:
>>
>>> This series adds support for the 802.11ac data-rates available on the WCN3680.
>>
>> To review 36 patches is just too much, so I'm going to take this in
>> smaller pieces.
>>
>> In the future please limit the patchset size:
>>
>> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#maximum_of_7-12_patches_per_patchset
>>
>
> OK, I will break this up into groups of 8-10 patches on the rebase.

Great, thanks.

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2020-08-27  8:06 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-03  3:10 [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Bryan O'Donoghue
2020-08-03  3:10 ` [PATCH 01/36] wcn36xx: Add ability to identify WCN3680 Bryan O'Donoghue
2020-08-26 15:28   ` Kalle Valo
2020-08-03  3:10 ` [PATCH 02/36] wcn36xx: Add ieee802.11 VHT flags Bryan O'Donoghue
2020-08-03  3:10 ` [PATCH 03/36] wcn36xx: Add 802.11ac MCS rates Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 04/36] wcn36xx: Specify ieee80211_rx_status.nss Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 05/36] wcn36xx: Add 802.11ac HAL param bitfields Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 06/36] wcn36xx: Add Supported rates V1 structure Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 07/36] wcn36xx: Use existing pointers in wcn36xx_smd_config_bss_v1 Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 08/36] wcn36xx: Set feature DOT11AC for wcn3680 Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 09/36] wcn36xx: Add VHT fields to parameter data structures Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 10/36] wcn36xx: Use V1 data structure to store supported rates Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 11/36] wcn36xx: Add wcn36xx_set_default_rates_v1 Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 12/36] wcn36xx: Add VHT rates to wcn36xx_update_allowed_rates() Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 13/36] wcn36xx: Add wcn36xx_smd_set_sta_default_vht_params() Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 14/36] wcn36xx: Add wcn36xx_smd_set_sta_default_ht_ldpc_params() Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 15/36] wcn36xx: Add wcn36xx_smd_set_sta_vht_params() Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 16/36] wcn36xx: Add wcn36xx_smd_set_sta_ht_ldpc_params() Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 17/36] wcn36xx: Add wcn36xx_smd_set_bss_vht_params() Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 18/36] wcn36xx: Add wrapper function wcn36xx_smd_set_sta_params_v1() Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 19/36] wcn36xx: Define INIT_HAL_MSG_V1() Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 20/36] wcn36xx: Convert to VHT parameter structure on wcn3680 Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 21/36] wcn36xx: Functionally decompose wcn36xx_smd_config_sta() Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 22/36] wcn36xx: Move wcn36xx_smd_set_sta_params() inside wcn36xx_smd_config_bss() Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 23/36] wcn36xx: Move BSS parameter setup to wcn36xx_smd_set_bss_params() Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 24/36] wcn36xx: Add wcn36xx_smd_config_bss_v0 Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 25/36] wcn36xx: Update wcn36xx_smd_config_bss_v1() to operate internally Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 26/36] wcn36xx: Convert to using wcn36xx_smd_config_bss_v0() Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 27/36] wcn36xx: Remove dead code in wcn36xx_smd_config_bss() Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 28/36] wcn36xx: Latch VHT specific BSS parameters to firmware Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 29/36] wcn36xx: Add accessor macro HW_VALUE_CHANNEL for hardware channels Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 30/36] wcn36xx: Use HW_VALUE_CHANNEL macro to get channel number Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 31/36] wcn36xx: Add accessor macro HW_VALUE_PHY for PHY settings Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 32/36] wcn36xx: Encode PHY mode for 80MHz channel in hw_value Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 33/36] wcn36xx: Set PHY into correct mode for 80MHz channel width Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 34/36] wcn36xx: Extend HAL param config list Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 35/36] wcn36xx: Define wcn3680 specific firmware parameters Bryan O'Donoghue
2020-08-03  3:11 ` [PATCH 36/36] wcn36xx: Add ability to download " Bryan O'Donoghue
2020-08-26 15:27 ` [PATCH 00/36] wcn36xx: Add support for WCN3680 802.11ac Kalle Valo
2020-08-26 16:17   ` Bryan O'Donoghue
2020-08-27  8:06     ` 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).