diff --git a/drivers/staging/qca-wifi-host-cmn/dp/inc/cdp_txrx_cmn.h b/drivers/staging/qca-wifi-host-cmn/dp/inc/cdp_txrx_cmn.h index 5bd16a267db6..0fda782b97e4 100644 --- a/drivers/staging/qca-wifi-host-cmn/dp/inc/cdp_txrx_cmn.h +++ b/drivers/staging/qca-wifi-host-cmn/dp/inc/cdp_txrx_cmn.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. 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 @@ -2047,6 +2047,30 @@ cdp_txrx_set_pdev_status_down(ol_txrx_soc_handle soc, is_pdev_down); } +/** + * cdp_set_tx_pause() - Pause or resume tx path + * @soc_hdl: Datapath soc handle + * @flag: set or clear is_tx_pause + * + * Return: None. + */ +static inline +void cdp_set_tx_pause(ol_txrx_soc_handle soc, bool flag) +{ + if (!soc || !soc->ops) { + QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, + "%s: Invalid Instance:", __func__); + QDF_BUG(0); + return; + } + + if (!soc->ops->cmn_drv_ops || + !soc->ops->cmn_drv_ops->set_tx_pause) + return; + + soc->ops->cmn_drv_ops->set_tx_pause(soc, flag); +} + /** * cdp_tx_send() - enqueue frame for transmission * @soc: soc opaque handle diff --git a/drivers/staging/qca-wifi-host-cmn/dp/inc/cdp_txrx_ops.h b/drivers/staging/qca-wifi-host-cmn/dp/inc/cdp_txrx_ops.h index 70f69eaa8582..d857ba819ed3 100644 --- a/drivers/staging/qca-wifi-host-cmn/dp/inc/cdp_txrx_ops.h +++ b/drivers/staging/qca-wifi-host-cmn/dp/inc/cdp_txrx_ops.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. 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 @@ -519,6 +519,9 @@ struct cdp_cmn_ops { uint32_t value); ol_txrx_tx_fp tx_send; + + void (*set_tx_pause)(ol_txrx_soc_handle soc, bool flag); + /** * txrx_get_os_rx_handles_from_vdev() - Return function, osif vdev * to deliver pkt to stack. diff --git a/drivers/staging/qca-wifi-host-cmn/dp/wifi3.0/dp_main.c b/drivers/staging/qca-wifi-host-cmn/dp/wifi3.0/dp_main.c index 4451f5f47a76..7016cfacc9e6 100644 --- a/drivers/staging/qca-wifi-host-cmn/dp/wifi3.0/dp_main.c +++ b/drivers/staging/qca-wifi-host-cmn/dp/wifi3.0/dp_main.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. 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 @@ -11339,6 +11339,21 @@ dp_set_pkt_capture_mode(struct cdp_soc_t *soc_handle, bool val) } #endif +/** + * dp_set_tx_pause() - Pause or resume tx path + * @soc_hdl: Datapath soc handle + * @flag: set or clear is_tx_pause + * + * Return: None. + */ +static inline +void dp_set_tx_pause(struct cdp_soc_t *soc_hdl, bool flag) +{ + struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl); + + soc->is_tx_pause = flag; +} + static struct cdp_cmn_ops dp_ops_cmn = { .txrx_soc_attach_target = dp_soc_attach_target_wifi3, .txrx_vdev_attach = dp_vdev_attach_wifi3, @@ -11411,6 +11426,7 @@ static struct cdp_cmn_ops dp_ops_cmn = { .txrx_set_ba_aging_timeout = dp_set_ba_aging_timeout, .txrx_get_ba_aging_timeout = dp_get_ba_aging_timeout, .tx_send = dp_tx_send, + .set_tx_pause = dp_set_tx_pause, .txrx_peer_reset_ast = dp_wds_reset_ast_wifi3, .txrx_peer_reset_ast_table = dp_wds_reset_ast_table_wifi3, .txrx_peer_flush_ast_table = dp_wds_flush_ast_table_wifi3, diff --git a/drivers/staging/qca-wifi-host-cmn/dp/wifi3.0/dp_rx.c b/drivers/staging/qca-wifi-host-cmn/dp/wifi3.0/dp_rx.c index 352832d0b6c4..2ad820e6703a 100644 --- a/drivers/staging/qca-wifi-host-cmn/dp/wifi3.0/dp_rx.c +++ b/drivers/staging/qca-wifi-host-cmn/dp/wifi3.0/dp_rx.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. 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 @@ -643,7 +643,8 @@ dp_rx_intrabss_fwd(struct dp_soc *soc, } } - if (!dp_tx_send((struct cdp_soc_t *)soc, + if (!soc->is_tx_pause && + !dp_tx_send((struct cdp_soc_t *)soc, ta_peer->vdev->vdev_id, nbuf)) { DP_STATS_INC_PKT(ta_peer, rx.intra_bss.pkts, 1, len); @@ -684,17 +685,18 @@ dp_rx_intrabss_fwd(struct dp_soc *soc, /* Set cb->ftype to intrabss FWD */ qdf_nbuf_set_tx_ftype(nbuf_copy, CB_FTYPE_INTRABSS_FWD); - if (dp_tx_send((struct cdp_soc_t *)soc, - ta_peer->vdev->vdev_id, nbuf_copy)) { + + if (!soc->is_tx_pause && !dp_tx_send((struct cdp_soc_t *)soc, + ta_peer->vdev->vdev_id, + nbuf_copy)) { + DP_STATS_INC_PKT(ta_peer, rx.intra_bss.pkts, 1, len); + tid_stats->intrabss_cnt++; + } else { DP_STATS_INC_PKT(ta_peer, rx.intra_bss.fail, 1, len); tid_stats->fail_cnt[INTRABSS_DROP]++; qdf_nbuf_free(nbuf_copy); - } else { - DP_STATS_INC_PKT(ta_peer, rx.intra_bss.pkts, 1, len); - tid_stats->intrabss_cnt++; } } - end: /* return false as we have to still send the original pkt * up the stack diff --git a/drivers/staging/qca-wifi-host-cmn/dp/wifi3.0/dp_types.h b/drivers/staging/qca-wifi-host-cmn/dp/wifi3.0/dp_types.h index 637801776a70..ed8306bc8b3b 100644 --- a/drivers/staging/qca-wifi-host-cmn/dp/wifi3.0/dp_types.h +++ b/drivers/staging/qca-wifi-host-cmn/dp/wifi3.0/dp_types.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. 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 @@ -1926,6 +1926,7 @@ struct dp_soc { qdf_spinlock_t reo_desc_deferred_freelist_lock; bool reo_desc_deferred_freelist_init; #endif + bool is_tx_pause; }; #ifdef IPA_OFFLOAD diff --git a/drivers/staging/qca-wifi-host-cmn/umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c b/drivers/staging/qca-wifi-host-cmn/umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c index 10b0805bbae6..843c042f6cc9 100644 --- a/drivers/staging/qca-wifi-host-cmn/umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c +++ b/drivers/staging/qca-wifi-host-cmn/umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c @@ -88,7 +88,7 @@ #define CM_OCE_WAN_WEIGHTAGE 2 #define CM_OCE_AP_TX_POWER_WEIGHTAGE 5 #define CM_OCE_SUBNET_ID_WEIGHTAGE 3 -#define CM_SAE_PK_AP_WEIGHTAGE 3 +#define CM_SAE_PK_AP_WEIGHTAGE 30 #define CM_BEST_CANDIDATE_MAX_WEIGHT 200 #define CM_MAX_PCT_SCORE 100 #define CM_MAX_INDEX_PER_INI 4 diff --git a/drivers/staging/qca-wifi-host-cmn/umac/mlme/connection_mgr/dispatcher/inc/cfg_mlme_score_params.h b/drivers/staging/qca-wifi-host-cmn/umac/mlme/connection_mgr/dispatcher/inc/cfg_mlme_score_params.h index 44cc92f4eeb0..1e1e4a522723 100644 --- a/drivers/staging/qca-wifi-host-cmn/umac/mlme/connection_mgr/dispatcher/inc/cfg_mlme_score_params.h +++ b/drivers/staging/qca-wifi-host-cmn/umac/mlme/connection_mgr/dispatcher/inc/cfg_mlme_score_params.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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 @@ -384,8 +385,8 @@ * * sae_pk_ap_weightage - update scoring param based on SAE PK ap weightage * @Min: 0 - * @Max: 10 - * @Default: 3 + * @Max: 30 + * @Default: 30 * * This ini is used to calculate SAE PK ap weightage in roam score. SAE Public * Key (SAE-PK) authentication is an extension of SAE that is intended for use @@ -405,8 +406,8 @@ #define CFG_SAE_PK_AP_WEIGHTAGE CFG_INI_UINT( \ "sae_pk_ap_weightage", \ 0, \ - 10, \ - PLATFORM_VALUE(3, 0), \ + 30, \ + PLATFORM_VALUE(30, 0), \ CFG_VALUE_OR_DEFAULT,\ "SAE-PK AP weightage")