wext.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. /*
  2. * Copyright 2002-2005, Instant802 Networks, Inc.
  3. * Copyright 2005-2006, Devicescape Software, Inc.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. */
  9. #include <linux/module.h>
  10. #include <linux/init.h>
  11. #include <linux/netdevice.h>
  12. #include <linux/types.h>
  13. #include <linux/slab.h>
  14. #include <linux/skbuff.h>
  15. #include <linux/etherdevice.h>
  16. #include <linux/if_arp.h>
  17. #include <linux/wireless.h>
  18. #include <net/iw_handler.h>
  19. #include <asm/uaccess.h>
  20. #include <net/mac80211.h>
  21. #include "ieee80211_i.h"
  22. #include "led.h"
  23. #include "rate.h"
  24. #include "wpa.h"
  25. #include "aes_ccm.h"
  26. static int ieee80211_ioctl_siwgenie(struct net_device *dev,
  27. struct iw_request_info *info,
  28. struct iw_point *data, char *extra)
  29. {
  30. struct ieee80211_sub_if_data *sdata;
  31. sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  32. if (sdata->vif.type == NL80211_IFTYPE_STATION) {
  33. int ret = ieee80211_sta_set_extra_ie(sdata, extra, data->length);
  34. if (ret && ret != -EALREADY)
  35. return ret;
  36. sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_BSSID_SEL;
  37. sdata->u.mgd.flags &= ~IEEE80211_STA_EXT_SME;
  38. sdata->u.mgd.flags &= ~IEEE80211_STA_CONTROL_PORT;
  39. if (ret != -EALREADY)
  40. ieee80211_sta_req_auth(sdata);
  41. return 0;
  42. }
  43. return -EOPNOTSUPP;
  44. }
  45. static int ieee80211_ioctl_siwfreq(struct net_device *dev,
  46. struct iw_request_info *info,
  47. struct iw_freq *freq, char *extra)
  48. {
  49. struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  50. if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
  51. return cfg80211_ibss_wext_siwfreq(dev, info, freq, extra);
  52. else if (sdata->vif.type == NL80211_IFTYPE_STATION)
  53. sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_CHANNEL_SEL;
  54. /* freq->e == 0: freq->m = channel; otherwise freq = m * 10^e */
  55. if (freq->e == 0) {
  56. if (freq->m < 0) {
  57. if (sdata->vif.type == NL80211_IFTYPE_STATION)
  58. sdata->u.mgd.flags |=
  59. IEEE80211_STA_AUTO_CHANNEL_SEL;
  60. return 0;
  61. } else
  62. return ieee80211_set_freq(sdata,
  63. ieee80211_channel_to_frequency(freq->m));
  64. } else {
  65. int i, div = 1000000;
  66. for (i = 0; i < freq->e; i++)
  67. div /= 10;
  68. if (div > 0)
  69. return ieee80211_set_freq(sdata, freq->m / div);
  70. else
  71. return -EINVAL;
  72. }
  73. }
  74. static int ieee80211_ioctl_giwfreq(struct net_device *dev,
  75. struct iw_request_info *info,
  76. struct iw_freq *freq, char *extra)
  77. {
  78. struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
  79. struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  80. if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
  81. return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
  82. freq->m = local->oper_channel->center_freq;
  83. freq->e = 6;
  84. return 0;
  85. }
  86. static int ieee80211_ioctl_siwessid(struct net_device *dev,
  87. struct iw_request_info *info,
  88. struct iw_point *data, char *ssid)
  89. {
  90. struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  91. size_t len = data->length;
  92. int ret;
  93. if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
  94. return cfg80211_ibss_wext_siwessid(dev, info, data, ssid);
  95. /* iwconfig uses nul termination in SSID.. */
  96. if (len > 0 && ssid[len - 1] == '\0')
  97. len--;
  98. if (sdata->vif.type == NL80211_IFTYPE_STATION) {
  99. if (data->flags)
  100. sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_SSID_SEL;
  101. else
  102. sdata->u.mgd.flags |= IEEE80211_STA_AUTO_SSID_SEL;
  103. ret = ieee80211_sta_set_ssid(sdata, ssid, len);
  104. if (ret)
  105. return ret;
  106. sdata->u.mgd.flags &= ~IEEE80211_STA_EXT_SME;
  107. sdata->u.mgd.flags &= ~IEEE80211_STA_CONTROL_PORT;
  108. ieee80211_sta_req_auth(sdata);
  109. return 0;
  110. }
  111. return -EOPNOTSUPP;
  112. }
  113. static int ieee80211_ioctl_giwessid(struct net_device *dev,
  114. struct iw_request_info *info,
  115. struct iw_point *data, char *ssid)
  116. {
  117. size_t len;
  118. struct ieee80211_sub_if_data *sdata;
  119. sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  120. if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
  121. return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);
  122. if (sdata->vif.type == NL80211_IFTYPE_STATION) {
  123. int res = ieee80211_sta_get_ssid(sdata, ssid, &len);
  124. if (res == 0) {
  125. data->length = len;
  126. data->flags = 1;
  127. } else
  128. data->flags = 0;
  129. return res;
  130. }
  131. return -EOPNOTSUPP;
  132. }
  133. static int ieee80211_ioctl_siwap(struct net_device *dev,
  134. struct iw_request_info *info,
  135. struct sockaddr *ap_addr, char *extra)
  136. {
  137. struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  138. if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
  139. return cfg80211_ibss_wext_siwap(dev, info, ap_addr, extra);
  140. if (sdata->vif.type == NL80211_IFTYPE_STATION) {
  141. int ret;
  142. if (is_zero_ether_addr((u8 *) &ap_addr->sa_data))
  143. sdata->u.mgd.flags |= IEEE80211_STA_AUTO_BSSID_SEL |
  144. IEEE80211_STA_AUTO_CHANNEL_SEL;
  145. else if (is_broadcast_ether_addr((u8 *) &ap_addr->sa_data))
  146. sdata->u.mgd.flags |= IEEE80211_STA_AUTO_BSSID_SEL;
  147. else
  148. sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_BSSID_SEL;
  149. ret = ieee80211_sta_set_bssid(sdata, (u8 *) &ap_addr->sa_data);
  150. if (ret)
  151. return ret;
  152. sdata->u.mgd.flags &= ~IEEE80211_STA_EXT_SME;
  153. sdata->u.mgd.flags &= ~IEEE80211_STA_CONTROL_PORT;
  154. ieee80211_sta_req_auth(sdata);
  155. return 0;
  156. } else if (sdata->vif.type == NL80211_IFTYPE_WDS) {
  157. /*
  158. * If it is necessary to update the WDS peer address
  159. * while the interface is running, then we need to do
  160. * more work here, namely if it is running we need to
  161. * add a new and remove the old STA entry, this is
  162. * normally handled by _open() and _stop().
  163. */
  164. if (netif_running(dev))
  165. return -EBUSY;
  166. memcpy(&sdata->u.wds.remote_addr, (u8 *) &ap_addr->sa_data,
  167. ETH_ALEN);
  168. return 0;
  169. }
  170. return -EOPNOTSUPP;
  171. }
  172. static int ieee80211_ioctl_giwap(struct net_device *dev,
  173. struct iw_request_info *info,
  174. struct sockaddr *ap_addr, char *extra)
  175. {
  176. struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  177. if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
  178. return cfg80211_ibss_wext_giwap(dev, info, ap_addr, extra);
  179. if (sdata->vif.type == NL80211_IFTYPE_STATION) {
  180. if (sdata->u.mgd.state == IEEE80211_STA_MLME_ASSOCIATED) {
  181. ap_addr->sa_family = ARPHRD_ETHER;
  182. memcpy(&ap_addr->sa_data, sdata->u.mgd.bssid, ETH_ALEN);
  183. } else
  184. memset(&ap_addr->sa_data, 0, ETH_ALEN);
  185. return 0;
  186. } else if (sdata->vif.type == NL80211_IFTYPE_WDS) {
  187. ap_addr->sa_family = ARPHRD_ETHER;
  188. memcpy(&ap_addr->sa_data, sdata->u.wds.remote_addr, ETH_ALEN);
  189. return 0;
  190. }
  191. return -EOPNOTSUPP;
  192. }
  193. static int ieee80211_ioctl_siwrate(struct net_device *dev,
  194. struct iw_request_info *info,
  195. struct iw_param *rate, char *extra)
  196. {
  197. struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
  198. int i, err = -EINVAL;
  199. u32 target_rate = rate->value / 100000;
  200. struct ieee80211_sub_if_data *sdata;
  201. struct ieee80211_supported_band *sband;
  202. sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  203. sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
  204. /* target_rate = -1, rate->fixed = 0 means auto only, so use all rates
  205. * target_rate = X, rate->fixed = 1 means only rate X
  206. * target_rate = X, rate->fixed = 0 means all rates <= X */
  207. sdata->max_ratectrl_rateidx = -1;
  208. sdata->force_unicast_rateidx = -1;
  209. if (rate->value < 0)
  210. return 0;
  211. for (i=0; i< sband->n_bitrates; i++) {
  212. struct ieee80211_rate *brate = &sband->bitrates[i];
  213. int this_rate = brate->bitrate;
  214. if (target_rate == this_rate) {
  215. sdata->max_ratectrl_rateidx = i;
  216. if (rate->fixed)
  217. sdata->force_unicast_rateidx = i;
  218. err = 0;
  219. break;
  220. }
  221. }
  222. return err;
  223. }
  224. static int ieee80211_ioctl_giwrate(struct net_device *dev,
  225. struct iw_request_info *info,
  226. struct iw_param *rate, char *extra)
  227. {
  228. struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
  229. struct sta_info *sta;
  230. struct ieee80211_sub_if_data *sdata;
  231. struct ieee80211_supported_band *sband;
  232. sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  233. if (sdata->vif.type != NL80211_IFTYPE_STATION)
  234. return -EOPNOTSUPP;
  235. sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
  236. rcu_read_lock();
  237. sta = sta_info_get(local, sdata->u.mgd.bssid);
  238. if (sta && !(sta->last_tx_rate.flags & IEEE80211_TX_RC_MCS))
  239. rate->value = sband->bitrates[sta->last_tx_rate.idx].bitrate;
  240. else
  241. rate->value = 0;
  242. rcu_read_unlock();
  243. if (!sta)
  244. return -ENODEV;
  245. rate->value *= 100000;
  246. return 0;
  247. }
  248. static int ieee80211_ioctl_siwpower(struct net_device *dev,
  249. struct iw_request_info *info,
  250. struct iw_param *wrq,
  251. char *extra)
  252. {
  253. struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  254. struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
  255. struct ieee80211_conf *conf = &local->hw.conf;
  256. int timeout = 0;
  257. bool ps;
  258. if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS))
  259. return -EOPNOTSUPP;
  260. if (sdata->vif.type != NL80211_IFTYPE_STATION)
  261. return -EINVAL;
  262. if (wrq->disabled) {
  263. ps = false;
  264. timeout = 0;
  265. goto set;
  266. }
  267. switch (wrq->flags & IW_POWER_MODE) {
  268. case IW_POWER_ON: /* If not specified */
  269. case IW_POWER_MODE: /* If set all mask */
  270. case IW_POWER_ALL_R: /* If explicitely state all */
  271. ps = true;
  272. break;
  273. default: /* Otherwise we ignore */
  274. return -EINVAL;
  275. }
  276. if (wrq->flags & ~(IW_POWER_MODE | IW_POWER_TIMEOUT))
  277. return -EINVAL;
  278. if (wrq->flags & IW_POWER_TIMEOUT)
  279. timeout = wrq->value / 1000;
  280. set:
  281. if (ps == sdata->u.mgd.powersave && timeout == conf->dynamic_ps_timeout)
  282. return 0;
  283. sdata->u.mgd.powersave = ps;
  284. conf->dynamic_ps_timeout = timeout;
  285. if (local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_PS)
  286. ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
  287. ieee80211_recalc_ps(local, -1);
  288. return 0;
  289. }
  290. static int ieee80211_ioctl_giwpower(struct net_device *dev,
  291. struct iw_request_info *info,
  292. union iwreq_data *wrqu,
  293. char *extra)
  294. {
  295. struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  296. wrqu->power.disabled = !sdata->u.mgd.powersave;
  297. return 0;
  298. }
  299. static int ieee80211_ioctl_siwauth(struct net_device *dev,
  300. struct iw_request_info *info,
  301. struct iw_param *data, char *extra)
  302. {
  303. struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  304. int ret = 0;
  305. switch (data->flags & IW_AUTH_INDEX) {
  306. case IW_AUTH_WPA_VERSION:
  307. case IW_AUTH_CIPHER_GROUP:
  308. case IW_AUTH_WPA_ENABLED:
  309. case IW_AUTH_RX_UNENCRYPTED_EAPOL:
  310. case IW_AUTH_KEY_MGMT:
  311. case IW_AUTH_CIPHER_GROUP_MGMT:
  312. break;
  313. case IW_AUTH_CIPHER_PAIRWISE:
  314. if (sdata->vif.type == NL80211_IFTYPE_STATION) {
  315. if (data->value & (IW_AUTH_CIPHER_WEP40 |
  316. IW_AUTH_CIPHER_WEP104 | IW_AUTH_CIPHER_TKIP))
  317. sdata->u.mgd.flags |=
  318. IEEE80211_STA_TKIP_WEP_USED;
  319. else
  320. sdata->u.mgd.flags &=
  321. ~IEEE80211_STA_TKIP_WEP_USED;
  322. }
  323. break;
  324. case IW_AUTH_DROP_UNENCRYPTED:
  325. sdata->drop_unencrypted = !!data->value;
  326. break;
  327. case IW_AUTH_PRIVACY_INVOKED:
  328. if (sdata->vif.type != NL80211_IFTYPE_STATION)
  329. ret = -EINVAL;
  330. else {
  331. sdata->u.mgd.flags &= ~IEEE80211_STA_PRIVACY_INVOKED;
  332. /*
  333. * Privacy invoked by wpa_supplicant, store the
  334. * value and allow associating to a protected
  335. * network without having a key up front.
  336. */
  337. if (data->value)
  338. sdata->u.mgd.flags |=
  339. IEEE80211_STA_PRIVACY_INVOKED;
  340. }
  341. break;
  342. case IW_AUTH_80211_AUTH_ALG:
  343. if (sdata->vif.type == NL80211_IFTYPE_STATION)
  344. sdata->u.mgd.auth_algs = data->value;
  345. else
  346. ret = -EOPNOTSUPP;
  347. break;
  348. case IW_AUTH_MFP:
  349. if (!(sdata->local->hw.flags & IEEE80211_HW_MFP_CAPABLE)) {
  350. ret = -EOPNOTSUPP;
  351. break;
  352. }
  353. if (sdata->vif.type == NL80211_IFTYPE_STATION) {
  354. switch (data->value) {
  355. case IW_AUTH_MFP_DISABLED:
  356. sdata->u.mgd.mfp = IEEE80211_MFP_DISABLED;
  357. break;
  358. case IW_AUTH_MFP_OPTIONAL:
  359. sdata->u.mgd.mfp = IEEE80211_MFP_OPTIONAL;
  360. break;
  361. case IW_AUTH_MFP_REQUIRED:
  362. sdata->u.mgd.mfp = IEEE80211_MFP_REQUIRED;
  363. break;
  364. default:
  365. ret = -EINVAL;
  366. }
  367. } else
  368. ret = -EOPNOTSUPP;
  369. break;
  370. default:
  371. ret = -EOPNOTSUPP;
  372. break;
  373. }
  374. return ret;
  375. }
  376. /* Get wireless statistics. Called by /proc/net/wireless and by SIOCGIWSTATS */
  377. static struct iw_statistics *ieee80211_get_wireless_stats(struct net_device *dev)
  378. {
  379. struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
  380. struct iw_statistics *wstats = &local->wstats;
  381. struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  382. struct sta_info *sta = NULL;
  383. rcu_read_lock();
  384. if (sdata->vif.type == NL80211_IFTYPE_STATION)
  385. sta = sta_info_get(local, sdata->u.mgd.bssid);
  386. if (!sta) {
  387. wstats->discard.fragment = 0;
  388. wstats->discard.misc = 0;
  389. wstats->qual.qual = 0;
  390. wstats->qual.level = 0;
  391. wstats->qual.noise = 0;
  392. wstats->qual.updated = IW_QUAL_ALL_INVALID;
  393. } else {
  394. wstats->qual.updated = 0;
  395. /*
  396. * mirror what cfg80211 does for iwrange/scan results,
  397. * otherwise userspace gets confused.
  398. */
  399. if (local->hw.flags & (IEEE80211_HW_SIGNAL_UNSPEC |
  400. IEEE80211_HW_SIGNAL_DBM)) {
  401. wstats->qual.updated |= IW_QUAL_LEVEL_UPDATED;
  402. wstats->qual.updated |= IW_QUAL_QUAL_UPDATED;
  403. } else {
  404. wstats->qual.updated |= IW_QUAL_LEVEL_INVALID;
  405. wstats->qual.updated |= IW_QUAL_QUAL_INVALID;
  406. }
  407. if (local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC) {
  408. wstats->qual.level = sta->last_signal;
  409. wstats->qual.qual = sta->last_signal;
  410. } else if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM) {
  411. int sig = sta->last_signal;
  412. wstats->qual.updated |= IW_QUAL_DBM;
  413. wstats->qual.level = sig;
  414. if (sig < -110)
  415. sig = -110;
  416. else if (sig > -40)
  417. sig = -40;
  418. wstats->qual.qual = sig + 110;
  419. }
  420. if (local->hw.flags & IEEE80211_HW_NOISE_DBM) {
  421. /*
  422. * This assumes that if driver reports noise, it also
  423. * reports signal in dBm.
  424. */
  425. wstats->qual.noise = sta->last_noise;
  426. wstats->qual.updated |= IW_QUAL_NOISE_UPDATED;
  427. } else {
  428. wstats->qual.updated |= IW_QUAL_NOISE_INVALID;
  429. }
  430. }
  431. rcu_read_unlock();
  432. return wstats;
  433. }
  434. static int ieee80211_ioctl_giwauth(struct net_device *dev,
  435. struct iw_request_info *info,
  436. struct iw_param *data, char *extra)
  437. {
  438. struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  439. int ret = 0;
  440. switch (data->flags & IW_AUTH_INDEX) {
  441. case IW_AUTH_80211_AUTH_ALG:
  442. if (sdata->vif.type == NL80211_IFTYPE_STATION)
  443. data->value = sdata->u.mgd.auth_algs;
  444. else
  445. ret = -EOPNOTSUPP;
  446. break;
  447. default:
  448. ret = -EOPNOTSUPP;
  449. break;
  450. }
  451. return ret;
  452. }
  453. /* Structures to export the Wireless Handlers */
  454. static const iw_handler ieee80211_handler[] =
  455. {
  456. (iw_handler) NULL, /* SIOCSIWCOMMIT */
  457. (iw_handler) cfg80211_wext_giwname, /* SIOCGIWNAME */
  458. (iw_handler) NULL, /* SIOCSIWNWID */
  459. (iw_handler) NULL, /* SIOCGIWNWID */
  460. (iw_handler) ieee80211_ioctl_siwfreq, /* SIOCSIWFREQ */
  461. (iw_handler) ieee80211_ioctl_giwfreq, /* SIOCGIWFREQ */
  462. (iw_handler) cfg80211_wext_siwmode, /* SIOCSIWMODE */
  463. (iw_handler) cfg80211_wext_giwmode, /* SIOCGIWMODE */
  464. (iw_handler) NULL, /* SIOCSIWSENS */
  465. (iw_handler) NULL, /* SIOCGIWSENS */
  466. (iw_handler) NULL /* not used */, /* SIOCSIWRANGE */
  467. (iw_handler) cfg80211_wext_giwrange, /* SIOCGIWRANGE */
  468. (iw_handler) NULL /* not used */, /* SIOCSIWPRIV */
  469. (iw_handler) NULL /* kernel code */, /* SIOCGIWPRIV */
  470. (iw_handler) NULL /* not used */, /* SIOCSIWSTATS */
  471. (iw_handler) NULL /* kernel code */, /* SIOCGIWSTATS */
  472. (iw_handler) NULL, /* SIOCSIWSPY */
  473. (iw_handler) NULL, /* SIOCGIWSPY */
  474. (iw_handler) NULL, /* SIOCSIWTHRSPY */
  475. (iw_handler) NULL, /* SIOCGIWTHRSPY */
  476. (iw_handler) ieee80211_ioctl_siwap, /* SIOCSIWAP */
  477. (iw_handler) ieee80211_ioctl_giwap, /* SIOCGIWAP */
  478. (iw_handler) cfg80211_wext_siwmlme, /* SIOCSIWMLME */
  479. (iw_handler) NULL, /* SIOCGIWAPLIST */
  480. (iw_handler) cfg80211_wext_siwscan, /* SIOCSIWSCAN */
  481. (iw_handler) cfg80211_wext_giwscan, /* SIOCGIWSCAN */
  482. (iw_handler) ieee80211_ioctl_siwessid, /* SIOCSIWESSID */
  483. (iw_handler) ieee80211_ioctl_giwessid, /* SIOCGIWESSID */
  484. (iw_handler) NULL, /* SIOCSIWNICKN */
  485. (iw_handler) NULL, /* SIOCGIWNICKN */
  486. (iw_handler) NULL, /* -- hole -- */
  487. (iw_handler) NULL, /* -- hole -- */
  488. (iw_handler) ieee80211_ioctl_siwrate, /* SIOCSIWRATE */
  489. (iw_handler) ieee80211_ioctl_giwrate, /* SIOCGIWRATE */
  490. (iw_handler) cfg80211_wext_siwrts, /* SIOCSIWRTS */
  491. (iw_handler) cfg80211_wext_giwrts, /* SIOCGIWRTS */
  492. (iw_handler) cfg80211_wext_siwfrag, /* SIOCSIWFRAG */
  493. (iw_handler) cfg80211_wext_giwfrag, /* SIOCGIWFRAG */
  494. (iw_handler) cfg80211_wext_siwtxpower, /* SIOCSIWTXPOW */
  495. (iw_handler) cfg80211_wext_giwtxpower, /* SIOCGIWTXPOW */
  496. (iw_handler) cfg80211_wext_siwretry, /* SIOCSIWRETRY */
  497. (iw_handler) cfg80211_wext_giwretry, /* SIOCGIWRETRY */
  498. (iw_handler) cfg80211_wext_siwencode, /* SIOCSIWENCODE */
  499. (iw_handler) cfg80211_wext_giwencode, /* SIOCGIWENCODE */
  500. (iw_handler) ieee80211_ioctl_siwpower, /* SIOCSIWPOWER */
  501. (iw_handler) ieee80211_ioctl_giwpower, /* SIOCGIWPOWER */
  502. (iw_handler) NULL, /* -- hole -- */
  503. (iw_handler) NULL, /* -- hole -- */
  504. (iw_handler) ieee80211_ioctl_siwgenie, /* SIOCSIWGENIE */
  505. (iw_handler) NULL, /* SIOCGIWGENIE */
  506. (iw_handler) ieee80211_ioctl_siwauth, /* SIOCSIWAUTH */
  507. (iw_handler) ieee80211_ioctl_giwauth, /* SIOCGIWAUTH */
  508. (iw_handler) cfg80211_wext_siwencodeext, /* SIOCSIWENCODEEXT */
  509. (iw_handler) NULL, /* SIOCGIWENCODEEXT */
  510. (iw_handler) NULL, /* SIOCSIWPMKSA */
  511. (iw_handler) NULL, /* -- hole -- */
  512. };
  513. const struct iw_handler_def ieee80211_iw_handler_def =
  514. {
  515. .num_standard = ARRAY_SIZE(ieee80211_handler),
  516. .standard = (iw_handler *) ieee80211_handler,
  517. .get_wireless_stats = ieee80211_get_wireless_stats,
  518. };