diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2013-07-24 06:36:46 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2013-07-31 02:03:56 -0400 |
commit | 8865bee4835441d9b3220d779d254d5856a68af0 (patch) | |
tree | 259273a570be29c04f72fbce69b242cd43902a16 /drivers/net/wireless/ath/ath10k | |
parent | ba0ccd7affd777cb90ad7279de4143663ae4d485 (diff) |
ath10k: detect the number of spatial streams supported by hw
Until now ath10k assumed 3 spatial streams.
However some devices support only 2 spatial
streams.
This patch improves performance on devices that
don't support 3 spatial streams.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/core.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/mac.c | 19 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi.c | 12 |
3 files changed, 20 insertions, 12 deletions
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 9f21ecb239d7..ff42bb744d9e 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h | |||
@@ -285,6 +285,7 @@ struct ath10k { | |||
285 | u32 hw_max_tx_power; | 285 | u32 hw_max_tx_power; |
286 | u32 ht_cap_info; | 286 | u32 ht_cap_info; |
287 | u32 vht_cap_info; | 287 | u32 vht_cap_info; |
288 | u32 num_rf_chains; | ||
288 | 289 | ||
289 | struct targetdef *targetdef; | 290 | struct targetdef *targetdef; |
290 | struct hostdef *hostdef; | 291 | struct hostdef *hostdef; |
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 6e01ef6e376b..344ad2772de8 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c | |||
@@ -3093,19 +3093,18 @@ static struct ieee80211_sta_vht_cap ath10k_create_vht_cap(struct ath10k *ar) | |||
3093 | { | 3093 | { |
3094 | struct ieee80211_sta_vht_cap vht_cap = {0}; | 3094 | struct ieee80211_sta_vht_cap vht_cap = {0}; |
3095 | u16 mcs_map; | 3095 | u16 mcs_map; |
3096 | int i; | ||
3096 | 3097 | ||
3097 | vht_cap.vht_supported = 1; | 3098 | vht_cap.vht_supported = 1; |
3098 | vht_cap.cap = ar->vht_cap_info; | 3099 | vht_cap.cap = ar->vht_cap_info; |
3099 | 3100 | ||
3100 | /* FIXME: check dynamically how many streams board supports */ | 3101 | mcs_map = 0; |
3101 | mcs_map = IEEE80211_VHT_MCS_SUPPORT_0_9 << 0 | | 3102 | for (i = 0; i < 8; i++) { |
3102 | IEEE80211_VHT_MCS_SUPPORT_0_9 << 2 | | 3103 | if (i < ar->num_rf_chains) |
3103 | IEEE80211_VHT_MCS_SUPPORT_0_9 << 4 | | 3104 | mcs_map |= IEEE80211_VHT_MCS_SUPPORT_0_9 << (i*2); |
3104 | IEEE80211_VHT_MCS_NOT_SUPPORTED << 6 | | 3105 | else |
3105 | IEEE80211_VHT_MCS_NOT_SUPPORTED << 8 | | 3106 | mcs_map |= IEEE80211_VHT_MCS_NOT_SUPPORTED << (i*2); |
3106 | IEEE80211_VHT_MCS_NOT_SUPPORTED << 10 | | 3107 | } |
3107 | IEEE80211_VHT_MCS_NOT_SUPPORTED << 12 | | ||
3108 | IEEE80211_VHT_MCS_NOT_SUPPORTED << 14; | ||
3109 | 3108 | ||
3110 | vht_cap.vht_mcs.rx_mcs_map = cpu_to_le16(mcs_map); | 3109 | vht_cap.vht_mcs.rx_mcs_map = cpu_to_le16(mcs_map); |
3111 | vht_cap.vht_mcs.tx_mcs_map = cpu_to_le16(mcs_map); | 3110 | vht_cap.vht_mcs.tx_mcs_map = cpu_to_le16(mcs_map); |
@@ -3168,7 +3167,7 @@ static struct ieee80211_sta_ht_cap ath10k_get_ht_cap(struct ath10k *ar) | |||
3168 | if (ar->vht_cap_info & WMI_VHT_CAP_MAX_MPDU_LEN_MASK) | 3167 | if (ar->vht_cap_info & WMI_VHT_CAP_MAX_MPDU_LEN_MASK) |
3169 | ht_cap.cap |= IEEE80211_HT_CAP_MAX_AMSDU; | 3168 | ht_cap.cap |= IEEE80211_HT_CAP_MAX_AMSDU; |
3170 | 3169 | ||
3171 | for (i = 0; i < WMI_MAX_SPATIAL_STREAM; i++) | 3170 | for (i = 0; i < ar->num_rf_chains; i++) |
3172 | ht_cap.mcs.rx_mask[i] = 0xFF; | 3171 | ht_cap.mcs.rx_mask[i] = 0xFF; |
3173 | 3172 | ||
3174 | ht_cap.mcs.tx_params |= IEEE80211_HT_MCS_TX_DEFINED; | 3173 | ht_cap.mcs.tx_params |= IEEE80211_HT_MCS_TX_DEFINED; |
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 5e4246015cdc..1cbcb2ea12f7 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c | |||
@@ -868,6 +868,13 @@ static void ath10k_wmi_service_ready_event_rx(struct ath10k *ar, | |||
868 | (__le32_to_cpu(ev->sw_version_1) & 0xffff0000) >> 16; | 868 | (__le32_to_cpu(ev->sw_version_1) & 0xffff0000) >> 16; |
869 | ar->fw_version_build = (__le32_to_cpu(ev->sw_version_1) & 0x0000ffff); | 869 | ar->fw_version_build = (__le32_to_cpu(ev->sw_version_1) & 0x0000ffff); |
870 | ar->phy_capability = __le32_to_cpu(ev->phy_capability); | 870 | ar->phy_capability = __le32_to_cpu(ev->phy_capability); |
871 | ar->num_rf_chains = __le32_to_cpu(ev->num_rf_chains); | ||
872 | |||
873 | if (ar->num_rf_chains > WMI_MAX_SPATIAL_STREAM) { | ||
874 | ath10k_warn("hardware advertises support for more spatial streams than it should (%d > %d)\n", | ||
875 | ar->num_rf_chains, WMI_MAX_SPATIAL_STREAM); | ||
876 | ar->num_rf_chains = WMI_MAX_SPATIAL_STREAM; | ||
877 | } | ||
871 | 878 | ||
872 | ar->ath_common.regulatory.current_rd = | 879 | ar->ath_common.regulatory.current_rd = |
873 | __le32_to_cpu(ev->hal_reg_capabilities.eeprom_rd); | 880 | __le32_to_cpu(ev->hal_reg_capabilities.eeprom_rd); |
@@ -892,7 +899,7 @@ static void ath10k_wmi_service_ready_event_rx(struct ath10k *ar, | |||
892 | } | 899 | } |
893 | 900 | ||
894 | ath10k_dbg(ATH10K_DBG_WMI, | 901 | ath10k_dbg(ATH10K_DBG_WMI, |
895 | "wmi event service ready sw_ver 0x%08x sw_ver1 0x%08x abi_ver %u phy_cap 0x%08x ht_cap 0x%08x vht_cap 0x%08x vht_supp_msc 0x%08x sys_cap_info 0x%08x mem_reqs %u\n", | 902 | "wmi event service ready sw_ver 0x%08x sw_ver1 0x%08x abi_ver %u phy_cap 0x%08x ht_cap 0x%08x vht_cap 0x%08x vht_supp_msc 0x%08x sys_cap_info 0x%08x mem_reqs %u num_rf_chains %u\n", |
896 | __le32_to_cpu(ev->sw_version), | 903 | __le32_to_cpu(ev->sw_version), |
897 | __le32_to_cpu(ev->sw_version_1), | 904 | __le32_to_cpu(ev->sw_version_1), |
898 | __le32_to_cpu(ev->abi_version), | 905 | __le32_to_cpu(ev->abi_version), |
@@ -901,7 +908,8 @@ static void ath10k_wmi_service_ready_event_rx(struct ath10k *ar, | |||
901 | __le32_to_cpu(ev->vht_cap_info), | 908 | __le32_to_cpu(ev->vht_cap_info), |
902 | __le32_to_cpu(ev->vht_supp_mcs), | 909 | __le32_to_cpu(ev->vht_supp_mcs), |
903 | __le32_to_cpu(ev->sys_cap_info), | 910 | __le32_to_cpu(ev->sys_cap_info), |
904 | __le32_to_cpu(ev->num_mem_reqs)); | 911 | __le32_to_cpu(ev->num_mem_reqs), |
912 | __le32_to_cpu(ev->num_rf_chains)); | ||
905 | 913 | ||
906 | complete(&ar->wmi.service_ready); | 914 | complete(&ar->wmi.service_ready); |
907 | } | 915 | } |