|
@@ -1372,14 +1372,26 @@ bool wlan_mlme_is_chain_mask_supported(struct wlan_objmgr_psoc *psoc)
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+#define MAX_PDEV_CHAIN_MASK_PARAMS 6
|
|
|
+/* params being sent:
|
|
|
+ * wmi_pdev_param_tx_chain_mask
|
|
|
+ * wmi_pdev_param_rx_chain_mask
|
|
|
+ * wmi_pdev_param_tx_chain_mask_2g
|
|
|
+ * wmi_pdev_param_rx_chain_mask_2g
|
|
|
+ * wmi_pdev_param_tx_chain_mask_5g
|
|
|
+ * wmi_pdev_param_rx_chain_mask_5g
|
|
|
+ */
|
|
|
QDF_STATUS wlan_mlme_configure_chain_mask(struct wlan_objmgr_psoc *psoc,
|
|
|
uint8_t session_id)
|
|
|
{
|
|
|
- int ret_val;
|
|
|
+ QDF_STATUS ret_val = QDF_STATUS_E_FAILURE;
|
|
|
uint8_t ch_msk_val;
|
|
|
struct wlan_mlme_psoc_ext_obj *mlme_obj = mlme_get_psoc_ext_obj(psoc);
|
|
|
bool mrc_disabled_2g_rx, mrc_disabled_2g_tx;
|
|
|
bool mrc_disabled_5g_rx, mrc_disabled_5g_tx;
|
|
|
+ struct dev_set_param setparam[MAX_PDEV_CHAIN_MASK_PARAMS];
|
|
|
+ uint8_t index = 0;
|
|
|
|
|
|
if (!mlme_obj)
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
@@ -1410,72 +1422,109 @@ QDF_STATUS wlan_mlme_configure_chain_mask(struct wlan_objmgr_psoc *psoc,
|
|
|
if (!wlan_mlme_configure_chain_mask_supported(psoc))
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
|
|
|
-
|
|
|
if (mlme_obj->cfg.chainmask_cfg.txchainmask1x1) {
|
|
|
ch_msk_val = mlme_obj->cfg.chainmask_cfg.txchainmask1x1;
|
|
|
- ret_val = wma_cli_set_command(session_id,
|
|
|
- WMI_PDEV_PARAM_TX_CHAIN_MASK,
|
|
|
- ch_msk_val, PDEV_CMD);
|
|
|
- if (ret_val)
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
+ if (wma_validate_txrx_chain_mask(wmi_pdev_param_tx_chain_mask,
|
|
|
+ ch_msk_val)) {
|
|
|
+ goto error;
|
|
|
+ }
|
|
|
+ ret_val = mlme_check_index_setparam(
|
|
|
+ setparam,
|
|
|
+ wmi_pdev_param_tx_chain_mask,
|
|
|
+ ch_msk_val, index++,
|
|
|
+ MAX_PDEV_CHAIN_MASK_PARAMS);
|
|
|
+ if (QDF_IS_STATUS_ERROR(ret_val)) {
|
|
|
+ mlme_err("failed at wmi_pdev_param_tx_chain_mask");
|
|
|
+ goto error;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (mlme_obj->cfg.chainmask_cfg.rxchainmask1x1) {
|
|
|
ch_msk_val = mlme_obj->cfg.chainmask_cfg.rxchainmask1x1;
|
|
|
- ret_val = wma_cli_set_command(session_id,
|
|
|
- WMI_PDEV_PARAM_RX_CHAIN_MASK,
|
|
|
- ch_msk_val, PDEV_CMD);
|
|
|
- if (ret_val)
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
+ if (wma_validate_txrx_chain_mask(wmi_pdev_param_rx_chain_mask,
|
|
|
+ ch_msk_val)) {
|
|
|
+ goto error;
|
|
|
+ }
|
|
|
+ ret_val = mlme_check_index_setparam(
|
|
|
+ setparam,
|
|
|
+ wmi_pdev_param_rx_chain_mask,
|
|
|
+ ch_msk_val, index++,
|
|
|
+ MAX_PDEV_CHAIN_MASK_PARAMS);
|
|
|
+ if (QDF_IS_STATUS_ERROR(ret_val)) {
|
|
|
+ mlme_err("failed at wmi_pdev_param_rx_chain_mask");
|
|
|
+ goto error;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (mlme_obj->cfg.chainmask_cfg.txchainmask1x1 ||
|
|
|
mlme_obj->cfg.chainmask_cfg.rxchainmask1x1) {
|
|
|
mlme_legacy_debug("band agnostic tx/rx chain mask set. skip per band chain mask");
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
+ goto sendparam;
|
|
|
}
|
|
|
|
|
|
if (mlme_obj->cfg.chainmask_cfg.tx_chain_mask_2g &&
|
|
|
mrc_disabled_2g_tx) {
|
|
|
ch_msk_val = mlme_obj->cfg.chainmask_cfg.tx_chain_mask_2g;
|
|
|
- ret_val = wma_cli_set_command(session_id,
|
|
|
- WMI_PDEV_PARAM_TX_CHAIN_MASK_2G,
|
|
|
- ch_msk_val, PDEV_CMD);
|
|
|
- if (0 != ret_val)
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
+ ret_val = mlme_check_index_setparam(
|
|
|
+ setparam,
|
|
|
+ wmi_pdev_param_tx_chain_mask_2g,
|
|
|
+ ch_msk_val, index++,
|
|
|
+ MAX_PDEV_CHAIN_MASK_PARAMS);
|
|
|
+ if (QDF_IS_STATUS_ERROR(ret_val)) {
|
|
|
+ mlme_err("failed at wmi_pdev_param_tx_chain_mask_2g");
|
|
|
+ goto error;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (mlme_obj->cfg.chainmask_cfg.rx_chain_mask_2g &&
|
|
|
mrc_disabled_2g_rx) {
|
|
|
ch_msk_val = mlme_obj->cfg.chainmask_cfg.rx_chain_mask_2g;
|
|
|
- ret_val = wma_cli_set_command(session_id,
|
|
|
- WMI_PDEV_PARAM_RX_CHAIN_MASK_2G,
|
|
|
- ch_msk_val, PDEV_CMD);
|
|
|
- if (0 != ret_val)
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
+ ret_val = mlme_check_index_setparam(
|
|
|
+ setparam,
|
|
|
+ wmi_pdev_param_rx_chain_mask_2g,
|
|
|
+ ch_msk_val, index++,
|
|
|
+ MAX_PDEV_CHAIN_MASK_PARAMS);
|
|
|
+ if (QDF_IS_STATUS_ERROR(ret_val)) {
|
|
|
+ mlme_err("failed at wmi_pdev_param_rx_chain_mask_2g");
|
|
|
+ goto error;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (mlme_obj->cfg.chainmask_cfg.tx_chain_mask_5g &&
|
|
|
mrc_disabled_5g_tx) {
|
|
|
ch_msk_val = mlme_obj->cfg.chainmask_cfg.tx_chain_mask_5g;
|
|
|
- ret_val = wma_cli_set_command(session_id,
|
|
|
- WMI_PDEV_PARAM_TX_CHAIN_MASK_5G,
|
|
|
- ch_msk_val, PDEV_CMD);
|
|
|
- if (0 != ret_val)
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
+ ret_val = mlme_check_index_setparam(
|
|
|
+ setparam,
|
|
|
+ wmi_pdev_param_tx_chain_mask_5g,
|
|
|
+ ch_msk_val, index++,
|
|
|
+ MAX_PDEV_CHAIN_MASK_PARAMS);
|
|
|
+ if (QDF_IS_STATUS_ERROR(ret_val)) {
|
|
|
+ mlme_err("failed at wmi_pdev_param_tx_chain_mask_5g");
|
|
|
+ goto error;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (mlme_obj->cfg.chainmask_cfg.rx_chain_mask_5g &&
|
|
|
mrc_disabled_5g_rx) {
|
|
|
ch_msk_val = mlme_obj->cfg.chainmask_cfg.rx_chain_mask_5g;
|
|
|
- ret_val = wma_cli_set_command(session_id,
|
|
|
- WMI_PDEV_PARAM_RX_CHAIN_MASK_5G,
|
|
|
- ch_msk_val, PDEV_CMD);
|
|
|
- if (0 != ret_val)
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
+ ret_val = mlme_check_index_setparam(
|
|
|
+ setparam,
|
|
|
+ wmi_pdev_param_rx_chain_mask_5g,
|
|
|
+ ch_msk_val, index++,
|
|
|
+ MAX_PDEV_CHAIN_MASK_PARAMS);
|
|
|
+ if (QDF_IS_STATUS_ERROR(ret_val)) {
|
|
|
+ mlme_err("failed at wmi_pdev_param_rx_chain_mask_5g");
|
|
|
+ goto error;
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
+sendparam:
|
|
|
+ ret_val = wma_send_multi_pdev_vdev_set_params(MLME_PDEV_SETPARAM,
|
|
|
+ WMI_PDEV_ID_SOC, setparam,
|
|
|
+ index);
|
|
|
+ if (QDF_IS_STATUS_ERROR(ret_val))
|
|
|
+ mlme_err("failed to send chainmask params");
|
|
|
+error:
|
|
|
+ return ret_val;
|
|
|
}
|
|
|
|
|
|
QDF_STATUS
|
|
@@ -2607,7 +2656,7 @@ static void wlan_mlme_send_oce_flags_fw(struct wlan_objmgr_pdev *pdev,
|
|
|
*dynamic_fw_value = *updated_fw_value;
|
|
|
vdev_id = wlan_vdev_get_id(vdev);
|
|
|
if (wma_cli_set_command(vdev_id,
|
|
|
- WMI_VDEV_PARAM_ENABLE_DISABLE_OCE_FEATURES,
|
|
|
+ wmi_vdev_param_enable_disable_oce_features,
|
|
|
*updated_fw_value, VDEV_CMD))
|
|
|
mlme_legacy_err("Failed to send OCE update to FW");
|
|
|
}
|