diff options
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/conf.h | 37 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/main.c | 52 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/reg.h | 57 |
3 files changed, 36 insertions, 110 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/conf.h b/drivers/net/wireless/ti/wl18xx/conf.h index 130546aa970d..fac0b7e87e75 100644 --- a/drivers/net/wireless/ti/wl18xx/conf.h +++ b/drivers/net/wireless/ti/wl18xx/conf.h | |||
@@ -23,41 +23,70 @@ | |||
23 | #define __WL18XX_CONF_H__ | 23 | #define __WL18XX_CONF_H__ |
24 | 24 | ||
25 | #define WL18XX_CONF_MAGIC 0x10e100ca | 25 | #define WL18XX_CONF_MAGIC 0x10e100ca |
26 | #define WL18XX_CONF_VERSION (WLCORE_CONF_VERSION | 0x0001) | 26 | #define WL18XX_CONF_VERSION (WLCORE_CONF_VERSION | 0x0002) |
27 | #define WL18XX_CONF_MASK 0x0000ffff | 27 | #define WL18XX_CONF_MASK 0x0000ffff |
28 | #define WL18XX_CONF_SIZE (WLCORE_CONF_SIZE + \ | 28 | #define WL18XX_CONF_SIZE (WLCORE_CONF_SIZE + \ |
29 | sizeof(struct wl18xx_priv_conf)) | 29 | sizeof(struct wl18xx_priv_conf)) |
30 | 30 | ||
31 | struct wl18xx_conf_phy { | 31 | #define NUM_OF_CHANNELS_11_ABG 150 |
32 | #define NUM_OF_CHANNELS_11_P 7 | ||
33 | #define WL18XX_NUM_OF_SUB_BANDS 9 | ||
34 | #define SRF_TABLE_LEN 16 | ||
35 | #define PIN_MUXING_SIZE 2 | ||
36 | |||
37 | struct wl18xx_mac_and_phy_params { | ||
32 | u8 phy_standalone; | 38 | u8 phy_standalone; |
33 | u8 rdl; | 39 | u8 rdl; |
34 | u8 enable_clpc; | 40 | u8 enable_clpc; |
35 | u8 enable_tx_low_pwr_on_siso_rdl; | 41 | u8 enable_tx_low_pwr_on_siso_rdl; |
36 | u8 auto_detect; | 42 | u8 auto_detect; |
37 | u8 dedicated_fem; | 43 | u8 dedicated_fem; |
44 | |||
38 | u8 low_band_component; | 45 | u8 low_band_component; |
46 | |||
47 | /* Bit 0: One Hot, Bit 1: Control Enable, Bit 2: 1.8V, Bit 3: 3V */ | ||
39 | u8 low_band_component_type; | 48 | u8 low_band_component_type; |
49 | |||
40 | u8 high_band_component; | 50 | u8 high_band_component; |
51 | |||
52 | /* Bit 0: One Hot, Bit 1: Control Enable, Bit 2: 1.8V, Bit 3: 3V */ | ||
41 | u8 high_band_component_type; | 53 | u8 high_band_component_type; |
54 | u8 number_of_assembled_ant2_4; | ||
55 | u8 number_of_assembled_ant5; | ||
56 | u8 pin_muxing_platform_options[PIN_MUXING_SIZE]; | ||
57 | u8 external_pa_dc2dc; | ||
42 | u8 tcxo_ldo_voltage; | 58 | u8 tcxo_ldo_voltage; |
43 | u8 xtal_itrim_val; | 59 | u8 xtal_itrim_val; |
44 | u8 srf_state; | 60 | u8 srf_state; |
61 | u8 srf1[SRF_TABLE_LEN]; | ||
62 | u8 srf2[SRF_TABLE_LEN]; | ||
63 | u8 srf3[SRF_TABLE_LEN]; | ||
45 | u8 io_configuration; | 64 | u8 io_configuration; |
46 | u8 sdio_configuration; | 65 | u8 sdio_configuration; |
47 | u8 settings; | 66 | u8 settings; |
48 | u8 rx_profile; | 67 | u8 rx_profile; |
68 | u8 per_chan_pwr_limit_arr_11abg[NUM_OF_CHANNELS_11_ABG]; | ||
69 | u8 pwr_limit_reference_11_abg; | ||
70 | u8 per_chan_pwr_limit_arr_11p[NUM_OF_CHANNELS_11_P]; | ||
71 | u8 pwr_limit_reference_11p; | ||
72 | u8 per_sub_band_tx_trace_loss[WL18XX_NUM_OF_SUB_BANDS]; | ||
73 | u8 per_sub_band_rx_trace_loss[WL18XX_NUM_OF_SUB_BANDS]; | ||
49 | u8 primary_clock_setting_time; | 74 | u8 primary_clock_setting_time; |
50 | u8 clock_valid_on_wake_up; | 75 | u8 clock_valid_on_wake_up; |
51 | u8 secondary_clock_setting_time; | 76 | u8 secondary_clock_setting_time; |
52 | u8 pwr_limit_reference_11_abg; | 77 | u8 board_type; |
78 | /* enable point saturation */ | ||
53 | u8 psat; | 79 | u8 psat; |
80 | /* low/medium/high Tx power in dBm */ | ||
54 | s8 low_power_val; | 81 | s8 low_power_val; |
55 | s8 med_power_val; | 82 | s8 med_power_val; |
56 | s8 high_power_val; | 83 | s8 high_power_val; |
84 | u8 padding[1]; | ||
57 | } __packed; | 85 | } __packed; |
58 | 86 | ||
59 | struct wl18xx_priv_conf { | 87 | struct wl18xx_priv_conf { |
60 | struct wl18xx_conf_phy phy; | 88 | /* this structure is copied wholesale to FW */ |
89 | struct wl18xx_mac_and_phy_params phy; | ||
61 | } __packed; | 90 | } __packed; |
62 | 91 | ||
63 | #endif /* __WL18XX_CONF_H__ */ | 92 | #endif /* __WL18XX_CONF_H__ */ |
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c index c26015b8830c..78b2e54a0be7 100644 --- a/drivers/net/wireless/ti/wl18xx/main.c +++ b/drivers/net/wireless/ti/wl18xx/main.c | |||
@@ -716,63 +716,17 @@ static void wl18xx_pre_upload(struct wl1271 *wl) | |||
716 | static void wl18xx_set_mac_and_phy(struct wl1271 *wl) | 716 | static void wl18xx_set_mac_and_phy(struct wl1271 *wl) |
717 | { | 717 | { |
718 | struct wl18xx_priv *priv = wl->priv; | 718 | struct wl18xx_priv *priv = wl->priv; |
719 | struct wl18xx_conf_phy *phy = &priv->conf.phy; | ||
720 | struct wl18xx_mac_and_phy_params params; | ||
721 | size_t len; | 719 | size_t len; |
722 | 720 | ||
723 | memset(¶ms, 0, sizeof(params)); | ||
724 | |||
725 | params.phy_standalone = phy->phy_standalone; | ||
726 | params.rdl = phy->rdl; | ||
727 | params.enable_clpc = phy->enable_clpc; | ||
728 | params.enable_tx_low_pwr_on_siso_rdl = | ||
729 | phy->enable_tx_low_pwr_on_siso_rdl; | ||
730 | params.auto_detect = phy->auto_detect; | ||
731 | params.dedicated_fem = phy->dedicated_fem; | ||
732 | params.low_band_component = phy->low_band_component; | ||
733 | params.low_band_component_type = | ||
734 | phy->low_band_component_type; | ||
735 | params.high_band_component = phy->high_band_component; | ||
736 | params.high_band_component_type = | ||
737 | phy->high_band_component_type; | ||
738 | params.number_of_assembled_ant2_4 = | ||
739 | n_antennas_2_param; | ||
740 | params.number_of_assembled_ant5 = | ||
741 | n_antennas_5_param; | ||
742 | params.external_pa_dc2dc = dc2dc_param; | ||
743 | params.tcxo_ldo_voltage = phy->tcxo_ldo_voltage; | ||
744 | params.xtal_itrim_val = phy->xtal_itrim_val; | ||
745 | params.srf_state = phy->srf_state; | ||
746 | params.io_configuration = phy->io_configuration; | ||
747 | params.sdio_configuration = phy->sdio_configuration; | ||
748 | params.settings = phy->settings; | ||
749 | params.rx_profile = phy->rx_profile; | ||
750 | params.primary_clock_setting_time = | ||
751 | phy->primary_clock_setting_time; | ||
752 | params.clock_valid_on_wake_up = | ||
753 | phy->clock_valid_on_wake_up; | ||
754 | params.secondary_clock_setting_time = | ||
755 | phy->secondary_clock_setting_time; | ||
756 | params.pwr_limit_reference_11_abg = | ||
757 | phy->pwr_limit_reference_11_abg; | ||
758 | |||
759 | params.board_type = priv->board_type; | ||
760 | |||
761 | /* for PG2 only */ | ||
762 | params.psat = phy->psat; | ||
763 | params.low_power_val = phy->low_power_val; | ||
764 | params.med_power_val = phy->med_power_val; | ||
765 | params.high_power_val = phy->high_power_val; | ||
766 | |||
767 | /* the parameters struct is smaller for PG1 */ | 721 | /* the parameters struct is smaller for PG1 */ |
768 | if (wl->chip.id == CHIP_ID_185x_PG10) | 722 | if (wl->chip.id == CHIP_ID_185x_PG10) |
769 | len = offsetof(struct wl18xx_mac_and_phy_params, psat) + 1; | 723 | len = offsetof(struct wl18xx_mac_and_phy_params, psat) + 1; |
770 | else | 724 | else |
771 | len = sizeof(params); | 725 | len = sizeof(struct wl18xx_mac_and_phy_params); |
772 | 726 | ||
773 | wlcore_set_partition(wl, &wl->ptable[PART_PHY_INIT]); | 727 | wlcore_set_partition(wl, &wl->ptable[PART_PHY_INIT]); |
774 | wl1271_write(wl, WL18XX_PHY_INIT_MEM_ADDR, (u8 *)¶ms, | 728 | wl1271_write(wl, WL18XX_PHY_INIT_MEM_ADDR, (u8 *)&priv->conf.phy, len, |
775 | len, false); | 729 | false); |
776 | } | 730 | } |
777 | 731 | ||
778 | static void wl18xx_enable_interrupts(struct wl1271 *wl) | 732 | static void wl18xx_enable_interrupts(struct wl1271 *wl) |
diff --git a/drivers/net/wireless/ti/wl18xx/reg.h b/drivers/net/wireless/ti/wl18xx/reg.h index a824b26702a8..937b71d8783f 100644 --- a/drivers/net/wireless/ti/wl18xx/reg.h +++ b/drivers/net/wireless/ti/wl18xx/reg.h | |||
@@ -164,13 +164,6 @@ | |||
164 | */ | 164 | */ |
165 | #define WL18XX_SCR_PAD8_PLT 0xBABABEBE | 165 | #define WL18XX_SCR_PAD8_PLT 0xBABABEBE |
166 | 166 | ||
167 | /* TODO: maybe move elsewhere? */ | ||
168 | #define NUM_OF_CHANNELS_11_ABG 150 | ||
169 | #define NUM_OF_CHANNELS_11_P 7 | ||
170 | #define WL18XX_NUM_OF_SUB_BANDS 9 | ||
171 | #define SRF_TABLE_LEN 16 | ||
172 | #define PIN_MUXING_SIZE 2 | ||
173 | |||
174 | enum { | 167 | enum { |
175 | COMPONENT_NO_SWITCH = 0x0, | 168 | COMPONENT_NO_SWITCH = 0x0, |
176 | COMPONENT_2_WAY_SWITCH = 0x1, | 169 | COMPONENT_2_WAY_SWITCH = 0x1, |
@@ -195,54 +188,4 @@ enum { | |||
195 | NUM_BOARD_TYPES, | 188 | NUM_BOARD_TYPES, |
196 | }; | 189 | }; |
197 | 190 | ||
198 | struct wl18xx_mac_and_phy_params { | ||
199 | u8 phy_standalone; | ||
200 | u8 rdl; | ||
201 | u8 enable_clpc; | ||
202 | u8 enable_tx_low_pwr_on_siso_rdl; | ||
203 | u8 auto_detect; | ||
204 | u8 dedicated_fem; | ||
205 | |||
206 | u8 low_band_component; | ||
207 | |||
208 | /* Bit 0: One Hot, Bit 1: Control Enable, Bit 2: 1.8V, Bit 3: 3V */ | ||
209 | u8 low_band_component_type; | ||
210 | |||
211 | u8 high_band_component; | ||
212 | |||
213 | /* Bit 0: One Hot, Bit 1: Control Enable, Bit 2: 1.8V, Bit 3: 3V */ | ||
214 | u8 high_band_component_type; | ||
215 | u8 number_of_assembled_ant2_4; | ||
216 | u8 number_of_assembled_ant5; | ||
217 | u8 pin_muxing_platform_options[PIN_MUXING_SIZE]; | ||
218 | u8 external_pa_dc2dc; | ||
219 | u8 tcxo_ldo_voltage; | ||
220 | u8 xtal_itrim_val; | ||
221 | u8 srf_state; | ||
222 | u8 srf1[SRF_TABLE_LEN]; | ||
223 | u8 srf2[SRF_TABLE_LEN]; | ||
224 | u8 srf3[SRF_TABLE_LEN]; | ||
225 | u8 io_configuration; | ||
226 | u8 sdio_configuration; | ||
227 | u8 settings; | ||
228 | u8 rx_profile; | ||
229 | u8 per_chan_pwr_limit_arr_11abg[NUM_OF_CHANNELS_11_ABG]; | ||
230 | u8 pwr_limit_reference_11_abg; | ||
231 | u8 per_chan_pwr_limit_arr_11p[NUM_OF_CHANNELS_11_P]; | ||
232 | u8 pwr_limit_reference_11p; | ||
233 | u8 per_sub_band_tx_trace_loss[WL18XX_NUM_OF_SUB_BANDS]; | ||
234 | u8 per_sub_band_rx_trace_loss[WL18XX_NUM_OF_SUB_BANDS]; | ||
235 | u8 primary_clock_setting_time; | ||
236 | u8 clock_valid_on_wake_up; | ||
237 | u8 secondary_clock_setting_time; | ||
238 | u8 board_type; | ||
239 | /* enable point saturation */ | ||
240 | u8 psat; | ||
241 | /* low/medium/high Tx power in dBm */ | ||
242 | s8 low_power_val; | ||
243 | s8 med_power_val; | ||
244 | s8 high_power_val; | ||
245 | u8 padding[1]; | ||
246 | } __packed; | ||
247 | |||
248 | #endif /* __REG_H__ */ | 191 | #endif /* __REG_H__ */ |