Lines Matching +full:auto +full:- +full:detect
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (C) 2009-2010 Nokia Corporation
18 struct wl12xx_priv *priv = wl->priv; in wl1271_cmd_ext_radio_parms()
19 struct wl12xx_conf_rf *rf = &priv->conf.rf; in wl1271_cmd_ext_radio_parms()
22 if (!wl->nvs) in wl1271_cmd_ext_radio_parms()
23 return -ENODEV; in wl1271_cmd_ext_radio_parms()
27 return -ENOMEM; in wl1271_cmd_ext_radio_parms()
29 ext_radio_parms->test.id = TEST_CMD_INI_FILE_RF_EXTENDED_PARAM; in wl1271_cmd_ext_radio_parms()
31 memcpy(ext_radio_parms->tx_per_channel_power_compensation_2, in wl1271_cmd_ext_radio_parms()
32 rf->tx_per_channel_power_compensation_2, in wl1271_cmd_ext_radio_parms()
34 memcpy(ext_radio_parms->tx_per_channel_power_compensation_5, in wl1271_cmd_ext_radio_parms()
35 rf->tx_per_channel_power_compensation_5, in wl1271_cmd_ext_radio_parms()
53 &((struct wl1271_nvs_file *)wl->nvs)->general_params; in wl1271_cmd_general_parms()
54 struct wl12xx_priv *priv = wl->priv; in wl1271_cmd_general_parms()
58 if (!wl->nvs) in wl1271_cmd_general_parms()
59 return -ENODEV; in wl1271_cmd_general_parms()
61 if (gp->tx_bip_fem_manufacturer >= WL1271_INI_FEM_MODULE_COUNT) { in wl1271_cmd_general_parms()
63 return -EINVAL; in wl1271_cmd_general_parms()
68 return -ENOMEM; in wl1271_cmd_general_parms()
70 gen_parms->test.id = TEST_CMD_INI_FILE_GENERAL_PARAM; in wl1271_cmd_general_parms()
72 memcpy(&gen_parms->general_params, gp, sizeof(*gp)); in wl1271_cmd_general_parms()
74 /* If we started in PLT FEM_DETECT mode, force auto detect */ in wl1271_cmd_general_parms()
75 if (wl->plt_mode == PLT_FEM_DETECT) in wl1271_cmd_general_parms()
76 gen_parms->general_params.tx_bip_fem_auto_detect = true; in wl1271_cmd_general_parms()
78 if (gen_parms->general_params.tx_bip_fem_auto_detect) in wl1271_cmd_general_parms()
82 gen_parms->general_params.ref_clock = priv->ref_clock; in wl1271_cmd_general_parms()
90 gp->tx_bip_fem_manufacturer = in wl1271_cmd_general_parms()
91 gen_parms->general_params.tx_bip_fem_manufacturer; in wl1271_cmd_general_parms()
93 if (gp->tx_bip_fem_manufacturer >= WL1271_INI_FEM_MODULE_COUNT) { in wl1271_cmd_general_parms()
95 ret = -EINVAL; in wl1271_cmd_general_parms()
99 /* If we are in calibrator based fem auto detect - save fem nr */ in wl1271_cmd_general_parms()
100 if (wl->plt_mode == PLT_FEM_DETECT) in wl1271_cmd_general_parms()
101 wl->fem_manuf = gp->tx_bip_fem_manufacturer; in wl1271_cmd_general_parms()
106 wl->plt_mode == PLT_FEM_DETECT ? in wl1271_cmd_general_parms()
108 "auto", in wl1271_cmd_general_parms()
109 gp->tx_bip_fem_manufacturer); in wl1271_cmd_general_parms()
120 &((struct wl128x_nvs_file *)wl->nvs)->general_params; in wl128x_cmd_general_parms()
121 struct wl12xx_priv *priv = wl->priv; in wl128x_cmd_general_parms()
125 if (!wl->nvs) in wl128x_cmd_general_parms()
126 return -ENODEV; in wl128x_cmd_general_parms()
128 if (gp->tx_bip_fem_manufacturer >= WL1271_INI_FEM_MODULE_COUNT) { in wl128x_cmd_general_parms()
130 return -EINVAL; in wl128x_cmd_general_parms()
135 return -ENOMEM; in wl128x_cmd_general_parms()
137 gen_parms->test.id = TEST_CMD_INI_FILE_GENERAL_PARAM; in wl128x_cmd_general_parms()
139 memcpy(&gen_parms->general_params, gp, sizeof(*gp)); in wl128x_cmd_general_parms()
141 /* If we started in PLT FEM_DETECT mode, force auto detect */ in wl128x_cmd_general_parms()
142 if (wl->plt_mode == PLT_FEM_DETECT) in wl128x_cmd_general_parms()
143 gen_parms->general_params.tx_bip_fem_auto_detect = true; in wl128x_cmd_general_parms()
145 if (gen_parms->general_params.tx_bip_fem_auto_detect) in wl128x_cmd_general_parms()
149 gen_parms->general_params.ref_clock = priv->ref_clock; in wl128x_cmd_general_parms()
150 gen_parms->general_params.tcxo_ref_clock = priv->tcxo_clock; in wl128x_cmd_general_parms()
158 gp->tx_bip_fem_manufacturer = in wl128x_cmd_general_parms()
159 gen_parms->general_params.tx_bip_fem_manufacturer; in wl128x_cmd_general_parms()
161 if (gp->tx_bip_fem_manufacturer >= WL1271_INI_FEM_MODULE_COUNT) { in wl128x_cmd_general_parms()
163 ret = -EINVAL; in wl128x_cmd_general_parms()
167 /* If we are in calibrator based fem auto detect - save fem nr */ in wl128x_cmd_general_parms()
168 if (wl->plt_mode == PLT_FEM_DETECT) in wl128x_cmd_general_parms()
169 wl->fem_manuf = gp->tx_bip_fem_manufacturer; in wl128x_cmd_general_parms()
174 wl->plt_mode == PLT_FEM_DETECT ? in wl128x_cmd_general_parms()
176 "auto", in wl128x_cmd_general_parms()
177 gp->tx_bip_fem_manufacturer); in wl128x_cmd_general_parms()
186 struct wl1271_nvs_file *nvs = (struct wl1271_nvs_file *)wl->nvs; in wl1271_cmd_radio_parms()
188 struct wl1271_ini_general_params *gp = &nvs->general_params; in wl1271_cmd_radio_parms()
191 if (!wl->nvs) in wl1271_cmd_radio_parms()
192 return -ENODEV; in wl1271_cmd_radio_parms()
196 return -ENOMEM; in wl1271_cmd_radio_parms()
198 radio_parms->test.id = TEST_CMD_INI_FILE_RADIO_PARAM; in wl1271_cmd_radio_parms()
200 fem_idx = WL12XX_FEM_TO_NVS_ENTRY(gp->tx_bip_fem_manufacturer); in wl1271_cmd_radio_parms()
203 memcpy(&radio_parms->static_params_2, &nvs->stat_radio_params_2, in wl1271_cmd_radio_parms()
205 memcpy(&radio_parms->dyn_params_2, in wl1271_cmd_radio_parms()
206 &nvs->dyn_radio_params_2[fem_idx].params, in wl1271_cmd_radio_parms()
210 memcpy(&radio_parms->static_params_5, in wl1271_cmd_radio_parms()
211 &nvs->stat_radio_params_5, in wl1271_cmd_radio_parms()
213 memcpy(&radio_parms->dyn_params_5, in wl1271_cmd_radio_parms()
214 &nvs->dyn_radio_params_5[fem_idx].params, in wl1271_cmd_radio_parms()
230 struct wl128x_nvs_file *nvs = (struct wl128x_nvs_file *)wl->nvs; in wl128x_cmd_radio_parms()
232 struct wl128x_ini_general_params *gp = &nvs->general_params; in wl128x_cmd_radio_parms()
235 if (!wl->nvs) in wl128x_cmd_radio_parms()
236 return -ENODEV; in wl128x_cmd_radio_parms()
240 return -ENOMEM; in wl128x_cmd_radio_parms()
242 radio_parms->test.id = TEST_CMD_INI_FILE_RADIO_PARAM; in wl128x_cmd_radio_parms()
244 fem_idx = WL12XX_FEM_TO_NVS_ENTRY(gp->tx_bip_fem_manufacturer); in wl128x_cmd_radio_parms()
247 memcpy(&radio_parms->static_params_2, &nvs->stat_radio_params_2, in wl128x_cmd_radio_parms()
249 memcpy(&radio_parms->dyn_params_2, in wl128x_cmd_radio_parms()
250 &nvs->dyn_radio_params_2[fem_idx].params, in wl128x_cmd_radio_parms()
254 memcpy(&radio_parms->static_params_5, in wl128x_cmd_radio_parms()
255 &nvs->stat_radio_params_5, in wl128x_cmd_radio_parms()
257 memcpy(&radio_parms->dyn_params_5, in wl128x_cmd_radio_parms()
258 &nvs->dyn_radio_params_5[fem_idx].params, in wl128x_cmd_radio_parms()
261 radio_parms->fem_vendor_and_options = nvs->fem_vendor_and_options; in wl128x_cmd_radio_parms()
285 ret = -ENOMEM; in wl12xx_cmd_channel_switch()
289 cmd->role_id = wlvif->role_id; in wl12xx_cmd_channel_switch()
290 cmd->channel = ch_switch->chandef.chan->hw_value; in wl12xx_cmd_channel_switch()
291 cmd->switch_time = ch_switch->count; in wl12xx_cmd_channel_switch()
292 cmd->stop_tx = ch_switch->block_tx; in wl12xx_cmd_channel_switch()
296 cmd->post_switch_tx_disable = 0; in wl12xx_cmd_channel_switch()