From af4467131728a60366f50f3121c31fc59f51b74f Mon Sep 17 00:00:00 2001 From: Pankaj Singh Date: Fri, 24 Jul 2020 16:55:20 +0530 Subject: [PATCH] qcacld-3.0: Extend Tdls external mode config support Current implementation of external mode requires supplicant to send tdls peer mac address. On matching of stats tdls implict link procedure is trigger for configured peer. Fix, to allow both configured peer and other peer that supports tdls to establish the tdls link. Change-Id: I8f65e6dcc9dec565623ac2d8d2c77e12570f8bfb CRs-Fixed: 2733830 --- .../tdls/core/src/wlan_tdls_cmds_process.c | 16 +++++++++++-- .../tdls/dispatcher/inc/wlan_tdls_cfg.h | 23 +++++++++++++------ .../dispatcher/inc/wlan_tdls_public_structs.h | 15 +++++++++--- .../tdls/dispatcher/src/wlan_tdls_ucfg_api.c | 8 +++++-- 4 files changed, 48 insertions(+), 14 deletions(-) diff --git a/components/tdls/core/src/wlan_tdls_cmds_process.c b/components/tdls/core/src/wlan_tdls_cmds_process.c index 9437f27ea30b..23c580951808 100644 --- a/components/tdls/core/src/wlan_tdls_cmds_process.c +++ b/components/tdls/core/src/wlan_tdls_cmds_process.c @@ -1697,12 +1697,23 @@ static QDF_STATUS tdls_config_force_peer( } feature = soc_obj->tdls_configs.tdls_feature_flags; - if (!TDLS_IS_EXTERNAL_CONTROL_ENABLED(feature) || + if (!(TDLS_IS_EXTERNAL_CONTROL_ENABLED(feature) || + TDLS_IS_LIBERAL_EXTERNAL_CONTROL_ENABLED(feature)) || !TDLS_IS_IMPLICIT_TRIG_ENABLED(feature)) { tdls_err("TDLS ext ctrl or Imp Trig not enabled, %x", feature); return QDF_STATUS_E_NOSUPPORT; } + /* + * In case of liberal external mode, supplicant will provide peer mac + * address but driver has to behave similar to implict mode ie + * establish tdls link with any peer that supports tdls and meets stats + */ + if (TDLS_IS_LIBERAL_EXTERNAL_CONTROL_ENABLED(feature)) { + tdls_debug("liberal mode set"); + return QDF_STATUS_SUCCESS; + } + peer_update_param = qdf_mem_malloc(sizeof(*peer_update_param)); if (!peer_update_param) { tdls_err("memory allocation failed"); @@ -1840,7 +1851,8 @@ QDF_STATUS tdls_process_remove_force_peer(struct tdls_oper_request *req) } feature = soc_obj->tdls_configs.tdls_feature_flags; - if (!TDLS_IS_EXTERNAL_CONTROL_ENABLED(feature) || + if (!(TDLS_IS_EXTERNAL_CONTROL_ENABLED(feature) || + TDLS_IS_LIBERAL_EXTERNAL_CONTROL_ENABLED(feature)) || !TDLS_IS_IMPLICIT_TRIG_ENABLED(feature)) { tdls_err("TDLS ext ctrl or Imp Trig not enabled, %x", feature); status = QDF_STATUS_E_NOSUPPORT; diff --git a/components/tdls/dispatcher/inc/wlan_tdls_cfg.h b/components/tdls/dispatcher/inc/wlan_tdls_cfg.h index 7d1044ff1b3c..7215a5eaf65e 100644 --- a/components/tdls/dispatcher/inc/wlan_tdls_cfg.h +++ b/components/tdls/dispatcher/inc/wlan_tdls_cfg.h @@ -544,15 +544,24 @@ /* * - * gTDLSPuapsdPTIWindow - This ini is used to configure peer traffic indication - * window. - * @Min: 1 - * @Max: 5 - * @Default: 2 + * gTDLSExternalControl - Enable external TDLS control. + * @Min: 0 + * @Max: 2 + * @Default: 1 * - * This ini is used to configure buffering time in number of beacon intervals. + * This ini is used to enable/disable external TDLS control. + * TDLS external control works with TDLS implicit trigger. TDLS external + * control allows a user to add a MAC address of potential TDLS peers so + * that the CLD driver can initiate implicit TDLS setup to only those peers + * when criteria for TDLS setup (throughput and RSSI threshold) is met. + * There are two flavors of external control supported. If control default + * is set 1 it means strict external control where only for configured + * tdls peer mac address tdls link will be established. If control default + * is set 2 liberal tdls external control is needed which means + * tdls link will be established with configured peer mac address as well + * as any other peer which supports tdls. * - * Related: gEnableTDLSSupport. + * Related: gEnableTDLSSupport, gEnableTDLSImplicitTrigger. * * Supported Feature: TDLS * diff --git a/components/tdls/dispatcher/inc/wlan_tdls_public_structs.h b/components/tdls/dispatcher/inc/wlan_tdls_public_structs.h index f675b84ff415..b73866b415cb 100644 --- a/components/tdls/dispatcher/inc/wlan_tdls_public_structs.h +++ b/components/tdls/dispatcher/inc/wlan_tdls_public_structs.h @@ -397,6 +397,11 @@ struct tx_frame { qdf_timer_t tx_timer; }; +enum tdls_configured_external_control { + TDLS_STRICT_EXTERNAL_CONTROL = 1, + TDLS_LIBERAL_EXTERNAL_CONTROL = 2, +}; + /** * enum tdls_feature_bit * @TDLS_FEATURE_OFF_CHANNEL: tdls off channel @@ -406,7 +411,8 @@ struct tx_frame { * @TDLS_FEATURE_SCAN: tdls scan * @TDLS_FEATURE_ENABLE: tdls enabled * @TDLS_FEAUTRE_IMPLICIT_TRIGGER: tdls implicit trigger - * @TDLS_FEATURE_EXTERNAL_CONTROL: tdls external control + * @TDLS_FEATURE_EXTERNAL_CONTROL: enforce strict tdls external control + * @TDLS_FEATURE_LIBERAL_EXTERNAL_CONTROL: liberal external tdls control */ enum tdls_feature_bit { TDLS_FEATURE_OFF_CHANNEL, @@ -416,7 +422,8 @@ enum tdls_feature_bit { TDLS_FEATURE_SCAN, TDLS_FEATURE_ENABLE, TDLS_FEAUTRE_IMPLICIT_TRIGGER, - TDLS_FEATURE_EXTERNAL_CONTROL + TDLS_FEATURE_EXTERNAL_CONTROL, + TDLS_FEATURE_LIBERAL_EXTERNAL_CONTROL, }; #define TDLS_IS_OFF_CHANNEL_ENABLED(flags) \ @@ -435,6 +442,8 @@ enum tdls_feature_bit { CHECK_BIT(flags, TDLS_FEAUTRE_IMPLICIT_TRIGGER) #define TDLS_IS_EXTERNAL_CONTROL_ENABLED(flags) \ CHECK_BIT(flags, TDLS_FEATURE_EXTERNAL_CONTROL) +#define TDLS_IS_LIBERAL_EXTERNAL_CONTROL_ENABLED(flags) \ + CHECK_BIT(flags, TDLS_FEATURE_LIBERAL_EXTERNAL_CONTROL) /** * struct tdls_user_config - TDLS user configuration @@ -495,7 +504,7 @@ struct tdls_user_config { bool tdls_off_chan_enable; bool tdls_off_chan_enable_orig; bool tdls_wmm_mode_enable; - bool tdls_external_control; + uint8_t tdls_external_control; bool tdls_implicit_trigger_enable; bool tdls_scan_enable; bool tdls_sleep_sta_enable; diff --git a/components/tdls/dispatcher/src/wlan_tdls_ucfg_api.c b/components/tdls/dispatcher/src/wlan_tdls_ucfg_api.c index 73e984dfecf7..5c46e782e659 100644 --- a/components/tdls/dispatcher/src/wlan_tdls_ucfg_api.c +++ b/components/tdls/dispatcher/src/wlan_tdls_ucfg_api.c @@ -142,8 +142,12 @@ tdls_update_feature_flag(struct tdls_soc_priv_obj *tdls_soc_obj) 1 << TDLS_FEATURE_ENABLE : 0) | (tdls_soc_obj->tdls_configs.tdls_implicit_trigger_enable ? 1 << TDLS_FEAUTRE_IMPLICIT_TRIGGER : 0) | - (tdls_soc_obj->tdls_configs.tdls_external_control ? - 1 << TDLS_FEATURE_EXTERNAL_CONTROL : 0)); + (tdls_soc_obj->tdls_configs.tdls_external_control & + TDLS_STRICT_EXTERNAL_CONTROL ? + 1 << TDLS_FEATURE_EXTERNAL_CONTROL : 0) | + (tdls_soc_obj->tdls_configs.tdls_external_control & + TDLS_LIBERAL_EXTERNAL_CONTROL ? + 1 << TDLS_FEATURE_LIBERAL_EXTERNAL_CONTROL : 0)); } /**