feature.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. */
  27. #define BRCMF_FEAT_LIST \
  28. BRCMF_FEAT_DEF(MBSS) \
  29. BRCMF_FEAT_DEF(MCHAN) \
  30. BRCMF_FEAT_DEF(PNO) \
  31. BRCMF_FEAT_DEF(WOWL) \
  32. BRCMF_FEAT_DEF(P2P)
  33. /*
  34. * Quirks:
  35. *
  36. * AUTO_AUTH: workaround needed for automatic authentication type.
  37. * NEED_MPC: driver needs to disable MPC during scanning operation.
  38. */
  39. #define BRCMF_QUIRK_LIST \
  40. BRCMF_QUIRK_DEF(AUTO_AUTH) \
  41. BRCMF_QUIRK_DEF(NEED_MPC)
  42. #define BRCMF_FEAT_DEF(_f) \
  43. BRCMF_FEAT_ ## _f,
  44. /*
  45. * expand feature list to enumeration.
  46. */
  47. enum brcmf_feat_id {
  48. BRCMF_FEAT_LIST
  49. BRCMF_FEAT_LAST
  50. };
  51. #undef BRCMF_FEAT_DEF
  52. #define BRCMF_QUIRK_DEF(_q) \
  53. BRCMF_FEAT_QUIRK_ ## _q,
  54. /*
  55. * expand quirk list to enumeration.
  56. */
  57. enum brcmf_feat_quirk {
  58. BRCMF_QUIRK_LIST
  59. BRCMF_FEAT_QUIRK_LAST
  60. };
  61. #undef BRCMF_QUIRK_DEF
  62. /**
  63. * brcmf_feat_attach() - determine features and quirks.
  64. *
  65. * @drvr: driver instance.
  66. */
  67. void brcmf_feat_attach(struct brcmf_pub *drvr);
  68. /**
  69. * brcmf_feat_is_enabled() - query feature.
  70. *
  71. * @ifp: interface instance.
  72. * @id: feature id to check.
  73. *
  74. * Return: true is feature is enabled; otherwise false.
  75. */
  76. bool brcmf_feat_is_enabled(struct brcmf_if *ifp, enum brcmf_feat_id id);
  77. /**
  78. * brcmf_feat_is_quirk_enabled() - query chip quirk.
  79. *
  80. * @ifp: interface instance.
  81. * @quirk: quirk id to check.
  82. *
  83. * Return: true is quirk is enabled; otherwise false.
  84. */
  85. bool brcmf_feat_is_quirk_enabled(struct brcmf_if *ifp,
  86. enum brcmf_feat_quirk quirk);
  87. #endif /* _BRCMF_FEATURE_H */