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

Skip to content
Commit d7dad550 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Johannes Berg
Browse files

iwlwifi: mvm: fix first_antenna



first_antenna is supposed to return the first antenna as a
0-based bitmap: ANT_A is BIT(0), ANT_B is BIT(1), etc...
Since ffs is 1 based (ffs(BIT(0)) = 1), then we had an
off-by-one bug:
BIT(ffs(ANT_A)) = BIT(ffs(BIT(0))) = BIT(1) = ANT_B.
So what we really want is:
BIT(ffs(ANT_A) - 1) = BIT(ffs(BIT(0)) - 1) = BIT(0) = ANT_A.

Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 178bdb57
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