1 Index: hostapd-20071107_03ec0ec5cdb974d51a4a2a566bea4c4568138576/hostapd/driver_nl80211.c
2 ===================================================================
3 --- hostapd-20071107_03ec0ec5cdb974d51a4a2a566bea4c4568138576.orig/hostapd/driver_nl80211.c.orig 2008-04-09 14:03:17.000000000 +1200
4 +++ hostapd-20071107_03ec0ec5cdb974d51a4a2a566bea4c4568138576/hostapd/driver_nl80211.c 2008-04-09 14:06:37.000000000 +1200
6 struct nlattr *tb[NL80211_ATTR_MAX + 1];
7 struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
8 struct hostap_sta_driver_data *data = arg;
9 - struct nlattr *stats[NL80211_STA_STAT_MAX + 1];
10 - static struct nla_policy stats_policy[NL80211_STA_STAT_MAX + 1] = {
11 - [NL80211_STA_STAT_INACTIVE_TIME] = { .type = NLA_U32 },
12 - [NL80211_STA_STAT_RX_BYTES] = { .type = NLA_U32 },
13 - [NL80211_STA_STAT_TX_BYTES] = { .type = NLA_U32 },
14 + struct nlattr *stats[NL80211_STA_INFO_MAX + 1];
15 + static struct nla_policy stats_policy[NL80211_STA_INFO_MAX + 1] = {
16 + [NL80211_STA_INFO_INACTIVE_TIME] = { .type = NLA_U32 },
17 + [NL80211_STA_INFO_RX_BYTES] = { .type = NLA_U32 },
18 + [NL80211_STA_INFO_TX_BYTES] = { .type = NLA_U32 },
21 nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
23 * the kernel starts sending station notifications.
26 - if (!tb[NL80211_ATTR_STA_STATS]) {
27 + if (!tb[NL80211_ATTR_STA_INFO]) {
28 wpa_printf(MSG_DEBUG, "sta stats missing!");
31 - if (nla_parse_nested(stats, NL80211_STA_STAT_MAX,
32 - tb[NL80211_ATTR_STA_STATS],
33 + if (nla_parse_nested(stats, NL80211_STA_INFO_MAX,
34 + tb[NL80211_ATTR_STA_INFO],
36 wpa_printf(MSG_DEBUG, "failed to parse nested attributes!");
40 - if (stats[NL80211_STA_STAT_INACTIVE_TIME])
41 + if (stats[NL80211_STA_INFO_INACTIVE_TIME])
43 - nla_get_u32(stats[NL80211_STA_STAT_INACTIVE_TIME]);
44 - if (stats[NL80211_STA_STAT_RX_BYTES])
45 - data->rx_bytes = nla_get_u32(stats[NL80211_STA_STAT_RX_BYTES]);
46 - if (stats[NL80211_STA_STAT_TX_BYTES])
47 - data->rx_bytes = nla_get_u32(stats[NL80211_STA_STAT_TX_BYTES]);
48 + nla_get_u32(stats[NL80211_STA_INFO_INACTIVE_TIME]);
49 + if (stats[NL80211_STA_INFO_RX_BYTES])
50 + data->rx_bytes = nla_get_u32(stats[NL80211_STA_INFO_RX_BYTES]);
51 + if (stats[NL80211_STA_INFO_TX_BYTES])
52 + data->rx_bytes = nla_get_u32(stats[NL80211_STA_INFO_TX_BYTES]);