From 3416ac0dff99f64d71e74cb88cf935edb70ea6aa Mon Sep 17 00:00:00 2001 From: Bapiraju Alla Date: Thu, 9 Apr 2020 16:33:26 +0530 Subject: [PATCH] qcacld-3.0: Add APIs to configure firmware params using fwol component Currently these params are sent to fw from hdd. By design, this should be done by fwol component. Add fwol APIs to achieve this. Change-Id: Ifcc67fe15e76a32c28819267b0639edae1032093 CRs-Fixed: 2665749 --- .../dispatcher/inc/wlan_fwol_tgt_api.h | 15 ++++++- .../dispatcher/inc/wlan_fwol_ucfg_api.h | 45 +++++++++++++++++++ .../dispatcher/src/wlan_fwol_tgt_api.c | 12 ++++- .../dispatcher/src/wlan_fwol_ucfg_api.c | 14 ++++++ core/hdd/src/wlan_hdd_main.c | 9 ++++ 5 files changed, 93 insertions(+), 2 deletions(-) diff --git a/components/fw_offload/dispatcher/inc/wlan_fwol_tgt_api.h b/components/fw_offload/dispatcher/inc/wlan_fwol_tgt_api.h index 4bf88b213e0e..bbbff5212c19 100644 --- a/components/fw_offload/dispatcher/inc/wlan_fwol_tgt_api.h +++ b/components/fw_offload/dispatcher/inc/wlan_fwol_tgt_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2020 The Linux Foundation. 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 @@ -24,6 +24,8 @@ #include "wlan_fwol_public_structs.h" +#define FWOL_WILDCARD_PDEV_ID 0 + /** * tgt_fwol_register_ev_handler() - register south bound event handler * @psoc: psoc handle @@ -47,4 +49,15 @@ QDF_STATUS tgt_fwol_unregister_ev_handler(struct wlan_objmgr_psoc *psoc); * Return: QDF_STATUS_SUCCESS on success */ QDF_STATUS tgt_fwol_register_rx_ops(struct wlan_fwol_rx_ops *rx_ops); + +/** + * tgt_fwol_pdev_param_send() - send pdev params to firmware + * @pdev: pdev handle + * @pdev_params: pdev params + * + * Return: QDF_STATUS_SUCCESS on success + */ +QDF_STATUS tgt_fwol_pdev_param_send(struct wlan_objmgr_pdev *pdev, + struct pdev_params pdev_param); + #endif /* _WLAN_FWOL_TGT_API_H */ diff --git a/components/fw_offload/dispatcher/inc/wlan_fwol_ucfg_api.h b/components/fw_offload/dispatcher/inc/wlan_fwol_ucfg_api.h index 71aa87b457ad..0976011facd4 100644 --- a/components/fw_offload/dispatcher/inc/wlan_fwol_ucfg_api.h +++ b/components/fw_offload/dispatcher/inc/wlan_fwol_ucfg_api.h @@ -584,6 +584,36 @@ QDF_STATUS ucfg_fwol_send_dscp_up_map_to_fw( return QDF_STATUS_SUCCESS; } #endif + +/** + * ucfg_fwol_configure_global_params - API to configure global params + * @psoc: pointer to psoc object + * @pdev: pointer to pdev object + * + * Used to configure global firmware params. This is invoked from hdd during + * bootup. + * + * Return: QDF Status + */ +QDF_STATUS ucfg_fwol_configure_global_params(struct wlan_objmgr_psoc *psoc, + struct wlan_objmgr_pdev *pdev); + +/** + * ucfg_fwol_configure_vdev_params - API to configure vdev specific params + * @psoc: pointer to psoc object + * @pdev: pointer to pdev object + * @device_mode: device mode + * @vdev_id: vdev ID + * + * Used to configure per vdev firmware params based on device mode. This is + * invoked from hdd during vdev creation. + * + * Return: QDF Status + */ +QDF_STATUS ucfg_fwol_configure_vdev_params(struct wlan_objmgr_psoc *psoc, + struct wlan_objmgr_pdev *pdev, + enum QDF_OPMODE device_mode, + uint8_t vdev_id); #else static inline QDF_STATUS ucfg_fwol_psoc_open(struct wlan_objmgr_psoc *psoc) { @@ -878,6 +908,21 @@ ucfg_fwol_get_is_rate_limit_enabled(struct wlan_objmgr_psoc *psoc, } #endif /* FEATURE_WLAN_RA_FILTERING */ +static inline QDF_STATUS +ucfg_fwol_configure_global_params(struct wlan_objmgr_psoc *psoc, + struct wlan_objmgr_pdev *pdev) +{ + return QDF_STATUS_E_FAILURE; +} + +static inline QDF_STATUS +ucfg_fwol_configure_vdev_params(struct wlan_objmgr_psoc *psoc, + struct wlan_objmgr_pdev *pdev, + enum QDF_OPMODE device_mode, uint8_t vdev_id) +{ + return QDF_STATUS_E_FAILURE; +} + #endif /* WLAN_FW_OFFLOAD */ #endif /* _WLAN_FWOL_UCFG_API_H_ */ diff --git a/components/fw_offload/dispatcher/src/wlan_fwol_tgt_api.c b/components/fw_offload/dispatcher/src/wlan_fwol_tgt_api.c index 8778fc6b8ecd..37b66645c15a 100644 --- a/components/fw_offload/dispatcher/src/wlan_fwol_tgt_api.c +++ b/components/fw_offload/dispatcher/src/wlan_fwol_tgt_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2020 The Linux Foundation. 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 @@ -28,6 +28,7 @@ #include "wlan_fwol_ucfg_api.h" #include "wlan_fwol_tgt_api.h" #include "wlan_fw_offload_main.h" +#include "target_if.h" QDF_STATUS tgt_fwol_register_ev_handler(struct wlan_objmgr_psoc *psoc) { @@ -171,3 +172,12 @@ QDF_STATUS tgt_fwol_register_rx_ops(struct wlan_fwol_rx_ops *rx_ops) return QDF_STATUS_SUCCESS; } + +QDF_STATUS tgt_fwol_pdev_param_send(struct wlan_objmgr_pdev *pdev, + struct pdev_params pdev_param) +{ + struct wmi_unified *wmi_handle = get_wmi_unified_hdl_from_pdev(pdev); + + return wmi_unified_pdev_param_send(wmi_handle, &pdev_param, + FWOL_WILDCARD_PDEV_ID); +} diff --git a/components/fw_offload/dispatcher/src/wlan_fwol_ucfg_api.c b/components/fw_offload/dispatcher/src/wlan_fwol_ucfg_api.c index 3235d4981e5c..dda6cbc5867c 100644 --- a/components/fw_offload/dispatcher/src/wlan_fwol_ucfg_api.c +++ b/components/fw_offload/dispatcher/src/wlan_fwol_ucfg_api.c @@ -958,3 +958,17 @@ QDF_STATUS ucfg_fwol_send_dscp_up_map_to_fw(struct wlan_objmgr_vdev *vdev, return status; } #endif /* WLAN_SEND_DSCP_UP_MAP_TO_FW */ + +QDF_STATUS ucfg_fwol_configure_global_params(struct wlan_objmgr_psoc *psoc, + struct wlan_objmgr_pdev *pdev) +{ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS ucfg_fwol_configure_vdev_params(struct wlan_objmgr_psoc *psoc, + struct wlan_objmgr_pdev *pdev, + enum QDF_OPMODE device_mode, + uint8_t vdev_id) +{ + return QDF_STATUS_SUCCESS; +} diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 7a6140e70e02..07a5385e58e3 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -5160,6 +5160,10 @@ int hdd_vdev_create(struct hdd_adapter *adapter) hdd_send_ocl_cmd(hdd_ctx, adapter); + /* Configure vdev params */ + ucfg_fwol_configure_vdev_params(hdd_ctx->psoc, hdd_ctx->pdev, + adapter->device_mode, adapter->vdev_id); + hdd_nofl_debug("vdev %d created successfully", adapter->vdev_id); return errno; @@ -11932,6 +11936,11 @@ static int hdd_pre_enable_configure(struct hdd_context *hdd_ctx) if (ret) goto out; + /* Configure global firmware params */ + ret = ucfg_fwol_configure_global_params(hdd_ctx->psoc, hdd_ctx->pdev); + if (ret) + goto out; + status = hdd_set_sme_chan_list(hdd_ctx); if (status != QDF_STATUS_SUCCESS) { hdd_err("Failed to init channel list: %d", status);