Home | History | Annotate | Download | only in wpa_supplicant
      1 /*
      2  * WPA Supplicant - Client mode MLME
      3  * Copyright (c) 2003-2007, Jouni Malinen <j (at) 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 struct wpa_supplicant;
     21 
     22 #ifdef CONFIG_CLIENT_MLME
     23 
     24 int ieee80211_sta_init(struct wpa_supplicant *wpa_s);
     25 void ieee80211_sta_deinit(struct wpa_supplicant *wpa_s);
     26 int ieee80211_sta_req_scan(struct wpa_supplicant *wpa_s, const u8 *ssid,
     27 			   size_t ssid_len);
     28 int ieee80211_sta_deauthenticate(struct wpa_supplicant *wpa_s, u16 reason);
     29 int ieee80211_sta_disassociate(struct wpa_supplicant *wpa_s, u16 reason);
     30 int ieee80211_sta_associate(struct wpa_supplicant *wpa_s,
     31 			    struct wpa_driver_associate_params *params);
     32 int ieee80211_sta_get_ssid(struct wpa_supplicant *wpa_s, u8 *ssid,
     33 			   size_t *len);
     34 void ieee80211_sta_free_hw_features(struct wpa_hw_modes *hw_features,
     35 				    size_t num_hw_features);
     36 void ieee80211_sta_rx(struct wpa_supplicant *wpa_s, const u8 *buf, size_t len,
     37 		      struct ieee80211_rx_status *rx_status);
     38 struct wpa_scan_results *
     39 ieee80211_sta_get_scan_results(struct wpa_supplicant *wpa_s);
     40 int ieee80211_sta_update_ft_ies(struct wpa_supplicant *wpa_s, const u8 *md,
     41 				const u8 *ies, size_t ies_len);
     42 int ieee80211_sta_send_ft_action(struct wpa_supplicant *wpa_s, u8 action,
     43 				 const u8 *target_ap,
     44 				 const u8 *ies, size_t ies_len);
     45 int ieee80211_sta_set_probe_req_ie(struct wpa_supplicant *wpa_s, const u8 *ies,
     46 				   size_t ies_len);
     47 
     48 #else /* CONFIG_CLIENT_MLME */
     49 
     50 static inline int ieee80211_sta_init(struct wpa_supplicant *wpa_s)
     51 {
     52 	return 0;
     53 }
     54 
     55 static inline void ieee80211_sta_deinit(struct wpa_supplicant *wpa_s)
     56 {
     57 }
     58 
     59 static inline int ieee80211_sta_req_scan(struct wpa_supplicant *wpa_s,
     60 					 const u8 *ssid, size_t ssid_len)
     61 {
     62 	return -1;
     63 }
     64 
     65 static inline int ieee80211_sta_deauthenticate(struct wpa_supplicant *wpa_s,
     66 					       u16 reason)
     67 {
     68 	return -1;
     69 }
     70 
     71 static inline int ieee80211_sta_disassociate(struct wpa_supplicant *wpa_s,
     72 					     u16 reason)
     73 {
     74 	return -1;
     75 }
     76 
     77 static inline int
     78 ieee80211_sta_associate(struct wpa_supplicant *wpa_s,
     79 			struct wpa_driver_associate_params *params)
     80 {
     81 	return -1;
     82 }
     83 
     84 static inline int ieee80211_sta_get_ssid(struct wpa_supplicant *wpa_s,
     85 					 u8 *ssid, size_t *len)
     86 {
     87 	return -1;
     88 }
     89 
     90 static inline void
     91 ieee80211_sta_free_hw_features(struct wpa_hw_modes *hw_features,
     92 			       size_t num_hw_features)
     93 {
     94 }
     95 
     96 static inline void
     97 ieee80211_sta_rx(struct wpa_supplicant *wpa_s, const u8 *buf, size_t len,
     98 		 struct ieee80211_rx_status *rx_status)
     99 {
    100 }
    101 
    102 static inline struct wpa_scan_results *
    103 ieee80211_sta_get_scan_results(struct wpa_supplicant *wpa_s)
    104 {
    105 	return NULL;
    106 }
    107 
    108 static inline int
    109 ieee80211_sta_update_ft_ies(struct wpa_supplicant *wpa_s, const u8 *md,
    110 			    const u8 *ies, size_t ies_len)
    111 {
    112 	return -1;
    113 }
    114 
    115 static inline int
    116 ieee80211_sta_send_ft_action(struct wpa_supplicant *wpa_s, u8 action,
    117 			     const u8 *target_ap,
    118 			     const u8 *ies, size_t ies_len)
    119 {
    120 	return -1;
    121 }
    122 
    123 static inline int
    124 ieee80211_sta_set_probe_req_ie(struct wpa_supplicant *wpa_s, const u8 *ies,
    125 			       size_t ies_len)
    126 {
    127 	return -1;
    128 }
    129 
    130 #endif /* CONFIG_CLIENT_MLME */
    131 
    132 #endif /* MLME_H */
    133