aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-03-31 09:36:22 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-04-07 07:56:41 -0400
commit29464ccc78f1e8f77b8c37ddbe95af46d13c2ec2 (patch)
treef5cc33762959fb5346b111e4123160a928691e90 /net/mac80211/util.c
parentba8c3d6f16a1f9305c23ac1d2fd3992508c5ac03 (diff)
cfg80211: move IE split utilities here from mac80211
As the next patch will require the IE splitting utility functions in cfg80211, move them there from mac80211. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 482b85c19a36..79412f16b61d 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2194,46 +2194,6 @@ void ieee80211_recalc_min_chandef(struct ieee80211_sub_if_data *sdata)
2194 mutex_unlock(&local->chanctx_mtx); 2194 mutex_unlock(&local->chanctx_mtx);
2195} 2195}
2196 2196
2197static bool ieee80211_id_in_list(const u8 *ids, int n_ids, u8 id)
2198{
2199 int i;
2200
2201 for (i = 0; i < n_ids; i++)
2202 if (ids[i] == id)
2203 return true;
2204 return false;
2205}
2206
2207size_t ieee80211_ie_split_ric(const u8 *ies, size_t ielen,
2208 const u8 *ids, int n_ids,
2209 const u8 *after_ric, int n_after_ric,
2210 size_t offset)
2211{
2212 size_t pos = offset;
2213
2214 while (pos < ielen && ieee80211_id_in_list(ids, n_ids, ies[pos])) {
2215 if (ies[pos] == WLAN_EID_RIC_DATA && n_after_ric) {
2216 pos += 2 + ies[pos + 1];
2217
2218 while (pos < ielen &&
2219 !ieee80211_id_in_list(after_ric, n_after_ric,
2220 ies[pos]))
2221 pos += 2 + ies[pos + 1];
2222 } else {
2223 pos += 2 + ies[pos + 1];
2224 }
2225 }
2226
2227 return pos;
2228}
2229
2230size_t ieee80211_ie_split(const u8 *ies, size_t ielen,
2231 const u8 *ids, int n_ids, size_t offset)
2232{
2233 return ieee80211_ie_split_ric(ies, ielen, ids, n_ids, NULL, 0, offset);
2234}
2235EXPORT_SYMBOL(ieee80211_ie_split);
2236
2237size_t ieee80211_ie_split_vendor(const u8 *ies, size_t ielen, size_t offset) 2197size_t ieee80211_ie_split_vendor(const u8 *ies, size_t ielen, size_t offset)
2238{ 2198{
2239 size_t pos = offset; 2199 size_t pos = offset;