]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
madwifi: Implement set_freq for hostapd, adjust hostapd.conf
authorPavel Roskin <proski@gnu.org>
Fri, 29 Jul 2011 17:49:45 +0000 (20:49 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 29 Jul 2011 17:51:55 +0000 (20:51 +0300)
Signed-off-by: Pavel Roskin <proski@gnu.org>
hostapd/hostapd.conf
src/drivers/driver_madwifi.c

index 3b1548c1bdd3326f19595f3a8d5e1175354a108c..cad1caf634ec8addc7991f15308645e348753540 100644 (file)
@@ -103,9 +103,8 @@ hw_mode=a
 
 # Channel number (IEEE 802.11)
 # (default: 0, i.e., not set)
-# Please note that some drivers (e.g., madwifi) do not use this value from
-# hostapd and the channel will need to be configuration separately with
-# iwconfig.
+# Please note that some drivers do not use this value from hostapd and the
+# channel will need to be configured separately with iwconfig.
 channel=60
 
 # Beacon interval in kus (1.024 ms) (default: 100; range 15..65535)
index b4abe9c1c9c6e92a93f905b3bdda64b0de5a63e7..0a855e7ff4684ac85d9d90ce0918bfb43d28ba3f 100644 (file)
@@ -806,6 +806,24 @@ madwifi_set_ap_wps_ie(void *priv, const struct wpabuf *beacon,
 #define madwifi_set_ap_wps_ie NULL
 #endif /* CONFIG_WPS */
 
+static int madwifi_set_freq(void *priv, struct hostapd_freq_params *freq)
+{
+       struct madwifi_driver_data *drv = priv;
+       struct iwreq iwr;
+
+       os_memset(&iwr, 0, sizeof(iwr));
+       os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ);
+       iwr.u.freq.m = freq->channel;
+       iwr.u.freq.e = 0;
+
+       if (ioctl(drv->ioctl_sock, SIOCSIWFREQ, &iwr) < 0) {
+               perror("ioctl[SIOCSIWFREQ]");
+               return -1;
+       }
+
+       return 0;
+}
+
 static void
 madwifi_new_sta(struct madwifi_driver_data *drv, u8 addr[IEEE80211_ADDR_LEN])
 {
@@ -1842,6 +1860,7 @@ const struct wpa_driver_ops wpa_driver_madwifi_ops = {
        .sta_clear_stats        = madwifi_sta_clear_stats,
        .commit                 = madwifi_commit,
        .set_ap_wps_ie          = madwifi_set_ap_wps_ie,
+       .set_freq               = madwifi_set_freq,
 #else /* HOSTAPD */
        .get_bssid              = wpa_driver_madwifi_get_bssid,
        .get_ssid               = wpa_driver_madwifi_get_ssid,