brcmfmac: wrap brcmf_fws_add_interface into bcdc layer
authorFranky Lin <franky.lin@broadcom.com>
Fri, 10 Mar 2017 21:17:04 +0000 (21:17 +0000)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 20 Mar 2017 17:14:52 +0000 (19:14 +0200)
fwsignal is only used by bcdc. Create a new protocol interface function
brcmf_proto_add_if for core module to notify protocol layer upon a new
interface is created.

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/core.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h

index bee70f3bd4db32c2b7e0e084314b2f0884178569..2e678a38dc6d5f0cb6fb0bffb603dcb798aa84ad 100644 (file)
@@ -399,6 +399,12 @@ static void brcmf_proto_bcdc_rxreorder(struct brcmf_if *ifp,
        brcmf_fws_rxreorder(ifp, skb);
 }
 
+static void
+brcmf_proto_bcdc_add_if(struct brcmf_if *ifp)
+{
+       brcmf_fws_add_interface(ifp);
+}
+
 int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr)
 {
        struct brcmf_bcdc *bcdc;
@@ -422,6 +428,7 @@ int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr)
        drvr->proto->delete_peer = brcmf_proto_bcdc_delete_peer;
        drvr->proto->add_tdls_peer = brcmf_proto_bcdc_add_tdls_peer;
        drvr->proto->rxreorder = brcmf_proto_bcdc_rxreorder;
+       drvr->proto->add_if = brcmf_proto_bcdc_add_if;
        drvr->proto->pd = bcdc;
 
        drvr->hdrlen += BCDC_HEADER_LEN + BRCMF_PROT_FW_SIGNAL_MAX_TXBYTES;
index 47cfb82dbfeb212acd3c1e302df5fe5ae35f75af..08853cefb8e617cb6126691e735e75fbfdb316e6 100644 (file)
@@ -990,7 +990,7 @@ int brcmf_bus_started(struct device *dev)
        if (ret < 0)
                goto fail;
 
-       brcmf_fws_add_interface(ifp);
+       brcmf_proto_add_if(drvr, ifp);
 
        drvr->config = brcmf_cfg80211_attach(drvr, bus_if->dev,
                                             drvr->settings->p2p_enable);
index c79306b575324f05a63b38a80068179db316f6a3..f63f36f24c82efef0bbf412d7c7428a4c166dfe4 100644 (file)
@@ -25,6 +25,7 @@
 #include "fwsignal.h"
 #include "fweh.h"
 #include "fwil.h"
+#include "proto.h"
 
 /**
  * struct brcmf_fweh_queue_item - event item on event queue.
@@ -172,7 +173,7 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr,
                if (IS_ERR(ifp))
                        return;
                if (!is_p2pdev)
-                       brcmf_fws_add_interface(ifp);
+                       brcmf_proto_add_if(drvr, ifp);
                if (!drvr->fweh.evt_handler[BRCMF_E_IF])
                        if (brcmf_net_attach(ifp, false) < 0)
                                return;
index 34b59feedeba86b592dfb08c0d737b340b57c798..3d001f33200331dba89a2bb6d98b543078ef39e9 100644 (file)
@@ -44,6 +44,7 @@ struct brcmf_proto {
        void (*add_tdls_peer)(struct brcmf_pub *drvr, int ifidx,
                              u8 peer[ETH_ALEN]);
        void (*rxreorder)(struct brcmf_if *ifp, struct sk_buff *skb);
+       void (*add_if)(struct brcmf_if *ifp);
        void *pd;
 };
 
@@ -118,4 +119,12 @@ brcmf_proto_rxreorder(struct brcmf_if *ifp, struct sk_buff *skb)
        ifp->drvr->proto->rxreorder(ifp, skb);
 }
 
+static inline void
+brcmf_proto_add_if(struct brcmf_pub *drvr, struct brcmf_if *ifp)
+{
+       if (!drvr->proto->add_if)
+               return;
+       drvr->proto->add_if(ifp);
+}
+
 #endif /* BRCMFMAC_PROTO_H */