diff options
author | Zhu Yi <yi.zhu@intel.com> | 2006-01-19 03:21:35 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-01-27 17:08:07 -0500 |
commit | 15f385982e3a4782fe8ed71a9a6beb64a2160c30 (patch) | |
tree | d33236c0ed68d8a255c88e3e3279f876c67575c6 | |
parent | b79e20b60997e427b701055a2c69fb0c1d507aa9 (diff) |
[PATCH] ieee80211: Add helpers for IBSS DFS handling
To support IEEE 802.11h in IBSS, an ibss_dfs field is added to struct
ieee80211_network. In IBSS, if one STA sends a beacon with DFS info
(for radar detection), all the other STAs should receive and store
this DFS. All STAs should send the DFS as one of the information
element in the beacon they are scheduled to send (if possible) in
the future.
Since the ibss_dfs has variable length, it must be allocated
dynamically. ieee80211_network_reset() is added to clear the ibss_dfs
field. ieee80211_network_free() is also updated to free the ibss_dfs
field if it is not NULL.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | net/ieee80211/ieee80211_module.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c index 90d18b72da3d..5f67c684afc2 100644 --- a/net/ieee80211/ieee80211_module.c +++ b/net/ieee80211/ieee80211_module.c | |||
@@ -82,10 +82,28 @@ static int ieee80211_networks_allocate(struct ieee80211_device *ieee) | |||
82 | return 0; | 82 | return 0; |
83 | } | 83 | } |
84 | 84 | ||
85 | void ieee80211_network_reset(struct ieee80211_network *network) | ||
86 | { | ||
87 | if (!network) | ||
88 | return; | ||
89 | |||
90 | if (network->ibss_dfs) { | ||
91 | kfree(network->ibss_dfs); | ||
92 | network->ibss_dfs = NULL; | ||
93 | } | ||
94 | } | ||
95 | |||
85 | static inline void ieee80211_networks_free(struct ieee80211_device *ieee) | 96 | static inline void ieee80211_networks_free(struct ieee80211_device *ieee) |
86 | { | 97 | { |
98 | int i; | ||
99 | |||
87 | if (!ieee->networks) | 100 | if (!ieee->networks) |
88 | return; | 101 | return; |
102 | |||
103 | for (i = 0; i < MAX_NETWORK_COUNT; i++) | ||
104 | if (ieee->networks[i].ibss_dfs) | ||
105 | kfree(ieee->networks[i].ibss_dfs); | ||
106 | |||
89 | kfree(ieee->networks); | 107 | kfree(ieee->networks); |
90 | ieee->networks = NULL; | 108 | ieee->networks = NULL; |
91 | } | 109 | } |