qcacmn: Add new feature to support protocol tags

With this feature, using appropriate commands, link layer, network layer,
transport layer and some of the application protocols can be tagged with
the user provided tag values for easier identification of protocols. The
supported protocols today are as follows.

ARP, DHCPv4, DHCPv6, DNS over TCP (v4), DNS over TCP (v6), DNS over UDP
(v4), DNS over UDP (v6), ICMPv4, ICMPv6, TCPv4, TCPv6, UDPv4,
UDPv6, IPv4, IPv6, EAP.

Receive packets are tagged by hardware. Tags are applied after the first
matching rule. Hence it is recommended that the rules are
programmed in such a way that tags are configured from application layer
to data link layer to get expected results.

Change-Id: Ibdc2bd2b78234f482074955e89fb93f05988eaca
这个提交包含在:
Karunakar Dasineni
2019-03-19 23:04:59 -07:00
提交者 nshrivas
父节点 c71219ea55
当前提交 142f9baf47
修改 20 个文件,包含 631 行新增12 行删除

查看文件

@@ -26,6 +26,7 @@
#define _CDP_TXRX_CTRL_H_
#include "cdp_txrx_handle.h"
#include "cdp_txrx_cmn_struct.h"
#include "cdp_txrx_cmn.h"
#include "cdp_txrx_ops.h"
static inline int cdp_is_target_ar900b
@@ -702,6 +703,67 @@ cdp_get_pldev(ol_txrx_soc_handle soc,
return soc->ops->ctrl_ops->txrx_get_pldev(pdev);
}
#ifdef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG
/**
* cdp_update_pdev_rx_protocol_tag() - wrapper function to set the protocol
* tag in CDP layer from cfg layer
* @soc: SOC TXRX handle
* @pdev: CDP pdev pointer
* @protocol_mask: Bitmap for protocol for which tagging is enabled
* @protocol_type: Protocol type for which the tag should be update
* @tag: Actual tag value for the given prototype
* Return: Returns QDF_STATUS_SUCCESS/FAILURE
*/
static inline QDF_STATUS
cdp_update_pdev_rx_protocol_tag(ol_txrx_soc_handle soc,
struct cdp_pdev *pdev, uint32_t protocol_mask,
uint16_t protocol_type, uint16_t tag)
{
if (!soc || !soc->ops) {
dp_err("Invalid SOC instance");
QDF_BUG(0);
return QDF_STATUS_E_FAILURE;
}
if (!soc->ops->ctrl_ops ||
!soc->ops->ctrl_ops->txrx_update_pdev_rx_protocol_tag)
return QDF_STATUS_E_FAILURE;
return soc->ops->ctrl_ops->txrx_update_pdev_rx_protocol_tag
(pdev, protocol_mask, protocol_type, tag);
}
#ifdef WLAN_SUPPORT_RX_TAG_STATISTICS
/**
* cdp_dump_pdev_rx_protocol_tag_stats() - wrapper function to dump the protocol
tag statistics for given or all protocols
* @soc: SOC TXRX handle
* @pdev: CDP pdev pointer
* @protocol_type: Protocol type for which the tag should be update
* Return: Returns QDF_STATUS_SUCCESS/FAILURE
*/
static inline QDF_STATUS
cdp_dump_pdev_rx_protocol_tag_stats(ol_txrx_soc_handle soc,
struct cdp_pdev *pdev,
uint16_t protocol_type)
{
if (!soc || !soc->ops) {
dp_err("Invalid SOC instance");
QDF_BUG(0);
return QDF_STATUS_E_FAILURE;
}
if (!soc->ops->ctrl_ops ||
!soc->ops->ctrl_ops->txrx_dump_pdev_rx_protocol_tag_stats)
return QDF_STATUS_E_FAILURE;
soc->ops->ctrl_ops->txrx_dump_pdev_rx_protocol_tag_stats(pdev,
protocol_type);
return QDF_STATUS_SUCCESS;
}
#endif /* WLAN_SUPPORT_RX_TAG_STATISTICS */
#endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
#ifdef ATH_SUPPORT_NAC_RSSI
/**
* cdp_vdev_config_for_nac_rssi(): To invoke dp callback for nac rssi config