Sync usage with man page.
[netbsd-mini2440.git] / dist / wpa / hostapd / driver.h
blobf76d2d432bb5be947700c79fcedb2634381d17d8
1 /*
2 * hostapd - driver interface definition
3 * Copyright (c) 2002-2007, Jouni Malinen <j@w1.fi>
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.
9 * Alternatively, this software may be distributed under the terms of BSD
10 * license.
12 * See README and COPYING for more details.
15 #ifndef DRIVER_H
16 #define DRIVER_H
18 enum hostapd_driver_if_type {
19 HOSTAPD_IF_VLAN, HOSTAPD_IF_WDS
22 struct wpa_driver_ops {
23 const char *name; /* as appears in the config file */
25 void * (*init)(struct hostapd_data *hapd);
26 void * (*init_bssid)(struct hostapd_data *hapd, const u8 *bssid);
27 void (*deinit)(void *priv);
29 int (*wireless_event_init)(void *priv);
30 void (*wireless_event_deinit)(void *priv);
32 /**
33 * set_8021x - enable/disable IEEE 802.1X support
34 * @ifname: Interface name (for multi-SSID/VLAN support)
35 * @priv: driver private data
36 * @enabled: 1 = enable, 0 = disable
38 * Returns: 0 on success, -1 on failure
40 * Configure the kernel driver to enable/disable 802.1X support.
41 * This may be an empty function if 802.1X support is always enabled.
43 int (*set_ieee8021x)(const char *ifname, void *priv, int enabled);
45 /**
46 * set_privacy - enable/disable privacy
47 * @priv: driver private data
48 * @enabled: 1 = privacy enabled, 0 = disabled
50 * Return: 0 on success, -1 on failure
52 * Configure privacy.
54 int (*set_privacy)(const char *ifname, void *priv, int enabled);
56 int (*set_encryption)(const char *ifname, void *priv, const char *alg,
57 const u8 *addr, int idx,
58 const u8 *key, size_t key_len, int txkey);
59 int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
60 int idx, u8 *seq);
61 int (*get_seqnum_igtk)(const char *ifname, void *priv, const u8 *addr,
62 int idx, u8 *seq);
63 int (*flush)(void *priv);
64 int (*set_generic_elem)(const char *ifname, void *priv, const u8 *elem,
65 size_t elem_len);
67 int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data,
68 const u8 *addr);
69 int (*send_eapol)(void *priv, const u8 *addr, const u8 *data,
70 size_t data_len, int encrypt, const u8 *own_addr);
71 int (*sta_deauth)(void *priv, const u8 *addr, int reason);
72 int (*sta_disassoc)(void *priv, const u8 *addr, int reason);
73 int (*sta_remove)(void *priv, const u8 *addr);
74 int (*get_ssid)(const char *ifname, void *priv, u8 *buf, int len);
75 int (*set_ssid)(const char *ifname, void *priv, const u8 *buf,
76 int len);
77 int (*set_countermeasures)(void *priv, int enabled);
78 int (*send_mgmt_frame)(void *priv, const void *msg, size_t len,
79 int flags);
80 int (*set_assoc_ap)(void *priv, const u8 *addr);
81 int (*sta_add)(const char *ifname, void *priv, const u8 *addr, u16 aid,
82 u16 capability, u8 *supp_rates, size_t supp_rates_len,
83 int flags, u16 listen_interval);
84 int (*get_inact_sec)(void *priv, const u8 *addr);
85 int (*sta_clear_stats)(void *priv, const u8 *addr);
87 int (*set_freq)(void *priv, int mode, int freq);
88 int (*set_rts)(void *priv, int rts);
89 int (*get_rts)(void *priv, int *rts);
90 int (*set_frag)(void *priv, int frag);
91 int (*get_frag)(void *priv, int *frag);
92 int (*set_retry)(void *priv, int short_retry, int long_retry);
93 int (*get_retry)(void *priv, int *short_retry, int *long_retry);
95 int (*sta_set_flags)(void *priv, const u8 *addr,
96 int total_flags, int flags_or, int flags_and);
97 int (*set_rate_sets)(void *priv, int *supp_rates, int *basic_rates,
98 int mode);
99 int (*set_channel_flag)(void *priv, int mode, int chan, int flag,
100 unsigned char power_level,
101 unsigned char antenna_max);
102 int (*set_regulatory_domain)(void *priv, unsigned int rd);
103 int (*set_country)(void *priv, const char *country);
104 int (*set_ieee80211d)(void *priv, int enabled);
105 int (*set_beacon)(const char *ifname, void *priv,
106 u8 *head, size_t head_len,
107 u8 *tail, size_t tail_len);
109 /* Configure internal bridge:
110 * 0 = disabled, i.e., client separation is enabled (no bridging of
111 * packets between associated STAs
112 * 1 = enabled, i.e., bridge packets between associated STAs (default)
114 int (*set_internal_bridge)(void *priv, int value);
115 int (*set_beacon_int)(void *priv, int value);
116 int (*set_dtim_period)(const char *ifname, void *priv, int value);
117 /* Configure broadcast SSID mode:
118 * 0 = include SSID in Beacon frames and reply to Probe Request frames
119 * that use broadcast SSID
120 * 1 = hide SSID from Beacon frames and ignore Probe Request frames for
121 * broadcast SSID
123 int (*set_broadcast_ssid)(void *priv, int value);
124 int (*set_cts_protect)(void *priv, int value);
125 int (*set_key_tx_rx_threshold)(void *priv, int value);
126 int (*set_preamble)(void *priv, int value);
127 int (*set_short_slot_time)(void *priv, int value);
128 int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min,
129 int cw_max, int burst_time);
130 int (*bss_add)(void *priv, const char *ifname, const u8 *bssid);
131 int (*bss_remove)(void *priv, const char *ifname);
132 int (*valid_bss_mask)(void *priv, const u8 *addr, const u8 *mask);
133 int (*passive_scan)(void *priv, int now, int our_mode_only,
134 int interval, int _listen, int *channel,
135 int *last_rx);
136 struct hostapd_hw_modes * (*get_hw_feature_data)(void *priv,
137 u16 *num_modes,
138 u16 *flags);
139 int (*if_add)(const char *iface, void *priv,
140 enum hostapd_driver_if_type type, char *ifname,
141 const u8 *addr);
142 int (*if_update)(void *priv, enum hostapd_driver_if_type type,
143 char *ifname, const u8 *addr);
144 int (*if_remove)(void *priv, enum hostapd_driver_if_type type,
145 const char *ifname, const u8 *addr);
146 int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname,
147 int vlan_id);
149 * commit - Optional commit changes handler
150 * @priv: driver private data
151 * Returns: 0 on success, -1 on failure
153 * This optional handler function can be registered if the driver
154 * interface implementation needs to commit changes (e.g., by setting
155 * network interface up) at the end of initial configuration. If set,
156 * this handler will be called after initial setup has been completed.
158 int (*commit)(void *priv);
160 int (*send_ether)(void *priv, const u8 *dst, const u8 *src, u16 proto,
161 const u8 *data, size_t data_len);
163 int (*set_radius_acl_auth)(void *priv, const u8 *mac, int accepted,
164 u32 session_timeout);
165 int (*set_radius_acl_expire)(void *priv, const u8 *mac);
168 static inline void *
169 hostapd_driver_init(struct hostapd_data *hapd)
171 if (hapd->driver == NULL || hapd->driver->init == NULL)
172 return NULL;
173 return hapd->driver->init(hapd);
176 static inline void *
177 hostapd_driver_init_bssid(struct hostapd_data *hapd, const u8 *bssid)
179 if (hapd->driver == NULL || hapd->driver->init_bssid == NULL)
180 return NULL;
181 return hapd->driver->init_bssid(hapd, bssid);
184 static inline void
185 hostapd_driver_deinit(struct hostapd_data *hapd)
187 if (hapd->driver == NULL || hapd->driver->deinit == NULL)
188 return;
189 hapd->driver->deinit(hapd->drv_priv);
192 static inline int
193 hostapd_wireless_event_init(struct hostapd_data *hapd)
195 if (hapd->driver == NULL ||
196 hapd->driver->wireless_event_init == NULL)
197 return 0;
198 return hapd->driver->wireless_event_init(hapd->drv_priv);
201 static inline void
202 hostapd_wireless_event_deinit(struct hostapd_data *hapd)
204 if (hapd->driver == NULL ||
205 hapd->driver->wireless_event_deinit == NULL)
206 return;
207 hapd->driver->wireless_event_deinit(hapd->drv_priv);
210 static inline int
211 hostapd_set_ieee8021x(const char *ifname, struct hostapd_data *hapd,
212 int enabled)
214 if (hapd->driver == NULL || hapd->driver->set_ieee8021x == NULL)
215 return 0;
216 return hapd->driver->set_ieee8021x(ifname, hapd->drv_priv, enabled);
219 static inline int
220 hostapd_set_privacy(struct hostapd_data *hapd, int enabled)
222 if (hapd->driver == NULL || hapd->driver->set_privacy == NULL)
223 return 0;
224 return hapd->driver->set_privacy(hapd->conf->iface, hapd->drv_priv,
225 enabled);
228 static inline int
229 hostapd_set_encryption(const char *ifname, struct hostapd_data *hapd,
230 const char *alg, const u8 *addr, int idx,
231 u8 *key, size_t key_len, int txkey)
233 if (hapd->driver == NULL || hapd->driver->set_encryption == NULL)
234 return 0;
235 return hapd->driver->set_encryption(ifname, hapd->drv_priv, alg, addr,
236 idx, key, key_len, txkey);
239 static inline int
240 hostapd_get_seqnum(const char *ifname, struct hostapd_data *hapd,
241 const u8 *addr, int idx, u8 *seq)
243 if (hapd->driver == NULL || hapd->driver->get_seqnum == NULL)
244 return 0;
245 return hapd->driver->get_seqnum(ifname, hapd->drv_priv, addr, idx,
246 seq);
249 static inline int
250 hostapd_get_seqnum_igtk(const char *ifname, struct hostapd_data *hapd,
251 const u8 *addr, int idx, u8 *seq)
253 if (hapd->driver == NULL || hapd->driver->get_seqnum_igtk == NULL)
254 return -1;
255 return hapd->driver->get_seqnum_igtk(ifname, hapd->drv_priv, addr, idx,
256 seq);
259 static inline int
260 hostapd_flush(struct hostapd_data *hapd)
262 if (hapd->driver == NULL || hapd->driver->flush == NULL)
263 return 0;
264 return hapd->driver->flush(hapd->drv_priv);
267 static inline int
268 hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
269 size_t elem_len)
271 if (hapd->driver == NULL || hapd->driver->set_generic_elem == NULL)
272 return 0;
273 return hapd->driver->set_generic_elem(hapd->conf->iface,
274 hapd->drv_priv, elem, elem_len);
277 static inline int
278 hostapd_read_sta_data(struct hostapd_data *hapd,
279 struct hostap_sta_driver_data *data, const u8 *addr)
281 if (hapd->driver == NULL || hapd->driver->read_sta_data == NULL)
282 return -1;
283 return hapd->driver->read_sta_data(hapd->drv_priv, data, addr);
286 static inline int
287 hostapd_send_eapol(struct hostapd_data *hapd, const u8 *addr, const u8 *data,
288 size_t data_len, int encrypt)
290 if (hapd->driver == NULL || hapd->driver->send_eapol == NULL)
291 return 0;
292 return hapd->driver->send_eapol(hapd->drv_priv, addr, data, data_len,
293 encrypt, hapd->own_addr);
296 static inline int
297 hostapd_sta_deauth(struct hostapd_data *hapd, const u8 *addr, int reason)
299 if (hapd->driver == NULL || hapd->driver->sta_deauth == NULL)
300 return 0;
301 return hapd->driver->sta_deauth(hapd->drv_priv, addr, reason);
304 static inline int
305 hostapd_sta_disassoc(struct hostapd_data *hapd, const u8 *addr, int reason)
307 if (hapd->driver == NULL || hapd->driver->sta_disassoc == NULL)
308 return 0;
309 return hapd->driver->sta_disassoc(hapd->drv_priv, addr, reason);
312 static inline int
313 hostapd_sta_remove(struct hostapd_data *hapd, const u8 *addr)
315 if (hapd->driver == NULL || hapd->driver->sta_remove == NULL)
316 return 0;
317 return hapd->driver->sta_remove(hapd->drv_priv, addr);
320 static inline int
321 hostapd_get_ssid(struct hostapd_data *hapd, u8 *buf, size_t len)
323 if (hapd->driver == NULL || hapd->driver->get_ssid == NULL)
324 return 0;
325 return hapd->driver->get_ssid(hapd->conf->iface, hapd->drv_priv, buf,
326 len);
329 static inline int
330 hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len)
332 if (hapd->driver == NULL || hapd->driver->set_ssid == NULL)
333 return 0;
334 return hapd->driver->set_ssid(hapd->conf->iface, hapd->drv_priv, buf,
335 len);
338 static inline int
339 hostapd_send_mgmt_frame(struct hostapd_data *hapd, const void *msg, size_t len,
340 int flags)
342 if (hapd->driver == NULL || hapd->driver->send_mgmt_frame == NULL)
343 return 0;
344 return hapd->driver->send_mgmt_frame(hapd->drv_priv, msg, len, flags);
347 static inline int
348 hostapd_set_assoc_ap(struct hostapd_data *hapd, const u8 *addr)
350 if (hapd->driver == NULL || hapd->driver->set_assoc_ap == NULL)
351 return 0;
352 return hapd->driver->set_assoc_ap(hapd->drv_priv, addr);
355 static inline int
356 hostapd_set_countermeasures(struct hostapd_data *hapd, int enabled)
358 if (hapd->driver == NULL || hapd->driver->set_countermeasures == NULL)
359 return 0;
360 return hapd->driver->set_countermeasures(hapd->drv_priv, enabled);
363 static inline int
364 hostapd_sta_add(const char *ifname, struct hostapd_data *hapd, const u8 *addr,
365 u16 aid, u16 capability, u8 *supp_rates, size_t supp_rates_len,
366 int flags, u16 listen_interval)
368 if (hapd->driver == NULL || hapd->driver->sta_add == NULL)
369 return 0;
370 return hapd->driver->sta_add(ifname, hapd->drv_priv, addr, aid,
371 capability, supp_rates, supp_rates_len,
372 flags, listen_interval);
375 static inline int
376 hostapd_get_inact_sec(struct hostapd_data *hapd, const u8 *addr)
378 if (hapd->driver == NULL || hapd->driver->get_inact_sec == NULL)
379 return 0;
380 return hapd->driver->get_inact_sec(hapd->drv_priv, addr);
383 static inline int
384 hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq)
386 if (hapd->driver == NULL || hapd->driver->set_freq == NULL)
387 return 0;
388 return hapd->driver->set_freq(hapd->drv_priv, mode, freq);
391 static inline int
392 hostapd_set_rts(struct hostapd_data *hapd, int rts)
394 if (hapd->driver == NULL || hapd->driver->set_rts == NULL)
395 return 0;
396 return hapd->driver->set_rts(hapd->drv_priv, rts);
399 static inline int
400 hostapd_get_rts(struct hostapd_data *hapd, int *rts)
402 if (hapd->driver == NULL || hapd->driver->get_rts == NULL)
403 return 0;
404 return hapd->driver->get_rts(hapd->drv_priv, rts);
407 static inline int
408 hostapd_set_frag(struct hostapd_data *hapd, int frag)
410 if (hapd->driver == NULL || hapd->driver->set_frag == NULL)
411 return 0;
412 return hapd->driver->set_frag(hapd->drv_priv, frag);
415 static inline int
416 hostapd_get_frag(struct hostapd_data *hapd, int *frag)
418 if (hapd->driver == NULL || hapd->driver->get_frag == NULL)
419 return 0;
420 return hapd->driver->get_frag(hapd->drv_priv, frag);
423 static inline int
424 hostapd_set_retry(struct hostapd_data *hapd, int short_retry, int long_retry)
426 if (hapd->driver == NULL || hapd->driver->set_retry == NULL)
427 return 0;
428 return hapd->driver->set_retry(hapd->drv_priv, short_retry,
429 long_retry);
432 static inline int
433 hostapd_get_retry(struct hostapd_data *hapd, int *short_retry, int *long_retry)
435 if (hapd->driver == NULL || hapd->driver->get_retry == NULL)
436 return 0;
437 return hapd->driver->get_retry(hapd->drv_priv, short_retry,
438 long_retry);
441 static inline int
442 hostapd_sta_set_flags(struct hostapd_data *hapd, u8 *addr,
443 int total_flags, int flags_or, int flags_and)
445 if (hapd->driver == NULL || hapd->driver->sta_set_flags == NULL)
446 return 0;
447 return hapd->driver->sta_set_flags(hapd->drv_priv, addr, total_flags,
448 flags_or, flags_and);
451 static inline int
452 hostapd_set_rate_sets(struct hostapd_data *hapd, int *supp_rates,
453 int *basic_rates, int mode)
455 if (hapd->driver == NULL || hapd->driver->set_rate_sets == NULL)
456 return 0;
457 return hapd->driver->set_rate_sets(hapd->drv_priv, supp_rates,
458 basic_rates, mode);
461 static inline int
462 hostapd_set_channel_flag(struct hostapd_data *hapd, int mode, int chan,
463 int flag, unsigned char power_level,
464 unsigned char antenna_max)
466 if (hapd->driver == NULL || hapd->driver->set_channel_flag == NULL)
467 return 0;
468 return hapd->driver->set_channel_flag(hapd->drv_priv, mode, chan, flag,
469 power_level, antenna_max);
472 static inline int
473 hostapd_set_regulatory_domain(struct hostapd_data *hapd, unsigned int rd)
475 if (hapd->driver == NULL ||
476 hapd->driver->set_regulatory_domain == NULL)
477 return 0;
478 return hapd->driver->set_regulatory_domain(hapd->drv_priv, rd);
481 static inline int
482 hostapd_set_country(struct hostapd_data *hapd, const char *country)
484 if (hapd->driver == NULL ||
485 hapd->driver->set_country == NULL)
486 return 0;
487 return hapd->driver->set_country(hapd->drv_priv, country);
490 static inline int
491 hostapd_set_ieee80211d(struct hostapd_data *hapd, int enabled)
493 if (hapd->driver == NULL ||
494 hapd->driver->set_ieee80211d == NULL)
495 return 0;
496 return hapd->driver->set_ieee80211d(hapd->drv_priv, enabled);
499 static inline int
500 hostapd_sta_clear_stats(struct hostapd_data *hapd, const u8 *addr)
502 if (hapd->driver == NULL || hapd->driver->sta_clear_stats == NULL)
503 return 0;
504 return hapd->driver->sta_clear_stats(hapd->drv_priv, addr);
507 static inline int
508 hostapd_set_beacon(const char *ifname, struct hostapd_data *hapd,
509 u8 *head, size_t head_len,
510 u8 *tail, size_t tail_len)
512 if (hapd->driver == NULL || hapd->driver->set_beacon == NULL)
513 return 0;
514 return hapd->driver->set_beacon(ifname, hapd->drv_priv, head, head_len,
515 tail, tail_len);
518 static inline int
519 hostapd_set_internal_bridge(struct hostapd_data *hapd, int value)
521 if (hapd->driver == NULL || hapd->driver->set_internal_bridge == NULL)
522 return 0;
523 return hapd->driver->set_internal_bridge(hapd->drv_priv, value);
526 static inline int
527 hostapd_set_beacon_int(struct hostapd_data *hapd, int value)
529 if (hapd->driver == NULL || hapd->driver->set_beacon_int == NULL)
530 return 0;
531 return hapd->driver->set_beacon_int(hapd->drv_priv, value);
534 static inline int
535 hostapd_set_dtim_period(struct hostapd_data *hapd, int value)
537 if (hapd->driver == NULL || hapd->driver->set_dtim_period == NULL)
538 return 0;
539 return hapd->driver->set_dtim_period(hapd->conf->iface, hapd->drv_priv,
540 value);
543 static inline int
544 hostapd_set_broadcast_ssid(struct hostapd_data *hapd, int value)
546 if (hapd->driver == NULL || hapd->driver->set_broadcast_ssid == NULL)
547 return 0;
548 return hapd->driver->set_broadcast_ssid(hapd->drv_priv, value);
551 static inline int
552 hostapd_set_cts_protect(struct hostapd_data *hapd, int value)
554 if (hapd->driver == NULL || hapd->driver->set_cts_protect == NULL)
555 return 0;
556 return hapd->driver->set_cts_protect(hapd->drv_priv, value);
559 static inline int
560 hostapd_set_key_tx_rx_threshold(struct hostapd_data *hapd, int value)
562 if (hapd->driver == NULL ||
563 hapd->driver->set_key_tx_rx_threshold == NULL)
564 return 0;
565 return hapd->driver->set_key_tx_rx_threshold(hapd->drv_priv, value);
568 static inline int
569 hostapd_set_preamble(struct hostapd_data *hapd, int value)
571 if (hapd->driver == NULL || hapd->driver->set_preamble == NULL)
572 return 0;
573 return hapd->driver->set_preamble(hapd->drv_priv, value);
576 static inline int
577 hostapd_set_short_slot_time(struct hostapd_data *hapd, int value)
579 if (hapd->driver == NULL || hapd->driver->set_short_slot_time == NULL)
580 return 0;
581 return hapd->driver->set_short_slot_time(hapd->drv_priv, value);
584 static inline int
585 hostapd_set_tx_queue_params(struct hostapd_data *hapd, int queue, int aifs,
586 int cw_min, int cw_max, int burst_time)
588 if (hapd->driver == NULL || hapd->driver->set_tx_queue_params == NULL)
589 return 0;
590 return hapd->driver->set_tx_queue_params(hapd->drv_priv, queue, aifs,
591 cw_min, cw_max, burst_time);
594 static inline int
595 hostapd_bss_add(struct hostapd_data *hapd, const char *ifname, const u8 *bssid)
597 if (hapd->driver == NULL || hapd->driver->bss_add == NULL)
598 return 0;
599 return hapd->driver->bss_add(hapd->drv_priv, ifname, bssid);
602 static inline int
603 hostapd_bss_remove(struct hostapd_data *hapd, const char *ifname)
605 if (hapd->driver == NULL || hapd->driver->bss_remove == NULL)
606 return 0;
607 return hapd->driver->bss_remove(hapd->drv_priv, ifname);
610 static inline int
611 hostapd_valid_bss_mask(struct hostapd_data *hapd, const u8 *addr,
612 const u8 *mask)
614 if (hapd->driver == NULL || hapd->driver->valid_bss_mask == NULL)
615 return 1;
616 return hapd->driver->valid_bss_mask(hapd->drv_priv, addr, mask);
619 static inline int
620 hostapd_if_add(struct hostapd_data *hapd, enum hostapd_driver_if_type type,
621 char *ifname, const u8 *addr)
623 if (hapd->driver == NULL || hapd->driver->if_add == NULL)
624 return -1;
625 return hapd->driver->if_add(hapd->conf->iface, hapd->drv_priv, type,
626 ifname, addr);
629 static inline int
630 hostapd_if_update(struct hostapd_data *hapd, enum hostapd_driver_if_type type,
631 char *ifname, const u8 *addr)
633 if (hapd->driver == NULL || hapd->driver->if_update == NULL)
634 return -1;
635 return hapd->driver->if_update(hapd->drv_priv, type, ifname, addr);
638 static inline int
639 hostapd_if_remove(struct hostapd_data *hapd, enum hostapd_driver_if_type type,
640 char *ifname, const u8 *addr)
642 if (hapd->driver == NULL || hapd->driver->if_remove == NULL)
643 return -1;
644 return hapd->driver->if_remove(hapd->drv_priv, type, ifname, addr);
647 static inline int
648 hostapd_passive_scan(struct hostapd_data *hapd, int now, int our_mode_only,
649 int interval, int _listen, int *channel,
650 int *last_rx)
652 if (hapd->driver == NULL || hapd->driver->passive_scan == NULL)
653 return -1;
654 return hapd->driver->passive_scan(hapd->drv_priv, now, our_mode_only,
655 interval, _listen, channel, last_rx);
658 static inline struct hostapd_hw_modes *
659 hostapd_get_hw_feature_data(struct hostapd_data *hapd, u16 *num_modes,
660 u16 *flags)
662 if (hapd->driver == NULL || hapd->driver->get_hw_feature_data == NULL)
663 return NULL;
664 return hapd->driver->get_hw_feature_data(hapd->drv_priv, num_modes,
665 flags);
668 static inline int
669 hostapd_set_sta_vlan(const char *ifname, struct hostapd_data *hapd,
670 const u8 *addr, int vlan_id)
672 if (hapd->driver == NULL || hapd->driver->set_sta_vlan == NULL)
673 return 0;
674 return hapd->driver->set_sta_vlan(hapd->drv_priv, addr, ifname, vlan_id);
677 static inline int
678 hostapd_driver_commit(struct hostapd_data *hapd)
680 if (hapd->driver == NULL || hapd->driver->commit == NULL)
681 return 0;
682 return hapd->driver->commit(hapd->drv_priv);
685 static inline int
686 hostapd_set_radius_acl_auth(struct hostapd_data *hapd, const u8 *mac,
687 int accepted, u32 session_timeout)
689 if (hapd->driver == NULL || hapd->driver->set_radius_acl_auth == NULL)
690 return 0;
691 return hapd->driver->set_radius_acl_auth(hapd->drv_priv, mac, accepted,
692 session_timeout);
695 static inline int
696 hostapd_set_radius_acl_expire(struct hostapd_data *hapd, const u8 *mac)
698 if (hapd->driver == NULL ||
699 hapd->driver->set_radius_acl_expire == NULL)
700 return 0;
701 return hapd->driver->set_radius_acl_expire(hapd->drv_priv, mac);
704 #endif /* DRIVER_H */