338-v5.0-0002-brcmutil-print-invalid-chanspec-when-WARN-ing.patch 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. On one of my devices I got WARNINGs when brcmfmac tried to decode
  9. chanspec. I couldn't tell if it was some unsupported format or just a
  10. malformed value passed by a firmware.
  11. Print chanspec value so it's possible to debug a possible problem.
  12. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
  13. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  14. ---
  15. drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c | 14 +++++++-------
  16. 1 file changed, 7 insertions(+), 7 deletions(-)
  17. --- a/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c
  18. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c
  19. @@ -128,7 +128,7 @@ static void brcmu_d11n_decchspec(struct
  20. }
  21. break;
  22. default:
  23. - WARN_ON_ONCE(1);
  24. + WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
  25. break;
  26. }
  27. @@ -140,7 +140,7 @@ static void brcmu_d11n_decchspec(struct
  28. ch->band = BRCMU_CHAN_BAND_2G;
  29. break;
  30. default:
  31. - WARN_ON_ONCE(1);
  32. + WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
  33. break;
  34. }
  35. }
  36. @@ -167,7 +167,7 @@ static void brcmu_d11ac_decchspec(struct
  37. ch->sb = BRCMU_CHAN_SB_U;
  38. ch->control_ch_num += CH_10MHZ_APART;
  39. } else {
  40. - WARN_ON_ONCE(1);
  41. + WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
  42. }
  43. break;
  44. case BRCMU_CHSPEC_D11AC_BW_80:
  45. @@ -188,7 +188,7 @@ static void brcmu_d11ac_decchspec(struct
  46. ch->control_ch_num += CH_30MHZ_APART;
  47. break;
  48. default:
  49. - WARN_ON_ONCE(1);
  50. + WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
  51. break;
  52. }
  53. break;
  54. @@ -222,13 +222,13 @@ static void brcmu_d11ac_decchspec(struct
  55. ch->control_ch_num += CH_70MHZ_APART;
  56. break;
  57. default:
  58. - WARN_ON_ONCE(1);
  59. + WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
  60. break;
  61. }
  62. break;
  63. case BRCMU_CHSPEC_D11AC_BW_8080:
  64. default:
  65. - WARN_ON_ONCE(1);
  66. + WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
  67. break;
  68. }
  69. @@ -240,7 +240,7 @@ static void brcmu_d11ac_decchspec(struct
  70. ch->band = BRCMU_CHAN_BAND_2G;
  71. break;
  72. default:
  73. - WARN_ON_ONCE(1);
  74. + WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
  75. break;
  76. }
  77. }