feature.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * Copyright (c) 2014 Broadcom Corporation
  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_FEATURE_H
  17. #define _BRCMF_FEATURE_H
  18. /*
  19. * Features:
  20. *
  21. * MBSS: multiple BSSID support (eg. guest network in AP mode).
  22. * MCHAN: multi-channel for concurrent P2P.
  23. * PNO: preferred network offload.
  24. * WOWL: Wake-On-WLAN.
  25. * P2P: peer-to-peer
  26. * RSDB: Real Simultaneous Dual Band
  27. * TDLS: Tunneled Direct Link Setup
  28. * SCAN_RANDOM_MAC: Random MAC during (net detect) scheduled scan.
  29. * WOWL_ND: WOWL net detect (PNO)
  30. * WOWL_GTK: (WOWL) GTK rekeying offload
  31. * WOWL_ARP_ND: ARP and Neighbor Discovery offload support during WOWL.
  32. * MFP: 802.11w Management Frame Protection.
  33. */
  34. #define BRCMF_FEAT_LIST \
  35. BRCMF_FEAT_DEF(MBSS) \
  36. BRCMF_FEAT_DEF(MCHAN) \
  37. BRCMF_FEAT_DEF(PNO) \
  38. BRCMF_FEAT_DEF(WOWL) \
  39. BRCMF_FEAT_DEF(P2P) \
  40. BRCMF_FEAT_DEF(RSDB) \
  41. BRCMF_FEAT_DEF(TDLS) \
  42. BRCMF_FEAT_DEF(SCAN_RANDOM_MAC) \
  43. BRCMF_FEAT_DEF(WOWL_ND) \
  44. BRCMF_FEAT_DEF(WOWL_GTK) \
  45. BRCMF_FEAT_DEF(WOWL_ARP_ND) \
  46. BRCMF_FEAT_DEF(MFP)
  47. /*
  48. * Quirks:
  49. *
  50. * AUTO_AUTH: workaround needed for automatic authentication type.
  51. * NEED_MPC: driver needs to disable MPC during scanning operation.
  52. */
  53. #define BRCMF_QUIRK_LIST \
  54. BRCMF_QUIRK_DEF(AUTO_AUTH) \
  55. BRCMF_QUIRK_DEF(NEED_MPC)
  56. #define BRCMF_FEAT_DEF(_f) \
  57. BRCMF_FEAT_ ## _f,
  58. /*
  59. * expand feature list to enumeration.
  60. */
  61. enum brcmf_feat_id {
  62. BRCMF_FEAT_LIST
  63. BRCMF_FEAT_LAST
  64. };
  65. #undef BRCMF_FEAT_DEF
  66. #define BRCMF_QUIRK_DEF(_q) \
  67. BRCMF_FEAT_QUIRK_ ## _q,
  68. /*
  69. * expand quirk list to enumeration.
  70. */
  71. enum brcmf_feat_quirk {
  72. BRCMF_QUIRK_LIST
  73. BRCMF_FEAT_QUIRK_LAST
  74. };
  75. #undef BRCMF_QUIRK_DEF
  76. /**
  77. * brcmf_feat_attach() - determine features and quirks.
  78. *
  79. * @drvr: driver instance.
  80. */
  81. void brcmf_feat_attach(struct brcmf_pub *drvr);
  82. /**
  83. * brcmf_feat_is_enabled() - query feature.
  84. *
  85. * @ifp: interface instance.
  86. * @id: feature id to check.
  87. *
  88. * Return: true is feature is enabled; otherwise false.
  89. */
  90. bool brcmf_feat_is_enabled(struct brcmf_if *ifp, enum brcmf_feat_id id);
  91. /**
  92. * brcmf_feat_is_quirk_enabled() - query chip quirk.
  93. *
  94. * @ifp: interface instance.
  95. * @quirk: quirk id to check.
  96. *
  97. * Return: true is quirk is enabled; otherwise false.
  98. */
  99. bool brcmf_feat_is_quirk_enabled(struct brcmf_if *ifp,
  100. enum brcmf_feat_quirk quirk);
  101. #endif /* _BRCMF_FEATURE_H */