hw_features.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. };
  26. #define HOSTAPD_RATE_ERP 0x00000001
  27. #define HOSTAPD_RATE_BASIC 0x00000002
  28. #define HOSTAPD_RATE_PREAMBLE2 0x00000004
  29. #define HOSTAPD_RATE_SUPPORTED 0x00000010
  30. #define HOSTAPD_RATE_OFDM 0x00000020
  31. #define HOSTAPD_RATE_CCK 0x00000040
  32. #define HOSTAPD_RATE_MANDATORY 0x00000100
  33. struct hostapd_rate_data {
  34. int rate; /* rate in 100 kbps */
  35. int flags; /* HOSTAPD_RATE_ flags */
  36. };
  37. struct hostapd_hw_modes {
  38. int mode;
  39. int num_channels;
  40. struct hostapd_channel_data *channels;
  41. int num_rates;
  42. struct hostapd_rate_data *rates;
  43. };
  44. void hostapd_free_hw_features(struct hostapd_hw_modes *hw_features,
  45. size_t num_hw_features);
  46. int hostapd_get_hw_features(struct hostapd_iface *iface);
  47. int hostapd_select_hw_mode(struct hostapd_iface *iface);
  48. const char * hostapd_hw_mode_txt(int mode);
  49. int hostapd_hw_get_freq(struct hostapd_data *hapd, int chan);
  50. int hostapd_hw_get_channel(struct hostapd_data *hapd, int freq);
  51. #endif /* HW_FEATURES_H */