Parcourir la source

Make channel number available to set_freq()

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.
Jouni Malinen il y a 16 ans
Parent
commit
9c6d8e1db5
3 fichiers modifiés avec 5 ajouts et 2 suppressions
  1. 1 0
      hostapd/driver.h
  2. 3 2
      hostapd/driver_i.h
  3. 1 0
      hostapd/hostapd.c

+ 1 - 0
hostapd/driver.h

@@ -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

+ 3 - 2
hostapd/driver_i.h

@@ -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);

+ 1 - 0
hostapd/hostapd.c

@@ -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 "