003-we_essential_def.patch 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. --- a/iwlist.c
  2. +++ b/iwlist.c
  3. @@ -58,7 +58,6 @@ typedef struct iw_auth_descr
  4. * Maybe this should go in iwlib.c ?
  5. */
  6. -#ifndef WE_ESSENTIAL
  7. #define IW_ARRAY_LEN(x) (sizeof(x)/sizeof((x)[0]))
  8. //static const struct iwmask_name iw_enc_mode_name[] = {
  9. @@ -161,11 +160,8 @@ static const char * iw_ie_key_mgmt_name[
  10. };
  11. #define IW_IE_KEY_MGMT_NUM IW_ARRAY_LEN(iw_ie_key_mgmt_name)
  12. -#endif /* WE_ESSENTIAL */
  13. -
  14. /************************* WPA SUBROUTINES *************************/
  15. -#ifndef WE_ESSENTIAL
  16. /*------------------------------------------------------------------*/
  17. /*
  18. * Print all names corresponding to a mask.
  19. @@ -431,7 +427,6 @@ iw_print_gen_ie(unsigned char * buffer,
  20. offset += buffer[offset+1] + 2;
  21. }
  22. }
  23. -#endif /* WE_ESSENTIAL */
  24. /***************************** SCANNING *****************************/
  25. /*
  26. @@ -585,12 +580,10 @@ print_scanning_token(struct stream_descr
  27. &event->u.qual, iw_range, has_range);
  28. printf(" %s\n", buffer);
  29. break;
  30. -#ifndef WE_ESSENTIAL
  31. case IWEVGENIE:
  32. /* Informations Elements are complex, let's do only some of them */
  33. iw_print_gen_ie(event->u.data.pointer, event->u.data.length);
  34. break;
  35. -#endif /* WE_ESSENTIAL */
  36. case IWEVCUSTOM:
  37. {
  38. char custom[IW_CUSTOM_MAX+1];
  39. @@ -1302,7 +1295,6 @@ print_pm_info(int skfd,
  40. return(0);
  41. }
  42. -#ifndef WE_ESSENTIAL
  43. /************************** TRANSMIT POWER **************************/
  44. /*------------------------------------------------------------------*/
  45. @@ -1405,6 +1397,7 @@ print_txpower_info(int skfd,
  46. return(0);
  47. }
  48. +#ifndef WE_ESSENTIAL
  49. /*********************** RETRY LIMIT/LIFETIME ***********************/
  50. /*------------------------------------------------------------------*/
  51. @@ -2060,8 +2053,8 @@ static const struct iwlist_entry iwlist_
  52. { "encryption", print_keys_info, 0, NULL },
  53. { "keys", print_keys_info, 0, NULL },
  54. { "power", print_pm_info, 0, NULL },
  55. -#ifndef WE_ESSENTIAL
  56. { "txpower", print_txpower_info, 0, NULL },
  57. +#ifndef WE_ESSENTIAL
  58. { "retry", print_retry_info, 0, NULL },
  59. { "ap", print_ap_info, 0, NULL },
  60. { "accesspoints", print_ap_info, 0, NULL },
  61. --- a/iwconfig.c
  62. +++ b/iwconfig.c
  63. @@ -106,16 +106,6 @@ get_info(int skfd,
  64. if(wrq.u.data.length > 1)
  65. info->has_nickname = 1;
  66. - if((info->has_range) && (info->range.we_version_compiled > 9))
  67. - {
  68. - /* Get Transmit Power */
  69. - if(iw_get_ext(skfd, ifname, SIOCGIWTXPOW, &wrq) >= 0)
  70. - {
  71. - info->has_txpower = 1;
  72. - memcpy(&(info->txpower), &(wrq.u.txpower), sizeof(iwparam));
  73. - }
  74. - }
  75. -
  76. /* Get sensitivity */
  77. if(iw_get_ext(skfd, ifname, SIOCGIWSENS, &wrq) >= 0)
  78. {
  79. @@ -132,6 +122,17 @@ get_info(int skfd,
  80. memcpy(&(info->retry), &(wrq.u.retry), sizeof(iwparam));
  81. }
  82. }
  83. +#endif /* WE_ESSENTIAL */
  84. +
  85. + if((info->has_range) && (info->range.we_version_compiled > 9))
  86. + {
  87. + /* Get Transmit Power */
  88. + if(iw_get_ext(skfd, ifname, SIOCGIWTXPOW, &wrq) >= 0)
  89. + {
  90. + info->has_txpower = 1;
  91. + memcpy(&(info->txpower), &(wrq.u.txpower), sizeof(iwparam));
  92. + }
  93. + }
  94. /* Get RTS threshold */
  95. if(iw_get_ext(skfd, ifname, SIOCGIWRTS, &wrq) >= 0)
  96. @@ -146,7 +147,6 @@ get_info(int skfd,
  97. info->has_frag = 1;
  98. memcpy(&(info->frag), &(wrq.u.frag), sizeof(iwparam));
  99. }
  100. -#endif /* WE_ESSENTIAL */
  101. return(0);
  102. }
  103. @@ -269,7 +269,6 @@ display_info(struct wireless_info * info
  104. printf("Bit Rate%c%s ", (info->bitrate.fixed ? '=' : ':'), buffer);
  105. }
  106. -#ifndef WE_ESSENTIAL
  107. /* Display the Transmit Power */
  108. if(info->has_txpower)
  109. {
  110. @@ -286,6 +285,7 @@ display_info(struct wireless_info * info
  111. printf("Tx-Power%c%s ", (info->txpower.fixed ? '=' : ':'), buffer);
  112. }
  113. +#ifndef WE_ESSENTIAL
  114. /* Display sensitivity */
  115. if(info->has_sens)
  116. {
  117. @@ -340,6 +340,7 @@ display_info(struct wireless_info * info
  118. printf(" ");
  119. tokens += 5; /* Between 3 and 5, depend on flags */
  120. }
  121. +#endif /* WE_ESSENTIAL */
  122. /* Display the RTS threshold */
  123. if(info->has_rts)
  124. @@ -383,7 +384,6 @@ display_info(struct wireless_info * info
  125. /* Formating */
  126. if(tokens > 0)
  127. printf("\n ");
  128. -#endif /* WE_ESSENTIAL */
  129. /* Display encryption information */
  130. /* Note : we display only the "current" key, use iwlist to list all keys */
  131. @@ -1196,6 +1196,7 @@ set_nwid_info(int skfd,
  132. /* 1 arg */
  133. return(1);
  134. }
  135. +#endif /* WE_ESSENTIAL */
  136. /*------------------------------------------------------------------*/
  137. /*
  138. @@ -1362,6 +1363,7 @@ set_txpower_info(int skfd,
  139. return(i);
  140. }
  141. +#ifndef WE_ESSENTIAL
  142. /*------------------------------------------------------------------*/
  143. /*
  144. * Set Sensitivity
  145. @@ -1459,6 +1461,7 @@ set_retry_info(int skfd,
  146. /* Var args */
  147. return(i);
  148. }
  149. +#endif /* WE_ESSENTIAL */
  150. /*------------------------------------------------------------------*/
  151. /*
  152. @@ -1565,6 +1568,7 @@ set_frag_info(int skfd,
  153. return(1);
  154. }
  155. +#ifndef WE_ESSENTIAL
  156. /*------------------------------------------------------------------*/
  157. /*
  158. * Set Modulation
  159. @@ -1719,21 +1723,21 @@ static const struct iwconfig_entry iwcon
  160. "Set Nickname", "NNN" },
  161. { "nwid", set_nwid_info, 1, SIOCSIWNWID,
  162. "Set NWID", "{NN|on|off}" },
  163. - { "ap", set_apaddr_info, 1, SIOCSIWAP,
  164. - "Set AP Address", "{N|off|auto}" },
  165. - { "txpower", set_txpower_info, 1, SIOCSIWTXPOW,
  166. - "Set Tx Power", "{NmW|NdBm|off|auto}" },
  167. { "sens", set_sens_info, 1, SIOCSIWSENS,
  168. "Set Sensitivity", "N" },
  169. + { "modulation", set_modulation_info, 1, SIOCGIWMODUL,
  170. + "Set Modulation", "{11g|11a|CCK|OFDMg|...}" },
  171. { "retry", set_retry_info, 1, SIOCSIWRETRY,
  172. "Set Retry Limit", "{limit N|lifetime N}" },
  173. +#endif /* WE_ESSENTIAL */
  174. + { "ap", set_apaddr_info, 1, SIOCSIWAP,
  175. + "Set AP Address", "{N|off|auto}" },
  176. + { "txpower", set_txpower_info, 1, SIOCSIWTXPOW,
  177. + "Set Tx Power", "{NmW|NdBm|off|auto}" },
  178. { "rts", set_rts_info, 1, SIOCSIWRTS,
  179. "Set RTS Threshold", "{N|auto|fixed|off}" },
  180. { "frag", set_frag_info, 1, SIOCSIWFRAG,
  181. "Set Fragmentation Threshold", "{N|auto|fixed|off}" },
  182. - { "modulation", set_modulation_info, 1, SIOCGIWMODUL,
  183. - "Set Modulation", "{11g|11a|CCK|OFDMg|...}" },
  184. -#endif /* WE_ESSENTIAL */
  185. { "commit", set_commit_info, 0, SIOCSIWCOMMIT,
  186. "Commit changes", "" },
  187. { NULL, NULL, 0, 0, NULL, NULL },
  188. --- a/iwmulticall.c
  189. +++ b/iwmulticall.c
  190. @@ -76,12 +76,10 @@ extern int
  191. #undef iw_usage
  192. #undef main
  193. -#ifndef WE_ESSENTIAL
  194. /* Get iwspy in there, it's not that big. */
  195. #define main(args...) main_iwspy(args)
  196. #include "iwspy.c"
  197. #undef main
  198. -#endif /* WE_ESSENTIAL */
  199. /* Get iwpriv in there. Mandatory for HostAP and some other drivers. */
  200. #define main(args...) main_iwpriv(args)
  201. @@ -128,10 +126,8 @@ main(int argc,
  202. return(main_iwconfig(argc, argv));
  203. if(!strcmp(call_name, "iwlist"))
  204. return(main_iwlist(argc, argv));
  205. -#ifndef WE_ESSENTIAL
  206. if(!strcmp(call_name, "iwspy"))
  207. return(main_iwspy(argc, argv));
  208. -#endif /* WE_ESSENTIAL */
  209. if(!strcmp(call_name, "iwpriv"))
  210. return(main_iwpriv(argc, argv));
  211. if(!strcmp(call_name, "iwgetid"))