2009-05-21 21:20:45 +08:00
|
|
|
/*
|
|
|
|
* Intel Wireless Multicomm 3200 WiFi driver
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009 Intel Corporation <ilw@linux.intel.com>
|
|
|
|
* Samuel Ortiz <samuel.ortiz@intel.com>
|
|
|
|
* Zhu Yi <yi.zhu@intel.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License version
|
|
|
|
* 2 as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
* 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/wireless.h>
|
|
|
|
#include <net/cfg80211.h>
|
|
|
|
|
|
|
|
#include "iwm.h"
|
|
|
|
#include "commands.h"
|
|
|
|
|
|
|
|
static int iwm_wext_siwfreq(struct net_device *dev,
|
|
|
|
struct iw_request_info *info,
|
|
|
|
struct iw_freq *freq, char *extra)
|
|
|
|
{
|
|
|
|
struct iwm_priv *iwm = ndev_to_iwm(dev);
|
|
|
|
|
2009-07-16 17:34:10 +08:00
|
|
|
switch (iwm->conf.mode) {
|
|
|
|
case UMAC_MODE_IBSS:
|
|
|
|
return cfg80211_ibss_wext_siwfreq(dev, info, freq, extra);
|
|
|
|
default:
|
2009-05-21 21:20:45 +08:00
|
|
|
return -EOPNOTSUPP;
|
2009-07-16 17:34:10 +08:00
|
|
|
}
|
2009-05-21 21:20:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static int iwm_wext_giwfreq(struct net_device *dev,
|
|
|
|
struct iw_request_info *info,
|
|
|
|
struct iw_freq *freq, char *extra)
|
|
|
|
{
|
|
|
|
struct iwm_priv *iwm = ndev_to_iwm(dev);
|
|
|
|
|
2009-07-16 17:34:10 +08:00
|
|
|
switch (iwm->conf.mode) {
|
|
|
|
case UMAC_MODE_IBSS:
|
2009-05-21 21:20:45 +08:00
|
|
|
return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
|
2009-07-16 17:34:10 +08:00
|
|
|
case UMAC_MODE_BSS:
|
|
|
|
return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra);
|
|
|
|
default:
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
2009-05-21 21:20:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static int iwm_wext_siwap(struct net_device *dev, struct iw_request_info *info,
|
|
|
|
struct sockaddr *ap_addr, char *extra)
|
|
|
|
{
|
|
|
|
struct iwm_priv *iwm = ndev_to_iwm(dev);
|
2009-06-16 03:59:52 +08:00
|
|
|
|
2009-07-16 17:34:10 +08:00
|
|
|
switch (iwm->conf.mode) {
|
|
|
|
case UMAC_MODE_IBSS:
|
2009-05-21 21:20:45 +08:00
|
|
|
return cfg80211_ibss_wext_siwap(dev, info, ap_addr, extra);
|
2009-07-16 17:34:10 +08:00
|
|
|
case UMAC_MODE_BSS:
|
|
|
|
return cfg80211_mgd_wext_siwap(dev, info, ap_addr, extra);
|
|
|
|
default:
|
|
|
|
return -EOPNOTSUPP;
|
2009-05-21 21:20:45 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int iwm_wext_giwap(struct net_device *dev, struct iw_request_info *info,
|
|
|
|
struct sockaddr *ap_addr, char *extra)
|
|
|
|
{
|
|
|
|
struct iwm_priv *iwm = ndev_to_iwm(dev);
|
|
|
|
|
|
|
|
switch (iwm->conf.mode) {
|
|
|
|
case UMAC_MODE_IBSS:
|
|
|
|
return cfg80211_ibss_wext_giwap(dev, info, ap_addr, extra);
|
|
|
|
case UMAC_MODE_BSS:
|
2009-07-16 17:34:10 +08:00
|
|
|
return cfg80211_mgd_wext_giwap(dev, info, ap_addr, extra);
|
2009-05-21 21:20:45 +08:00
|
|
|
default:
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int iwm_wext_siwessid(struct net_device *dev,
|
|
|
|
struct iw_request_info *info,
|
|
|
|
struct iw_point *data, char *ssid)
|
|
|
|
{
|
|
|
|
struct iwm_priv *iwm = ndev_to_iwm(dev);
|
2009-06-16 03:59:52 +08:00
|
|
|
|
2009-07-16 17:34:10 +08:00
|
|
|
switch (iwm->conf.mode) {
|
|
|
|
case UMAC_MODE_IBSS:
|
2009-05-21 21:20:45 +08:00
|
|
|
return cfg80211_ibss_wext_siwessid(dev, info, data, ssid);
|
2009-07-16 17:34:10 +08:00
|
|
|
case UMAC_MODE_BSS:
|
|
|
|
return cfg80211_mgd_wext_siwessid(dev, info, data, ssid);
|
|
|
|
default:
|
|
|
|
return -EOPNOTSUPP;
|
2009-05-21 21:20:45 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int iwm_wext_giwessid(struct net_device *dev,
|
|
|
|
struct iw_request_info *info,
|
|
|
|
struct iw_point *data, char *ssid)
|
|
|
|
{
|
|
|
|
struct iwm_priv *iwm = ndev_to_iwm(dev);
|
|
|
|
|
2009-07-16 17:34:10 +08:00
|
|
|
switch (iwm->conf.mode) {
|
|
|
|
case UMAC_MODE_IBSS:
|
2009-05-21 21:20:45 +08:00
|
|
|
return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);
|
2009-07-16 17:34:10 +08:00
|
|
|
case UMAC_MODE_BSS:
|
|
|
|
return cfg80211_mgd_wext_giwessid(dev, info, data, ssid);
|
2009-05-21 21:20:45 +08:00
|
|
|
default:
|
2009-07-16 17:34:10 +08:00
|
|
|
return -EOPNOTSUPP;
|
2009-05-21 21:20:45 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static const iw_handler iwm_handlers[] =
|
|
|
|
{
|
|
|
|
(iw_handler) NULL, /* SIOCSIWCOMMIT */
|
|
|
|
(iw_handler) cfg80211_wext_giwname, /* SIOCGIWNAME */
|
|
|
|
(iw_handler) NULL, /* SIOCSIWNWID */
|
|
|
|
(iw_handler) NULL, /* SIOCGIWNWID */
|
|
|
|
(iw_handler) iwm_wext_siwfreq, /* SIOCSIWFREQ */
|
|
|
|
(iw_handler) iwm_wext_giwfreq, /* SIOCGIWFREQ */
|
|
|
|
(iw_handler) cfg80211_wext_siwmode, /* SIOCSIWMODE */
|
|
|
|
(iw_handler) cfg80211_wext_giwmode, /* SIOCGIWMODE */
|
|
|
|
(iw_handler) NULL, /* SIOCSIWSENS */
|
|
|
|
(iw_handler) NULL, /* SIOCGIWSENS */
|
|
|
|
(iw_handler) NULL /* not used */, /* SIOCSIWRANGE */
|
|
|
|
(iw_handler) cfg80211_wext_giwrange, /* SIOCGIWRANGE */
|
|
|
|
(iw_handler) NULL /* not used */, /* SIOCSIWPRIV */
|
|
|
|
(iw_handler) NULL /* kernel code */, /* SIOCGIWPRIV */
|
|
|
|
(iw_handler) NULL /* not used */, /* SIOCSIWSTATS */
|
|
|
|
(iw_handler) NULL /* kernel code */, /* SIOCGIWSTATS */
|
|
|
|
(iw_handler) NULL, /* SIOCSIWSPY */
|
|
|
|
(iw_handler) NULL, /* SIOCGIWSPY */
|
|
|
|
(iw_handler) NULL, /* SIOCSIWTHRSPY */
|
|
|
|
(iw_handler) NULL, /* SIOCGIWTHRSPY */
|
|
|
|
(iw_handler) iwm_wext_siwap, /* SIOCSIWAP */
|
|
|
|
(iw_handler) iwm_wext_giwap, /* SIOCGIWAP */
|
|
|
|
(iw_handler) NULL, /* SIOCSIWMLME */
|
|
|
|
(iw_handler) NULL, /* SIOCGIWAPLIST */
|
|
|
|
(iw_handler) cfg80211_wext_siwscan, /* SIOCSIWSCAN */
|
|
|
|
(iw_handler) cfg80211_wext_giwscan, /* SIOCGIWSCAN */
|
|
|
|
(iw_handler) iwm_wext_siwessid, /* SIOCSIWESSID */
|
|
|
|
(iw_handler) iwm_wext_giwessid, /* SIOCGIWESSID */
|
|
|
|
(iw_handler) NULL, /* SIOCSIWNICKN */
|
|
|
|
(iw_handler) NULL, /* SIOCGIWNICKN */
|
|
|
|
(iw_handler) NULL, /* -- hole -- */
|
|
|
|
(iw_handler) NULL, /* -- hole -- */
|
|
|
|
(iw_handler) NULL, /* SIOCSIWRATE */
|
2009-07-16 17:34:10 +08:00
|
|
|
(iw_handler) cfg80211_wext_giwrate, /* SIOCGIWRATE */
|
2009-05-21 21:20:45 +08:00
|
|
|
(iw_handler) cfg80211_wext_siwrts, /* SIOCSIWRTS */
|
|
|
|
(iw_handler) cfg80211_wext_giwrts, /* SIOCGIWRTS */
|
|
|
|
(iw_handler) cfg80211_wext_siwfrag, /* SIOCSIWFRAG */
|
|
|
|
(iw_handler) cfg80211_wext_giwfrag, /* SIOCGIWFRAG */
|
2009-06-16 03:59:56 +08:00
|
|
|
(iw_handler) cfg80211_wext_siwtxpower, /* SIOCSIWTXPOW */
|
|
|
|
(iw_handler) cfg80211_wext_giwtxpower, /* SIOCGIWTXPOW */
|
2009-05-21 21:20:45 +08:00
|
|
|
(iw_handler) NULL, /* SIOCSIWRETRY */
|
|
|
|
(iw_handler) NULL, /* SIOCGIWRETRY */
|
2009-06-16 03:59:52 +08:00
|
|
|
(iw_handler) cfg80211_wext_siwencode, /* SIOCSIWENCODE */
|
|
|
|
(iw_handler) cfg80211_wext_giwencode, /* SIOCGIWENCODE */
|
2009-07-02 03:26:57 +08:00
|
|
|
(iw_handler) cfg80211_wext_siwpower, /* SIOCSIWPOWER */
|
|
|
|
(iw_handler) cfg80211_wext_giwpower, /* SIOCGIWPOWER */
|
2009-05-21 21:20:45 +08:00
|
|
|
(iw_handler) NULL, /* -- hole -- */
|
|
|
|
(iw_handler) NULL, /* -- hole -- */
|
2009-07-16 17:34:10 +08:00
|
|
|
(iw_handler) cfg80211_wext_siwgenie, /* SIOCSIWGENIE */
|
2009-05-21 21:20:45 +08:00
|
|
|
(iw_handler) NULL, /* SIOCGIWGENIE */
|
2009-07-16 17:34:10 +08:00
|
|
|
(iw_handler) cfg80211_wext_siwauth, /* SIOCSIWAUTH */
|
|
|
|
(iw_handler) cfg80211_wext_giwauth, /* SIOCGIWAUTH */
|
2009-06-16 03:59:52 +08:00
|
|
|
(iw_handler) cfg80211_wext_siwencodeext, /* SIOCSIWENCODEEXT */
|
2009-05-21 21:20:45 +08:00
|
|
|
(iw_handler) NULL, /* SIOCGIWENCODEEXT */
|
|
|
|
(iw_handler) NULL, /* SIOCSIWPMKSA */
|
|
|
|
(iw_handler) NULL, /* -- hole -- */
|
|
|
|
};
|
|
|
|
|
|
|
|
const struct iw_handler_def iwm_iw_handler_def = {
|
|
|
|
.num_standard = ARRAY_SIZE(iwm_handlers),
|
|
|
|
.standard = (iw_handler *) iwm_handlers,
|
2009-07-16 17:34:10 +08:00
|
|
|
.get_wireless_stats = cfg80211_wireless_stats,
|
2009-05-21 21:20:45 +08:00
|
|
|
};
|
|
|
|
|