2015-10-27 12:21:41

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 1/4] ath10k: remove supported chain mask

Removing supported chainmask fields as it can be always derived
from num_rf_chains.

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath10k/core.h | 2 --
drivers/net/wireless/ath/ath10k/mac.c | 17 +++++------------
drivers/net/wireless/ath/ath10k/wmi.c | 6 ++++--
3 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 7cc7cdd..cd598cf 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -730,8 +730,6 @@ struct ath10k {
int num_started_vdevs;

/* Protected by conf-mutex */
- u8 supp_tx_chainmask;
- u8 supp_rx_chainmask;
u8 cfg_tx_chainmask;
u8 cfg_rx_chainmask;

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 484c1a1..b4eb9fd 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3736,13 +3736,8 @@ static int ath10k_get_antenna(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant)

mutex_lock(&ar->conf_mutex);

- if (ar->cfg_tx_chainmask) {
- *tx_ant = ar->cfg_tx_chainmask;
- *rx_ant = ar->cfg_rx_chainmask;
- } else {
- *tx_ant = ar->supp_tx_chainmask;
- *rx_ant = ar->supp_rx_chainmask;
- }
+ *tx_ant = ar->cfg_tx_chainmask;
+ *rx_ant = ar->cfg_rx_chainmask;

mutex_unlock(&ar->conf_mutex);

@@ -3884,9 +3879,7 @@ static int ath10k_start(struct ieee80211_hw *hw)
}
}

- if (ar->cfg_tx_chainmask)
- __ath10k_set_antenna(ar, ar->cfg_tx_chainmask,
- ar->cfg_rx_chainmask);
+ __ath10k_set_antenna(ar, ar->cfg_tx_chainmask, ar->cfg_rx_chainmask);

