wext.c 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * Intel Wireless Multicomm 3200 WiFi driver
  3. *
  4. * Copyright (C) 2009 Intel Corporation <ilw@linux.intel.com>
  5. * Samuel Ortiz <samuel.ortiz@intel.com>
  6. * Zhu Yi <yi.zhu@intel.com>
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License version
  10. * 2 as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  20. * 02110-1301, USA.
  21. *
  22. */
  23. #include <linux/wireless.h>
  24. #include <net/cfg80211.h>
  25. #include "iwm.h"
  26. #include "commands.h"
  27. static int iwm_wext_siwessid(struct net_device *dev,
  28. struct iw_request_info *info,
  29. struct iw_point *data, char *ssid)
  30. {
  31. struct iwm_priv *iwm = ndev_to_iwm(dev);
  32. switch (iwm->conf.mode) {
  33. case UMAC_MODE_IBSS:
  34. return cfg80211_ibss_wext_siwessid(dev, info, data, ssid);
  35. case UMAC_MODE_BSS:
  36. return cfg80211_mgd_wext_siwessid(dev, info, data, ssid);
  37. default:
  38. return -EOPNOTSUPP;
  39. }
  40. }
  41. static int iwm_wext_giwessid(struct net_device *dev,
  42. struct iw_request_info *info,
  43. struct iw_point *data, char *ssid)
  44. {
  45. struct iwm_priv *iwm = ndev_to_iwm(dev);
  46. switch (iwm->conf.mode) {
  47. case UMAC_MODE_IBSS:
  48. return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);
  49. case UMAC_MODE_BSS:
  50. return cfg80211_mgd_wext_giwessid(dev, info, data, ssid);
  51. default:
  52. return -EOPNOTSUPP;
  53. }
  54. }
  55. static const iw_handler iwm_handlers[] =
  56. {
  57. (iw_handler) NULL, /* SIOCSIWCOMMIT */
  58. (iw_handler) cfg80211_wext_giwname, /* SIOCGIWNAME */
  59. (iw_handler) NULL, /* SIOCSIWNWID */
  60. (iw_handler) NULL, /* SIOCGIWNWID */
  61. (iw_handler) cfg80211_wext_siwfreq, /* SIOCSIWFREQ */
  62. (iw_handler) cfg80211_wext_giwfreq, /* SIOCGIWFREQ */
  63. (iw_handler) cfg80211_wext_siwmode, /* SIOCSIWMODE */
  64. (iw_handler) cfg80211_wext_giwmode, /* SIOCGIWMODE */
  65. (iw_handler) NULL, /* SIOCSIWSENS */
  66. (iw_handler) NULL, /* SIOCGIWSENS */
  67. (iw_handler) NULL /* not used */, /* SIOCSIWRANGE */
  68. (iw_handler) cfg80211_wext_giwrange, /* SIOCGIWRANGE */
  69. (iw_handler) NULL /* not used */, /* SIOCSIWPRIV */
  70. (iw_handler) NULL /* kernel code */, /* SIOCGIWPRIV */
  71. (iw_handler) NULL /* not used */, /* SIOCSIWSTATS */
  72. (iw_handler) NULL /* kernel code */, /* SIOCGIWSTATS */
  73. (iw_handler) NULL, /* SIOCSIWSPY */
  74. (iw_handler) NULL, /* SIOCGIWSPY */
  75. (iw_handler) NULL, /* SIOCSIWTHRSPY */
  76. (iw_handler) NULL, /* SIOCGIWTHRSPY */
  77. (iw_handler) cfg80211_wext_siwap, /* SIOCSIWAP */
  78. (iw_handler) cfg80211_wext_giwap, /* SIOCGIWAP */
  79. (iw_handler) NULL, /* SIOCSIWMLME */
  80. (iw_handler) NULL, /* SIOCGIWAPLIST */
  81. (iw_handler) cfg80211_wext_siwscan, /* SIOCSIWSCAN */
  82. (iw_handler) cfg80211_wext_giwscan, /* SIOCGIWSCAN */
  83. (iw_handler) iwm_wext_siwessid, /* SIOCSIWESSID */
  84. (iw_handler) iwm_wext_giwessid, /* SIOCGIWESSID */
  85. (iw_handler) NULL, /* SIOCSIWNICKN */
  86. (iw_handler) NULL, /* SIOCGIWNICKN */
  87. (iw_handler) NULL, /* -- hole -- */
  88. (iw_handler) NULL, /* -- hole -- */
  89. (iw_handler) NULL, /* SIOCSIWRATE */
  90. (iw_handler) cfg80211_wext_giwrate, /* SIOCGIWRATE */
  91. (iw_handler) cfg80211_wext_siwrts, /* SIOCSIWRTS */
  92. (iw_handler) cfg80211_wext_giwrts, /* SIOCGIWRTS */
  93. (iw_handler) cfg80211_wext_siwfrag, /* SIOCSIWFRAG */
  94. (iw_handler) cfg80211_wext_giwfrag, /* SIOCGIWFRAG */
  95. (iw_handler) cfg80211_wext_siwtxpower, /* SIOCSIWTXPOW */
  96. (iw_handler) cfg80211_wext_giwtxpower, /* SIOCGIWTXPOW */
  97. (iw_handler) NULL, /* SIOCSIWRETRY */
  98. (iw_handler) NULL, /* SIOCGIWRETRY */
  99. (iw_handler) cfg80211_wext_siwencode, /* SIOCSIWENCODE */
  100. (iw_handler) cfg80211_wext_giwencode, /* SIOCGIWENCODE */
  101. (iw_handler) cfg80211_wext_siwpower, /* SIOCSIWPOWER */
  102. (iw_handler) cfg80211_wext_giwpower, /* SIOCGIWPOWER */
  103. (iw_handler) NULL, /* -- hole -- */
  104. (iw_handler) NULL, /* -- hole -- */
  105. (iw_handler) cfg80211_wext_siwgenie, /* SIOCSIWGENIE */
  106. (iw_handler) NULL, /* SIOCGIWGENIE */
  107. (iw_handler) cfg80211_wext_siwauth, /* SIOCSIWAUTH */
  108. (iw_handler) cfg80211_wext_giwauth, /* SIOCGIWAUTH */
  109. (iw_handler) cfg80211_wext_siwencodeext, /* SIOCSIWENCODEEXT */
  110. (iw_handler) NULL, /* SIOCGIWENCODEEXT */
  111. (iw_handler) NULL, /* SIOCSIWPMKSA */
  112. (iw_handler) NULL, /* -- hole -- */
  113. };
  114. const struct iw_handler_def iwm_iw_handler_def = {
  115. .num_standard = ARRAY_SIZE(iwm_handlers),
  116. .standard = (iw_handler *) iwm_handlers,
  117. .get_wireless_stats = cfg80211_wireless_stats,
  118. };