brcm80211: fmac: change function bus_txdata parameter
[deliverable/linux.git] / drivers / net / wireless / brcm80211 / brcmfmac / dhd_linux.c
index 719fd9397eb6f5dc405d8b04783871a50697acb6..1cfe9f3dbe0e8c3068ec9c355e8a937404c59ab6 100644 (file)
@@ -43,7 +43,6 @@
 #include "dhd_proto.h"
 #include "dhd_dbg.h"
 #include "wl_cfg80211.h"
-#include "bcmchip.h"
 
 MODULE_AUTHOR("Broadcom Corporation");
 MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN fullmac driver.");
@@ -77,6 +76,7 @@ struct brcmf_info {
 };
 
 /* Error bits */
+int brcmf_msg_level = BRCMF_ERROR_VAL;
 module_param(brcmf_msg_level, int, 0);
 
 int brcmf_ifname2idx(struct brcmf_info *drvr_priv, char *name)
@@ -292,7 +292,7 @@ int brcmf_sendpkt(struct brcmf_pub *drvr, int ifidx, struct sk_buff *pktbuf)
        struct brcmf_info *drvr_priv = drvr->info;
 
        /* Reject if down */
-       if (!drvr->up || (drvr->busstate == BRCMF_BUS_DOWN))
+       if (!drvr->up || (drvr->bus_if->state == BRCMF_BUS_DOWN))
                return -ENODEV;
 
        /* Update multicast statistic */
@@ -310,7 +310,7 @@ int brcmf_sendpkt(struct brcmf_pub *drvr, int ifidx, struct sk_buff *pktbuf)
        brcmf_proto_hdrpush(drvr, ifidx, pktbuf);
 
        /* Use bus module to send data frame */
-       return brcmf_sdbrcm_bus_txdata(drvr->bus, pktbuf);
+       return brcmf_sdbrcm_bus_txdata(drvr->dev, pktbuf);
 }
 
 static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev)
@@ -322,9 +322,11 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev)
        brcmf_dbg(TRACE, "Enter\n");
 
        /* Reject if down */
-       if (!drvr_priv->pub.up || (drvr_priv->pub.busstate == BRCMF_BUS_DOWN)) {
-               brcmf_dbg(ERROR, "xmit rejected pub.up=%d busstate=%d\n",
-                         drvr_priv->pub.up, drvr_priv->pub.busstate);
+       if (!drvr_priv->pub.up ||
+           (drvr_priv->pub.bus_if->state == BRCMF_BUS_DOWN)) {
+               brcmf_dbg(ERROR, "xmit rejected pub.up=%d state=%d\n",
+                         drvr_priv->pub.up,
+                         drvr_priv->pub.bus_if->state);
                netif_stop_queue(ndev);
                return -ENODEV;
        }
@@ -397,26 +399,21 @@ static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx,
        return bcmerror;
 }
 
-void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb,
-                 int numpkt)
+void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx,
+                   struct sk_buff_head *skb_list)
 {
        struct brcmf_info *drvr_priv = drvr->info;
        unsigned char *eth;
        uint len;
        void *data;
-       struct sk_buff *pnext, *save_pktbuf;
-       int i;
+       struct sk_buff *skb, *pnext;
        struct brcmf_if *ifp;
        struct brcmf_event_msg event;
 
        brcmf_dbg(TRACE, "Enter\n");
 
-       save_pktbuf = skb;
-
-       for (i = 0; skb && i < numpkt; i++, skb = pnext) {
-
-               pnext = skb->next;
-               skb->next = NULL;
+       skb_queue_walk_safe(skb_list, skb, pnext) {
+               skb_unlink(skb, skb_list);
 
                /* Get the protocol, maintain skb around eth_type_trans()
                 * The main reason for this hack is for the limitation of
@@ -437,6 +434,12 @@ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb,
                if (ifp == NULL)
                        ifp = drvr_priv->iflist[0];
 
+               if (!ifp || !ifp->ndev ||
+                   ifp->ndev->reg_state != NETREG_REGISTERED) {
+                       brcmu_pkt_buf_free_skb(skb);
+                       continue;
+               }
+
                skb->dev = ifp->ndev;
                skb->protocol = eth_type_trans(skb, skb->dev);
 
@@ -605,7 +608,6 @@ static void brcmf_ethtool_get_drvinfo(struct net_device *ndev,
 
        sprintf(info->driver, KBUILD_MODNAME);
        sprintf(info->version, "%lu", drvr_priv->pub.drv_version);
-       sprintf(info->fw_version, "%s", BCM4329_FW_NAME);
        sprintf(info->bus_info, "%s",
                dev_name(brcmf_bus_get_device(drvr_priv->pub.bus)));
 }
@@ -761,7 +763,7 @@ s32 brcmf_exec_dcmd(struct net_device *ndev, u32 cmd, void *arg, u32 len)
                buflen = min_t(uint, dcmd.len, BRCMF_DCMD_MAXLEN);
 
        /* send to dongle (must be up, and wl) */
-       if ((drvr_priv->pub.busstate != BRCMF_BUS_DATA)) {
+       if ((drvr_priv->pub.bus_if->state != BRCMF_BUS_DATA)) {
                brcmf_dbg(ERROR, "DONGLE_DOWN\n");
                err = -EIO;
                goto done;
@@ -940,7 +942,8 @@ void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx)
        }
 }
 
-struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
+struct brcmf_pub *brcmf_attach(struct brcmf_sdio *bus, uint bus_hdrlen,
+                              struct device *dev)
 {
        struct brcmf_info *drvr_priv = NULL;
 
@@ -959,6 +962,8 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
        /* Link to bus module */
        drvr_priv->pub.bus = bus;
        drvr_priv->pub.hdrlen = bus_hdrlen;
+       drvr_priv->pub.bus_if = dev_get_drvdata(dev);
+       drvr_priv->pub.dev = dev;
 
        /* Attach and link in the protocol */
        if (brcmf_proto_attach(&drvr_priv->pub) != 0) {
@@ -995,7 +1000,7 @@ int brcmf_bus_start(struct brcmf_pub *drvr)
        }
 
        /* If bus is not ready, can't come up */
-       if (drvr_priv->pub.busstate != BRCMF_BUS_DATA) {
+       if (drvr_priv->pub.bus_if->state != BRCMF_BUS_DATA) {
                brcmf_dbg(ERROR, "failed bus is not ready\n");
                return -ENODEV;
        }
@@ -1148,34 +1153,6 @@ void brcmf_detach(struct brcmf_pub *drvr)
        }
 }
 
-static void __exit brcmf_module_cleanup(void)
-{
-       brcmf_dbg(TRACE, "Enter\n");
-
-       brcmf_bus_unregister();
-}
-
-static int __init brcmf_module_init(void)
-{
-       int error;
-
-       brcmf_dbg(TRACE, "Enter\n");
-
-       error = brcmf_bus_register();
-
-       if (error) {
-               brcmf_dbg(ERROR, "brcmf_bus_register failed\n");
-               goto failed;
-       }
-       return 0;
-
-failed:
-       return -EINVAL;
-}
-
-module_init(brcmf_module_init);
-module_exit(brcmf_module_cleanup);
-
 int brcmf_os_proto_block(struct brcmf_pub *drvr)
 {
        struct brcmf_info *drvr_priv = drvr->info;
This page took 0.026918 seconds and 5 git commands to generate.