diff options
author | Arik Nemtsov | 2012-05-29 04:44:12 -0500 |
---|---|---|
committer | Arik Nemtsov | 2012-05-29 13:58:43 -0500 |
commit | 0b431294eabb7216333bf4615654b3d77f55ddf9 (patch) | |
tree | 605c2c0528e9418ec08c2060e8b0143b39ceaa62 | |
parent | 05bb4c29da46a8d332537d035a27b331061504d9 (diff) | |
download | wl18xx-0b431294eabb7216333bf4615654b3d77f55ddf9.tar.gz wl18xx-0b431294eabb7216333bf4615654b3d77f55ddf9.tar.xz wl18xx-0b431294eabb7216333bf4615654b3d77f55ddf9.zip |
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>
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/main.c | 110 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/wl18xx.h | 2 |
2 files changed, 55 insertions, 57 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c index c05d8bdf3ed8..93d6811bc975 100644 --- a/drivers/net/wireless/ti/wl18xx/main.c +++ b/drivers/net/wireless/ti/wl18xx/main.c | |||
@@ -46,18 +46,20 @@ | |||
46 | 46 | ||
47 | static char *ht_mode_param = "wide"; | 47 | static char *ht_mode_param = "wide"; |
48 | static char *board_type_param = "hdk"; | 48 | static char *board_type_param = "hdk"; |
49 | static bool dc2dc_param = false; | ||
50 | static int n_antennas_2_param = 1; | ||
51 | static int n_antennas_5_param = 1; | ||
52 | static bool checksum_param = false; | 49 | static bool checksum_param = false; |
53 | static bool enable_11a_param = true; | 50 | static bool enable_11a_param = true; |
54 | static int low_band_component = -1; | ||
55 | static int low_band_component_type = -1; | ||
56 | static int high_band_component = -1; | ||
57 | static int high_band_component_type = -1; | ||
58 | static int pwr_limit_reference_11_abg = -1; | ||
59 | static bool disable_yield_fix = true; | 51 | static bool disable_yield_fix = true; |
60 | static bool enable_pad_last_frame = true; | 52 | static bool enable_pad_last_frame = true; |
53 | |||
54 | /* phy paramters */ | ||
55 | static int dc2dc_param = -1; | ||
56 | static int n_antennas_2_param = -1; | ||
57 | static int n_antennas_5_param = -1; | ||
58 | static int low_band_component_param = -1; | ||
59 | static int low_band_component_type_param = -1; | ||
60 | static int high_band_component_param = -1; | ||
61 | static int high_band_component_type_param = -1; | ||
62 | static int pwr_limit_reference_11_abg_param = -1; | ||
61 | static int Psat = -1; | 63 | static int Psat = -1; |
62 | static int low_power_val = 0xff; | 64 | static int low_power_val = 0xff; |
63 | static int med_power_val = 0xff; | 65 | static int med_power_val = 0xff; |
@@ -519,6 +521,9 @@ static struct wl18xx_priv_conf wl18xx_default_priv_conf = { | |||
519 | .low_power_val = 0x00, | 521 | .low_power_val = 0x00, |
520 | .med_power_val = 0x0a, | 522 | .med_power_val = 0x0a, |
521 | .high_power_val = 0x1e, | 523 | .high_power_val = 0x1e, |
524 | .external_pa_dc2dc = 0, | ||
525 | .number_of_assembled_ant2_4 = 1, | ||
526 | .number_of_assembled_ant5 = 1, | ||
522 | }, | 527 | }, |
523 | }; | 528 | }; |
524 | 529 | ||
@@ -1477,17 +1482,17 @@ int __devinit wl18xx_probe(struct platform_device *pdev) | |||
1477 | goto out_free; | 1482 | goto out_free; |
1478 | 1483 | ||
1479 | if (!strcmp(board_type_param, "fpga")) { | 1484 | if (!strcmp(board_type_param, "fpga")) { |
1480 | priv->board_type = BOARD_TYPE_FPGA_18XX; | 1485 | priv->conf.phy.board_type = BOARD_TYPE_FPGA_18XX; |
1481 | } else if (!strcmp(board_type_param, "hdk")) { | 1486 | } else if (!strcmp(board_type_param, "hdk")) { |
1482 | priv->board_type = BOARD_TYPE_HDK_18XX; | 1487 | priv->conf.phy.board_type = BOARD_TYPE_HDK_18XX; |
1483 | /* HACK! Just for now we hardcode HDK to 0x06 */ | 1488 | /* HACK! Just for now we hardcode HDK to 0x06 */ |
1484 | priv->conf.phy.low_band_component_type = 0x06; | 1489 | priv->conf.phy.low_band_component_type = 0x06; |
1485 | } else if (!strcmp(board_type_param, "dvp")) { | 1490 | } else if (!strcmp(board_type_param, "dvp")) { |
1486 | priv->board_type = BOARD_TYPE_DVP_18XX; | 1491 | priv->conf.phy.board_type = BOARD_TYPE_DVP_18XX; |
1487 | } else if (!strcmp(board_type_param, "evb")) { | 1492 | } else if (!strcmp(board_type_param, "evb")) { |
1488 | priv->board_type = BOARD_TYPE_EVB_18XX; | 1493 | priv->conf.phy.board_type = BOARD_TYPE_EVB_18XX; |
1489 | } else if (!strcmp(board_type_param, "com8")) { | 1494 | } else if (!strcmp(board_type_param, "com8")) { |
1490 | priv->board_type = BOARD_TYPE_COM8_18XX; | 1495 | priv->conf.phy.board_type = BOARD_TYPE_COM8_18XX; |
1491 | /* HACK! Just for now we hardcode COM8 to 0x06 */ | 1496 | /* HACK! Just for now we hardcode COM8 to 0x06 */ |
1492 | priv->conf.phy.low_band_component_type = 0x06; | 1497 | priv->conf.phy.low_band_component_type = 0x06; |
1493 | } else { | 1498 | } else { |
@@ -1496,38 +1501,26 @@ int __devinit wl18xx_probe(struct platform_device *pdev) | |||
1496 | goto out_free; | 1501 | goto out_free; |
1497 | } | 1502 | } |
1498 | 1503 | ||
1499 | /* | 1504 | /* If the module param is set, update it in conf */ |
1500 | * If the module param is not set, update it with the one from | 1505 | if (low_band_component_param != -1) |
1501 | * conf. If it is set, overwrite conf with it. | 1506 | priv->conf.phy.low_band_component = low_band_component_param; |
1502 | */ | 1507 | if (low_band_component_type_param != -1) |
1503 | if (low_band_component == -1) | 1508 | priv->conf.phy.low_band_component_type = |
1504 | low_band_component = priv->conf.phy.low_band_component; | 1509 | low_band_component_type_param; |
1505 | else | 1510 | if (high_band_component_param != -1) |
1506 | priv->conf.phy.low_band_component = low_band_component; | 1511 | priv->conf.phy.high_band_component = high_band_component_param; |
1507 | if (low_band_component_type == -1) | 1512 | if (high_band_component_type_param != -1) |
1508 | low_band_component_type = | 1513 | priv->conf.phy.high_band_component_type = |
1509 | priv->conf.phy.low_band_component_type; | 1514 | high_band_component_type_param; |
1510 | else | 1515 | if (pwr_limit_reference_11_abg_param != -1) |
1511 | priv->conf.phy.low_band_component_type = | ||
1512 | low_band_component_type; | ||
1513 | |||
1514 | if (high_band_component == -1) | ||
1515 | high_band_component = priv->conf.phy.high_band_component; | ||
1516 | else | ||
1517 | priv->conf.phy.high_band_component = high_band_component; | ||
1518 | if (high_band_component_type == -1) | ||
1519 | high_band_component_type = | ||
1520 | priv->conf.phy.high_band_component_type; | ||
1521 | else | ||
1522 | priv->conf.phy.high_band_component_type = | ||
1523 | high_band_component_type; | ||
1524 | |||
1525 | if (pwr_limit_reference_11_abg == -1) | ||
1526 | pwr_limit_reference_11_abg = | ||
1527 | priv->conf.phy.pwr_limit_reference_11_abg; | ||
1528 | else | ||
1529 | priv->conf.phy.pwr_limit_reference_11_abg = | 1516 | priv->conf.phy.pwr_limit_reference_11_abg = |
1530 | pwr_limit_reference_11_abg; | 1517 | pwr_limit_reference_11_abg_param; |
1518 | if (n_antennas_2_param != -1) | ||
1519 | priv->conf.phy.number_of_assembled_ant2_4 = n_antennas_2_param; | ||
1520 | if (n_antennas_5_param != -1) | ||
1521 | priv->conf.phy.number_of_assembled_ant5 = n_antennas_5_param; | ||
1522 | if (dc2dc_param != -1) | ||
1523 | priv->conf.phy.external_pa_dc2dc = dc2dc_param; | ||
1531 | 1524 | ||
1532 | if (Psat == -1) | 1525 | if (Psat == -1) |
1533 | Psat = priv->conf.phy.Psat; | 1526 | Psat = priv->conf.phy.Psat; |
@@ -1603,14 +1596,16 @@ module_param_named(board_type, board_type_param, charp, S_IRUSR); | |||
1603 | MODULE_PARM_DESC(board_type, "Board type: fpga, hdk (default), evb, com8 or " | 1596 | MODULE_PARM_DESC(board_type, "Board type: fpga, hdk (default), evb, com8 or " |
1604 | "dvp"); | 1597 | "dvp"); |
1605 | 1598 | ||
1606 | module_param_named(dc2dc, dc2dc_param, bool, S_IRUSR); | 1599 | module_param_named(dc2dc, dc2dc_param, int, S_IRUSR); |
1607 | MODULE_PARM_DESC(dc2dc, "External DC2DC: boolean (defaults to false)"); | 1600 | MODULE_PARM_DESC(dc2dc, "External DC2DC: u8 (defaults to 0)"); |
1608 | 1601 | ||
1609 | module_param_named(n_antennas_2, n_antennas_2_param, uint, S_IRUSR); | 1602 | module_param_named(n_antennas_2, n_antennas_2_param, int, S_IRUSR); |
1610 | MODULE_PARM_DESC(n_antennas_2, "Number of installed 2.4GHz antennas: 1 (default) or 2"); | 1603 | MODULE_PARM_DESC(n_antennas_2, |
1604 | "Number of installed 2.4GHz antennas: 1 (default) or 2"); | ||
1611 | 1605 | ||
1612 | module_param_named(n_antennas_5, n_antennas_5_param, uint, S_IRUSR); | 1606 | module_param_named(n_antennas_5, n_antennas_5_param, int, S_IRUSR); |
1613 | MODULE_PARM_DESC(n_antennas_5, "Number of installed 5GHz antennas: 1 (default) or 2"); | 1607 | MODULE_PARM_DESC(n_antennas_5, |
1608 | "Number of installed 5GHz antennas: 1 (default) or 2"); | ||
1614 | 1609 | ||
1615 | module_param_named(checksum, checksum_param, bool, S_IRUSR); | 1610 | module_param_named(checksum, checksum_param, bool, S_IRUSR); |
1616 | MODULE_PARM_DESC(checksum, "Enable TCP checksum: boolean (defaults to false)"); | 1611 | MODULE_PARM_DESC(checksum, "Enable TCP checksum: boolean (defaults to false)"); |
@@ -1618,23 +1613,28 @@ MODULE_PARM_DESC(checksum, "Enable TCP checksum: boolean (defaults to false)"); | |||
1618 | module_param_named(enable_11a, enable_11a_param, bool, S_IRUSR); | 1613 | module_param_named(enable_11a, enable_11a_param, bool, S_IRUSR); |
1619 | MODULE_PARM_DESC(enable_11a, "Enable 11a (5GHz): boolean (defaults to true)"); | 1614 | MODULE_PARM_DESC(enable_11a, "Enable 11a (5GHz): boolean (defaults to true)"); |
1620 | 1615 | ||
1621 | module_param(low_band_component, uint, S_IRUSR); | 1616 | module_param_named(low_band_component, low_band_component_param, int, |
1617 | S_IRUSR); | ||
1622 | MODULE_PARM_DESC(low_band_component, "Low band component: u8 " | 1618 | MODULE_PARM_DESC(low_band_component, "Low band component: u8 " |
1623 | "(default is 0x01)"); | 1619 | "(default is 0x01)"); |
1624 | 1620 | ||
1625 | module_param(low_band_component_type, uint, S_IRUSR); | 1621 | module_param_named(low_band_component_type, low_band_component_type_param, |
1622 | int, S_IRUSR); | ||
1626 | MODULE_PARM_DESC(low_band_component_type, "Low band component type: u8 " | 1623 | MODULE_PARM_DESC(low_band_component_type, "Low band component type: u8 " |
1627 | "(default is 0x05 or 0x06 depending on the board_type)"); | 1624 | "(default is 0x05 or 0x06 depending on the board_type)"); |
1628 | 1625 | ||
1629 | module_param(high_band_component, uint, S_IRUSR); | 1626 | module_param_named(high_band_component, high_band_component_param, int, |
1627 | S_IRUSR); | ||
1630 | MODULE_PARM_DESC(high_band_component, "High band component: u8, " | 1628 | MODULE_PARM_DESC(high_band_component, "High band component: u8, " |
1631 | "(default is 0x01)"); | 1629 | "(default is 0x01)"); |
1632 | 1630 | ||
1633 | module_param(high_band_component_type, uint, S_IRUSR); | 1631 | module_param_named(high_band_component_type, high_band_component_type_param, |
1632 | int, S_IRUSR); | ||
1634 | MODULE_PARM_DESC(high_band_component_type, "High band component type: u8 " | 1633 | MODULE_PARM_DESC(high_band_component_type, "High band component type: u8 " |
1635 | "(default is 0x09)"); | 1634 | "(default is 0x09)"); |
1636 | 1635 | ||
1637 | module_param(pwr_limit_reference_11_abg, uint, S_IRUSR); | 1636 | module_param_named(pwr_limit_reference_11_abg, |
1637 | pwr_limit_reference_11_abg_param, int, S_IRUSR); | ||
1638 | MODULE_PARM_DESC(pwr_limit_reference_11_abg, "Power limit reference: u8 " | 1638 | MODULE_PARM_DESC(pwr_limit_reference_11_abg, "Power limit reference: u8 " |
1639 | "(default is 0xc8)"); | 1639 | "(default is 0xc8)"); |
1640 | 1640 | ||
diff --git a/drivers/net/wireless/ti/wl18xx/wl18xx.h b/drivers/net/wireless/ti/wl18xx/wl18xx.h index 88b5de2b0613..daadc70871f9 100644 --- a/drivers/net/wireless/ti/wl18xx/wl18xx.h +++ b/drivers/net/wireless/ti/wl18xx/wl18xx.h | |||
@@ -44,8 +44,6 @@ struct wl18xx_priv { | |||
44 | /* Index of last released Tx desc in FW */ | 44 | /* Index of last released Tx desc in FW */ |
45 | u8 last_fw_rls_idx; | 45 | u8 last_fw_rls_idx; |
46 | 46 | ||
47 | u8 board_type; | ||
48 | |||
49 | struct wl18xx_phy_addresses phy_addresses; | 47 | struct wl18xx_phy_addresses phy_addresses; |
50 | 48 | ||
51 | /* number of VIFs requiring extra spare mem-blocks */ | 49 | /* number of VIFs requiring extra spare mem-blocks */ |