aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2019-04-22 17:17:38 (GMT)
committerJouni Malinen <j@w1.fi>2019-04-22 19:08:07 (GMT)
commit4be17ffbd9aacd3c1b590907af12c85bf6ea3fb0 (patch)
tree10d1e263c5e171f669fbe88d20dd81d3b2674842 /wpa_supplicant
parentcfde99a84bf38f6c80e81c51f3bcae9e97058d03 (diff)
downloadhostap-4be17ffbd9aacd3c1b590907af12c85bf6ea3fb0.zip
hostap-4be17ffbd9aacd3c1b590907af12c85bf6ea3fb0.tar.gz
hostap-4be17ffbd9aacd3c1b590907af12c85bf6ea3fb0.tar.bz2
Replace int status/reason_code with u16 variable
These cases are for the IEEE 802.11 Status Code and Reason Code and those fields are unsigned 16 bit values, so use the more appropriate type consistently. This is mainly to document the uses and to make the source code easier to understand. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/driver_i.h4
-rw-r--r--wpa_supplicant/ibss_rsn.c2
-rw-r--r--wpa_supplicant/notify.c4
-rw-r--r--wpa_supplicant/notify.h4
-rw-r--r--wpa_supplicant/preauth_test.c2
-rw-r--r--wpa_supplicant/wpa_supplicant.c4
-rw-r--r--wpa_supplicant/wpa_supplicant_i.h2
-rw-r--r--wpa_supplicant/wpas_glue.c2
8 files changed, 12 insertions, 12 deletions
diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h
index 4a9f472..f073b8a 100644
--- a/wpa_supplicant/driver_i.h
+++ b/wpa_supplicant/driver_i.h
@@ -168,7 +168,7 @@ static inline int wpa_drv_get_seqnum(struct wpa_supplicant *wpa_s,
}
static inline int wpa_drv_sta_deauth(struct wpa_supplicant *wpa_s,
- const u8 *addr, int reason_code)
+ const u8 *addr, u16 reason_code)
{
if (wpa_s->driver->sta_deauth) {
return wpa_s->driver->sta_deauth(wpa_s->drv_priv,
@@ -179,7 +179,7 @@ static inline int wpa_drv_sta_deauth(struct wpa_supplicant *wpa_s,
}
static inline int wpa_drv_deauthenticate(struct wpa_supplicant *wpa_s,
- const u8 *addr, int reason_code)
+ const u8 *addr, u16 reason_code)
{
if (wpa_s->driver->deauthenticate) {
return wpa_s->driver->deauthenticate(wpa_s->drv_priv, addr,
diff --git a/wpa_supplicant/ibss_rsn.c b/wpa_supplicant/ibss_rsn.c
index e96ea65..6934c47 100644
--- a/wpa_supplicant/ibss_rsn.c
+++ b/wpa_supplicant/ibss_rsn.c
@@ -193,7 +193,7 @@ static void supp_cancel_auth_timeout(void *ctx)
}
-static void supp_deauthenticate(void * ctx, int reason_code)
+static void supp_deauthenticate(void * ctx, u16 reason_code)
{
wpa_printf(MSG_DEBUG, "SUPP: %s (TODO)", __func__);
}
diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c
index bedb74b..b086509 100644
--- a/wpa_supplicant/notify.c
+++ b/wpa_supplicant/notify.c
@@ -901,7 +901,7 @@ void wpas_notify_mesh_group_started(struct wpa_supplicant *wpa_s,
void wpas_notify_mesh_group_removed(struct wpa_supplicant *wpa_s,
const u8 *meshid, u8 meshid_len,
- int reason_code)
+ u16 reason_code)
{
if (wpa_s->p2p_mgmt)
return;
@@ -922,7 +922,7 @@ void wpas_notify_mesh_peer_connected(struct wpa_supplicant *wpa_s,
void wpas_notify_mesh_peer_disconnected(struct wpa_supplicant *wpa_s,
- const u8 *peer_addr, int reason_code)
+ const u8 *peer_addr, u16 reason_code)
{
if (wpa_s->p2p_mgmt)
return;
diff --git a/wpa_supplicant/notify.h b/wpa_supplicant/notify.h
index 65f513e..d3e73f0 100644
--- a/wpa_supplicant/notify.h
+++ b/wpa_supplicant/notify.h
@@ -151,10 +151,10 @@ void wpas_notify_mesh_group_started(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid);
void wpas_notify_mesh_group_removed(struct wpa_supplicant *wpa_s,
const u8 *meshid, u8 meshid_len,
- int reason_code);
+ u16 reason_code);
void wpas_notify_mesh_peer_connected(struct wpa_supplicant *wpa_s,
const u8 *peer_addr);
void wpas_notify_mesh_peer_disconnected(struct wpa_supplicant *wpa_s,
- const u8 *peer_addr, int reason_code);
+ const u8 *peer_addr, u16 reason_code);
#endif /* NOTIFY_H */
diff --git a/wpa_supplicant/preauth_test.c b/wpa_supplicant/preauth_test.c
index f2fff55..3f2da34 100644
--- a/wpa_supplicant/preauth_test.c
+++ b/wpa_supplicant/preauth_test.c
@@ -35,7 +35,7 @@ struct preauth_test_data {
};
-static void _wpa_supplicant_deauthenticate(void *wpa_s, int reason_code)
+static void _wpa_supplicant_deauthenticate(void *wpa_s, u16 reason_code)
{
wpa_supplicant_deauthenticate(wpa_s, reason_code);
}
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 8050ad3..2ddd4f2 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -3422,7 +3422,7 @@ static void wpa_supplicant_clear_connection(struct wpa_supplicant *wpa_s,
* current AP.
*/
void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
- int reason_code)
+ u16 reason_code)
{
u8 *addr = NULL;
union wpa_event_data event;
@@ -3474,7 +3474,7 @@ void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
if (addr) {
wpa_drv_deauthenticate(wpa_s, addr, reason_code);
os_memset(&event, 0, sizeof(event));
- event.deauth_info.reason_code = (u16) reason_code;
+ event.deauth_info.reason_code = reason_code;
event.deauth_info.locally_generated = 1;
wpa_supplicant_event(wpa_s, EVENT_DEAUTH, &event);
if (zero_addr)
diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
index 16e4db6..8ea3c5a 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -1291,7 +1291,7 @@ struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s);
const char * wpa_supplicant_get_eap_mode(struct wpa_supplicant *wpa_s);
void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s);
void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
- int reason_code);
+ u16 reason_code);
struct wpa_ssid * wpa_supplicant_add_network(struct wpa_supplicant *wpa_s);
int wpa_supplicant_remove_network(struct wpa_supplicant *wpa_s, int id);
diff --git a/wpa_supplicant/wpas_glue.c b/wpa_supplicant/wpas_glue.c
index 449e04a..e98bf11 100644
--- a/wpa_supplicant/wpas_glue.c
+++ b/wpa_supplicant/wpas_glue.c
@@ -464,7 +464,7 @@ static enum wpa_states _wpa_supplicant_get_state(void *wpa_s)
}
-static void _wpa_supplicant_deauthenticate(void *wpa_s, int reason_code)
+static void _wpa_supplicant_deauthenticate(void *wpa_s, u16 reason_code)
{
wpa_supplicant_deauthenticate(wpa_s, reason_code);
/* Schedule a scan to make sure we continue looking for networks */