iw: update to version 4.3
[openwrt/openwrt.git] / package / network / utils / iw / patches / 200-reduce_size.patch
1 --- a/Makefile
2 +++ b/Makefile
3 @@ -15,8 +15,8 @@ CFLAGS += -Wall -Wundef -Wstrict-prototy
4 OBJS = iw.o genl.o event.o info.o phy.o \
5 interface.o ibss.o station.o survey.o util.o ocb.o \
6 mesh.o mpath.o mpp.o scan.o reg.o version.o \
7 - reason.o status.o connect.o link.o offch.o ps.o cqm.o \
8 - bitrate.o wowlan.o coalesce.o roc.o p2p.o vendor.o
9 + reason.o status.o link.o offch.o ps.o cqm.o \
10 + bitrate.o vendor.o
11 OBJS += sections.o
12
13 OBJS-$(HWSIM) += hwsim.o
14 --- a/event.c
15 +++ b/event.c
16 @@ -342,6 +342,7 @@ static int print_event(struct nl_msg *ms
17 }
18
19 switch (gnlh->cmd) {
20 +#if 0
21 case NL80211_CMD_NEW_WIPHY:
22 printf("renamed to %s\n", nla_get_string(tb[NL80211_ATTR_WIPHY_NAME]));
23 break;
24 @@ -376,6 +377,7 @@ static int print_event(struct nl_msg *ms
25 case NL80211_CMD_SCHED_SCAN_RESULTS:
26 printf("got scheduled scan results\n");
27 break;
28 +#endif
29 case NL80211_CMD_REG_CHANGE:
30 printf("regulatory domain change: ");
31
32 @@ -454,6 +456,7 @@ static int print_event(struct nl_msg *ms
33 mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC]));
34 printf("del station %s\n", macbuf);
35 break;
36 +#if 0
37 case NL80211_CMD_JOIN_IBSS:
38 mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC]));
39 printf("IBSS %s joined\n", macbuf);
40 @@ -610,9 +613,9 @@ static int print_event(struct nl_msg *ms
41 case NL80211_CMD_DEL_WIPHY:
42 printf("delete wiphy\n");
43 break;
44 +#endif
45 default:
46 - printf("unknown event %d (%s)\n",
47 - gnlh->cmd, command_name(gnlh->cmd));
48 + printf("unknown event %d\n", gnlh->cmd);
49 break;
50 }
51
52 --- a/info.c
53 +++ b/info.c
54 @@ -219,6 +219,7 @@ next:
55 }
56 }
57
58 +#if 0
59 if (tb_band[NL80211_BAND_ATTR_RATES]) {
60 printf("\t\tBitrates (non-HT):\n");
61 nla_for_each_nested(nl_rate, tb_band[NL80211_BAND_ATTR_RATES], rem_rate) {
62 @@ -235,6 +236,7 @@ next:
63 printf("\n");
64 }
65 }
66 +#endif
67 }
68 }
69
70 @@ -291,6 +293,7 @@ next:
71 printf("\tCoverage class: %d (up to %dm)\n", coverage, 450 * coverage);
72 }
73
74 +#if 0
75 if (tb_msg[NL80211_ATTR_CIPHER_SUITES]) {
76 int num = nla_len(tb_msg[NL80211_ATTR_CIPHER_SUITES]) / sizeof(__u32);
77 int i;
78 @@ -302,6 +305,7 @@ next:
79 cipher_name(ciphers[i]));
80 }
81 }
82 +#endif
83
84 if (tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX] &&
85 tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX])
86 @@ -321,11 +325,13 @@ next:
87 printf("\t\t * %s\n", iftype_name(nla_type(nl_mode)));
88 }
89
90 +#if 0
91 if (tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES]) {
92 printf("\tsoftware interface modes (can always be added):\n");
93 nla_for_each_nested(nl_mode, tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES], rem_mode)
94 printf("\t\t * %s\n", iftype_name(nla_type(nl_mode)));
95 }
96 +#endif
97
98 if (tb_msg[NL80211_ATTR_INTERFACE_COMBINATIONS]) {
99 struct nlattr *nl_combi;
100 @@ -422,6 +428,7 @@ broken_combination:
101 printf("\tinterface combinations are not supported\n");
102 }
103
104 +#if 0
105 if (tb_msg[NL80211_ATTR_SUPPORTED_COMMANDS]) {
106 printf("\tSupported commands:\n");
107 nla_for_each_nested(nl_cmd, tb_msg[NL80211_ATTR_SUPPORTED_COMMANDS], rem_cmd)
108 @@ -518,6 +525,7 @@ broken_combination:
109 printf("\t\t * wake up on TCP connection\n");
110 }
111 }
112 +#endif
113
114 if (tb_msg[NL80211_ATTR_ROAM_SUPPORT])
115 printf("\tDevice supports roaming.\n");
116 @@ -554,6 +562,7 @@ broken_combination:
117 }
118 }
119
120 +#if 0
121 if (tb_msg[NL80211_ATTR_FEATURE_FLAGS]) {
122 unsigned int features = nla_get_u32(tb_msg[NL80211_ATTR_FEATURE_FLAGS]);
123
124 @@ -612,6 +621,7 @@ broken_combination:
125 if (features & NL80211_FEATURE_TDLS_CHANNEL_SWITCH)
126 printf("\tDevice supports TDLS channel switching\n");
127 }
128 +#endif
129
130 if (tb_msg[NL80211_ATTR_EXT_FEATURES]) {
131 struct nlattr *tb = tb_msg[NL80211_ATTR_EXT_FEATURES];
132 @@ -668,6 +678,7 @@ TOPLEVEL(list, NULL, NL80211_CMD_GET_WIP
133 "List all wireless devices and their capabilities.");
134 TOPLEVEL(phy, NULL, NL80211_CMD_GET_WIPHY, NLM_F_DUMP, CIB_NONE, handle_info, NULL);
135
136 +#if 0
137 static int handle_commands(struct nl80211_state *state, struct nl_msg *msg,
138 int argc, char **argv, enum id_input id)
139 {
140 @@ -679,6 +690,7 @@ static int handle_commands(struct nl8021
141 }
142 TOPLEVEL(commands, NULL, NL80211_CMD_GET_WIPHY, 0, CIB_NONE, handle_commands,
143 "list all known commands and their decimal & hex value");
144 +#endif
145
146 static int print_feature_handler(struct nl_msg *msg, void *arg)
147 {
148 --- a/scan.c
149 +++ b/scan.c
150 @@ -1081,6 +1081,7 @@ static void print_ht_op(const uint8_t ty
151 printf("\t\t * secondary channel offset: %s\n",
152 ht_secondary_offset[data[1] & 0x3]);
153 printf("\t\t * STA channel width: %s\n", sta_chan_width[(data[1] & 0x4)>>2]);
154 + return;
155 printf("\t\t * RIFS: %d\n", (data[1] & 0x8)>>3);
156 printf("\t\t * HT protection: %s\n", protection[data[2] & 0x3]);
157 printf("\t\t * non-GF present: %d\n", (data[2] & 0x4) >> 2);
158 @@ -1312,6 +1313,13 @@ static void print_ie(const struct ie_pri
159
160 static const struct ie_print ieprinters[] = {
161 [0] = { "SSID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), },
162 + [45] = { "HT capabilities", print_ht_capa, 26, 26, BIT(PRINT_SCAN), },
163 + [48] = { "RSN", print_rsn, 2, 255, BIT(PRINT_SCAN), },
164 + [61] = { "HT operation", print_ht_op, 22, 22, BIT(PRINT_SCAN), },
165 + [62] = { "Secondary Channel Offset", print_secchan_offs, 1, 1, BIT(PRINT_SCAN), },
166 + [191] = { "VHT capabilities", print_vht_capa, 12, 255, BIT(PRINT_SCAN), },
167 + [192] = { "VHT operation", print_vht_oper, 5, 255, BIT(PRINT_SCAN), },
168 +#if 0
169 [1] = { "Supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), },
170 [3] = { "DS Parameter set", print_ds, 1, 1, BIT(PRINT_SCAN), },
171 [5] = { "TIM", print_tim, 4, 255, BIT(PRINT_SCAN), },
172 @@ -1321,14 +1329,8 @@ static const struct ie_print ieprinters[
173 [32] = { "Power constraint", print_powerconstraint, 1, 1, BIT(PRINT_SCAN), },
174 [35] = { "TPC report", print_tpcreport, 2, 2, BIT(PRINT_SCAN), },
175 [42] = { "ERP", print_erp, 1, 255, BIT(PRINT_SCAN), },
176 - [45] = { "HT capabilities", print_ht_capa, 26, 26, BIT(PRINT_SCAN), },
177 [47] = { "ERP D4.0", print_erp, 1, 255, BIT(PRINT_SCAN), },
178 [74] = { "Overlapping BSS scan params", print_obss_scan_params, 14, 255, BIT(PRINT_SCAN), },
179 - [61] = { "HT operation", print_ht_op, 22, 22, BIT(PRINT_SCAN), },
180 - [62] = { "Secondary Channel Offset", print_secchan_offs, 1, 1, BIT(PRINT_SCAN), },
181 - [191] = { "VHT capabilities", print_vht_capa, 12, 255, BIT(PRINT_SCAN), },
182 - [192] = { "VHT operation", print_vht_oper, 5, 255, BIT(PRINT_SCAN), },
183 - [48] = { "RSN", print_rsn, 2, 255, BIT(PRINT_SCAN), },
184 [50] = { "Extended supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), },
185 [113] = { "MESH Configuration", print_mesh_conf, 7, 7, BIT(PRINT_SCAN), },
186 [114] = { "MESH ID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), },
187 @@ -1336,6 +1338,7 @@ static const struct ie_print ieprinters[
188 [107] = { "802.11u Interworking", print_interworking, 0, 255, BIT(PRINT_SCAN), },
189 [108] = { "802.11u Advertisement", print_11u_advert, 0, 255, BIT(PRINT_SCAN), },
190 [111] = { "802.11u Roaming Consortium", print_11u_rcon, 0, 255, BIT(PRINT_SCAN), },
191 +#endif
192 };
193
194 static void print_wifi_wpa(const uint8_t type, uint8_t len, const uint8_t *data)
195 @@ -1767,6 +1770,7 @@ void print_ies(unsigned char *ie, int ie
196 ieprinters[ie[0]].name &&
197 ieprinters[ie[0]].flags & BIT(ptype)) {
198 print_ie(&ieprinters[ie[0]], ie[0], ie[1], ie + 2);
199 +#if 0
200 } else if (ie[0] == 221 /* vendor */) {
201 print_vendor(ie[1], ie + 2, unknown, ptype);
202 } else if (unknown) {
203 @@ -1776,6 +1780,7 @@ void print_ies(unsigned char *ie, int ie
204 for (i=0; i<ie[1]; i++)
205 printf(" %.2x", ie[2+i]);
206 printf("\n");
207 +#endif
208 }
209 ielen -= ie[1] + 2;
210 ie += ie[1] + 2;
211 @@ -1816,6 +1821,7 @@ static void print_capa_non_dmg(__u16 cap
212 printf(" ESS");
213 if (capa & WLAN_CAPABILITY_IBSS)
214 printf(" IBSS");
215 +#if 0
216 if (capa & WLAN_CAPABILITY_CF_POLLABLE)
217 printf(" CfPollable");
218 if (capa & WLAN_CAPABILITY_CF_POLL_REQUEST)
219 @@ -1844,6 +1850,7 @@ static void print_capa_non_dmg(__u16 cap
220 printf(" DelayedBACK");
221 if (capa & WLAN_CAPABILITY_IMM_BACK)
222 printf(" ImmediateBACK");
223 +#endif
224 }
225
226 static int print_bss_handler(struct nl_msg *msg, void *arg)
227 @@ -1922,8 +1929,10 @@ static int print_bss_handler(struct nl_m
228 if (bss[NL80211_BSS_FREQUENCY]) {
229 int freq = nla_get_u32(bss[NL80211_BSS_FREQUENCY]);
230 printf("\tfreq: %d\n", freq);
231 +#if 0
232 if (freq > 45000)
233 is_dmg = true;
234 +#endif
235 }
236 if (bss[NL80211_BSS_BEACON_INTERVAL])
237 printf("\tbeacon interval: %d TUs\n",
238 --- a/util.c
239 +++ b/util.c
240 @@ -267,6 +267,7 @@ static const char *commands[NL80211_CMD_
241
242 static char cmdbuf[100];
243
244 +#if 0
245 const char *command_name(enum nl80211_commands cmd)
246 {
247 if (cmd <= NL80211_CMD_MAX && commands[cmd])
248 @@ -274,6 +275,7 @@ const char *command_name(enum nl80211_co
249 sprintf(cmdbuf, "Unknown command (%d)", cmd);
250 return cmdbuf;
251 }
252 +#endif
253
254 int ieee80211_channel_to_frequency(int chan, enum nl80211_band band)
255 {