brcmfmac: wrap brcmf_fws_init into bcdc layer
authorFranky Lin <franky.lin@broadcom.com>
Tue, 28 Mar 2017 10:43:24 +0000 (11:43 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 5 Apr 2017 12:40:59 +0000 (15:40 +0300)
Create a new protocol layer interface brcmf_proto_init_cb for protocol
layer to finish initialzation after core module components(fweh and
etc.) are initialized.

Signed-off-by: Franky Lin <franky.lin@broadcom.com>
Reviewed-by: Arend Van Spriel <arend.vanspriel@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/proto.h

index 92eafccf087b49ad9ae9b00f8b9f75189fe7726a..a07c49fa745a8ad7314566efdcea2a039f24af15 100644 (file)
@@ -417,6 +417,12 @@ brcmf_proto_bcdc_reset_if(struct brcmf_if *ifp)
        brcmf_fws_reset_interface(ifp);
 }
 
+static int
+brcmf_proto_bcdc_init_done(struct brcmf_pub *drvr)
+{
+       return brcmf_fws_init(drvr);
+}
+
 int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr)
 {
        struct brcmf_bcdc *bcdc;
@@ -443,6 +449,7 @@ int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr)
        drvr->proto->add_if = brcmf_proto_bcdc_add_if;
        drvr->proto->del_if = brcmf_proto_bcdc_del_if;
        drvr->proto->reset_if = brcmf_proto_bcdc_reset_if;
+       drvr->proto->init_done = brcmf_proto_bcdc_init_done;
        drvr->proto->pd = bcdc;
 
        drvr->hdrlen += BCDC_HEADER_LEN + BRCMF_PROT_FW_SIGNAL_MAX_TXBYTES;
index 60c6c7839cc2d26fd62eb68f4fc56978e36ad53d..0c05365278399f2780e176089719fc3006b88ef8 100644 (file)
@@ -986,7 +986,7 @@ int brcmf_bus_started(struct device *dev)
        }
        brcmf_feat_attach(drvr);
 
-       ret = brcmf_fws_init(drvr);
+       ret = brcmf_proto_init_done(drvr);
        if (ret < 0)
                goto fail;
 
index 3048ed529f952d60b9616bcc5dd0d880751d7859..2404f8a7c31c9901b77e8929e9e2012fd2f55b2a 100644 (file)
@@ -47,6 +47,7 @@ struct brcmf_proto {
        void (*add_if)(struct brcmf_if *ifp);
        void (*del_if)(struct brcmf_if *ifp);
        void (*reset_if)(struct brcmf_if *ifp);
+       int (*init_done)(struct brcmf_pub *drvr);
        void *pd;
 };
 
@@ -145,4 +146,12 @@ brcmf_proto_reset_if(struct brcmf_pub *drvr, struct brcmf_if *ifp)
        drvr->proto->reset_if(ifp);
 }
 
+static inline int
+brcmf_proto_init_done(struct brcmf_pub *drvr)
+{
+       if (!drvr->proto->init_done)
+               return 0;
+       return drvr->proto->init_done(drvr);
+}
+
 #endif /* BRCMFMAC_PROTO_H */