qcacld-3.0: Add function to fill rssi received from target in vdev_priv

Add function to populate the rx average rssi received from target in
pkt_capture vdev_priv structure. The rx average rssi is received in
wmi smart monitor event.

Change-Id: I9206669b418a2245bb8d53920040fddea77ce06c
CRs-Fixed: 2969242
This commit is contained in:
Surabhi Vishnoi
2021-06-15 18:13:02 +05:30
committed by Madan Koyyalamudi
parent 755388276d
commit 9686432f2c
4 changed files with 54 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2020-2021 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
@@ -58,6 +58,7 @@ struct pkt_capture_cb_context {
* @cb_ctx: pointer to packet capture mon callback context
* @rx_ops: rx ops
* @tx_ops: tx ops
* @rx_avg_rssi: avg rssi of rx data packets
*/
struct pkt_capture_vdev_priv {
struct wlan_objmgr_vdev *vdev;
@@ -65,6 +66,7 @@ struct pkt_capture_vdev_priv {
struct pkt_capture_cb_context *cb_ctx;
struct wlan_pkt_capture_rx_ops rx_ops;
struct wlan_pkt_capture_tx_ops tx_ops;
int32_t rx_avg_rssi;
};
/**

View File

@@ -64,5 +64,24 @@ tgt_pkt_capture_send_mode(struct wlan_objmgr_vdev *vdev,
QDF_STATUS
tgt_pkt_capture_send_config(struct wlan_objmgr_vdev *vdev,
enum pkt_capture_trigger_qos_config config);
/**
* tgt_pkt_capture_smu_event() - Receive smart monitor event from firmware
* @psoc: pointer to psoc
* @param: smart monitor event params
*
* Return: QDF_STATUS
*/
QDF_STATUS
tgt_pkt_capture_smu_event(struct wlan_objmgr_psoc *psoc,
struct smu_event_params *param);
#else
static inline QDF_STATUS
tgt_pkt_capture_smu_event(struct wlan_objmgr_psoc *psoc,
struct smu_event_params *param)
{
return QDF_STATUS_SUCCESS;
}
#endif
#endif /* _WLAN_PKT_CAPTURE_TGT_API_H */

View File

@@ -160,4 +160,35 @@ tgt_pkt_capture_send_config(struct wlan_objmgr_vdev *vdev,
return status;
}
QDF_STATUS
tgt_pkt_capture_smu_event(struct wlan_objmgr_psoc *psoc,
struct smu_event_params *param)
{
struct pkt_capture_vdev_priv *vdev_priv;
struct wlan_objmgr_vdev *vdev;
uint8_t vdev_id;
vdev_id = param->vdev_id;
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
WLAN_PKT_CAPTURE_ID);
if (!vdev) {
pkt_capture_err("failed to get vdev");
return QDF_STATUS_E_FAILURE;
}
vdev_priv = pkt_capture_vdev_get_priv(vdev);
if (!vdev_priv) {
pkt_capture_err("vdev priv is NULL");
pkt_capture_vdev_put_ref(vdev);
return QDF_STATUS_E_FAILURE;
}
vdev_priv->rx_avg_rssi = param->rx_avg_rssi;
pkt_capture_vdev_put_ref(vdev);
return QDF_STATUS_SUCCESS;
}
#endif

View File

@@ -310,6 +310,7 @@ target_if_smart_monitor_event_handler(void *handle, uint8_t *data,
return -EINVAL;
}
tgt_pkt_capture_smu_event(psoc, &params);
return 0;
}