ap_drv_ops.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. #include "includes.h"
  15. #include "common.h"
  16. #include "hostapd.h"
  17. #include "driver_i.h"
  18. static int hostapd_set_ap_wps_ie(struct hostapd_data *hapd,
  19. const struct wpabuf *beacon,
  20. const struct wpabuf *proberesp)
  21. {
  22. if (hapd->driver == NULL || hapd->driver->set_ap_wps_ie == NULL)
  23. return 0;
  24. return hapd->driver->set_ap_wps_ie(hapd->conf->iface, hapd->drv_priv,
  25. beacon, proberesp);
  26. }
  27. static int hostapd_send_mgmt_frame(struct hostapd_data *hapd, const void *msg,
  28. size_t len)
  29. {
  30. if (hapd->driver == NULL || hapd->driver->send_mlme == NULL)
  31. return 0;
  32. return hapd->driver->send_mlme(hapd->drv_priv, msg, len);
  33. }
  34. void hostapd_set_driver_ops(struct hostapd_driver_ops *ops)
  35. {
  36. ops->set_ap_wps_ie = hostapd_set_ap_wps_ie;
  37. ops->send_mgmt_frame = hostapd_send_mgmt_frame;
  38. }