303-v4.15-0005-brcmfmac-get-rid-of-brcmf_cfg80211_escan-function.patch 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. From 588378f15cff285ac81c929239ccba01d7f71d50 Mon Sep 17 00:00:00 2001
  2. From: Arend Van Spriel <[email protected]>
  3. Date: Wed, 8 Nov 2017 14:36:35 +0100
  4. Subject: [PATCH] brcmfmac: get rid of brcmf_cfg80211_escan() function
  5. The function brcmf_cfg80211_escan() is only called by brcmf_cfg80211_scan()
  6. so there is no reason to split in two function especially since the latter
  7. does not do an awful lot.
  8. Reviewed-by: Hante Meuleman <[email protected]>
  9. Reviewed-by: Pieter-Paul Giesberts <[email protected]>
  10. Reviewed-by: Franky Lin <[email protected]>
  11. Signed-off-by: Arend van Spriel <[email protected]>
  12. Signed-off-by: Kalle Valo <[email protected]>
  13. ---
  14. .../broadcom/brcm80211/brcmfmac/cfg80211.c | 34 +++++++---------------
  15. 1 file changed, 10 insertions(+), 24 deletions(-)
  16. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  17. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  18. @@ -1071,13 +1071,16 @@ brcmf_do_escan(struct brcmf_if *ifp, str
  19. }
  20. static s32
  21. -brcmf_cfg80211_escan(struct wiphy *wiphy, struct brcmf_cfg80211_vif *vif,
  22. - struct cfg80211_scan_request *request)
  23. +brcmf_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
  24. {
  25. struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  26. - s32 err;
  27. + struct brcmf_cfg80211_vif *vif;
  28. + s32 err = 0;
  29. - brcmf_dbg(SCAN, "START ESCAN\n");
  30. + brcmf_dbg(TRACE, "Enter\n");
  31. + vif = container_of(request->wdev, struct brcmf_cfg80211_vif, wdev);
  32. + if (!check_vif_up(vif))
  33. + return -EIO;
  34. if (test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
  35. brcmf_err("Scanning already: status (%lu)\n", cfg->scan_status);
  36. @@ -1102,6 +1105,8 @@ brcmf_cfg80211_escan(struct wiphy *wiphy
  37. if (vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif)
  38. vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif;
  39. + brcmf_dbg(SCAN, "START ESCAN\n");
  40. +
  41. cfg->scan_request = request;
  42. set_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status);
  43. @@ -1121,31 +1126,12 @@ brcmf_cfg80211_escan(struct wiphy *wiphy
  44. return 0;
  45. scan_out:
  46. + brcmf_err("scan error (%d)\n", err);
  47. clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status);
  48. cfg->scan_request = NULL;
  49. return err;
  50. }
  51. -static s32
  52. -brcmf_cfg80211_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
  53. -{
  54. - struct brcmf_cfg80211_vif *vif;
  55. - s32 err = 0;
  56. -
  57. - brcmf_dbg(TRACE, "Enter\n");
  58. - vif = container_of(request->wdev, struct brcmf_cfg80211_vif, wdev);
  59. - if (!check_vif_up(vif))
  60. - return -EIO;
  61. -
  62. - err = brcmf_cfg80211_escan(wiphy, vif, request);
  63. -
  64. - if (err)
  65. - brcmf_err("scan error (%d)\n", err);
  66. -
  67. - brcmf_dbg(TRACE, "Exit\n");
  68. - return err;
  69. -}
  70. -
  71. static s32 brcmf_set_rts(struct net_device *ndev, u32 rts_threshold)
  72. {
  73. s32 err = 0;