qcacld-3.0: Feature flag for Wlan Latency Manager support

WLAN Latency Manager support is one of the capabilities that is sent
along with the service bits by firmware. Currently, driver is not
exposing this feature to the user space.

Create and add support for a feature flag to expose this feature to the
userspace.

Change-Id: Ica8213bdaeb32c7be01b6a71a7d8b7a32dc8611b
CRs-Fixed: 2363704
This commit is contained in:
Sourav Mohapatra 2018-12-06 15:19:41 +05:30 • committed by nshrivas
commit c457ae6f18
6 changed files with 58 additions and 0 deletions

View file

@ -3208,4 +3208,15 @@ QDF_STATUS ucfg_wlan_mlme_get_rrm_enabled(struct wlan_objmgr_psoc *psoc,
{
return wlan_mlme_get_rrm_enabled(psoc, value);
}
/**
* ucfg_mlme_get_latency_enable() - Get the latency_enable
* @psoc: pointer to psoc object
* @value: Value that needs to be get from the caller
*
* Return: QDF Status
*/
QDF_STATUS
ucfg_mlme_get_latency_enable(struct wlan_objmgr_psoc *psoc, bool *value);
#endif /* _WLAN_MLME_UCFG_API_H_ */

View file

@ -1195,3 +1195,18 @@ ucfg_mlme_get_ap_random_bssid_enable(struct wlan_objmgr_psoc *psoc,
*value = mlme_obj->cfg.sap_cfg.ap_random_bssid_enable;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
ucfg_mlme_get_latency_enable(struct wlan_objmgr_psoc *psoc, bool *value)
{
struct wlan_mlme_psoc_obj *mlme_obj;
mlme_obj = mlme_get_psoc_obj(psoc);
if (!mlme_obj) {
mlme_err("mlme obj null");
return QDF_STATUS_E_INVAL;
}
*value = mlme_obj->cfg.wlm_config.latency_enable;
return QDF_STATUS_SUCCESS;
}

View file

@ -3082,6 +3082,29 @@ void wlan_hdd_cfg80211_acs_ch_select_evt(struct hdd_adapter *adapter)
}
}
/**
* hdd_is_wlm_latency_manager_supported - Checks if WLM Latency manager is
* supported
* @hdd_ctx: The HDD context
*
* Return: True if supported, false otherwise
*/
static inline
bool hdd_is_wlm_latency_manager_supported(struct hdd_context *hdd_ctx)
{
bool latency_enable;
if (QDF_IS_STATUS_ERROR(ucfg_mlme_get_latency_enable
(hdd_ctx->psoc, &latency_enable)))
return false;
if (latency_enable &&
sme_is_feature_supported_by_fw(VDEV_LATENCY_CONFIG))
return true;
else
return false;
}
static int
__wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy,
struct wireless_dev *wdev,
@ -3178,6 +3201,9 @@ __wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy,
if (hdd_scan_random_mac_addr_supported())
fset |= WIFI_FEATURE_SCAN_RAND;
if (hdd_is_wlm_latency_manager_supported(hdd_ctx))
fset |= WIFI_FEATURE_SET_LATENCY_MODE;
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(fset) +
NLMSG_HDRLEN);
if (!skb) {

View file

@ -192,6 +192,8 @@ typedef enum {
#define WIFI_FEATURE_CONTROL_ROAMING 0x800000 /* Enable/Disable roaming */
#define WIFI_FEATURE_IE_WHITELIST 0x1000000 /* Support Probe IE white listing */
#define WIFI_FEATURE_SCAN_RAND 0x2000000 /* Support MAC & Probe Sequence Number randomization */
#define WIFI_FEATURE_SET_LATENCY_MODE 0x40000000 /* Set latency mode */
/* Support Tx Power Limit setting */
#define WIFI_FEATURE_SET_TX_POWER_LIMIT 0x4000000

View file

@ -132,6 +132,7 @@ enum cap_bitmap {
ADVANCE_TDLS = 29,
TDLS_OFF_CHANNEL = 30,
#endif
VDEV_LATENCY_CONFIG = 31,
/* MAX_FEATURE_SUPPORTED = 32 */
};

View file

@ -4996,6 +4996,9 @@ static inline void wma_update_target_services(struct wmi_unified *wmi_handle,
cfg->obss_scan_offload = true;
if (wmi_service_enabled(wmi_handle, wmi_service_beacon_reception_stats))
cfg->bcn_reception_stats = true;
if (wmi_service_enabled(wmi_handle, wmi_service_vdev_latency_config))
g_fw_wlan_feat_caps |= (1 << VDEV_LATENCY_CONFIG);
}
/**