Better messages when channel cannot be used in AP mode
Log messages letting user know that the channel cannot be used because it is flagged unusable. Signed-off-by: Ben Greear <greearb@candelatech.com>
This commit is contained in:
parent
5dcfb6830e
commit
60eda5e47d
2 changed files with 15 additions and 9 deletions
|
@ -603,7 +603,7 @@ int hostapd_check_ht_capab(struct hostapd_iface *iface)
|
||||||
/**
|
/**
|
||||||
* hostapd_select_hw_mode - Select the hardware mode
|
* hostapd_select_hw_mode - Select the hardware mode
|
||||||
* @iface: Pointer to interface data.
|
* @iface: Pointer to interface data.
|
||||||
* Returns: 0 on success, -1 on failure
|
* Returns: 0 on success, < 0 on failure
|
||||||
*
|
*
|
||||||
* Sets up the hardware mode, channel, rates, and passive scanning
|
* Sets up the hardware mode, channel, rates, and passive scanning
|
||||||
* based on the configuration.
|
* based on the configuration.
|
||||||
|
@ -631,17 +631,23 @@ int hostapd_select_hw_mode(struct hostapd_iface *iface)
|
||||||
HOSTAPD_LEVEL_WARNING,
|
HOSTAPD_LEVEL_WARNING,
|
||||||
"Hardware does not support configured mode "
|
"Hardware does not support configured mode "
|
||||||
"(%d)", (int) iface->conf->hw_mode);
|
"(%d)", (int) iface->conf->hw_mode);
|
||||||
return -1;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
ok = 0;
|
ok = 0;
|
||||||
for (j = 0; j < iface->current_mode->num_channels; j++) {
|
for (j = 0; j < iface->current_mode->num_channels; j++) {
|
||||||
struct hostapd_channel_data *chan =
|
struct hostapd_channel_data *chan =
|
||||||
&iface->current_mode->channels[j];
|
&iface->current_mode->channels[j];
|
||||||
if (!(chan->flag & HOSTAPD_CHAN_DISABLED) &&
|
if (chan->chan == iface->conf->channel) {
|
||||||
(chan->chan == iface->conf->channel)) {
|
if (chan->flag & HOSTAPD_CHAN_DISABLED) {
|
||||||
ok = 1;
|
wpa_printf(MSG_ERROR,
|
||||||
break;
|
"channel [%i] (%i) is disabled for "
|
||||||
|
"use in AP mode, flags: 0x%x",
|
||||||
|
j, chan->chan, chan->flag);
|
||||||
|
} else {
|
||||||
|
ok = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ok && iface->conf->secondary_channel) {
|
if (ok && iface->conf->secondary_channel) {
|
||||||
|
@ -675,7 +681,7 @@ int hostapd_select_hw_mode(struct hostapd_iface *iface)
|
||||||
* the channel automatically */
|
* the channel automatically */
|
||||||
wpa_printf(MSG_ERROR, "Channel not configured "
|
wpa_printf(MSG_ERROR, "Channel not configured "
|
||||||
"(hw_mode/channel in hostapd.conf)");
|
"(hw_mode/channel in hostapd.conf)");
|
||||||
return -1;
|
return -3;
|
||||||
}
|
}
|
||||||
if (ok == 0 && iface->conf->channel != 0) {
|
if (ok == 0 && iface->conf->channel != 0) {
|
||||||
hostapd_logger(iface->bss[0], NULL,
|
hostapd_logger(iface->bss[0], NULL,
|
||||||
|
@ -693,7 +699,7 @@ int hostapd_select_hw_mode(struct hostapd_iface *iface)
|
||||||
hostapd_logger(iface->bss[0], NULL, HOSTAPD_MODULE_IEEE80211,
|
hostapd_logger(iface->bss[0], NULL, HOSTAPD_MODULE_IEEE80211,
|
||||||
HOSTAPD_LEVEL_WARNING,
|
HOSTAPD_LEVEL_WARNING,
|
||||||
"Hardware does not support configured channel");
|
"Hardware does not support configured channel");
|
||||||
return -1;
|
return -4;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -41,7 +41,7 @@ static inline int hostapd_get_hw_features(struct hostapd_iface *iface)
|
||||||
|
|
||||||
static inline int hostapd_select_hw_mode(struct hostapd_iface *iface)
|
static inline int hostapd_select_hw_mode(struct hostapd_iface *iface)
|
||||||
{
|
{
|
||||||
return -1;
|
return -100;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline const char * hostapd_hw_mode_txt(int mode)
|
static inline const char * hostapd_hw_mode_txt(int mode)
|
||||||
|
|
Loading…
Reference in a new issue