nl80211: rework internal_flags usage
authorJohannes Berg <johannes.berg@intel.com>
Thu, 14 Apr 2022 12:04:03 +0000 (14:04 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 4 May 2022 10:31:57 +0000 (12:31 +0200)
commit2182db91e0016ca2b451426290c3b368ba9f6fdc
tree3cd74a22e1370ade922aec48c648422e3201d885
parent1b550a0bebfc0b69d6ec08fe6eb58953a8aec48a
nl80211: rework internal_flags usage

Since internal_flags is only 8 bits, we can only have one
more internal flag. However, we can obviously never use all
of possible the combinations, in fact, we only use 14 of
them (including no flags).

Since we want more flags for MLO (multi-link operation) in
the future, refactor the code to use a flags selector, so
wrap all of the .internal_flags assignments in a IFLAGS()
macro which selects the combination according to the pre-
defined list of combinations.

When we need a new combination, we'll have to add it, but
again we will never use all possible combinations.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20220414140402.70ddf8af3eb0.I2cc38cb6a10bb4c3863ec9ee97edbcc70a07aa4b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c