[PATCH] FreeBSD: Enable channel control

Masashi Honma honma
Tue Feb 9 18:25:06 PST 2010


This patch enables FreeBSD channel control.

This is a patch to
http://lists.shmoo.com/pipermail/hostap/2010-February/021083.html

I have tested on FreeBSD 7.2 with these cases.

[hostapd]
RSN-PSK(CCMP)/WPA-PSK(TKIP)

[wpa_supplicant(STA)]
RSN-PSK(CCMP)/WPA-PSK(TKIP)

[wpa_supplicant(AP)]
RSN-PSK(CCMP)/WPA-PSK(TKIP)


--- driver_bsd.c.bak	2010-02-10 02:23:50.000000000 +0900
+++ driver_bsd.c	2010-02-10 02:23:40.000000000 +0900
@@ -537,6 +537,7 @@
 	struct bsd_driver_data *drv = priv;
 #ifdef SIOCS80211CHANNEL
 	struct ieee80211chanreq creq;
+#endif /* SIOCS80211CHANNEL */
 	u32 mode;
 
 	if (channel < 14)
@@ -551,15 +552,14 @@
 		return -1;
 	}
 
+#ifdef SIOCS80211CHANNEL
 	os_memset(&creq, 0, sizeof(creq));
 	os_strlcpy(creq.i_name, drv->ifname, sizeof(creq.i_name));
 	creq.i_channel = channel;
 	return ioctl(drv->sock, SIOCS80211CHANNEL, &creq);
-#else
-	wpa_printf(MSG_ERROR, "bsd_set_freq: SIOCS80211CHANNEL not "
-		   "defined");
-	return -1;
-#endif
+#else /* SIOCS80211CHANNEL */
+	return set80211param(priv, IEEE80211_IOC_CHANNEL, channel);
+#endif /* SIOCS80211CHANNEL */
 }
 
 

Regards,
Masashi Honma.



More information about the Hostap mailing list