diff options
author | Arik Nemtsov <arik@wizery.com> | 2010-10-16 11:52:59 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-01-24 15:11:46 -0500 |
commit | 79b223f4c7ce35fba145c504de12be030cc0007e (patch) | |
tree | e83e8abc8cc89cdd5e6912be7540418bac8bfbd2 /drivers | |
parent | 1e05a81888318752e9a6d2158a95ddd6442ae117 (diff) |
wl12xx: AP mode - AP specific CMD_CONFIGURE sub-commands
Add AP max retries and rate policy configuration.
Rename STA rate policy configuration function.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/wl12xx/acx.c | 60 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/acx.h | 29 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/conf.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/init.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/tx.c | 2 |
6 files changed, 98 insertions, 11 deletions
diff --git a/drivers/net/wireless/wl12xx/acx.c b/drivers/net/wireless/wl12xx/acx.c index d6885d7c4256..646d278bd944 100644 --- a/drivers/net/wireless/wl12xx/acx.c +++ b/drivers/net/wireless/wl12xx/acx.c | |||
@@ -751,9 +751,9 @@ int wl1271_acx_statistics(struct wl1271 *wl, struct acx_statistics *stats) | |||
751 | return 0; | 751 | return 0; |
752 | } | 752 | } |
753 | 753 | ||
754 | int wl1271_acx_rate_policies(struct wl1271 *wl) | 754 | int wl1271_acx_sta_rate_policies(struct wl1271 *wl) |
755 | { | 755 | { |
756 | struct acx_rate_policy *acx; | 756 | struct acx_sta_rate_policy *acx; |
757 | struct conf_tx_rate_class *c = &wl->conf.tx.sta_rc_conf; | 757 | struct conf_tx_rate_class *c = &wl->conf.tx.sta_rc_conf; |
758 | int idx = 0; | 758 | int idx = 0; |
759 | int ret = 0; | 759 | int ret = 0; |
@@ -794,6 +794,38 @@ out: | |||
794 | return ret; | 794 | return ret; |
795 | } | 795 | } |
796 | 796 | ||
797 | int wl1271_acx_ap_rate_policy(struct wl1271 *wl, struct conf_tx_rate_class *c, | ||
798 | u8 idx) | ||
799 | { | ||
800 | struct acx_ap_rate_policy *acx; | ||
801 | int ret = 0; | ||
802 | |||
803 | wl1271_debug(DEBUG_ACX, "acx ap rate policy"); | ||
804 | |||
805 | acx = kzalloc(sizeof(*acx), GFP_KERNEL); | ||
806 | if (!acx) { | ||
807 | ret = -ENOMEM; | ||
808 | goto out; | ||
809 | } | ||
810 | |||
811 | acx->rate_policy.enabled_rates = cpu_to_le32(c->enabled_rates); | ||
812 | acx->rate_policy.short_retry_limit = c->short_retry_limit; | ||
813 | acx->rate_policy.long_retry_limit = c->long_retry_limit; | ||
814 | acx->rate_policy.aflags = c->aflags; | ||
815 | |||
816 | acx->rate_policy_idx = idx; | ||
817 | |||
818 | ret = wl1271_cmd_configure(wl, ACX_RATE_POLICY, acx, sizeof(*acx)); | ||
819 | if (ret < 0) { | ||
820 | wl1271_warning("Setting of ap rate policy failed: %d", ret); | ||
821 | goto out; | ||
822 | } | ||
823 | |||
824 | out: | ||
825 | kfree(acx); | ||
826 | return ret; | ||
827 | } | ||
828 | |||
797 | int wl1271_acx_ac_cfg(struct wl1271 *wl, u8 ac, u8 cw_min, u16 cw_max, | 829 | int wl1271_acx_ac_cfg(struct wl1271 *wl, u8 ac, u8 cw_min, u16 cw_max, |
798 | u8 aifsn, u16 txop) | 830 | u8 aifsn, u16 txop) |
799 | { | 831 | { |
@@ -1335,3 +1367,27 @@ out: | |||
1335 | kfree(tsf_info); | 1367 | kfree(tsf_info); |
1336 | return ret; | 1368 | return ret; |
1337 | } | 1369 | } |
1370 | |||
1371 | int wl1271_acx_max_tx_retry(struct wl1271 *wl) | ||
1372 | { | ||
1373 | struct wl1271_acx_max_tx_retry *acx = NULL; | ||
1374 | int ret; | ||
1375 | |||
1376 | wl1271_debug(DEBUG_ACX, "acx max tx retry"); | ||
1377 | |||
1378 | acx = kzalloc(sizeof(*acx), GFP_KERNEL); | ||
1379 | if (!acx) | ||
1380 | return -ENOMEM; | ||
1381 | |||
1382 | acx->max_tx_retry = cpu_to_le16(wl->conf.tx.ap_max_tx_retries); | ||
1383 | |||
1384 | ret = wl1271_cmd_configure(wl, ACX_MAX_TX_FAILURE, acx, sizeof(*acx)); | ||
1385 | if (ret < 0) { | ||
1386 | wl1271_warning("acx max tx retry failed: %d", ret); | ||
1387 | goto out; | ||
1388 | } | ||
1389 | |||
1390 | out: | ||
1391 | kfree(acx); | ||
1392 | return ret; | ||
1393 | } | ||
diff --git a/drivers/net/wireless/wl12xx/acx.h b/drivers/net/wireless/wl12xx/acx.h index 7bd8e4db4a71..62a269d84ebe 100644 --- a/drivers/net/wireless/wl12xx/acx.h +++ b/drivers/net/wireless/wl12xx/acx.h | |||
@@ -747,13 +747,23 @@ struct acx_rate_class { | |||
747 | #define ACX_TX_BASIC_RATE 0 | 747 | #define ACX_TX_BASIC_RATE 0 |
748 | #define ACX_TX_AP_FULL_RATE 1 | 748 | #define ACX_TX_AP_FULL_RATE 1 |
749 | #define ACX_TX_RATE_POLICY_CNT 2 | 749 | #define ACX_TX_RATE_POLICY_CNT 2 |
750 | struct acx_rate_policy { | 750 | struct acx_sta_rate_policy { |
751 | struct acx_header header; | 751 | struct acx_header header; |
752 | 752 | ||
753 | __le32 rate_class_cnt; | 753 | __le32 rate_class_cnt; |
754 | struct acx_rate_class rate_class[CONF_TX_MAX_RATE_CLASSES]; | 754 | struct acx_rate_class rate_class[CONF_TX_MAX_RATE_CLASSES]; |
755 | } __packed; | 755 | } __packed; |
756 | 756 | ||
757 | |||
758 | #define ACX_TX_AP_MODE_MGMT_RATE 4 | ||
759 | #define ACX_TX_AP_MODE_BCST_RATE 5 | ||
760 | struct acx_ap_rate_policy { | ||
761 | struct acx_header header; | ||
762 | |||
763 | __le32 rate_policy_idx; | ||
764 | struct acx_rate_class rate_policy; | ||
765 | } __packed; | ||
766 | |||
757 | struct acx_ac_cfg { | 767 | struct acx_ac_cfg { |
758 | struct acx_header header; | 768 | struct acx_header header; |
759 | u8 ac; | 769 | u8 ac; |
@@ -1062,6 +1072,17 @@ struct wl1271_acx_fw_tsf_information { | |||
1062 | u8 padding[3]; | 1072 | u8 padding[3]; |
1063 | } __packed; | 1073 | } __packed; |
1064 | 1074 | ||
1075 | struct wl1271_acx_max_tx_retry { | ||
1076 | struct acx_header header; | ||
1077 | |||
1078 | /* | ||
1079 | * the number of frames transmission failures before | ||
1080 | * issuing the aging event. | ||
1081 | */ | ||
1082 | __le16 max_tx_retry; | ||
1083 | u8 padding_1[2]; | ||
1084 | } __packed; | ||
1085 | |||
1065 | enum { | 1086 | enum { |
1066 | ACX_WAKE_UP_CONDITIONS = 0x0002, | 1087 | ACX_WAKE_UP_CONDITIONS = 0x0002, |
1067 | ACX_MEM_CFG = 0x0003, | 1088 | ACX_MEM_CFG = 0x0003, |
@@ -1119,6 +1140,7 @@ enum { | |||
1119 | ACX_HT_BSS_OPERATION = 0x0058, | 1140 | ACX_HT_BSS_OPERATION = 0x0058, |
1120 | ACX_COEX_ACTIVITY = 0x0059, | 1141 | ACX_COEX_ACTIVITY = 0x0059, |
1121 | ACX_SET_DCO_ITRIM_PARAMS = 0x0061, | 1142 | ACX_SET_DCO_ITRIM_PARAMS = 0x0061, |
1143 | ACX_MAX_TX_FAILURE = 0x0072, | ||
1122 | DOT11_RX_MSDU_LIFE_TIME = 0x1004, | 1144 | DOT11_RX_MSDU_LIFE_TIME = 0x1004, |
1123 | DOT11_CUR_TX_PWR = 0x100D, | 1145 | DOT11_CUR_TX_PWR = 0x100D, |
1124 | DOT11_RX_DOT11_MODE = 0x1012, | 1146 | DOT11_RX_DOT11_MODE = 0x1012, |
@@ -1160,7 +1182,9 @@ int wl1271_acx_set_preamble(struct wl1271 *wl, enum acx_preamble_type preamble); | |||
1160 | int wl1271_acx_cts_protect(struct wl1271 *wl, | 1182 | int wl1271_acx_cts_protect(struct wl1271 *wl, |
1161 | enum acx_ctsprotect_type ctsprotect); | 1183 | enum acx_ctsprotect_type ctsprotect); |
1162 | int wl1271_acx_statistics(struct wl1271 *wl, struct acx_statistics *stats); | 1184 | int wl1271_acx_statistics(struct wl1271 *wl, struct acx_statistics *stats); |
1163 | int wl1271_acx_rate_policies(struct wl1271 *wl); | 1185 | int wl1271_acx_sta_rate_policies(struct wl1271 *wl); |
1186 | int wl1271_acx_ap_rate_policy(struct wl1271 *wl, struct conf_tx_rate_class *c, | ||
1187 | u8 idx); | ||
1164 | int wl1271_acx_ac_cfg(struct wl1271 *wl, u8 ac, u8 cw_min, u16 cw_max, | 1188 | int wl1271_acx_ac_cfg(struct wl1271 *wl, u8 ac, u8 cw_min, u16 cw_max, |
1165 | u8 aifsn, u16 txop); | 1189 | u8 aifsn, u16 txop); |
1166 | int wl1271_acx_tid_cfg(struct wl1271 *wl, u8 queue_id, u8 channel_type, | 1190 | int wl1271_acx_tid_cfg(struct wl1271 *wl, u8 queue_id, u8 channel_type, |
@@ -1186,5 +1210,6 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl, | |||
1186 | int wl1271_acx_set_ht_information(struct wl1271 *wl, | 1210 | int wl1271_acx_set_ht_information(struct wl1271 *wl, |
1187 | u16 ht_operation_mode); | 1211 | u16 ht_operation_mode); |
1188 | int wl1271_acx_tsf_info(struct wl1271 *wl, u64 *mactime); | 1212 | int wl1271_acx_tsf_info(struct wl1271 *wl, u64 *mactime); |
1213 | int wl1271_acx_max_tx_retry(struct wl1271 *wl); | ||
1189 | 1214 | ||
1190 | #endif /* __WL1271_ACX_H__ */ | 1215 | #endif /* __WL1271_ACX_H__ */ |
diff --git a/drivers/net/wireless/wl12xx/conf.h b/drivers/net/wireless/wl12xx/conf.h index 7563ce3a9f66..f5c048c9bea4 100644 --- a/drivers/net/wireless/wl12xx/conf.h +++ b/drivers/net/wireless/wl12xx/conf.h | |||
@@ -683,6 +683,12 @@ struct conf_tx_settings { | |||
683 | struct conf_tx_rate_class ap_bcst_conf; | 683 | struct conf_tx_rate_class ap_bcst_conf; |
684 | 684 | ||
685 | /* | 685 | /* |
686 | * AP-mode - allow this number of TX retries to a station before an | ||
687 | * event is triggered from FW. | ||
688 | */ | ||
689 | u16 ap_max_tx_retries; | ||
690 | |||
691 | /* | ||
686 | * Configuration for TID parameters. | 692 | * Configuration for TID parameters. |
687 | */ | 693 | */ |
688 | u8 tid_conf_count; | 694 | u8 tid_conf_count; |
diff --git a/drivers/net/wireless/wl12xx/init.c b/drivers/net/wireless/wl12xx/init.c index 785a5304bfc4..f468d7178a9f 100644 --- a/drivers/net/wireless/wl12xx/init.c +++ b/drivers/net/wireless/wl12xx/init.c | |||
@@ -322,7 +322,7 @@ int wl1271_hw_init(struct wl1271 *wl) | |||
322 | } | 322 | } |
323 | 323 | ||
324 | /* Configure TX rate classes */ | 324 | /* Configure TX rate classes */ |
325 | ret = wl1271_acx_rate_policies(wl); | 325 | ret = wl1271_acx_sta_rate_policies(wl); |
326 | if (ret < 0) | 326 | if (ret < 0) |
327 | goto out_free_memmap; | 327 | goto out_free_memmap; |
328 | 328 | ||
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index 788959a5f0de..b40568e89eb4 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -191,7 +191,7 @@ static struct conf_drv_settings default_conf = { | |||
191 | .long_retry_limit = 10, | 191 | .long_retry_limit = 10, |
192 | .aflags = 0, | 192 | .aflags = 0, |
193 | }, | 193 | }, |
194 | 194 | .ap_max_tx_retries = 100, | |
195 | .tid_conf_count = 4, | 195 | .tid_conf_count = 4, |
196 | .tid_conf = { | 196 | .tid_conf = { |
197 | [CONF_TX_AC_BE] = { | 197 | [CONF_TX_AC_BE] = { |
@@ -1393,7 +1393,7 @@ static int wl1271_handle_idle(struct wl1271 *wl, bool idle) | |||
1393 | } | 1393 | } |
1394 | wl->rate_set = wl1271_min_rate_get(wl); | 1394 | wl->rate_set = wl1271_min_rate_get(wl); |
1395 | wl->sta_rate_set = 0; | 1395 | wl->sta_rate_set = 0; |
1396 | ret = wl1271_acx_rate_policies(wl); | 1396 | ret = wl1271_acx_sta_rate_policies(wl); |
1397 | if (ret < 0) | 1397 | if (ret < 0) |
1398 | goto out; | 1398 | goto out; |
1399 | ret = wl1271_acx_keep_alive_config( | 1399 | ret = wl1271_acx_keep_alive_config( |
@@ -1468,7 +1468,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed) | |||
1468 | wl1271_set_band_rate(wl); | 1468 | wl1271_set_band_rate(wl); |
1469 | 1469 | ||
1470 | wl->basic_rate = wl1271_min_rate_get(wl); | 1470 | wl->basic_rate = wl1271_min_rate_get(wl); |
1471 | ret = wl1271_acx_rate_policies(wl); | 1471 | ret = wl1271_acx_sta_rate_policies(wl); |
1472 | if (ret < 0) | 1472 | if (ret < 0) |
1473 | wl1271_warning("rate policy for update channel " | 1473 | wl1271_warning("rate policy for update channel " |
1474 | "failed %d", ret); | 1474 | "failed %d", ret); |
@@ -2017,7 +2017,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw, | |||
2017 | wl->basic_rate_set = wl1271_tx_enabled_rates_get(wl, | 2017 | wl->basic_rate_set = wl1271_tx_enabled_rates_get(wl, |
2018 | rates); | 2018 | rates); |
2019 | wl->basic_rate = wl1271_min_rate_get(wl); | 2019 | wl->basic_rate = wl1271_min_rate_get(wl); |
2020 | ret = wl1271_acx_rate_policies(wl); | 2020 | ret = wl1271_acx_sta_rate_policies(wl); |
2021 | if (ret < 0) | 2021 | if (ret < 0) |
2022 | goto out_sleep; | 2022 | goto out_sleep; |
2023 | 2023 | ||
@@ -2071,7 +2071,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw, | |||
2071 | /* revert back to minimum rates for the current band */ | 2071 | /* revert back to minimum rates for the current band */ |
2072 | wl1271_set_band_rate(wl); | 2072 | wl1271_set_band_rate(wl); |
2073 | wl->basic_rate = wl1271_min_rate_get(wl); | 2073 | wl->basic_rate = wl1271_min_rate_get(wl); |
2074 | ret = wl1271_acx_rate_policies(wl); | 2074 | ret = wl1271_acx_sta_rate_policies(wl); |
2075 | if (ret < 0) | 2075 | if (ret < 0) |
2076 | goto out_sleep; | 2076 | goto out_sleep; |
2077 | 2077 | ||
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c index b44c75cd8c1e..0cf210d6aa46 100644 --- a/drivers/net/wireless/wl12xx/tx.c +++ b/drivers/net/wireless/wl12xx/tx.c | |||
@@ -303,7 +303,7 @@ void wl1271_tx_work_locked(struct wl1271 *wl) | |||
303 | woken_up = true; | 303 | woken_up = true; |
304 | 304 | ||
305 | wl->rate_set = wl1271_tx_enabled_rates_get(wl, sta_rates); | 305 | wl->rate_set = wl1271_tx_enabled_rates_get(wl, sta_rates); |
306 | wl1271_acx_rate_policies(wl); | 306 | wl1271_acx_sta_rate_policies(wl); |
307 | } | 307 | } |
308 | 308 | ||
309 | while ((skb = wl1271_skb_dequeue(wl))) { | 309 | while ((skb = wl1271_skb_dequeue(wl))) { |