Commit 17d97719 authored by Arik Nemtsov's avatar Arik Nemtsov Committed by Luciano Coelho

wl18xx: clean up phy module parameters

Give all wl18xx phy module paramters -1 as a default value, indicating
the paramter was not set. Add previous default values to the default
18xx priv conf structure.

Remove the board_type field from wl18xx priv. The field with the same
name inside the phy conf is good enough for our purposes.
Signed-off-by: default avatarArik Nemtsov <arik@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent d61c6b55
...@@ -45,16 +45,18 @@ ...@@ -45,16 +45,18 @@
static char *ht_mode_param = "wide"; static char *ht_mode_param = "wide";
static char *board_type_param = "hdk"; static char *board_type_param = "hdk";
static bool dc2dc_param = false;
static int n_antennas_2_param = 1;
static int n_antennas_5_param = 1;
static bool checksum_param = false; static bool checksum_param = false;
static bool enable_11a_param = true; static bool enable_11a_param = true;
static int low_band_component = -1;
static int low_band_component_type = -1; /* phy paramters */
static int high_band_component = -1; static int dc2dc_param = -1;
static int high_band_component_type = -1; static int n_antennas_2_param = -1;
static int pwr_limit_reference_11_abg = -1; static int n_antennas_5_param = -1;
static int low_band_component_param = -1;
static int low_band_component_type_param = -1;
static int high_band_component_param = -1;
static int high_band_component_type_param = -1;
static int pwr_limit_reference_11_abg_param = -1;
static const u8 wl18xx_rate_to_idx_2ghz[] = { static const u8 wl18xx_rate_to_idx_2ghz[] = {
/* MCS rates are used only with 11n */ /* MCS rates are used only with 11n */
...@@ -516,6 +518,9 @@ static struct wl18xx_priv_conf wl18xx_default_priv_conf = { ...@@ -516,6 +518,9 @@ static struct wl18xx_priv_conf wl18xx_default_priv_conf = {
.low_power_val = 0x00, .low_power_val = 0x00,
.med_power_val = 0x0a, .med_power_val = 0x0a,
.high_power_val = 0x1e, .high_power_val = 0x1e,
.external_pa_dc2dc = 0,
.number_of_assembled_ant2_4 = 1,
.number_of_assembled_ant5 = 1,
}, },
}; };
...@@ -1320,17 +1325,17 @@ static int __devinit wl18xx_probe(struct platform_device *pdev) ...@@ -1320,17 +1325,17 @@ static int __devinit wl18xx_probe(struct platform_device *pdev)
goto out_free; goto out_free;
if (!strcmp(board_type_param, "fpga")) { if (!strcmp(board_type_param, "fpga")) {
priv->board_type = BOARD_TYPE_FPGA_18XX; priv->conf.phy.board_type = BOARD_TYPE_FPGA_18XX;
} else if (!strcmp(board_type_param, "hdk")) { } else if (!strcmp(board_type_param, "hdk")) {
priv->board_type = BOARD_TYPE_HDK_18XX; priv->conf.phy.board_type = BOARD_TYPE_HDK_18XX;
/* HACK! Just for now we hardcode HDK to 0x06 */ /* HACK! Just for now we hardcode HDK to 0x06 */
priv->conf.phy.low_band_component_type = 0x06; priv->conf.phy.low_band_component_type = 0x06;
} else if (!strcmp(board_type_param, "dvp")) { } else if (!strcmp(board_type_param, "dvp")) {
priv->board_type = BOARD_TYPE_DVP_18XX; priv->conf.phy.board_type = BOARD_TYPE_DVP_18XX;
} else if (!strcmp(board_type_param, "evb")) { } else if (!strcmp(board_type_param, "evb")) {
priv->board_type = BOARD_TYPE_EVB_18XX; priv->conf.phy.board_type = BOARD_TYPE_EVB_18XX;
} else if (!strcmp(board_type_param, "com8")) { } else if (!strcmp(board_type_param, "com8")) {
priv->board_type = BOARD_TYPE_COM8_18XX; priv->conf.phy.board_type = BOARD_TYPE_COM8_18XX;
/* HACK! Just for now we hardcode COM8 to 0x06 */ /* HACK! Just for now we hardcode COM8 to 0x06 */
priv->conf.phy.low_band_component_type = 0x06; priv->conf.phy.low_band_component_type = 0x06;
} else { } else {
...@@ -1339,38 +1344,26 @@ static int __devinit wl18xx_probe(struct platform_device *pdev) ...@@ -1339,38 +1344,26 @@ static int __devinit wl18xx_probe(struct platform_device *pdev)
goto out_free; goto out_free;
} }
/* /* If the module param is set, update it in conf */
* If the module param is not set, update it with the one from if (low_band_component_param != -1)
* conf. If it is set, overwrite conf with it. priv->conf.phy.low_band_component = low_band_component_param;
*/ if (low_band_component_type_param != -1)
if (low_band_component == -1)
low_band_component = priv->conf.phy.low_band_component;
else
priv->conf.phy.low_band_component = low_band_component;
if (low_band_component_type == -1)
low_band_component_type =
priv->conf.phy.low_band_component_type;
else
priv->conf.phy.low_band_component_type = priv->conf.phy.low_band_component_type =
low_band_component_type; low_band_component_type_param;
if (high_band_component_param != -1)
if (high_band_component == -1) priv->conf.phy.high_band_component = high_band_component_param;
high_band_component = priv->conf.phy.high_band_component; if (high_band_component_type_param != -1)
else
priv->conf.phy.high_band_component = high_band_component;
if (high_band_component_type == -1)
high_band_component_type =
priv->conf.phy.high_band_component_type;
else
priv->conf.phy.high_band_component_type = priv->conf.phy.high_band_component_type =
high_band_component_type; high_band_component_type_param;
if (pwr_limit_reference_11_abg_param != -1)
if (pwr_limit_reference_11_abg == -1)
pwr_limit_reference_11_abg =
priv->conf.phy.pwr_limit_reference_11_abg;
else
priv->conf.phy.pwr_limit_reference_11_abg = priv->conf.phy.pwr_limit_reference_11_abg =
pwr_limit_reference_11_abg; pwr_limit_reference_11_abg_param;
if (n_antennas_2_param != -1)
priv->conf.phy.number_of_assembled_ant2_4 = n_antennas_2_param;
if (n_antennas_5_param != -1)
priv->conf.phy.number_of_assembled_ant5 = n_antennas_5_param;
if (dc2dc_param != -1)
priv->conf.phy.external_pa_dc2dc = dc2dc_param;
if (!checksum_param) { if (!checksum_param) {
wl18xx_ops.set_rx_csum = NULL; wl18xx_ops.set_rx_csum = NULL;
...@@ -1422,38 +1415,45 @@ module_param_named(board_type, board_type_param, charp, S_IRUSR); ...@@ -1422,38 +1415,45 @@ module_param_named(board_type, board_type_param, charp, S_IRUSR);
MODULE_PARM_DESC(board_type, "Board type: fpga, hdk (default), evb, com8 or " MODULE_PARM_DESC(board_type, "Board type: fpga, hdk (default), evb, com8 or "
"dvp"); "dvp");
module_param_named(dc2dc, dc2dc_param, bool, S_IRUSR);
MODULE_PARM_DESC(dc2dc, "External DC2DC: boolean (defaults to false)");
module_param_named(n_antennas_2, n_antennas_2_param, uint, S_IRUSR);
MODULE_PARM_DESC(n_antennas_2, "Number of installed 2.4GHz antennas: 1 (default) or 2");
module_param_named(n_antennas_5, n_antennas_5_param, uint, S_IRUSR);
MODULE_PARM_DESC(n_antennas_5, "Number of installed 5GHz antennas: 1 (default) or 2");
module_param_named(checksum, checksum_param, bool, S_IRUSR); module_param_named(checksum, checksum_param, bool, S_IRUSR);
MODULE_PARM_DESC(checksum, "Enable TCP checksum: boolean (defaults to false)"); MODULE_PARM_DESC(checksum, "Enable TCP checksum: boolean (defaults to false)");
module_param_named(enable_11a, enable_11a_param, bool, S_IRUSR); module_param_named(enable_11a, enable_11a_param, bool, S_IRUSR);
MODULE_PARM_DESC(enable_11a, "Enable 11a (5GHz): boolean (defaults to true)"); MODULE_PARM_DESC(enable_11a, "Enable 11a (5GHz): boolean (defaults to true)");
module_param(low_band_component, uint, S_IRUSR); module_param_named(dc2dc, dc2dc_param, int, S_IRUSR);
MODULE_PARM_DESC(dc2dc, "External DC2DC: u8 (defaults to 0)");
module_param_named(n_antennas_2, n_antennas_2_param, int, S_IRUSR);
MODULE_PARM_DESC(n_antennas_2,
"Number of installed 2.4GHz antennas: 1 (default) or 2");
module_param_named(n_antennas_5, n_antennas_5_param, int, S_IRUSR);
MODULE_PARM_DESC(n_antennas_5,
"Number of installed 5GHz antennas: 1 (default) or 2");
module_param_named(low_band_component, low_band_component_param, int,
S_IRUSR);
MODULE_PARM_DESC(low_band_component, "Low band component: u8 " MODULE_PARM_DESC(low_band_component, "Low band component: u8 "
"(default is 0x01)"); "(default is 0x01)");
module_param(low_band_component_type, uint, S_IRUSR); module_param_named(low_band_component_type, low_band_component_type_param,
int, S_IRUSR);
MODULE_PARM_DESC(low_band_component_type, "Low band component type: u8 " MODULE_PARM_DESC(low_band_component_type, "Low band component type: u8 "
"(default is 0x05 or 0x06 depending on the board_type)"); "(default is 0x05 or 0x06 depending on the board_type)");
module_param(high_band_component, uint, S_IRUSR); module_param_named(high_band_component, high_band_component_param, int,
S_IRUSR);
MODULE_PARM_DESC(high_band_component, "High band component: u8, " MODULE_PARM_DESC(high_band_component, "High band component: u8, "
"(default is 0x01)"); "(default is 0x01)");
module_param(high_band_component_type, uint, S_IRUSR); module_param_named(high_band_component_type, high_band_component_type_param,
int, S_IRUSR);
MODULE_PARM_DESC(high_band_component_type, "High band component type: u8 " MODULE_PARM_DESC(high_band_component_type, "High band component type: u8 "
"(default is 0x09)"); "(default is 0x09)");
module_param(pwr_limit_reference_11_abg, uint, S_IRUSR); module_param_named(pwr_limit_reference_11_abg,
pwr_limit_reference_11_abg_param, int, S_IRUSR);
MODULE_PARM_DESC(pwr_limit_reference_11_abg, "Power limit reference: u8 " MODULE_PARM_DESC(pwr_limit_reference_11_abg, "Power limit reference: u8 "
"(default is 0xc8)"); "(default is 0xc8)");
......
...@@ -35,8 +35,6 @@ struct wl18xx_priv { ...@@ -35,8 +35,6 @@ struct wl18xx_priv {
/* Index of last released Tx desc in FW */ /* Index of last released Tx desc in FW */
u8 last_fw_rls_idx; u8 last_fw_rls_idx;
u8 board_type;
/* number of VIFs requiring extra spare mem-blocks */ /* number of VIFs requiring extra spare mem-blocks */
int extra_spare_vif_count; int extra_spare_vif_count;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment