qcacld-3.0: Pkt capture config for qos null and trigger frames

Provide ucfg api to configure qos null and trigger frames.

Ucfg api will send configuration to FW. Below configuration values
are allowed.

PACKET_CAPTURE_CONFIG_TRIGGER_QOS_DISABLE: disable capture for
trigger and qos frames.
PACKET_CAPTURE_CONFIG_TRIGGER_ENABLE: enable capture for trigger
frames only.
PACKET_CAPTURE_CONFIG_QOS_ENABLE: enable capture for qos frames only.
PACKET_CAPTURE_CONFIG_TRIGGER_QOS_ENABLE: enable capture for both
trigger and qos frames.

The packet capture config old value will be over written by new value.
For example, first if we configure value as
PACKET_CAPTURE_CONFIG_TRIGGER_ENABLE and then if we send config as
PACKET_CAPTURE_CONFIG_QOS_ENABLE then config is enabled only for qos.

Change-Id: I02dcd4372c7194ec3e477694ad0e2c045fe6c942
CRs-Fixed: 2967824
This commit is contained in:
Vulupala Shashank Reddy
2021-06-14 16:11:10 +05:30
committed by Madan Koyyalamudi
parent e2e99c1424
commit 01b4e695dd
6 changed files with 162 additions and 4 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
@@ -33,6 +33,22 @@ enum pkt_capture_mode {
PACKET_CAPTURE_MODE_DATA_MGMT,
};
/**
* enum pkt_capture_trigger_qos_config - packet capture config
* @PACKET_CAPTURE_CONFIG_TRIGGER_QOS_DISABLE: disable capture for trigger and
* qos frames
* @PACKET_CAPTURE_CONFIG_TRIGGER_ENABLE: enable capture for trigger frames only
* @PACKET_CAPTURE_CONFIG_QOS_ENABLE: enable capture for qos frames only
* @PACKET_CAPTURE_CONFIG_TRIGGER_QOS_ENABLE: enable capture for both trigger
* and qos frames
*/
enum pkt_capture_trigger_qos_config {
PACKET_CAPTURE_CONFIG_TRIGGER_QOS_DISABLE = 0,
PACKET_CAPTURE_CONFIG_TRIGGER_ENABLE,
PACKET_CAPTURE_CONFIG_QOS_ENABLE,
PACKET_CAPTURE_CONFIG_TRIGGER_QOS_ENABLE,
};
/**
* struct mgmt_offload_event_params - Management offload event params
* @tsf_l32: The lower 32 bits of the TSF
@@ -71,12 +87,17 @@ struct pkt_capture_callbacks {
* struct wlan_pkt_capture_tx_ops - structure of tx operation function
* pointers for packet capture component
* @pkt_capture_send_mode: send packet capture mode
* @pkt_capture_send_config: send packet capture config
*
*/
struct wlan_pkt_capture_tx_ops {
QDF_STATUS (*pkt_capture_send_mode)(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id,
enum pkt_capture_mode mode);
QDF_STATUS (*pkt_capture_send_config)
(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id,
enum pkt_capture_trigger_qos_config config);
};
/**

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 above
@@ -52,4 +52,17 @@ tgt_pkt_capture_unregister_ev_handler(struct wlan_objmgr_vdev *vdev);
QDF_STATUS
tgt_pkt_capture_send_mode(struct wlan_objmgr_vdev *vdev,
enum pkt_capture_mode mode);
#ifdef WLAN_FEATURE_PKT_CAPTURE_V2
/**
* tgt_pkt_capture_send_config() - send packet capture config to firmware
* @vdev: pointer to vdev object
* @config: packet capture config
*
* Return: QDF_STATUS
*/
QDF_STATUS
tgt_pkt_capture_send_config(struct wlan_objmgr_vdev *vdev,
enum pkt_capture_trigger_qos_config config);
#endif
#endif /* _WLAN_PKT_CAPTURE_TGT_API_H */

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
@@ -266,6 +266,28 @@ void ucfg_pkt_capture_record_channel(struct wlan_objmgr_vdev *vdev);
int
ucfg_pkt_capture_register_wma_callbacks(struct wlan_objmgr_psoc *psoc,
struct pkt_capture_callbacks *cb_obj);
#ifdef WLAN_FEATURE_PKT_CAPTURE_V2
/**
* ucfg_pkt_capture_send_config - send packet capture config
* @vdev: pointer to vdev object
* @config: packet capture config
*
* Return: None
*/
QDF_STATUS ucfg_pkt_capture_send_config
(struct wlan_objmgr_vdev *vdev,
enum pkt_capture_trigger_qos_config config);
#else
static inline
QDF_STATUS ucfg_pkt_capture_send_config
(struct wlan_objmgr_vdev *vdev,
enum pkt_capture_trigger_qos_config config)
{
return QDF_STATUS_SUCCESS;
}
#endif
#else
static inline
QDF_STATUS ucfg_pkt_capture_init(void)
@@ -395,5 +417,13 @@ static inline void
ucfg_pkt_capture_record_channel(struct wlan_objmgr_vdev *vdev)
{
}
static inline
QDF_STATUS ucfg_pkt_capture_send_config
(struct wlan_objmgr_vdev *vdev,
enum pkt_capture_trigger_qos_config config)
{
return QDF_STATUS_SUCCESS;
}
#endif /* WLAN_FEATURE_PKT_CAPTURE */
#endif /* _WLAN_PKT_CAPTURE_UCFG_API_H_ */

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 above
@@ -117,3 +117,39 @@ tgt_pkt_capture_send_mode(struct wlan_objmgr_vdev *vdev,
return status;
}
#ifdef WLAN_FEATURE_PKT_CAPTURE_V2
QDF_STATUS
tgt_pkt_capture_send_config(struct wlan_objmgr_vdev *vdev,
enum pkt_capture_trigger_qos_config config)
{
QDF_STATUS status = QDF_STATUS_E_FAILURE;
struct pkt_capture_vdev_priv *vdev_priv;
struct wlan_pkt_capture_tx_ops *tx_ops;
struct wlan_objmgr_psoc *psoc;
psoc = wlan_vdev_get_psoc(vdev);
if (!psoc) {
pkt_capture_err("psoc is NULL");
return status;
}
vdev_priv = pkt_capture_vdev_get_priv(vdev);
if (!vdev_priv) {
pkt_capture_err("vdev priv is NULL");
return status;
}
tx_ops = &vdev_priv->tx_ops;
if (!tx_ops->pkt_capture_send_config)
return status;
status = tx_ops->pkt_capture_send_config(psoc, wlan_vdev_get_id(vdev),
config);
if (QDF_IS_STATUS_ERROR(status))
pkt_capture_err("Unable to send packet capture config to fw");
return status;
}
#endif

View File

@@ -308,3 +308,12 @@ ucfg_pkt_capture_register_wma_callbacks(struct wlan_objmgr_psoc *psoc,
return 0;
}
#ifdef WLAN_FEATURE_PKT_CAPTURE_V2
QDF_STATUS ucfg_pkt_capture_send_config
(struct wlan_objmgr_vdev *vdev,
enum pkt_capture_trigger_qos_config config)
{
return tgt_pkt_capture_send_config(vdev, config);
}
#endif