/*
* By default FW set ARP frames ac to voice (6). In that case ARP
@@ -7157,8 +7150,8 @@ int ath10k_mac_register(struct ath10k *ar)
BIT(NL80211_IFTYPE_AP) |
BIT(NL80211_IFTYPE_MESH_POINT);

- ar->hw->wiphy->available_antennas_rx = ar->supp_rx_chainmask;
- ar->hw->wiphy->available_antennas_tx = ar->supp_tx_chainmask;
+ ar->hw->wiphy->available_antennas_rx = ar->cfg_rx_chainmask;
+ ar->hw->wiphy->available_antennas_tx = ar->cfg_tx_chainmask;

if (!test_bit(ATH10K_FW_FEATURE_NO_P2P, ar->fw_features))
ar->hw->wiphy->interface_modes |=
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 6e7d7a7..b36ecf2 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -4335,8 +4335,10 @@ static void ath10k_wmi_event_service_ready_work(struct work_struct *work)
ar->num_rf_chains = ar->max_spatial_stream;
}

- ar->supp_tx_chainmask = (1 << ar->num_rf_chains) - 1;
- ar->supp_rx_chainmask = (1 << ar->num_rf_chains) - 1;
+ if (!ar->cfg_tx_chainmask) {
+ ar->cfg_tx_chainmask = (1 << ar->num_rf_chains) - 1;
+ ar->cfg_rx_chainmask = (1 << ar->num_rf_chains) - 1;
+ }

if (strlen(ar->hw->wiphy->fw_version) == 0) {
snprintf(ar->hw->wiphy->fw_version,
--
2.6.2



2015-10-29 11:02:00

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 1/4] ath10k: remove supported chain mask

Rajkumar Manoharan <[email protected]> writes:

> Removing supported chainmask fields as it can be always derived
> from num_rf_chains.
>
> Signed-off-by: Rajkumar Manoharan <[email protected]>

All four patches applied, thanks.

--
Kalle Valo

2015-10-27 12:22:22

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 3/4] ath10k: move static HT/VHT capability setup functions

Move HT and VHT capabiltity setup static functions to avoid
forward declaration.

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath10k/mac.c | 280 +++++++++++++++++-----------------
1 file changed, 140 insertions(+), 140 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 4e799d4..2217494 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3757,6 +3757,146 @@ static void ath10k_check_chain_mask(struct ath10k *ar, u32 cm, const char *dbg)
dbg, cm);
}

+static int ath10k_mac_get_vht_cap_bf_sts(struct ath10k *ar)
+{
+ int nsts = ar->vht_cap_info;
+
+ nsts &= IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK;
+ nsts >>= IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT;
+
+ /* If firmware does not deliver to host number of space-time
+ * streams supported, assume it support up to 4 BF STS and return
+ * the value for VHT CAP: nsts-1)
+ */
+ if (nsts == 0)
+ return 3;
+
+ return nsts;
+}
+
+static int ath10k_mac_get_vht_cap_bf_sound_dim(struct ath10k *ar)
+{
+ int sound_dim = ar->vht_cap_info;
+
+ sound_dim &= IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK;
+ sound_dim >>= IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT;
+
+ /* If the sounding dimension is not advertised by the firmware,
+ * let's use a default value of 1
+ */
+ if (sound_dim == 0)
+ return 1;
+
+ return sound_dim;
+}
+
+static struct ieee80211_sta_vht_cap ath10k_create_vht_cap(struct ath10k *ar)
+{
+ struct ieee80211_sta_vht_cap vht_cap = {0};
+ u16 mcs_map;
+ u32 val;
+ int i;
+
+ vht_cap.vht_supported = 1;
+ vht_cap.cap = ar->vht_cap_info;
+
+ if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
+ IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE)) {
+ val = ath10k_mac_get_vht_cap_bf_sts(ar);
+ val <<= IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT;
+ val &= IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK;
+
+ vht_cap.cap |= val;
+ }
+
+ if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE |
+ IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE)) {
+ val = ath10k_mac_get_vht_cap_bf_sound_dim(ar);
+ val <<= IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT;
+ val &= IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK;
+
+ vht_cap.cap |= val;
+ }
+
+ mcs_map = 0;
+ for (i = 0; i < 8; i++) {
+ if ((i < ar->num_rf_chains) && (ar->cfg_tx_chainmask & BIT(i)))
+ mcs_map |= IEEE80211_VHT_MCS_SUPPORT_0_9 << (i * 2);
+ else
+ mcs_map |= IEEE80211_VHT_MCS_NOT_SUPPORTED << (i * 2);
+ }
+
+ vht_cap.vht_mcs.rx_mcs_map = cpu_to_le16(mcs_map);
+ vht_cap.vht_mcs.tx_mcs_map = cpu_to_le16(mcs_map);
+
+ return vht_cap;
+}
+
+static struct ieee80211_sta_ht_cap ath10k_get_ht_cap(struct ath10k *ar)
+{
+ int i;
+ struct ieee80211_sta_ht_cap ht_cap = {0};
+
+ if (!(ar->ht_cap_info & WMI_HT_CAP_ENABLED))
+ return ht_cap;
+
+ ht_cap.ht_supported = 1;
+ ht_cap.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;
+ ht_cap.ampdu_density = IEEE80211_HT_MPDU_DENSITY_8;
+ ht_cap.cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40;
+ ht_cap.cap |= IEEE80211_HT_CAP_DSSSCCK40;
+ ht_cap.cap |= WLAN_HT_CAP_SM_PS_STATIC << IEEE80211_HT_CAP_SM_PS_SHIFT;
+
+ if (ar->ht_cap_info & WMI_HT_CAP_HT20_SGI)
+ ht_cap.cap |= IEEE80211_HT_CAP_SGI_20;
+
+ if (ar->ht_cap_info & WMI_HT_CAP_HT40_SGI)
+ ht_cap.cap |= IEEE80211_HT_CAP_SGI_40;
+
+ if (ar->ht_cap_info & WMI_HT_CAP_DYNAMIC_SMPS) {
+ u32 smps;
+
+ smps = WLAN_HT_CAP_SM_PS_DYNAMIC;
+ smps <<= IEEE80211_HT_CAP_SM_PS_SHIFT;
+
+ ht_cap.cap |= smps;
+ }
+
+ if (ar->ht_cap_info & WMI_HT_CAP_TX_STBC)
+ ht_cap.cap |= IEEE80211_HT_CAP_TX_STBC;
+
+ if (ar->ht_cap_info & WMI_HT_CAP_RX_STBC) {
+ u32 stbc;
+
+ stbc = ar->ht_cap_info;
+ stbc &= WMI_HT_CAP_RX_STBC;
+ stbc >>= WMI_HT_CAP_RX_STBC_MASK_SHIFT;
+ stbc <<= IEEE80211_HT_CAP_RX_STBC_SHIFT;
+ stbc &= IEEE80211_HT_CAP_RX_STBC;
+
+ ht_cap.cap |= stbc;
+ }
+
+ if (ar->ht_cap_info & WMI_HT_CAP_LDPC)
+ ht_cap.cap |= IEEE80211_HT_CAP_LDPC_CODING;
+
+ if (ar->ht_cap_info & WMI_HT_CAP_L_SIG_TXOP_PROT)
+ ht_cap.cap |= IEEE80211_HT_CAP_LSIG_TXOP_PROT;
+
+ /* max AMSDU is implicitly taken from vht_cap_info */
+ if (ar->vht_cap_info & WMI_VHT_CAP_MAX_MPDU_LEN_MASK)
+ ht_cap.cap |= IEEE80211_HT_CAP_MAX_AMSDU;
+
+ for (i = 0; i < ar->num_rf_chains; i++) {
+ if (ar->cfg_rx_chainmask & BIT(i))
+ ht_cap.mcs.rx_mask[i] = 0xFF;
+ }
+
+ ht_cap.mcs.tx_params |= IEEE80211_HT_MCS_TX_DEFINED;
+
+ return ht_cap;
+}
+
static int __ath10k_set_antenna(struct ath10k *ar, u32 tx_ant, u32 rx_ant)
{
int ret;
@@ -4056,39 +4196,6 @@ static u32 get_nss_from_chainmask(u16 chain_mask)
return 1;
}

