319-v4.12-0012-brcmfmac-wrap-brcmf_fws_add_interface-into-bcdc-laye.patch 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. From 9fdc64bbdbe7bd546e0fbcedd2f1c03448c6df42 Mon Sep 17 00:00:00 2001
  2. From: Franky Lin <franky.lin@broadcom.com>
  3. Date: Fri, 10 Mar 2017 21:17:04 +0000
  4. Subject: [PATCH] brcmfmac: wrap brcmf_fws_add_interface into bcdc layer
  5. fwsignal is only used by bcdc. Create a new protocol interface function
  6. brcmf_proto_add_if for core module to notify protocol layer upon a new
  7. interface is created.
  8. Signed-off-by: Franky Lin <franky.lin@broadcom.com>
  9. Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
  10. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  11. ---
  12. drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 7 +++++++
  13. drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 2 +-
  14. drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c | 3 ++-
  15. drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h | 9 +++++++++
  16. 4 files changed, 19 insertions(+), 2 deletions(-)
  17. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
  18. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
  19. @@ -399,6 +399,12 @@ static void brcmf_proto_bcdc_rxreorder(s
  20. brcmf_fws_rxreorder(ifp, skb);
  21. }
  22. +static void
  23. +brcmf_proto_bcdc_add_if(struct brcmf_if *ifp)
  24. +{
  25. + brcmf_fws_add_interface(ifp);
  26. +}
  27. +
  28. int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr)
  29. {
  30. struct brcmf_bcdc *bcdc;
  31. @@ -422,6 +428,7 @@ int brcmf_proto_bcdc_attach(struct brcmf
  32. drvr->proto->delete_peer = brcmf_proto_bcdc_delete_peer;
  33. drvr->proto->add_tdls_peer = brcmf_proto_bcdc_add_tdls_peer;
  34. drvr->proto->rxreorder = brcmf_proto_bcdc_rxreorder;
  35. + drvr->proto->add_if = brcmf_proto_bcdc_add_if;
  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. @@ -1000,7 +1000,7 @@ int brcmf_bus_started(struct device *dev
  41. if (ret < 0)
  42. goto fail;
  43. - brcmf_fws_add_interface(ifp);
  44. + brcmf_proto_add_if(drvr, ifp);
  45. drvr->config = brcmf_cfg80211_attach(drvr, bus_if->dev,
  46. drvr->settings->p2p_enable);
  47. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
  48. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
  49. @@ -25,6 +25,7 @@
  50. #include "fwsignal.h"
  51. #include "fweh.h"
  52. #include "fwil.h"
  53. +#include "proto.h"
  54. /**
  55. * struct brcmf_fweh_queue_item - event item on event queue.
  56. @@ -172,7 +173,7 @@ static void brcmf_fweh_handle_if_event(s
  57. if (IS_ERR(ifp))
  58. return;
  59. if (!is_p2pdev)
  60. - brcmf_fws_add_interface(ifp);
  61. + brcmf_proto_add_if(drvr, ifp);
  62. if (!drvr->fweh.evt_handler[BRCMF_E_IF])
  63. if (brcmf_net_attach(ifp, false) < 0)
  64. return;
  65. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
  66. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
  67. @@ -44,6 +44,7 @@ struct brcmf_proto {
  68. void (*add_tdls_peer)(struct brcmf_pub *drvr, int ifidx,
  69. u8 peer[ETH_ALEN]);
  70. void (*rxreorder)(struct brcmf_if *ifp, struct sk_buff *skb);
  71. + void (*add_if)(struct brcmf_if *ifp);
  72. void *pd;
  73. };
  74. @@ -118,4 +119,12 @@ brcmf_proto_rxreorder(struct brcmf_if *i
  75. ifp->drvr->proto->rxreorder(ifp, skb);
  76. }
  77. +static inline void
  78. +brcmf_proto_add_if(struct brcmf_pub *drvr, struct brcmf_if *ifp)
  79. +{
  80. + if (!drvr->proto->add_if)
  81. + return;
  82. + drvr->proto->add_if(ifp);
  83. +}
  84. +
  85. #endif /* BRCMFMAC_PROTO_H */