2007-08-14 11:51:08

by Johannes Berg

[permalink] [raw]
Subject: [PATCH 2/4] hostapd: use SIOCSIWGENIE

Use SIOCSIWGENIE instead of PRISM2_HOSTAPD_SET_GENERIC_INFO_ELEM.

Signed-off-by: Johannes Berg <[email protected]>

---
hostapd/driver_devicescape.c | 26 +++++++++-----------------
1 file changed, 9 insertions(+), 17 deletions(-)

--- hostap.orig/hostapd/driver_devicescape.c 2007-08-14 11:32:34.000000000 +0200
+++ hostap/hostapd/driver_devicescape.c 2007-08-14 11:32:35.000000000 +0200
@@ -694,28 +694,20 @@ static int i802_set_generic_elem(const c
const u8 *elem, size_t elem_len)
{
struct i802_driver_data *drv = priv;
- struct prism2_hostapd_param *param;
- u8 *buf;
- size_t blen;
- int ret = 0;
+ struct iwreq iwr;

- blen = sizeof(*param) + elem_len;
- buf = os_zalloc(blen);
- if (buf == NULL)
- return -1;
+ memset(&iwr, 0, sizeof(iwr));

- param = (struct prism2_hostapd_param *) buf;
- param->cmd = PRISM2_HOSTAPD_SET_GENERIC_INFO_ELEM;
- param->u.set_generic_info_elem.len = elem_len;
- memcpy(param->u.set_generic_info_elem.data, elem, elem_len);
+ os_strlcpy(iwr.ifr_name, drv->hapd->conf->iface, IFNAMSIZ);
+ iwr.u.data.length = elem_len;
+ iwr.u.data.pointer = (void*)elem;

- if (hostapd_ioctl_iface(ifname, drv, param, blen)) {
- printf("%s: Failed to set generic info element\n", drv->iface);
- ret = -1;
+ if (ioctl(drv->ioctl_sock, SIOCSIWGENIE, &iwr) < 0) {
+ perror("Failed to set generic info element");
+ return -1;
}
- free(buf);

- return ret;
+ return 0;
}



--



2007-08-15 03:52:50

by Jouni Malinen

[permalink] [raw]
Subject: Re: [PATCH 2/4] hostapd: use SIOCSIWGENIE

On Tue, Aug 14, 2007 at 11:32:56AM +0200, Johannes Berg wrote:
> Use SIOCSIWGENIE instead of PRISM2_HOSTAPD_SET_GENERIC_INFO_ELEM.

Thanks, applied.

--
Jouni Malinen PGP id EFC895FA