-static int ath10k_mac_get_vht_cap_bf_sts(struct ath10k *ar)
-{
- int nsts = ar->vht_cap_info;
-
- nsts &= IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK;
- nsts >>= IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT;
-
- /* If firmware does not deliver to host number of space-time
- * streams supported, assume it support up to 4 BF STS and return
- * the value for VHT CAP: nsts-1)
- * */
- if (nsts == 0)
- return 3;
-
- return nsts;
-}
-
-static int ath10k_mac_get_vht_cap_bf_sound_dim(struct ath10k *ar)
-{
- int sound_dim = ar->vht_cap_info;
-
- sound_dim &= IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK;
- sound_dim >>= IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT;
-
- /* If the sounding dimension is not advertised by the firmware,
- * let's use a default value of 1
- */
- if (sound_dim == 0)
- return 1;
-
- return sound_dim;
-}
-
static int ath10k_mac_set_txbf_conf(struct ath10k_vif *arvif)
{
u32 value = 0;
@@ -6942,113 +7049,6 @@ static const struct ieee80211_iface_combination ath10k_10_4_if_comb[] = {
},
};

-static struct ieee80211_sta_vht_cap ath10k_create_vht_cap(struct ath10k *ar)
-{
- struct ieee80211_sta_vht_cap vht_cap = {0};
- u16 mcs_map;
- u32 val;
- int i;
-
- vht_cap.vht_supported = 1;
- vht_cap.cap = ar->vht_cap_info;
-
- if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
- IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE)) {
- val = ath10k_mac_get_vht_cap_bf_sts(ar);
- val <<= IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT;
- val &= IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK;
-
- vht_cap.cap |= val;
- }
-
- if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE |
- IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE)) {
- val = ath10k_mac_get_vht_cap_bf_sound_dim(ar);
- val <<= IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT;
- val &= IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK;
-
- vht_cap.cap |= val;
- }
-
- mcs_map = 0;
- for (i = 0; i < 8; i++) {
- if ((i < ar->num_rf_chains) && (ar->cfg_tx_chainmask & BIT(i)))
- mcs_map |= IEEE80211_VHT_MCS_SUPPORT_0_9 << (i*2);
- else
- mcs_map |= IEEE80211_VHT_MCS_NOT_SUPPORTED << (i*2);
- }
-
- vht_cap.vht_mcs.rx_mcs_map = cpu_to_le16(mcs_map);
- vht_cap.vht_mcs.tx_mcs_map = cpu_to_le16(mcs_map);
-
- return vht_cap;
-}
-
-static struct ieee80211_sta_ht_cap ath10k_get_ht_cap(struct ath10k *ar)
-{
- int i;
- struct ieee80211_sta_ht_cap ht_cap = {0};
-
- if (!(ar->ht_cap_info & WMI_HT_CAP_ENABLED))
- return ht_cap;
-
- ht_cap.ht_supported = 1;
- ht_cap.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;
- ht_cap.ampdu_density = IEEE80211_HT_MPDU_DENSITY_8;
- ht_cap.cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40;
- ht_cap.cap |= IEEE80211_HT_CAP_DSSSCCK40;
- ht_cap.cap |= WLAN_HT_CAP_SM_PS_STATIC << IEEE80211_HT_CAP_SM_PS_SHIFT;
-
- if (ar->ht_cap_info & WMI_HT_CAP_HT20_SGI)
- ht_cap.cap |= IEEE80211_HT_CAP_SGI_20;
-
- if (ar->ht_cap_info & WMI_HT_CAP_HT40_SGI)
- ht_cap.cap |= IEEE80211_HT_CAP_SGI_40;
-
- if (ar->ht_cap_info & WMI_HT_CAP_DYNAMIC_SMPS) {
- u32 smps;
-
- smps = WLAN_HT_CAP_SM_PS_DYNAMIC;
- smps <<= IEEE80211_HT_CAP_SM_PS_SHIFT;
-
- ht_cap.cap |= smps;
- }
-
- if (ar->ht_cap_info & WMI_HT_CAP_TX_STBC)
- ht_cap.cap |= IEEE80211_HT_CAP_TX_STBC;
-
- if (ar->ht_cap_info & WMI_HT_CAP_RX_STBC) {
- u32 stbc;
-
- stbc = ar->ht_cap_info;
- stbc &= WMI_HT_CAP_RX_STBC;
- stbc >>= WMI_HT_CAP_RX_STBC_MASK_SHIFT;
- stbc <<= IEEE80211_HT_CAP_RX_STBC_SHIFT;
- stbc &= IEEE80211_HT_CAP_RX_STBC;
-
- ht_cap.cap |= stbc;
- }
-
- if (ar->ht_cap_info & WMI_HT_CAP_LDPC)
- ht_cap.cap |= IEEE80211_HT_CAP_LDPC_CODING;
-
- if (ar->ht_cap_info & WMI_HT_CAP_L_SIG_TXOP_PROT)
- ht_cap.cap |= IEEE80211_HT_CAP_LSIG_TXOP_PROT;
-
- /* max AMSDU is implicitly taken from vht_cap_info */
- if (ar->vht_cap_info & WMI_VHT_CAP_MAX_MPDU_LEN_MASK)
- ht_cap.cap |= IEEE80211_HT_CAP_MAX_AMSDU;
-
- for (i = 0; i < ar->num_rf_chains; i++) {
- if (ar->cfg_rx_chainmask & BIT(i))
- ht_cap.mcs.rx_mask[i] = 0xFF;
- }
-
- ht_cap.mcs.tx_params |= IEEE80211_HT_MCS_TX_DEFINED;
-
- return ht_cap;
-}
-
static void ath10k_get_arvif_iter(void *data, u8 *mac,
struct ieee80211_vif *vif)
{
--
2.6.2


2015-10-27 12:22:44

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 4/4] ath10k: reload HT/VHT capabilities on antenna change

