200-reduce_size.patch 8.7 KB

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