aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-09-05 17:07:03 +0300
committerDmitry Shmidt <dimitrysh@google.com>2012-09-09 12:39:46 -0700
commit1e6c57fee4a56b421cc20f6dc0785c9138b21337 (patch)
treed3264d1435916dcc019be0878849e087fb03d4b2 /src
parent205f2142134d2f3475fe1f893575df8f809eede4 (diff)
downloadexternal_wpa_supplicant_8-1e6c57fee4a56b421cc20f6dc0785c9138b21337.zip
external_wpa_supplicant_8-1e6c57fee4a56b421cc20f6dc0785c9138b21337.tar.gz
external_wpa_supplicant_8-1e6c57fee4a56b421cc20f6dc0785c9138b21337.tar.bz2
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 <j@w1.fi>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/driver.h2
-rw-r--r--src/drivers/driver_nl80211.c10
2 files changed, 10 insertions, 2 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,