Search Linux Wireless

[PATCH 2/4] hostapd: use SIOCSIWGENIE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use SIOCSIWGENIE instead of PRISM2_HOSTAPD_SET_GENERIC_INFO_ELEM.

Signed-off-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>

---
 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;
 }
 
 

-- 

-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux