]> nv-tegra.nvidia Code Review - linux-2.6.git/blob - drivers/net/wireless/iwmc3200wifi/wext.c
cfg80211: combine IWAP handlers
[linux-2.6.git] / drivers / net / wireless / iwmc3200wifi / wext.c
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
24 #include <linux/wireless.h>
25 #include <net/cfg80211.h>
26
27 #include "iwm.h"
28 #include "commands.h"
29
30 static int iwm_wext_siwessid(struct net_device *dev,
31                              struct iw_request_info *info,
32                              struct iw_point *data, char *ssid)
33 {
34         struct iwm_priv *iwm = ndev_to_iwm(dev);
35
36         switch (iwm->conf.mode) {
37         case UMAC_MODE_IBSS:
38                 return cfg80211_ibss_wext_siwessid(dev, info, data, ssid);
39         case UMAC_MODE_BSS:
40                 return cfg80211_mgd_wext_siwessid(dev, info, data, ssid);
41         default:
42                 return -EOPNOTSUPP;
43         }
44 }
45
46 static int iwm_wext_giwessid(struct net_device *dev,
47                              struct iw_request_info *info,
48                              struct iw_point *data, char *ssid)
49 {
50         struct iwm_priv *iwm = ndev_to_iwm(dev);
51
52         switch (iwm->conf.mode) {
53         case UMAC_MODE_IBSS:
54                 return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);
55         case UMAC_MODE_BSS:
56                 return cfg80211_mgd_wext_giwessid(dev, info, data, ssid);
57         default:
58                 return -EOPNOTSUPP;
59         }
60 }
61
62 static const iw_handler iwm_handlers[] =
63 {
64         (iw_handler) NULL,                              /* SIOCSIWCOMMIT */
65         (iw_handler) cfg80211_wext_giwname,             /* SIOCGIWNAME */
66         (iw_handler) NULL,                              /* SIOCSIWNWID */
67         (iw_handler) NULL,                              /* SIOCGIWNWID */
68         (iw_handler) cfg80211_wext_siwfreq,             /* SIOCSIWFREQ */
69         (iw_handler) cfg80211_wext_giwfreq,             /* SIOCGIWFREQ */
70         (iw_handler) cfg80211_wext_siwmode,             /* SIOCSIWMODE */
71         (iw_handler) cfg80211_wext_giwmode,             /* SIOCGIWMODE */
72         (iw_handler) NULL,                              /* SIOCSIWSENS */
73         (iw_handler) NULL,                              /* SIOCGIWSENS */
74         (iw_handler) NULL /* not used */,               /* SIOCSIWRANGE */
75         (iw_handler) cfg80211_wext_giwrange,            /* SIOCGIWRANGE */
76         (iw_handler) NULL /* not used */,               /* SIOCSIWPRIV */
77         (iw_handler) NULL /* kernel code */,            /* SIOCGIWPRIV */
78         (iw_handler) NULL /* not used */,               /* SIOCSIWSTATS */
79         (iw_handler) NULL /* kernel code */,            /* SIOCGIWSTATS */
80         (iw_handler) NULL,                              /* SIOCSIWSPY */
81         (iw_handler) NULL,                              /* SIOCGIWSPY */
82         (iw_handler) NULL,                              /* SIOCSIWTHRSPY */
83         (iw_handler) NULL,                              /* SIOCGIWTHRSPY */
84         (iw_handler) cfg80211_wext_siwap,               /* SIOCSIWAP */
85         (iw_handler) cfg80211_wext_giwap,               /* SIOCGIWAP */
86         (iw_handler) NULL,                              /* SIOCSIWMLME */
87         (iw_handler) NULL,                              /* SIOCGIWAPLIST */
88         (iw_handler) cfg80211_wext_siwscan,             /* SIOCSIWSCAN */
89         (iw_handler) cfg80211_wext_giwscan,             /* SIOCGIWSCAN */
90         (iw_handler) iwm_wext_siwessid,                 /* SIOCSIWESSID */
91         (iw_handler) iwm_wext_giwessid,                 /* SIOCGIWESSID */
92         (iw_handler) NULL,                              /* SIOCSIWNICKN */
93         (iw_handler) NULL,                              /* SIOCGIWNICKN */
94         (iw_handler) NULL,                              /* -- hole -- */
95         (iw_handler) NULL,                              /* -- hole -- */
96         (iw_handler) NULL,                              /* SIOCSIWRATE */
97         (iw_handler) cfg80211_wext_giwrate,             /* SIOCGIWRATE */
98         (iw_handler) cfg80211_wext_siwrts,              /* SIOCSIWRTS */
99         (iw_handler) cfg80211_wext_giwrts,              /* SIOCGIWRTS */
100         (iw_handler) cfg80211_wext_siwfrag,             /* SIOCSIWFRAG */
101         (iw_handler) cfg80211_wext_giwfrag,             /* SIOCGIWFRAG */
102         (iw_handler) cfg80211_wext_siwtxpower,          /* SIOCSIWTXPOW */
103         (iw_handler) cfg80211_wext_giwtxpower,          /* SIOCGIWTXPOW */
104         (iw_handler) NULL,                              /* SIOCSIWRETRY */
105         (iw_handler) NULL,                              /* SIOCGIWRETRY */
106         (iw_handler) cfg80211_wext_siwencode,           /* SIOCSIWENCODE */
107         (iw_handler) cfg80211_wext_giwencode,           /* SIOCGIWENCODE */
108         (iw_handler) cfg80211_wext_siwpower,            /* SIOCSIWPOWER */
109         (iw_handler) cfg80211_wext_giwpower,            /* SIOCGIWPOWER */
110         (iw_handler) NULL,                              /* -- hole -- */
111         (iw_handler) NULL,                              /* -- hole -- */
112         (iw_handler) cfg80211_wext_siwgenie,            /* SIOCSIWGENIE */
113         (iw_handler) NULL,                              /* SIOCGIWGENIE */
114         (iw_handler) cfg80211_wext_siwauth,             /* SIOCSIWAUTH */
115         (iw_handler) cfg80211_wext_giwauth,             /* SIOCGIWAUTH */
116         (iw_handler) cfg80211_wext_siwencodeext,        /* SIOCSIWENCODEEXT */
117         (iw_handler) NULL,                              /* SIOCGIWENCODEEXT */
118         (iw_handler) NULL,                              /* SIOCSIWPMKSA */
119         (iw_handler) NULL,                              /* -- hole -- */
120 };
121
122 const struct iw_handler_def iwm_iw_handler_def = {
123         .num_standard   = ARRAY_SIZE(iwm_handlers),
124         .standard       = (iw_handler *) iwm_handlers,
125         .get_wireless_stats = cfg80211_wireless_stats,
126 };
127