319-v4.12-0020-brcmfmac-wrap-brcmf_fws_init-into-bcdc-layer.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. From 62c50a34883c6b821d816b6a661e5d47c09d42b2 Mon Sep 17 00:00:00 2001
  2. From: Franky Lin <franky.lin@broadcom.com>
  3. Date: Tue, 28 Mar 2017 11:43:24 +0100
  4. Subject: [PATCH] brcmfmac: wrap brcmf_fws_init into bcdc layer
  5. Create a new protocol layer interface brcmf_proto_init_cb for protocol
  6. layer to finish initialzation after core module components(fweh and
  7. etc.) are initialized.
  8. Signed-off-by: Franky Lin <franky.lin@broadcom.com>
  9. Reviewed-by: Arend Van Spriel <arend.vanspriel@broadcom.com>
  10. Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
  11. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  12. ---
  13. drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 7 +++++++
  14. drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 2 +-
  15. drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h | 9 +++++++++
  16. 3 files changed, 17 insertions(+), 1 deletion(-)
  17. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
  18. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
  19. @@ -417,6 +417,12 @@ brcmf_proto_bcdc_reset_if(struct brcmf_i
  20. brcmf_fws_reset_interface(ifp);
  21. }
  22. +static int
  23. +brcmf_proto_bcdc_init_done(struct brcmf_pub *drvr)
  24. +{
  25. + return brcmf_fws_init(drvr);
  26. +}
  27. +
  28. int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr)
  29. {
  30. struct brcmf_bcdc *bcdc;
  31. @@ -443,6 +449,7 @@ int brcmf_proto_bcdc_attach(struct brcmf
  32. drvr->proto->add_if = brcmf_proto_bcdc_add_if;
  33. drvr->proto->del_if = brcmf_proto_bcdc_del_if;
  34. drvr->proto->reset_if = brcmf_proto_bcdc_reset_if;
  35. + drvr->proto->init_done = brcmf_proto_bcdc_init_done;
  36. drvr->proto->pd = bcdc;
  37. drvr->hdrlen += BCDC_HEADER_LEN + BRCMF_PROT_FW_SIGNAL_MAX_TXBYTES;
  38. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
  39. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
  40. @@ -996,7 +996,7 @@ int brcmf_bus_started(struct device *dev
  41. }
  42. brcmf_feat_attach(drvr);
  43. - ret = brcmf_fws_init(drvr);
  44. + ret = brcmf_proto_init_done(drvr);
  45. if (ret < 0)
  46. goto fail;
  47. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
  48. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
  49. @@ -47,6 +47,7 @@ struct brcmf_proto {
  50. void (*add_if)(struct brcmf_if *ifp);
  51. void (*del_if)(struct brcmf_if *ifp);
  52. void (*reset_if)(struct brcmf_if *ifp);
  53. + int (*init_done)(struct brcmf_pub *drvr);
  54. void *pd;
  55. };
  56. @@ -145,4 +146,12 @@ brcmf_proto_reset_if(struct brcmf_pub *d
  57. drvr->proto->reset_if(ifp);
  58. }
  59. +static inline int
  60. +brcmf_proto_init_done(struct brcmf_pub *drvr)
  61. +{
  62. + if (!drvr->proto->init_done)
  63. + return 0;
  64. + return drvr->proto->init_done(drvr);
  65. +}
  66. +
  67. #endif /* BRCMFMAC_PROTO_H */