HS 2.0R2: Add support for Policy/MaximumBSSLoadValue

The new credential parameter max_bss_load can be used to specify
restrictions on BSS Load in the home network.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2013-08-06 16:14:25 +03:00 committed by Jouni Malinen
parent 4cad9df15a
commit a45b2dc5dc
6 changed files with 66 additions and 2 deletions

View file

@ -237,6 +237,13 @@ Credentials can be pre-configured for automatic network selection:
# min_dl_bandwidth_roaming
# min_ul_bandwidth_roaming
#
# max_bss_load: Maximum BSS Load Channel Utilization (1..255)
# (PPS/<X+>/Policy/MaximumBSSLoadValue)
# This value is used as the maximum channel utilization for network
# selection purposes for home networks. If the AP does not advertise
# BSS Load or if the limit would prevent any connection, this constraint
# will be ignored.
#
# for example:
#
#cred={

View file

@ -2473,6 +2473,11 @@ int wpa_config_set_cred(struct wpa_cred *cred, const char *var,
return 0;
}
if (os_strcmp(var, "max_bss_load") == 0) {
cred->max_bss_load = atoi(value);
return 0;
}
val = wpa_config_parse_string(value, &len);
if (val == NULL) {
wpa_printf(MSG_ERROR, "Line %d: invalid field '%s' string "

View file

@ -256,6 +256,15 @@ struct wpa_cred {
unsigned int min_ul_bandwidth_home;
unsigned int min_dl_bandwidth_roaming;
unsigned int min_ul_bandwidth_roaming;
/**
* max_bss_load - Maximum BSS Load Channel Utilization (1..255)
* This value is used as the maximum channel utilization for network
* selection purposes for home networks. If the AP does not advertise
* BSS Load or if the limit would prevent any connection, this
* constraint will be ignored.
*/
unsigned int max_bss_load;
};

View file

@ -822,6 +822,10 @@ static void wpa_config_write_cred(FILE *f, struct wpa_cred *cred)
if (cred->min_ul_bandwidth_roaming)
fprintf(f, "\tmin_ul_bandwidth_roaming=%u\n",
cred->min_ul_bandwidth_roaming);
if (cred->max_bss_load)
fprintf(f, "\tmax_bss_load=%u\n",
cred->max_bss_load);
}

View file

@ -1131,6 +1131,28 @@ static int cred_below_min_backhaul(struct wpa_supplicant *wpa_s,
}
static int cred_over_max_bss_load(struct wpa_supplicant *wpa_s,
struct wpa_cred *cred, struct wpa_bss *bss)
{
const u8 *ie;
int res;
if (!cred->max_bss_load)
return 0; /* No BSS Load constraint specified */
ie = wpa_bss_get_ie(bss, WLAN_EID_BSS_LOAD);
if (ie == NULL || ie[1] < 3)
return 0; /* No BSS Load advertised */
res = interworking_home_sp_cred(wpa_s, cred, bss->anqp ?
bss->anqp->domain_name : NULL);
if (res <= 0)
return 0; /* Not a home network */
return ie[4] > cred->max_bss_load;
}
static struct wpa_cred * interworking_credentials_available_roaming_consortium(
struct wpa_supplicant *wpa_s, struct wpa_bss *bss, int ignore_bw)
{
@ -1164,6 +1186,8 @@ static struct wpa_cred * interworking_credentials_available_roaming_consortium(
continue;
if (!ignore_bw && cred_below_min_backhaul(wpa_s, cred, bss))
continue;
if (!ignore_bw && cred_over_max_bss_load(wpa_s, cred, bss))
continue;
if (selected == NULL ||
selected->priority < cred->priority)
@ -1656,6 +1680,9 @@ static struct wpa_cred * interworking_credentials_available_3gpp(
if (!ignore_bw &&
cred_below_min_backhaul(wpa_s, cred, bss))
continue;
if (!ignore_bw &&
cred_over_max_bss_load(wpa_s, cred, bss))
continue;
if (selected == NULL ||
selected->priority < cred->priority)
selected = cred;
@ -1703,6 +1730,9 @@ static struct wpa_cred * interworking_credentials_available_realm(
if (!ignore_bw &&
cred_below_min_backhaul(wpa_s, cred, bss))
continue;
if (!ignore_bw &&
cred_over_max_bss_load(wpa_s, cred, bss))
continue;
if (selected == NULL ||
selected->priority < cred->priority)
selected = cred;
@ -1994,10 +2024,12 @@ static void interworking_select_network(struct wpa_supplicant *wpa_s)
type = "roaming";
else
type = "unknown";
wpa_msg(wpa_s, MSG_INFO, INTERWORKING_AP MACSTR " type=%s%s",
wpa_msg(wpa_s, MSG_INFO, INTERWORKING_AP MACSTR " type=%s%s%s",
MAC2STR(bss->bssid), type,
cred_below_min_backhaul(wpa_s, cred, bss) ?
" below_min_backhaul=1" : "");
" below_min_backhaul=1" : "",
cred_over_max_bss_load(wpa_s, cred, bss) ?
" over_max_bss_load=1" : "");
if (wpa_s->auto_select ||
(wpa_s->conf->auto_interworking &&
wpa_s->auto_network_select)) {

View file

@ -456,6 +456,13 @@ fast_reauth=1
# min_dl_bandwidth_roaming
# min_ul_bandwidth_roaming
#
# max_bss_load: Maximum BSS Load Channel Utilization (1..255)
# (PPS/<X+>/Policy/MaximumBSSLoadValue)
# This value is used as the maximum channel utilization for network
# selection purposes for home networks. If the AP does not advertise
# BSS Load or if the limit would prevent any connection, this constraint
# will be ignored.
#
# for example:
#
#cred={