feature.h 2.2 KB

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