Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 0569e468 authored by Johannes Berg's avatar Johannes Berg Committed by Peng Xu
Browse files

cfg80211: add and use strongly typed element iteration macros



Rather than always iterating elements from frames with pure
u8 pointers, add a type "struct element" that encapsulates
the id/datalen/data format of them.

Then, add the element iteration macros
 * for_each_element
 * for_each_element_id
 * for_each_element_extid

which take, as their first 'argument', such a structure and
iterate through a given u8 array interpreting it as elements.

While at it and since we'll need it, also add
 * for_each_subelement
 * for_each_subelement_id
 * for_each_subelement_extid

which instead of taking data/length just take an outer element
and use its data/datalen.

Also add for_each_element_completed() to determine if any of
the loops above completed, i.e. it was able to parse all of
the elements successfully and no data remained.

Use for_each_element_id() in cfg80211_find_ie_match() as the
first user of this.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Change-Id: Ida7a01fc82f8299b243be9634cdcc5bbd3bd8930
CRs-fixed: 2399972
Git-commit: 0f3b07f027f87a38ebe5c436490095df762819be
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git


Signed-off-by: default avatarPeng Xu <pxu@codeaurora.org>
parent aa9bff30
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment