bb80f898f8737402fe2e7f9203b15b072e9f8bf1
[dragonfly.git] / contrib / wpa_supplicant-0.5.8 / wpa_supplicant_i.h
1 /*
2  * wpa_supplicant - Internal definitions
3  * Copyright (c) 2003-2006, 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
15 #ifndef WPA_SUPPLICANT_I_H
16 #define WPA_SUPPLICANT_I_H
17
18 #include "driver.h"
19
20 struct wpa_blacklist {
21         struct wpa_blacklist *next;
22         u8 bssid[ETH_ALEN];
23         int count;
24 };
25
26
27 struct wpa_scan_result;
28 struct wpa_sm;
29 struct wpa_supplicant;
30
31 /*
32  * Forward declarations of private structures used within the ctrl_iface
33  * backends. Other parts of wpa_supplicant do not have access to data stored in
34  * these structures.
35  */
36 struct ctrl_iface_priv;
37 struct ctrl_iface_global_priv;
38 struct ctrl_iface_dbus_priv;
39
40 /**
41  * struct wpa_interface - Parameters for wpa_supplicant_add_iface()
42  */
43 struct wpa_interface {
44         /**
45          * confname - Configuration name (file or profile) name
46          *
47          * This can also be %NULL when a configuration file is not used. In
48          * that case, ctrl_interface must be set to allow the interface to be
49          * configured.
50          */
51         const char *confname;
52
53         /**
54          * ctrl_interface - Control interface parameter
55          *
56          * If a configuration file is not used, this variable can be used to
57          * set the ctrl_interface parameter that would have otherwise been read
58          * from the configuration file. If both confname and ctrl_interface are
59          * set, ctrl_interface is used to override the value from configuration
60          * file.
61          */
62         const char *ctrl_interface;
63
64         /**
65          * driver - Driver interface name, or %NULL to use the default driver
66          */
67         const char *driver;
68
69         /**
70          * driver_param - Driver interface parameters
71          *
72          * If a configuration file is not used, this variable can be used to
73          * set the driver_param parameters that would have otherwise been read
74          * from the configuration file. If both confname and driver_param are
75          * set, driver_param is used to override the value from configuration
76          * file.
77          */
78         const char *driver_param;
79
80         /**
81          * ifname - Interface name
82          */
83         const char *ifname;
84
85         /**
86          * bridge_ifname - Optional bridge interface name
87          *
88          * If the driver interface (ifname) is included in a Linux bridge
89          * device, the bridge interface may need to be used for receiving EAPOL
90          * frames. This can be enabled by setting this variable to enable
91          * receiving of EAPOL frames from an additional interface.
92          */
93         const char *bridge_ifname;
94 };
95
96 /**
97  * struct wpa_params - Parameters for wpa_supplicant_init()
98  */
99 struct wpa_params {
100         /**
101          * daemonize - Run %wpa_supplicant in the background
102          */
103         int daemonize;
104
105         /**
106          * wait_for_interface - Wait for the network interface to appear
107          *
108          * If set, %wpa_supplicant will wait until all the configured network
109          * interfaces are available before starting processing. Please note
110          * that in many cases, a better alternative would be to start
111          * %wpa_supplicant without network interfaces and add the interfaces
112          * dynamically whenever they become available.
113          */
114         int wait_for_interface;
115
116         /**
117          * wait_for_monitor - Wait for a monitor program before starting
118          */
119         int wait_for_monitor;
120
121         /**
122          * pid_file - Path to a PID (process ID) file
123          *
124          * If this and daemonize are set, process ID of the background process
125          * will be written to the specified file.
126          */
127         char *pid_file;
128
129         /**
130          * wpa_debug_level - Debugging verbosity level (e.g., MSG_INFO)
131          */
132         int wpa_debug_level;
133
134         /**
135          * wpa_debug_show_keys - Whether keying material is included in debug
136          *
137          * This parameter can be used to allow keying material to be included
138          * in debug messages. This is a security risk and this option should
139          * not be enabled in normal configuration. If needed during
140          * development or while troubleshooting, this option can provide more
141          * details for figuring out what is happening.
142          */
143         int wpa_debug_show_keys;
144
145         /**
146          * wpa_debug_timestamp - Whether to include timestamp in debug messages
147          */
148         int wpa_debug_timestamp;
149
150         /**
151          * ctrl_interface - Global ctrl_iface path/parameter
152          */
153         char *ctrl_interface;
154
155         /**
156          * dbus_ctrl_interface - Enable the DBus control interface
157          */
158         int dbus_ctrl_interface;
159
160         /**
161          * wpa_debug_use_file - Write debug to a file (instead of stdout)
162          */
163         int wpa_debug_use_file;
164 };
165
166 /**
167  * struct wpa_global - Internal, global data for all %wpa_supplicant interfaces
168  *
169  * This structure is initialized by calling wpa_supplicant_init() when starting
170  * %wpa_supplicant.
171  */
172 struct wpa_global {
173         struct wpa_supplicant *ifaces;
174         struct wpa_params params;
175         struct ctrl_iface_global_priv *ctrl_iface;
176         struct ctrl_iface_dbus_priv *dbus_ctrl_iface;
177 };
178
179
180 struct wpa_client_mlme {
181 #ifdef CONFIG_CLIENT_MLME
182         enum {
183                 IEEE80211_DISABLED, IEEE80211_AUTHENTICATE,
184                 IEEE80211_ASSOCIATE, IEEE80211_ASSOCIATED,
185                 IEEE80211_IBSS_SEARCH, IEEE80211_IBSS_JOINED
186         } state;
187         u8 prev_bssid[ETH_ALEN];
188         u8 ssid[32];
189         size_t ssid_len;
190         u16 aid;
191         u16 ap_capab, capab;
192         u8 *extra_ie; /* to be added to the end of AssocReq */
193         size_t extra_ie_len;
194         wpa_key_mgmt key_mgmt;
195
196         /* The last AssocReq/Resp IEs */
197         u8 *assocreq_ies, *assocresp_ies;
198         size_t assocreq_ies_len, assocresp_ies_len;
199
200         int auth_tries, assoc_tries;
201
202         unsigned int ssid_set:1;
203         unsigned int bssid_set:1;
204         unsigned int prev_bssid_set:1;
205         unsigned int authenticated:1;
206         unsigned int associated:1;
207         unsigned int probereq_poll:1;
208         unsigned int use_protection:1;
209         unsigned int create_ibss:1;
210         unsigned int mixed_cell:1;
211         unsigned int wmm_enabled:1;
212
213         struct os_time last_probe;
214
215 #define IEEE80211_AUTH_ALG_OPEN BIT(0)
216 #define IEEE80211_AUTH_ALG_SHARED_KEY BIT(1)
217 #define IEEE80211_AUTH_ALG_LEAP BIT(2)
218         unsigned int auth_algs; /* bitfield of allowed auth algs */
219         int auth_alg; /* currently used IEEE 802.11 authentication algorithm */
220         int auth_transaction;
221
222         struct os_time ibss_join_req;
223         u8 *probe_resp; /* ProbeResp template for IBSS */
224         size_t probe_resp_len;
225         u32 supp_rates_bits;
226
227         int wmm_last_param_set;
228
229         int sta_scanning;
230         int scan_hw_mode_idx;
231         int scan_channel_idx;
232         enum { SCAN_SET_CHANNEL, SCAN_SEND_PROBE } scan_state;
233         struct os_time last_scan_completed;
234         int scan_oper_channel;
235         int scan_oper_freq;
236         int scan_oper_phymode;
237         u8 scan_ssid[32];
238         size_t scan_ssid_len;
239         int scan_skip_11b;
240
241         struct ieee80211_sta_bss *sta_bss_list;
242 #define STA_HASH_SIZE 256
243 #define STA_HASH(sta) (sta[5])
244         struct ieee80211_sta_bss *sta_bss_hash[STA_HASH_SIZE];
245
246         int cts_protect_erp_frames;
247
248         int phymode; /* current mode; WPA_MODE_IEEE80211A, .. */
249         struct wpa_hw_modes *modes;
250         size_t num_modes;
251         unsigned int hw_modes; /* bitfield of allowed hardware modes;
252                                 * (1 << MODE_*) */
253         int num_curr_rates;
254         struct wpa_rate_data *curr_rates;
255         int freq; /* The current frequency in MHz */
256         int channel; /* The current IEEE 802.11 channel number */
257 #else /* CONFIG_CLIENT_MLME */
258         int dummy; /* to keep MSVC happy */
259 #endif /* CONFIG_CLIENT_MLME */
260 };
261
262 /**
263  * struct wpa_supplicant - Internal data for wpa_supplicant interface
264  *
265  * This structure contains the internal data for core wpa_supplicant code. This
266  * should be only used directly from the core code. However, a pointer to this
267  * data is used from other files as an arbitrary context pointer in calls to
268  * core functions.
269  */
270 struct wpa_supplicant {
271         struct wpa_global *global;
272         struct wpa_supplicant *next;
273         struct l2_packet_data *l2;
274         struct l2_packet_data *l2_br;
275         unsigned char own_addr[ETH_ALEN];
276         char ifname[100];
277 #ifdef CONFIG_CTRL_IFACE_DBUS
278         char *dbus_path;
279 #endif /* CONFIG_CTRL_IFACE_DBUS */
280         char bridge_ifname[16];
281
282         char *confname;
283         struct wpa_config *conf;
284         int countermeasures;
285         os_time_t last_michael_mic_error;
286         u8 bssid[ETH_ALEN];
287         u8 pending_bssid[ETH_ALEN]; /* If wpa_state == WPA_ASSOCIATING, this
288                                      * field contains the targer BSSID. */
289         int reassociate; /* reassociation requested */
290         int disconnected; /* all connections disabled; i.e., do no reassociate
291                            * before this has been cleared */
292         struct wpa_ssid *current_ssid;
293
294         /* Selected configuration (based on Beacon/ProbeResp WPA IE) */
295         int pairwise_cipher;
296         int group_cipher;
297         int key_mgmt;
298         int mgmt_group_cipher;
299
300         void *drv_priv; /* private data used by driver_ops */
301
302         struct wpa_ssid *prev_scan_ssid; /* previously scanned SSID;
303                                           * NULL = not yet initialized (start
304                                           * with broadcast SSID)
305                                           * BROADCAST_SSID_SCAN = broadcast
306                                           * SSID was used in the previous scan
307                                           */
308 #define BROADCAST_SSID_SCAN ((struct wpa_ssid *) 1)
309
310         struct wpa_scan_result *scan_results;
311         int num_scan_results;
312
313         struct wpa_driver_ops *driver;
314         int interface_removed; /* whether the network interface has been
315                                 * removed */
316         struct wpa_sm *wpa;
317         struct eapol_sm *eapol;
318
319         struct ctrl_iface_priv *ctrl_iface;
320
321         wpa_states wpa_state;
322         int new_connection;
323         int reassociated_connection;
324
325         int eapol_received; /* number of EAPOL packets received after the
326                              * previous association event */
327
328         struct scard_data *scard;
329
330         unsigned char last_eapol_src[ETH_ALEN];
331
332         int keys_cleared;
333
334         struct wpa_blacklist *blacklist;
335
336         int scan_req; /* manual scan request; this forces a scan even if there
337                        * are no enabled networks in the configuration */
338         int scan_res_tried; /* whether ap_scan=1 mode has tried to fetch scan
339                              * results without a new scan request; this is used
340                              * to speed up the first association if the driver
341                              * has already available scan results. */
342
343         struct wpa_client_mlme mlme;
344         int use_client_mlme;
345 };
346
347
348 /* wpa_supplicant.c */
349 void wpa_supplicant_cancel_scan(struct wpa_supplicant *wpa_s);
350
351 int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s);
352
353 const char * wpa_supplicant_state_txt(int state);
354 int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s,
355                                int wait_for_interface);
356 struct wpa_blacklist * wpa_blacklist_get(struct wpa_supplicant *wpa_s,
357                                          const u8 *bssid);
358 int wpa_blacklist_add(struct wpa_supplicant *wpa_s, const u8 *bssid);
359 void wpa_blacklist_clear(struct wpa_supplicant *wpa_s);
360 int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
361                               struct wpa_scan_result *bss,
362                               struct wpa_ssid *ssid,
363                               u8 *wpa_ie, size_t *wpa_ie_len);
364 void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
365                               struct wpa_scan_result *bss,
366                               struct wpa_ssid *ssid);
367 void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s,
368                                        struct wpa_ssid *ssid);
369 void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s);
370 int wpa_supplicant_get_scan_results(struct wpa_supplicant *wpa_s);
371 void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr);
372 void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
373                                      int sec, int usec);
374 void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, wpa_states state);
375 struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s);
376 void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s);
377 void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
378                                    int reason_code);
379 void wpa_supplicant_disassociate(struct wpa_supplicant *wpa_s,
380                                  int reason_code);
381 void wpa_supplicant_req_scan(struct wpa_supplicant *wpa_s, int sec, int usec);
382
383 void wpa_show_license(void);
384
385 struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global,
386                                                  struct wpa_interface *iface);
387 int wpa_supplicant_remove_iface(struct wpa_global *global,
388                                 struct wpa_supplicant *wpa_s);
389 struct wpa_supplicant * wpa_supplicant_get_iface(struct wpa_global *global,
390                                                  const char *ifname);
391 struct wpa_global * wpa_supplicant_init(struct wpa_params *params);
392 int wpa_supplicant_run(struct wpa_global *global);
393 void wpa_supplicant_deinit(struct wpa_global *global);
394
395 int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
396                               struct wpa_ssid *ssid);
397
398 /* events.c */
399 void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s);
400
401 /* driver_ops */
402 static inline void * wpa_drv_init(struct wpa_supplicant *wpa_s,
403                                   const char *ifname)
404 {
405         if (wpa_s->driver->init) {
406                 return wpa_s->driver->init(wpa_s, ifname);
407         }
408         return NULL;
409 }
410
411 static inline void wpa_drv_deinit(struct wpa_supplicant *wpa_s)
412 {
413         if (wpa_s->driver->deinit)
414                 wpa_s->driver->deinit(wpa_s->drv_priv);
415 }
416
417 static inline int wpa_drv_set_param(struct wpa_supplicant *wpa_s,
418                                     const char *param)
419 {
420         if (wpa_s->driver->set_param)
421                 return wpa_s->driver->set_param(wpa_s->drv_priv, param);
422         return 0;
423 }
424
425 static inline int wpa_drv_set_drop_unencrypted(struct wpa_supplicant *wpa_s,
426                                                int enabled)
427 {
428         if (wpa_s->driver->set_drop_unencrypted) {
429                 return wpa_s->driver->set_drop_unencrypted(wpa_s->drv_priv,
430                                                            enabled);
431         }
432         return -1;
433 }
434
435 static inline int wpa_drv_set_countermeasures(struct wpa_supplicant *wpa_s,
436                                               int enabled)
437 {
438         if (wpa_s->driver->set_countermeasures) {
439                 return wpa_s->driver->set_countermeasures(wpa_s->drv_priv,
440                                                           enabled);
441         }
442         return -1;
443 }
444
445 static inline int wpa_drv_set_auth_alg(struct wpa_supplicant *wpa_s,
446                                        int auth_alg)
447 {
448         if (wpa_s->driver->set_auth_alg) {
449                 return wpa_s->driver->set_auth_alg(wpa_s->drv_priv,
450                                                    auth_alg);
451         }
452         return -1;
453 }
454
455 static inline int wpa_drv_set_wpa(struct wpa_supplicant *wpa_s, int enabled)
456 {
457         if (wpa_s->driver->set_wpa) {
458                 return wpa_s->driver->set_wpa(wpa_s->drv_priv, enabled);
459         }
460         return 0;
461 }
462
463 static inline int wpa_drv_associate(struct wpa_supplicant *wpa_s,
464                                     struct wpa_driver_associate_params *params)
465 {
466         if (wpa_s->driver->associate) {
467                 return wpa_s->driver->associate(wpa_s->drv_priv, params);
468         }
469         return -1;
470 }
471
472 static inline int wpa_drv_scan(struct wpa_supplicant *wpa_s, const u8 *ssid,
473                                size_t ssid_len)
474 {
475         if (wpa_s->driver->scan) {
476                 return wpa_s->driver->scan(wpa_s->drv_priv, ssid, ssid_len);
477         }
478         return -1;
479 }
480
481 static inline int wpa_drv_get_scan_results(struct wpa_supplicant *wpa_s,
482                                            struct wpa_scan_result *results,
483                                            size_t max_size)
484 {
485         if (wpa_s->driver->get_scan_results) {
486                 return wpa_s->driver->get_scan_results(wpa_s->drv_priv,
487                                                        results, max_size);
488         }
489         return -1;
490 }
491
492 static inline int wpa_drv_get_bssid(struct wpa_supplicant *wpa_s, u8 *bssid)
493 {
494         if (wpa_s->driver->get_bssid) {
495                 return wpa_s->driver->get_bssid(wpa_s->drv_priv, bssid);
496         }
497         return -1;
498 }
499
500 static inline int wpa_drv_get_ssid(struct wpa_supplicant *wpa_s, u8 *ssid)
501 {
502         if (wpa_s->driver->get_ssid) {
503                 return wpa_s->driver->get_ssid(wpa_s->drv_priv, ssid);
504         }
505         return -1;
506 }
507
508 static inline int wpa_drv_set_key(struct wpa_supplicant *wpa_s, wpa_alg alg,
509                                    const u8 *addr, int key_idx, int set_tx,
510                                    const u8 *seq, size_t seq_len,
511                                    const u8 *key, size_t key_len)
512 {
513         if (wpa_s->driver->set_key) {
514                 wpa_s->keys_cleared = 0;
515                 return wpa_s->driver->set_key(wpa_s->drv_priv, alg, addr,
516                                               key_idx, set_tx, seq, seq_len,
517                                               key, key_len);
518         }
519         return -1;
520 }
521
522 static inline int wpa_drv_deauthenticate(struct wpa_supplicant *wpa_s,
523                                          const u8 *addr, int reason_code)
524 {
525         if (wpa_s->driver->deauthenticate) {
526                 return wpa_s->driver->deauthenticate(wpa_s->drv_priv, addr,
527                                                      reason_code);
528         }
529         return -1;
530 }
531
532 static inline int wpa_drv_disassociate(struct wpa_supplicant *wpa_s,
533                                        const u8 *addr, int reason_code)
534 {
535         if (wpa_s->driver->disassociate) {
536                 return wpa_s->driver->disassociate(wpa_s->drv_priv, addr,
537                                                    reason_code);
538         }
539         return -1;
540 }
541
542 static inline int wpa_drv_add_pmkid(struct wpa_supplicant *wpa_s,
543                                     const u8 *bssid, const u8 *pmkid)
544 {
545         if (wpa_s->driver->add_pmkid) {
546                 return wpa_s->driver->add_pmkid(wpa_s->drv_priv, bssid, pmkid);
547         }
548         return -1;
549 }
550
551 static inline int wpa_drv_remove_pmkid(struct wpa_supplicant *wpa_s,
552                                        const u8 *bssid, const u8 *pmkid)
553 {
554         if (wpa_s->driver->remove_pmkid) {
555                 return wpa_s->driver->remove_pmkid(wpa_s->drv_priv, bssid,
556                                                    pmkid);
557         }
558         return -1;
559 }
560
561 static inline int wpa_drv_flush_pmkid(struct wpa_supplicant *wpa_s)
562 {
563         if (wpa_s->driver->flush_pmkid) {
564                 return wpa_s->driver->flush_pmkid(wpa_s->drv_priv);
565         }
566         return -1;
567 }
568
569 static inline int wpa_drv_get_capa(struct wpa_supplicant *wpa_s,
570                                    struct wpa_driver_capa *capa)
571 {
572         if (wpa_s->driver->get_capa) {
573                 return wpa_s->driver->get_capa(wpa_s->drv_priv, capa);
574         }
575         return -1;
576 }
577
578 static inline void wpa_drv_poll(struct wpa_supplicant *wpa_s)
579 {
580         if (wpa_s->driver->poll) {
581                 wpa_s->driver->poll(wpa_s->drv_priv);
582         }
583 }
584
585 static inline const char * wpa_drv_get_ifname(struct wpa_supplicant *wpa_s)
586 {
587         if (wpa_s->driver->get_ifname) {
588                 return wpa_s->driver->get_ifname(wpa_s->drv_priv);
589         }
590         return NULL;
591 }
592
593 static inline const u8 * wpa_drv_get_mac_addr(struct wpa_supplicant *wpa_s)
594 {
595         if (wpa_s->driver->get_mac_addr) {
596                 return wpa_s->driver->get_mac_addr(wpa_s->drv_priv);
597         }
598         return NULL;
599 }
600
601 static inline int wpa_drv_send_eapol(struct wpa_supplicant *wpa_s,
602                                      const u8 *dst, u16 proto,
603                                      const u8 *data, size_t data_len)
604 {
605         if (wpa_s->driver->send_eapol)
606                 return wpa_s->driver->send_eapol(wpa_s->drv_priv, dst, proto,
607                                                  data, data_len);
608         return -1;
609 }
610
611 static inline int wpa_drv_set_operstate(struct wpa_supplicant *wpa_s,
612                                         int state)
613 {
614         if (wpa_s->driver->set_operstate)
615                 return wpa_s->driver->set_operstate(wpa_s->drv_priv, state);
616         return 0;
617 }
618
619 static inline int wpa_drv_mlme_setprotection(struct wpa_supplicant *wpa_s,
620                                              const u8 *addr, int protect_type,
621                                              int key_type)
622 {
623         if (wpa_s->driver->mlme_setprotection)
624                 return wpa_s->driver->mlme_setprotection(wpa_s->drv_priv, addr,
625                                                          protect_type,
626                                                          key_type);
627         return 0;
628 }
629
630 static inline struct wpa_hw_modes *
631 wpa_drv_get_hw_feature_data(struct wpa_supplicant *wpa_s, u16 *num_modes,
632                             u16 *flags)
633 {
634         if (wpa_s->driver->get_hw_feature_data)
635                 return wpa_s->driver->get_hw_feature_data(wpa_s->drv_priv,
636                                                           num_modes, flags);
637         return NULL;
638 }
639
640 static inline int wpa_drv_set_channel(struct wpa_supplicant *wpa_s,
641                                       wpa_hw_mode phymode, int chan,
642                                       int freq)
643 {
644         if (wpa_s->driver->set_channel)
645                 return wpa_s->driver->set_channel(wpa_s->drv_priv, phymode,
646                                                   chan, freq);
647         return -1;
648 }
649
650 static inline int wpa_drv_set_ssid(struct wpa_supplicant *wpa_s,
651                                    const u8 *ssid, size_t ssid_len)
652 {
653         if (wpa_s->driver->set_ssid) {
654                 return wpa_s->driver->set_ssid(wpa_s->drv_priv, ssid,
655                                                ssid_len);
656         }
657         return -1;
658 }
659
660 static inline int wpa_drv_set_bssid(struct wpa_supplicant *wpa_s,
661                                     const u8 *bssid)
662 {
663         if (wpa_s->driver->set_bssid) {
664                 return wpa_s->driver->set_bssid(wpa_s->drv_priv, bssid);
665         }
666         return -1;
667 }
668
669 static inline int wpa_drv_send_mlme(struct wpa_supplicant *wpa_s,
670                                     const u8 *data, size_t data_len)
671 {
672         if (wpa_s->driver->send_mlme)
673                 return wpa_s->driver->send_mlme(wpa_s->drv_priv,
674                                                 data, data_len);
675         return -1;
676 }
677
678 static inline int wpa_drv_mlme_add_sta(struct wpa_supplicant *wpa_s,
679                                        const u8 *addr, const u8 *supp_rates,
680                                        size_t supp_rates_len)
681 {
682         if (wpa_s->driver->mlme_add_sta)
683                 return wpa_s->driver->mlme_add_sta(wpa_s->drv_priv, addr,
684                                                    supp_rates, supp_rates_len);
685         return -1;
686 }
687
688 static inline int wpa_drv_mlme_remove_sta(struct wpa_supplicant *wpa_s,
689                                           const u8 *addr)
690 {
691         if (wpa_s->driver->mlme_remove_sta)
692                 return wpa_s->driver->mlme_remove_sta(wpa_s->drv_priv, addr);
693         return -1;
694 }
695
696 #endif /* WPA_SUPPLICANT_I_H */