pno.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * Copyright (c) 2016 Broadcom
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  11. * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  13. * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef _BRCMF_PNO_H
  17. #define _BRCMF_PNO_H
  18. #define BRCMF_PNO_SCAN_COMPLETE 1
  19. #define BRCMF_PNO_MAX_PFN_COUNT 16
  20. #define BRCMF_PNO_SCHED_SCAN_MIN_PERIOD 10
  21. #define BRCMF_PNO_SCHED_SCAN_MAX_PERIOD 508
  22. /* forward declaration */
  23. struct brcmf_pno_info;
  24. /**
  25. * brcmf_pno_start_sched_scan - initiate scheduled scan on device.
  26. *
  27. * @ifp: interface object used.
  28. * @req: configuration parameters for scheduled scan.
  29. */
  30. int brcmf_pno_start_sched_scan(struct brcmf_if *ifp,
  31. struct cfg80211_sched_scan_request *req);
  32. /**
  33. * brcmf_pno_stop_sched_scan - terminate scheduled scan on device.
  34. *
  35. * @ifp: interface object used.
  36. * @reqid: unique identifier of scan to be stopped.
  37. */
  38. int brcmf_pno_stop_sched_scan(struct brcmf_if *ifp, u64 reqid);
  39. /**
  40. * brcmf_pno_wiphy_params - fill scheduled scan parameters in wiphy instance.
  41. *
  42. * @wiphy: wiphy instance to be used.
  43. * @gscan: indicates whether the device has support for g-scan feature.
  44. */
  45. void brcmf_pno_wiphy_params(struct wiphy *wiphy, bool gscan);
  46. /**
  47. * brcmf_pno_attach - allocate and attach module information.
  48. *
  49. * @cfg: cfg80211 context used.
  50. */
  51. int brcmf_pno_attach(struct brcmf_cfg80211_info *cfg);
  52. /**
  53. * brcmf_pno_detach - detach and free module information.
  54. *
  55. * @cfg: cfg80211 context used.
  56. */
  57. void brcmf_pno_detach(struct brcmf_cfg80211_info *cfg);
  58. /**
  59. * brcmf_pno_find_reqid_by_bucket - find request id for given bucket index.
  60. *
  61. * @pi: pno instance used.
  62. * @bucket: index of firmware bucket.
  63. */
  64. u64 brcmf_pno_find_reqid_by_bucket(struct brcmf_pno_info *pi, u32 bucket);
  65. /**
  66. * brcmf_pno_get_bucket_map - determine bucket map for given netinfo.
  67. *
  68. * @pi: pno instance used.
  69. * @netinfo: netinfo to compare with bucket configuration.
  70. */
  71. u32 brcmf_pno_get_bucket_map(struct brcmf_pno_info *pi,
  72. struct brcmf_pno_net_info_le *netinfo);
  73. #endif /* _BRCMF_PNO_H */