blob: 6f97d621e7ca536ec7032d3f5c8475d63caf146b [file] [log] [blame]
developer66e89bc2024-04-23 14:50:01 +08001From c4743bbc1b1953bdc035b871ea1899ca94c1c6ac Mon Sep 17 00:00:00 2001
2From: Jaewan Kim <jaewan@google.com>
3Date: Tue, 10 Jan 2023 00:14:55 +0900
4Subject: [PATCH 03/28] iw: info: fix bug reading preambles and bandwidths
5
6Preambles and bandwidths values are considered as bit shifts
7when they're are used for capabilities.
8
9Signed-off-by: Jaewan Kim <jaewan@google.com>
10Link: https://lore.kernel.org/r/20230109151455.325793-1-jaewan@google.com
11Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12---
13 info.c | 4 ++--
14 1 file changed, 2 insertions(+), 2 deletions(-)
15
16diff --git a/info.c b/info.c
17index eb257f8..5229d44 100644
18--- a/info.c
19+++ b/info.c
20@@ -197,7 +197,7 @@ static void __print_ftm_capability(struct nlattr *ftm_capa)
21 if (tb[NL80211_PMSR_FTM_CAPA_ATTR_PREAMBLES]) {
22 #define PRINT_PREAMBLE(P, V) \
23 do { \
24- if (P | NL80211_PREAMBLE_##V) \
25+ if (P & BIT(NL80211_PREAMBLE_##V)) \
26 printf(" " #V); \
27 } while (0)
28
29@@ -215,7 +215,7 @@ static void __print_ftm_capability(struct nlattr *ftm_capa)
30 if (tb[NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS]) {
31 #define PRINT_BANDWIDTH(B, V) \
32 do { \
33- if (B | NL80211_CHAN_WIDTH_##V) \
34+ if (B & BIT(NL80211_CHAN_WIDTH_##V)) \
35 printf(" " #V); \
36 } while (0)
37
38--
392.39.2
40