iw: update to 3.10, sync with nl80211.h changes in compat-wireless
[openwrt/svn-archive/archive.git] / package / network / utils / iw / patches / 100-rx_rate.patch
1 --- a/station.c
2 +++ b/station.c
3 @@ -43,7 +43,7 @@ static void print_power_mode(struct nlat
4 }
5 }
6
7 -void parse_tx_bitrate(struct nlattr *bitrate_attr, char *buf, int buflen)
8 +void parse_bitrate(struct nlattr *bitrate_attr, char *buf, int buflen)
9 {
10 int rate = 0;
11 char *pos = buf;
12 @@ -107,6 +107,7 @@ static int print_sta_handler(struct nl_m
13 [NL80211_STA_INFO_SIGNAL] = { .type = NLA_U8 },
14 [NL80211_STA_INFO_T_OFFSET] = { .type = NLA_U64 },
15 [NL80211_STA_INFO_TX_BITRATE] = { .type = NLA_NESTED },
16 + [NL80211_STA_INFO_RX_BITRATE] = { .type = NLA_NESTED },
17 [NL80211_STA_INFO_LLID] = { .type = NLA_U16 },
18 [NL80211_STA_INFO_PLID] = { .type = NLA_U16 },
19 [NL80211_STA_INFO_PLINK_STATE] = { .type = NLA_U8 },
20 @@ -177,10 +178,17 @@ static int print_sta_handler(struct nl_m
21 if (sinfo[NL80211_STA_INFO_TX_BITRATE]) {
22 char buf[100];
23
24 - parse_tx_bitrate(sinfo[NL80211_STA_INFO_TX_BITRATE], buf, sizeof(buf));
25 + parse_bitrate(sinfo[NL80211_STA_INFO_TX_BITRATE], buf, sizeof(buf));
26 printf("\n\ttx bitrate:\t%s", buf);
27 }
28
29 + if (sinfo[NL80211_STA_INFO_RX_BITRATE]) {
30 + char buf[100];
31 +
32 + parse_bitrate(sinfo[NL80211_STA_INFO_RX_BITRATE], buf, sizeof(buf));
33 + printf("\n\trx bitrate:\t%s", buf);
34 + }
35 +
36 if (sinfo[NL80211_STA_INFO_LLID])
37 printf("\n\tmesh llid:\t%d",
38 nla_get_u16(sinfo[NL80211_STA_INFO_LLID]));
39 --- a/iw.h
40 +++ b/iw.h
41 @@ -170,7 +170,7 @@ enum print_ie_type {
42 void print_ies(unsigned char *ie, int ielen, bool unknown,
43 enum print_ie_type ptype);
44
45 -void parse_tx_bitrate(struct nlattr *bitrate_attr, char *buf, int buflen);
46 +void parse_bitrate(struct nlattr *bitrate_attr, char *buf, int buflen);
47
48 DECLARE_SECTION(set);
49 DECLARE_SECTION(get);
50 --- a/link.c
51 +++ b/link.c
52 @@ -165,7 +165,7 @@ static int print_link_sta(struct nl_msg
53 if (sinfo[NL80211_STA_INFO_TX_BITRATE]) {
54 char buf[100];
55
56 - parse_tx_bitrate(sinfo[NL80211_STA_INFO_TX_BITRATE], buf, sizeof(buf));
57 + parse_bitrate(sinfo[NL80211_STA_INFO_TX_BITRATE], buf, sizeof(buf));
58 printf("\ttx bitrate: %s\n", buf);
59 }
60