From 1e6c57fee4a56b421cc20f6dc0785c9138b21337 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 5 Sep 2012 17:07:03 +0300 Subject: nl80211: Register read_sta_data() handler for station only builds This driver_op can now be used in station mode, too, to fetch information about the connection with the AP, so allow this to be used even if wpa_supplicant is built without AP mode support. Change-Id: Ibef1d27ed0e2df312e715a88d500500c661860d1 Signed-hostap: Jouni Malinen --- wpa_supplicant/ctrl_iface.c | 5 +++-- wpa_supplicant/driver_i.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'wpa_supplicant') diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 059c586..dbf8a84 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -4331,6 +4331,7 @@ static int wpa_supplicant_signal_poll(struct wpa_supplicant *wpa_s, char *buf, return ret; } + static int wpa_supplicant_pktcnt_poll(struct wpa_supplicant *wpa_s, char *buf, size_t buflen) { @@ -4342,8 +4343,8 @@ static int wpa_supplicant_pktcnt_poll(struct wpa_supplicant *wpa_s, char *buf, return -1; ret = os_snprintf(buf, buflen, "TXGOOD=%lu\nTXBAD=%lu\nRXGOOD=%lu\n", - sta.tx_packets, sta.tx_retry_failed, sta.rx_packets); - if (ret < 0 || (unsigned int) ret > buflen) + sta.tx_packets, sta.tx_retry_failed, sta.rx_packets); + if (ret < 0 || (size_t) ret > buflen) return -1; return ret; } diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h index ee9f6b0..bc148ca 100644 --- a/wpa_supplicant/driver_i.h +++ b/wpa_supplicant/driver_i.h @@ -467,7 +467,8 @@ static inline int wpa_drv_pktcnt_poll(struct wpa_supplicant *wpa_s, struct hostap_sta_driver_data *sta) { if (wpa_s->driver->read_sta_data) - return wpa_s->driver->read_sta_data(wpa_s->drv_priv, sta, wpa_s->bssid); + return wpa_s->driver->read_sta_data(wpa_s->drv_priv, sta, + wpa_s->bssid); return -1; } -- cgit v1.1