aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wl12xx/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ti/wl12xx/main.c')
-rw-r--r--drivers/net/wireless/ti/wl12xx/main.c79
1 files changed, 48 insertions, 31 deletions
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index f429fc110cb0..dadf1dbb002a 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -32,7 +32,6 @@
32#include "../wlcore/acx.h" 32#include "../wlcore/acx.h"
33#include "../wlcore/tx.h" 33#include "../wlcore/tx.h"
34#include "../wlcore/rx.h" 34#include "../wlcore/rx.h"
35#include "../wlcore/io.h"
36#include "../wlcore/boot.h" 35#include "../wlcore/boot.h"
37 36
38#include "wl12xx.h" 37#include "wl12xx.h"
@@ -1185,9 +1184,16 @@ static int wl12xx_enable_interrupts(struct wl1271 *wl)
1185 ret = wlcore_write_reg(wl, REG_INTERRUPT_MASK, 1184 ret = wlcore_write_reg(wl, REG_INTERRUPT_MASK,
1186 WL1271_ACX_INTR_ALL & ~(WL12XX_INTR_MASK)); 1185 WL1271_ACX_INTR_ALL & ~(WL12XX_INTR_MASK));
1187 if (ret < 0) 1186 if (ret < 0)
1188 goto out; 1187 goto disable_interrupts;
1189 1188
1190 ret = wlcore_write32(wl, WL12XX_HI_CFG, HI_CFG_DEF_VAL); 1189 ret = wlcore_write32(wl, WL12XX_HI_CFG, HI_CFG_DEF_VAL);
1190 if (ret < 0)
1191 goto disable_interrupts;
1192
1193 return ret;
1194
1195disable_interrupts:
1196 wlcore_disable_interrupts(wl);
1191 1197
1192out: 1198out:
1193 return ret; 1199 return ret;
@@ -1583,7 +1589,10 @@ static int wl12xx_set_key(struct wl1271 *wl, enum set_key_cmd cmd,
1583 return wlcore_set_key(wl, cmd, vif, sta, key_conf); 1589 return wlcore_set_key(wl, cmd, vif, sta, key_conf);
1584} 1590}
1585 1591
1592static int wl12xx_setup(struct wl1271 *wl);
1593
1586static struct wlcore_ops wl12xx_ops = { 1594static struct wlcore_ops wl12xx_ops = {
1595 .setup = wl12xx_setup,
1587 .identify_chip = wl12xx_identify_chip, 1596 .identify_chip = wl12xx_identify_chip,
1588 .identify_fw = wl12xx_identify_fw, 1597 .identify_fw = wl12xx_identify_fw,
1589 .boot = wl12xx_boot, 1598 .boot = wl12xx_boot,
@@ -1624,26 +1633,15 @@ static struct ieee80211_sta_ht_cap wl12xx_ht_cap = {
1624 }, 1633 },
1625}; 1634};
1626 1635
1627static int __devinit wl12xx_probe(struct platform_device *pdev) 1636static int wl12xx_setup(struct wl1271 *wl)
1628{ 1637{
1629 struct wl12xx_platform_data *pdata = pdev->dev.platform_data; 1638 struct wl12xx_priv *priv = wl->priv;
1630 struct wl1271 *wl; 1639 struct wl12xx_platform_data *pdata = wl->pdev->dev.platform_data;
1631 struct ieee80211_hw *hw;
1632 struct wl12xx_priv *priv;
1633
1634 hw = wlcore_alloc_hw(sizeof(*priv));
1635 if (IS_ERR(hw)) {
1636 wl1271_error("can't allocate hw");
1637 return PTR_ERR(hw);
1638 }
1639 1640
1640 wl = hw->priv;
1641 priv = wl->priv;
1642 wl->ops = &wl12xx_ops;
1643 wl->ptable = wl12xx_ptable;
1644 wl->rtable = wl12xx_rtable; 1641 wl->rtable = wl12xx_rtable;
1645 wl->num_tx_desc = 16; 1642 wl->num_tx_desc = WL12XX_NUM_TX_DESCRIPTORS;
1646 wl->num_rx_desc = 8; 1643 wl->num_rx_desc = WL12XX_NUM_RX_DESCRIPTORS;
1644 wl->num_mac_addr = WL12XX_NUM_MAC_ADDRESSES;
1647 wl->band_rate_to_idx = wl12xx_band_rate_to_idx; 1645 wl->band_rate_to_idx = wl12xx_band_rate_to_idx;
1648 wl->hw_tx_rate_tbl_size = WL12XX_CONF_HW_RXTX_RATE_MAX; 1646 wl->hw_tx_rate_tbl_size = WL12XX_CONF_HW_RXTX_RATE_MAX;
1649 wl->hw_min_ht_rate = WL12XX_CONF_HW_RXTX_RATE_MCS0; 1647 wl->hw_min_ht_rate = WL12XX_CONF_HW_RXTX_RATE_MCS0;
@@ -1695,7 +1693,36 @@ static int __devinit wl12xx_probe(struct platform_device *pdev)
1695 wl1271_error("Invalid tcxo parameter %s", tcxo_param); 1693 wl1271_error("Invalid tcxo parameter %s", tcxo_param);
1696 } 1694 }
1697 1695
1698 return wlcore_probe(wl, pdev); 1696 return 0;
1697}
1698
1699static int __devinit wl12xx_probe(struct platform_device *pdev)
1700{
1701 struct wl1271 *wl;
1702 struct ieee80211_hw *hw;
1703 int ret;
1704
1705 hw = wlcore_alloc_hw(sizeof(struct wl12xx_priv),
1706 WL12XX_AGGR_BUFFER_SIZE);
1707 if (IS_ERR(hw)) {
1708 wl1271_error("can't allocate hw");
1709 ret = PTR_ERR(hw);
1710 goto out;
1711 }
1712
1713 wl = hw->priv;
1714 wl->ops = &wl12xx_ops;
1715 wl->ptable = wl12xx_ptable;
1716 ret = wlcore_probe(wl, pdev);
1717 if (ret)
1718 goto out_free;
1719
1720 return ret;
1721
1722out_free:
1723 wlcore_free_hw(wl);
1724out:
1725 return ret;
1699} 1726}
1700 1727
1701static const struct platform_device_id wl12xx_id_table[] __devinitconst = { 1728static const struct platform_device_id wl12xx_id_table[] __devinitconst = {
@@ -1714,17 +1741,7 @@ static struct platform_driver wl12xx_driver = {
1714 } 1741 }
1715}; 1742};
1716 1743
1717static int __init wl12xx_init(void) 1744module_platform_driver(wl12xx_driver);
1718{
1719 return platform_driver_register(&wl12xx_driver);
1720}
1721module_init(wl12xx_init);
1722
1723static void __exit wl12xx_exit(void)
1724{
1725 platform_driver_unregister(&wl12xx_driver);
1726}
1727module_exit(wl12xx_exit);
1728 1745
1729module_param_named(fref, fref_param, charp, 0); 1746module_param_named(fref, fref_param, charp, 0);
1730MODULE_PARM_DESC(fref, "FREF clock: 19.2, 26, 26x, 38.4, 38.4x, 52"); 1747MODULE_PARM_DESC(fref, "FREF clock: 19.2, 26, 26x, 38.4, 38.4x, 52");