13ff40c12SJohn Marino /*
23ff40c12SJohn Marino * hostapd - Driver operations
33ff40c12SJohn Marino * Copyright (c) 2009-2014, Jouni Malinen <j@w1.fi>
43ff40c12SJohn Marino *
53ff40c12SJohn Marino * This software may be distributed under the terms of the BSD license.
63ff40c12SJohn Marino * See README for more details.
73ff40c12SJohn Marino */
83ff40c12SJohn Marino
93ff40c12SJohn Marino #ifndef AP_DRV_OPS
103ff40c12SJohn Marino #define AP_DRV_OPS
113ff40c12SJohn Marino
123ff40c12SJohn Marino enum wpa_driver_if_type;
133ff40c12SJohn Marino struct wpa_bss_params;
143ff40c12SJohn Marino struct wpa_driver_scan_params;
153ff40c12SJohn Marino struct ieee80211_ht_capabilities;
163ff40c12SJohn Marino struct ieee80211_vht_capabilities;
173ff40c12SJohn Marino struct hostapd_freq_params;
183ff40c12SJohn Marino
193ff40c12SJohn Marino u32 hostapd_sta_flags_to_drv(u32 flags);
203ff40c12SJohn Marino int hostapd_build_ap_extra_ies(struct hostapd_data *hapd,
213ff40c12SJohn Marino struct wpabuf **beacon,
223ff40c12SJohn Marino struct wpabuf **proberesp,
233ff40c12SJohn Marino struct wpabuf **assocresp);
243ff40c12SJohn Marino void hostapd_free_ap_extra_ies(struct hostapd_data *hapd, struct wpabuf *beacon,
253ff40c12SJohn Marino struct wpabuf *proberesp,
263ff40c12SJohn Marino struct wpabuf *assocresp);
27*a1157835SDaniel Fojt int hostapd_reset_ap_wps_ie(struct hostapd_data *hapd);
283ff40c12SJohn Marino int hostapd_set_ap_wps_ie(struct hostapd_data *hapd);
293ff40c12SJohn Marino int hostapd_set_authorized(struct hostapd_data *hapd,
303ff40c12SJohn Marino struct sta_info *sta, int authorized);
313ff40c12SJohn Marino int hostapd_set_sta_flags(struct hostapd_data *hapd, struct sta_info *sta);
323ff40c12SJohn Marino int hostapd_set_drv_ieee8021x(struct hostapd_data *hapd, const char *ifname,
333ff40c12SJohn Marino int enabled);
343ff40c12SJohn Marino int hostapd_vlan_if_add(struct hostapd_data *hapd, const char *ifname);
353ff40c12SJohn Marino int hostapd_vlan_if_remove(struct hostapd_data *hapd, const char *ifname);
363ff40c12SJohn Marino int hostapd_set_wds_sta(struct hostapd_data *hapd, char *ifname_wds,
373ff40c12SJohn Marino const u8 *addr, int aid, int val);
383ff40c12SJohn Marino int hostapd_sta_add(struct hostapd_data *hapd,
393ff40c12SJohn Marino const u8 *addr, u16 aid, u16 capability,
403ff40c12SJohn Marino const u8 *supp_rates, size_t supp_rates_len,
413ff40c12SJohn Marino u16 listen_interval,
423ff40c12SJohn Marino const struct ieee80211_ht_capabilities *ht_capab,
433ff40c12SJohn Marino const struct ieee80211_vht_capabilities *vht_capab,
44*a1157835SDaniel Fojt const struct ieee80211_he_capabilities *he_capab,
45*a1157835SDaniel Fojt size_t he_capab_len,
46*a1157835SDaniel Fojt u32 flags, u8 qosinfo, u8 vht_opmode, int supp_p2p_ps,
47*a1157835SDaniel Fojt int set);
483ff40c12SJohn Marino int hostapd_set_privacy(struct hostapd_data *hapd, int enabled);
493ff40c12SJohn Marino int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
503ff40c12SJohn Marino size_t elem_len);
513ff40c12SJohn Marino int hostapd_get_ssid(struct hostapd_data *hapd, u8 *buf, size_t len);
523ff40c12SJohn Marino int hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len);
533ff40c12SJohn Marino int hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type,
543ff40c12SJohn Marino const char *ifname, const u8 *addr, void *bss_ctx,
553ff40c12SJohn Marino void **drv_priv, char *force_ifname, u8 *if_addr,
563ff40c12SJohn Marino const char *bridge, int use_existing);
573ff40c12SJohn Marino int hostapd_if_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type,
583ff40c12SJohn Marino const char *ifname);
593ff40c12SJohn Marino int hostapd_set_ieee8021x(struct hostapd_data *hapd,
603ff40c12SJohn Marino struct wpa_bss_params *params);
613ff40c12SJohn Marino int hostapd_get_seqnum(const char *ifname, struct hostapd_data *hapd,
623ff40c12SJohn Marino const u8 *addr, int idx, u8 *seq);
633ff40c12SJohn Marino int hostapd_flush(struct hostapd_data *hapd);
64*a1157835SDaniel Fojt int hostapd_set_freq(struct hostapd_data *hapd, enum hostapd_hw_mode mode,
65*a1157835SDaniel Fojt int freq, int channel, int ht_enabled, int vht_enabled,
66*a1157835SDaniel Fojt int he_enabled, int sec_channel_offset, int oper_chwidth,
673ff40c12SJohn Marino int center_segment0, int center_segment1);
683ff40c12SJohn Marino int hostapd_set_rts(struct hostapd_data *hapd, int rts);
693ff40c12SJohn Marino int hostapd_set_frag(struct hostapd_data *hapd, int frag);
703ff40c12SJohn Marino int hostapd_sta_set_flags(struct hostapd_data *hapd, u8 *addr,
713ff40c12SJohn Marino int total_flags, int flags_or, int flags_and);
72*a1157835SDaniel Fojt int hostapd_sta_set_airtime_weight(struct hostapd_data *hapd, const u8 *addr,
73*a1157835SDaniel Fojt unsigned int weight);
743ff40c12SJohn Marino int hostapd_set_country(struct hostapd_data *hapd, const char *country);
753ff40c12SJohn Marino int hostapd_set_tx_queue_params(struct hostapd_data *hapd, int queue, int aifs,
763ff40c12SJohn Marino int cw_min, int cw_max, int burst_time);
773ff40c12SJohn Marino struct hostapd_hw_modes *
783ff40c12SJohn Marino hostapd_get_hw_feature_data(struct hostapd_data *hapd, u16 *num_modes,
79*a1157835SDaniel Fojt u16 *flags, u8 *dfs_domain);
803ff40c12SJohn Marino int hostapd_driver_commit(struct hostapd_data *hapd);
813ff40c12SJohn Marino int hostapd_drv_none(struct hostapd_data *hapd);
823ff40c12SJohn Marino int hostapd_driver_scan(struct hostapd_data *hapd,
833ff40c12SJohn Marino struct wpa_driver_scan_params *params);
843ff40c12SJohn Marino struct wpa_scan_results * hostapd_driver_get_scan_results(
853ff40c12SJohn Marino struct hostapd_data *hapd);
863ff40c12SJohn Marino int hostapd_driver_set_noa(struct hostapd_data *hapd, u8 count, int start,
873ff40c12SJohn Marino int duration);
883ff40c12SJohn Marino int hostapd_drv_set_key(const char *ifname,
893ff40c12SJohn Marino struct hostapd_data *hapd,
903ff40c12SJohn Marino enum wpa_alg alg, const u8 *addr,
913ff40c12SJohn Marino int key_idx, int set_tx,
923ff40c12SJohn Marino const u8 *seq, size_t seq_len,
933ff40c12SJohn Marino const u8 *key, size_t key_len);
943ff40c12SJohn Marino int hostapd_drv_send_mlme(struct hostapd_data *hapd,
953ff40c12SJohn Marino const void *msg, size_t len, int noack);
96*a1157835SDaniel Fojt int hostapd_drv_send_mlme_csa(struct hostapd_data *hapd,
97*a1157835SDaniel Fojt const void *msg, size_t len, int noack,
98*a1157835SDaniel Fojt const u16 *csa_offs, size_t csa_offs_len);
993ff40c12SJohn Marino int hostapd_drv_sta_deauth(struct hostapd_data *hapd,
1003ff40c12SJohn Marino const u8 *addr, int reason);
1013ff40c12SJohn Marino int hostapd_drv_sta_disassoc(struct hostapd_data *hapd,
1023ff40c12SJohn Marino const u8 *addr, int reason);
1033ff40c12SJohn Marino int hostapd_drv_send_action(struct hostapd_data *hapd, unsigned int freq,
1043ff40c12SJohn Marino unsigned int wait, const u8 *dst, const u8 *data,
1053ff40c12SJohn Marino size_t len);
106*a1157835SDaniel Fojt int hostapd_drv_send_action_addr3_ap(struct hostapd_data *hapd,
107*a1157835SDaniel Fojt unsigned int freq,
108*a1157835SDaniel Fojt unsigned int wait, const u8 *dst,
109*a1157835SDaniel Fojt const u8 *data, size_t len);
110*a1157835SDaniel Fojt static inline void
hostapd_drv_send_action_cancel_wait(struct hostapd_data * hapd)111*a1157835SDaniel Fojt hostapd_drv_send_action_cancel_wait(struct hostapd_data *hapd)
112*a1157835SDaniel Fojt {
113*a1157835SDaniel Fojt if (!hapd->driver || !hapd->driver->send_action_cancel_wait ||
114*a1157835SDaniel Fojt !hapd->drv_priv)
115*a1157835SDaniel Fojt return;
116*a1157835SDaniel Fojt hapd->driver->send_action_cancel_wait(hapd->drv_priv);
117*a1157835SDaniel Fojt }
1183ff40c12SJohn Marino int hostapd_add_sta_node(struct hostapd_data *hapd, const u8 *addr,
1193ff40c12SJohn Marino u16 auth_alg);
1203ff40c12SJohn Marino int hostapd_sta_auth(struct hostapd_data *hapd, const u8 *addr,
1213ff40c12SJohn Marino u16 seq, u16 status, const u8 *ie, size_t len);
1223ff40c12SJohn Marino int hostapd_sta_assoc(struct hostapd_data *hapd, const u8 *addr,
1233ff40c12SJohn Marino int reassoc, u16 status, const u8 *ie, size_t len);
1243ff40c12SJohn Marino int hostapd_add_tspec(struct hostapd_data *hapd, const u8 *addr,
1253ff40c12SJohn Marino u8 *tspec_ie, size_t tspec_ielen);
126*a1157835SDaniel Fojt int hostapd_start_dfs_cac(struct hostapd_iface *iface,
127*a1157835SDaniel Fojt enum hostapd_hw_mode mode, int freq,
1283ff40c12SJohn Marino int channel, int ht_enabled, int vht_enabled,
129*a1157835SDaniel Fojt int he_enabled,
130*a1157835SDaniel Fojt int sec_channel_offset, int oper_chwidth,
1313ff40c12SJohn Marino int center_segment0, int center_segment1);
132*a1157835SDaniel Fojt int hostapd_drv_do_acs(struct hostapd_data *hapd);
133*a1157835SDaniel Fojt int hostapd_drv_update_dh_ie(struct hostapd_data *hapd, const u8 *peer,
134*a1157835SDaniel Fojt u16 reason_code, const u8 *ie, size_t ielen);
1353ff40c12SJohn Marino
1363ff40c12SJohn Marino
1373ff40c12SJohn Marino #include "drivers/driver.h"
1383ff40c12SJohn Marino
1393ff40c12SJohn Marino int hostapd_drv_wnm_oper(struct hostapd_data *hapd,
1403ff40c12SJohn Marino enum wnm_oper oper, const u8 *peer,
1413ff40c12SJohn Marino u8 *buf, u16 *buf_len);
1423ff40c12SJohn Marino
1433ff40c12SJohn Marino int hostapd_drv_set_qos_map(struct hostapd_data *hapd, const u8 *qos_map_set,
1443ff40c12SJohn Marino u8 qos_map_set_len);
1453ff40c12SJohn Marino
146*a1157835SDaniel Fojt void hostapd_get_ext_capa(struct hostapd_iface *iface);
147*a1157835SDaniel Fojt
hostapd_drv_set_countermeasures(struct hostapd_data * hapd,int enabled)1483ff40c12SJohn Marino static inline int hostapd_drv_set_countermeasures(struct hostapd_data *hapd,
1493ff40c12SJohn Marino int enabled)
1503ff40c12SJohn Marino {
1513ff40c12SJohn Marino if (hapd->driver == NULL ||
1523ff40c12SJohn Marino hapd->driver->hapd_set_countermeasures == NULL)
1533ff40c12SJohn Marino return 0;
1543ff40c12SJohn Marino return hapd->driver->hapd_set_countermeasures(hapd->drv_priv, enabled);
1553ff40c12SJohn Marino }
1563ff40c12SJohn Marino
hostapd_drv_set_sta_vlan(const char * ifname,struct hostapd_data * hapd,const u8 * addr,int vlan_id)1573ff40c12SJohn Marino static inline int hostapd_drv_set_sta_vlan(const char *ifname,
1583ff40c12SJohn Marino struct hostapd_data *hapd,
1593ff40c12SJohn Marino const u8 *addr, int vlan_id)
1603ff40c12SJohn Marino {
1613ff40c12SJohn Marino if (hapd->driver == NULL || hapd->driver->set_sta_vlan == NULL)
1623ff40c12SJohn Marino return 0;
1633ff40c12SJohn Marino return hapd->driver->set_sta_vlan(hapd->drv_priv, addr, ifname,
1643ff40c12SJohn Marino vlan_id);
1653ff40c12SJohn Marino }
1663ff40c12SJohn Marino
hostapd_drv_get_inact_sec(struct hostapd_data * hapd,const u8 * addr)1673ff40c12SJohn Marino static inline int hostapd_drv_get_inact_sec(struct hostapd_data *hapd,
1683ff40c12SJohn Marino const u8 *addr)
1693ff40c12SJohn Marino {
1703ff40c12SJohn Marino if (hapd->driver == NULL || hapd->driver->get_inact_sec == NULL)
1713ff40c12SJohn Marino return 0;
1723ff40c12SJohn Marino return hapd->driver->get_inact_sec(hapd->drv_priv, addr);
1733ff40c12SJohn Marino }
1743ff40c12SJohn Marino
hostapd_drv_sta_remove(struct hostapd_data * hapd,const u8 * addr)1753ff40c12SJohn Marino static inline int hostapd_drv_sta_remove(struct hostapd_data *hapd,
1763ff40c12SJohn Marino const u8 *addr)
1773ff40c12SJohn Marino {
178*a1157835SDaniel Fojt if (!hapd->driver || !hapd->driver->sta_remove || !hapd->drv_priv)
1793ff40c12SJohn Marino return 0;
1803ff40c12SJohn Marino return hapd->driver->sta_remove(hapd->drv_priv, addr);
1813ff40c12SJohn Marino }
1823ff40c12SJohn Marino
hostapd_drv_hapd_send_eapol(struct hostapd_data * hapd,const u8 * addr,const u8 * data,size_t data_len,int encrypt,u32 flags)1833ff40c12SJohn Marino static inline int hostapd_drv_hapd_send_eapol(struct hostapd_data *hapd,
1843ff40c12SJohn Marino const u8 *addr, const u8 *data,
1853ff40c12SJohn Marino size_t data_len, int encrypt,
1863ff40c12SJohn Marino u32 flags)
1873ff40c12SJohn Marino {
1883ff40c12SJohn Marino if (hapd->driver == NULL || hapd->driver->hapd_send_eapol == NULL)
1893ff40c12SJohn Marino return 0;
1903ff40c12SJohn Marino return hapd->driver->hapd_send_eapol(hapd->drv_priv, addr, data,
1913ff40c12SJohn Marino data_len, encrypt,
1923ff40c12SJohn Marino hapd->own_addr, flags);
1933ff40c12SJohn Marino }
1943ff40c12SJohn Marino
hostapd_drv_read_sta_data(struct hostapd_data * hapd,struct hostap_sta_driver_data * data,const u8 * addr)1953ff40c12SJohn Marino static inline int hostapd_drv_read_sta_data(
1963ff40c12SJohn Marino struct hostapd_data *hapd, struct hostap_sta_driver_data *data,
1973ff40c12SJohn Marino const u8 *addr)
1983ff40c12SJohn Marino {
1993ff40c12SJohn Marino if (hapd->driver == NULL || hapd->driver->read_sta_data == NULL)
2003ff40c12SJohn Marino return -1;
2013ff40c12SJohn Marino return hapd->driver->read_sta_data(hapd->drv_priv, data, addr);
2023ff40c12SJohn Marino }
2033ff40c12SJohn Marino
hostapd_drv_sta_clear_stats(struct hostapd_data * hapd,const u8 * addr)2043ff40c12SJohn Marino static inline int hostapd_drv_sta_clear_stats(struct hostapd_data *hapd,
2053ff40c12SJohn Marino const u8 *addr)
2063ff40c12SJohn Marino {
2073ff40c12SJohn Marino if (hapd->driver == NULL || hapd->driver->sta_clear_stats == NULL)
2083ff40c12SJohn Marino return 0;
2093ff40c12SJohn Marino return hapd->driver->sta_clear_stats(hapd->drv_priv, addr);
2103ff40c12SJohn Marino }
2113ff40c12SJohn Marino
hostapd_drv_set_acl(struct hostapd_data * hapd,struct hostapd_acl_params * params)2123ff40c12SJohn Marino static inline int hostapd_drv_set_acl(struct hostapd_data *hapd,
2133ff40c12SJohn Marino struct hostapd_acl_params *params)
2143ff40c12SJohn Marino {
2153ff40c12SJohn Marino if (hapd->driver == NULL || hapd->driver->set_acl == NULL)
2163ff40c12SJohn Marino return 0;
2173ff40c12SJohn Marino return hapd->driver->set_acl(hapd->drv_priv, params);
2183ff40c12SJohn Marino }
2193ff40c12SJohn Marino
hostapd_drv_set_ap(struct hostapd_data * hapd,struct wpa_driver_ap_params * params)2203ff40c12SJohn Marino static inline int hostapd_drv_set_ap(struct hostapd_data *hapd,
2213ff40c12SJohn Marino struct wpa_driver_ap_params *params)
2223ff40c12SJohn Marino {
2233ff40c12SJohn Marino if (hapd->driver == NULL || hapd->driver->set_ap == NULL)
2243ff40c12SJohn Marino return 0;
2253ff40c12SJohn Marino return hapd->driver->set_ap(hapd->drv_priv, params);
2263ff40c12SJohn Marino }
2273ff40c12SJohn Marino
hostapd_drv_set_radius_acl_auth(struct hostapd_data * hapd,const u8 * mac,int accepted,u32 session_timeout)2283ff40c12SJohn Marino static inline int hostapd_drv_set_radius_acl_auth(struct hostapd_data *hapd,
2293ff40c12SJohn Marino const u8 *mac, int accepted,
2303ff40c12SJohn Marino u32 session_timeout)
2313ff40c12SJohn Marino {
2323ff40c12SJohn Marino if (hapd->driver == NULL || hapd->driver->set_radius_acl_auth == NULL)
2333ff40c12SJohn Marino return 0;
2343ff40c12SJohn Marino return hapd->driver->set_radius_acl_auth(hapd->drv_priv, mac, accepted,
2353ff40c12SJohn Marino session_timeout);
2363ff40c12SJohn Marino }
2373ff40c12SJohn Marino
hostapd_drv_set_radius_acl_expire(struct hostapd_data * hapd,const u8 * mac)2383ff40c12SJohn Marino static inline int hostapd_drv_set_radius_acl_expire(struct hostapd_data *hapd,
2393ff40c12SJohn Marino const u8 *mac)
2403ff40c12SJohn Marino {
2413ff40c12SJohn Marino if (hapd->driver == NULL ||
2423ff40c12SJohn Marino hapd->driver->set_radius_acl_expire == NULL)
2433ff40c12SJohn Marino return 0;
2443ff40c12SJohn Marino return hapd->driver->set_radius_acl_expire(hapd->drv_priv, mac);
2453ff40c12SJohn Marino }
2463ff40c12SJohn Marino
hostapd_drv_set_authmode(struct hostapd_data * hapd,int auth_algs)2473ff40c12SJohn Marino static inline int hostapd_drv_set_authmode(struct hostapd_data *hapd,
2483ff40c12SJohn Marino int auth_algs)
2493ff40c12SJohn Marino {
2503ff40c12SJohn Marino if (hapd->driver == NULL || hapd->driver->set_authmode == NULL)
2513ff40c12SJohn Marino return 0;
2523ff40c12SJohn Marino return hapd->driver->set_authmode(hapd->drv_priv, auth_algs);
2533ff40c12SJohn Marino }
2543ff40c12SJohn Marino
hostapd_drv_poll_client(struct hostapd_data * hapd,const u8 * own_addr,const u8 * addr,int qos)2553ff40c12SJohn Marino static inline void hostapd_drv_poll_client(struct hostapd_data *hapd,
2563ff40c12SJohn Marino const u8 *own_addr, const u8 *addr,
2573ff40c12SJohn Marino int qos)
2583ff40c12SJohn Marino {
2593ff40c12SJohn Marino if (hapd->driver == NULL || hapd->driver->poll_client == NULL)
2603ff40c12SJohn Marino return;
2613ff40c12SJohn Marino hapd->driver->poll_client(hapd->drv_priv, own_addr, addr, qos);
2623ff40c12SJohn Marino }
2633ff40c12SJohn Marino
hostapd_drv_get_survey(struct hostapd_data * hapd,unsigned int freq)2643ff40c12SJohn Marino static inline int hostapd_drv_get_survey(struct hostapd_data *hapd,
2653ff40c12SJohn Marino unsigned int freq)
2663ff40c12SJohn Marino {
2673ff40c12SJohn Marino if (hapd->driver == NULL)
2683ff40c12SJohn Marino return -1;
2693ff40c12SJohn Marino if (!hapd->driver->get_survey)
2703ff40c12SJohn Marino return -1;
2713ff40c12SJohn Marino return hapd->driver->get_survey(hapd->drv_priv, freq);
2723ff40c12SJohn Marino }
2733ff40c12SJohn Marino
hostapd_get_country(struct hostapd_data * hapd,char * alpha2)2743ff40c12SJohn Marino static inline int hostapd_get_country(struct hostapd_data *hapd, char *alpha2)
2753ff40c12SJohn Marino {
2763ff40c12SJohn Marino if (hapd->driver == NULL || hapd->driver->get_country == NULL)
2773ff40c12SJohn Marino return -1;
2783ff40c12SJohn Marino return hapd->driver->get_country(hapd->drv_priv, alpha2);
2793ff40c12SJohn Marino }
2803ff40c12SJohn Marino
hostapd_drv_get_radio_name(struct hostapd_data * hapd)2813ff40c12SJohn Marino static inline const char * hostapd_drv_get_radio_name(struct hostapd_data *hapd)
2823ff40c12SJohn Marino {
2833ff40c12SJohn Marino if (hapd->driver == NULL || hapd->drv_priv == NULL ||
2843ff40c12SJohn Marino hapd->driver->get_radio_name == NULL)
2853ff40c12SJohn Marino return NULL;
2863ff40c12SJohn Marino return hapd->driver->get_radio_name(hapd->drv_priv);
2873ff40c12SJohn Marino }
2883ff40c12SJohn Marino
hostapd_drv_switch_channel(struct hostapd_data * hapd,struct csa_settings * settings)2893ff40c12SJohn Marino static inline int hostapd_drv_switch_channel(struct hostapd_data *hapd,
2903ff40c12SJohn Marino struct csa_settings *settings)
2913ff40c12SJohn Marino {
292*a1157835SDaniel Fojt if (hapd->driver == NULL || hapd->driver->switch_channel == NULL ||
293*a1157835SDaniel Fojt hapd->drv_priv == NULL)
294*a1157835SDaniel Fojt return -1;
2953ff40c12SJohn Marino
2963ff40c12SJohn Marino return hapd->driver->switch_channel(hapd->drv_priv, settings);
2973ff40c12SJohn Marino }
2983ff40c12SJohn Marino
hostapd_drv_status(struct hostapd_data * hapd,char * buf,size_t buflen)2993ff40c12SJohn Marino static inline int hostapd_drv_status(struct hostapd_data *hapd, char *buf,
3003ff40c12SJohn Marino size_t buflen)
3013ff40c12SJohn Marino {
302*a1157835SDaniel Fojt if (!hapd->driver || !hapd->driver->status || !hapd->drv_priv)
3033ff40c12SJohn Marino return -1;
3043ff40c12SJohn Marino return hapd->driver->status(hapd->drv_priv, buf, buflen);
3053ff40c12SJohn Marino }
3063ff40c12SJohn Marino
hostapd_drv_br_add_ip_neigh(struct hostapd_data * hapd,int version,const u8 * ipaddr,int prefixlen,const u8 * addr)307*a1157835SDaniel Fojt static inline int hostapd_drv_br_add_ip_neigh(struct hostapd_data *hapd,
308*a1157835SDaniel Fojt int version, const u8 *ipaddr,
309*a1157835SDaniel Fojt int prefixlen, const u8 *addr)
310*a1157835SDaniel Fojt {
311*a1157835SDaniel Fojt if (hapd->driver == NULL || hapd->drv_priv == NULL ||
312*a1157835SDaniel Fojt hapd->driver->br_add_ip_neigh == NULL)
313*a1157835SDaniel Fojt return -1;
314*a1157835SDaniel Fojt return hapd->driver->br_add_ip_neigh(hapd->drv_priv, version, ipaddr,
315*a1157835SDaniel Fojt prefixlen, addr);
316*a1157835SDaniel Fojt }
317*a1157835SDaniel Fojt
hostapd_drv_br_delete_ip_neigh(struct hostapd_data * hapd,u8 version,const u8 * ipaddr)318*a1157835SDaniel Fojt static inline int hostapd_drv_br_delete_ip_neigh(struct hostapd_data *hapd,
319*a1157835SDaniel Fojt u8 version, const u8 *ipaddr)
320*a1157835SDaniel Fojt {
321*a1157835SDaniel Fojt if (hapd->driver == NULL || hapd->drv_priv == NULL ||
322*a1157835SDaniel Fojt hapd->driver->br_delete_ip_neigh == NULL)
323*a1157835SDaniel Fojt return -1;
324*a1157835SDaniel Fojt return hapd->driver->br_delete_ip_neigh(hapd->drv_priv, version,
325*a1157835SDaniel Fojt ipaddr);
326*a1157835SDaniel Fojt }
327*a1157835SDaniel Fojt
hostapd_drv_br_port_set_attr(struct hostapd_data * hapd,enum drv_br_port_attr attr,unsigned int val)328*a1157835SDaniel Fojt static inline int hostapd_drv_br_port_set_attr(struct hostapd_data *hapd,
329*a1157835SDaniel Fojt enum drv_br_port_attr attr,
330*a1157835SDaniel Fojt unsigned int val)
331*a1157835SDaniel Fojt {
332*a1157835SDaniel Fojt if (hapd->driver == NULL || hapd->drv_priv == NULL ||
333*a1157835SDaniel Fojt hapd->driver->br_port_set_attr == NULL)
334*a1157835SDaniel Fojt return -1;
335*a1157835SDaniel Fojt return hapd->driver->br_port_set_attr(hapd->drv_priv, attr, val);
336*a1157835SDaniel Fojt }
337*a1157835SDaniel Fojt
hostapd_drv_br_set_net_param(struct hostapd_data * hapd,enum drv_br_net_param param,unsigned int val)338*a1157835SDaniel Fojt static inline int hostapd_drv_br_set_net_param(struct hostapd_data *hapd,
339*a1157835SDaniel Fojt enum drv_br_net_param param,
340*a1157835SDaniel Fojt unsigned int val)
341*a1157835SDaniel Fojt {
342*a1157835SDaniel Fojt if (hapd->driver == NULL || hapd->drv_priv == NULL ||
343*a1157835SDaniel Fojt hapd->driver->br_set_net_param == NULL)
344*a1157835SDaniel Fojt return -1;
345*a1157835SDaniel Fojt return hapd->driver->br_set_net_param(hapd->drv_priv, param, val);
346*a1157835SDaniel Fojt }
347*a1157835SDaniel Fojt
hostapd_drv_vendor_cmd(struct hostapd_data * hapd,int vendor_id,int subcmd,const u8 * data,size_t data_len,struct wpabuf * buf)348*a1157835SDaniel Fojt static inline int hostapd_drv_vendor_cmd(struct hostapd_data *hapd,
349*a1157835SDaniel Fojt int vendor_id, int subcmd,
350*a1157835SDaniel Fojt const u8 *data, size_t data_len,
351*a1157835SDaniel Fojt struct wpabuf *buf)
352*a1157835SDaniel Fojt {
353*a1157835SDaniel Fojt if (hapd->driver == NULL || hapd->driver->vendor_cmd == NULL)
354*a1157835SDaniel Fojt return -1;
355*a1157835SDaniel Fojt return hapd->driver->vendor_cmd(hapd->drv_priv, vendor_id, subcmd, data,
356*a1157835SDaniel Fojt data_len, buf);
357*a1157835SDaniel Fojt }
358*a1157835SDaniel Fojt
hostapd_drv_stop_ap(struct hostapd_data * hapd)359*a1157835SDaniel Fojt static inline int hostapd_drv_stop_ap(struct hostapd_data *hapd)
360*a1157835SDaniel Fojt {
361*a1157835SDaniel Fojt if (!hapd->driver || !hapd->driver->stop_ap || !hapd->drv_priv)
362*a1157835SDaniel Fojt return 0;
363*a1157835SDaniel Fojt return hapd->driver->stop_ap(hapd->drv_priv);
364*a1157835SDaniel Fojt }
365*a1157835SDaniel Fojt
hostapd_drv_channel_info(struct hostapd_data * hapd,struct wpa_channel_info * ci)366*a1157835SDaniel Fojt static inline int hostapd_drv_channel_info(struct hostapd_data *hapd,
367*a1157835SDaniel Fojt struct wpa_channel_info *ci)
368*a1157835SDaniel Fojt {
369*a1157835SDaniel Fojt if (!hapd->driver || !hapd->driver->channel_info)
370*a1157835SDaniel Fojt return -1;
371*a1157835SDaniel Fojt return hapd->driver->channel_info(hapd->drv_priv, ci);
372*a1157835SDaniel Fojt }
373*a1157835SDaniel Fojt
374*a1157835SDaniel Fojt static inline int
hostapd_drv_send_external_auth_status(struct hostapd_data * hapd,struct external_auth * params)375*a1157835SDaniel Fojt hostapd_drv_send_external_auth_status(struct hostapd_data *hapd,
376*a1157835SDaniel Fojt struct external_auth *params)
377*a1157835SDaniel Fojt {
378*a1157835SDaniel Fojt if (!hapd->driver || !hapd->drv_priv ||
379*a1157835SDaniel Fojt !hapd->driver->send_external_auth_status)
380*a1157835SDaniel Fojt return -1;
381*a1157835SDaniel Fojt return hapd->driver->send_external_auth_status(hapd->drv_priv, params);
382*a1157835SDaniel Fojt }
383*a1157835SDaniel Fojt
3843ff40c12SJohn Marino #endif /* AP_DRV_OPS */
385