aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2012-05-29 05:44:12 -0400
committerLuciano Coelho <coelho@ti.com>2012-06-08 02:42:09 -0400
commit17d97719dc2fe2b9c13831dc2c8572b54efe00b4 (patch)
treeb63f72b523f5d625ae17671f01e5b2cb2cb4cb4e /drivers/net/wireless
parentd61c6b5550c759728e702e68c8423a23a6991fc3 (diff)
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: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c112
-rw-r--r--drivers/net/wireless/ti/wl18xx/wl18xx.h2
2 files changed, 56 insertions, 58 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index 78b2e54a0be7..b2ccff7d6188 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -45,16 +45,18 @@
45 45
46static char *ht_mode_param = "wide"; 46static char *ht_mode_param = "wide";
47static char *board_type_param = "hdk"; 47static char *board_type_param = "hdk";
48static bool dc2dc_param = false;
49static int n_antennas_2_param = 1;
50static int n_antennas_5_param = 1;
51static bool checksum_param = false; 48static bool checksum_param = false;
52static bool enable_11a_param = true; 49static bool enable_11a_param = true;
53static int low_band_component = -1; 50
54static int low_band_component_type = -1; 51/* phy paramters */
55static int high_band_component = -1; 52static int dc2dc_param = -1;
56static int high_band_component_type = -1; 53static int n_antennas_2_param = -1;
57static int pwr_limit_reference_11_abg = -1; 54static int n_antennas_5_param = -1;
55static int low_band_component_param = -1;
56static int low_band_component_type_param = -1;
57static int high_band_component_param = -1;
58static int high_band_component_type_param = -1;
59static int pwr_limit_reference_11_abg_param = -1;
58 60
59static const u8 wl18xx_rate_to_idx_2ghz[] = { 61static const u8 wl18xx_rate_to_idx_2ghz[] = {
60 /* MCS rates are used only with 11n */ 62 /* MCS rates are used only with 11n */
@@ -516,6 +518,9 @@ static struct wl18xx_priv_conf wl18xx_default_priv_conf = {
516 .low_power_val = 0x00, 518 .low_power_val = 0x00,
517 .med_power_val = 0x0a, 519 .med_power_val = 0x0a,
518 .high_power_val = 0x1e, 520 .high_power_val = 0x1e,
521 .external_pa_dc2dc = 0,
522 .number_of_assembled_ant2_4 = 1,
523 .number_of_assembled_ant5 = 1,
519 }, 524 },
520}; 525};
521 526
@@ -1320,17 +1325,17 @@ static int __devinit wl18xx_probe(struct platform_device *pdev)
1320 goto out_free; 1325 goto out_free;
1321 1326
1322 if (!strcmp(board_type_param, "fpga")) { 1327 if (!strcmp(board_type_param, "fpga")) {
1323 priv->board_type = BOARD_TYPE_FPGA_18XX; 1328 priv->conf.phy.board_type = BOARD_TYPE_FPGA_18XX;
1324 } else if (!strcmp(board_type_param, "hdk")) { 1329 } else if (!strcmp(board_type_param, "hdk")) {
1325 priv->board_type = BOARD_TYPE_HDK_18XX; 1330 priv->conf.phy.board_type = BOARD_TYPE_HDK_18XX;
1326 /* HACK! Just for now we hardcode HDK to 0x06 */ 1331 /* HACK! Just for now we hardcode HDK to 0x06 */
1327 priv->conf.phy.low_band_component_type = 0x06; 1332 priv->conf.phy.low_band_component_type = 0x06;
1328 } else if (!strcmp(board_type_param, "dvp")) { 1333 } else if (!strcmp(board_type_param, "dvp")) {
1329 priv->board_type = BOARD_TYPE_DVP_18XX; 1334 priv->conf.phy.board_type = BOARD_TYPE_DVP_18XX;
1330 } else if (!strcmp(board_type_param, "evb")) { 1335 } else if (!strcmp(board_type_param, "evb")) {
1331 priv->board_type = BOARD_TYPE_EVB_18XX; 1336 priv->conf.phy.board_type = BOARD_TYPE_EVB_18XX;
1332 } else if (!strcmp(board_type_param, "com8")) { 1337 } else if (!strcmp(board_type_param, "com8")) {
1333 priv->board_type = BOARD_TYPE_COM8_18XX; 1338 priv->conf.phy.board_type = BOARD_TYPE_COM8_18XX;
1334 /* HACK! Just for now we hardcode COM8 to 0x06 */ 1339 /* HACK! Just for now we hardcode COM8 to 0x06 */
1335 priv->conf.phy.low_band_component_type = 0x06; 1340 priv->conf.phy.low_band_component_type = 0x06;
1336 } else { 1341 } else {
@@ -1339,38 +1344,26 @@ static int __devinit wl18xx_probe(struct platform_device *pdev)
1339 goto out_free; 1344 goto out_free;
1340 } 1345 }
1341 1346
1342 /* 1347 /* If the module param is set, update it in conf */
1343 * If the module param is not set, update it with the one from 1348 if (low_band_component_param != -1)
1344 * conf. If it is set, overwrite conf with it. 1349 priv->conf.phy.low_band_component = low_band_component_param;
1345 */ 1350 if (low_band_component_type_param != -1)
1346 if (low_band_component == -1)
1347 low_band_component = priv->conf.phy.low_band_component;
1348 else
1349 priv->conf.phy.low_band_component = low_band_component;
1350 if (low_band_component_type == -1)
1351 low_band_component_type =
1352 priv->conf.phy.low_band_component_type;
1353 else
1354 priv->conf.phy.low_band_component_type = 1351 priv->conf.phy.low_band_component_type =
1355 low_band_component_type; 1352 low_band_component_type_param;
1356 1353 if (high_band_component_param != -1)
1357 if (high_band_component == -1) 1354 priv->conf.phy.high_band_component = high_band_component_param;
1358 high_band_component = priv->conf.phy.high_band_component; 1355 if (high_band_component_type_param != -1)
1359 else
1360 priv->conf.phy.high_band_component = high_band_component;
1361 if (high_band_component_type == -1)
1362 high_band_component_type =
1363 priv->conf.phy.high_band_component_type;
1364 else
1365 priv->conf.phy.high_band_component_type = 1356 priv->conf.phy.high_band_component_type =
1366 high_band_component_type; 1357 high_band_component_type_param;
1367 1358 if (pwr_limit_reference_11_abg_param != -1)
1368 if (pwr_limit_reference_11_abg == -1)
1369 pwr_limit_reference_11_abg =
1370 priv->conf.phy.pwr_limit_reference_11_abg;
1371 else
1372 priv->conf.phy.pwr_limit_reference_11_abg = 1359 priv->conf.phy.pwr_limit_reference_11_abg =
1373 pwr_limit_reference_11_abg; 1360 pwr_limit_reference_11_abg_param;
1361 if (n_antennas_2_param != -1)
1362 priv->conf.phy.number_of_assembled_ant2_4 = n_antennas_2_param;
1363 if (n_antennas_5_param != -1)
1364 priv->conf.phy.number_of_assembled_ant5 = n_antennas_5_param;
1365 if (dc2dc_param != -1)
1366 priv->conf.phy.external_pa_dc2dc = dc2dc_param;
1374 1367
1375 if (!checksum_param) { 1368 if (!checksum_param) {
1376 wl18xx_ops.set_rx_csum = NULL; 1369 wl18xx_ops.set_rx_csum = NULL;
@@ -1422,38 +1415,45 @@ module_param_named(board_type, board_type_param, charp, S_IRUSR);
1422MODULE_PARM_DESC(board_type, "Board type: fpga, hdk (default), evb, com8 or " 1415MODULE_PARM_DESC(board_type, "Board type: fpga, hdk (default), evb, com8 or "
1423 "dvp"); 1416 "dvp");
1424 1417
1425module_param_named(dc2dc, dc2dc_param, bool, S_IRUSR);
1426MODULE_PARM_DESC(dc2dc, "External DC2DC: boolean (defaults to false)");
1427
1428module_param_named(n_antennas_2, n_antennas_2_param, uint, S_IRUSR);
1429MODULE_PARM_DESC(n_antennas_2, "Number of installed 2.4GHz antennas: 1 (default) or 2");
1430
1431module_param_named(n_antennas_5, n_antennas_5_param, uint, S_IRUSR);
1432MODULE_PARM_DESC(n_antennas_5, "Number of installed 5GHz antennas: 1 (default) or 2");
1433
1434module_param_named(checksum, checksum_param, bool, S_IRUSR); 1418module_param_named(checksum, checksum_param, bool, S_IRUSR);
1435MODULE_PARM_DESC(checksum, "Enable TCP checksum: boolean (defaults to false)"); 1419MODULE_PARM_DESC(checksum, "Enable TCP checksum: boolean (defaults to false)");
1436 1420
1437module_param_named(enable_11a, enable_11a_param, bool, S_IRUSR); 1421module_param_named(enable_11a, enable_11a_param, bool, S_IRUSR);
1438MODULE_PARM_DESC(enable_11a, "Enable 11a (5GHz): boolean (defaults to true)"); 1422MODULE_PARM_DESC(enable_11a, "Enable 11a (5GHz): boolean (defaults to true)");
1439 1423
1440module_param(low_band_component, uint, S_IRUSR); 1424module_param_named(dc2dc, dc2dc_param, int, S_IRUSR);
1425MODULE_PARM_DESC(dc2dc, "External DC2DC: u8 (defaults to 0)");
1426
1427module_param_named(n_antennas_2, n_antennas_2_param, int, S_IRUSR);
1428MODULE_PARM_DESC(n_antennas_2,
1429 "Number of installed 2.4GHz antennas: 1 (default) or 2");
1430
1431module_param_named(n_antennas_5, n_antennas_5_param, int, S_IRUSR);
1432MODULE_PARM_DESC(n_antennas_5,
1433 "Number of installed 5GHz antennas: 1 (default) or 2");
1434
1435module_param_named(low_band_component, low_band_component_param, int,
1436 S_IRUSR);
1441MODULE_PARM_DESC(low_band_component, "Low band component: u8 " 1437MODULE_PARM_DESC(low_band_component, "Low band component: u8 "
1442 "(default is 0x01)"); 1438 "(default is 0x01)");
1443 1439
1444module_param(low_band_component_type, uint, S_IRUSR); 1440module_param_named(low_band_component_type, low_band_component_type_param,
1441 int, S_IRUSR);
1445MODULE_PARM_DESC(low_band_component_type, "Low band component type: u8 " 1442MODULE_PARM_DESC(low_band_component_type, "Low band component type: u8 "
1446 "(default is 0x05 or 0x06 depending on the board_type)"); 1443 "(default is 0x05 or 0x06 depending on the board_type)");
1447 1444
1448module_param(high_band_component, uint, S_IRUSR); 1445module_param_named(high_band_component, high_band_component_param, int,
1446 S_IRUSR);
1449MODULE_PARM_DESC(high_band_component, "High band component: u8, " 1447MODULE_PARM_DESC(high_band_component, "High band component: u8, "
1450 "(default is 0x01)"); 1448 "(default is 0x01)");
1451 1449
1452module_param(high_band_component_type, uint, S_IRUSR); 1450module_param_named(high_band_component_type, high_band_component_type_param,
1451 int, S_IRUSR);
1453MODULE_PARM_DESC(high_band_component_type, "High band component type: u8 " 1452MODULE_PARM_DESC(high_band_component_type, "High band component type: u8 "
1454 "(default is 0x09)"); 1453 "(default is 0x09)");
1455 1454
1456module_param(pwr_limit_reference_11_abg, uint, S_IRUSR); 1455module_param_named(pwr_limit_reference_11_abg,
1456 pwr_limit_reference_11_abg_param, int, S_IRUSR);
1457MODULE_PARM_DESC(pwr_limit_reference_11_abg, "Power limit reference: u8 " 1457MODULE_PARM_DESC(pwr_limit_reference_11_abg, "Power limit reference: u8 "
1458 "(default is 0xc8)"); 1458 "(default is 0xc8)");
1459 1459
diff --git a/drivers/net/wireless/ti/wl18xx/wl18xx.h b/drivers/net/wireless/ti/wl18xx/wl18xx.h
index b9c43097d2f6..bc67a4750615 100644
--- a/drivers/net/wireless/ti/wl18xx/wl18xx.h
+++ b/drivers/net/wireless/ti/wl18xx/wl18xx.h
@@ -35,8 +35,6 @@ struct wl18xx_priv {
35 /* Index of last released Tx desc in FW */ 35 /* Index of last released Tx desc in FW */
36 u8 last_fw_rls_idx; 36 u8 last_fw_rls_idx;
37 37
38 u8 board_type;
39
40 /* number of VIFs requiring extra spare mem-blocks */ 38 /* number of VIFs requiring extra spare mem-blocks */
41 int extra_spare_vif_count; 39 int extra_spare_vif_count;
42}; 40};