18d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/*
28d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * hostapd - Driver operations
38d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
48d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
5c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt * This software may be distributed under the terms of the BSD license.
6c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt * See README for more details.
78d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
88d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
98d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifndef AP_DRV_OPS
108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#define AP_DRV_OPS
118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtenum wpa_driver_if_type;
138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct wpa_bss_params;
148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct wpa_driver_scan_params;
158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct ieee80211_ht_capabilities;
16a54fa5fb807eaeff45464139b5a7759f060cec68Dmitry Shmidtstruct ieee80211_vht_capabilities;
178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtu32 hostapd_sta_flags_to_drv(u32 flags);
191f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtint hostapd_build_ap_extra_ies(struct hostapd_data *hapd,
201f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt			       struct wpabuf **beacon,
211f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt			       struct wpabuf **proberesp,
221f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt			       struct wpabuf **assocresp);
231f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtvoid hostapd_free_ap_extra_ies(struct hostapd_data *hapd, struct wpabuf *beacon,
241f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt			       struct wpabuf *proberesp,
251f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt			       struct wpabuf *assocresp);
268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_set_ap_wps_ie(struct hostapd_data *hapd);
278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_set_authorized(struct hostapd_data *hapd,
288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			   struct sta_info *sta, int authorized);
298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_set_sta_flags(struct hostapd_data *hapd, struct sta_info *sta);
308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_set_drv_ieee8021x(struct hostapd_data *hapd, const char *ifname,
318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			      int enabled);
328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_vlan_if_add(struct hostapd_data *hapd, const char *ifname);
338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_vlan_if_remove(struct hostapd_data *hapd, const char *ifname);
34c2ebb4b85d69b65f552fee71ac68f44e8d87b39eDmitry Shmidtint hostapd_set_wds_sta(struct hostapd_data *hapd, char *ifname_wds,
35c2ebb4b85d69b65f552fee71ac68f44e8d87b39eDmitry Shmidt			const u8 *addr, int aid, int val);
368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_sta_add(struct hostapd_data *hapd,
378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		    const u8 *addr, u16 aid, u16 capability,
388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		    const u8 *supp_rates, size_t supp_rates_len,
398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		    u16 listen_interval,
401f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt		    const struct ieee80211_ht_capabilities *ht_capab,
41a54fa5fb807eaeff45464139b5a7759f060cec68Dmitry Shmidt		    const struct ieee80211_vht_capabilities *vht_capab,
421f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt		    u32 flags, u8 qosinfo);
438d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_set_privacy(struct hostapd_data *hapd, int enabled);
448d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
458d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			     size_t elem_len);
468d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_get_ssid(struct hostapd_data *hapd, u8 *buf, size_t len);
478d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len);
488d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type,
498d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		   const char *ifname, const u8 *addr, void *bss_ctx,
508d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		   void **drv_priv, char *force_ifname, u8 *if_addr,
518d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		   const char *bridge);
528d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_if_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type,
538d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		      const char *ifname);
548d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_set_ieee8021x(struct hostapd_data *hapd,
558d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			  struct wpa_bss_params *params);
568d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_get_seqnum(const char *ifname, struct hostapd_data *hapd,
578d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		       const u8 *addr, int idx, u8 *seq);
588d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_flush(struct hostapd_data *hapd);
598d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq,
60a54fa5fb807eaeff45464139b5a7759f060cec68Dmitry Shmidt		     int channel, int ht_enabled, int vht_enabled,
61a54fa5fb807eaeff45464139b5a7759f060cec68Dmitry Shmidt		     int sec_channel_offset, int vht_oper_chwidth,
62a54fa5fb807eaeff45464139b5a7759f060cec68Dmitry Shmidt		     int center_segment0, int center_segment1);
638d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_set_rts(struct hostapd_data *hapd, int rts);
648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_set_frag(struct hostapd_data *hapd, int frag);
658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_sta_set_flags(struct hostapd_data *hapd, u8 *addr,
668d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			  int total_flags, int flags_or, int flags_and);
678d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_set_country(struct hostapd_data *hapd, const char *country);
688d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_set_tx_queue_params(struct hostapd_data *hapd, int queue, int aifs,
698d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				int cw_min, int cw_max, int burst_time);
708d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct hostapd_hw_modes *
718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidthostapd_get_hw_feature_data(struct hostapd_data *hapd, u16 *num_modes,
728d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			    u16 *flags);
738d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_driver_commit(struct hostapd_data *hapd);
748d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_drv_none(struct hostapd_data *hapd);
758d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_driver_scan(struct hostapd_data *hapd,
768d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			struct wpa_driver_scan_params *params);
778d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstruct wpa_scan_results * hostapd_driver_get_scan_results(
788d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct hostapd_data *hapd);
798d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_driver_set_noa(struct hostapd_data *hapd, u8 count, int start,
808d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			   int duration);
818d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_drv_set_key(const char *ifname,
828d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			struct hostapd_data *hapd,
838d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			enum wpa_alg alg, const u8 *addr,
848d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			int key_idx, int set_tx,
858d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			const u8 *seq, size_t seq_len,
868d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			const u8 *key, size_t key_len);
878d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_drv_send_mlme(struct hostapd_data *hapd,
881f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt			  const void *msg, size_t len, int noack);
898d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_drv_sta_deauth(struct hostapd_data *hapd,
908d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			   const u8 *addr, int reason);
918d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint hostapd_drv_sta_disassoc(struct hostapd_data *hapd,
928d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			     const u8 *addr, int reason);
9304949598a23f501be6eec21697465fd46a28840aDmitry Shmidtint hostapd_drv_send_action(struct hostapd_data *hapd, unsigned int freq,
9404949598a23f501be6eec21697465fd46a28840aDmitry Shmidt			    unsigned int wait, const u8 *dst, const u8 *data,
9504949598a23f501be6eec21697465fd46a28840aDmitry Shmidt			    size_t len);
961f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtint hostapd_add_sta_node(struct hostapd_data *hapd, const u8 *addr,
971f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt			 u16 auth_alg);
981f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtint hostapd_sta_auth(struct hostapd_data *hapd, const u8 *addr,
991f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt		     u16 seq, u16 status, const u8 *ie, size_t len);
1001f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtint hostapd_sta_assoc(struct hostapd_data *hapd, const u8 *addr,
1011f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt		      int reassoc, u16 status, const u8 *ie, size_t len);
1021f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtint hostapd_add_tspec(struct hostapd_data *hapd, const u8 *addr,
1031f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt		      u8 *tspec_ie, size_t tspec_ielen);
1048d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1058d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1068d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#include "drivers/driver.h"
1078d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
10861d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidtint hostapd_drv_wnm_oper(struct hostapd_data *hapd,
10961d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt			 enum wnm_oper oper, const u8 *peer,
11061d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt			 u8 *buf, u16 *buf_len);
11161d9df3e62aaa0e87ad05452fcb95142159a17b6Dmitry Shmidt
1128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstatic inline int hostapd_drv_set_countermeasures(struct hostapd_data *hapd,
1138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt						  int enabled)
1148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	if (hapd->driver == NULL ||
1168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	    hapd->driver->hapd_set_countermeasures == NULL)
1178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		return 0;
1188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	return hapd->driver->hapd_set_countermeasures(hapd->drv_priv, enabled);
1198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstatic inline int hostapd_drv_set_sta_vlan(const char *ifname,
1228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt					   struct hostapd_data *hapd,
1238d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt					   const u8 *addr, int vlan_id)
1248d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1258d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	if (hapd->driver == NULL || hapd->driver->set_sta_vlan == NULL)
1268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		return 0;
1278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	return hapd->driver->set_sta_vlan(hapd->drv_priv, addr, ifname,
1288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt					  vlan_id);
1298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstatic inline int hostapd_drv_get_inact_sec(struct hostapd_data *hapd,
1328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt					    const u8 *addr)
1338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	if (hapd->driver == NULL || hapd->driver->get_inact_sec == NULL)
1358d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		return 0;
1368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	return hapd->driver->get_inact_sec(hapd->drv_priv, addr);
1378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstatic inline int hostapd_drv_sta_remove(struct hostapd_data *hapd,
1408d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt					 const u8 *addr)
1418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1428d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	if (hapd->driver == NULL || hapd->driver->sta_remove == NULL)
1438d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		return 0;
1448d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	return hapd->driver->sta_remove(hapd->drv_priv, addr);
1458d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1468d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1478d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstatic inline int hostapd_drv_hapd_send_eapol(struct hostapd_data *hapd,
1488d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt					      const u8 *addr, const u8 *data,
1498d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt					      size_t data_len, int encrypt,
1508d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt					      u32 flags)
1518d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1528d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	if (hapd->driver == NULL || hapd->driver->hapd_send_eapol == NULL)
1538d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		return 0;
1548d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	return hapd->driver->hapd_send_eapol(hapd->drv_priv, addr, data,
1558d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt					     data_len, encrypt,
1568d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt					     hapd->own_addr, flags);
1578d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1588d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1598d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstatic inline int hostapd_drv_read_sta_data(
1608d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct hostapd_data *hapd, struct hostap_sta_driver_data *data,
1618d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	const u8 *addr)
1628d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1638d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	if (hapd->driver == NULL || hapd->driver->read_sta_data == NULL)
1648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		return -1;
1658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	return hapd->driver->read_sta_data(hapd->drv_priv, data, addr);
1668d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1678d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1688d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstatic inline int hostapd_drv_sta_clear_stats(struct hostapd_data *hapd,
1698d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt					      const u8 *addr)
1708d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	if (hapd->driver == NULL || hapd->driver->sta_clear_stats == NULL)
1728d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		return 0;
1738d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	return hapd->driver->sta_clear_stats(hapd->drv_priv, addr);
1748d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1758d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1768bae4138a0356709720a96f3e50b4d734e532c12Dmitry Shmidtstatic inline int hostapd_drv_set_acl(struct hostapd_data *hapd,
1778bae4138a0356709720a96f3e50b4d734e532c12Dmitry Shmidt				      struct hostapd_acl_params *params)
1788bae4138a0356709720a96f3e50b4d734e532c12Dmitry Shmidt{
1798bae4138a0356709720a96f3e50b4d734e532c12Dmitry Shmidt	if (hapd->driver == NULL || hapd->driver->set_acl == NULL)
1808bae4138a0356709720a96f3e50b4d734e532c12Dmitry Shmidt		return 0;
1818bae4138a0356709720a96f3e50b4d734e532c12Dmitry Shmidt	return hapd->driver->set_acl(hapd->drv_priv, params);
1828bae4138a0356709720a96f3e50b4d734e532c12Dmitry Shmidt}
1838bae4138a0356709720a96f3e50b4d734e532c12Dmitry Shmidt
1841f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtstatic inline int hostapd_drv_set_ap(struct hostapd_data *hapd,
1851f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt				     struct wpa_driver_ap_params *params)
1868d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1871f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt	if (hapd->driver == NULL || hapd->driver->set_ap == NULL)
1888d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		return 0;
1891f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt	return hapd->driver->set_ap(hapd->drv_priv, params);
1908d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1918d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1928d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstatic inline int hostapd_drv_set_radius_acl_auth(struct hostapd_data *hapd,
1938d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt						  const u8 *mac, int accepted,
1948d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt						  u32 session_timeout)
1958d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1968d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	if (hapd->driver == NULL || hapd->driver->set_radius_acl_auth == NULL)
1978d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		return 0;
1988d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	return hapd->driver->set_radius_acl_auth(hapd->drv_priv, mac, accepted,
1998d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt						 session_timeout);
2008d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
2018d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2028d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstatic inline int hostapd_drv_set_radius_acl_expire(struct hostapd_data *hapd,
2038d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt						    const u8 *mac)
2048d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
2058d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	if (hapd->driver == NULL ||
2068d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	    hapd->driver->set_radius_acl_expire == NULL)
2078d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		return 0;
2088d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	return hapd->driver->set_radius_acl_expire(hapd->drv_priv, mac);
2098d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
2108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
21175ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinenstatic inline int hostapd_drv_set_authmode(struct hostapd_data *hapd,
21275ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen					   int auth_algs)
21375ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen{
21475ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	if (hapd->driver == NULL || hapd->driver->set_authmode == NULL)
21575ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen		return 0;
21675ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	return hapd->driver->set_authmode(hapd->drv_priv, auth_algs);
21775ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen}
21875ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen
2191f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtstatic inline void hostapd_drv_poll_client(struct hostapd_data *hapd,
2201f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt					   const u8 *own_addr, const u8 *addr,
2211f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt					   int qos)
2221f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt{
2231f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt	if (hapd->driver == NULL || hapd->driver->poll_client == NULL)
2241f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt		return;
2251f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt	hapd->driver->poll_client(hapd->drv_priv, own_addr, addr, qos);
2261f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt}
2271f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt
228b7b4d0ec07161a6d76c40ba7ef1306e82fbb7e15Dmitry Shmidtstatic inline int hostapd_drv_get_survey(struct hostapd_data *hapd,
229b7b4d0ec07161a6d76c40ba7ef1306e82fbb7e15Dmitry Shmidt					 unsigned int freq)
230b7b4d0ec07161a6d76c40ba7ef1306e82fbb7e15Dmitry Shmidt{
231b7b4d0ec07161a6d76c40ba7ef1306e82fbb7e15Dmitry Shmidt	if (hapd->driver == NULL)
232b7b4d0ec07161a6d76c40ba7ef1306e82fbb7e15Dmitry Shmidt		return -1;
233b7b4d0ec07161a6d76c40ba7ef1306e82fbb7e15Dmitry Shmidt	if (!hapd->driver->get_survey)
234b7b4d0ec07161a6d76c40ba7ef1306e82fbb7e15Dmitry Shmidt		return -1;
235b7b4d0ec07161a6d76c40ba7ef1306e82fbb7e15Dmitry Shmidt	return hapd->driver->get_survey(hapd->drv_priv, freq);
236b7b4d0ec07161a6d76c40ba7ef1306e82fbb7e15Dmitry Shmidt}
237b7b4d0ec07161a6d76c40ba7ef1306e82fbb7e15Dmitry Shmidt
2388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* AP_DRV_OPS */
239