hw_features.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * hostapd / Hardware feature query and different modes
  3. * Copyright 2002-2003, Instant802 Networks, Inc.
  4. * Copyright 2005-2006, Devicescape Software, Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * Alternatively, this software may be distributed under the terms of BSD
  11. * license.
  12. *
  13. * See README and COPYING for more details.
  14. */
  15. #ifndef HW_FEATURES_H
  16. #define HW_FEATURES_H
  17. #define HOSTAPD_CHAN_DISABLED 0x00000001
  18. #define HOSTAPD_CHAN_PASSIVE_SCAN 0x00000002
  19. #define HOSTAPD_CHAN_NO_IBSS 0x00000004
  20. #define HOSTAPD_CHAN_RADAR 0x00000008
  21. struct hostapd_channel_data {
  22. short chan; /* channel number (IEEE 802.11) */
  23. short freq; /* frequency in MHz */
  24. int flag; /* flag for hostapd use (HOSTAPD_CHAN_*) */
  25. u8 max_tx_power; /* maximum transmit power in dBm */
  26. };
  27. #define HOSTAPD_RATE_ERP 0x00000001
  28. #define HOSTAPD_RATE_BASIC 0x00000002
  29. #define HOSTAPD_RATE_PREAMBLE2 0x00000004
  30. #define HOSTAPD_RATE_SUPPORTED 0x00000010
  31. #define HOSTAPD_RATE_OFDM 0x00000020
  32. #define HOSTAPD_RATE_CCK 0x00000040
  33. #define HOSTAPD_RATE_MANDATORY 0x00000100
  34. struct hostapd_rate_data {
  35. int rate; /* rate in 100 kbps */
  36. int flags; /* HOSTAPD_RATE_ flags */
  37. };
  38. struct hostapd_hw_modes {
  39. int mode;
  40. int num_channels;
  41. struct hostapd_channel_data *channels;
  42. int num_rates;
  43. struct hostapd_rate_data *rates;
  44. u16 ht_capab;
  45. };
  46. #ifdef NEED_MLME
  47. void hostapd_free_hw_features(struct hostapd_hw_modes *hw_features,
  48. size_t num_hw_features);
  49. int hostapd_get_hw_features(struct hostapd_iface *iface);
  50. int hostapd_select_hw_mode(struct hostapd_iface *iface);
  51. const char * hostapd_hw_mode_txt(int mode);
  52. int hostapd_hw_get_freq(struct hostapd_data *hapd, int chan);
  53. int hostapd_hw_get_channel(struct hostapd_data *hapd, int freq);
  54. #else /* NEED_MLME */
  55. static inline void
  56. hostapd_free_hw_features(struct hostapd_hw_modes *hw_features,
  57. size_t num_hw_features)
  58. {
  59. }
  60. static inline int hostapd_get_hw_features(struct hostapd_iface *iface)
  61. {
  62. return -1;
  63. }
  64. static inline int hostapd_select_hw_mode(struct hostapd_iface *iface)
  65. {
  66. return -1;
  67. }
  68. static inline const char * hostapd_hw_mode_txt(int mode)
  69. {
  70. return NULL;
  71. }
  72. static inline int hostapd_hw_get_freq(struct hostapd_data *hapd, int chan)
  73. {
  74. return -1;
  75. }
  76. #endif /* NEED_MLME */
  77. #endif /* HW_FEATURES_H */