nl80211: Add channel flags for DFS state information
This patch is based on the original work by Boris Presman and Victor Goldenshtein. Channel Switch Announcement support has been removed and event handling as well as channel set handling was changed, among various other changes. Cc: Boris Presman <boris.presman@ti.com> Cc: Victor Goldenshtein <victorg@ti.com> Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
This commit is contained in:
parent
f295d0c86a
commit
fc96522eb9
2 changed files with 23 additions and 0 deletions
|
@ -29,6 +29,12 @@
|
|||
#define HOSTAPD_CHAN_HT40MINUS 0x00000020
|
||||
#define HOSTAPD_CHAN_HT40 0x00000040
|
||||
|
||||
#define HOSTAPD_CHAN_DFS_UNKNOWN 0x00000000
|
||||
#define HOSTAPD_CHAN_DFS_USABLE 0x00000100
|
||||
#define HOSTAPD_CHAN_DFS_UNAVAILABLE 0x00000200
|
||||
#define HOSTAPD_CHAN_DFS_AVAILABLE 0x00000300
|
||||
#define HOSTAPD_CHAN_DFS_MASK 0x00000300
|
||||
|
||||
/**
|
||||
* struct hostapd_channel_data - Channel information
|
||||
*/
|
||||
|
|
|
@ -5162,6 +5162,22 @@ static void phy_info_freq(struct hostapd_hw_modes *mode,
|
|||
!tb_freq[NL80211_FREQUENCY_ATTR_DISABLED])
|
||||
chan->max_tx_power = nla_get_u32(
|
||||
tb_freq[NL80211_FREQUENCY_ATTR_MAX_TX_POWER]) / 100;
|
||||
if (tb_freq[NL80211_FREQUENCY_ATTR_DFS_STATE]) {
|
||||
enum nl80211_dfs_state state =
|
||||
nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_DFS_STATE]);
|
||||
|
||||
switch (state) {
|
||||
case NL80211_DFS_USABLE:
|
||||
chan->flag |= HOSTAPD_CHAN_DFS_USABLE;
|
||||
break;
|
||||
case NL80211_DFS_AVAILABLE:
|
||||
chan->flag |= HOSTAPD_CHAN_DFS_AVAILABLE;
|
||||
break;
|
||||
case NL80211_DFS_UNAVAILABLE:
|
||||
chan->flag |= HOSTAPD_CHAN_DFS_UNAVAILABLE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -5175,6 +5191,7 @@ static int phy_info_freqs(struct phy_info_arg *phy_info,
|
|||
[NL80211_FREQUENCY_ATTR_NO_IBSS] = { .type = NLA_FLAG },
|
||||
[NL80211_FREQUENCY_ATTR_RADAR] = { .type = NLA_FLAG },
|
||||
[NL80211_FREQUENCY_ATTR_MAX_TX_POWER] = { .type = NLA_U32 },
|
||||
[NL80211_FREQUENCY_ATTR_DFS_STATE] = { .type = NLA_U32 },
|
||||
};
|
||||
int new_channels = 0;
|
||||
struct hostapd_channel_data *channel;
|
||||
|
|
Loading…
Reference in a new issue