cfg80211: assimilate and export ieee80211_bss_get_ie

This function from mac80211 seems generally useful, and
I will need it in cfg80211 soon.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Johannes Berg
2009-07-02 17:18:40 +02:00
committed by John W. Linville
parent 0eb14647fc
commit 517357c685
3 changed files with 33 additions and 22 deletions

View File

@ -502,3 +502,24 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb)
return dscp >> 5;
}
EXPORT_SYMBOL(cfg80211_classify8021d);
const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie)
{
u8 *end, *pos;
pos = bss->information_elements;
if (pos == NULL)
return NULL;
end = pos + bss->len_information_elements;
while (pos + 1 < end) {
if (pos + 2 + pos[1] > end)
break;
if (pos[0] == ie)
return pos;
pos += 2 + pos[1];
}
return NULL;
}
EXPORT_SYMBOL(ieee80211_bss_get_ie);