Search Linux Wireless

[PATCH 7/8] hostap: handle interference on current channel

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

 



---
 src/ap/hostapd.c |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index a065fc9..1024d73 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -993,6 +993,34 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
 		wpa_auth_sta_associated(hapd->wpa_auth, sta->wpa_sm);
 }
 
+static void hostapd_radar_flags_cb(struct hostapd_data *hapd)
+{
+	struct hostapd_iface *iface = hapd->iface;
+	u32 flags;
+
+	iface->radar_cac_cb = NULL;
+	iface->radar_flags_cb = NULL;
+	flags = hostapd_hw_get_radar_flags(hapd, iface->conf->channel);
+	if ((flags & HOSTAPD_CHAN_RADAR_CLEAR)) {
+		hostapd_reload_bss(hapd);
+	} else if ((flags & HOSTAPD_CHAN_RADAR_INTERFERENCE)) {
+		int chan = iface->conf->channel;
+		u32 newflags;
+		iface->conf->channel = 0;
+		if (hostapd_select_random_channel(iface))
+			iface->conf->channel = chan;
+		newflags = hostapd_hw_get_radar_flags(hapd,
+						      iface->conf->channel);
+		if ((newflags & HOSTAPD_CHAN_RADAR_INTERFERENCE))
+			iface->radar_flags_cb = hostapd_radar_flags_cb;
+		else
+			hostapd_radar_flags_cb(hapd);
+	} else {
+		hostapd_channel_availability_check(hapd);
+		iface->radar_cac_cb = hostapd_radar_flags_cb;
+	}
+}
+
 void hostapd_radar_flags_changed(struct hostapd_data *hapd, int freq, u32 flags)
 {
 	struct hostapd_iface *iface = hapd->iface;
@@ -1003,4 +1031,8 @@ void hostapd_radar_flags_changed(struct hostapd_data *hapd, int freq, u32 flags)
 		iface->radar_flags_cb(hapd);
 		return;
 	}
+	if (iface->radar_cac_cb || iface->freq != freq)
+		return;
+	else if ((flags & HOSTAPD_CHAN_RADAR_INTERFERENCE))
+		hostapd_radar_flags_cb(hapd);
 }
-- 
1.5.6.5

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