brcmfmac: absorb brcmf_sendpkt into brcmf_netdev_start_xmit
authorFranky Lin <frankyl@broadcom.com>
Thu, 13 Sep 2012 19:11:57 +0000 (21:11 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 24 Sep 2012 18:59:08 +0000 (14:59 -0400)
brcmf_sendpkt only called by brcmf_netdev_start_xmit now. Absorb it
to increase readability.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/dhd.h
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c

index 4766d9f356966224d526aee1273848964bca0dca..55e489d2147d90cafadad708e7c5bdf228983ea5 100644 (file)
@@ -682,10 +682,6 @@ extern int brcmf_c_host_event(struct brcmf_pub *drvr, int *idx,
 
 extern void brcmf_del_if(struct brcmf_pub *drvr, int ifidx);
 
-/* Send packet to dongle via data channel */
-extern int brcmf_sendpkt(struct brcmf_pub *drvr, int ifidx,\
-                        struct sk_buff *pkt);
-
 extern void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg);
 extern void brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg,
                                             int enable, int master_mode);
index b08f3474d8e74e9e82b7d6c6998b4ff4d5c364cb..d7c76ce9d8cb3d74dccb79c863e5db1efd9a7446 100644 (file)
@@ -272,30 +272,6 @@ static void brcmf_netdev_set_multicast_list(struct net_device *ndev)
        schedule_work(&drvr->multicast_work);
 }
 
-int brcmf_sendpkt(struct brcmf_pub *drvr, int ifidx, struct sk_buff *pktbuf)
-{
-       /* Reject if down */
-       if (!drvr->bus_if->drvr_up || (drvr->bus_if->state == BRCMF_BUS_DOWN))
-               return -ENODEV;
-
-       /* Update multicast statistic */
-       if (pktbuf->len >= ETH_ALEN) {
-               u8 *pktdata = (u8 *) (pktbuf->data);
-               struct ethhdr *eh = (struct ethhdr *)pktdata;
-
-               if (is_multicast_ether_addr(eh->h_dest))
-                       drvr->tx_multicast++;
-               if (ntohs(eh->h_proto) == ETH_P_PAE)
-                       atomic_inc(&drvr->pend_8021x_cnt);
-       }
-
-       /* If the protocol uses a data header, apply it */
-       brcmf_proto_hdrpush(drvr, ifidx, pktbuf);
-
-       /* Use bus module to send data frame */
-       return drvr->bus_if->brcmf_bus_txdata(drvr->dev, pktbuf);
-}
-
 static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 {
        int ret;
@@ -338,7 +314,22 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev)
                }
        }
 
-       ret = brcmf_sendpkt(drvr, ifp->idx, skb);
+       /* Update multicast statistic */
+       if (skb->len >= ETH_ALEN) {
+               u8 *pktdata = (u8 *)(skb->data);
+               struct ethhdr *eh = (struct ethhdr *)pktdata;
+
+               if (is_multicast_ether_addr(eh->h_dest))
+                       drvr->tx_multicast++;
+               if (ntohs(eh->h_proto) == ETH_P_PAE)
+                       atomic_inc(&drvr->pend_8021x_cnt);
+       }
+
+       /* If the protocol uses a data header, apply it */
+       brcmf_proto_hdrpush(drvr, ifp->idx, skb);
+
+       /* Use bus module to send data frame */
+       ret =  drvr->bus_if->brcmf_bus_txdata(drvr->dev, skb);
 
 done:
        if (ret)