diff options
-rw-r--r-- | src/drivers/driver.h | 2 | ||||
-rw-r--r-- | src/drivers/driver_nl80211.c | 10 | ||||
-rw-r--r-- | wpa_supplicant/ctrl_iface.c | 5 | ||||
-rw-r--r-- | wpa_supplicant/driver_i.h | 3 |
4 files changed, 15 insertions, 5 deletions
diff --git a/src/drivers/driver.h b/src/drivers/driver.h index e392072..e9f926f 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1638,7 +1638,7 @@ struct wpa_driver_ops { int (*set_generic_elem)(void *priv, const u8 *elem, size_t elem_len); /** - * read_sta_data - Fetch station data (AP only) + * read_sta_data - Fetch station data * @priv: Private driver interface data * @data: Buffer for returning station information * @addr: MAC address of the station diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index eeec609..a9e6139 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -7391,6 +7391,8 @@ static int i802_flush(void *priv) return -ENOBUFS; } +#endif /* HOSTAPD || CONFIG_AP */ + static int get_sta_handler(struct nl_msg *msg, void *arg) { @@ -7404,6 +7406,7 @@ static int get_sta_handler(struct nl_msg *msg, void *arg) [NL80211_STA_INFO_TX_BYTES] = { .type = NLA_U32 }, [NL80211_STA_INFO_RX_PACKETS] = { .type = NLA_U32 }, [NL80211_STA_INFO_TX_PACKETS] = { .type = NLA_U32 }, + [NL80211_STA_INFO_TX_FAILED] = { .type = NLA_U32 }, }; nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0), @@ -7439,6 +7442,9 @@ static int get_sta_handler(struct nl_msg *msg, void *arg) if (stats[NL80211_STA_INFO_TX_PACKETS]) data->tx_packets = nla_get_u32(stats[NL80211_STA_INFO_TX_PACKETS]); + if (stats[NL80211_STA_INFO_TX_FAILED]) + data->tx_retry_failed = + nla_get_u32(stats[NL80211_STA_INFO_TX_FAILED]); return NL_SKIP; } @@ -7467,6 +7473,8 @@ static int i802_read_sta_data(void *priv, struct hostap_sta_driver_data *data, } +#if defined(HOSTAPD) || defined(CONFIG_AP) + static int i802_set_tx_queue_params(void *priv, int queue, int aifs, int cw_min, int cw_max, int burst_time) { @@ -9204,7 +9212,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = { #if defined(HOSTAPD) || defined(CONFIG_AP) .get_seqnum = i802_get_seqnum, .flush = i802_flush, - .read_sta_data = i802_read_sta_data, .get_inact_sec = i802_get_inact_sec, .sta_clear_stats = i802_sta_clear_stats, .set_rts = i802_set_rts, @@ -9214,6 +9221,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = { .sta_deauth = i802_sta_deauth, .sta_disassoc = i802_sta_disassoc, #endif /* HOSTAPD || CONFIG_AP */ + .read_sta_data = i802_read_sta_data, .set_freq = i802_set_freq, .send_action = wpa_driver_nl80211_send_action, .send_action_cancel_wait = wpa_driver_nl80211_send_action_cancel_wait, 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; } |