1 From 6522dcbbcf71abcb80cce84b93b4a9a5cfcd4fca Mon Sep 17 00:00:00 2001
2 From: Markus Theil <markus.theil@tu-ilmenau.de>
3 Date: Tue, 30 Jun 2020 13:53:22 +0200
4 Subject: [PATCH 06/19] hw_features: better debug messages for some error cases
6 Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
8 src/common/hw_features_common.c | 29 ++++++++++++++++++++++-------
9 1 file changed, 22 insertions(+), 7 deletions(-)
11 --- a/src/common/hw_features_common.c
12 +++ b/src/common/hw_features_common.c
13 @@ -540,13 +540,18 @@ int hostapd_set_freq_params(struct hosta
14 if (center_segment1 ||
15 (center_segment0 != 0 &&
16 5000 + center_segment0 * 5 != data->center_freq1 &&
17 - 2407 + center_segment0 * 5 != data->center_freq1))
18 + 2407 + center_segment0 * 5 != data->center_freq1)) {
19 + wpa_printf(MSG_ERROR, "20/40 MHz: center segment 0 (=%i) and center freq 1 (=%i) not in sync",
20 + center_segment0, data->center_freq1);
24 case CHANWIDTH_80P80MHZ:
25 if (center_segment1 == center_segment0 + 4 ||
26 - center_segment1 == center_segment0 - 4)
27 + center_segment1 == center_segment0 - 4) {
28 + wpa_printf(MSG_ERROR, "80+80 MHz: center segment 1 only 20 MHz apart");
31 data->center_freq2 = 5000 + center_segment1 * 5;
34 @@ -555,8 +560,10 @@ int hostapd_set_freq_params(struct hosta
36 (oper_chwidth == CHANWIDTH_80P80MHZ &&
38 - !sec_channel_offset)
39 + !sec_channel_offset) {
40 + wpa_printf(MSG_ERROR, "80/80+80 MHz: center segment 1 wrong or no second channel offset");
43 if (!center_segment0) {
46 @@ -582,16 +589,22 @@ int hostapd_set_freq_params(struct hosta
47 center_segment0 == channel - 2 ||
48 center_segment0 == channel - 6)
49 data->center_freq1 = 5000 + center_segment0 * 5;
52 + wpa_printf(MSG_ERROR, "Wrong coupling between HT and VHT/HE channel setting");
57 case CHANWIDTH_160MHZ:
58 data->bandwidth = 160;
59 - if (center_segment1)
60 + if (center_segment1) {
61 + wpa_printf(MSG_ERROR, "160 MHz: center segment 1 should not be set");
63 - if (!sec_channel_offset)
65 + if (!sec_channel_offset) {
66 + wpa_printf(MSG_ERROR, "160 MHz: second channel offset not set");
70 * Note: HT/VHT config and params are coupled. Check if
71 * HT40 channel band is in VHT160 channel band configuration.
72 @@ -605,8 +618,10 @@ int hostapd_set_freq_params(struct hosta
73 center_segment0 == channel - 10 ||
74 center_segment0 == channel - 14)
75 data->center_freq1 = 5000 + center_segment0 * 5;
78 + wpa_printf(MSG_ERROR, "160 MHz: HT40 channel band is not in 160 MHz band");