From f295d0c86a232e9e21dd56dbf30d74ded13a9880 Mon Sep 17 00:00:00 2001 From: Simon Wunderlich Date: Thu, 9 May 2013 19:58:55 +0300 Subject: [PATCH] nl80211: Add driver capability flag for radar detection 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 Cc: Victor Goldenshtein Signed-hostap: Simon Wunderlich --- src/drivers/driver.h | 2 ++ src/drivers/driver_nl80211.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 016b697d2..30a90c0b9 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -866,6 +866,8 @@ struct wpa_driver_capa { #define WPA_DRIVER_FLAGS_OBSS_SCAN 0x04000000 /* Driver supports IBSS (Ad-hoc) mode */ #define WPA_DRIVER_FLAGS_IBSS 0x08000000 +/* Driver supports radar detection */ +#define WPA_DRIVER_FLAGS_RADAR 0x10000000 unsigned int flags; int max_scan_ssids; diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 0a1cac6e7..a28086c99 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -2680,6 +2680,7 @@ static int wiphy_info_iface_comb_process(struct wiphy_info_data *info, [NL80211_IFACE_COMB_MAXNUM] = { .type = NLA_U32 }, [NL80211_IFACE_COMB_STA_AP_BI_MATCH] = { .type = NLA_FLAG }, [NL80211_IFACE_COMB_NUM_CHANNELS] = { .type = NLA_U32 }, + [NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS] = { .type = NLA_U32 }, }, iface_limit_policy[NUM_NL80211_IFACE_LIMIT] = { [NL80211_IFACE_LIMIT_TYPES] = { .type = NLA_NESTED }, @@ -2693,6 +2694,9 @@ static int wiphy_info_iface_comb_process(struct wiphy_info_data *info, !tb_comb[NL80211_IFACE_COMB_NUM_CHANNELS]) return 0; /* broken combination */ + if (tb_comb[NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS]) + info->capa->flags |= WPA_DRIVER_FLAGS_RADAR; + nla_for_each_nested(nl_limit, tb_comb[NL80211_IFACE_COMB_LIMITS], rem_limit) { err = nla_parse_nested(tb_limit, MAX_NL80211_IFACE_LIMIT,