Commit ae5848cb authored by Rafał Miłecki's avatar Rafał Miłecki Committed by Kalle Valo

brcmutil: print invalid chanspec when WARN-ing

On one of my devices I got WARNINGs when brcmfmac tried to decode
chanspec. I couldn't tell if it was some unsupported format or just a
malformed value passed by a firmware.

Print chanspec value so it's possible to debug a possible problem.
Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 3d39e1bb
...@@ -128,7 +128,7 @@ static void brcmu_d11n_decchspec(struct brcmu_chan *ch) ...@@ -128,7 +128,7 @@ static void brcmu_d11n_decchspec(struct brcmu_chan *ch)
} }
break; break;
default: default:
WARN_ON_ONCE(1); WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
break; break;
} }
...@@ -140,7 +140,7 @@ static void brcmu_d11n_decchspec(struct brcmu_chan *ch) ...@@ -140,7 +140,7 @@ static void brcmu_d11n_decchspec(struct brcmu_chan *ch)
ch->band = BRCMU_CHAN_BAND_2G; ch->band = BRCMU_CHAN_BAND_2G;
break; break;
default: default:
WARN_ON_ONCE(1); WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
break; break;
} }
} }
...@@ -167,7 +167,7 @@ static void brcmu_d11ac_decchspec(struct brcmu_chan *ch) ...@@ -167,7 +167,7 @@ static void brcmu_d11ac_decchspec(struct brcmu_chan *ch)
ch->sb = BRCMU_CHAN_SB_U; ch->sb = BRCMU_CHAN_SB_U;
ch->control_ch_num += CH_10MHZ_APART; ch->control_ch_num += CH_10MHZ_APART;
} else { } else {
WARN_ON_ONCE(1); WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
} }
break; break;
case BRCMU_CHSPEC_D11AC_BW_80: case BRCMU_CHSPEC_D11AC_BW_80:
...@@ -188,7 +188,7 @@ static void brcmu_d11ac_decchspec(struct brcmu_chan *ch) ...@@ -188,7 +188,7 @@ static void brcmu_d11ac_decchspec(struct brcmu_chan *ch)
ch->control_ch_num += CH_30MHZ_APART; ch->control_ch_num += CH_30MHZ_APART;
break; break;
default: default:
WARN_ON_ONCE(1); WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
break; break;
} }
break; break;
...@@ -219,13 +219,13 @@ static void brcmu_d11ac_decchspec(struct brcmu_chan *ch) ...@@ -219,13 +219,13 @@ static void brcmu_d11ac_decchspec(struct brcmu_chan *ch)
ch->control_ch_num += CH_70MHZ_APART; ch->control_ch_num += CH_70MHZ_APART;
break; break;
default: default:
WARN_ON_ONCE(1); WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
break; break;
} }
break; break;
case BRCMU_CHSPEC_D11AC_BW_8080: case BRCMU_CHSPEC_D11AC_BW_8080:
default: default:
WARN_ON_ONCE(1); WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
break; break;
} }
...@@ -237,7 +237,7 @@ static void brcmu_d11ac_decchspec(struct brcmu_chan *ch) ...@@ -237,7 +237,7 @@ static void brcmu_d11ac_decchspec(struct brcmu_chan *ch)
ch->band = BRCMU_CHAN_BAND_2G; ch->band = BRCMU_CHAN_BAND_2G;
break; break;
default: default:
WARN_ON_ONCE(1); WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec);
break; break;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment