]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Add channel flags for DFS state information
authorSimon Wunderlich <siwu@hrz.tu-chemnitz.de>
Thu, 9 May 2013 17:02:57 +0000 (20:02 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 9 May 2013 17:02:57 +0000 (20:02 +0300)
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>

src/drivers/driver.h
src/drivers/driver_nl80211.c

index 30a90c0b9ba16e7d18f50f81c68ebc5bb8dfa111..9b39e7e3d06e820dcebf9558950b73e26bfdfeaf 100644 (file)
 #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
  */
index a28086c995f0d53a7bacddc5ebdb0c2c5a31d98d..11140f9cd38509ca819cd0288afc2f755e53ec76 100644 (file)
@@ -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;