Fix hostapd compilation errors on STA_INFO (#3308)
[openwrt/svn-archive/archive.git] / package / hostapd / patches / 004-nl80211-rename-STAT-to-INFO.patch
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
5 @@ -598,11 +598,11 @@
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 },
19 };
20
21 nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
22 @@ -614,24 +614,24 @@
23 * the kernel starts sending station notifications.
24 */
25
26 - if (!tb[NL80211_ATTR_STA_STATS]) {
27 + if (!tb[NL80211_ATTR_STA_INFO]) {
28 wpa_printf(MSG_DEBUG, "sta stats missing!");
29 return NL_SKIP;
30 }
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],
35 stats_policy)) {
36 wpa_printf(MSG_DEBUG, "failed to parse nested attributes!");
37 return NL_SKIP;
38 }
39
40 - if (stats[NL80211_STA_STAT_INACTIVE_TIME])
41 + if (stats[NL80211_STA_INFO_INACTIVE_TIME])
42 data->inactive_msec =
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]);
53
54 return NL_SKIP;
55 }