From e45e898970e29f5f21e2815a2c75714129d7ae20 Mon Sep 17 00:00:00 2001 From: Thomas Pedersen Date: Mon, 1 Sep 2014 00:23:26 -0400 Subject: [PATCH] mesh: Add user_mpm config option Add user_mpm config parameter, when this is set to 1 (the default) the peer link management is done on userspace, otherwise the peer management will be done by the kernel. Signed-off-by: Javier Lopez Signed-off-by: Jason Mobarak Signed-off-by: Thomas Pedersen --- wpa_supplicant/config.c | 4 ++++ wpa_supplicant/config.h | 11 +++++++++++ wpa_supplicant/config_file.c | 3 +++ wpa_supplicant/wpa_supplicant.conf | 9 +++++++++ 4 files changed, 27 insertions(+) diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index 45a346a96..99c518756 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -3310,6 +3310,7 @@ struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface, return NULL; config->eapol_version = DEFAULT_EAPOL_VERSION; config->ap_scan = DEFAULT_AP_SCAN; + config->user_mpm = DEFAULT_USER_MPM; config->fast_reauth = DEFAULT_FAST_REAUTH; config->p2p_go_intent = DEFAULT_P2P_GO_INTENT; config->p2p_intra_bss = DEFAULT_P2P_INTRA_BSS; @@ -3856,6 +3857,9 @@ static const struct global_parse_data global_fields[] = { #endif /* CONFIG_MACSEC */ { INT(ap_scan), 0 }, { FUNC(bgscan), 0 }, +#ifdef CONFIG_MESH + { INT(user_mpm), 0 }, +#endif /* CONFIG_MESH */ { INT(disable_scan_offload), 0 }, { INT(fast_reauth), 0 }, { STR(opensc_engine_path), 0 }, diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h index ba6e2d926..2c3d6f5b6 100644 --- a/wpa_supplicant/config.h +++ b/wpa_supplicant/config.h @@ -15,6 +15,7 @@ #else /* CONFIG_NO_SCAN_PROCESSING */ #define DEFAULT_AP_SCAN 1 #endif /* CONFIG_NO_SCAN_PROCESSING */ +#define DEFAULT_USER_MPM 1 #define DEFAULT_FAST_REAUTH 1 #define DEFAULT_P2P_GO_INTENT 7 #define DEFAULT_P2P_INTRA_BSS 1 @@ -1100,6 +1101,16 @@ struct wpa_config { * rekeying operation. */ int key_mgmt_offload; + + /** + * user_mpm - MPM residency + * + * 0: MPM lives in driver. + * 1: wpa_supplicant handles peering and station allocation. + * + * If AMPE or SAE is enabled, the MPM is always in userspace. + */ + int user_mpm; }; diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c index 1661f88c0..d58707eea 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -1195,6 +1195,9 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config) if (config->key_mgmt_offload != DEFAULT_KEY_MGMT_OFFLOAD) fprintf(f, "key_mgmt_offload=%u\n", config->key_mgmt_offload); + + if (config->user_mpm != DEFAULT_USER_MPM) + fprintf(f, "user_mpm=%d\n", config->user_mpm); } #endif /* CONFIG_NO_CONFIG_WRITE */ diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf index 9f5ad536a..0e8a28a55 100644 --- a/wpa_supplicant/wpa_supplicant.conf +++ b/wpa_supplicant/wpa_supplicant.conf @@ -114,6 +114,15 @@ eapol_version=1 # networks are found, a new IBSS or AP mode network is created. ap_scan=1 +# MPM residency +# By default, wpa_supplicant implements the mesh peering manager (MPM) for an +# open mesh. However, if the driver can implement the MPM, you may set this to +# 0 to use the driver version. When AMPE is enabled, the wpa_supplicant MPM is +# always used. +# 0: MPM lives in the driver +# 1: wpa_supplicant provides an MPM which handles peering (default) +#user_mpm=1 + # EAP fast re-authentication # By default, fast re-authentication is enabled for all EAP methods that # support it. This variable can be used to disable fast re-authentication.