From: Johannes Berg <johannes@sipsolutions.net>
To: Jouni Malinen <j@w1.fi>
Cc: linux-wireless <linux-wireless@vger.kernel.org>
Subject: [PATCH 2/4] hostapd: use SIOCSIWGENIE
Date: Tue, 14 Aug 2007 11:32:56 +0200 [thread overview]
Message-ID: <20070814093409.132987000@sipsolutions.net> (raw)
In-Reply-To: 20070814093254.021041000@sipsolutions.net
Use SIOCSIWGENIE instead of PRISM2_HOSTAPD_SET_GENERIC_INFO_ELEM.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
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;
}
--
next prev parent reply other threads:[~2007-08-14 11:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-14 9:32 [PATCH 0/4] hostapd cleanups Johannes Berg
2007-08-14 9:32 ` [PATCH 1/4] hostapd: remove enable/disable calls Johannes Berg
2007-08-15 3:49 ` Jouni Malinen
2007-08-14 9:32 ` Johannes Berg [this message]
2007-08-15 3:51 ` [PATCH 2/4] hostapd: use SIOCSIWGENIE Jouni Malinen
2007-08-14 9:32 ` [PATCH 3/4] hostapd: use nl80211 for add/remove iface Johannes Berg
2007-08-14 9:32 ` [PATCH 4/4] hostapd: remove PRISM2_PARAM_NEXT_MODE Johannes Berg
2007-08-15 2:41 ` Jouni Malinen
2007-08-15 7:29 ` Tomas Winkler
2007-08-15 10:56 ` Johannes Berg
2007-08-15 10:44 ` Johannes Berg
2007-08-16 1:38 ` Jouni Malinen
2007-08-16 13:22 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070814093409.132987000@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=j@w1.fi \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).