From 899cc14e10ff6ebf741432175c96e20719288e5e Mon Sep 17 00:00:00 2001 From: Janusz Dziedzic Date: Wed, 16 Oct 2013 18:42:57 +0300 Subject: [PATCH] hostapd: Add support for DFS with 160 MHz channel width Signed-hostap: Janusz Dziedzic --- src/ap/dfs.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/ap/dfs.c b/src/ap/dfs.c index 1c42336ae..37bbd203c 100644 --- a/src/ap/dfs.c +++ b/src/ap/dfs.c @@ -31,6 +31,9 @@ static int dfs_get_used_n_chans(struct hostapd_data *hapd) case VHT_CHANWIDTH_80MHZ: n_chans = 4; break; + case VHT_CHANWIDTH_160MHZ: + n_chans = 8; + break; default: break; } @@ -132,8 +135,11 @@ static void dfs_adjust_vht_center_freq(struct hostapd_data *hapd, case VHT_CHANWIDTH_80MHZ: hapd->iconf->vht_oper_centr_freq_seg0_idx = chan->chan + 6; break; + case VHT_CHANWIDTH_160MHZ: + hapd->iconf->vht_oper_centr_freq_seg0_idx = + chan->chan + 14; default: - wpa_printf(MSG_INFO, "DFS only VHT20/40/80 is supported now"); + wpa_printf(MSG_INFO, "DFS only VHT20/40/80/160 is supported now"); break; } @@ -163,9 +169,13 @@ static int dfs_get_start_chan_idx(struct hostapd_data *hapd) channel_no = hapd->iconf->vht_oper_centr_freq_seg0_idx - 6; break; + case VHT_CHANWIDTH_160MHZ: + channel_no = + hapd->iconf->vht_oper_centr_freq_seg0_idx - 14; + break; default: wpa_printf(MSG_INFO, - "DFS only VHT20/40/80 is supported now"); + "DFS only VHT20/40/80/160 is supported now"); channel_no = -1; break; } @@ -344,6 +354,10 @@ static int set_dfs_state(struct hostapd_data *hapd, int freq, int ht_enabled, n_chans = 4; frequency = cf1 - 30; break; + case CHAN_WIDTH_160: + n_chans = 8; + frequency = cf1 - 70; + break; default: wpa_printf(MSG_INFO, "DFS chan_width %d not supported", chan_width); @@ -394,6 +408,10 @@ static int dfs_are_channels_overlapped(struct hostapd_data *hapd, int freq, radar_n_chans = 4; frequency = cf1 - 30; break; + case CHAN_WIDTH_160: + radar_n_chans = 8; + frequency = cf1 - 70; + break; default: wpa_printf(MSG_INFO, "DFS chan_width %d not supported", chan_width);