brcm80211: fmac: move packet realloc stats to struct brcmf_bus
authorFranky Lin <frankyl@broadcom.com>
Sat, 17 Dec 2011 02:37:07 +0000 (18:37 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 19 Dec 2011 19:40:45 +0000 (14:40 -0500)
tx_realloc is used by both common layer and bus layer. This patch
moves it to interface structure brcmf_bus as part of the fullmac
bus interface refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@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
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c

index 86cb197e82cdaec183f5e7498e4725a66515abed..746156797bcc64b6a8fcbbe236fca0be0dc31e83 100644 (file)
@@ -578,6 +578,7 @@ struct brcmf_bus {
        enum brcmf_bus_state state;
        uint maxctl;            /* Max size rxctl request from proto to bus */
        bool drvr_up;           /* Status flag of driver up/down */
+       unsigned long tx_realloc;       /* Tx packets realloced for headroom */
        struct dngl_stats dstats;       /* Stats for dongle-based data */
 };
 
@@ -615,8 +616,6 @@ struct brcmf_pub {
        /* Number of times dpc scheduled by watchdog timer */
        unsigned long wd_dpc_sched;
 
-       /* Number of tx packets we had to realloc for headroom */
-       unsigned long tx_realloc;
        /* Number of flow control pkts recvd */
        unsigned long fc_packets;
 
index e45609947ce137febad5c7e90e3e96ba097a09c5..1ce6322882618b6e86ae4ec58c814889b9023441 100644 (file)
@@ -324,7 +324,7 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 
                brcmf_dbg(INFO, "%s: insufficient headroom\n",
                          brcmf_ifname(drvr, ifp->idx));
-               drvr->tx_realloc++;
+               drvr->bus_if->tx_realloc++;
                skb2 = skb_realloc_headroom(skb, drvr->hdrlen);
                dev_kfree_skb(skb);
                skb = skb2;
index 4b0a87d9497b6cf9d0417b225eb614dde4683c26..e0456e96cbd17336c640764cbf5ea11379c179fc 100644 (file)
@@ -2130,7 +2130,7 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_sdio *bus, struct sk_buff *pkt,
                if (skb_headroom(pkt) < pad) {
                        brcmf_dbg(INFO, "insufficient headroom %d for %d pad\n",
                                  skb_headroom(pkt), pad);
-                       bus->drvr->tx_realloc++;
+                       bus->sdiodev->bus_if->tx_realloc++;
                        new = brcmu_pkt_buf_get_skb(pkt->len + BRCMF_SDALIGN);
                        if (!new) {
                                brcmf_dbg(ERROR, "couldn't allocate new %d-byte packet\n",