To reflect configured antenna settings in HT/VHT MCS map,
reload the HT/VHT capabilities upon antenna change.

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath10k/mac.c | 39 +++++++++++++++++++++++++----------
1 file changed, 28 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 2217494..5782ec9 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3897,6 +3897,29 @@ static struct ieee80211_sta_ht_cap ath10k_get_ht_cap(struct ath10k *ar)
return ht_cap;
}

+static void ath10k_mac_setup_ht_vht_cap(struct ath10k *ar)
+{
+ struct ieee80211_supported_band *band;
+ struct ieee80211_sta_vht_cap vht_cap;
+ struct ieee80211_sta_ht_cap ht_cap;
+
+ ht_cap = ath10k_get_ht_cap(ar);
+ vht_cap = ath10k_create_vht_cap(ar);
+
+ if (ar->phy_capability & WHAL_WLAN_11G_CAPABILITY) {
+ band = &ar->mac.sbands[IEEE80211_BAND_2GHZ];
+ band->ht_cap = ht_cap;
+
+ /* Enable the VHT support at 2.4 GHz */
+ band->vht_cap = vht_cap;
+ }
+ if (ar->phy_capability & WHAL_WLAN_11A_CAPABILITY) {
+ band = &ar->mac.sbands[IEEE80211_BAND_5GHZ];
+ band->ht_cap = ht_cap;
+ band->vht_cap = vht_cap;
+ }
+}
+
static int __ath10k_set_antenna(struct ath10k *ar, u32 tx_ant, u32 rx_ant)
{
int ret;
@@ -3929,6 +3952,9 @@ static int __ath10k_set_antenna(struct ath10k *ar, u32 tx_ant, u32 rx_ant)
return ret;
}

