brcmfmac: wrap brcmf_fws_(de)init into bcdc layer
PATCH 1/1 brcmfmac: wrap brcmf_fws_(de)init into bcdc layer
From: Rafał Miłecki <[email protected]>
fwsignal is only used by bcdc. Create new protocol interface functions for core code to perform proto specific (de)initialization. This makes core agnostic to the protocol which will allow further optimizations. We will be able to avoid compiling unused protocols or modularize them.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 12 ++++++++++++ drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 7 +++---- drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h | 16 ++++++++++++++++ 3 files changed, 31 insertions(+), 4 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c +12 -0
@@ -106,6 +106,16 @@ struct brcmf_bcdc { }; +static int brcmf_proto_bcdc_init (struct brcmf_pub *pub) +{ +return brcmf_fws_init (pub); +} + +static void brcmf_proto_bcdc_deinit (struct brcmf_pub *pub) +{ +return brcmf_fws_deinit (pub); +} +static int brcmf_proto_bcdc_msg (struct brcmf_pub *drvr,int ifidx,uint cmd,void *buf,uint len,bool set)
@@ -431,6 +441,8 @@ int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr) goto fail; } + drvr->proto->init = brcmf_proto_bcdc_init; + drvr->proto->deinit = brcmf_proto_bcdc_deinit; drvr->proto->hdrpull = brcmf_proto_bcdc_hdrpull; drvr->proto->query_dcmd = brcmf_proto_bcdc_query_dcmd; drvr->proto->set_dcmd = brcmf_proto_bcdc_set_dcmd;
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +3 -4
@@ -32,7 +32,6 @@#include "p2p.h" #include "cfg80211.h" #include "fwil.h" -#include "fwsignal.h" #include "feature.h" #include "proto.h" #include "pcie.h"
@@ -986,7 +985,7 @@ int brcmf_bus_started(struct device *dev) }brcmf_feat_attach (drvr); - ret =brcmf_fws_init (drvr); + ret =brcmf_proto_init (drvr);if (ret <0 ) goto fail;
@@ -1036,7 +1035,7 @@ int brcmf_bus_started(struct device *dev) }if (drvr->fws) {brcmf_proto_del_if (ifp->drvr, ifp); -brcmf_fws_deinit (drvr); +brcmf_proto_deinit (drvr); }brcmf_net_detach (ifp->ndev, false);if (p2p_ifp)
@@ -1103,7 +1102,7 @@ void brcmf_detach(struct device *dev)brcmf_cfg80211_detach (drvr->config); -brcmf_fws_deinit (drvr); +brcmf_proto_deinit (drvr);brcmf_bus_stop (drvr->bus_if);
drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h +16 -0
@@ -27,6 +27,8 @@ struct brcmf_skb_reorder_data { };struct brcmf_proto { +int (*init)(struct brcmf_pub *pub); +void (*deinit)(struct brcmf_pub *pub);int (*hdrpull)(struct brcmf_pub *drvr,bool do_fws,struct sk_buff *skb,struct brcmf_if **ifp); int (*query_dcmd)(struct brcmf_pub *drvr, int ifidx, uint cmd,
@@ -54,6 +56,20 @@ struct brcmf_proto {int brcmf_proto_attach (struct brcmf_pub *drvr);void brcmf_proto_detach (struct brcmf_pub *drvr); +static inline int brcmf_proto_init (struct brcmf_pub *pub) +{ +if (!pub->proto->init) +return 0 ; +return pub->proto->init (pub); +} + +static inline void brcmf_proto_deinit (struct brcmf_pub *pub) +{ +if (!pub->proto->deinit) +return ; + pub->proto->deinit (pub); +} +static inline int brcmf_proto_hdrpull (struct brcmf_pub *drvr,bool do_fws,struct sk_buff *skb,struct brcmf_if **ifp)
Signature · 1 line
2.11.0
Arend Van Spriel
maintainerQuoted 6 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
fwsignal is only used by bcdc. Create new protocol interface functions for core code to perform proto specific (de)initialization. This makes core agnostic to the protocol which will allow further optimizations. We will be able to avoid compiling unused protocols or modularize them.
Thanks, Rafał
Franky had tackled this with two patches, which are queued to be submitted.
Regards,
Arend
Quoted 11 lines · Arend Van Spriel
Quoted 6 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
fwsignal is only used by bcdc. Create new protocol interface functions for core code to perform proto specific (de)initialization. This makes core agnostic to the protocol which will allow further optimizations. We will be able to avoid compiling unused protocols or modularize them.
Thanks, Rafał
Franky had tackled this with two patches, which are queued to be submitted.
Given that your implementation (you now published) doesn't do any magic, is there any real problem with my patch except of /not invented here/?
Arend Van Spriel
maintainerQuoted 9 lines · Rafał Miłecki
Quoted 8 lines · Arend Van Spriel
Quoted 6 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
fwsignal is only used by bcdc. Create new protocol interface functions for core code to perform proto specific (de)initialization. This makes core agnostic to the protocol which will allow further optimizations. We will be able to avoid compiling unused protocols or modularize them.
Quoted 7 lines
Quoted 4 lines
Thanks, Rafał
Franky had tackled this with two patches, which are queued to be submitted.
Given that your implementation (you now published) doesn't do any magic, is there any real problem with my patch except of /not invented here/?
You could see it like that, but no. These two patches were already reviewed and I requested more testing as explained in another email response. Your patch needed a bit of rework and you can safely assume that my remarks on your patch would make it even more like the one we already had queued up. So it seemed unreasonable to have Kalle apply yours and then the two from Franky. It would only be for the sake of kernel git stats, which is not something I want to factor in.
Regards,
Arend