566336cbc3285c9930ee90c98ce86370159c82ac
[oweals/openwrt.git] /
1 From ae5848cb4511bbbfe0306fcdbe5d9a95cd9546a9 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Fri, 26 Oct 2018 13:22:32 +0200
4 Subject: [PATCH] brcmutil: print invalid chanspec when WARN-ing
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 On one of my devices I got WARNINGs when brcmfmac tried to decode
10 chanspec. I couldn't tell if it was some unsupported format or just a
11 malformed value passed by a firmware.
12
13 Print chanspec value so it's possible to debug a possible problem.
14
15 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
16 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
17 ---
18  drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c | 14 +++++++-------
19  1 file changed, 7 insertions(+), 7 deletions(-)
20
21 --- a/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c
22 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c
23 @@ -128,7 +128,7 @@ static void brcmu_d11n_decchspec(struct
24                 }
25                 break;
26         default:
27 -               WARN_ON_ONCE(1);
28 +               WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
29                 break;
30         }
31  
32 @@ -140,7 +140,7 @@ static void brcmu_d11n_decchspec(struct
33                 ch->band = BRCMU_CHAN_BAND_2G;
34                 break;
35         default:
36 -               WARN_ON_ONCE(1);
37 +               WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
38                 break;
39         }
40  }
41 @@ -167,7 +167,7 @@ static void brcmu_d11ac_decchspec(struct
42                         ch->sb = BRCMU_CHAN_SB_U;
43                         ch->control_ch_num += CH_10MHZ_APART;
44                 } else {
45 -                       WARN_ON_ONCE(1);
46 +                       WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
47                 }
48                 break;
49         case BRCMU_CHSPEC_D11AC_BW_80:
50 @@ -188,7 +188,7 @@ static void brcmu_d11ac_decchspec(struct
51                         ch->control_ch_num += CH_30MHZ_APART;
52                         break;
53                 default:
54 -                       WARN_ON_ONCE(1);
55 +                       WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
56                         break;
57                 }
58                 break;
59 @@ -222,13 +222,13 @@ static void brcmu_d11ac_decchspec(struct
60                         ch->control_ch_num += CH_70MHZ_APART;
61                         break;
62                 default:
63 -                       WARN_ON_ONCE(1);
64 +                       WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
65                         break;
66                 }
67                 break;
68         case BRCMU_CHSPEC_D11AC_BW_8080:
69         default:
70 -               WARN_ON_ONCE(1);
71 +               WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
72                 break;
73         }
74  
75 @@ -240,7 +240,7 @@ static void brcmu_d11ac_decchspec(struct
76                 ch->band = BRCMU_CHAN_BAND_2G;
77                 break;
78         default:
79 -               WARN_ON_ONCE(1);
80 +               WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
81                 break;
82         }
83  }