diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h index 77bff76158..e135a0d6aa 100644 --- a/dp/inc/cdp_txrx_cmn_struct.h +++ b/dp/inc/cdp_txrx_cmn_struct.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-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 @@ -1106,6 +1106,8 @@ enum cdp_pdev_param_type { * @cdp_vdev_param_drop_unenc: set drop unencrypted flag * @cdp_vdev_param_hlos_tid_override: set hlos tid override * @cdp_vdev_param_peer_authorize: set peer authorize + * @cdp_vdev_param_peer_tid_latency_enable: set peer tid latency enable flag + * @cdp_vdev_param_mesh_tid: config tatency tid on vdev * * @cdp_pdev_param_dbg_snf: Enable debug sniffer feature * @cdp_pdev_param_bpr_enable: Enable bcast probe feature @@ -1173,6 +1175,8 @@ typedef union cdp_config_param_t { uint8_t cdp_vdev_param_hlos_tid_override; bool cdp_vdev_param_wds_ext; uint8_t cdp_vdev_param_peer_authorize; + uint8_t cdp_vdev_param_peer_tid_latency_enable; + uint8_t cdp_vdev_param_mesh_tid; /* pdev params */ bool cdp_pdev_param_cptr_latcy; @@ -1285,6 +1289,8 @@ enum cdp_pdev_bpr_param { * @CDP_ENABLE_HLOS_TID_OVERRIDE: set hlos tid override flag * @CDP_CFG_WDS_EXT: enable/disable wds ext feature * @CDP_ENABLE_PEER_AUTHORIZE: enable peer authorize flag + * @CDP_ENABLE_PEER_TID_LATENCY: set peer tid latency enable flag + * @CDP_SET_VAP_MESH_TID : Set latency tid in vap */ enum cdp_vdev_param_type { CDP_ENABLE_NAWDS, @@ -1316,6 +1322,10 @@ enum cdp_vdev_param_type { CDP_CFG_WDS_EXT, #endif /* QCA_SUPPORT_WDS_EXTENDED */ CDP_ENABLE_PEER_AUTHORIZE, +#ifdef WLAN_SUPPORT_MESH_LATENCY + CDP_ENABLE_PEER_TID_LATENCY, + CDP_SET_VAP_MESH_TID, +#endif }; /* diff --git a/dp/inc/cdp_txrx_mesh_latency.h b/dp/inc/cdp_txrx_mesh_latency.h new file mode 100644 index 0000000000..14f951de47 --- /dev/null +++ b/dp/inc/cdp_txrx_mesh_latency.h @@ -0,0 +1,57 @@ +/* + * 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 copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/** + * @file cdp_txrx_mesh_latency.h + * @brief Define the host data path MESH latency API functions + * called by the host control SW and the OS interface module + */ +#ifndef _CDP_TXRX_MESH_LATENCY_H_ +#define _CDP_TXRX_MESH_LATENCY_H_ +#include "cdp_txrx_handle.h" +#ifdef WLAN_SUPPORT_MESH_LATENCY +/** + * @brief find MSCS enabled peer for this mac address and validate priority + * @details + * This function updates per peer per TID mesh latency related parameters. + * + * @param dest_mac - destination mac address + * @param service_interval - Service Interval per tid + * @param burst_size - Burst size per tid + * @param priority - user priority combination of tid and msdu queue + * #add_or_sub - indicates to add or substract latency parameter + * @return - 0 for non error case, -1 for failure + */ +static inline QDF_STATUS +cdp_mesh_latency_update_peer_parameter(ol_txrx_soc_handle soc, + uint8_t *dest_mac, uint32_t service_interval, + uint32_t burst_size, uint16_t priority, uint8_t add_or_sub) +{ + if (!soc || !soc->ops || !soc->ops->mesh_latency_ops) { + return 1; + } + + if (soc->ops->mesh_latency_ops->mesh_latency_update_peer_parameter) + return soc->ops->mesh_latency_ops-> + mesh_latency_update_peer_parameter(soc, + dest_mac, service_interval, + burst_size, priority, add_or_sub); + return 0; +} +#endif +#endif diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index 36e66d5cc0..4045460142 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -1153,6 +1153,13 @@ struct ol_if_ops { uint16_t peer_id, uint8_t vdev_id, uint8_t *peer_macaddr); #endif /* QCA_SUPPORT_WDS_EXTENDED */ +#ifdef WLAN_SUPPORT_MESH_LATENCY + QDF_STATUS(*peer_update_mesh_latency_params)( + struct cdp_ctrl_objmgr_psoc *psoc, + uint8_t vdev_id, uint8_t *peer_mac, uint8_t tid, + uint32_t service_interval, uint32_t burst_size, + uint8_t add_or_sub, uint8_t ac); +#endif }; #ifdef DP_PEER_EXTENDED_API @@ -1710,6 +1717,20 @@ struct cdp_mscs_ops { }; #endif +#ifdef WLAN_SUPPORT_MESH_LATENCY +/** + * struct cdp_mesh_latency_ops - data path ops for Mesh latency + * @mesh_latency_update_peer_parameter: + */ +struct cdp_mesh_latency_ops { + QDF_STATUS (*mesh_latency_update_peer_parameter)( + struct cdp_soc_t *soc, + uint8_t *dest_mac, uint32_t service_interval, + uint32_t burst_size, uint16_t priority, + uint8_t add_or_sub); +}; +#endif + struct cdp_ops { struct cdp_cmn_ops *cmn_drv_ops; struct cdp_ctrl_ops *ctrl_ops; @@ -1748,6 +1769,9 @@ struct cdp_ops { #ifdef WLAN_SUPPORT_MSCS struct cdp_mscs_ops *mscs_ops; #endif +#ifdef WLAN_SUPPORT_MESH_LATENCY + struct cdp_mesh_latency_ops *mesh_latency_ops; +#endif }; #endif diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 2fa0d5adf2..be83cff5be 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -71,6 +71,9 @@ cdp_dump_flow_pool_info(struct cdp_soc_t *soc) #ifdef WLAN_SUPPORT_MSCS #include "dp_mscs.h" #endif +#ifdef WLAN_SUPPORT_MESH_LATENCY +#include "dp_mesh_latency.h" +#endif #ifdef ATH_SUPPORT_IQUE #include "dp_txrx_me.h" #endif @@ -9133,6 +9136,16 @@ static QDF_STATUS dp_get_vdev_param(struct cdp_soc_t *cdp_soc, uint8_t vdev_id, val->cdp_vdev_param_peer_authorize = vdev->peer_authorize; break; +#ifdef WLAN_SUPPORT_MESH_LATENCY + case CDP_ENABLE_PEER_TID_LATENCY: + val->cdp_vdev_param_peer_tid_latency_enable = + vdev->peer_tid_latency_enabled; + break; + case CDP_SET_VAP_MESH_TID: + val->cdp_vdev_param_mesh_tid = + vdev->mesh_tid_latency_config.latency_tid; + break; +#endif default: dp_cdp_err("%pk: param value %d is wrong\n", soc, param); @@ -9263,6 +9276,20 @@ dp_set_vdev_param(struct cdp_soc_t *cdp_soc, uint8_t vdev_id, case CDP_ENABLE_PEER_AUTHORIZE: vdev->peer_authorize = val.cdp_vdev_param_peer_authorize; break; +#ifdef WLAN_SUPPORT_MESH_LATENCY + case CDP_ENABLE_PEER_TID_LATENCY: + dp_info("vdev_id %d enable peer tid latency %d", vdev_id, + val.cdp_vdev_param_peer_tid_latency_enable); + vdev->peer_tid_latency_enabled = + val.cdp_vdev_param_peer_tid_latency_enable; + break; + case CDP_SET_VAP_MESH_TID: + dp_info("vdev_id %d enable peer tid latency %d", vdev_id, + val.cdp_vdev_param_mesh_tid); + vdev->mesh_tid_latency_config.latency_tid + = val.cdp_vdev_param_mesh_tid; + break; +#endif default: break; } @@ -11388,6 +11415,13 @@ static struct cdp_mscs_ops dp_ops_mscs = { }; #endif +#ifdef WLAN_SUPPORT_MESH_LATENCY +static struct cdp_mesh_latency_ops dp_ops_mesh_latency = { + .mesh_latency_update_peer_parameter = + dp_mesh_latency_update_peer_parameter, +}; +#endif + #ifdef FEATURE_RUNTIME_PM /** * dp_runtime_suspend() - ensure DP is ready to runtime suspend @@ -12069,6 +12103,9 @@ static struct cdp_ops dp_txrx_ops = { #ifdef WLAN_SUPPORT_MSCS .mscs_ops = &dp_ops_mscs, #endif +#ifdef WLAN_SUPPORT_MESH_LATENCY + .mesh_latency_ops = &dp_ops_mesh_latency, +#endif }; /* diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index c787f18db2..aa18972703 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -2592,6 +2592,15 @@ struct dp_vdev { qdf_atomic_t ref_cnt; qdf_atomic_t mod_refs[DP_MOD_ID_MAX]; uint8_t num_latency_critical_conn; +#ifdef WLAN_SUPPORT_MESH_LATENCY + uint8_t peer_tid_latency_enabled; + /* tid latency configuration parameters */ + struct { + uint32_t service_interval; + uint32_t burst_size; + uint8_t latency_tid; + } mesh_tid_latency_config; +#endif }; @@ -2712,6 +2721,26 @@ struct dp_wds_ext_peer { }; #endif /* QCA_SUPPORT_WDS_EXTENDED */ +#ifdef WLAN_SUPPORT_MESH_LATENCY +/*Advanced Mesh latency feature based macros */ +/* + * struct dp_peer_mesh_latency parameter - Mesh latency related + * parameters. This data is updated per peer per TID based on + * the flow tuple classification in external rule database + * during packet processing. + * @service_interval - Service interval associated with TID + * @burst_size - Burst size additive over multiple flows + * @ac - custom ac derived from service interval + * @msduq - MSDU queue number within TID + */ +struct dp_peer_mesh_latency_parameter { + uint32_t service_interval; + uint32_t burst_size; + uint8_t ac; + uint8_t msduq; +}; +#endif + /* Peer structure for data path state */ struct dp_peer { /* VDEV to which this peer is associated */ @@ -2837,6 +2866,9 @@ struct dp_peer { struct dp_wds_ext_peer wds_ext; ol_txrx_rx_fp osif_rx; #endif +#ifdef WLAN_SUPPORT_MESH_LATENCY + struct dp_peer_mesh_latency_parameter mesh_latency_params[DP_MAX_TIDS]; +#endif }; /*