brcmfmac: move brcmf_txflowblock to bcdc layer
authorFranky Lin <franky.lin@broadcom.com>
Fri, 10 Mar 2017 21:17:02 +0000 (21:17 +0000)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 20 Mar 2017 17:14:51 +0000 (19:14 +0200)
brcmf_txflowblock is invoked by sdio and usb bus module which are using
bcdc protocol. This patch makes it a bcdc API instead of a core module
function.

Reviewed-by: Arend Van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.h
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c

index 384b1873e7e38dfbeac989ce7f46138548f8d750..4c7dafa162acb93a3fef63be4ed73e5c9c90befd 100644 (file)
@@ -345,6 +345,16 @@ brcmf_proto_bcdc_txdata(struct brcmf_pub *drvr, int ifidx, u8 offset,
        return brcmf_bus_txdata(drvr->bus_if, pktbuf);
 }
 
+void brcmf_proto_bcdc_txflowblock(struct device *dev, bool state)
+{
+       struct brcmf_bus *bus_if = dev_get_drvdata(dev);
+       struct brcmf_pub *drvr = bus_if->drvr;
+
+       brcmf_dbg(TRACE, "Enter\n");
+
+       brcmf_fws_bus_blocked(drvr, state);
+}
+
 static void
 brcmf_proto_bcdc_configure_addr_mode(struct brcmf_pub *drvr, int ifidx,
                                     enum proto_addr_mode addr_mode)
index 6003179c0ceb286ce2a396d96eb1f436d727b80f..b5282cb08199a68b8e3836d989f628ee9c7c2f23 100644 (file)
@@ -19,6 +19,7 @@
 #ifdef CONFIG_BRCMFMAC_PROTO_BCDC
 int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr);
 void brcmf_proto_bcdc_detach(struct brcmf_pub *drvr);
+void brcmf_proto_bcdc_txflowblock(struct device *dev, bool state);
 #else
 static inline int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr) { return 0; }
 static inline void brcmf_proto_bcdc_detach(struct brcmf_pub *drvr) {}
index 76693df347425951397a211c863f19046dbf07f5..eeb6643eb1da5546f788adb2288e8b8dd64716e3 100644 (file)
@@ -229,8 +229,6 @@ int brcmf_attach(struct device *dev, struct brcmf_mp_device *settings);
 void brcmf_detach(struct device *dev);
 /* Indication from bus module that dongle should be reset */
 void brcmf_dev_reset(struct device *dev);
-/* Indication from bus module to change flow-control state */
-void brcmf_txflowblock(struct device *dev, bool state);
 
 /* Notify the bus has transferred the tx packet to firmware */
 void brcmf_txcomplete(struct device *dev, struct sk_buff *txp, bool success);
index 2f2f3a5ad86a6f82199a737e5c21c654a0e4da8d..59831dc446d68b8bb8098ebfa089779bccfe1314 100644 (file)
@@ -283,16 +283,6 @@ void brcmf_txflowblock_if(struct brcmf_if *ifp,
        spin_unlock_irqrestore(&ifp->netif_stop_lock, flags);
 }
 
-void brcmf_txflowblock(struct device *dev, bool state)
-{
-       struct brcmf_bus *bus_if = dev_get_drvdata(dev);
-       struct brcmf_pub *drvr = bus_if->drvr;
-
-       brcmf_dbg(TRACE, "Enter\n");
-
-       brcmf_fws_bus_blocked(drvr, state);
-}
-
 void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb)
 {
        if (skb->pkt_type == PACKET_MULTICAST)
index 65689469c5a12e2fcfd6123ca584944da79ec184..2a38dd3eade3c96b5529ce6606e7ac1ee3bda37d 100644 (file)
@@ -44,6 +44,7 @@
 #include "firmware.h"
 #include "core.h"
 #include "common.h"
+#include "bcdc.h"
 
 #define DCMD_RESP_TIMEOUT      msecs_to_jiffies(2500)
 #define CTL_DONE_TIMEOUT       msecs_to_jiffies(2500)
@@ -2328,7 +2329,7 @@ static uint brcmf_sdio_sendfromq(struct brcmf_sdio *bus, uint maxframes)
        if ((bus->sdiodev->state == BRCMF_SDIOD_DATA) &&
            bus->txoff && (pktq_len(&bus->txq) < TXLOW)) {
                bus->txoff = false;
-               brcmf_txflowblock(bus->sdiodev->dev, false);
+               brcmf_proto_bcdc_txflowblock(bus->sdiodev->dev, false);
        }
 
        return cnt;
@@ -2753,7 +2754,7 @@ static int brcmf_sdio_bus_txdata(struct device *dev, struct sk_buff *pkt)
 
        if (pktq_len(&bus->txq) >= TXHI) {
                bus->txoff = true;
-               brcmf_txflowblock(dev, true);
+               brcmf_proto_bcdc_txflowblock(dev, true);
        }
        spin_unlock_bh(&bus->txq_lock);
 
index d93ebbdc773757adda218b16b816c30202792973..c45c7c1c786408ebdedc06b16ef4bb8c5681c87d 100644 (file)
@@ -29,6 +29,7 @@
 #include "usb.h"
 #include "core.h"
 #include "common.h"
+#include "bcdc.h"
 
 
 #define IOCTL_RESP_TIMEOUT             msecs_to_jiffies(2000)
@@ -488,7 +489,7 @@ static void brcmf_usb_tx_complete(struct urb *urb)
        spin_lock_irqsave(&devinfo->tx_flowblock_lock, flags);
        if (devinfo->tx_freecount > devinfo->tx_high_watermark &&
                devinfo->tx_flowblock) {
-               brcmf_txflowblock(devinfo->dev, false);
+               brcmf_proto_bcdc_txflowblock(devinfo->dev, false);
                devinfo->tx_flowblock = false;
        }
        spin_unlock_irqrestore(&devinfo->tx_flowblock_lock, flags);
@@ -635,7 +636,7 @@ static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb)
        spin_lock_irqsave(&devinfo->tx_flowblock_lock, flags);
        if (devinfo->tx_freecount < devinfo->tx_low_watermark &&
            !devinfo->tx_flowblock) {
-               brcmf_txflowblock(dev, true);
+               brcmf_proto_bcdc_txflowblock(dev, true);
                devinfo->tx_flowblock = true;
        }
        spin_unlock_irqrestore(&devinfo->tx_flowblock_lock, flags);