3cc80f9767fd3772aa358ce10106355836c814e8
[librecmc/librecmc.git] / package / hostapd / patches / 004-nl80211-rename-STAT-to-INFO.patch
1 --- a/hostapd/driver_nl80211.c
2 +++ b/hostapd/driver_nl80211.c
3 @@ -598,11 +598,11 @@
4         struct nlattr *tb[NL80211_ATTR_MAX + 1];
5         struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
6         struct hostap_sta_driver_data *data = arg;
7 -       struct nlattr *stats[NL80211_STA_STAT_MAX + 1];
8 -       static struct nla_policy stats_policy[NL80211_STA_STAT_MAX + 1] = {
9 -               [NL80211_STA_STAT_INACTIVE_TIME] = { .type = NLA_U32 },
10 -               [NL80211_STA_STAT_RX_BYTES] = { .type = NLA_U32 },
11 -               [NL80211_STA_STAT_TX_BYTES] = { .type = NLA_U32 },
12 +       struct nlattr *stats[NL80211_STA_INFO_MAX + 1];
13 +       static struct nla_policy stats_policy[NL80211_STA_INFO_MAX + 1] = {
14 +               [NL80211_STA_INFO_INACTIVE_TIME] = { .type = NLA_U32 },
15 +               [NL80211_STA_INFO_RX_BYTES] = { .type = NLA_U32 },
16 +               [NL80211_STA_INFO_TX_BYTES] = { .type = NLA_U32 },
17         };
18  
19         nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
20 @@ -614,24 +614,24 @@
21          * the kernel starts sending station notifications.
22          */
23  
24 -       if (!tb[NL80211_ATTR_STA_STATS]) {
25 +       if (!tb[NL80211_ATTR_STA_INFO]) {
26                 wpa_printf(MSG_DEBUG, "sta stats missing!");
27                 return NL_SKIP;
28         }
29 -       if (nla_parse_nested(stats, NL80211_STA_STAT_MAX,
30 -                            tb[NL80211_ATTR_STA_STATS],
31 +       if (nla_parse_nested(stats, NL80211_STA_INFO_MAX,
32 +                            tb[NL80211_ATTR_STA_INFO],
33                              stats_policy)) {
34                 wpa_printf(MSG_DEBUG, "failed to parse nested attributes!");
35                 return NL_SKIP;
36         }
37  
38 -       if (stats[NL80211_STA_STAT_INACTIVE_TIME])
39 +       if (stats[NL80211_STA_INFO_INACTIVE_TIME])
40                 data->inactive_msec =
41 -                       nla_get_u32(stats[NL80211_STA_STAT_INACTIVE_TIME]);
42 -       if (stats[NL80211_STA_STAT_RX_BYTES])
43 -               data->rx_bytes = nla_get_u32(stats[NL80211_STA_STAT_RX_BYTES]);
44 -       if (stats[NL80211_STA_STAT_TX_BYTES])
45 -               data->rx_bytes = nla_get_u32(stats[NL80211_STA_STAT_TX_BYTES]);
46 +                       nla_get_u32(stats[NL80211_STA_INFO_INACTIVE_TIME]);
47 +       if (stats[NL80211_STA_INFO_RX_BYTES])
48 +               data->rx_bytes = nla_get_u32(stats[NL80211_STA_INFO_RX_BYTES]);
49 +       if (stats[NL80211_STA_INFO_TX_BYTES])
50 +               data->rx_bytes = nla_get_u32(stats[NL80211_STA_INFO_TX_BYTES]);
51  
52         return NL_SKIP;
53  }