qcacld-3.0: Add Component APIs for required ucfg APIs in DP component

When component dependent functions calling from higher
modules or any other components, it uses ucfg APIs pattern.
Calling ucfg dependent APIs is acceptable for higher modules
like HDD, OSIF but for another components like DP to avoid
using ucfg APIs here, implementing component APIs for existing
ucfg APIs to other components like MLME, TDLS, Pkt capture in
DP component module.

Change-Id: Ib8857eeca6a88810d7875312ff6dc14ffb60bc70
CRs-Fixed: 3351486
This commit is contained in:
Roopavathi Lingampalli
2022-12-01 13:48:44 +05:30
committed by Madan Koyyalamudi
parent 75c248dbb9
commit fcb513f88f
12 changed files with 131 additions and 31 deletions

View File

@@ -33,11 +33,11 @@
#include "wlan_mlme_vdev_mgr_interface.h" #include "wlan_mlme_vdev_mgr_interface.h"
#include "hif.h" #include "hif.h"
#include "qdf_trace.h" #include "qdf_trace.h"
#include <wlan_cm_ucfg_api.h> #include <wlan_cm_api.h>
#include <qdf_threads.h> #include <qdf_threads.h>
#include <qdf_net_stats.h> #include <qdf_net_stats.h>
#include "wlan_dp_periodic_sta_stats.h" #include "wlan_dp_periodic_sta_stats.h"
#include "wlan_mlme_ucfg_api.h" #include "wlan_mlme_api.h"
#include "wlan_dp_txrx.h" #include "wlan_dp_txrx.h"
#include "cdp_txrx_host_stats.h" #include "cdp_txrx_host_stats.h"
#include "wlan_cm_roam_api.h" #include "wlan_cm_roam_api.h"
@@ -1145,7 +1145,7 @@ static void dp_display_periodic_stats(struct wlan_dp_psoc_context *dp_ctx,
uint32_t periodic_stats_disp_time = 0; uint32_t periodic_stats_disp_time = 0;
hdd_cb_handle ctx = dp_ctx->dp_ops.callback_ctx; hdd_cb_handle ctx = dp_ctx->dp_ops.callback_ctx;
ucfg_mlme_stats_get_periodic_display_time(dp_ctx->psoc, wlan_mlme_stats_get_periodic_display_time(dp_ctx->psoc,
&periodic_stats_disp_time); &periodic_stats_disp_time);
if (!periodic_stats_disp_time) if (!periodic_stats_disp_time)
return; return;
@@ -1849,7 +1849,7 @@ static void __dp_bus_bw_work_handler(struct wlan_dp_psoc_context *dp_ctx)
if ((dp_intf->device_mode == QDF_STA_MODE || if ((dp_intf->device_mode == QDF_STA_MODE ||
dp_intf->device_mode == QDF_P2P_CLIENT_MODE) && dp_intf->device_mode == QDF_P2P_CLIENT_MODE) &&
!ucfg_cm_is_vdev_active(vdev)) { !wlan_cm_is_vdev_active(vdev)) {
dp_objmgr_put_vdev_by_user(vdev, WLAN_DP_ID); dp_objmgr_put_vdev_by_user(vdev, WLAN_DP_ID);
continue; continue;
} }
@@ -1876,7 +1876,7 @@ static void __dp_bus_bw_work_handler(struct wlan_dp_psoc_context *dp_ctx)
dp_intf->prev_tx_bytes); dp_intf->prev_tx_bytes);
if (dp_intf->device_mode == QDF_STA_MODE && if (dp_intf->device_mode == QDF_STA_MODE &&
ucfg_cm_is_vdev_active(vdev)) { wlan_cm_is_vdev_active(vdev)) {
dp_ctx->dp_ops.dp_send_mscs_action_frame(ctx, dp_ctx->dp_ops.dp_send_mscs_action_frame(ctx,
dp_intf->intf_id); dp_intf->intf_id);
if (dp_intf->link_monitoring.enabled) if (dp_intf->link_monitoring.enabled)

View File

@@ -29,7 +29,7 @@
#include <wlan_nlink_common.h> #include <wlan_nlink_common.h>
#include <qdf_net_types.h> #include <qdf_net_types.h>
#include "wlan_objmgr_vdev_obj.h" #include "wlan_objmgr_vdev_obj.h"
#include <wlan_cm_ucfg_api.h> #include "wlan_cm_api.h"
#include "wlan_dp_nud_tracking.h" #include "wlan_dp_nud_tracking.h"
#include "target_if_dp_comp.h" #include "target_if_dp_comp.h"
#include "wlan_dp_txrx.h" #include "wlan_dp_txrx.h"
@@ -672,7 +672,7 @@ __dp_process_mic_error(struct wlan_dp_intf *dp_intf)
if ((dp_intf->device_mode == QDF_STA_MODE || if ((dp_intf->device_mode == QDF_STA_MODE ||
dp_intf->device_mode == QDF_P2P_CLIENT_MODE) && dp_intf->device_mode == QDF_P2P_CLIENT_MODE) &&
ucfg_cm_is_vdev_active(vdev)) wlan_cm_is_vdev_active(vdev))
ops->osif_dp_process_mic_error(dp_intf->mic_work.info, ops->osif_dp_process_mic_error(dp_intf->mic_work.info,
vdev); vdev);
else if (dp_intf->device_mode == QDF_SAP_MODE || else if (dp_intf->device_mode == QDF_SAP_MODE ||

View File

@@ -26,7 +26,7 @@
#include "wlan_dp_cfg.h" #include "wlan_dp_cfg.h"
#include <cdp_txrx_misc.h> #include <cdp_txrx_misc.h>
#include "wlan_cm_roam_ucfg_api.h" #include "wlan_cm_roam_ucfg_api.h"
#include <wlan_cm_ucfg_api.h> #include <wlan_cm_api.h>
#include "wlan_dp_nud_tracking.h" #include "wlan_dp_nud_tracking.h"
#include "wlan_vdev_mgr_ucfg_api.h" #include "wlan_vdev_mgr_ucfg_api.h"
@@ -377,7 +377,7 @@ static void dp_nud_filter_netevent(struct qdf_mac_addr *netdev_addr,
if (!vdev) if (!vdev)
return; return;
if (!ucfg_cm_is_vdev_active(vdev)) { if (!wlan_cm_is_vdev_active(vdev)) {
dp_objmgr_put_vdev_by_user(vdev, WLAN_DP_ID); dp_objmgr_put_vdev_by_user(vdev, WLAN_DP_ID);
dp_info("Not in Connected State"); dp_info("Not in Connected State");
return; return;

View File

@@ -36,11 +36,11 @@
#endif #endif
#include "nan_public_structs.h" #include "nan_public_structs.h"
#include "nan_ucfg_api.h" #include "nan_ucfg_api.h"
#include <wlan_cm_ucfg_api.h> #include <wlan_cm_api.h>
#include <enet.h> #include <enet.h>
#include <cds_utils.h> #include <cds_utils.h>
#include <wlan_dp_bus_bandwidth.h> #include <wlan_dp_bus_bandwidth.h>
#include <wlan_tdls_ucfg_api.h> #include "wlan_tdls_api.h"
#include <qdf_trace.h> #include <qdf_trace.h>
#include <qdf_net_stats.h> #include <qdf_net_stats.h>
@@ -440,7 +440,7 @@ void dp_get_transmit_mac_addr(struct wlan_dp_intf *dp_intf,
break; break;
case QDF_STA_MODE: case QDF_STA_MODE:
case QDF_P2P_CLIENT_MODE: case QDF_P2P_CLIENT_MODE:
if (ucfg_cm_is_vdev_active(dp_intf->vdev)) if (wlan_cm_is_vdev_active(dp_intf->vdev))
qdf_copy_macaddr(mac_addr_tx_allowed, qdf_copy_macaddr(mac_addr_tx_allowed,
&dp_intf->conn_info.bssid); &dp_intf->conn_info.bssid);
break; break;
@@ -815,7 +815,7 @@ void dp_sta_notify_tx_comp_cb(qdf_nbuf_t nbuf, void *ctx, uint16_t flag)
/* Since it is TDLS call took TDLS vdev ref*/ /* Since it is TDLS call took TDLS vdev ref*/
status = wlan_objmgr_vdev_try_get_ref(dp_intf->vdev, WLAN_TDLS_SB_ID); status = wlan_objmgr_vdev_try_get_ref(dp_intf->vdev, WLAN_TDLS_SB_ID);
if (QDF_IS_STATUS_SUCCESS(status)) { if (QDF_IS_STATUS_SUCCESS(status)) {
ucfg_tdls_update_tx_pkt_cnt(dp_intf->vdev, dest_mac_addr); wlan_tdls_update_tx_pkt_cnt(dp_intf->vdev, dest_mac_addr);
wlan_objmgr_vdev_release_ref(dp_intf->vdev, WLAN_TDLS_SB_ID); wlan_objmgr_vdev_release_ref(dp_intf->vdev, WLAN_TDLS_SB_ID);
} }
} }
@@ -1729,7 +1729,7 @@ QDF_STATUS dp_rx_packet_cbk(void *dp_intf_context,
status = wlan_objmgr_vdev_try_get_ref(dp_intf->vdev, status = wlan_objmgr_vdev_try_get_ref(dp_intf->vdev,
WLAN_TDLS_SB_ID); WLAN_TDLS_SB_ID);
if (QDF_IS_STATUS_SUCCESS(status)) { if (QDF_IS_STATUS_SUCCESS(status)) {
ucfg_tdls_update_rx_pkt_cnt(dp_intf->vdev, mac_addr, wlan_tdls_update_rx_pkt_cnt(dp_intf->vdev, mac_addr,
dest_mac_addr); dest_mac_addr);
wlan_objmgr_vdev_release_ref(dp_intf->vdev, wlan_objmgr_vdev_release_ref(dp_intf->vdev,
WLAN_TDLS_SB_ID); WLAN_TDLS_SB_ID);

View File

@@ -34,7 +34,7 @@
#include "wlan_dp_nud_tracking.h" #include "wlan_dp_nud_tracking.h"
#include "wlan_dp_txrx.h" #include "wlan_dp_txrx.h"
#include "wlan_nlink_common.h" #include "wlan_nlink_common.h"
#include "wlan_pkt_capture_ucfg_api.h" #include "wlan_pkt_capture_api.h"
#include <cdp_txrx_ctrl.h> #include <cdp_txrx_ctrl.h>
#include <qdf_net_stats.h> #include <qdf_net_stats.h>
#include "wlan_dp_prealloc.h" #include "wlan_dp_prealloc.h"
@@ -332,6 +332,7 @@ ucfg_dp_suspend_handler(struct wlan_objmgr_psoc *psoc, void *arg)
struct wlan_dp_intf *dp_intf, *dp_intf_next = NULL; struct wlan_dp_intf *dp_intf, *dp_intf_next = NULL;
void *soc = cds_get_context(QDF_MODULE_ID_SOC); void *soc = cds_get_context(QDF_MODULE_ID_SOC);
QDF_STATUS status; QDF_STATUS status;
dp_ctx = dp_psoc_get_priv(psoc); dp_ctx = dp_psoc_get_priv(psoc);
if (!dp_ctx) { if (!dp_ctx) {
dp_err("DP context not found"); dp_err("DP context not found");
@@ -1144,7 +1145,7 @@ QDF_STATUS ucfg_dp_register_pkt_capture_callbacks(struct wlan_objmgr_vdev *vdev)
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
} }
return ucfg_pkt_capture_register_callbacks(vdev, return wlan_pkt_capture_register_callbacks(vdev,
dp_mon_rx_packet_cbk, dp_mon_rx_packet_cbk,
dp_intf); dp_intf);
} }

View File

@@ -4097,4 +4097,15 @@ wlan_mlme_get_sr_enable_modes(struct wlan_objmgr_psoc *psoc, uint8_t *val);
void void
wlan_mlme_set_edca_pifs_param(struct wlan_edca_pifs_param_ie *ep, wlan_mlme_set_edca_pifs_param(struct wlan_edca_pifs_param_ie *ep,
enum host_edca_param_type type); enum host_edca_param_type type);
/**
* wlan_mlme_stats_get_periodic_display_time() - get display time
* @psoc: pointer to psoc object
* @periodic_display_time: buffer to hold value
*
* Return: QDF Status
*/
QDF_STATUS
wlan_mlme_stats_get_periodic_display_time(struct wlan_objmgr_psoc *psoc,
uint32_t *periodic_display_time);
#endif /* _WLAN_MLME_API_H_ */ #endif /* _WLAN_MLME_API_H_ */

View File

@@ -6470,3 +6470,22 @@ wlan_mlme_set_edca_pifs_param(struct wlan_edca_pifs_param_ie *ep,
CFG_PIFS_PARAM_REB_OFFSET; CFG_PIFS_PARAM_REB_OFFSET;
} }
} }
QDF_STATUS
wlan_mlme_stats_get_periodic_display_time(struct wlan_objmgr_psoc *psoc,
uint32_t *periodic_display_time)
{
struct wlan_mlme_psoc_ext_obj *mlme_obj;
mlme_obj = mlme_get_psoc_ext_obj(psoc);
if (!mlme_obj) {
*periodic_display_time =
cfg_default(CFG_PERIODIC_STATS_DISPLAY_TIME);
return QDF_STATUS_E_INVAL;
}
*periodic_display_time =
mlme_obj->cfg.stats.stats_periodic_display_time;
return QDF_STATUS_SUCCESS;
}

View File

@@ -1182,19 +1182,8 @@ QDF_STATUS
ucfg_mlme_stats_get_periodic_display_time(struct wlan_objmgr_psoc *psoc, ucfg_mlme_stats_get_periodic_display_time(struct wlan_objmgr_psoc *psoc,
uint32_t *periodic_display_time) uint32_t *periodic_display_time)
{ {
struct wlan_mlme_psoc_ext_obj *mlme_obj; return wlan_mlme_stats_get_periodic_display_time(psoc,
periodic_display_time);
mlme_obj = mlme_get_psoc_ext_obj(psoc);
if (!mlme_obj) {
*periodic_display_time =
cfg_default(CFG_PERIODIC_STATS_DISPLAY_TIME);
return QDF_STATUS_E_INVAL;
}
*periodic_display_time =
mlme_obj->cfg.stats.stats_periodic_display_time;
return QDF_STATUS_SUCCESS;
} }
QDF_STATUS QDF_STATUS

View File

@@ -1,5 +1,5 @@
/* /*
* 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 * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -33,4 +33,28 @@
* Return: bool * Return: bool
*/ */
bool wlan_pkt_capture_is_tx_mgmt_enable(struct wlan_objmgr_pdev *pdev); bool wlan_pkt_capture_is_tx_mgmt_enable(struct wlan_objmgr_pdev *pdev);
#ifdef WLAN_FEATURE_PKT_CAPTURE
/**
* wlan_pkt_capture_register_callbacks - Register packet capture callbacks
* @vdev: pointer to wlan vdev object manager
* @mon_cb: callback to call
* @context: callback context
*
* Return: 0 in case of success, invalid in case of failure.
*/
QDF_STATUS
wlan_pkt_capture_register_callbacks(struct wlan_objmgr_vdev *vdev,
QDF_STATUS (*mon_cb)(void *, qdf_nbuf_t),
void *context);
#else
static inline QDF_STATUS
wlan_pkt_capture_register_callbacks(struct wlan_objmgr_vdev *vdev,
QDF_STATUS (*mon_cb)(void *, qdf_nbuf_t),
void *context)
{
return QDF_STATUS_SUCCESS;
}
#endif /* WLAN_FEATURE_PKT_CAPTURE */
#endif /* _WLAN_PKT_CAPTURE_API_H_ */ #endif /* _WLAN_PKT_CAPTURE_API_H_ */

View File

@@ -1,5 +1,5 @@
/* /*
* 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 * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -27,3 +27,11 @@ bool wlan_pkt_capture_is_tx_mgmt_enable(struct wlan_objmgr_pdev *pdev)
{ {
return pkt_capture_is_tx_mgmt_enable(pdev); return pkt_capture_is_tx_mgmt_enable(pdev);
} }
QDF_STATUS
wlan_pkt_capture_register_callbacks(struct wlan_objmgr_vdev *vdev,
QDF_STATUS (*mon_cb)(void *, qdf_nbuf_t),
void *context)
{
return pkt_capture_register_callbacks(vdev, mon_cb, context);
}

View File

@@ -88,6 +88,28 @@ wlan_tdls_notify_sta_connect(uint8_t vdev_id,
bool tdls_prohibited, bool tdls_prohibited,
struct wlan_objmgr_vdev *vdev); struct wlan_objmgr_vdev *vdev);
/**
* wlan_tdls_update_tx_pkt_cnt() - update tx pkt count
* @vdev: tdls vdev object
* @mac_addr: peer mac address
*
* Return: None
*/
void wlan_tdls_update_tx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
struct qdf_mac_addr *mac_addr);
/**
* wlan_tdls_update_rx_pkt_cnt() - update rx pkt count
* @vdev: tdls vdev object
* @mac_addr: peer mac address
* @dest_mac_addr: dest mac address
*
* Return: None
*/
void wlan_tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
struct qdf_mac_addr *mac_addr,
struct qdf_mac_addr *dest_mac_addr);
#else #else
#ifdef FEATURE_SET #ifdef FEATURE_SET
@@ -118,5 +140,18 @@ wlan_tdls_notify_sta_connect(uint8_t vdev_id,
bool tdls_prohibited, bool tdls_prohibited,
struct wlan_objmgr_vdev *vdev) {} struct wlan_objmgr_vdev *vdev) {}
static inline void
wlan_tdls_update_tx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
struct qdf_mac_addr *mac_addr)
{
}
static inline
void wlan_tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
struct qdf_mac_addr *mac_addr,
struct qdf_mac_addr *dest_mac_addr)
{
}
#endif #endif
#endif #endif

View File

@@ -268,3 +268,16 @@ void wlan_tdls_get_features_info(struct wlan_objmgr_psoc *psoc,
} }
} }
#endif #endif
void wlan_tdls_update_tx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
struct qdf_mac_addr *mac_addr)
{
tdls_update_tx_pkt_cnt(vdev, mac_addr);
}
void wlan_tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev,
struct qdf_mac_addr *mac_addr,
struct qdf_mac_addr *dest_mac_addr)
{
tdls_update_rx_pkt_cnt(vdev, mac_addr, dest_mac_addr);
}