2 net/mac80211/ieee80211.c | 5 +
3 net/mac80211/ieee80211_ioctl.c | 121 +++++++++++++++++++++++++++++++++++++++++
4 2 files changed, 126 insertions(+)
6 --- everything.orig/net/mac80211/ieee80211_ioctl.c 2007-11-07 13:06:34.902124618 +0100
7 +++ everything/net/mac80211/ieee80211_ioctl.c 2007-11-07 13:19:24.311521482 +0100
10 #include <net/mac80211.h>
11 #include "ieee80211_i.h"
12 +#include "hostapd_ioctl.h"
13 #include "ieee80211_rate.h"
16 @@ -124,6 +125,47 @@ static int ieee80211_ioctl_siwgenie(stru
21 +static int ieee80211_ioctl_priv_hostapd(struct net_device *dev,
24 + struct prism2_hostapd_param *param;
27 + if (p->length < sizeof(struct prism2_hostapd_param) ||
28 + p->length > PRISM2_HOSTAPD_MAX_BUF_SIZE || !p->pointer) {
29 + printk(KERN_DEBUG "%s: hostapd ioctl: ptr=%p len=%d min=%d "
30 + "max=%d\n", dev->name, p->pointer, p->length,
31 + (int)sizeof(struct prism2_hostapd_param),
32 + PRISM2_HOSTAPD_MAX_BUF_SIZE);
36 + param = kmalloc(p->length, GFP_KERNEL);
40 + if (copy_from_user(param, p->pointer, p->length)) {
45 + switch (param->cmd) {
51 + if (copy_to_user(p->pointer, param, p->length))
61 static int ieee80211_ioctl_giwname(struct net_device *dev,
62 struct iw_request_info *info,
63 char *name, char *extra)
64 @@ -819,6 +861,49 @@ static int ieee80211_ioctl_giwretry(stru
68 +static int ieee80211_ioctl_prism2_param(struct net_device *dev,
69 + struct iw_request_info *info,
70 + void *wrqu, char *extra)
72 + struct ieee80211_sub_if_data *sdata;
73 + int *i = (int *) extra;
77 + if (!capable(CAP_NET_ADMIN))
80 + sdata = IEEE80211_DEV_TO_SUB_IF(dev);
92 +static int ieee80211_ioctl_get_prism2_param(struct net_device *dev,
93 + struct iw_request_info *info,
94 + void *wrqu, char *extra)
96 + struct ieee80211_sub_if_data *sdata;
97 + int *param = (int *) extra;
100 + sdata = IEEE80211_DEV_TO_SUB_IF(dev);
111 static int ieee80211_ioctl_siwmlme(struct net_device *dev,
112 struct iw_request_info *info,
113 struct iw_point *data, char *extra)
114 @@ -1073,6 +1158,32 @@ static int ieee80211_ioctl_siwencodeext(
118 +static const struct iw_priv_args ieee80211_ioctl_priv[] = {
119 + { PRISM2_IOCTL_PRISM2_PARAM,
120 + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "param" },
121 + { PRISM2_IOCTL_GET_PRISM2_PARAM,
122 + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
123 + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_param" },
127 +int ieee80211_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
129 + struct iwreq *wrq = (struct iwreq *) rq;
132 + /* Private ioctls (iwpriv) that have not yet been converted
133 + * into new wireless extensions API */
134 + case PRISM2_IOCTL_HOSTAPD:
135 + if (!capable(CAP_NET_ADMIN))
137 + return ieee80211_ioctl_priv_hostapd(dev, &wrq->u.data);
139 + return -EOPNOTSUPP;
144 /* Structures to export the Wireless Handlers */
146 static const iw_handler ieee80211_handler[] =
147 @@ -1135,9 +1246,19 @@ static const iw_handler ieee80211_handle
148 (iw_handler) NULL, /* -- hole -- */
151 +static const iw_handler ieee80211_private_handler[] =
152 +{ /* SIOCIWFIRSTPRIV + */
153 + (iw_handler) ieee80211_ioctl_prism2_param, /* 0 */
154 + (iw_handler) ieee80211_ioctl_get_prism2_param, /* 1 */
157 const struct iw_handler_def ieee80211_iw_handler_def =
159 .num_standard = ARRAY_SIZE(ieee80211_handler),
160 + .num_private = ARRAY_SIZE(ieee80211_private_handler),
161 + .num_private_args = ARRAY_SIZE(ieee80211_ioctl_priv),
162 .standard = (iw_handler *) ieee80211_handler,
163 + .private = (iw_handler *) ieee80211_private_handler,
164 + .private_args = (struct iw_priv_args *) ieee80211_ioctl_priv,
165 .get_wireless_stats = ieee80211_get_wireless_stats,
167 --- everything.orig/net/mac80211/ieee80211.c 2007-11-07 13:18:36.001511500 +0100
168 +++ everything/net/mac80211/ieee80211.c 2007-11-07 13:19:24.311521482 +0100
169 @@ -413,6 +413,9 @@ static const struct header_ops ieee80211
170 .cache_update = eth_header_cache_update,
174 +extern int ieee80211_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
176 /* Must not be called for mdev */
177 void ieee80211_if_setup(struct net_device *dev)
179 @@ -425,6 +428,8 @@ void ieee80211_if_setup(struct net_devic
180 dev->open = ieee80211_open;
181 dev->stop = ieee80211_stop;
182 dev->destructor = ieee80211_if_free;
184 + dev->do_ioctl = ieee80211_ioctl;
187 /* WDS specialties */