319-v4.12-0014-brcmfmac-wrap-brcmf_fws_reset_interface-into-bcdc-la.patch 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. From 66ded1f8b33cdd9d6d3e20f5f8dd23615a110e70 Mon Sep 17 00:00:00 2001
  2. From: Franky Lin <franky.lin@broadcom.com>
  3. Date: Fri, 10 Mar 2017 21:17:06 +0000
  4. Subject: [PATCH] brcmfmac: wrap brcmf_fws_reset_interface into bcdc layer
  5. Create a new protocol interface function brcmf_proto_reset_if for core
  6. module to notify protocol layer when interface role changes.
  7. Signed-off-by: Franky Lin <franky.lin@broadcom.com>
  8. Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
  9. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  10. ---
  11. drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 7 +++++++
  12. drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c | 3 +--
  13. drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h | 9 +++++++++
  14. 3 files changed, 17 insertions(+), 2 deletions(-)
  15. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
  16. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
  17. @@ -411,6 +411,12 @@ brcmf_proto_bcdc_del_if(struct brcmf_if
  18. brcmf_fws_del_interface(ifp);
  19. }
  20. +static void
  21. +brcmf_proto_bcdc_reset_if(struct brcmf_if *ifp)
  22. +{
  23. + brcmf_fws_reset_interface(ifp);
  24. +}
  25. +
  26. int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr)
  27. {
  28. struct brcmf_bcdc *bcdc;
  29. @@ -436,6 +442,7 @@ int brcmf_proto_bcdc_attach(struct brcmf
  30. drvr->proto->rxreorder = brcmf_proto_bcdc_rxreorder;
  31. drvr->proto->add_if = brcmf_proto_bcdc_add_if;
  32. drvr->proto->del_if = brcmf_proto_bcdc_del_if;
  33. + drvr->proto->reset_if = brcmf_proto_bcdc_reset_if;
  34. drvr->proto->pd = bcdc;
  35. drvr->hdrlen += BCDC_HEADER_LEN + BRCMF_PROT_FW_SIGNAL_MAX_TXBYTES;
  36. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
  37. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
  38. @@ -22,7 +22,6 @@
  39. #include "core.h"
  40. #include "debug.h"
  41. #include "tracepoint.h"
  42. -#include "fwsignal.h"
  43. #include "fweh.h"
  44. #include "fwil.h"
  45. #include "proto.h"
  46. @@ -180,7 +179,7 @@ static void brcmf_fweh_handle_if_event(s
  47. }
  48. if (ifp && ifevent->action == BRCMF_E_IF_CHANGE)
  49. - brcmf_fws_reset_interface(ifp);
  50. + brcmf_proto_reset_if(drvr, ifp);
  51. err = brcmf_fweh_call_event_handler(ifp, emsg->event_code, emsg, data);
  52. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
  53. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
  54. @@ -46,6 +46,7 @@ struct brcmf_proto {
  55. void (*rxreorder)(struct brcmf_if *ifp, struct sk_buff *skb);
  56. void (*add_if)(struct brcmf_if *ifp);
  57. void (*del_if)(struct brcmf_if *ifp);
  58. + void (*reset_if)(struct brcmf_if *ifp);
  59. void *pd;
  60. };
  61. @@ -136,4 +137,12 @@ brcmf_proto_del_if(struct brcmf_pub *drv
  62. drvr->proto->del_if(ifp);
  63. }
  64. +static inline void
  65. +brcmf_proto_reset_if(struct brcmf_pub *drvr, struct brcmf_if *ifp)
  66. +{
  67. + if (!drvr->proto->reset_if)
  68. + return;
  69. + drvr->proto->reset_if(ifp);
  70. +}
  71. +
  72. #endif /* BRCMFMAC_PROTO_H */