aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2009-10-13 05:47:43 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:48:08 -0400
commit47fab7d589d46d87a5dbfd7f2ddd53deccfad504 (patch)
tree7ef786fb166d86449605723e29dd52ab8338e8ab
parent51f2be24328957f9e2acf116b1b1d2dfd10bf41f (diff)
wl1271: Add config structure for FW init parameters
Add a configuration structure for RX path parameters, and set default configuration values there. 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>
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_acx.c39
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_conf.h182
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_init.c128
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_init.h51
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c103
5 files changed, 376 insertions, 127 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.c b/drivers/net/wireless/wl12xx/wl1271_acx.c
index d0036860ab60..880c82894f63 100644
--- a/drivers/net/wireless/wl12xx/wl1271_acx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_acx.c
@@ -1014,7 +1014,7 @@ int wl1271_acx_smart_reflex(struct wl1271 *wl)
1014{ 1014{
1015 struct acx_smart_reflex_state *sr_state = NULL; 1015 struct acx_smart_reflex_state *sr_state = NULL;
1016 struct acx_smart_reflex_config_params *sr_param = NULL; 1016 struct acx_smart_reflex_config_params *sr_param = NULL;
1017 int ret; 1017 int i, ret;
1018 1018
1019 wl1271_debug(DEBUG_ACX, "acx smart reflex"); 1019 wl1271_debug(DEBUG_ACX, "acx smart reflex");
1020 1020
@@ -1024,33 +1024,14 @@ int wl1271_acx_smart_reflex(struct wl1271 *wl)
1024 goto out; 1024 goto out;
1025 } 1025 }
1026 1026
1027 /* set cryptic smart reflex parameters - source TI reference code */ 1027 for (i = 0; i < CONF_SR_ERR_TBL_COUNT; i++) {
1028 sr_param->error_table[0].len = 0x07; 1028 struct conf_mart_reflex_err_table *e =
1029 sr_param->error_table[0].upper_limit = 0x03; 1029 &(wl->conf.init.sr_err_tbl[i]);
1030 sr_param->error_table[0].values[0] = 0x18; 1030
1031 sr_param->error_table[0].values[1] = 0x10; 1031 sr_param->error_table[i].len = e->len;
1032 sr_param->error_table[0].values[2] = 0x05; 1032 sr_param->error_table[i].upper_limit = e->upper_limit;
1033 sr_param->error_table[0].values[3] = 0xfb; 1033 memcpy(sr_param->error_table[i].values, e->values, e->len);
1034 sr_param->error_table[0].values[4] = 0xf0; 1034 }
1035 sr_param->error_table[0].values[5] = 0xe8;
1036
1037 sr_param->error_table[1].len = 0x07;
1038 sr_param->error_table[1].upper_limit = 0x03;
1039 sr_param->error_table[1].values[0] = 0x18;
1040 sr_param->error_table[1].values[1] = 0x10;
1041 sr_param->error_table[1].values[2] = 0x05;
1042 sr_param->error_table[1].values[3] = 0xf6;
1043 sr_param->error_table[1].values[4] = 0xf0;
1044 sr_param->error_table[1].values[5] = 0xe8;
1045
1046 sr_param->error_table[2].len = 0x07;
1047 sr_param->error_table[2].upper_limit = 0x03;
1048 sr_param->error_table[2].values[0] = 0x18;
1049 sr_param->error_table[2].values[1] = 0x10;
1050 sr_param->error_table[2].values[2] = 0x05;
1051 sr_param->error_table[2].values[3] = 0xfb;
1052 sr_param->error_table[2].values[4] = 0xf0;
1053 sr_param->error_table[2].values[5] = 0xe8;
1054 1035
1055 ret = wl1271_cmd_configure(wl, ACX_SET_SMART_REFLEX_PARAMS, 1036 ret = wl1271_cmd_configure(wl, ACX_SET_SMART_REFLEX_PARAMS,
1056 sr_param, sizeof(*sr_param)); 1037 sr_param, sizeof(*sr_param));
@@ -1066,7 +1047,7 @@ int wl1271_acx_smart_reflex(struct wl1271 *wl)
1066 } 1047 }
1067 1048
1068 /* enable smart reflex */ 1049 /* enable smart reflex */
1069 sr_state->enable = 1; 1050 sr_state->enable = wl->conf.init.sr_enable;
1070 1051
1071 ret = wl1271_cmd_configure(wl, ACX_SET_SMART_REFLEX_STATE, 1052 ret = wl1271_cmd_configure(wl, ACX_SET_SMART_REFLEX_STATE,
1072 sr_state, sizeof(*sr_state)); 1053 sr_state, sizeof(*sr_state));
diff --git a/drivers/net/wireless/wl12xx/wl1271_conf.h b/drivers/net/wireless/wl12xx/wl1271_conf.h
index f08e509bd69f..5333a2731254 100644
--- a/drivers/net/wireless/wl12xx/wl1271_conf.h
+++ b/drivers/net/wireless/wl12xx/wl1271_conf.h
@@ -691,11 +691,193 @@ struct conf_conn_settings {
691 struct conf_sig_weights sig_weights; 691 struct conf_sig_weights sig_weights;
692}; 692};
693 693
694#define CONF_SR_ERR_TBL_MAX_VALUES 14
695
696struct conf_mart_reflex_err_table {
697 /*
698 * Length of the error table values table.
699 *
700 * Range: 0 - CONF_SR_ERR_TBL_MAX_VALUES
701 */
702 u8 len;
703
704 /*
705 * Smart Reflex error table upper limit.
706 *
707 * Range: s8
708 */
709 s8 upper_limit;
710
711 /*
712 * Smart Reflex error table values.
713 *
714 * Range: s8
715 */
716 s8 values[CONF_SR_ERR_TBL_MAX_VALUES];
717};
718
719enum {
720 CONF_REF_CLK_19_2_E,
721 CONF_REF_CLK_26_E,
722 CONF_REF_CLK_38_4_E,
723 CONF_REF_CLK_52_E
724};
725
726struct conf_general_parms {
727 /*
728 * RF Reference Clock type / speed
729 *
730 * Range: CONF_REF_CLK_*
731 */
732 u8 ref_clk;
733
734 /*
735 * Settling time of the reference clock after boot.
736 *
737 * Range: u8
738 */
739 u8 settling_time;
740
741 /*
742 * Flag defining whether clock is valid on wakeup.
743 *
744 * Range: 0 - not valid on wakeup, 1 - valid on wakeup
745 */
746 u8 clk_valid_on_wakeup;
747
748 /*
749 * DC-to-DC mode.
750 *
751 * Range: Unknown
752 */
753 u8 dc2dcmode;
754
755 /*
756 * Flag defining whether used as single or dual-band.
757 *
758 * Range: Unknown
759 */
760 u8 single_dual_band;
761
762 /*
763 * TX bip fem autodetect flag.
764 *
765 * Range: Unknown
766 */
767 u8 tx_bip_fem_autodetect;
768
769 /*
770 * TX bip gem manufacturer.
771 *
772 * Range: Unknown
773 */
774 u8 tx_bip_fem_manufacturer;
775
776 /*
777 * Settings flags.
778 *
779 * Range: Unknown
780 */
781 u8 settings;
782};
783
784#define CONF_RSSI_AND_PROCESS_COMPENSATION_SIZE 15
785#define CONF_NUMBER_OF_SUB_BANDS_5 7
786#define CONF_NUMBER_OF_RATE_GROUPS 6
787#define CONF_NUMBER_OF_CHANNELS_2_4 14
788#define CONF_NUMBER_OF_CHANNELS_5 35
789
790struct conf_radio_parms {
791 /*
792 * Static radio parameters for 2.4GHz
793 *
794 * Range: unknown
795 */
796 u8 rx_trace_loss;
797 u8 tx_trace_loss;
798 s8 rx_rssi_and_proc_compens[CONF_RSSI_AND_PROCESS_COMPENSATION_SIZE];
799
800 /*
801 * Static radio parameters for 5GHz
802 *
803 * Range: unknown
804 */
805 u8 rx_trace_loss_5[CONF_NUMBER_OF_SUB_BANDS_5];
806 u8 tx_trace_loss_5[CONF_NUMBER_OF_SUB_BANDS_5];
807 s8 rx_rssi_and_proc_compens_5[CONF_RSSI_AND_PROCESS_COMPENSATION_SIZE];
808
809 /*
810 * Dynamic radio parameters for 2.4GHz
811 *
812 * Range: unknown
813 */
814 s16 tx_ref_pd_voltage;
815 s8 tx_ref_power;
816 s8 tx_offset_db;
817
818 s8 tx_rate_limits_normal[CONF_NUMBER_OF_RATE_GROUPS];
819 s8 tx_rate_limits_degraded[CONF_NUMBER_OF_RATE_GROUPS];
820
821 s8 tx_channel_limits_11b[CONF_NUMBER_OF_CHANNELS_2_4];
822 s8 tx_channel_limits_ofdm[CONF_NUMBER_OF_CHANNELS_2_4];
823 s8 tx_pdv_rate_offsets[CONF_NUMBER_OF_RATE_GROUPS];
824
825 u8 tx_ibias[CONF_NUMBER_OF_RATE_GROUPS];
826 u8 rx_fem_insertion_loss;
827
828 /*
829 * Dynamic radio parameters for 5GHz
830 *
831 * Range: unknown
832 */
833 s16 tx_ref_pd_voltage_5[CONF_NUMBER_OF_SUB_BANDS_5];
834 s8 tx_ref_power_5[CONF_NUMBER_OF_SUB_BANDS_5];
835 s8 tx_offset_db_5[CONF_NUMBER_OF_SUB_BANDS_5];
836
837 s8 tx_rate_limits_normal_5[CONF_NUMBER_OF_RATE_GROUPS];
838 s8 tx_rate_limits_degraded_5[CONF_NUMBER_OF_RATE_GROUPS];
839
840 s8 tx_channel_limits_ofdm_5[CONF_NUMBER_OF_CHANNELS_5];
841 s8 tx_pdv_rate_offsets_5[CONF_NUMBER_OF_RATE_GROUPS];
842
843 /* FIXME: this is inconsistent with the types for 2.4GHz */
844 s8 tx_ibias_5[CONF_NUMBER_OF_RATE_GROUPS];
845 s8 rx_fem_insertion_loss_5[CONF_NUMBER_OF_SUB_BANDS_5];
846};
847
848#define CONF_SR_ERR_TBL_COUNT 3
849
850struct conf_init_settings {
851 /*
852 * Configure Smart Reflex error table values.
853 */
854 struct conf_mart_reflex_err_table sr_err_tbl[CONF_SR_ERR_TBL_COUNT];
855
856 /*
857 * Smart Reflex enable flag.
858 *
859 * Range: 1 - Smart Reflex enabled, 0 - Smart Reflex disabled
860 */
861 u8 sr_enable;
862
863 /*
864 * Configure general parameters.
865 */
866 struct conf_general_parms genparam;
867
868 /*
869 * Configure radio parameters.
870 */
871 struct conf_radio_parms radioparam;
872
873};
874
694struct conf_drv_settings { 875struct conf_drv_settings {
695 struct conf_sg_settings sg; 876 struct conf_sg_settings sg;
696 struct conf_rx_settings rx; 877 struct conf_rx_settings rx;
697 struct conf_tx_settings tx; 878 struct conf_tx_settings tx;
698 struct conf_conn_settings conn; 879 struct conf_conn_settings conn;
880 struct conf_init_settings init;
699}; 881};
700 882
701#endif 883#endif
diff --git a/drivers/net/wireless/wl12xx/wl1271_init.c b/drivers/net/wireless/wl12xx/wl1271_init.c
index a3fc4c97c518..5c2cf1e00ac7 100644
--- a/drivers/net/wireless/wl12xx/wl1271_init.c
+++ b/drivers/net/wireless/wl12xx/wl1271_init.c
@@ -188,6 +188,7 @@ static int wl1271_init_beacon_broadcast(struct wl1271 *wl)
188static int wl1271_init_general_parms(struct wl1271 *wl) 188static int wl1271_init_general_parms(struct wl1271 *wl)
189{ 189{
190 struct wl1271_general_parms *gen_parms; 190 struct wl1271_general_parms *gen_parms;
191 struct conf_general_parms *g = &wl->conf.init.genparam;
191 int ret; 192 int ret;
192 193
193 gen_parms = kzalloc(sizeof(*gen_parms), GFP_KERNEL); 194 gen_parms = kzalloc(sizeof(*gen_parms), GFP_KERNEL);
@@ -196,22 +197,14 @@ static int wl1271_init_general_parms(struct wl1271 *wl)
196 197
197 gen_parms->id = TEST_CMD_INI_FILE_GENERAL_PARAM; 198 gen_parms->id = TEST_CMD_INI_FILE_GENERAL_PARAM;
198 199
199 /* 200 gen_parms->ref_clk = g->ref_clk;
200 * FIXME: The firmware crashes on boot with REF_CLK_38_4_E as clock. 201 gen_parms->settling_time = g->settling_time;
201 * according to TI engineers, ref clk 5 is an unofficial 202 gen_parms->clk_valid_on_wakeup = g->clk_valid_on_wakeup;
202 * 38.4 XTAL clock config, which seems to boot the device. 203 gen_parms->dc2dcmode = g->dc2dcmode;
203 * Restore correct value once the real problem source is 204 gen_parms->single_dual_band = g->single_dual_band;
204 * identified. 205 gen_parms->tx_bip_fem_autodetect = g->tx_bip_fem_autodetect;
205 */ 206 gen_parms->tx_bip_fem_manufacturer = g->tx_bip_fem_manufacturer;
206 gen_parms->ref_clk = 5; /* REF_CLK_38_4_E; */ 207 gen_parms->settings = g->settings;
207 /* FIXME: magic numbers */
208 gen_parms->settling_time = 5;
209 gen_parms->clk_valid_on_wakeup = 0;
210 gen_parms->dc2dcmode = 0;
211 gen_parms->single_dual_band = 0;
212 gen_parms->tx_bip_fem_autodetect = 0;
213 gen_parms->tx_bip_fem_manufacturer = 1;
214 gen_parms->settings = 1;
215 208
216 ret = wl1271_cmd_test(wl, gen_parms, sizeof(*gen_parms), 0); 209 ret = wl1271_cmd_test(wl, gen_parms, sizeof(*gen_parms), 0);
217 if (ret < 0) { 210 if (ret < 0) {
@@ -225,32 +218,9 @@ static int wl1271_init_general_parms(struct wl1271 *wl)
225 218
226static int wl1271_init_radio_parms(struct wl1271 *wl) 219static int wl1271_init_radio_parms(struct wl1271 *wl)
227{ 220{
228 /*
229 * FIXME: All these magic numbers should be moved to some place where
230 * they can be configured (separate file?)
231 */
232
233 struct wl1271_radio_parms *radio_parms; 221 struct wl1271_radio_parms *radio_parms;
234 int ret; 222 struct conf_radio_parms *r = &wl->conf.init.radioparam;
235 u8 compensation[] = { 0xec, 0xf6, 0x00, 0x0c, 0x18, 0xf8, 0xfc, 0x00, 223 int i, ret;
236 0x08, 0x10, 0xf0, 0xf8, 0x00, 0x0a, 0x14 };
237
238 u8 tx_rate_limits_normal[] = { 0x1e, 0x1f, 0x22, 0x24, 0x28, 0x29 };
239 u8 tx_rate_limits_degraded[] = { 0x1b, 0x1c, 0x1e, 0x20, 0x24, 0x25 };
240
241 u8 tx_channel_limits_11b[] = { 0x22, 0x50, 0x50, 0x50,
242 0x50, 0x50, 0x50, 0x50,
243 0x50, 0x50, 0x22, 0x50,
244 0x22, 0x50 };
245
246 u8 tx_channel_limits_ofdm[] = { 0x20, 0x50, 0x50, 0x50,
247 0x50, 0x50, 0x50, 0x50,
248 0x50, 0x50, 0x20, 0x50,
249 0x20, 0x50 };
250
251 u8 tx_pdv_rate_offsets[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
252
253 u8 tx_ibias[] = { 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x27 };
254 224
255 radio_parms = kzalloc(sizeof(*radio_parms), GFP_KERNEL); 225 radio_parms = kzalloc(sizeof(*radio_parms), GFP_KERNEL);
256 if (!radio_parms) 226 if (!radio_parms)
@@ -259,33 +229,59 @@ static int wl1271_init_radio_parms(struct wl1271 *wl)
259 radio_parms->id = TEST_CMD_INI_FILE_RADIO_PARAM; 229 radio_parms->id = TEST_CMD_INI_FILE_RADIO_PARAM;
260 230
261 /* Static radio parameters */ 231 /* Static radio parameters */
262 radio_parms->rx_trace_loss = 10; 232 radio_parms->rx_trace_loss = r->rx_trace_loss;
263 radio_parms->tx_trace_loss = 10; 233 radio_parms->tx_trace_loss = r->tx_trace_loss;
264 memcpy(radio_parms->rx_rssi_and_proc_compens, compensation, 234 memcpy(radio_parms->rx_rssi_and_proc_compens,
265 sizeof(compensation)); 235 r->rx_rssi_and_proc_compens,
266 236 CONF_RSSI_AND_PROCESS_COMPENSATION_SIZE);
267 /* We don't set the 5GHz -- N/A */ 237
238 memcpy(radio_parms->rx_trace_loss_5, r->rx_trace_loss_5,
239 CONF_NUMBER_OF_SUB_BANDS_5);
240 memcpy(radio_parms->tx_trace_loss_5, r->tx_trace_loss_5,
241 CONF_NUMBER_OF_SUB_BANDS_5);
242 memcpy(radio_parms->rx_rssi_and_proc_compens_5,
243 r->rx_rssi_and_proc_compens_5,
244 CONF_RSSI_AND_PROCESS_COMPENSATION_SIZE);
268 245
269 /* Dynamic radio parameters */ 246 /* Dynamic radio parameters */
270 radio_parms->tx_ref_pd_voltage = cpu_to_le16(0x24e); 247 radio_parms->tx_ref_pd_voltage = cpu_to_le16(r->tx_ref_pd_voltage);
271 radio_parms->tx_ref_power = 0x78; 248 radio_parms->tx_ref_power = r->tx_ref_power;
272 radio_parms->tx_offset_db = 0x0; 249 radio_parms->tx_offset_db = r->tx_offset_db;
273 250
274 memcpy(radio_parms->tx_rate_limits_normal, tx_rate_limits_normal, 251 memcpy(radio_parms->tx_rate_limits_normal, r->tx_rate_limits_normal,
275 sizeof(tx_rate_limits_normal)); 252 CONF_NUMBER_OF_RATE_GROUPS);
276 memcpy(radio_parms->tx_rate_limits_degraded, tx_rate_limits_degraded, 253 memcpy(radio_parms->tx_rate_limits_degraded, r->tx_rate_limits_degraded,
277 sizeof(tx_rate_limits_degraded)); 254 CONF_NUMBER_OF_RATE_GROUPS);
278 255
279 memcpy(radio_parms->tx_channel_limits_11b, tx_channel_limits_11b, 256 memcpy(radio_parms->tx_channel_limits_11b, r->tx_channel_limits_11b,
280 sizeof(tx_channel_limits_11b)); 257 CONF_NUMBER_OF_CHANNELS_2_4);
281 memcpy(radio_parms->tx_channel_limits_ofdm, tx_channel_limits_ofdm, 258 memcpy(radio_parms->tx_channel_limits_ofdm, r->tx_channel_limits_ofdm,
282 sizeof(tx_channel_limits_ofdm)); 259 CONF_NUMBER_OF_CHANNELS_2_4);
283 memcpy(radio_parms->tx_pdv_rate_offsets, tx_pdv_rate_offsets, 260 memcpy(radio_parms->tx_pdv_rate_offsets, r->tx_pdv_rate_offsets,
284 sizeof(tx_pdv_rate_offsets)); 261 CONF_NUMBER_OF_RATE_GROUPS);
285 memcpy(radio_parms->tx_ibias, tx_ibias, 262 memcpy(radio_parms->tx_ibias, r->tx_ibias, CONF_NUMBER_OF_RATE_GROUPS);
286 sizeof(tx_ibias)); 263
287 264 radio_parms->rx_fem_insertion_loss = r->rx_fem_insertion_loss;
288 radio_parms->rx_fem_insertion_loss = 0x14; 265
266 for (i = 0; i < CONF_NUMBER_OF_SUB_BANDS_5; i++)
267 radio_parms->tx_ref_pd_voltage_5[i] =
268 cpu_to_le16(r->tx_ref_pd_voltage_5[i]);
269 memcpy(radio_parms->tx_ref_power_5, r->tx_ref_power_5,
270 CONF_NUMBER_OF_SUB_BANDS_5);
271 memcpy(radio_parms->tx_offset_db_5, r->tx_offset_db_5,
272 CONF_NUMBER_OF_SUB_BANDS_5);
273 memcpy(radio_parms->tx_rate_limits_normal_5,
274 r->tx_rate_limits_normal_5, CONF_NUMBER_OF_RATE_GROUPS);
275 memcpy(radio_parms->tx_rate_limits_degraded_5,
276 r->tx_rate_limits_degraded_5, CONF_NUMBER_OF_RATE_GROUPS);
277 memcpy(radio_parms->tx_channel_limits_ofdm_5,
278 r->tx_channel_limits_ofdm_5, CONF_NUMBER_OF_CHANNELS_5);
279 memcpy(radio_parms->tx_pdv_rate_offsets_5, r->tx_pdv_rate_offsets_5,
280 CONF_NUMBER_OF_RATE_GROUPS);
281 memcpy(radio_parms->tx_ibias_5, r->tx_ibias_5,
282 CONF_NUMBER_OF_RATE_GROUPS);
283 memcpy(radio_parms->rx_fem_insertion_loss_5,
284 r->rx_fem_insertion_loss_5, CONF_NUMBER_OF_SUB_BANDS_5);
289 285
290 ret = wl1271_cmd_test(wl, radio_parms, sizeof(*radio_parms), 0); 286 ret = wl1271_cmd_test(wl, radio_parms, sizeof(*radio_parms), 0);
291 if (ret < 0) 287 if (ret < 0)
diff --git a/drivers/net/wireless/wl12xx/wl1271_init.h b/drivers/net/wireless/wl12xx/wl1271_init.h
index bd8ff0fa2272..513d0cb1866b 100644
--- a/drivers/net/wireless/wl12xx/wl1271_init.h
+++ b/drivers/net/wireless/wl12xx/wl1271_init.h
@@ -48,19 +48,6 @@ struct wl1271_general_parms {
48 u8 settings; 48 u8 settings;
49} __attribute__ ((packed)); 49} __attribute__ ((packed));
50 50
51enum ref_clk_enum {
52 REF_CLK_19_2_E,
53 REF_CLK_26_E,
54 REF_CLK_38_4_E,
55 REF_CLK_52_E
56};
57
58#define RSSI_AND_PROCESS_COMPENSATION_SIZE 15
59#define NUMBER_OF_SUB_BANDS_5 7
60#define NUMBER_OF_RATE_GROUPS 6
61#define NUMBER_OF_CHANNELS_2_4 14
62#define NUMBER_OF_CHANNELS_5 35
63
64struct wl1271_radio_parms { 51struct wl1271_radio_parms {
65 u8 id; 52 u8 id;
66 u8 padding[3]; 53 u8 padding[3];
@@ -69,12 +56,12 @@ struct wl1271_radio_parms {
69 /* 2.4GHz */ 56 /* 2.4GHz */
70 u8 rx_trace_loss; 57 u8 rx_trace_loss;
71 u8 tx_trace_loss; 58 u8 tx_trace_loss;
72 s8 rx_rssi_and_proc_compens[RSSI_AND_PROCESS_COMPENSATION_SIZE]; 59 s8 rx_rssi_and_proc_compens[CONF_RSSI_AND_PROCESS_COMPENSATION_SIZE];
73 60
74 /* 5GHz */ 61 /* 5GHz */
75 u8 rx_trace_loss_5[NUMBER_OF_SUB_BANDS_5]; 62 u8 rx_trace_loss_5[CONF_NUMBER_OF_SUB_BANDS_5];
76 u8 tx_trace_loss_5[NUMBER_OF_SUB_BANDS_5]; 63 u8 tx_trace_loss_5[CONF_NUMBER_OF_SUB_BANDS_5];
77 s8 rx_rssi_and_proc_compens_5[RSSI_AND_PROCESS_COMPENSATION_SIZE]; 64 s8 rx_rssi_and_proc_compens_5[CONF_RSSI_AND_PROCESS_COMPENSATION_SIZE];
78 65
79 /* Dynamic radio parameters */ 66 /* Dynamic radio parameters */
80 /* 2.4GHz */ 67 /* 2.4GHz */
@@ -82,32 +69,32 @@ struct wl1271_radio_parms {
82 s8 tx_ref_power; 69 s8 tx_ref_power;
83 s8 tx_offset_db; 70 s8 tx_offset_db;
84 71
85 s8 tx_rate_limits_normal[NUMBER_OF_RATE_GROUPS]; 72 s8 tx_rate_limits_normal[CONF_NUMBER_OF_RATE_GROUPS];
86 s8 tx_rate_limits_degraded[NUMBER_OF_RATE_GROUPS]; 73 s8 tx_rate_limits_degraded[CONF_NUMBER_OF_RATE_GROUPS];
87 74
88 s8 tx_channel_limits_11b[NUMBER_OF_CHANNELS_2_4]; 75 s8 tx_channel_limits_11b[CONF_NUMBER_OF_CHANNELS_2_4];
89 s8 tx_channel_limits_ofdm[NUMBER_OF_CHANNELS_2_4]; 76 s8 tx_channel_limits_ofdm[CONF_NUMBER_OF_CHANNELS_2_4];
90 s8 tx_pdv_rate_offsets[NUMBER_OF_RATE_GROUPS]; 77 s8 tx_pdv_rate_offsets[CONF_NUMBER_OF_RATE_GROUPS];
91 78
92 u8 tx_ibias[NUMBER_OF_RATE_GROUPS]; 79 u8 tx_ibias[CONF_NUMBER_OF_RATE_GROUPS];
93 u8 rx_fem_insertion_loss; 80 u8 rx_fem_insertion_loss;
94 81
95 u8 padding2; 82 u8 padding2;
96 83
97 /* 5GHz */ 84 /* 5GHz */
98 s16 tx_ref_pd_voltage_5[NUMBER_OF_SUB_BANDS_5]; 85 s16 tx_ref_pd_voltage_5[CONF_NUMBER_OF_SUB_BANDS_5];
99 s8 tx_ref_power_5[NUMBER_OF_SUB_BANDS_5]; 86 s8 tx_ref_power_5[CONF_NUMBER_OF_SUB_BANDS_5];
100 s8 tx_offset_db_5[NUMBER_OF_SUB_BANDS_5]; 87 s8 tx_offset_db_5[CONF_NUMBER_OF_SUB_BANDS_5];
101 88
102 s8 tx_rate_limits_normal_5[NUMBER_OF_RATE_GROUPS]; 89 s8 tx_rate_limits_normal_5[CONF_NUMBER_OF_RATE_GROUPS];
103 s8 tx_rate_limits_degraded_5[NUMBER_OF_RATE_GROUPS]; 90 s8 tx_rate_limits_degraded_5[CONF_NUMBER_OF_RATE_GROUPS];
104 91
105 s8 tx_channel_limits_ofdm_5[NUMBER_OF_CHANNELS_5]; 92 s8 tx_channel_limits_ofdm_5[CONF_NUMBER_OF_CHANNELS_5];
106 s8 tx_pdv_rate_offsets_5[NUMBER_OF_RATE_GROUPS]; 93 s8 tx_pdv_rate_offsets_5[CONF_NUMBER_OF_RATE_GROUPS];
107 94
108 /* FIXME: this is inconsistent with the types for 2.4GHz */ 95 /* FIXME: this is inconsistent with the types for 2.4GHz */
109 s8 tx_ibias_5[NUMBER_OF_RATE_GROUPS]; 96 s8 tx_ibias_5[CONF_NUMBER_OF_RATE_GROUPS];
110 s8 rx_fem_insertion_loss_5[NUMBER_OF_SUB_BANDS_5]; 97 s8 rx_fem_insertion_loss_5[CONF_NUMBER_OF_SUB_BANDS_5];
111 98
112 u8 padding3[2]; 99 u8 padding3[2];
113} __attribute__ ((packed)); 100} __attribute__ ((packed));
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index a559a1536534..0b17b056f3f3 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -224,6 +224,109 @@ static void wl1271_conf_init(struct wl1271 *wl)
224 .snr_bcn_avg_weight = 10, 224 .snr_bcn_avg_weight = 10,
225 .snr_pkt_avg_weight = 10 225 .snr_pkt_avg_weight = 10
226 } 226 }
227 },
228 .init = {
229 .sr_err_tbl = {
230 [0] = {
231 .len = 7,
232 .upper_limit = 0x03,
233 .values = {
234 0x18, 0x10, 0x05, 0xfb,
235 0xf0, 0xe8, 0x00 }
236 },
237 [1] = {
238 .len = 7,
239 .upper_limit = 0x03,
240 .values = {
241 0x18, 0x10, 0x05, 0xf6,
242 0xf0, 0xe8, 0x00 }
243 },
244 [2] = {
245 .len = 7,
246 .upper_limit = 0x03,
247 .values = {
248 0x18, 0x10, 0x05, 0xfb,
249 0xf0, 0xe8, 0x00 }
250 }
251 },
252 .sr_enable = 1,
253 .genparam = {
254 /*
255 * FIXME: The correct value CONF_REF_CLK_38_4_E
256 * causes the firmware to crash on boot.
257 * The value 5 apparently is an
258 * unnoficial XTAL configuration of the
259 * same frequency, which appears to work.
260 */
261 .ref_clk = 5,
262 .settling_time = 5,
263 .clk_valid_on_wakeup = 0,
264 .dc2dcmode = 0,
265 .single_dual_band = 0,
266 .tx_bip_fem_autodetect = 0,
267 .tx_bip_fem_manufacturer = 1,
268 .settings = 1,
269 },
270 .radioparam = {
271 /* FIXME: 5GHz values unset! */
272 .rx_trace_loss = 10,
273 .tx_trace_loss = 10,
274 .rx_rssi_and_proc_compens = {
275 0xec, 0xf6, 0x00, 0x0c, 0x18, 0xf8,
276 0xfc, 0x00, 0x08, 0x10, 0xf0, 0xf8,
277 0x00, 0x0a, 0x14 },
278 .rx_trace_loss_5 = {
279 0, 0, 0, 0, 0, 0, 0 },
280 .tx_trace_loss_5 = {
281 0, 0, 0, 0, 0, 0, 0 },
282 .rx_rssi_and_proc_compens_5 = {
283 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
284 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
285 0x00, 0x00, 0x00 },
286 .tx_ref_pd_voltage = 0x24e,
287 .tx_ref_power = 0x78,
288 .tx_offset_db = 0x0,
289 .tx_rate_limits_normal = {
290 0x1e, 0x1f, 0x22, 0x24, 0x28, 0x29 },
291 .tx_rate_limits_degraded = {
292 0x1b, 0x1c, 0x1e, 0x20, 0x24, 0x25 },
293 .tx_channel_limits_11b = {
294 0x22, 0x50, 0x50, 0x50, 0x50, 0x50,
295 0x50, 0x50, 0x50, 0x50, 0x22, 0x50,
296 0x22, 0x50 },
297 .tx_channel_limits_ofdm = {
298 0x20, 0x50, 0x50, 0x50, 0x50, 0x50,
299 0x50, 0x50, 0x50, 0x50, 0x20, 0x50,
300 0x20, 0x50 },
301 .tx_pdv_rate_offsets = {
302 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
303 .tx_ibias = {
304 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x27 },
305 .rx_fem_insertion_loss = 0x14,
306 .tx_ref_pd_voltage_5 = {
307 0, 0, 0, 0, 0, 0, 0 },
308 .tx_ref_power_5 = {
309 0, 0, 0, 0, 0, 0, 0 },
310 .tx_offset_db_5 = {
311 0, 0, 0, 0, 0, 0, 0 },
312 .tx_rate_limits_normal_5 = {
313 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
314 .tx_rate_limits_degraded_5 = {
315 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
316 .tx_channel_limits_ofdm_5 = {
317 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
318 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
319 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
320 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
321 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
322 0x00, 0x00, 0x00, 0x00, 0x00},
323 .tx_pdv_rate_offsets_5 = {
324 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
325 .tx_ibias_5 = {
326 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
327 .rx_fem_insertion_loss_5 = {
328 0, 0, 0, 0, 0, 0, 0 }
329 }
227 } 330 }
228 }; 331 };
229 332