200-reduce_size.patch 8.6 KB

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