wext.c 18 KB

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