summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2012-03-09 20:57:30 +0100
committerJohn W. Linville <linville@tuxdriver.com>2012-03-09 20:57:30 +0100
commit74dd1521d0b4f940cdd3ce7b9d988836bef589b8 (patch)
tree42f3d4ee1d4e6d60a91aaadab771f766a3024bc0 /drivers/net/wireless/brcm80211
parentdlm: Do not allocate a fd for peeloff (diff)
parentiwlwifi: fix the delta for remove max_txq_num patch (diff)
downloadlinux-74dd1521d0b4f940cdd3ce7b9d988836bef589b8.tar.xz
linux-74dd1521d0b4f940cdd3ce7b9d988836bef589b8.zip
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Diffstat (limited to 'drivers/net/wireless/brcm80211')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c4
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h4
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c30
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/usb.c32
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/usb.h27
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/ampdu.c20
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c31
7 files changed, 64 insertions, 84 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 83ca3cc2cccb..4688904908ec 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -604,7 +604,7 @@ void brcmf_sdio_exit(void)
sdio_unregister_driver(&brcmf_sdmmc_driver);
}
-int brcmf_sdio_init(void)
+void brcmf_sdio_init(void)
{
int ret;
@@ -614,6 +614,4 @@ int brcmf_sdio_init(void)
if (ret)
brcmf_dbg(ERROR, "sdio_register_driver failed: %d\n", ret);
-
- return ret;
}
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
index b7671b30692f..366916494be4 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
@@ -108,11 +108,11 @@ extern int brcmf_add_if(struct device *dev, int ifidx,
#ifdef CONFIG_BRCMFMAC_SDIO
extern void brcmf_sdio_exit(void);
-extern int brcmf_sdio_init(void);
+extern void brcmf_sdio_init(void);
#endif
#ifdef CONFIG_BRCMFMAC_USB
extern void brcmf_usb_exit(void);
-extern int brcmf_usb_init(void);
+extern void brcmf_usb_init(void);
#endif
#endif /* _BRCMF_BUS_H_ */
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
index c4da05817443..2a1e5ae0c402 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
@@ -1181,27 +1181,29 @@ exit:
}
#endif /* DEBUG */
-static int __init brcmfmac_init(void)
+static void brcmf_driver_init(struct work_struct *work)
{
- int ret = 0;
-
#ifdef CONFIG_BRCMFMAC_SDIO
- ret = brcmf_sdio_init();
- if (ret)
- goto fail;
+ brcmf_sdio_init();
#endif
#ifdef CONFIG_BRCMFMAC_USB
- ret = brcmf_usb_init();
- if (ret)
- goto fail;
+ brcmf_usb_init();
#endif
+}
+static DECLARE_WORK(brcmf_driver_work, brcmf_driver_init);
-fail:
- return ret;
+static int __init brcmfmac_module_init(void)
+{
+ if (!schedule_work(&brcmf_driver_work))
+ return -EBUSY;
+
+ return 0;
}
-static void __exit brcmfmac_exit(void)
+static void __exit brcmfmac_module_exit(void)
{
+ cancel_work_sync(&brcmf_driver_work);
+
#ifdef CONFIG_BRCMFMAC_SDIO
brcmf_sdio_exit();
#endif
@@ -1210,5 +1212,5 @@ static void __exit brcmfmac_exit(void)
#endif
}
-module_init(brcmfmac_init);
-module_exit(brcmfmac_exit);
+module_init(brcmfmac_module_init);
+module_exit(brcmfmac_module_exit);
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
index d4a9e8e7deb3..82364223e817 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
@@ -514,9 +514,9 @@ static void brcmf_usb_tx_complete(struct urb *urb)
brcmf_usb_del_fromq(devinfo, req);
if (urb->status == 0)
- devinfo->bus_pub.stats.tx_packets++;
+ devinfo->bus_pub.bus->dstats.tx_packets++;
else
- devinfo->bus_pub.stats.tx_errors++;
+ devinfo->bus_pub.bus->dstats.tx_errors++;
dev_kfree_skb(req->skb);
req->skb = NULL;
@@ -536,9 +536,9 @@ static void brcmf_usb_rx_complete(struct urb *urb)
req->skb = NULL;
if (urb->status == 0) {
- devinfo->bus_pub.stats.rx_packets++;
+ devinfo->bus_pub.bus->dstats.rx_packets++;
} else {
- devinfo->bus_pub.stats.rx_errors++;
+ devinfo->bus_pub.bus->dstats.rx_errors++;
dev_kfree_skb(skb);
brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req);
return;
@@ -712,9 +712,6 @@ static int brcmf_usb_up(struct device *dev)
struct brcmf_usbdev_info *devinfo = brcmf_usb_get_businfo(dev);
u16 ifnum;
- if (devinfo == NULL)
- return -EINVAL;
-
if (devinfo->bus_pub.state == BCMFMAC_USB_STATE_UP)
return 0;
@@ -900,8 +897,8 @@ brcmf_usb_dlneeded(struct brcmf_usbdev_info *devinfo)
sizeof(struct bootrom_id_le));
return false;
} else {
- devinfo->bus_pub.attrib.devid = chipid;
- devinfo->bus_pub.attrib.chiprev = chiprev;
+ devinfo->bus_pub.devid = chipid;
+ devinfo->bus_pub.chiprev = chiprev;
}
return true;
}
@@ -1067,7 +1064,7 @@ static int brcmf_usb_dlstart(struct brcmf_usbdev_info *devinfo, u8 *fw, int len)
if (devinfo == NULL)
return -EINVAL;
- if (devinfo->bus_pub.attrib.devid == 0xDEAD)
+ if (devinfo->bus_pub.devid == 0xDEAD)
return -EINVAL;
err = brcmf_usb_dl_writeimage(devinfo, fw, len);
@@ -1088,7 +1085,7 @@ static int brcmf_usb_dlrun(struct brcmf_usbdev_info *devinfo)
if (!devinfo)
return -EINVAL;
- if (devinfo->bus_pub.attrib.devid == 0xDEAD)
+ if (devinfo->bus_pub.devid == 0xDEAD)
return -EINVAL;
/* Check we are runnable */
@@ -1127,18 +1124,19 @@ static bool brcmf_usb_chip_support(int chipid, int chiprev)
static int
brcmf_usb_fw_download(struct brcmf_usbdev_info *devinfo)
{
- struct brcmf_usb_attrib *attr;
+ int devid, chiprev;
int err;
brcmf_dbg(TRACE, "enter\n");
if (devinfo == NULL)
return -ENODEV;
- attr = &devinfo->bus_pub.attrib;
+ devid = devinfo->bus_pub.devid;
+ chiprev = devinfo->bus_pub.chiprev;
- if (!brcmf_usb_chip_support(attr->devid, attr->chiprev)) {
+ if (!brcmf_usb_chip_support(devid, chiprev)) {
brcmf_dbg(ERROR, "unsupported chip %d rev %d\n",
- attr->devid, attr->chiprev);
+ devid, chiprev);
return -EINVAL;
}
@@ -1617,7 +1615,7 @@ void brcmf_usb_exit(void)
g_image.len = 0;
}
-int brcmf_usb_init(void)
+void brcmf_usb_init(void)
{
- return usb_register(&brcmf_usbdrvr);
+ usb_register(&brcmf_usbdrvr);
}
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.h b/drivers/net/wireless/brcm80211/brcmfmac/usb.h
index b31da7b83ff7..acfa5e89872f 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/usb.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.h
@@ -33,36 +33,12 @@ enum brcmf_usb_pnp_state {
};
struct brcmf_stats {
- u32 tx_errors;
- u32 tx_packets;
- u32 tx_multicast;
u32 tx_ctlpkts;
u32 tx_ctlerrs;
- u32 tx_dropped;
- u32 tx_flushed;
- u32 rx_errors;
- u32 rx_packets;
- u32 rx_multicast;
u32 rx_ctlpkts;
u32 rx_ctlerrs;
- u32 rx_dropped;
- u32 rx_flushed;
-
-};
-
-struct brcmf_usb_attrib {
- int bustype;
- int vid;
- int pid;
- int devid;
- int chiprev; /* chip revsion number */
- int mtu;
- int nchan; /* Data Channels */
- int has_2nd_bulk_in_ep;
};
-struct brcmf_usbdev_info;
-
struct brcmf_usbdev {
struct brcmf_bus *bus;
struct brcmf_usbdev_info *devinfo;
@@ -70,7 +46,8 @@ struct brcmf_usbdev {
struct brcmf_stats stats;
int ntxq, nrxq, rxsize;
u32 bus_mtu;
- struct brcmf_usb_attrib attrib;
+ int devid;
+ int chiprev; /* chip revsion number */
};
/* IO Request Block (IRB) */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c b/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c
index dbee69620a90..95b5902bc4b3 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c
@@ -959,14 +959,13 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
if (supr_status) {
update_rate = false;
if (supr_status == TX_STATUS_SUPR_BADCH) {
- wiphy_err(wiphy, "%s: Pkt tx suppressed, "
- "illegal channel possibly %d\n",
+ wiphy_err(wiphy,
+ "%s: Pkt tx suppressed, illegal channel possibly %d\n",
__func__, CHSPEC_CHANNEL(
wlc->default_bss->chanspec));
} else {
if (supr_status != TX_STATUS_SUPR_FRAG)
- wiphy_err(wiphy, "%s:"
- "supr_status 0x%x\n",
+ wiphy_err(wiphy, "%s: supr_status 0x%x\n",
__func__, supr_status);
}
/* no need to retry for badch; will fail again */
@@ -988,9 +987,8 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
}
} else if (txs->phyerr) {
update_rate = false;
- wiphy_err(wiphy, "wl%d: ampdu tx phy "
- "error (0x%x)\n", wlc->pub->unit,
- txs->phyerr);
+ wiphy_err(wiphy, "%s: ampdu tx phy error (0x%x)\n",
+ __func__, txs->phyerr);
if (brcm_msg_level & LOG_ERROR_VAL) {
brcmu_prpkt("txpkt (AMPDU)", p);
@@ -1018,10 +1016,10 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
ack_recd = false;
if (ba_recd) {
bindex = MODSUB_POW2(seq, start_seq, SEQNUM_MAX);
- BCMMSG(wlc->wiphy, "tid %d seq %d,"
- " start_seq %d, bindex %d set %d, index %d\n",
- tid, seq, start_seq, bindex,
- isset(bitmap, bindex), index);
+ BCMMSG(wiphy,
+ "tid %d seq %d, start_seq %d, bindex %d set %d, index %d\n",
+ tid, seq, start_seq, bindex,
+ isset(bitmap, bindex), index);
/* if acked then clear bit and free packet */
if ((bindex < AMPDU_TX_BA_MAX_WSIZE)
&& isset(bitmap, bindex)) {
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
index fec0f10773e5..569ab8abd2a1 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
@@ -1169,25 +1169,31 @@ static struct bcma_driver brcms_bcma_driver = {
/**
* This is the main entry point for the brcmsmac driver.
*
- * This function determines if a device pointed to by pdev is a WL device,
- * and if so, performs a brcms_attach() on it.
- *
+ * This function is scheduled upon module initialization and
+ * does the driver registration, which result in brcms_bcma_probe()
+ * call resulting in the driver bringup.
*/
-static int __init brcms_module_init(void)
+static void brcms_driver_init(struct work_struct *work)
{
- int error = -ENODEV;
+ int error;
+ error = bcma_driver_register(&brcms_bcma_driver);
+ if (error)
+ pr_err("%s: register returned %d\n", __func__, error);
+}
+
+static DECLARE_WORK(brcms_driver_work, brcms_driver_init);
+
+static int __init brcms_module_init(void)
+{
#ifdef DEBUG
if (msglevel != 0xdeadbeef)
brcm_msg_level = msglevel;
-#endif /* DEBUG */
-
- error = bcma_driver_register(&brcms_bcma_driver);
- pr_err("%s: register returned %d\n", __func__, error);
- if (!error)
- return 0;
+#endif
+ if (!schedule_work(&brcms_driver_work))
+ return -EBUSY;
- return error;
+ return 0;
}
/**
@@ -1199,6 +1205,7 @@ static int __init brcms_module_init(void)
*/
static void __exit brcms_module_exit(void)
{
+ cancel_work_sync(&brcms_driver_work);
bcma_driver_unregister(&brcms_bcma_driver);
}