From b3fa7a1d57399b4dac982f0ce92061f7907ae87d Mon Sep 17 00:00:00 2001 From: Anurag Chouhan Date: Mon, 18 Apr 2016 17:26:49 +0530 Subject: [PATCH] qcacld-3.0: CL 1492713 - update fw common interface files qcacld-2.0 to qcacld-3.0 propagation. WMI changes for adaptive dwell time scan. Change-Id: Ibdd1bdd607b3acac5d55312ee2595c32892c89b5 CRs-Fixed: 865207 --- target/inc/wmi_tlv_defs.h | 12 +++++++- target/inc/wmi_unified.h | 60 +++++++++++++++++++++++++++++++++++++++ target/inc/wmi_version.h | 2 +- 3 files changed, 72 insertions(+), 2 deletions(-) diff --git a/target/inc/wmi_tlv_defs.h b/target/inc/wmi_tlv_defs.h index e90ab570599a..8cd68b32a075 100644 --- a/target/inc/wmi_tlv_defs.h +++ b/target/inc/wmi_tlv_defs.h @@ -700,6 +700,8 @@ typedef enum { WMITLV_TAG_STRUC_WMI_SOC_HAL_REG_CAPABILITIES, WMITLV_TAG_STRUC_wmi_vdev_wisa_cmd_fixed_param, WMITLV_TAG_STRUC_wmi_tx_power_level_stats_evt_fixed_param, + WMITLV_TAG_STRUC_wmi_scan_adaptive_dwell_parameters_tlv, + WMITLV_TAG_STRUC_wmi_scan_adaptive_dwell_config_fixed_param, } WMITLV_TAG_ID; /* @@ -982,7 +984,8 @@ typedef enum { OP(WMI_SET_PERIODIC_CHANNEL_STATS_CONFIG_CMDID) \ OP(WMI_VDEV_SET_CUSTOM_AGGR_SIZE_CMDID) \ OP(WMI_PDEV_WAL_POWER_DEBUG_CMDID) \ - OP(WMI_VDEV_WISA_CMDID) + OP(WMI_VDEV_WISA_CMDID) \ + OP(WMI_SCAN_ADAPTIVE_DWELL_CONFIG_CMDID) /* * IMPORTANT: Please add _ALL_ WMI Events Here. @@ -1317,6 +1320,13 @@ WMITLV_CREATE_PARAM_STRUC(WMI_VDEV_PLMREQ_STOP_CMDID); WMITLV_CREATE_PARAM_STRUC(WMI_START_SCAN_CMDID); +/* Scan adaptive dwell mode configuration */ +#define WMITLV_TABLE_WMI_SCAN_ADAPTIVE_DWELL_CONFIG_CMDID(id, op, buf, len) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_scan_adaptive_dwell_config_fixed_param, wmi_scan_adaptive_dwell_config_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, wmi_scan_adaptive_dwell_parameters_tlv, param, WMITLV_SIZE_VAR) + +WMITLV_CREATE_PARAM_STRUC(WMI_SCAN_ADAPTIVE_DWELL_CONFIG_CMDID); + /* Start ExtScan Cmd */ #define WMITLV_TABLE_WMI_EXTSCAN_START_CMDID(id,op,buf,len) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_extscan_start_cmd_fixed_param, wmi_extscan_start_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ diff --git a/target/inc/wmi_unified.h b/target/inc/wmi_unified.h index 61a9185e9f6b..f00a95c038dd 100644 --- a/target/inc/wmi_unified.h +++ b/target/inc/wmi_unified.h @@ -263,6 +263,8 @@ typedef enum { /** set OUI to be used in probe request if enabled */ WMI_SCAN_PROB_REQ_OUI_CMDID, + /** config adaptive dwell scan */ + WMI_SCAN_ADAPTIVE_DWELL_CONFIG_CMDID, /* PDEV(physical device) specific commands */ /** set regulatorty ctl id used by FW to determine the exact ctl power limits */ @@ -2567,6 +2569,27 @@ typedef struct { #define WMI_SCAN_CAPTURE_PHY_ERROR 0x8000 /** always do passive scan on passive channels */ #define WMI_SCAN_FLAG_STRICT_PASSIVE_ON_PCHN 0x1000 +/** for adaptive scan mode using 3 bits (21 - 23 bits) */ +#define WMI_SCAN_DWELL_MODE_MASK 0x00E00000 +#define WMI_SCAN_DWELL_MODE_SHIFT 21 + +typedef enum { + WMI_SCAN_DWELL_MODE_DEFAULT = 0, + WMI_SCAN_DWELL_MODE_CONSERVATIVE = 1, + WMI_SCAN_DWELL_MODE_MODERATE = 2, + WMI_SCAN_DWELL_MODE_AGGRESSIVE = 3, + WMI_SCAN_DWELL_MODE_STATIC = 4, +} WMI_SCAN_DWELL_MODE; + +#define WMI_SCAN_SET_DWELL_MODE(flag, mode) \ + do { \ + (flag) |= (((mode) << WMI_SCAN_DWELL_MODE_SHIFT) & \ + WMI_SCAN_DWELL_MODE_MASK); \ + } while (0) + +#define WMI_SCAN_GET_DWELL_MODE(flag) \ + (((flag) & WMI_SCAN_DWELL_MODE_MASK) >> WMI_SCAN_DWELL_MODE_SHIFT) + /** WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */ #define WMI_SCAN_CLASS_MASK 0xFF000000 @@ -15548,6 +15571,43 @@ typedef struct { A_UINT32 num_phy; } WMI_SOC_HAL_REG_CAPABILITIES; +typedef struct { + /* + * TLV tag and len; tag equals + * WMITLV_TAG_STRUC_wmi_scan_adaptive_dwell_parameters_tlv + */ + A_UINT32 tlv_header; + /* + * global default adaptive dwell mode, + * used when WMI_SCAN_DWELL_MODE_DEFAULT + */ + A_UINT32 default_adaptive_dwell_mode; + /* + * the weight to calculate the average low pass filter for + * channel congestion. 0-100 + */ + A_UINT32 adapative_lpf_weight; + /* interval to monitor passive scan in msec */ + A_UINT32 passive_monitor_interval_ms; + /* % of wifi activity to switch from passive to active 0-100 */ + A_UINT32 wifi_activity_threshold_pct; +} wmi_scan_adaptive_dwell_parameters_tlv; + +typedef struct { + /* + * TLV tag and len; tag equals + * WMITLV_TAG_STRUC_wmi_scan_adaptive_dwell_config_fixed_param + */ + A_UINT32 tlv_header; + /* globally enable/disable adaptive dwell */ + A_UINT32 enable; + /* + * followed by TLV (tag length value) parameters array + * The TLV's are: + * wmi_scan_adaptive_dwell_parameters_tlv param[]; (0 or 1 elements) + */ +} wmi_scan_adaptive_dwell_config_fixed_param; + /* ADD NEW DEFS HERE */ /***************************************************************************** diff --git a/target/inc/wmi_version.h b/target/inc/wmi_version.h index 8adda0c639d4..604094dcb817 100644 --- a/target/inc/wmi_version.h +++ b/target/inc/wmi_version.h @@ -36,7 +36,7 @@ #define __WMI_VER_MINOR_ 0 /** WMI revision number has to be incremented when there is a * change that may or may not break compatibility */ -#define __WMI_REVISION_ 236 +#define __WMI_REVISION_ 237 /** The Version Namespace should not be normally changed. Only * host and firmware of the same WMI namespace will work