diff options
author | Jessica Wu <wjessica@qca.qualcomm.com> | 2014-06-17 05:41:10 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2014-07-14 09:03:29 -0400 |
commit | c1d32d3038ff4d366b837cedb95aeb1801730f2c (patch) | |
tree | a8fff0ebef8b9fb6b04139496c2876c815c503f8 | |
parent | 958e1be848c92006ee4b95190d3725daf3a70034 (diff) |
ath6kl: add support wmi rate tables with mcs15
Some of the firmware versions support rate tables up to mcs15, add support for
that.
Signed-off-by: Jessica Wu <wjessica@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/core.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/init.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/main.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/wmi.c | 69 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/wmi.h | 2 |
5 files changed, 77 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h index bd91c4465580..23a776391e44 100644 --- a/drivers/net/wireless/ath/ath6kl/core.h +++ b/drivers/net/wireless/ath/ath6kl/core.h | |||
@@ -145,6 +145,9 @@ enum ath6kl_fw_capability { | |||
145 | /* use low priority endpoint for all data */ | 145 | /* use low priority endpoint for all data */ |
146 | ATH6KL_FW_CAPABILITY_MAP_LP_ENDPOINT, | 146 | ATH6KL_FW_CAPABILITY_MAP_LP_ENDPOINT, |
147 | 147 | ||
148 | /* ratetable is the 2 stream version (max MCS15) */ | ||
149 | ATH6KL_FW_CAPABILITY_RATETABLE_MCS15, | ||
150 | |||
148 | /* this needs to be last */ | 151 | /* this needs to be last */ |
149 | ATH6KL_FW_CAPABILITY_MAX, | 152 | ATH6KL_FW_CAPABILITY_MAX, |
150 | }; | 153 | }; |
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c index a0400a12b592..8cd0cdfdb800 100644 --- a/drivers/net/wireless/ath/ath6kl/init.c +++ b/drivers/net/wireless/ath/ath6kl/init.c | |||
@@ -1576,6 +1576,7 @@ static const struct fw_capa_str_map { | |||
1576 | { ATH6KL_FW_CAPABILITY_64BIT_RATES, "64bit-rates" }, | 1576 | { ATH6KL_FW_CAPABILITY_64BIT_RATES, "64bit-rates" }, |
1577 | { ATH6KL_FW_CAPABILITY_AP_INACTIVITY_MINS, "ap-inactivity-mins" }, | 1577 | { ATH6KL_FW_CAPABILITY_AP_INACTIVITY_MINS, "ap-inactivity-mins" }, |
1578 | { ATH6KL_FW_CAPABILITY_MAP_LP_ENDPOINT, "map-lp-endpoint" }, | 1578 | { ATH6KL_FW_CAPABILITY_MAP_LP_ENDPOINT, "map-lp-endpoint" }, |
1579 | { ATH6KL_FW_CAPABILITY_RATETABLE_MCS15, "ratetable-mcs15" }, | ||
1579 | }; | 1580 | }; |
1580 | 1581 | ||
1581 | static const char *ath6kl_init_get_fw_capa_name(unsigned int id) | 1582 | static const char *ath6kl_init_get_fw_capa_name(unsigned int id) |
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c index d56554674da4..baa447f50fda 100644 --- a/drivers/net/wireless/ath/ath6kl/main.c +++ b/drivers/net/wireless/ath/ath6kl/main.c | |||
@@ -702,6 +702,7 @@ static void ath6kl_update_target_stats(struct ath6kl_vif *vif, u8 *ptr, u32 len) | |||
702 | struct ath6kl *ar = vif->ar; | 702 | struct ath6kl *ar = vif->ar; |
703 | struct target_stats *stats = &vif->target_stats; | 703 | struct target_stats *stats = &vif->target_stats; |
704 | struct tkip_ccmp_stats *ccmp_stats; | 704 | struct tkip_ccmp_stats *ccmp_stats; |
705 | s32 rate; | ||
705 | u8 ac; | 706 | u8 ac; |
706 | 707 | ||
707 | if (len < sizeof(*tgt_stats)) | 708 | if (len < sizeof(*tgt_stats)) |
@@ -731,8 +732,9 @@ static void ath6kl_update_target_stats(struct ath6kl_vif *vif, u8 *ptr, u32 len) | |||
731 | le32_to_cpu(tgt_stats->stats.tx.mult_retry_cnt); | 732 | le32_to_cpu(tgt_stats->stats.tx.mult_retry_cnt); |
732 | stats->tx_rts_fail_cnt += | 733 | stats->tx_rts_fail_cnt += |
733 | le32_to_cpu(tgt_stats->stats.tx.rts_fail_cnt); | 734 | le32_to_cpu(tgt_stats->stats.tx.rts_fail_cnt); |
734 | stats->tx_ucast_rate = | 735 | |
735 | ath6kl_wmi_get_rate(a_sle32_to_cpu(tgt_stats->stats.tx.ucast_rate)); | 736 | rate = a_sle32_to_cpu(tgt_stats->stats.tx.ucast_rate); |
737 | stats->tx_ucast_rate = ath6kl_wmi_get_rate(ar->wmi, rate); | ||
736 | 738 | ||
737 | stats->rx_pkt += le32_to_cpu(tgt_stats->stats.rx.pkt); | 739 | stats->rx_pkt += le32_to_cpu(tgt_stats->stats.rx.pkt); |
738 | stats->rx_byte += le32_to_cpu(tgt_stats->stats.rx.byte); | 740 | stats->rx_byte += le32_to_cpu(tgt_stats->stats.rx.byte); |
@@ -749,8 +751,9 @@ static void ath6kl_update_target_stats(struct ath6kl_vif *vif, u8 *ptr, u32 len) | |||
749 | le32_to_cpu(tgt_stats->stats.rx.key_cache_miss); | 751 | le32_to_cpu(tgt_stats->stats.rx.key_cache_miss); |
750 | stats->rx_decrypt_err += le32_to_cpu(tgt_stats->stats.rx.decrypt_err); | 752 | stats->rx_decrypt_err += le32_to_cpu(tgt_stats->stats.rx.decrypt_err); |
751 | stats->rx_dupl_frame += le32_to_cpu(tgt_stats->stats.rx.dupl_frame); | 753 | stats->rx_dupl_frame += le32_to_cpu(tgt_stats->stats.rx.dupl_frame); |
752 | stats->rx_ucast_rate = | 754 | |
753 | ath6kl_wmi_get_rate(a_sle32_to_cpu(tgt_stats->stats.rx.ucast_rate)); | 755 | rate = a_sle32_to_cpu(tgt_stats->stats.rx.ucast_rate); |
756 | stats->rx_ucast_rate = ath6kl_wmi_get_rate(ar->wmi, rate); | ||
754 | 757 | ||
755 | ccmp_stats = &tgt_stats->stats.tkip_ccmp_stats; | 758 | ccmp_stats = &tgt_stats->stats.tkip_ccmp_stats; |
756 | 759 | ||
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index 6ecc0a419c1a..94df345d08c2 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c | |||
@@ -59,6 +59,55 @@ static const s32 wmi_rate_tbl[][2] = { | |||
59 | {0, 0} | 59 | {0, 0} |
60 | }; | 60 | }; |
61 | 61 | ||
62 | static const s32 wmi_rate_tbl_mcs15[][2] = { | ||
63 | /* {W/O SGI, with SGI} */ | ||
64 | {1000, 1000}, | ||
65 | {2000, 2000}, | ||
66 | {5500, 5500}, | ||
67 | {11000, 11000}, | ||
68 | {6000, 6000}, | ||
69 | {9000, 9000}, | ||
70 | {12000, 12000}, | ||
71 | {18000, 18000}, | ||
72 | {24000, 24000}, | ||
73 | {36000, 36000}, | ||
74 | {48000, 48000}, | ||
75 | {54000, 54000}, | ||
76 | {6500, 7200}, /* HT 20, MCS 0 */ | ||
77 | {13000, 14400}, | ||
78 | {19500, 21700}, | ||
79 | {26000, 28900}, | ||
80 | {39000, 43300}, | ||
81 | {52000, 57800}, | ||
82 | {58500, 65000}, | ||
83 | {65000, 72200}, | ||
84 | {13000, 14400}, /* HT 20, MCS 8 */ | ||
85 | {26000, 28900}, | ||
86 | {39000, 43300}, | ||
87 | {52000, 57800}, | ||
88 | {78000, 86700}, | ||
89 | {104000, 115600}, | ||
90 | {117000, 130000}, | ||
91 | {130000, 144400}, /* HT 20, MCS 15 */ | ||
92 | {13500, 15000}, /*HT 40, MCS 0 */ | ||
93 | {27000, 30000}, | ||
94 | {40500, 45000}, | ||
95 | {54000, 60000}, | ||
96 | {81000, 90000}, | ||
97 | {108000, 120000}, | ||
98 | {121500, 135000}, | ||
99 | {135000, 150000}, | ||
100 | {27000, 30000}, /*HT 40, MCS 8 */ | ||
101 | {54000, 60000}, | ||
102 | {81000, 90000}, | ||
103 | {108000, 120000}, | ||
104 | {162000, 180000}, | ||
105 | {216000, 240000}, | ||
106 | {243000, 270000}, | ||
107 | {270000, 300000}, /*HT 40, MCS 15 */ | ||
108 | {0, 0} | ||
109 | }; | ||
110 | |||
62 | /* 802.1d to AC mapping. Refer pg 57 of WMM-test-plan-v1.2 */ | 111 | /* 802.1d to AC mapping. Refer pg 57 of WMM-test-plan-v1.2 */ |
63 | static const u8 up_to_ac[] = { | 112 | static const u8 up_to_ac[] = { |
64 | WMM_AC_BE, | 113 | WMM_AC_BE, |
@@ -3280,9 +3329,11 @@ int ath6kl_wmi_set_regdomain_cmd(struct wmi *wmi, const char *alpha2) | |||
3280 | NO_SYNC_WMIFLAG); | 3329 | NO_SYNC_WMIFLAG); |
3281 | } | 3330 | } |
3282 | 3331 | ||
3283 | s32 ath6kl_wmi_get_rate(s8 rate_index) | 3332 | s32 ath6kl_wmi_get_rate(struct wmi *wmi, s8 rate_index) |
3284 | { | 3333 | { |
3334 | struct ath6kl *ar = wmi->parent_dev; | ||
3285 | u8 sgi = 0; | 3335 | u8 sgi = 0; |
3336 | s32 ret; | ||
3286 | 3337 | ||
3287 | if (rate_index == RATE_AUTO) | 3338 | if (rate_index == RATE_AUTO) |
3288 | return 0; | 3339 | return 0; |
@@ -3293,10 +3344,20 @@ s32 ath6kl_wmi_get_rate(s8 rate_index) | |||
3293 | sgi = 1; | 3344 | sgi = 1; |
3294 | } | 3345 | } |
3295 | 3346 | ||
3296 | if (WARN_ON(rate_index > RATE_MCS_7_40)) | 3347 | if (test_bit(ATH6KL_FW_CAPABILITY_RATETABLE_MCS15, |
3297 | rate_index = RATE_MCS_7_40; | 3348 | ar->fw_capabilities)) { |
3349 | if (WARN_ON(rate_index >= ARRAY_SIZE(wmi_rate_tbl_mcs15))) | ||
3350 | return 0; | ||
3351 | |||
3352 | ret = wmi_rate_tbl_mcs15[(u32) rate_index][sgi]; | ||
3353 | } else { | ||
3354 | if (WARN_ON(rate_index >= ARRAY_SIZE(wmi_rate_tbl))) | ||
3355 | return 0; | ||
3298 | 3356 | ||
3299 | return wmi_rate_tbl[(u32) rate_index][sgi]; | 3357 | ret = wmi_rate_tbl[(u32) rate_index][sgi]; |
3358 | } | ||
3359 | |||
3360 | return ret; | ||
3300 | } | 3361 | } |
3301 | 3362 | ||
3302 | static int ath6kl_wmi_get_pmkid_list_event_rx(struct wmi *wmi, u8 *datap, | 3363 | static int ath6kl_wmi_get_pmkid_list_event_rx(struct wmi *wmi, u8 *datap, |
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.h b/drivers/net/wireless/ath/ath6kl/wmi.h index 7809afbb3e93..8d4d88531404 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.h +++ b/drivers/net/wireless/ath/ath6kl/wmi.h | |||
@@ -2632,7 +2632,7 @@ int ath6kl_wmi_set_htcap_cmd(struct wmi *wmi, u8 if_idx, | |||
2632 | struct ath6kl_htcap *htcap); | 2632 | struct ath6kl_htcap *htcap); |
2633 | int ath6kl_wmi_test_cmd(struct wmi *wmi, void *buf, size_t len); | 2633 | int ath6kl_wmi_test_cmd(struct wmi *wmi, void *buf, size_t len); |
2634 | 2634 | ||
2635 | s32 ath6kl_wmi_get_rate(s8 rate_index); | 2635 | s32 ath6kl_wmi_get_rate(struct wmi *wmi, s8 rate_index); |
2636 | 2636 | ||
2637 | int ath6kl_wmi_set_ip_cmd(struct wmi *wmi, u8 if_idx, | 2637 | int ath6kl_wmi_set_ip_cmd(struct wmi *wmi, u8 if_idx, |
2638 | __be32 ips0, __be32 ips1); | 2638 | __be32 ips0, __be32 ips1); |