+ /* Reload HT/VHT capability */
+ ath10k_mac_setup_ht_vht_cap(ar);
+
return 0;
}

@@ -7090,8 +7116,6 @@ int ath10k_mac_register(struct ath10k *ar)
WLAN_CIPHER_SUITE_AES_CMAC,
};
struct ieee80211_supported_band *band;
- struct ieee80211_sta_vht_cap vht_cap;
- struct ieee80211_sta_ht_cap ht_cap;
void *channels;
int ret;

@@ -7099,9 +7123,6 @@ int ath10k_mac_register(struct ath10k *ar)

SET_IEEE80211_DEV(ar->hw, ar->dev);

- ht_cap = ath10k_get_ht_cap(ar);
- vht_cap = ath10k_create_vht_cap(ar);
-
BUILD_BUG_ON((ARRAY_SIZE(ath10k_2ghz_channels) +
ARRAY_SIZE(ath10k_5ghz_channels)) !=
ATH10K_NUM_CHANS);
@@ -7120,10 +7141,6 @@ int ath10k_mac_register(struct ath10k *ar)
band->channels = channels;
band->n_bitrates = ath10k_g_rates_size;
band->bitrates = ath10k_g_rates;
- band->ht_cap = ht_cap;
-
- /* Enable the VHT support at 2.4 GHz */
- band->vht_cap = vht_cap;

ar->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = band;
}
@@ -7142,11 +7159,11 @@ int ath10k_mac_register(struct ath10k *ar)
band->channels = channels;
band->n_bitrates = ath10k_a_rates_size;
band->bitrates = ath10k_a_rates;
- band->ht_cap = ht_cap;
- band->vht_cap = vht_cap;
ar->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = band;
}

+ ath10k_mac_setup_ht_vht_cap(ar);
+
ar->hw->wiphy->interface_modes =
BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_AP) |
--
2.6.2


2015-10-27 12:22:08

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 2/4] ath10k: fill HT/VHT MCS rateset only for configured chainmask

HT/VHT MCS rateset should be filled only for configured chainmask
rather that max supported chainmask. Fix that by checking configured
chainmask while filling HT/VHT MCS rate map.

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath10k/mac.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index b4eb9fd..4e799d4 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -6972,7 +6972,7 @@ static struct ieee80211_sta_vht_cap ath10k_create_vht_cap(struct ath10k *ar)

