ap_drv_ops.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * hostapd - Driver operations
  3. * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * Alternatively, this software may be distributed under the terms of BSD
  10. * license.
  11. *
  12. * See README and COPYING for more details.
  13. */
  14. #ifndef AP_DRV_OPS
  15. #define AP_DRV_OPS
  16. enum wpa_driver_if_type;
  17. struct wpa_bss_params;
  18. struct wpa_driver_scan_params;
  19. void hostapd_set_driver_ops(struct hostapd_driver_ops *ops);
  20. int hostapd_set_privacy(struct hostapd_data *hapd, int enabled);
  21. int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
  22. size_t elem_len);
  23. int hostapd_get_ssid(struct hostapd_data *hapd, u8 *buf, size_t len);
  24. int hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len);
  25. int hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type,
  26. const char *ifname, const u8 *addr, void *bss_ctx,
  27. void **drv_priv, char *force_ifname, u8 *if_addr);
  28. int hostapd_if_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type,
  29. const char *ifname);
  30. int hostapd_set_ieee8021x(struct hostapd_data *hapd,
  31. struct wpa_bss_params *params);
  32. int hostapd_get_seqnum(const char *ifname, struct hostapd_data *hapd,
  33. const u8 *addr, int idx, u8 *seq);
  34. int hostapd_flush(struct hostapd_data *hapd);
  35. int hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq,
  36. int channel, int ht_enabled, int sec_channel_offset);
  37. int hostapd_set_rts(struct hostapd_data *hapd, int rts);
  38. int hostapd_set_frag(struct hostapd_data *hapd, int frag);
  39. int hostapd_sta_set_flags(struct hostapd_data *hapd, u8 *addr,
  40. int total_flags, int flags_or, int flags_and);
  41. int hostapd_set_rate_sets(struct hostapd_data *hapd, int *supp_rates,
  42. int *basic_rates, int mode);
  43. int hostapd_set_country(struct hostapd_data *hapd, const char *country);
  44. int hostapd_set_cts_protect(struct hostapd_data *hapd, int value);
  45. int hostapd_set_preamble(struct hostapd_data *hapd, int value);
  46. int hostapd_set_short_slot_time(struct hostapd_data *hapd, int value);
  47. int hostapd_set_tx_queue_params(struct hostapd_data *hapd, int queue, int aifs,
  48. int cw_min, int cw_max, int burst_time);
  49. int hostapd_valid_bss_mask(struct hostapd_data *hapd, const u8 *addr,
  50. const u8 *mask);
  51. struct hostapd_hw_modes *
  52. hostapd_get_hw_feature_data(struct hostapd_data *hapd, u16 *num_modes,
  53. u16 *flags);
  54. int hostapd_driver_commit(struct hostapd_data *hapd);
  55. int hostapd_set_ht_params(struct hostapd_data *hapd,
  56. const u8 *ht_capab, size_t ht_capab_len,
  57. const u8 *ht_oper, size_t ht_oper_len);
  58. int hostapd_drv_none(struct hostapd_data *hapd);
  59. int hostapd_driver_scan(struct hostapd_data *hapd,
  60. struct wpa_driver_scan_params *params);
  61. struct wpa_scan_results * hostapd_driver_get_scan_results(
  62. struct hostapd_data *hapd);
  63. int hostapd_driver_set_noa(struct hostapd_data *hapd, u8 count, int start,
  64. int duration);
  65. #include "drivers/driver.h"
  66. static inline int hostapd_drv_send_mlme(struct hostapd_data *hapd,
  67. const void *msg, size_t len)
  68. {
  69. if (hapd->driver == NULL || hapd->driver->send_mlme == NULL)
  70. return 0;
  71. return hapd->driver->send_mlme(hapd->drv_priv, msg, len);
  72. }
  73. #endif /* AP_DRV_OPS */