hw_features.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 int hostapd_hw_get_freq(struct hostapd_data *hapd, int chan)
  69. {
  70. return -1;
  71. }
  72. #endif /* NEED_MLME */
  73. #endif /* HW_FEATURES_H */