mcs_map = 0;
for (i = 0; i < 8; i++) {
- if (i < ar->num_rf_chains)
+ if ((i < ar->num_rf_chains) && (ar->cfg_tx_chainmask & BIT(i)))
mcs_map |= IEEE80211_VHT_MCS_SUPPORT_0_9 << (i*2);
else
mcs_map |= IEEE80211_VHT_MCS_NOT_SUPPORTED << (i*2);
@@ -7039,8 +7039,10 @@ static struct ieee80211_sta_ht_cap ath10k_get_ht_cap(struct ath10k *ar)
if (ar->vht_cap_info & WMI_VHT_CAP_MAX_MPDU_LEN_MASK)
ht_cap.cap |= IEEE80211_HT_CAP_MAX_AMSDU;

- for (i = 0; i < ar->num_rf_chains; i++)
- ht_cap.mcs.rx_mask[i] = 0xFF;
+ for (i = 0; i < ar->num_rf_chains; i++) {
+ if (ar->cfg_rx_chainmask & BIT(i))
+ ht_cap.mcs.rx_mask[i] = 0xFF;
+ }

ht_cap.mcs.tx_params |= IEEE80211_HT_MCS_TX_DEFINED;

--
2.6.2


2016-02-25 17:39:17

by Rajkumar Manoharan

[permalink] [raw]
Subject: Re: [PATCH 1/4] ath10k: remove supported chain mask

>>>> Removing supported chainmask fields as it can be always derived
>>>> from num_rf_chains.
>>>>
>>>> Signed-off-by: Rajkumar Manoharan <[email protected]>
>>>
>> Hello,
>>
>> This one break monitor mode for qca988x and 10.x firmware:
>> After Revert "ath10k: remove supported chain mask" - works correctly.
>>
>Janusz,
>
> Thanks for reporting. Will send out patch asap.
>

Janusz,

It seems the change ("ath10k: remove supported chain mask") just exposed an
hidden problem. The same target assert can be reproduced by below sequence
even after reverting the commit.

ifconfig wlan0 down
iw wlan0 set type monitor
iw phy0 set antenna 7
ifconfig wlan0 up

The actual cause of target assert is below commit.

commit 5572a95b4b5768187652a346356e39e7542ca6e0
Author: Ben Greear <[email protected]>
Date: Mon Nov 24 16:22:10 2014 +0200

ath10k: apply chainmask settings to vdev on creation

Configuring NSS vdev param on interface addition is causing the target assert in 10.1 firmware.
Just creating monitor interface is causing assert with qca_main firmware.


-Rajkumar

2016-02-23 13:23:43

by Rajkumar Manoharan

[permalink] [raw]
Subject: Re: [PATCH 1/4] ath10k: remove supported chain mask

>>> Removing supported chainmask fields as it can be always derived
>>> from num_rf_chains.
>>>
>>> Signed-off-by: Rajkumar Manoharan <[email protected]>
>>
> Hello,
>
> This one break monitor mode for qca988x and 10.x firmware:
> After Revert "ath10k: remove supported chain mask" - works correctly.
>
Janusz,

Thanks for reporting. Will send out patch asap.

-Rajkumar

2016-02-25 18:40:24

by Ben Greear

[permalink] [raw]
Subject: Re: [PATCH 1/4] ath10k: remove supported chain mask

On 02/25/2016 09:39 AM, Manoharan, Rajkumar wrote:
>>>>> Removing supported chainmask fields as it can be always derived
>>>>> from num_rf_chains.
>>>>>
>>>>> Signed-off-by: Rajkumar Manoharan <[email protected]>
>>>>
>>> Hello,
>>>
>>> This one break monitor mode for qca988x and 10.x firmware:
>>> After Revert "ath10k: remove supported chain mask" - works correctly.
>>>
>> Janusz,
>>
>> Thanks for reporting. Will send out patch asap.
>>
>
> Janusz,
>
> It seems the change ("ath10k: remove supported chain mask") just exposed an
> hidden problem. The same target assert can be reproduced by below sequence
> even after reverting the commit.
>
> ifconfig wlan0 down
> iw wlan0 set type monitor
> iw phy0 set antenna 7
> ifconfig wlan0 up
>
> The actual cause of target assert is below commit.
>
> commit 5572a95b4b5768187652a346356e39e7542ca6e0
> Author: Ben Greear <[email protected]>
> Date: Mon Nov 24 16:22:10 2014 +0200
>
> ath10k: apply chainmask settings to vdev on creation
>
> Configuring NSS vdev param on interface addition is causing the target assert in 10.1 firmware.
> Just creating monitor interface is causing assert with qca_main firmware.

Maybe change that patch so that it does not attempt to set nss just for monitor interfaces?

Thanks,
Ben

>
>
> -Rajkumar
>


--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com


2016-02-23 12:52:44

by Janusz Dziedzic

[permalink] [raw]
Subject: Re: [PATCH 1/4] ath10k: remove supported chain mask

On 29 October 2015 at 12:01, Kalle Valo <[email protected]> wrote:
> Rajkumar Manoharan <[email protected]> writes:
>
>> Removing supported chainmask fields as it can be always derived
>> from num_rf_chains.
>>
>> Signed-off-by: Rajkumar Manoharan <[email protected]>
>
Hello,

This one break monitor mode for qca988x and 10.x firmware:
After Revert "ath10k: remove supported chain mask" - works correctly.

[ 997.415152] ath10k_pci 0000:03:00.0: mac create vdev 0 map ffff
[ 997.415154] ath10k_pci 0000:03:00.0: mac vdev create 0 (add
interface) type 4 subtype 0 bcnmode per-skb
[ 997.415156] ath10k_pci 0000:03:00.0: WMI vdev create: id 0 type 4
subtype 0 macaddr 00:00:00:00:00:00
[ 997.415157] ath10k_pci 0000:03:00.0: vdev param 0 not supported by firmware
[ 997.415161] ath10k_pci 0000:03:00.0: wmi vdev id 0x0 set param 32 value 2
[ 997.415163] ath10k_pci 0000:03:00.0: wmi vdev id 0x0 set param 1 value -1
[ 997.415254] ath10k_pci 0000:03:00.0: mac txpower 0
[ 997.415269] ath10k_pci 0000:03:00.0: wmi pdev set param 3 value 0
[ 997.415423] ath10k_pci 0000:03:00.0: firmware crashed! (uuid
d11e90aa-0f2a-433a-bcb4-eac63c6b7fdc)
[ 997.424369] ath10k_pci 0000:03:00.0: qca988x hw2.0 target
0x4100016c chip_id 0x043022ff sub 168c:3342
[ 997.424371] ath10k_pci 0000:03:00.0: kconfig debug 1 debugfs 1
tracing 1 dfs 1 testmode 0
[ 997.424498] ath10k_pci 0000:03:00.0: firmware ver 10.1.467 api 2
features wmi-10.x,has-wmi-mgmt-tx crc32 ba069298
[ 997.424501] ath10k_pci 0000:03:00.0: board_file api 1 bmi_id N/A
crc32 bebc7c08
[ 997.424503] ath10k_pci 0000:03:00.0: htt-ver 2.1 wmi-op 2 htt-op 2
cal otp max-sta 128 raw 0 hwcrypto 1
[ 997.426528] ath10k_pci 0000:03:00.0: firmware register dump:
[ 997.432176] ath10k_pci 0000:03:00.0: [00]: 0x4100016C 0x00000000
0x0097F8D2 0x00000000
[ 997.440076] ath10k_pci 0000:03:00.0: [04]: 0x00000000 0x00000000
0x00000000 0x00000000
[ 997.447975] ath10k_pci 0000:03:00.0: [08]: 0x00000000 0x00000000
0x00000000 0x00000000
[ 997.455875] ath10k_pci 0000:03:00.0: [12]: 0x00000000 0x00000000
0x00000000 0x00000000
[ 997.463774] ath10k_pci 0000:03:00.0: [16]: 0x00000000 0x00000000
0x00000000 0x0097F8D2
[ 997.471675] ath10k_pci 0000:03:00.0: [20]: 0x00000000 0x00401930
0x00000000 0x00000000
[ 997.479574] ath10k_pci 0000:03:00.0: [24]: 0x00000000 0x00000000
0x00000000 0x00000000
[ 997.487473] ath10k_pci 0000:03:00.0: [28]: 0x00000000 0x00000000
0x00000000 0x00000000
[ 997.495374] ath10k_pci 0000:03:00.0: [32]: 0x00000000 0x00000000
0x00000000 0x00000000
[ 997.503273] ath10k_pci 0000:03:00.0: [36]: 0x00000000 0x00000000
0x00000000 0x00000000
[ 997.511172] ath10k_pci 0000:03:00.0: [40]: 0x00000000 0x00000000
0x00000000 0x00000000
[ 997.519072] ath10k_pci 0000:03:00.0: [44]: 0x00000000 0x00000000
0x00000000 0x00000000
[ 997.526971] ath10k_pci 0000:03:00.0: [48]: 0x00000000 0x00000000
0x00000000 0x00000000
[ 997.534871] ath10k_pci 0000:03:00.0: [52]: 0x00000000 0x00000000
0x00000000 0x00000000
[ 997.542772] ath10k_pci 0000:03:00.0: [56]: 0x00000000 0x00000000
0x00000000 0x00000000
[ 997.550714] ath10k_pci 0000:03:00.0: failed to set 2g txpower 0: -108
[ 997.550715] ath10k_pci 0000:03:00.0: failed to setup tx power 0: -108
[ 997.550717] ath10k_pci 0000:03:00.0: failed to recalc tx power: -108
[ 997.550718] ath10k_pci 0000:03:00.0: WMI vdev delete id 0

BR
Janusz