319-v4.12-0013-brcmfmac-wrap-brcmf_fws_del_interface-into-bcdc-laye.patch 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. From c02a5eb82056f75615cb48aa540bfd245f489b99 Mon Sep 17 00:00:00 2001
  2. From: Franky Lin <franky.lin@broadcom.com>
  3. Date: Fri, 10 Mar 2017 21:17:05 +0000
  4. Subject: [PATCH] brcmfmac: wrap brcmf_fws_del_interface into bcdc layer
  5. Create a new protocol interface function brcmf_proto_del_if for core
  6. module to notify protocol layer upon interface deletion.
  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/core.c | 4 ++--
  13. drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h | 9 +++++++++
  14. 3 files changed, 18 insertions(+), 2 deletions(-)
  15. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
  16. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
  17. @@ -405,6 +405,12 @@ brcmf_proto_bcdc_add_if(struct brcmf_if
  18. brcmf_fws_add_interface(ifp);
  19. }
  20. +static void
  21. +brcmf_proto_bcdc_del_if(struct brcmf_if *ifp)
  22. +{
  23. + brcmf_fws_del_interface(ifp);
  24. +}
  25. +
  26. int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr)
  27. {
  28. struct brcmf_bcdc *bcdc;
  29. @@ -429,6 +435,7 @@ int brcmf_proto_bcdc_attach(struct brcmf
  30. drvr->proto->add_tdls_peer = brcmf_proto_bcdc_add_tdls_peer;
  31. drvr->proto->rxreorder = brcmf_proto_bcdc_rxreorder;
  32. drvr->proto->add_if = brcmf_proto_bcdc_add_if;
  33. + drvr->proto->del_if = brcmf_proto_bcdc_del_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/core.c
  37. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
  38. @@ -716,7 +716,7 @@ void brcmf_remove_interface(struct brcmf
  39. return;
  40. brcmf_dbg(TRACE, "Enter, bsscfgidx=%d, ifidx=%d\n", ifp->bsscfgidx,
  41. ifp->ifidx);
  42. - brcmf_fws_del_interface(ifp);
  43. + brcmf_proto_del_if(ifp->drvr, ifp);
  44. brcmf_del_if(ifp->drvr, ifp->bsscfgidx, rtnl_locked);
  45. }
  46. @@ -1045,7 +1045,7 @@ fail:
  47. drvr->config = NULL;
  48. }
  49. if (drvr->fws) {
  50. - brcmf_fws_del_interface(ifp);
  51. + brcmf_proto_del_if(ifp->drvr, ifp);
  52. brcmf_fws_deinit(drvr);
  53. }
  54. brcmf_net_detach(ifp->ndev, false);
  55. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
  56. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
  57. @@ -45,6 +45,7 @@ struct brcmf_proto {
  58. u8 peer[ETH_ALEN]);
  59. void (*rxreorder)(struct brcmf_if *ifp, struct sk_buff *skb);
  60. void (*add_if)(struct brcmf_if *ifp);
  61. + void (*del_if)(struct brcmf_if *ifp);
  62. void *pd;
  63. };
  64. @@ -127,4 +128,12 @@ brcmf_proto_add_if(struct brcmf_pub *drv
  65. drvr->proto->add_if(ifp);
  66. }
  67. +static inline void
  68. +brcmf_proto_del_if(struct brcmf_pub *drvr, struct brcmf_if *ifp)
  69. +{
  70. + if (!drvr->proto->del_if)
  71. + return;
  72. + drvr->proto->del_if(ifp);
  73. +}
  74. +
  75. #endif /* BRCMFMAC_PROTO_H */