1 /*
2 * WPA Supplicant - Client mode MLME
3 * Copyright (c) 2003-2006, Jouni Malinen <j@w1.fi>
4 * Copyright (c) 2004, Instant802 Networks, Inc.
5 * Copyright (c) 2005-2006, Devicescape Software, Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Alternatively, this software may be distributed under the terms of BSD
12 * license.
13 *
14 * See README and COPYING for more details.
15 */
16
17 #ifndef MLME_H
18 #define MLME_H
19
20 #ifdef CONFIG_CLIENT_MLME
21
22 int ieee80211_sta_init(struct wpa_supplicant *wpa_s);
23 void ieee80211_sta_deinit(struct wpa_supplicant *wpa_s);
24 int ieee80211_sta_req_scan(struct wpa_supplicant *wpa_s, const u8 *ssid,
25 size_t ssid_len);
26 int ieee80211_sta_deauthenticate(struct wpa_supplicant *wpa_s, u16 reason);
27 int ieee80211_sta_disassociate(struct wpa_supplicant *wpa_s, u16 reason);
28 int ieee80211_sta_associate(struct wpa_supplicant *wpa_s,
29 struct wpa_driver_associate_params *params);
30 int ieee80211_sta_get_ssid(struct wpa_supplicant *wpa_s, u8 *ssid,
31 size_t *len);
32 void ieee80211_sta_free_hw_features(struct wpa_hw_modes *hw_features,
33 size_t num_hw_features);
34 void ieee80211_sta_rx(struct wpa_supplicant *wpa_s, const u8 *buf, size_t len,
35 struct ieee80211_rx_status *rx_status);
36 int ieee80211_sta_get_scan_results(struct wpa_supplicant *wpa_s,
37 struct wpa_scan_result *results,
38 size_t max_size);
39
40 #else /* CONFIG_CLIENT_MLME */
41
ieee80211_sta_init(struct wpa_supplicant * wpa_s)42 static inline int ieee80211_sta_init(struct wpa_supplicant *wpa_s)
43 {
44 return 0;
45 }
46
ieee80211_sta_deinit(struct wpa_supplicant * wpa_s)47 static inline void ieee80211_sta_deinit(struct wpa_supplicant *wpa_s)
48 {
49 }
50
ieee80211_sta_req_scan(struct wpa_supplicant * wpa_s,const u8 * ssid,size_t ssid_len)51 static inline int ieee80211_sta_req_scan(struct wpa_supplicant *wpa_s,
52 const u8 *ssid, size_t ssid_len)
53 {
54 return -1;
55 }
56
ieee80211_sta_deauthenticate(struct wpa_supplicant * wpa_s,u16 reason)57 static inline int ieee80211_sta_deauthenticate(struct wpa_supplicant *wpa_s,
58 u16 reason)
59 {
60 return -1;
61 }
62
ieee80211_sta_disassociate(struct wpa_supplicant * wpa_s,u16 reason)63 static inline int ieee80211_sta_disassociate(struct wpa_supplicant *wpa_s,
64 u16 reason)
65 {
66 return -1;
67 }
68
69 static inline int
ieee80211_sta_associate(struct wpa_supplicant * wpa_s,struct wpa_driver_associate_params * params)70 ieee80211_sta_associate(struct wpa_supplicant *wpa_s,
71 struct wpa_driver_associate_params *params)
72 {
73 return -1;
74 }
75
ieee80211_sta_get_ssid(struct wpa_supplicant * wpa_s,u8 * ssid,size_t * len)76 static inline int ieee80211_sta_get_ssid(struct wpa_supplicant *wpa_s,
77 u8 *ssid, size_t *len)
78 {
79 return -1;
80 }
81
82 static inline void
ieee80211_sta_free_hw_features(struct wpa_hw_modes * hw_features,size_t num_hw_features)83 ieee80211_sta_free_hw_features(struct wpa_hw_modes *hw_features,
84 size_t num_hw_features)
85 {
86 }
87
88 static inline void
ieee80211_sta_rx(struct wpa_supplicant * wpa_s,const u8 * buf,size_t len,struct ieee80211_rx_status * rx_status)89 ieee80211_sta_rx(struct wpa_supplicant *wpa_s, const u8 *buf, size_t len,
90 struct ieee80211_rx_status *rx_status)
91 {
92 }
93
94 static inline int
ieee80211_sta_get_scan_results(struct wpa_supplicant * wpa_s,struct wpa_scan_result * results,size_t max_size)95 ieee80211_sta_get_scan_results(struct wpa_supplicant *wpa_s,
96 struct wpa_scan_result *results,
97 size_t max_size)
98 {
99 return -1;
100 }
101
102 #endif /* CONFIG_CLIENT_MLME */
103
104 #endif /* MLME_H */
105