Make channel number available to set_freq()
authorJouni Malinen <jouni.malinen@atheros.com>
Mon, 30 Mar 2009 14:55:37 +0000 (17:55 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 30 Mar 2009 14:55:37 +0000 (17:55 +0300)
Since we have the channel number, we could as well pass it to the driver
wrapper should there be drivers that use channel number instead of
frequency.

hostapd/driver.h
hostapd/driver_i.h
hostapd/hostapd.c

index 6db7d37..f695da1 100644 (file)
@@ -47,6 +47,7 @@ struct hostapd_sta_add_params {
 struct hostapd_freq_params {
        int mode;
        int freq;
+       int channel;
        int ht_enabled;
        int sec_channel_offset; /* 0 = HT40 disabled, -1 = HT40 enabled,
                                 * secondary channel below primary, 1 = HT40
index fcf08f0..a38f2ab 100644 (file)
@@ -242,8 +242,8 @@ hostapd_get_inact_sec(struct hostapd_data *hapd, const u8 *addr)
 }
 
 static inline int
-hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq, int ht_enabled,
-                int sec_channel_offset)
+hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq, int channel,
+                int ht_enabled, int sec_channel_offset)
 {
        struct hostapd_freq_params data;
        if (hapd->driver == NULL)
@@ -253,6 +253,7 @@ hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq, int ht_enabled,
        os_memset(&data, 0, sizeof(data));
        data.mode = mode;
        data.freq = freq;
+       data.channel = channel;
        data.ht_enabled = ht_enabled;
        data.sec_channel_offset = sec_channel_offset;
        return hapd->driver->set_freq(hapd->drv_priv, &data);
index aa43eac..f227242 100644 (file)
@@ -1391,6 +1391,7 @@ static int setup_interface(struct hostapd_iface *iface)
                           hapd->iconf->channel, freq);
 
                if (hostapd_set_freq(hapd, hapd->iconf->hw_mode, freq,
+                                    hapd->iconf->channel,
                                     hapd->iconf->ieee80211n,
                                     hapd->iconf->secondary_channel)) {
                        wpa_printf(MSG_ERROR, "Could not set channel for "