iw: enable MESH ID in scan output
[openwrt/openwrt.git] / package / network / utils / iw / patches / 200-reduce_size.patch
1 --- a/Makefile
2 +++ b/Makefile
3 @@ -16,8 +16,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 @@ -612,9 +615,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 @@ -197,6 +197,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 @@ -213,6 +214,7 @@ next:
63 printf("\n");
64 }
65 }
66 +#endif
67 }
68 }
69
70 @@ -278,6 +280,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 @@ -289,6 +292,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 @@ -308,11 +312,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 @@ -409,6 +415,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 @@ -506,6 +513,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 @@ -544,6 +552,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 @@ -602,6 +611,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 @@ -658,6 +668,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 @@ -669,6 +680,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 @@ -1147,6 +1147,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 @@ -1380,6 +1381,14 @@ 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 + [114] = { "MESH ID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), },
167 + [191] = { "VHT capabilities", print_vht_capa, 12, 255, BIT(PRINT_SCAN), },
168 + [192] = { "VHT operation", print_vht_oper, 5, 255, BIT(PRINT_SCAN), },
169 +#if 0
170 [1] = { "Supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), },
171 [3] = { "DS Parameter set", print_ds, 1, 1, BIT(PRINT_SCAN), },
172 [5] = { "TIM", print_tim, 4, 255, BIT(PRINT_SCAN), },
173 @@ -1389,21 +1398,15 @@ static const struct ie_print ieprinters[
174 [32] = { "Power constraint", print_powerconstraint, 1, 1, BIT(PRINT_SCAN), },
175 [35] = { "TPC report", print_tpcreport, 2, 2, BIT(PRINT_SCAN), },
176 [42] = { "ERP", print_erp, 1, 255, BIT(PRINT_SCAN), },
177 - [45] = { "HT capabilities", print_ht_capa, 26, 26, BIT(PRINT_SCAN), },
178 [47] = { "ERP D4.0", print_erp, 1, 255, BIT(PRINT_SCAN), },
179 [74] = { "Overlapping BSS scan params", print_obss_scan_params, 14, 255, BIT(PRINT_SCAN), },
180 - [61] = { "HT operation", print_ht_op, 22, 22, BIT(PRINT_SCAN), },
181 - [62] = { "Secondary Channel Offset", print_secchan_offs, 1, 1, BIT(PRINT_SCAN), },
182 - [191] = { "VHT capabilities", print_vht_capa, 12, 255, BIT(PRINT_SCAN), },
183 - [192] = { "VHT operation", print_vht_oper, 5, 255, BIT(PRINT_SCAN), },
184 - [48] = { "RSN", print_rsn, 2, 255, BIT(PRINT_SCAN), },
185 [50] = { "Extended supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), },
186 [113] = { "MESH Configuration", print_mesh_conf, 7, 7, BIT(PRINT_SCAN), },
187 - [114] = { "MESH ID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), },
188 [127] = { "Extended capabilities", print_capabilities, 0, 255, BIT(PRINT_SCAN), },
189 [107] = { "802.11u Interworking", print_interworking, 0, 255, BIT(PRINT_SCAN), },
190 [108] = { "802.11u Advertisement", print_11u_advert, 0, 255, BIT(PRINT_SCAN), },
191 [111] = { "802.11u Roaming Consortium", print_11u_rcon, 0, 255, BIT(PRINT_SCAN), },
192 +#endif
193 };
194
195 static void print_wifi_wpa(const uint8_t type, uint8_t len, const uint8_t *data)
196 @@ -1835,6 +1838,7 @@ void print_ies(unsigned char *ie, int ie
197 ieprinters[ie[0]].name &&
198 ieprinters[ie[0]].flags & BIT(ptype)) {
199 print_ie(&ieprinters[ie[0]], ie[0], ie[1], ie + 2);
200 +#if 0
201 } else if (ie[0] == 221 /* vendor */) {
202 print_vendor(ie[1], ie + 2, unknown, ptype);
203 } else if (unknown) {
204 @@ -1844,6 +1848,7 @@ void print_ies(unsigned char *ie, int ie
205 for (i=0; i<ie[1]; i++)
206 printf(" %.2x", ie[2+i]);
207 printf("\n");
208 +#endif
209 }
210 ielen -= ie[1] + 2;
211 ie += ie[1] + 2;
212 @@ -1884,6 +1889,7 @@ static void print_capa_non_dmg(__u16 cap
213 printf(" ESS");
214 if (capa & WLAN_CAPABILITY_IBSS)
215 printf(" IBSS");
216 +#if 0
217 if (capa & WLAN_CAPABILITY_CF_POLLABLE)
218 printf(" CfPollable");
219 if (capa & WLAN_CAPABILITY_CF_POLL_REQUEST)
220 @@ -1912,6 +1918,7 @@ static void print_capa_non_dmg(__u16 cap
221 printf(" DelayedBACK");
222 if (capa & WLAN_CAPABILITY_IMM_BACK)
223 printf(" ImmediateBACK");
224 +#endif
225 }
226
227 static int print_bss_handler(struct nl_msg *msg, void *arg)
228 @@ -1996,8 +2003,10 @@ static int print_bss_handler(struct nl_m
229 if (bss[NL80211_BSS_FREQUENCY]) {
230 int freq = nla_get_u32(bss[NL80211_BSS_FREQUENCY]);
231 printf("\tfreq: %d\n", freq);
232 +#if 0
233 if (freq > 45000)
234 is_dmg = true;
235 +#endif
236 }
237 if (bss[NL80211_BSS_BEACON_INTERVAL])
238 printf("\tbeacon interval: %d TUs\n",
239 --- a/util.c
240 +++ b/util.c
241 @@ -275,6 +275,7 @@ static const char *commands[NL80211_CMD_
242
243 static char cmdbuf[100];
244
245 +#if 0
246 const char *command_name(enum nl80211_commands cmd)
247 {
248 if (cmd <= NL80211_CMD_MAX && commands[cmd])
249 @@ -282,6 +283,7 @@ const char *command_name(enum nl80211_co
250 sprintf(cmdbuf, "Unknown command (%d)", cmd);
251 return cmdbuf;
252 }
253 +#endif
254
255 int ieee80211_channel_to_frequency(int chan, enum nl80211_band band)
256 {