]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
More specific set_freq_params debug prints for 80/80+80 MHz errors
authorJouni Malinen <j@w1.fi>
Sat, 6 Mar 2021 22:54:36 +0000 (00:54 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 6 Mar 2021 22:54:36 +0000 (00:54 +0200)
It is more convenient to see the exact error in the debug log instead of
getting noted that something was invalid.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/common/hw_features_common.c

index b8b886fa14750449ffebb0a512b3a39a925d6163..ad2aebfef5b540328a5e35246a9fa4344fb83ba2 100644 (file)
@@ -572,13 +572,19 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
                /* fall through */
        case CHANWIDTH_80MHZ:
                data->bandwidth = 80;
-               if ((oper_chwidth == CHANWIDTH_80MHZ &&
-                    center_segment1) ||
-                   (oper_chwidth == CHANWIDTH_80P80MHZ &&
-                    !center_segment1) ||
-                   !sec_channel_offset) {
+               if (!sec_channel_offset) {
+                       wpa_printf(MSG_ERROR,
+                                  "80/80+80 MHz: no second channel offset");
+                       return -1;
+               }
+               if (oper_chwidth == CHANWIDTH_80MHZ && center_segment1) {
+                       wpa_printf(MSG_ERROR,
+                                  "80 MHz: center segment 1 configured");
+                       return -1;
+               }
+               if (oper_chwidth == CHANWIDTH_80P80MHZ && !center_segment1) {
                        wpa_printf(MSG_ERROR,
-                                  "80/80+80 MHz: center segment 1 wrong or no second channel offset");
+                                  "80+80 MHz: center segment 1 not configured");
                        return -1;
                }
                if (!center_segment0) {