qcacmn: Dynamic ratemask config support

Add dynamic ratemask config support.

CRs-Fixed: 3112486
Change-Id: If419d1672b92085eb3f27b1d6505b1facfa9c09d
This commit is contained in:
Jayachandran Sreekumaran
2022-01-12 15:45:43 +05:30
committed by Madan Koyyalamudi
parent d0232b9bc0
commit 9aefacd777
6 changed files with 102 additions and 31 deletions

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -408,6 +408,36 @@ struct vdev_mlme_inactivity_params {
uint32_t keepalive_max_unresponsive_time_secs;
};
/**
* enum vdev_ratemask_type - ratemask phy type
* @WLAN_VDEV_RATEMASK_TYPE_CCK: phy type CCK
* @WLAN_VDEV_RATEMASK_TYPE_HT: phy type ht
* @WLAN_VDEV_RATEMASK_TYPE_VHT: phy type vht
* WLAN_VDEV_RATEMASK_TYPE_HE: phy type he
*/
enum vdev_ratemask_type {
WLAN_VDEV_RATEMASK_TYPE_CCK,
WLAN_VDEV_RATEMASK_TYPE_HT,
WLAN_VDEV_RATEMASK_TYPE_VHT,
WLAN_VDEV_RATEMASK_TYPE_HE,
WLAN_VDEV_RATEMASK_TYPE_MAX,
};
/**
* struct vdev_ratemask_params - vdev ratemask parameters
* @type: ratemask phy type
* @lower32: ratemask lower32 bitmask
* @higher32: ratemask higher32 bitmask
* @lower32_2: ratemask lower32_2 bitmask
* @higher32_2: rtaemask higher32_2 bitmask
*/
struct vdev_ratemask_params {
uint32_t lower32;
uint32_t higher32;
uint32_t lower32_2;
uint32_t higher32_2;
};
/**
* struct vdev_mlme_rate_info - vdev mlme rate information
* @rate_flags: dynamic bandwidth info
@@ -416,10 +446,7 @@ struct vdev_mlme_inactivity_params {
* @tx_mgmt_rate: Tx Mgmt rate
* @bcn_tx_rate: beacon Tx rate
* @bcn_tx_rate_code: beacon Tx rate code
* @type: Type of ratemask configuration
* @lower32: Lower 32 bits in the 1st 64-bit value
* @higher32: Higher 32 bits in the 1st 64-bit value
* @lower32_2: Lower 32 bits in the 2nd 64-bit value
* @ratemask_params: vdev ratemask params per phy type
* @half_rate: Half rate
* @quarter_rate: quarter rate
*/
@@ -433,10 +460,8 @@ struct vdev_mlme_rate_info {
uint32_t bcn_tx_rate_code;
#endif
uint32_t rtscts_tx_rate;
uint8_t type;
uint32_t lower32;
uint32_t higher32;
uint32_t lower32_2;
struct vdev_ratemask_params ratemask_params[
WLAN_VDEV_RATEMASK_TYPE_MAX];
bool half_rate;
bool quarter_rate;
};

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -127,6 +127,10 @@ static QDF_STATUS mlme_vdev_obj_create_handler(struct wlan_objmgr_vdev *vdev,
goto ext_hdl_post_create_failed;
}
qdf_mem_set(vdev_mlme->mgmt.rate_info.ratemask_params,
WLAN_VDEV_RATEMASK_TYPE_MAX *
sizeof(struct vdev_ratemask_params), 0xFF);
return QDF_STATUS_SUCCESS;
ext_hdl_post_create_failed:

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -115,12 +115,23 @@ enum wlan_mlme_cfg_id {
WLAN_MLME_CFG_MAX
};
/**
* struct ratemask_cfg - ratemask config
* @index: index of ratemask parameter array
* @value: configuration value
*/
struct ratemask_cfg {
uint8_t index;
uint32_t value;
};
/**
* struct wlan_vdev_mgr_cfg - vdev mgr configuration
* @value: configuration value
* @tsf: tsf adjust value
* @trans_bssid: transmission bssid address
* @ssid_cfg: ssid configuration
* @ratemask: ratemask configuration
*/
struct wlan_vdev_mgr_cfg {
union {
@@ -128,6 +139,7 @@ struct wlan_vdev_mgr_cfg {
uint64_t tsf;
uint8_t trans_bssid[QDF_MAC_ADDR_SIZE];
struct wlan_ssid ssid_cfg;
struct ratemask_cfg ratemask;
};
};

View File

@@ -63,11 +63,13 @@ wlan_util_vdev_get_cdp_txrx_subtype(struct wlan_objmgr_vdev *vdev);
* wlan_util_vdev_mlme_set_ratemask_config) common MLME API to set
* ratemask configuration and send it to FW
* @vdev_mlme: pointer to vdev_mlme object
* @index: ratemask array index
*
* Return: QDF_STATUS - Success or Failure
*/
QDF_STATUS
wlan_util_vdev_mlme_set_ratemask_config(struct vdev_mlme_obj *vdev_mlme);
wlan_util_vdev_mlme_set_ratemask_config(struct vdev_mlme_obj *vdev_mlme,
uint8_t index);
/**
* wlan_util_vdev_mlme_set_param() common MLME API to fill common

View File

@@ -39,17 +39,17 @@
#endif
static QDF_STATUS vdev_mgr_config_ratemask_update(
struct vdev_mlme_obj *mlme_obj,
struct config_ratemask_params *param)
uint8_t vdev_id,
struct vdev_ratemask_params *rate_params,
struct config_ratemask_params *param,
uint8_t index)
{
struct wlan_objmgr_vdev *vdev;
vdev = mlme_obj->vdev;
param->vdev_id = wlan_vdev_get_id(vdev);
param->type = mlme_obj->mgmt.rate_info.type;
param->lower32 = mlme_obj->mgmt.rate_info.lower32;
param->higher32 = mlme_obj->mgmt.rate_info.higher32;
param->lower32_2 = mlme_obj->mgmt.rate_info.lower32_2;
param->vdev_id = vdev_id;
param->type = index;
param->lower32 = rate_params->lower32;
param->lower32_2 = rate_params->lower32_2;
param->higher32 = rate_params->higher32;
param->higher32_2 = rate_params->higher32_2;
return QDF_STATUS_SUCCESS;
}
@@ -120,19 +120,35 @@ wlan_util_vdev_get_cdp_txrx_opmode(struct wlan_objmgr_vdev *vdev)
return cdp_txrx_opmode;
}
/**
* wlan_util_vdev_mlme_set_ratemask_config() - common MLME API to fill
* ratemask parameters of vdev_mlme object
* @vdev_mlme: pointer to vdev_mlme object
* @index: array index of ratemask_params
*/
QDF_STATUS
wlan_util_vdev_mlme_set_ratemask_config(struct vdev_mlme_obj *vdev_mlme)
wlan_util_vdev_mlme_set_ratemask_config(struct vdev_mlme_obj *vdev_mlme,
uint8_t index)
{
struct config_ratemask_params rm_param = {0};
uint8_t vdev_id;
struct vdev_mlme_rate_info *rate_info;
struct vdev_ratemask_params *rate_params;
if (!vdev_mlme) {
mlme_err("VDEV MLME is NULL");
return QDF_STATUS_E_FAILURE;
}
vdev_mgr_config_ratemask_update(vdev_mlme, &rm_param);
vdev_id = wlan_vdev_get_id(vdev_mlme->vdev);
rate_info = &vdev_mlme->mgmt.rate_info;
rate_params = &rate_info->ratemask_params[index];
vdev_mgr_config_ratemask_update(vdev_id,
rate_params,
&rm_param, index);
return tgt_vdev_mgr_config_ratemask_cmd_send(vdev_mlme, &rm_param);
return tgt_vdev_mgr_config_ratemask_cmd_send(vdev_mlme,
&rm_param);
}
qdf_export_symbol(wlan_util_vdev_mlme_set_ratemask_config);
@@ -438,17 +454,23 @@ wlan_util_vdev_mlme_set_param(struct vdev_mlme_obj *vdev_mlme,
WLAN_MLME_CFG_RX_DECAP_TYPE,
mlme_cfg.value);
break;
case WLAN_MLME_CFG_RATEMASK_TYPE:
mlme_mgmt->rate_info.type = mlme_cfg.value;
break;
case WLAN_MLME_CFG_RATEMASK_LOWER32:
mlme_mgmt->rate_info.lower32 = mlme_cfg.value;
if (mlme_cfg.ratemask.index < WLAN_VDEV_RATEMASK_TYPE_MAX)
mlme_mgmt->rate_info.ratemask_params[
mlme_cfg.ratemask.index].lower32 =
mlme_cfg.ratemask.value;
break;
case WLAN_MLME_CFG_RATEMASK_HIGHER32:
mlme_mgmt->rate_info.higher32 = mlme_cfg.value;
if (mlme_cfg.ratemask.index < WLAN_VDEV_RATEMASK_TYPE_MAX)
mlme_mgmt->rate_info.ratemask_params[
mlme_cfg.ratemask.index].higher32 =
mlme_cfg.ratemask.value;
break;
case WLAN_MLME_CFG_RATEMASK_LOWER32_2:
mlme_mgmt->rate_info.lower32_2 = mlme_cfg.value;
if (mlme_cfg.ratemask.index < WLAN_VDEV_RATEMASK_TYPE_MAX)
mlme_mgmt->rate_info.ratemask_params[
mlme_cfg.ratemask.index].lower32_2 =
mlme_cfg.ratemask.value;
break;
case WLAN_MLME_CFG_BCN_TX_RATE:
mlme_mgmt->rate_info.bcn_tx_rate = mlme_cfg.value;

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -48,6 +49,11 @@ send_vdev_config_ratemask_cmd_tlv(struct wmi_unified *wmi_handle,
cmd->mask_lower32_2 = param->lower32_2;
cmd->mask_higher32_2 = param->higher32_2;
wmi_debug("vdev_id %d type %d lower32 0x%x lower32_2 0x%x",
cmd->vdev_id, cmd->type, cmd->mask_lower32,
cmd->mask_lower32_2);
wmi_debug("higher32 0x%x higher32_2 0x%x", cmd->mask_higher32,
cmd->mask_higher32_2);
wmi_mtrace(WMI_VDEV_RATEMASK_CMDID, cmd->vdev_id, 0);
if (wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_VDEV_RATEMASK_CMDID)) {