hw_features.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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_W_SCAN 0x00000001
  18. #define HOSTAPD_CHAN_W_ACTIVE_SCAN 0x00000002
  19. #define HOSTAPD_CHAN_W_IBSS 0x00000004
  20. struct hostapd_channel_data {
  21. short chan; /* channel number (IEEE 802.11) */
  22. short freq; /* frequency in MHz */
  23. int flag; /* flag for hostapd use (HOSTAPD_CHAN_*) */
  24. };
  25. #define HOSTAPD_RATE_ERP 0x00000001
  26. #define HOSTAPD_RATE_BASIC 0x00000002
  27. #define HOSTAPD_RATE_PREAMBLE2 0x00000004
  28. #define HOSTAPD_RATE_SUPPORTED 0x00000010
  29. #define HOSTAPD_RATE_OFDM 0x00000020
  30. #define HOSTAPD_RATE_CCK 0x00000040
  31. #define HOSTAPD_RATE_MANDATORY 0x00000100
  32. struct hostapd_rate_data {
  33. int rate; /* rate in 100 kbps */
  34. int flags; /* HOSTAPD_RATE_ flags */
  35. };
  36. struct hostapd_hw_modes {
  37. int mode;
  38. int num_channels;
  39. struct hostapd_channel_data *channels;
  40. int num_rates;
  41. struct hostapd_rate_data *rates;
  42. };
  43. void hostapd_free_hw_features(struct hostapd_hw_modes *hw_features,
  44. size_t num_hw_features);
  45. int hostapd_get_hw_features(struct hostapd_iface *iface);
  46. int hostapd_select_hw_mode_start(struct hostapd_iface *iface,
  47. hostapd_iface_cb cb);
  48. int hostapd_select_hw_mode_stop(struct hostapd_iface *iface);
  49. const char * hostapd_hw_mode_txt(int mode);
  50. int hostapd_hw_get_freq(struct hostapd_data *hapd, int chan);
  51. int hostapd_hw_get_channel(struct hostapd_data *hapd, int freq);
  52. #endif /* HW_FEATURES_H */