aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_acx.c
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2009-10-12 08:08:52 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:48:05 -0400
commit3cfd6cf960b2b030ccae1144a5c0dcd91c7c56a8 (patch)
tree54d0ff7c915701d12fdf891f5131e44c0efd6682 /drivers/net/wireless/wl12xx/wl1271_acx.c
parent5d0af498c08b43566733d5c5fb8293ce3b109eab (diff)
wl1271: Enable smart reflex
Enable and configure smart reflex. This should have a reducing impact on power consumption. Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_acx.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_acx.c72
1 files changed, 72 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.c b/drivers/net/wireless/wl12xx/wl1271_acx.c
index d5dac5753ae2..6c2989002218 100644
--- a/drivers/net/wireless/wl12xx/wl1271_acx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_acx.c
@@ -998,3 +998,75 @@ out:
998 kfree(rx_conf); 998 kfree(rx_conf);
999 return ret; 999 return ret;
1000} 1000}
1001
1002int wl1271_acx_smart_reflex(struct wl1271 *wl)
1003{
1004 struct acx_smart_reflex_state *sr_state = NULL;
1005 struct acx_smart_reflex_config_params *sr_param = NULL;
1006 int ret;
1007
1008 wl1271_debug(DEBUG_ACX, "acx smart reflex");
1009
1010 sr_param = kzalloc(sizeof(*sr_param), GFP_KERNEL);
1011 if (!sr_param) {
1012 ret = -ENOMEM;
1013 goto out;
1014 }
1015
1016 /* set cryptic smart reflex parameters - source TI reference code */
1017 sr_param->error_table[0].len = 0x07;
1018 sr_param->error_table[0].upper_limit = 0x03;
1019 sr_param->error_table[0].values[0] = 0x18;
1020 sr_param->error_table[0].values[1] = 0x10;
1021 sr_param->error_table[0].values[2] = 0x05;
1022 sr_param->error_table[0].values[3] = 0xfb;
1023 sr_param->error_table[0].values[4] = 0xf0;
1024 sr_param->error_table[0].values[5] = 0xe8;
1025
1026 sr_param->error_table[1].len = 0x07;
1027 sr_param->error_table[1].upper_limit = 0x03;
1028 sr_param->error_table[1].values[0] = 0x18;
1029 sr_param->error_table[1].values[1] = 0x10;
1030 sr_param->error_table[1].values[2] = 0x05;
1031 sr_param->error_table[1].values[3] = 0xf6;
1032 sr_param->error_table[1].values[4] = 0xf0;
1033 sr_param->error_table[1].values[5] = 0xe8;
1034
1035 sr_param->error_table[2].len = 0x07;
1036 sr_param->error_table[2].upper_limit = 0x03;
1037 sr_param->error_table[2].values[0] = 0x18;
1038 sr_param->error_table[2].values[1] = 0x10;
1039 sr_param->error_table[2].values[2] = 0x05;
1040 sr_param->error_table[2].values[3] = 0xfb;
1041 sr_param->error_table[2].values[4] = 0xf0;
1042 sr_param->error_table[2].values[5] = 0xe8;
1043
1044 ret = wl1271_cmd_configure(wl, ACX_SET_SMART_REFLEX_PARAMS,
1045 sr_param, sizeof(*sr_param));
1046 if (ret < 0) {
1047 wl1271_warning("failed to set smart reflex params: %d", ret);
1048 goto out;
1049 }
1050
1051 sr_state = kzalloc(sizeof(*sr_state), GFP_KERNEL);
1052 if (!sr_state) {
1053 ret = -ENOMEM;
1054 goto out;
1055 }
1056
1057 /* enable smart reflex */
1058 sr_state->enable = 1;
1059
1060 ret = wl1271_cmd_configure(wl, ACX_SET_SMART_REFLEX_STATE,
1061 sr_state, sizeof(*sr_state));
1062 if (ret < 0) {
1063 wl1271_warning("failed to set smart reflex params: %d", ret);
1064 goto out;
1065 }
1066
1067out:
1068 kfree(sr_state);
1069 kfree(sr_param);
1070 return ret;
1071
1072}