ACS: Extend interference factor calculation for all modes
This is preparation for being able to support hw_mode=any to select the best channel from any supported mode. Signed-off-by: Neo Jou <neojou@gmail.com>
This commit is contained in:
parent
070522e5b2
commit
f3c44a196f
1 changed files with 18 additions and 4 deletions
22
src/ap/acs.c
22
src/ap/acs.c
|
@ -512,14 +512,14 @@ static int is_in_chanlist(struct hostapd_iface *iface,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void acs_survey_all_chans_interference_factor(
|
static void acs_survey_mode_interference_factor(
|
||||||
struct hostapd_iface *iface)
|
struct hostapd_iface *iface, struct hostapd_hw_modes *mode)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct hostapd_channel_data *chan;
|
struct hostapd_channel_data *chan;
|
||||||
|
|
||||||
for (i = 0; i < iface->current_mode->num_channels; i++) {
|
for (i = 0; i < mode->num_channels; i++) {
|
||||||
chan = &iface->current_mode->channels[i];
|
chan = &mode->channels[i];
|
||||||
|
|
||||||
if (!acs_usable_chan(chan))
|
if (!acs_usable_chan(chan))
|
||||||
continue;
|
continue;
|
||||||
|
@ -538,6 +538,20 @@ static void acs_survey_all_chans_interference_factor(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void acs_survey_all_chans_interference_factor(
|
||||||
|
struct hostapd_iface *iface)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
struct hostapd_hw_modes *mode;
|
||||||
|
|
||||||
|
for (i = 0; i < iface->num_hw_features; i++) {
|
||||||
|
mode = &iface->hw_features[i];
|
||||||
|
if (!hostapd_hw_skip_mode(iface, mode))
|
||||||
|
acs_survey_mode_interference_factor(iface, mode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static struct hostapd_channel_data *
|
static struct hostapd_channel_data *
|
||||||
acs_find_chan_mode(struct hostapd_hw_modes *mode, int freq)
|
acs_find_chan_mode(struct hostapd_hw_modes *mode, int freq)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue