From abc88bbfd1147ba55a8496a80ff897abed9ebb20 Mon Sep 17 00:00:00 2001 From: Jia Ding Date: Tue, 26 Apr 2022 10:46:17 +0800 Subject: [PATCH 01/20] qcacmn: Add uplink delay attribute in QCA vendor command get_sta_info responses Add uplink delay attribute in responses of QCA_NL80211_VENDOR_SUBCMD_GET_STA_INFO vendor command. Change-Id: I9f1d6f1a8e9135ed18949759a837c866005b43c5 CRs-Fixed: 2990880 --- os_if/linux/qca_vendor.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/os_if/linux/qca_vendor.h b/os_if/linux/qca_vendor.h index 6bc43a97f3b6..3218da32e59d 100644 --- a/os_if/linux/qca_vendor.h +++ b/os_if/linux/qca_vendor.h @@ -10468,6 +10468,11 @@ enum qca_vendor_wlan_sta_guard_interval { * failed roam invoke. Different roam invoke failure reason codes * are specified in enum qca_vendor_roam_invoke_fail_reasons. This can be * queried either in connected state or disconnected state. + * + * @QCA_WLAN_VENDOR_ATTR_GET_STA_INFO_UPLINK_DELAY: u32, used in STA mode only. + * This represents the average congestion duration of uplink frames in MAC + * queue in unit of ms. This can be queried either in connected state or + * disconnected state. */ enum qca_wlan_vendor_attr_get_sta_info { QCA_WLAN_VENDOR_ATTR_GET_STA_INFO_INVALID = 0, @@ -10517,6 +10522,7 @@ enum qca_wlan_vendor_attr_get_sta_info { QCA_WLAN_VENDOR_ATTR_GET_STA_INFO_ROAM_TRIGGER_REASON = 47, QCA_WLAN_VENDOR_ATTR_GET_STA_INFO_ROAM_FAIL_REASON = 48, QCA_WLAN_VENDOR_ATTR_GET_STA_INFO_ROAM_INVOKE_FAIL_REASON = 49, + QCA_WLAN_VENDOR_ATTR_GET_STA_INFO_UPLINK_DELAY = 50, /* keep last */ QCA_WLAN_VENDOR_ATTR_GET_STA_INFO_AFTER_LAST, From 0c4768e17a5696849244a5af7fe51152b64b94a5 Mon Sep 17 00:00:00 2001 From: Jia Ding Date: Tue, 26 Apr 2022 10:38:58 +0800 Subject: [PATCH 02/20] qcacmn: Add channel load percentage attribute into QCA vendor command Add channel load percentage attribute in enum ll_stats_results. Change-Id: Ib3603730e93d70ab1adc384b0c438f198fc889e9 CRs-Fixed: 2990868 --- os_if/linux/qca_vendor.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/os_if/linux/qca_vendor.h b/os_if/linux/qca_vendor.h index 3218da32e59d..3b38e8e06b27 100644 --- a/os_if/linux/qca_vendor.h +++ b/os_if/linux/qca_vendor.h @@ -2249,6 +2249,8 @@ enum qca_wlan_vendor_attr_ll_stats_results_type { * @QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_RX_TIME: Unsigned int 32bit * value representing total number of msecs the radio is receiving all * 802.11 frames intended for this device on this channel. + * @QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_LOAD_PERCENTAGE: u8 value + * representing the channel load percentage. Possible values are 0-100. * @QCA_WLAN_VENDOR_ATTR_LL_STATS_AFTER_LAST: After last * @QCA_WLAN_VENDOR_ATTR_FEATURE_SET_MAX: Max value */ @@ -2356,6 +2358,7 @@ enum qca_wlan_vendor_attr_ll_stats_results { QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_TX_TIME = 84, QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_RX_TIME = 85, + QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_LOAD_PERCENTAGE = 86, /* keep last */ QCA_WLAN_VENDOR_ATTR_LL_STATS_AFTER_LAST, From d7b2a52591bf4373f7892717ace2185deb5b1b86 Mon Sep 17 00:00:00 2001 From: Jia Ding Date: Tue, 26 Apr 2022 10:41:50 +0800 Subject: [PATCH 03/20] qcacmn: Extend QCA vendor command for TSF to enable and disable auto report Add TSF cmd to enable and disable automatic TSF report from the target to the host. Change-Id: I17b255299f55b8e78968d951824726d533a7c6e9 CRs-Fixed: 2991909 --- os_if/linux/qca_vendor.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/os_if/linux/qca_vendor.h b/os_if/linux/qca_vendor.h index 3b38e8e06b27..be1da4fa3206 100644 --- a/os_if/linux/qca_vendor.h +++ b/os_if/linux/qca_vendor.h @@ -5558,11 +5558,22 @@ enum qca_vendor_attr_tsf_cmd { * @QCA_TSF_CAPTURE: Initiate TSF Capture * @QCA_TSF_GET: Get TSF capture value * @QCA_TSF_SYNC_GET: Initiate TSF capture and return with captured value + * @QCA_TSF_AUTO_REPORT_ENABLE: Used in STA mode only. Once set, the target + * will automatically send TSF report to the host. To query + * QCA_WLAN_VENDOR_ATTR_GET_STA_INFO_UPLINK_DELAY, this operation needs to be + * initiated first. + * @QCA_TSF_AUTO_REPORT_DISABLE: Used in STA mode only. Once set, the target + * will not automatically send TSF report to the host. If + * QCA_TSF_AUTO_REPORT_ENABLE is initiated and + * QCA_WLAN_VENDOR_ATTR_GET_STA_INFO_UPLINK_DELAY is not queried anymore, this + * operation needs to be initiated. */ enum qca_tsf_cmd { QCA_TSF_CAPTURE, QCA_TSF_GET, QCA_TSF_SYNC_GET, + QCA_TSF_AUTO_REPORT_ENABLE, + QCA_TSF_AUTO_REPORT_DISABLE, }; /** From 80e3b667ebb5dc9076887d1388393aac6d3020b4 Mon Sep 17 00:00:00 2001 From: Jia Ding Date: Tue, 26 Apr 2022 09:50:22 +0800 Subject: [PATCH 04/20] qcacmn: Get buffer_timestamp from wbm release ring Upon TX completion, get buffer_timestamp from wbm release ring descriptor. Change-Id: I0203b51c52a265711e62afc3a940392674ac014a CRs-Fixed: 2978492 --- hal/wifi3.0/hal_generic_api.h | 18 ++++++++++++++++++ hal/wifi3.0/hal_tx.h | 6 ++++++ 2 files changed, 24 insertions(+) diff --git a/hal/wifi3.0/hal_generic_api.h b/hal/wifi3.0/hal_generic_api.h index 2ecaaa06c8a1..2e7315447d00 100644 --- a/hal/wifi3.0/hal_generic_api.h +++ b/hal/wifi3.0/hal_generic_api.h @@ -21,6 +21,22 @@ #include +#ifdef WLAN_FEATURE_TSF_UPLINK_DELAY +static inline void +hal_tx_comp_get_buffer_timestamp(void *desc, + struct hal_tx_completion_status *ts) +{ + ts->buffer_timestamp = HAL_TX_DESC_GET(desc, WBM_RELEASE_RING_4, + BUFFER_TIMESTAMP); +} +#else /* !WLAN_FEATURE_TSF_UPLINK_DELAY */ +static inline void +hal_tx_comp_get_buffer_timestamp(void *desc, + struct hal_tx_completion_status *ts) +{ +} +#endif /* WLAN_FEATURE_TSF_UPLINK_DELAY */ + /** * hal_tx_comp_get_status() - TQM Release reason * @hal_desc: completion ring Tx status @@ -88,6 +104,8 @@ void hal_tx_comp_get_status_generic(void *desc, ts->tsf = HAL_TX_DESC_GET(desc, UNIFIED_WBM_RELEASE_RING_6, TX_RATE_STATS_INFO_TX_RATE_STATS); + + hal_tx_comp_get_buffer_timestamp(desc, ts); } /** diff --git a/hal/wifi3.0/hal_tx.h b/hal/wifi3.0/hal_tx.h index 7cc5e61033b0..fde6f2bdb0fe 100644 --- a/hal/wifi3.0/hal_tx.h +++ b/hal/wifi3.0/hal_tx.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -165,6 +166,8 @@ enum hal_tx_ret_buf_manager { * @transmit_cnt: Number of times this frame has been transmitted * @tid: TID of the flow or MPDU queue * @peer_id: Peer ID of the flow or MPDU queue + * @buffer_timestamp: Frame system entrance timestamp in units of 1024 + * microseconds */ struct hal_tx_completion_status { uint8_t status; @@ -187,6 +190,9 @@ struct hal_tx_completion_status { uint8_t transmit_cnt; uint8_t tid; uint16_t peer_id; +#ifdef WLAN_FEATURE_TSF_UPLINK_DELAY + uint32_t buffer_timestamp:19; +#endif }; /** From 5a4270c91417de6425bfc4b307f492aa48483581 Mon Sep 17 00:00:00 2001 From: Jia Ding Date: Tue, 26 Apr 2022 10:07:46 +0800 Subject: [PATCH 05/20] qcacmn: Add support to calculate uplink delay Add support to calculate uplink delay on a per vdev basis. The delay calculated excludes bus delays, where packet enqueueing time and complete time are fetched from HW release ring. Change-Id: I4bbcbf28b197f7a87cb822a841f1f957ebcf063b CRs-Fixed: 2958833 --- dp/inc/cdp_txrx_ctrl.h | 83 +++++++++++++++++++++++++ dp/inc/cdp_txrx_ops.h | 13 +++- dp/wifi3.0/dp_main.c | 5 ++ dp/wifi3.0/dp_tx.c | 134 +++++++++++++++++++++++++++++++++++++++++ dp/wifi3.0/dp_tx.h | 37 ++++++++++++ dp/wifi3.0/dp_types.h | 13 +++- 6 files changed, 283 insertions(+), 2 deletions(-) diff --git a/dp/inc/cdp_txrx_ctrl.h b/dp/inc/cdp_txrx_ctrl.h index c719318b6483..a2a8aa578b29 100644 --- a/dp/inc/cdp_txrx_ctrl.h +++ b/dp/inc/cdp_txrx_ctrl.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -1217,4 +1218,86 @@ cdp_dump_rx_flow_tag_stats(ol_txrx_soc_handle soc, uint8_t pdev_id, flow_info); } #endif /* WLAN_SUPPORT_RX_FLOW_TAG */ + +#ifdef WLAN_FEATURE_TSF_UPLINK_DELAY +/** + * cdp_set_delta_tsf() - wrapper function to set delta_tsf + * @soc: SOC TXRX handle + * @vdev_id: vdev id + * @delta_tsf: difference between TSF clock and qtimer + * + * Return: None + */ +static inline void cdp_set_delta_tsf(ol_txrx_soc_handle soc, uint8_t vdev_id, + uint32_t delta_tsf) +{ + if (!soc || !soc->ops) { + dp_cdp_err("Invalid instance"); + QDF_BUG(0); + return; + } + + if (!soc->ops->ctrl_ops || + !soc->ops->ctrl_ops->txrx_set_delta_tsf) + return; + + soc->ops->ctrl_ops->txrx_set_delta_tsf(soc, vdev_id, delta_tsf); +} + +/** + * cdp_set_tsf_ul_delay_report() - Enable or disable reporting uplink delay + * @soc: SOC TXRX handle + * @vdev_id: vdev id + * @enable: true to enable and false to disable + * + * Return: QDF_STATUS + */ +static inline QDF_STATUS cdp_set_tsf_ul_delay_report(ol_txrx_soc_handle soc, + uint8_t vdev_id, + bool enable) +{ + if (!soc || !soc->ops) { + dp_cdp_err("Invalid SOC instance"); + QDF_BUG(0); + return QDF_STATUS_E_FAILURE; + } + + if (!soc->ops->ctrl_ops || + !soc->ops->ctrl_ops->txrx_set_tsf_ul_delay_report) + return QDF_STATUS_E_FAILURE; + + return soc->ops->ctrl_ops->txrx_set_tsf_ul_delay_report(soc, vdev_id, + enable); +} + +/** + * cdp_get_uplink_delay() - Get uplink delay value + * @soc: SOC TXRX handle + * @vdev_id: vdev id + * @val: pointer to save uplink delay value + * + * Return: QDF_STATUS + */ +static inline QDF_STATUS cdp_get_uplink_delay(ol_txrx_soc_handle soc, + uint32_t vdev_id, uint32_t *val) +{ + if (!soc || !soc->ops) { + dp_cdp_err("Invalid SOC instance"); + QDF_BUG(0); + return QDF_STATUS_E_FAILURE; + } + + if (!val) { + dp_cdp_err("Invalid params val"); + return QDF_STATUS_E_FAILURE; + } + + if (!soc->ops->ctrl_ops || + !soc->ops->ctrl_ops->txrx_get_uplink_delay) + return QDF_STATUS_E_FAILURE; + + return soc->ops->ctrl_ops->txrx_get_uplink_delay(soc, vdev_id, val); +} +#endif /* WLAN_FEATURE_TSF_UPLINK_DELAY */ + #endif /* _CDP_TXRX_CTRL_H_ */ diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index 921876d0a690..85589c1f2c6d 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/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. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -794,6 +794,17 @@ struct cdp_ctrl_ops { int8_t vdev_id); #endif + +#ifdef WLAN_FEATURE_TSF_UPLINK_DELAY + void (*txrx_set_delta_tsf)(struct cdp_soc_t *soc, uint8_t vdev_id, + uint32_t delta_tsf); + QDF_STATUS (*txrx_set_tsf_ul_delay_report)(struct cdp_soc_t *soc, + uint8_t vdev_id, + bool enable); + QDF_STATUS (*txrx_get_uplink_delay)(struct cdp_soc_t *soc, + uint8_t vdev_id, + uint32_t *val); +#endif }; struct cdp_me_ops { diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 12b27e5bb9f2..4b50d78c5779 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -11475,6 +11475,11 @@ static struct cdp_ctrl_ops dp_ops_ctrl = { .txrx_update_peer_pkt_capture_params = dp_peer_update_pkt_capture_params, #endif /* WLAN_TX_PKT_CAPTURE_ENH || WLAN_RX_PKT_CAPTURE_ENH */ +#ifdef WLAN_FEATURE_TSF_UPLINK_DELAY + .txrx_set_delta_tsf = dp_set_delta_tsf, + .txrx_set_tsf_ul_delay_report = dp_set_tsf_ul_delay_report, + .txrx_get_uplink_delay = dp_get_uplink_delay, +#endif }; static struct cdp_me_ops dp_ops_me = { diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index a499384d3dd4..817ffbf37de0 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -4399,6 +4400,138 @@ void dp_tx_update_connectivity_stats(struct dp_soc *soc, } #endif +#ifdef WLAN_FEATURE_TSF_UPLINK_DELAY +void dp_set_delta_tsf(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, + uint32_t delta_tsf) +{ + struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl); + struct dp_vdev *vdev = dp_vdev_get_ref_by_id(soc, vdev_id, + DP_MOD_ID_CDP); + + if (!vdev) { + dp_err_rl("vdev %d does not exist", vdev_id); + return; + } + + vdev->delta_tsf = delta_tsf; + dp_debug("vdev id %u delta_tsf %u", vdev_id, delta_tsf); + + dp_vdev_unref_delete(soc, vdev, DP_MOD_ID_CDP); +} + +QDF_STATUS dp_set_tsf_ul_delay_report(struct cdp_soc_t *soc_hdl, + uint8_t vdev_id, bool enable) +{ + struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl); + struct dp_vdev *vdev = dp_vdev_get_ref_by_id(soc, vdev_id, + DP_MOD_ID_CDP); + + if (!vdev) { + dp_err_rl("vdev %d does not exist", vdev_id); + return QDF_STATUS_E_FAILURE; + } + + qdf_atomic_set(&vdev->ul_delay_report, enable); + + dp_vdev_unref_delete(soc, vdev, DP_MOD_ID_CDP); + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS dp_get_uplink_delay(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, + uint32_t *val) +{ + struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl); + struct dp_vdev *vdev; + uint32_t delay_accum; + uint32_t pkts_accum; + + vdev = dp_vdev_get_ref_by_id(soc, vdev_id, DP_MOD_ID_CDP); + if (!vdev) { + dp_err_rl("vdev %d does not exist", vdev_id); + return QDF_STATUS_E_FAILURE; + } + + if (!qdf_atomic_read(&vdev->ul_delay_report)) { + dp_vdev_unref_delete(soc, vdev, DP_MOD_ID_CDP); + return QDF_STATUS_E_FAILURE; + } + + /* Average uplink delay based on current accumulated values */ + delay_accum = qdf_atomic_read(&vdev->ul_delay_accum); + pkts_accum = qdf_atomic_read(&vdev->ul_pkts_accum); + + *val = delay_accum / pkts_accum; + dp_debug("uplink_delay %u delay_accum %u pkts_accum %u", *val, + delay_accum, pkts_accum); + + /* Reset accumulated values to 0 */ + qdf_atomic_set(&vdev->ul_delay_accum, 0); + qdf_atomic_set(&vdev->ul_pkts_accum, 0); + + dp_vdev_unref_delete(soc, vdev, DP_MOD_ID_CDP); + + return QDF_STATUS_SUCCESS; +} + +static void dp_tx_update_uplink_delay(struct dp_soc *soc, struct dp_vdev *vdev, + struct hal_tx_completion_status *ts) +{ + uint32_t buffer_ts; + uint32_t delta_tsf; + uint32_t ul_delay; + + /* Tx_rate_stats_info_valid is 0 and tsf is invalid then */ + if (!ts->valid) + return; + + if (qdf_unlikely(!vdev)) { + dp_info_rl("vdev is null or delete in progrss"); + return; + } + + if (!qdf_atomic_read(&vdev->ul_delay_report)) + return; + + delta_tsf = vdev->delta_tsf; + + /* buffer_timestamp is in units of 1024 us and is [31:13] of + * WBM_RELEASE_RING_4. After left shift 10 bits, it's + * valid up to 29 bits. + */ + buffer_ts = ts->buffer_timestamp << 10; + + ul_delay = ts->tsf - buffer_ts - delta_tsf; + ul_delay &= 0x1FFFFFFF; /* mask 29 BITS */ + if (ul_delay > 0x1000000) { + dp_info_rl("----------------------\n" + "Tx completion status:\n" + "----------------------\n" + "release_src = %d\n" + "ppdu_id = 0x%x\n" + "release_reason = %d\n" + "tsf = %u (0x%x)\n" + "buffer_timestamp = %u (0x%x)\n" + "delta_tsf = %u (0x%x)\n", + ts->release_src, ts->ppdu_id, ts->status, + ts->tsf, ts->tsf, ts->buffer_timestamp, + ts->buffer_timestamp, delta_tsf, delta_tsf); + return; + } + + ul_delay /= 1000; /* in unit of ms */ + + qdf_atomic_add(ul_delay, &vdev->ul_delay_accum); + qdf_atomic_inc(&vdev->ul_pkts_accum); +} +#else /* !WLAN_FEATURE_TSF_UPLINK_DELAY */ +static inline +void dp_tx_update_uplink_delay(struct dp_soc *soc, struct dp_vdev *vdev, + struct hal_tx_completion_status *ts) +{ +} +#endif /* WLAN_FEATURE_TSF_UPLINK_DELAY */ + /** * dp_tx_comp_process_tx_status() - Parse and Dump Tx completion status info * @soc: DP soc handle @@ -4479,6 +4612,7 @@ void dp_tx_comp_process_tx_status(struct dp_soc *soc, vdev = peer->vdev; dp_tx_update_connectivity_stats(soc, vdev, tx_desc, ts->status); + dp_tx_update_uplink_delay(soc, vdev, ts); /* Update per-packet stats for mesh mode */ if (qdf_unlikely(vdev->mesh_vdev) && diff --git a/dp/wifi3.0/dp_tx.h b/dp/wifi3.0/dp_tx.h index 80073bfc1845..4c504ee22b53 100644 --- a/dp/wifi3.0/dp_tx.h +++ b/dp/wifi3.0/dp_tx.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -542,4 +543,40 @@ dp_send_completion_to_pkt_capture(struct dp_soc *soc, { } #endif + +#ifdef WLAN_FEATURE_TSF_UPLINK_DELAY +/** + * dp_set_delta_tsf() - Set delta_tsf to dp_soc structure + * @soc_hdl: cdp soc pointer + * @vdev_id: vdev id + * @delta_tsf: difference between TSF clock and qtimer + * + * Return: None + */ +void dp_set_delta_tsf(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, + uint32_t delta_tsf); + +/** + * dp_set_tsf_report_ul_delay() - Enable or disable reporting uplink delay + * @soc_hdl: cdp soc pointer + * @vdev_id: vdev id + * @enable: true to enable and false to disable + * + * Return: QDF_STATUS + */ +QDF_STATUS dp_set_tsf_ul_delay_report(struct cdp_soc_t *soc_hdl, + uint8_t vdev_id, bool enable); + +/** + * dp_get_uplink_delay() - Get uplink delay value + * @soc_hdl: cdp soc pointer + * @vdev_id: vdev id + * @val: pointer to save uplink delay value + * + * Return: QDF_STATUS + */ +QDF_STATUS dp_get_uplink_delay(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, + uint32_t *val); +#endif /* WLAN_FEATURE_TSF_UPLINK_TSF */ + #endif diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 51184b9f8e87..68a3813027d5 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -2786,8 +2787,18 @@ 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_FEATURE_TSF_UPLINK_DELAY + /* Indicate if uplink delay report is enabled or not */ + qdf_atomic_t ul_delay_report; + /* Delta between TQM clock and TSF clock */ + uint32_t delta_tsf; + /* accumulative delay for every TX completion */ + qdf_atomic_t ul_delay_accum; + /* accumulative number of packets delay has accumulated */ + qdf_atomic_t ul_pkts_accum; +#endif /* WLAN_FEATURE_TSF_UPLINK_DELAY */ +}; enum { dp_sec_mcast = 0, From 0b62d7f8acdf62497fd90987c0b5cca7b4b0c551 Mon Sep 17 00:00:00 2001 From: Gururaj Pandurangi Date: Fri, 19 Nov 2021 05:20:52 -0800 Subject: [PATCH 06/20] qcacmn: Allow scan/connection if RF test mode/Safe mode enabled Currently if AP and STA have different ctry codes, STA should operate in VLP mode. And if STA ctry code is US, then scan and connection are not allowed as US VLP is not supported yet. However, if RF test mode or Wi-Fi Safe Mode is enabled, allow scan and connection on this AP and STA can operate in LPI mode. Change-Id: I513657b8e274ef07eb9e9b5fc265722cb01525de CRs-Fixed: 3079537 --- umac/regulatory/core/src/reg_utils.c | 14 ++++++++++++-- umac/regulatory/core/src/reg_utils.h | 4 +++- .../dispatcher/inc/wlan_reg_services_api.h | 4 +++- .../dispatcher/src/wlan_reg_services_api.c | 8 +++++--- umac/scan/core/src/wlan_scan_cache_db.c | 15 +++++++++++---- 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/umac/regulatory/core/src/reg_utils.c b/umac/regulatory/core/src/reg_utils.c index 2596fbbe3300..5c87c16c43d3 100644 --- a/umac/regulatory/core/src/reg_utils.c +++ b/umac/regulatory/core/src/reg_utils.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2014-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2021-2022 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 @@ -36,6 +37,7 @@ #include #include "reg_services_common.h" #include "reg_build_chan_list.h" +#include "wlan_cm_bss_score_param.h" #define DEFAULT_WORLD_REGDMN 0x60 @@ -323,7 +325,8 @@ QDF_STATUS reg_get_domain_from_country_code(v_REGDOMAIN_t *reg_domain_ptr, #ifdef CONFIG_REG_CLIENT QDF_STATUS -reg_get_6g_power_type_for_ctry(uint8_t *ap_ctry, uint8_t *sta_ctry, +reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc, + uint8_t *ap_ctry, uint8_t *sta_ctry, enum reg_6g_ap_type *pwr_type_6g, bool *ctry_code_match) { @@ -334,7 +337,14 @@ reg_get_6g_power_type_for_ctry(uint8_t *ap_ctry, uint8_t *sta_ctry, ap_ctry[1], sta_ctry[0], sta_ctry[1]); *ctry_code_match = false; - if (wlan_reg_is_us(sta_ctry)) { + /** + * Do not return if Wi-Fi safe mode or RF test mode is + * enabled, rather STA should operate in LPI mode. + * wlan_cm_get_check_6ghz_security API returns true if + * neither Safe mode nor RF test mode are enabled. + */ + if (wlan_reg_is_us(sta_ctry) && + wlan_cm_get_check_6ghz_security(psoc)) { reg_err("US VLP not in place yet, connection not allowed"); return QDF_STATUS_E_NOSUPPORT; } diff --git a/umac/regulatory/core/src/reg_utils.h b/umac/regulatory/core/src/reg_utils.h index 8bcbd4628e10..8a60819446f8 100644 --- a/umac/regulatory/core/src/reg_utils.h +++ b/umac/regulatory/core/src/reg_utils.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. * * * Permission to use, copy, modify, and/or distribute this software for @@ -320,7 +321,8 @@ QDF_STATUS reg_get_domain_from_country_code(v_REGDOMAIN_t *reg_domain_ptr, * Return: QDF_STATUS */ QDF_STATUS -reg_get_6g_power_type_for_ctry(uint8_t *ap_ctry, uint8_t *sta_ctry, +reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc, + uint8_t *ap_ctry, uint8_t *sta_ctry, enum reg_6g_ap_type *pwr_type_6g, bool *ctry_code_match); #endif diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h index 711d673bc046..5f8ec7e2fa18 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021-2022 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 @@ -550,7 +551,8 @@ QDF_STATUS wlan_reg_read_current_country(struct wlan_objmgr_psoc *psoc, * Return: QDF_STATUS */ QDF_STATUS -wlan_reg_get_6g_power_type_for_ctry(uint8_t *ap_ctry, uint8_t *sta_ctry, +wlan_reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc, + uint8_t *ap_ctry, uint8_t *sta_ctry, enum reg_6g_ap_type *pwr_type_6g, bool *ctry_code_match); #endif diff --git a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c index 4251c50326e5..962888ad3813 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. * * * Permission to use, copy, modify, and/or distribute this software for @@ -86,12 +87,13 @@ QDF_STATUS wlan_reg_get_max_5g_bw_from_regdomain(uint16_t regdmn, #ifdef CONFIG_REG_CLIENT QDF_STATUS -wlan_reg_get_6g_power_type_for_ctry(uint8_t *ap_ctry, uint8_t *sta_ctry, +wlan_reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc, + uint8_t *ap_ctry, uint8_t *sta_ctry, enum reg_6g_ap_type *pwr_type_6g, bool *ctry_code_match) { - return reg_get_6g_power_type_for_ctry(ap_ctry, sta_ctry, pwr_type_6g, - ctry_code_match); + return reg_get_6g_power_type_for_ctry(psoc, ap_ctry, sta_ctry, + pwr_type_6g, ctry_code_match); } #endif diff --git a/umac/scan/core/src/wlan_scan_cache_db.c b/umac/scan/core/src/wlan_scan_cache_db.c index 05e87bb3f809..58a2d9de7179 100644 --- a/umac/scan/core/src/wlan_scan_cache_db.c +++ b/umac/scan/core/src/wlan_scan_cache_db.c @@ -1106,10 +1106,17 @@ QDF_STATUS __scm_handle_bcn_probe(struct scan_bcn_probe_event *bcn) if (scan_obj->cb.update_beacon) scan_obj->cb.update_beacon(pdev, scan_entry); - if (!scm_is_bss_allowed_for_country(psoc, scan_entry)) { - scm_info("Drop frame from "QDF_MAC_ADDR_FMT - ": AP in VLP mode not supported for US", - QDF_MAC_ADDR_REF(scan_entry->bssid.bytes)); + /** + * Do not drop the frame if Wi-Fi safe mode or RF test mode is + * enabled. wlan_cm_get_check_6ghz_security API returns true if + * neither Safe mode nor RF test mode are enabled. + */ + if (!scm_is_bss_allowed_for_country(psoc, scan_entry) && + wlan_cm_get_check_6ghz_security(psoc)) { + scm_info_rl( + "Drop frame from "QDF_MAC_ADDR_FMT + ": AP in VLP mode not supported for US", + QDF_MAC_ADDR_REF(scan_entry->bssid.bytes)); util_scan_free_cache_entry(scan_entry); qdf_mem_free(scan_node); continue; From b8894c96e24ddd4c578eaa59acdb9b04aef53173 Mon Sep 17 00:00:00 2001 From: Gururaj Pandurangi Date: Thu, 2 Dec 2021 04:04:34 -0800 Subject: [PATCH 07/20] qcacmn: Allow STA in LPI mode if AP ctry US and advertises LPI The existing logic is if STA and AP have different ctry code, and STA is in ETSI, then it operates in VLP mode irrespective of AP ctry. New logic would be if AP ctry is US and if it advertises LPI power type in HE ops IE via beacon, then STA can advance to LPI mode. Change-Id: Ifbee7052854277c3d21ccd21b65b79edb5e89f46 CRs-Fixed: 3084589 --- umac/regulatory/core/src/reg_utils.c | 9 ++++++++- umac/regulatory/core/src/reg_utils.h | 5 +++-- umac/regulatory/dispatcher/inc/wlan_reg_services_api.h | 5 +++-- umac/regulatory/dispatcher/src/wlan_reg_services_api.c | 6 ++++-- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/umac/regulatory/core/src/reg_utils.c b/umac/regulatory/core/src/reg_utils.c index 5c87c16c43d3..06103a2d2c3b 100644 --- a/umac/regulatory/core/src/reg_utils.c +++ b/umac/regulatory/core/src/reg_utils.c @@ -328,7 +328,8 @@ QDF_STATUS reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc, uint8_t *ap_ctry, uint8_t *sta_ctry, enum reg_6g_ap_type *pwr_type_6g, - bool *ctry_code_match) + bool *ctry_code_match, + enum reg_6g_ap_type ap_pwr_type) { *pwr_type_6g = REG_INDOOR_AP; @@ -354,6 +355,12 @@ reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc, sta_ctry[0], sta_ctry[1]); *pwr_type_6g = REG_VERY_LOW_POWER_AP; } + + if (wlan_reg_is_us(ap_ctry) && ap_pwr_type == REG_INDOOR_AP) { + reg_debug("AP ctry:%c%c, AP power type:%d, allow STA IN LPI", + ap_ctry[0], ap_ctry[1], ap_pwr_type); + *pwr_type_6g = REG_INDOOR_AP; + } } else { *ctry_code_match = true; } diff --git a/umac/regulatory/core/src/reg_utils.h b/umac/regulatory/core/src/reg_utils.h index 8a60819446f8..fdb8a834a28d 100644 --- a/umac/regulatory/core/src/reg_utils.h +++ b/umac/regulatory/core/src/reg_utils.h @@ -317,14 +317,15 @@ QDF_STATUS reg_get_domain_from_country_code(v_REGDOMAIN_t *reg_domain_ptr, * @sta_ctry: ptr to sta programmed country * @pwr_type_6g: ptr to 6G power type * @ctry_code_match: Check for country IE and sta country code match - * + * @ap_pwr_type: AP's power type as advertised in HE ops IE * Return: QDF_STATUS */ QDF_STATUS reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc, uint8_t *ap_ctry, uint8_t *sta_ctry, enum reg_6g_ap_type *pwr_type_6g, - bool *ctry_code_match); + bool *ctry_code_match, + enum reg_6g_ap_type ap_pwr_type); #endif /** diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h index 5f8ec7e2fa18..99a67981c385 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h @@ -547,14 +547,15 @@ QDF_STATUS wlan_reg_read_current_country(struct wlan_objmgr_psoc *psoc, * @sta_ctry: ptr to sta programmed country * @pwr_type_6g: ptr to 6G power type * @ctry_code_match: Check for country IE and sta country code match - * + * @ap_pwr_type: AP's power type for 6G as advertised in HE ops IE * Return: QDF_STATUS */ QDF_STATUS wlan_reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc, uint8_t *ap_ctry, uint8_t *sta_ctry, enum reg_6g_ap_type *pwr_type_6g, - bool *ctry_code_match); + bool *ctry_code_match, + enum reg_6g_ap_type ap_pwr_type); #endif #ifdef CONFIG_CHAN_NUM_API diff --git a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c index 962888ad3813..b9bec25b2e6d 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c @@ -90,10 +90,12 @@ QDF_STATUS wlan_reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc, uint8_t *ap_ctry, uint8_t *sta_ctry, enum reg_6g_ap_type *pwr_type_6g, - bool *ctry_code_match) + bool *ctry_code_match, + enum reg_6g_ap_type ap_pwr_type) { return reg_get_6g_power_type_for_ctry(psoc, ap_ctry, sta_ctry, - pwr_type_6g, ctry_code_match); + pwr_type_6g, ctry_code_match, + ap_pwr_type); } #endif From b92591930578743ad7a1ac4c92d654abae66aec4 Mon Sep 17 00:00:00 2001 From: Aravind Kishore Sukla Date: Fri, 13 May 2022 12:15:48 +0530 Subject: [PATCH 08/20] qcacmn: Replace kmsg logs to debug logs Change kernel log level to debug level Change-Id: Ib2736aff0f653d046d502d460f204bba2247246f CRs-Fixed: 3182588 --- dp/wifi3.0/dp_htt.c | 5 +++-- dp/wifi3.0/dp_tx_flow_control.c | 10 +++++----- hif/src/hif_main.c | 4 ++-- umac/cfr/core/src/cfr_common.c | 4 ++-- umac/dcs/core/src/wlan_dcs.c | 3 ++- umac/dfs/dispatcher/src/wlan_dfs_utils_api.c | 4 ++-- umac/green_ap/dispatcher/src/wlan_green_ap_api.c | 3 ++- umac/regulatory/core/src/reg_services_common.c | 3 ++- wmi/src/wmi_unified_tlv.c | 8 ++++---- 9 files changed, 24 insertions(+), 20 deletions(-) diff --git a/dp/wifi3.0/dp_htt.c b/dp/wifi3.0/dp_htt.c index e715fadbfcf0..3dc1b76ff8d0 100644 --- a/dp/wifi3.0/dp_htt.c +++ b/dp/wifi3.0/dp_htt.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -4584,7 +4585,7 @@ static void dp_htt_t2h_msg_handler(void *context, HTC_PACKET *pkt) (u_int8_t *) (msg_word+1), &mac_addr_deswizzle_buf[0]); QDF_TRACE(QDF_MODULE_ID_TXRX, - QDF_TRACE_LEVEL_INFO, + QDF_TRACE_LEVEL_DEBUG, "HTT_T2H_MSG_TYPE_PEER_MAP msg for peer id %d vdev id %d n", peer_id, vdev_id); @@ -4792,7 +4793,7 @@ static void dp_htt_t2h_msg_handler(void *context, HTC_PACKET *pkt) HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(*(msg_word + 5)); QDF_TRACE(QDF_MODULE_ID_TXRX, - QDF_TRACE_LEVEL_INFO, + QDF_TRACE_LEVEL_DEBUG, "HTT_T2H_MSG_TYPE_PEER_MAP msg for peer id %d vdev id %d n", peer_id, vdev_id); diff --git a/dp/wifi3.0/dp_tx_flow_control.c b/dp/wifi3.0/dp_tx_flow_control.c index 41654aa1e7af..a50a8004885b 100644 --- a/dp/wifi3.0/dp_tx_flow_control.c +++ b/dp/wifi3.0/dp_tx_flow_control.c @@ -73,8 +73,8 @@ dp_tx_initialize_threshold(struct dp_tx_desc_pool_s *pool, pool->stop_th[DP_TH_HI] = (pool->stop_th[DP_TH_BE_BK] * FL_TH_HI_PERCENTAGE) / 100; - dp_info("tx flow control threshold is set, pool size is %d", - flow_pool_size); + dp_debug("tx flow control threshold is set, pool size is %d", + flow_pool_size); } /** @@ -568,9 +568,9 @@ void dp_tx_flow_pool_unmap_handler(struct dp_pdev *pdev, uint8_t flow_id, struct dp_tx_desc_pool_s *pool; enum htt_flow_type type = flow_type; - QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO, - "%s: flow_id %d flow_type %d flow_pool_id %d", - __func__, flow_id, flow_type, flow_pool_id); + QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, + "%s: flow_id %d flow_type %d flow_pool_id %d", + __func__, flow_id, flow_type, flow_pool_id); if (qdf_unlikely(!pdev)) { QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, diff --git a/hif/src/hif_main.c b/hif/src/hif_main.c index 15f7d94eced3..83ac8f2f749c 100644 --- a/hif/src/hif_main.c +++ b/hif/src/hif_main.c @@ -801,7 +801,7 @@ void hif_latency_detect_timer_start(struct hif_opaque_softc *hif_ctx) if (QDF_GLOBAL_MISSION_MODE != hif_get_conparam(scn)) return; - hif_info_rl("start timer"); + hif_debug_rl("start timer"); if (scn->latency_detect.is_timer_started) { hif_info("timer has been started"); return; @@ -819,7 +819,7 @@ void hif_latency_detect_timer_stop(struct hif_opaque_softc *hif_ctx) if (QDF_GLOBAL_MISSION_MODE != hif_get_conparam(scn)) return; - hif_info_rl("stop timer"); + hif_debug_rl("stop timer"); qdf_timer_sync_cancel(&scn->latency_detect.detect_latency_timer); scn->latency_detect.is_timer_started = false; diff --git a/umac/cfr/core/src/cfr_common.c b/umac/cfr/core/src/cfr_common.c index 1365dc8a718b..b23da3b583c1 100644 --- a/umac/cfr/core/src/cfr_common.c +++ b/umac/cfr/core/src/cfr_common.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2022 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 @@ -294,7 +294,7 @@ wlan_cfr_peer_obj_create_handler(struct wlan_objmgr_peer *peer, void *arg) } if (wlan_cfr_is_feature_disabled(pdev)) { - cfr_info("cfr is disabled"); + cfr_debug("cfr is disabled"); return QDF_STATUS_E_NOSUPPORT; } diff --git a/umac/dcs/core/src/wlan_dcs.c b/umac/dcs/core/src/wlan_dcs.c index d7b16c899006..cbfded332bae 100644 --- a/umac/dcs/core/src/wlan_dcs.c +++ b/umac/dcs/core/src/wlan_dcs.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -126,7 +127,7 @@ QDF_STATUS wlan_dcs_cmd_send(struct wlan_objmgr_psoc *psoc, dcs_tx_ops = target_if_dcs_get_tx_ops(psoc); if (dcs_tx_ops->dcs_cmd_send) { - dcs_info("dcs_enable: %u, pdev_id: %u", dcs_enable, pdev_id); + dcs_debug("dcs_enable: %u, pdev_id: %u", dcs_enable, pdev_id); return dcs_tx_ops->dcs_cmd_send(psoc, pdev_id, is_host_pdev_id, diff --git a/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c b/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c index 34aeba6340a2..29c7b63c0d1e 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_utils_api.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. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1302,7 +1302,7 @@ void utils_dfs_init_nol(struct wlan_objmgr_pdev *pdev) dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "nol channels in pld"); DFS_PRINT_NOL_LOCKED(dfs); } else { - dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "no nol in pld"); + dfs_debug(dfs, WLAN_DEBUG_DFS_ALWAYS, "no nol in pld"); } qdf_mem_free(dfs_nolinfo); } diff --git a/umac/green_ap/dispatcher/src/wlan_green_ap_api.c b/umac/green_ap/dispatcher/src/wlan_green_ap_api.c index 7fa69dceb56d..f03375e4ca38 100644 --- a/umac/green_ap/dispatcher/src/wlan_green_ap_api.c +++ b/umac/green_ap/dispatcher/src/wlan_green_ap_api.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -414,7 +415,7 @@ QDF_STATUS wlan_green_ap_del_sta(struct wlan_objmgr_pdev *pdev) qdf_spin_lock_bh(&green_ap_ctx->lock); if (wlan_is_egap_enabled(green_ap_ctx)) { qdf_spin_unlock_bh(&green_ap_ctx->lock); - green_ap_info("enhanced green ap support is enabled"); + green_ap_debug("enhanced green ap support is enabled"); return QDF_STATUS_SUCCESS; } qdf_spin_unlock_bh(&green_ap_ctx->lock); diff --git a/umac/regulatory/core/src/reg_services_common.c b/umac/regulatory/core/src/reg_services_common.c index c116472c8079..64bb09998265 100644 --- a/umac/regulatory/core/src/reg_services_common.c +++ b/umac/regulatory/core/src/reg_services_common.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -1687,7 +1688,7 @@ uint8_t reg_freq_to_chan(struct wlan_objmgr_pdev *pdev, struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj; if (freq == 0) { - reg_err_rl("Invalid freq %d", freq); + reg_debug_rl("Invalid freq %d", freq); return 0; } diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 534a0371b750..6edd7e6b616d 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -1871,10 +1871,10 @@ static QDF_STATUS send_wow_enable_cmd_tlv(wmi_unified_t wmi_handle, cmd->pause_iface_config = WOW_IFACE_PAUSE_DISABLED; cmd->flags = param->flags; - wmi_info("suspend type: %s flag is 0x%x", - cmd->pause_iface_config == WOW_IFACE_PAUSE_ENABLED ? - "WOW_IFACE_PAUSE_ENABLED" : "WOW_IFACE_PAUSE_DISABLED", - cmd->flags); + wmi_debug("suspend type: %s flag is 0x%x", + cmd->pause_iface_config == WOW_IFACE_PAUSE_ENABLED ? + "WOW_IFACE_PAUSE_ENABLED" : "WOW_IFACE_PAUSE_DISABLED", + cmd->flags); wmi_mtrace(WMI_WOW_ENABLE_CMDID, NO_SESSION, 0); ret = wmi_unified_cmd_send(wmi_handle, buf, len, From e19169dc461f6220b024f0c1b884f69e84659ad5 Mon Sep 17 00:00:00 2001 From: Gururaj Pandurangi Date: Tue, 14 Dec 2021 21:51:36 -0800 Subject: [PATCH 09/20] qcacmn: Reduce logging in get 6G power type for country API Optimize the checks in reg_get_6g_power_type_for_ctry API to reduce logging. Logs will appear only during initial connection and not after parsing each beacon. Change-Id: I4c4904c4825cd822d119e4ee9b2c69e96612be31 CRs-Fixed: 3094366 --- umac/regulatory/core/src/reg_utils.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/umac/regulatory/core/src/reg_utils.c b/umac/regulatory/core/src/reg_utils.c index 06103a2d2c3b..73f3a88c7806 100644 --- a/umac/regulatory/core/src/reg_utils.c +++ b/umac/regulatory/core/src/reg_utils.c @@ -350,10 +350,14 @@ reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_NOSUPPORT; } - if (wlan_reg_is_etsi(sta_ctry)) { - reg_debug("STA ctry:%c%c, doesn't match with AP ctry, switch to VLP", - sta_ctry[0], sta_ctry[1]); - *pwr_type_6g = REG_VERY_LOW_POWER_AP; + if (wlan_reg_is_etsi(sta_ctry) && + ap_pwr_type != REG_MAX_AP_TYPE) { + if (!(wlan_reg_is_us(ap_ctry) && + ap_pwr_type == REG_INDOOR_AP)) { + reg_debug("STA ctry:%c%c, doesn't match with AP ctry, switch to VLP", + sta_ctry[0], sta_ctry[1]); + *pwr_type_6g = REG_VERY_LOW_POWER_AP; + } } if (wlan_reg_is_us(ap_ctry) && ap_pwr_type == REG_INDOOR_AP) { From 7700a1544e8f326ab262b3642cb9035169546ffe Mon Sep 17 00:00:00 2001 From: Sai Pavan Akhil Remella Date: Mon, 31 Jan 2022 14:38:39 +0530 Subject: [PATCH 10/20] qcacmn: Add mode based flags to channels in PNO request Currently 6 GHz channel flags are not set for channels present in the list from PNO scan request but are set for all other 6 GHz channels which are added when either of the two below conditions are satisfied 1. Userspace sets NL80211_SCAN_FLAG_COLOCATED_6GHZ flag in PNO scan request. 2. At least one 6 GHz channel is present in the PNO scan req. Add flags for channels in the PNO scan request based on the scan_mode_6g ini configured similar to active scan request. Add changes to remove the RNR flag for the channel if the corresponding short SSID entry is present in the RNR db Cache since if colocated SSID is different userspace doesn't include corresponding 2.4/5 GHz channel information in PNO request. Change-Id: I22c4f7ecf65d4ab09dfbbe126aefe02f9145de42 CRs-Fixed: 3119113 --- os_if/linux/scan/src/wlan_cfg80211_scan.c | 44 +++--- umac/cmn_services/utils/inc/wlan_utility.h | 11 ++ umac/cmn_services/utils/src/wlan_utility.c | 62 +++++++++ umac/scan/core/src/wlan_scan_cache_db.c | 55 ++++++++ umac/scan/core/src/wlan_scan_cache_db.h | 26 ++++ umac/scan/core/src/wlan_scan_manager_6ghz.c | 126 ++++++++++-------- umac/scan/core/src/wlan_scan_manager_6ghz.h | 28 ++++ .../dispatcher/inc/wlan_scan_public_structs.h | 2 + umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h | 16 ++- umac/scan/dispatcher/src/wlan_scan_ucfg_api.c | 27 ++-- 10 files changed, 306 insertions(+), 91 deletions(-) diff --git a/os_if/linux/scan/src/wlan_cfg80211_scan.c b/os_if/linux/scan/src/wlan_cfg80211_scan.c index b58563d998c4..a9b58d275bae 100644 --- a/os_if/linux/scan/src/wlan_cfg80211_scan.c +++ b/os_if/linux/scan/src/wlan_cfg80211_scan.c @@ -529,36 +529,42 @@ int wlan_cfg80211_sched_scan_start(struct wlan_objmgr_vdev *vdev, /* Filling per profile params */ for (i = 0; i < req->networks_cnt; i++) { - req->networks_list[i].ssid.length = - request->match_sets[i].ssid.ssid_len; + struct cfg80211_match_set *user_req = &request->match_sets[i]; + struct pno_nw_type *tgt_req = &req->networks_list[i]; - if ((!req->networks_list[i].ssid.length) || - (req->networks_list[i].ssid.length > WLAN_SSID_MAX_LEN)) { + tgt_req->ssid.length = user_req->ssid.ssid_len; + + if (!tgt_req->ssid.length || + tgt_req->ssid.length > WLAN_SSID_MAX_LEN) { osif_err(" SSID Len %d is not correct for network %d", - req->networks_list[i].ssid.length, i); + tgt_req->ssid.length, i); ret = -EINVAL; goto error; } - qdf_mem_copy(req->networks_list[i].ssid.ssid, - request->match_sets[i].ssid.ssid, - req->networks_list[i].ssid.length); - req->networks_list[i].authentication = 0; /*eAUTH_TYPE_ANY */ - req->networks_list[i].encryption = 0; /*eED_ANY */ - req->networks_list[i].bc_new_type = 0; /*eBCAST_UNKNOWN */ + qdf_mem_copy(tgt_req->ssid.ssid, user_req->ssid.ssid, + tgt_req->ssid.length); + tgt_req->authentication = 0; /*eAUTH_TYPE_ANY */ + tgt_req->encryption = 0; /*eED_ANY */ + tgt_req->bc_new_type = 0; /*eBCAST_UNKNOWN */ + /*Copying list of valid channel into request */ for (j = 0; j < num_chan; j++) - req->networks_list[i].pno_chan_list.chan[j].freq = - valid_ch[j]; - req->networks_list[i].pno_chan_list.num_chan = num_chan; + tgt_req->pno_chan_list.chan[j].freq = valid_ch[j]; + tgt_req->pno_chan_list.num_chan = num_chan; - if (ucfg_is_6ghz_pno_scan_optimization_supported(psoc)) - ucfg_scan_pno_add_all_valid_6g_channels(vdev, req, - &num_chan); + if (ucfg_is_6ghz_pno_scan_optimization_supported(psoc)) { + uint32_t short_ssid = + wlan_construct_shortssid(tgt_req->ssid.ssid, + tgt_req->ssid.length); - req->networks_list[i].rssi_thresh = - request->match_sets[i].rssi_thold; + ucfg_scan_add_flags_to_pno_chan_list(vdev, req, + &num_chan, + short_ssid, i); + } + + tgt_req->rssi_thresh = user_req->rssi_thold; } /* set scan to passive if no SSIDs are specified in the request */ diff --git a/umac/cmn_services/utils/inc/wlan_utility.h b/umac/cmn_services/utils/inc/wlan_utility.h index 9d52f467c7d3..cfec6712098e 100644 --- a/umac/cmn_services/utils/inc/wlan_utility.h +++ b/umac/cmn_services/utils/inc/wlan_utility.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -52,6 +53,16 @@ struct wlan_op_mode_peer_count { uint16_t peer_count; }; +/** + * wlan_construct_shortssid() - construct the short ssid with the help of + * shortssid table + * @ssid: pointer to ssid + * @ssid_len: ssid length + * + * return: short ssid length + */ +uint32_t wlan_construct_shortssid(uint8_t *ssid, uint8_t ssid_len); + /** * wlan_chan_to_freq() - converts channel to frequency * @chan: channel number diff --git a/umac/cmn_services/utils/src/wlan_utility.c b/umac/cmn_services/utils/src/wlan_utility.c index 0b030ee9802f..e737b0704e9e 100644 --- a/umac/cmn_services/utils/src/wlan_utility.c +++ b/umac/cmn_services/utils/src/wlan_utility.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -27,6 +28,67 @@ #include #include "cfg_ucfg_api.h" +/* CRC polynomial 0xedb88320 */ +static unsigned long const wlan_shortssid_table[] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, + 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, + 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, + 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, + 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, + 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, + 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, + 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, + 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, + 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, + 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, + 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, + 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, + 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, + 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, + 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, + 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, + 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d +}; + +uint32_t wlan_construct_shortssid(uint8_t *ssid, uint8_t ssid_len) +{ + uint32_t shortssid = 0xffffffff; + uint8_t i; + + if (!ssid || ssid_len > WLAN_SSID_MAX_LEN) + return shortssid; + + for (i = 0; i < ssid_len; i++) + shortssid = wlan_shortssid_table[(shortssid ^ ssid[i]) & 0xff] ^ + (shortssid >> 8); + return (shortssid ^ 0xffffffff); +} + uint32_t wlan_chan_to_freq(uint8_t chan) { if (chan == 0 ) diff --git a/umac/scan/core/src/wlan_scan_cache_db.c b/umac/scan/core/src/wlan_scan_cache_db.c index 58a2d9de7179..229ed22f98f9 100644 --- a/umac/scan/core/src/wlan_scan_cache_db.c +++ b/umac/scan/core/src/wlan_scan_cache_db.c @@ -156,6 +156,8 @@ static void scm_add_rnr_channel_db(struct wlan_objmgr_psoc *psoc, QDF_MAC_ADDR_SIZE); if (rnr_bss->short_ssid) rnr_node->entry.short_ssid = rnr_bss->short_ssid; + if (rnr_bss->bss_params) + rnr_node->entry.bss_params = rnr_bss->bss_params; scm_debug("Add freq %d: "QDF_MAC_ADDR_FMT" short ssid %x", chan_freq, QDF_MAC_ADDR_REF(rnr_bss->bssid.bytes), rnr_bss->short_ssid); @@ -163,6 +165,59 @@ static void scm_add_rnr_channel_db(struct wlan_objmgr_psoc *psoc, &rnr_node->node); } } + +void scm_filter_rnr_flag_pno(struct wlan_objmgr_vdev *vdev, + uint32_t short_ssid, + struct chan_list *pno_chan_list) +{ + uint8_t i; + uint32_t freq; + struct meta_rnr_channel *chan; + struct scan_rnr_node *rnr_node; + enum scan_mode_6ghz scan_mode; + struct wlan_scan_obj *scan_obj; + struct wlan_objmgr_psoc *psoc; + + psoc = wlan_vdev_get_psoc(vdev); + if (!psoc) + return; + + scan_obj = wlan_vdev_get_scan_obj(vdev); + if (!scan_obj) { + scm_err("scan_obj is NULL"); + return; + } + + scan_mode = scan_obj->scan_def.scan_mode_6g; + /* No Filteration required for below scan modes since + * no RNR flag marked + */ + if (scan_mode == SCAN_MODE_6G_NO_CHANNEL || + scan_mode == SCAN_MODE_6G_ALL_CHANNEL || + scan_mode == SCAN_MODE_6G_ALL_DUTY_CYCLE) + return; + + for (i = 0; i < pno_chan_list->num_chan; i++) { + freq = pno_chan_list->chan[i].freq; + + chan = scm_get_chan_meta(psoc, freq); + if (!chan || qdf_list_empty(&chan->rnr_list)) + continue; + + qdf_list_for_each(&chan->rnr_list, rnr_node, node) { + if (rnr_node->entry.short_ssid) { + if (rnr_node->entry.short_ssid == short_ssid) { + /* If short ssid entry present in RNR db cache, remove + * FLAG_SCAN_ONLY_IF_RNR_FOUND flag from the channel. + */ + pno_chan_list->chan[i].flags &= + ~FLAG_SCAN_ONLY_IF_RNR_FOUND; + break; + } + } + } + } +} #endif /** diff --git a/umac/scan/core/src/wlan_scan_cache_db.h b/umac/scan/core/src/wlan_scan_cache_db.h index c7f2366f72a5..daa29a79fea3 100644 --- a/umac/scan/core/src/wlan_scan_cache_db.h +++ b/umac/scan/core/src/wlan_scan_cache_db.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -248,6 +249,24 @@ QDF_STATUS scm_rnr_db_flush(struct wlan_objmgr_psoc *psoc); */ void scm_update_rnr_from_scan_cache(struct wlan_objmgr_pdev *pdev); +/** + * scm_filter_rnr_flag_pno() - Remove FLAG_SCAN_ONLY_IF_RNR_FOUND flag + * in channel if ssid is different for colocated AP, + * during pno scan request + * @vdev: vdev + * @short_ssid: short ssid + * @pno_chan_list: channel list + * + * Remove FLAG_SCAN_ONLY_IF_RNR_FOUND flag in channel if ssid is different for + * colocated AP, in pno scan request + * + * Return: None + */ +void +scm_filter_rnr_flag_pno(struct wlan_objmgr_vdev *vdev, + uint32_t short_ssid, + struct chan_list *chan_list); + #else static inline QDF_STATUS scm_channel_list_db_init(struct wlan_objmgr_psoc *psoc) { @@ -259,6 +278,13 @@ QDF_STATUS scm_channel_list_db_deinit(struct wlan_objmgr_psoc *psoc) { return QDF_STATUS_SUCCESS; } + +static inline void +scm_filter_rnr_flag_pno(struct wlan_objmgr_vdev *vdev, + uint32_t short_ssid, + struct chan_list *chan_list) +{ +} #endif /** diff --git a/umac/scan/core/src/wlan_scan_manager_6ghz.c b/umac/scan/core/src/wlan_scan_manager_6ghz.c index 319cdbd82675..6120f4955501 100644 --- a/umac/scan/core/src/wlan_scan_manager_6ghz.c +++ b/umac/scan/core/src/wlan_scan_manager_6ghz.c @@ -332,18 +332,6 @@ void scm_add_all_valid_6g_channels(struct wlan_objmgr_pdev *pdev, qdf_mem_free(cur_chan_list); } -static void scm_scan_add_all_valid_6g_channels(struct wlan_objmgr_pdev *pdev, - struct scan_start_request *req, - uint8_t *num_scan_ch) -{ - bool is_colocated_6ghz_scan_enabled = - req->scan_req.scan_policy_colocated_6ghz; - - scm_add_all_valid_6g_channels(pdev, &req->scan_req.chan_list, - num_scan_ch, - is_colocated_6ghz_scan_enabled); -} - static void scm_copy_valid_channels(struct wlan_objmgr_psoc *psoc, enum scan_mode_6ghz scan_mode, @@ -445,6 +433,76 @@ scm_is_6ghz_scan_optimization_supported(struct wlan_objmgr_psoc *psoc) WLAN_SOC_CEXT_SCAN_PER_CH_CONFIG); } +void scm_add_channel_flags(struct wlan_objmgr_vdev *vdev, + struct chan_list *chan_list, + uint8_t *num_chan, + bool is_colocated_6ghz_scan_enabled, + bool is_pno_scan) +{ + struct wlan_scan_obj *scan_obj; + enum scan_mode_6ghz scan_mode; + struct wlan_objmgr_pdev *pdev; + uint8_t num_scan_chan = *num_chan; + + pdev = wlan_vdev_get_pdev(vdev); + if (!pdev) + return; + scan_obj = wlan_vdev_get_scan_obj(vdev); + if (!scan_obj) { + scm_err("scan_obj is NULL"); + return; + } + + scan_mode = scan_obj->scan_def.scan_mode_6g; + + switch (scan_mode) { + case SCAN_MODE_6G_RNR_ONLY: + /* + * When the ini is set to SCAN_MODE_6G_RNR_ONLY, + * always set RNR flag for all(PSC and non-PSC) channels. + */ + scm_set_rnr_flag_all_6g_ch(&chan_list->chan[0], num_scan_chan); + break; + case SCAN_MODE_6G_PSC_CHANNEL: + /* + * When the ini is set to SCAN_MODE_6G_PSC_CHANNEL, + * always set RNR flag for non-PSC channels. + */ + scm_set_rnr_flag_non_psc_6g_ch(&chan_list->chan[0], + num_scan_chan); + break; + case SCAN_MODE_6G_PSC_DUTY_CYCLE: + case SCAN_MODE_6G_ALL_DUTY_CYCLE: + if (!is_pno_scan && !scm_is_duty_cycle_scan(scan_obj)) + scm_set_rnr_flag_all_6g_ch(&chan_list->chan[0], + num_scan_chan); + else if (scan_mode == SCAN_MODE_6G_PSC_DUTY_CYCLE) { + if (is_pno_scan) + scm_debug("Duty cycle scan not supported in pno"); + scm_set_rnr_flag_non_psc_6g_ch(&chan_list->chan[0], + num_scan_chan); + } + break; + case SCAN_MODE_6G_ALL_CHANNEL: + /* + * When the ini is set to SCAN_MODE_6G_ALL_CHANNEL, + * Host fills all remaining (other than channel(s) present in + * host scan req) valid 6 GHz channel(s) to scan requests and + * set the flag FLAG_SCAN_ONLY_IF_RNR_FOUND for each remaining + * channels. + */ + scm_add_all_valid_6g_channels(pdev, chan_list, num_chan, + is_colocated_6ghz_scan_enabled); + break; + default: + /* + * Don't set the RNR flag for SCAN_MODE_6G_NO_CHANNEL/ + * SCAN_MODE_6G_RNR_ONLY + */ + break; + } +} + void scm_update_6ghz_channel_list(struct scan_start_request *req, struct wlan_scan_obj *scan_obj) @@ -493,48 +551,8 @@ scm_update_6ghz_channel_list(struct scan_start_request *req, scm_is_scan_type_exempted_from_optimization(req)) goto end; - switch (scan_mode) { - case SCAN_MODE_6G_RNR_ONLY: - /* - * When the ini is set to SCAN_MODE_6G_RNR_ONLY, - * always set RNR flag for all(PSC and non-PSC) channels. - */ - scm_set_rnr_flag_all_6g_ch(&chan_list->chan[0], num_scan_ch); - break; - case SCAN_MODE_6G_PSC_CHANNEL: - /* - * When the ini is set to SCAN_MODE_6G_PSC_CHANNEL, - * always set RNR flag for non-PSC channels. - */ - scm_set_rnr_flag_non_psc_6g_ch(&chan_list->chan[0], - num_scan_ch); - break; - case SCAN_MODE_6G_PSC_DUTY_CYCLE: - case SCAN_MODE_6G_ALL_DUTY_CYCLE: - if (!scm_is_duty_cycle_scan(scan_obj)) - scm_set_rnr_flag_all_6g_ch(&chan_list->chan[0], - num_scan_ch); - else if (scan_mode == SCAN_MODE_6G_PSC_DUTY_CYCLE) - scm_set_rnr_flag_non_psc_6g_ch(&chan_list->chan[0], - num_scan_ch); - break; - case SCAN_MODE_6G_ALL_CHANNEL: - /* - * When the ini is set to SCAN_MODE_6G_ALL_CHANNEL, - * Host fills all remaining (other than channel(s) present in - * host scan req) valid 6 GHz channel(s) to scan requests and - * set the flag FLAG_SCAN_ONLY_IF_RNR_FOUND for each remaining - * channels. - */ - scm_scan_add_all_valid_6g_channels(pdev, req, &num_scan_ch); - break; - default: - /* - * Don't set the RNR flag for SCAN_MODE_6G_NO_CHANNEL/ - * SCAN_MODE_6G_RNR_ONLY - */ - break; - } + scm_add_channel_flags(vdev, chan_list, &num_scan_ch, + req->scan_req.scan_policy_colocated_6ghz, false); end: chan_list->num_chan = num_scan_ch; diff --git a/umac/scan/core/src/wlan_scan_manager_6ghz.h b/umac/scan/core/src/wlan_scan_manager_6ghz.h index 4f4114d10229..62f88619d730 100644 --- a/umac/scan/core/src/wlan_scan_manager_6ghz.h +++ b/umac/scan/core/src/wlan_scan_manager_6ghz.h @@ -47,6 +47,25 @@ #define SET_RNR_FLAG_TO_NON_PSC_CHANNEL 0x2 #define SET_RNR_FLAG_TO_ALL_6G_CHANNELS 0x3 +/** + * scm_add_channel_flags() - Update 6ghz channel flags in the active/pno scan req + * @vdev: vdev + * @pno_chan_list: channel list + * @num_chan: number channels + * @is_colocated_6ghz_scan_enabled: Colacated 6ghz flag + * @is_pno_scan: is pno scan + * + * Add channel flags for 6ghz channels from active/pno scan request based on ini + * + * Return: None + */ +void +scm_add_channel_flags(struct wlan_objmgr_vdev *vdev, + struct chan_list *chan_list, + uint8_t *num_chan, + bool is_colocated_6ghz_scan_enabled, + bool is_pno_scan); + /** * scm_update_6ghz_channel_list() - Update 6ghz channel list in the scan req * @req: scan start request @@ -93,6 +112,15 @@ void scm_add_all_valid_6g_channels(struct wlan_objmgr_pdev *pdev, bool is_colocated_6ghz); #else +static inline void +scm_add_channel_flags(struct wlan_objmgr_vdev *vdev, + struct chan_list *pno_chan_list, + uint8_t *num_chan, + bool is_colocated_6ghz, + bool is_pno_scan) +{ +} + static inline void scm_update_6ghz_channel_list(struct scan_start_request *req, struct wlan_scan_obj *scan_obj) diff --git a/umac/scan/dispatcher/inc/wlan_scan_public_structs.h b/umac/scan/dispatcher/inc/wlan_scan_public_structs.h index cb87e61c0547..4a150b7f6b41 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_public_structs.h +++ b/umac/scan/dispatcher/inc/wlan_scan_public_structs.h @@ -1449,11 +1449,13 @@ enum ext_cap_bit_field { * @timestamp: time stamp of beacon/probe * @short_ssid: Short SSID * @bssid: BSSID + * @bss_params: bss params present in RNR IE */ struct scan_rnr_info { qdf_time_t timestamp; uint32_t short_ssid; struct qdf_mac_addr bssid; + uint8_t bss_params; }; /** diff --git a/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h b/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h index 70cda95abf46..050f0fce8138 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h +++ b/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h @@ -102,17 +102,21 @@ QDF_STATUS ucfg_scan_pno_start(struct wlan_objmgr_vdev *vdev, struct pno_scan_req_params *req); /** - * ucfg_scan_pno_add_all_valid_6g_channels() - This API to update all valid 6g - * channels to pno scan request + * ucfg_scan_add_flags_to_pno_chan_list() - This API to update flags for all 6g + * channels in pno scan request * @vdev: vdev pointer * @req: pno req params - * @num_scan_ch: total number of channels present in pno scan request + * @num_chan: number of channels + * @short_ssid: short ssid + * @list_idx: index of network_list in pno request * * Return: None */ -void ucfg_scan_pno_add_all_valid_6g_channels(struct wlan_objmgr_vdev *vdev, - struct pno_scan_req_params *req, - uint8_t *num_scan_ch); +void ucfg_scan_add_flags_to_pno_chan_list(struct wlan_objmgr_vdev *vdev, + struct pno_scan_req_params *req, + uint8_t *num_chan, + uint32_t short_ssid, + int list_idx); /** * ucfg_is_6ghz_pno_scan_optimization_supported() - Public API to check diff --git a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c index 189b8d07a879..7aab4712ca76 100644 --- a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c +++ b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c @@ -185,20 +185,23 @@ QDF_STATUS ucfg_scan_pno_start(struct wlan_objmgr_vdev *vdev, return status; } -void ucfg_scan_pno_add_all_valid_6g_channels(struct wlan_objmgr_vdev *vdev, - struct pno_scan_req_params *req, - uint8_t *num_scan_ch) +void ucfg_scan_add_flags_to_pno_chan_list(struct wlan_objmgr_vdev *vdev, + struct pno_scan_req_params *req, + uint8_t *num_chan, + uint32_t short_ssid, + int list_idx) { - struct wlan_objmgr_pdev *pdev; - struct chan_list *pno_chan_list = &req->networks_list[0].pno_chan_list; - bool is_colocated_6ghz = req->scan_policy_colocated_6ghz; + struct chan_list *pno_chan_list = + &req->networks_list[list_idx].pno_chan_list; - pdev = wlan_vdev_get_pdev(vdev); - if (!pdev) - return; - - scm_add_all_valid_6g_channels(pdev, pno_chan_list, num_scan_ch, - is_colocated_6ghz); + /* Add RNR flags to channels based on scan_mode_6g ini */ + scm_add_channel_flags(vdev, pno_chan_list, num_chan, + req->scan_policy_colocated_6ghz, true); + /* Filter RNR flags in pno channel list based on short ssid entry in + * RNR db cache. + */ + scm_filter_rnr_flag_pno(vdev, short_ssid, + &req->networks_list[0].pno_chan_list); } QDF_STATUS ucfg_scan_pno_stop(struct wlan_objmgr_vdev *vdev) From 528e81a13b0f40c19288f52ca48ebf5f2b533ca9 Mon Sep 17 00:00:00 2001 From: Sheenam Monga Date: Mon, 2 May 2022 10:23:23 +0530 Subject: [PATCH 11/20] qcacmn: Add support for lower span active and passive dwell time Add LOW_SPAN_ACTIVE_DWELL_TIME and LOW_SPAN_PASSIVE_DWELL_TIME macro support to keep all 2.4g/5g active/passive dwell time same for low span scan mode. Disable adaptive dwell to firmware so that firmware cannot modify dwell time. Change-Id: Iff05dd7b37a40226c61b28a1e59ea8aa8c57cb52 CRs-Fixed: 3076163 --- os_if/linux/scan/src/wlan_cfg80211_scan.c | 3 +- umac/scan/core/src/wlan_scan_manager.c | 36 +++++++++++++++++++ .../dispatcher/inc/wlan_scan_public_structs.h | 9 +++++ 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/os_if/linux/scan/src/wlan_cfg80211_scan.c b/os_if/linux/scan/src/wlan_cfg80211_scan.c index a9b58d275bae..d76a1b825393 100644 --- a/os_if/linux/scan/src/wlan_cfg80211_scan.c +++ b/os_if/linux/scan/src/wlan_cfg80211_scan.c @@ -1535,8 +1535,7 @@ int wlan_cfg80211_scan(struct wlan_objmgr_vdev *vdev, if (req->scan_req.scan_policy_high_accuracy) req->scan_req.adaptive_dwell_time_mode = SCAN_DWELL_MODE_STATIC; - if (req->scan_req.scan_policy_low_power || - req->scan_req.scan_policy_low_span) + if (req->scan_req.scan_policy_low_power) req->scan_req.adaptive_dwell_time_mode = SCAN_DWELL_MODE_AGGRESSIVE; } diff --git a/umac/scan/core/src/wlan_scan_manager.c b/umac/scan/core/src/wlan_scan_manager.c index de436566c474..3227a43aafda 100644 --- a/umac/scan/core/src/wlan_scan_manager.c +++ b/umac/scan/core/src/wlan_scan_manager.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021-2022 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 @@ -945,6 +946,38 @@ scm_update_channel_list(struct scan_start_request *req, scm_scan_chlist_concurrency_modify(req->vdev, req); } +/** + * scm_req_update_dwell_time_as_per_scan_mode() - update scan req params + * dwell time as per scan mode. + * @req: scan request + * + * Return: void + */ +static void +scm_req_update_dwell_time_as_per_scan_mode( + struct wlan_objmgr_vdev *vdev, + struct scan_start_request *req) +{ + struct wlan_objmgr_psoc *psoc; + + psoc = wlan_vdev_get_psoc(vdev); + + if (req->scan_req.scan_policy_low_span && + wlan_scan_cfg_honour_nl_scan_policy_flags(psoc)) { + req->scan_req.adaptive_dwell_time_mode = + SCAN_DWELL_MODE_STATIC; + req->scan_req.dwell_time_active = + QDF_MIN(req->scan_req.dwell_time_active, + LOW_SPAN_ACTIVE_DWELL_TIME); + req->scan_req.dwell_time_active_2g = + QDF_MIN(req->scan_req.dwell_time_active_2g, + LOW_SPAN_ACTIVE_DWELL_TIME); + req->scan_req.dwell_time_passive = + QDF_MIN(req->scan_req.dwell_time_passive, + LOW_SPAN_PASSIVE_DWELL_TIME); + } +} + /** * scm_scan_req_update_params() - update scan req params depending on modes * and scan type. @@ -1051,6 +1084,9 @@ scm_scan_req_update_params(struct wlan_objmgr_vdev *vdev, if (req->scan_req.scan_type == SCAN_TYPE_RRM) req->scan_req.scan_ctrl_flags_ext |= SCAN_FLAG_EXT_RRM_SCAN_IND; + + scm_req_update_dwell_time_as_per_scan_mode(vdev, req); + /* * Set wide band flag if enabled. This will cause * phymode TLV being sent to FW. diff --git a/umac/scan/dispatcher/inc/wlan_scan_public_structs.h b/umac/scan/dispatcher/inc/wlan_scan_public_structs.h index 4a150b7f6b41..962edac467ab 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_public_structs.h +++ b/umac/scan/dispatcher/inc/wlan_scan_public_structs.h @@ -61,6 +61,15 @@ typedef uint32_t wlan_scan_id; #define TBTT_INFO_COUNT 16 +/* Active dwell time in low span scan mode(NL80211_SCAN_FLAG_LOW_SPAN) + * in msec + */ +#define LOW_SPAN_ACTIVE_DWELL_TIME 40 +/* passive dwell time in low span scan mode (NL80211_SCAN_FLAG_LOW_SPAN) + * in msec + */ +#define LOW_SPAN_PASSIVE_DWELL_TIME 110 + /* forward declaration */ struct wlan_objmgr_vdev; struct wlan_objmgr_pdev; From e1faf4064cefd5034ed2f5e6a75a3400414744ef Mon Sep 17 00:00:00 2001 From: Surabhi Vishnoi Date: Wed, 6 Apr 2022 14:23:05 +0530 Subject: [PATCH 12/20] qcacmn: Allow rx UDP packets during roaming before peer map is received In VoIP cases, no or minimal packet drop is expected during roaming. Currently, data packets are dropped in host if they are received after roam sync indication from firmware and before peer map indication is received due to invalid peer. This change allows rx UDP data packets during roaming before peer map indication is received from FW if peer's auth_status received in roam_sync_indication from FW is authorised. Change-Id: Ic518b7cd0aef48a2b0f8c923a2e20838b07f3d1f CRs-Fixed: 3168603 --- dp/inc/cdp_txrx_cmn.h | 28 ++++++++++++++++++++++++++ dp/inc/cdp_txrx_ops.h | 7 +++++++ dp/wifi3.0/dp_main.c | 23 +++++++++++++++++++++ dp/wifi3.0/dp_peer.c | 22 ++++++++++++++++++++ dp/wifi3.0/dp_peer.h | 23 +++++++++++++++++++++ dp/wifi3.0/dp_rx.c | 47 ++++++++++++++++++++++++++++++++++++++++++- dp/wifi3.0/dp_types.h | 15 +++++++++++++- 7 files changed, 163 insertions(+), 2 deletions(-) diff --git a/dp/inc/cdp_txrx_cmn.h b/dp/inc/cdp_txrx_cmn.h index 620513343129..5bd16a267db6 100644 --- a/dp/inc/cdp_txrx_cmn.h +++ b/dp/inc/cdp_txrx_cmn.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -694,6 +695,33 @@ cdp_peer_delete(ol_txrx_soc_handle soc, uint8_t vdev_id, soc->ops->cmn_drv_ops->txrx_peer_delete(soc, vdev_id, peer_mac, bitmap); } +#ifdef DP_RX_UDP_OVER_PEER_ROAM +static inline void +cdp_update_roaming_peer_in_vdev(ol_txrx_soc_handle soc, uint8_t vdev_id, + uint8_t *peer_mac, uint32_t auth_status) +{ + 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->txrx_update_roaming_peer) + return; + + soc->ops->cmn_drv_ops->txrx_update_roaming_peer(soc, vdev_id, + peer_mac, auth_status); +} +#else +static inline void +cdp_update_roaming_peer_in_vdev(ol_txrx_soc_handle soc, uint8_t vdev_id, + uint8_t *peer_mac, uint32_t auth_status) +{ +} +#endif + /** * cdp_peer_detach_sync() - peer detach sync callback * @soc: datapath soc handle diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index 85589c1f2c6d..70f69eaa8582 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -558,6 +558,13 @@ struct cdp_cmn_ops { QDF_STATUS (*set_vdev_pcp_tid_map)(struct cdp_soc_t *soc, uint8_t vdev_id, uint8_t pcp, uint8_t tid); +#ifdef DP_RX_UDP_OVER_PEER_ROAM + QDF_STATUS (*txrx_update_roaming_peer)(struct cdp_soc_t *soc, + uint8_t vdev_id, + uint8_t *peer_mac, + uint32_t auth_status); +#endif + #ifdef QCA_MULTIPASS_SUPPORT QDF_STATUS (*set_vlan_groupkey)(struct cdp_soc_t *soc, uint8_t vdev_id, uint16_t vlan_id, uint16_t group_key); diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 4b50d78c5779..2e513c63c093 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -7267,6 +7267,26 @@ static QDF_STATUS dp_peer_delete_wifi3(struct cdp_soc_t *soc_hdl, return QDF_STATUS_SUCCESS; } +#ifdef DP_RX_UDP_OVER_PEER_ROAM +static QDF_STATUS dp_update_roaming_peer_wifi3(struct cdp_soc_t *soc_hdl, + uint8_t vdev_id, + uint8_t *peer_mac, + uint32_t auth_status) +{ + struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl); + struct dp_vdev *vdev = dp_vdev_get_ref_by_id(soc, vdev_id, + DP_MOD_ID_CDP); + if (!vdev) + return QDF_STATUS_E_FAILURE; + + vdev->roaming_peer_status = auth_status; + qdf_mem_copy(vdev->roaming_peer_mac.raw, peer_mac, + QDF_MAC_ADDR_SIZE); + dp_vdev_unref_delete(soc, vdev, DP_MOD_ID_CDP); + + return QDF_STATUS_SUCCESS; +} +#endif /* * dp_get_vdev_mac_addr_wifi3() – Detach txrx peer * @soc_hdl: Datapath soc handle @@ -11332,6 +11352,9 @@ static struct cdp_cmn_ops dp_ops_cmn = { .txrx_peer_ast_delete_by_pdev = dp_peer_ast_entry_del_by_pdev, .txrx_peer_delete = dp_peer_delete_wifi3, +#ifdef DP_RX_UDP_OVER_PEER_ROAM + .txrx_update_roaming_peer = dp_update_roaming_peer_wifi3, +#endif .txrx_vdev_register = dp_vdev_register_wifi3, .txrx_soc_detach = dp_soc_detach_wifi3, .txrx_soc_deinit = dp_soc_deinit_wifi3, diff --git a/dp/wifi3.0/dp_peer.c b/dp/wifi3.0/dp_peer.c index 1da11b1e418f..a94f385852f4 100644 --- a/dp/wifi3.0/dp_peer.c +++ b/dp/wifi3.0/dp_peer.c @@ -2095,6 +2095,26 @@ static inline struct dp_peer *dp_peer_find_add_id(struct dp_soc *soc, return NULL; } +#ifdef DP_RX_UDP_OVER_PEER_ROAM +void dp_rx_reset_roaming_peer(struct dp_soc *soc, uint8_t vdev_id, + uint8_t *peer_mac_addr) +{ + struct dp_vdev *vdev = NULL; + + vdev = dp_vdev_get_ref_by_id(soc, vdev_id, DP_MOD_ID_HTT); + if (vdev) { + if (qdf_mem_cmp(vdev->roaming_peer_mac.raw, peer_mac_addr, + QDF_MAC_ADDR_SIZE) == 0) { + vdev->roaming_peer_status = + WLAN_ROAM_PEER_AUTH_STATUS_NONE; + qdf_mem_zero(vdev->roaming_peer_mac.raw, + QDF_MAC_ADDR_SIZE); + } + dp_vdev_unref_delete(soc, vdev, DP_MOD_ID_HTT); + } +} +#endif + /** * dp_rx_peer_map_handler() - handle peer map event from firmware * @soc_handle - genereic soc handle @@ -2188,6 +2208,8 @@ dp_rx_peer_map_handler(struct dp_soc *soc, uint16_t peer_id, vdev_id, ast_hash, is_wds); } + dp_rx_reset_roaming_peer(soc, vdev_id, peer_mac_addr); + return err; } diff --git a/dp/wifi3.0/dp_peer.h b/dp/wifi3.0/dp_peer.h index 75fff6f66df6..f31b16c27b64 100644 --- a/dp/wifi3.0/dp_peer.h +++ b/dp/wifi3.0/dp_peer.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -542,6 +543,28 @@ dp_peer_update_state(struct dp_soc *soc, } void dp_print_ast_stats(struct dp_soc *soc); + +#ifdef DP_RX_UDP_OVER_PEER_ROAM +/** + * dp_rx_reset_roaming_peer() - Reset the roamed peer in vdev + * @soc - dp soc pointer + * @vdev_id - vdev id + * @peer_mac_addr - mac address of the peer + * + * This function resets the roamed peer auth status and mac address + * after peer map indication of same peer is received from firmware. + * + * Return: None + */ +void dp_rx_reset_roaming_peer(struct dp_soc *soc, uint8_t vdev_id, + uint8_t *peer_mac_addr); +#else +static inline void dp_rx_reset_roaming_peer(struct dp_soc *soc, uint8_t vdev_id, + uint8_t *peer_mac_addr) +{ +} +#endif + QDF_STATUS dp_rx_peer_map_handler(struct dp_soc *soc, uint16_t peer_id, uint16_t hw_peer_id, uint8_t vdev_id, uint8_t *peer_mac_addr, uint16_t ast_hash, diff --git a/dp/wifi3.0/dp_rx.c b/dp/wifi3.0/dp_rx.c index 9fd2fe6c87d0..eebc90a648c0 100644 --- a/dp/wifi3.0/dp_rx.c +++ b/dp/wifi3.0/dp_rx.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -2060,6 +2061,49 @@ static inline bool dp_rx_enable_eol_data_check(struct dp_soc *soc) #endif /* WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT */ #ifdef DP_RX_PKT_NO_PEER_DELIVER +#ifdef DP_RX_UDP_OVER_PEER_ROAM +/** + * dp_rx_is_udp_allowed_over_roam_peer() - check if udp data received + * during roaming + * @vdev: dp_vdev pointer + * @rx_tlv_hdr: rx tlv header + * @nbuf: pkt skb pointer + * + * This function will check if rx udp data is received from authorised + * roamed peer before peer map indication is received from FW after + * roaming. This is needed for VoIP scenarios in which packet loss + * expected during roaming is minimal. + * + * Return: bool + */ +static bool dp_rx_is_udp_allowed_over_roam_peer(struct dp_vdev *vdev, + uint8_t *rx_tlv_hdr, + qdf_nbuf_t nbuf) +{ + char *hdr_desc; + struct ieee80211_frame *wh = NULL; + + hdr_desc = HAL_RX_DESC_GET_80211_HDR(rx_tlv_hdr); + wh = (struct ieee80211_frame *)hdr_desc; + + if (vdev->roaming_peer_status == + WLAN_ROAM_PEER_AUTH_STATUS_AUTHENTICATED && + !qdf_mem_cmp(vdev->roaming_peer_mac.raw, wh->i_addr2, + QDF_MAC_ADDR_SIZE) && (qdf_nbuf_is_ipv4_udp_pkt(nbuf) || + qdf_nbuf_is_ipv6_udp_pkt(nbuf))) + return true; + + return false; +} +#else +static bool dp_rx_is_udp_allowed_over_roam_peer(struct dp_vdev *vdev, + uint8_t *rx_tlv_hdr, + qdf_nbuf_t nbuf) +{ + return false; +} +#endif + /** * dp_rx_deliver_to_stack_no_peer() - try deliver rx data even if * no corresbonding peer found @@ -2110,7 +2154,8 @@ void dp_rx_deliver_to_stack_no_peer(struct dp_soc *soc, qdf_nbuf_t nbuf) RX_PKT_TLVS_LEN + l2_hdr_offset); - if (dp_rx_is_special_frame(nbuf, frame_mask)) { + if (dp_rx_is_special_frame(nbuf, frame_mask) || + dp_rx_is_udp_allowed_over_roam_peer(vdev, rx_tlv_hdr, nbuf)) { qdf_nbuf_set_exc_frame(nbuf, 1); if (QDF_STATUS_SUCCESS != vdev->osif_rx(vdev->osif_vdev, nbuf)) diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 68a3813027d5..8dd06f7b1efb 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -2542,6 +2542,15 @@ struct dp_pdev { struct dp_peer; +#ifdef DP_RX_UDP_OVER_PEER_ROAM +#define WLAN_ROAM_PEER_AUTH_STATUS_NONE 0x0 +/** + * This macro is equivalent to macro ROAM_AUTH_STATUS_AUTHENTICATED used + * in connection mgr + */ +#define WLAN_ROAM_PEER_AUTH_STATUS_AUTHENTICATED 0x2 +#endif + /* VDEV structure for data path state */ struct dp_vdev { /* OS device abstraction */ @@ -2787,7 +2796,6 @@ 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_FEATURE_TSF_UPLINK_DELAY /* Indicate if uplink delay report is enabled or not */ qdf_atomic_t ul_delay_report; @@ -2798,6 +2806,11 @@ struct dp_vdev { /* accumulative number of packets delay has accumulated */ qdf_atomic_t ul_pkts_accum; #endif /* WLAN_FEATURE_TSF_UPLINK_DELAY */ + +#ifdef DP_RX_UDP_OVER_PEER_ROAM + uint32_t roaming_peer_status; + union dp_align_mac_addr roaming_peer_mac; +#endif }; enum { From ee7e4cf08b7eed19f6db9b57eede921378a7b35f Mon Sep 17 00:00:00 2001 From: Jyoti Kumari Date: Wed, 4 May 2022 15:22:20 +0530 Subject: [PATCH 13/20] qcacmn: Skip STA scan on 6Ghz and 5ghz indoor chan if SAP is up Currently STA can scan and come up on 6Ghz or 5Ghz indoor channel if hardware is non-dbs and SAP is present As part of this change, do not allow STA to scan on 6Ghz and 5Ghz indoor channel for non-dbs hardware if SAP is present Change-Id: I97759f8b2c6a1c460d90fbb797a0e64d2532797c CRs-Fixed: 3186406 --- umac/scan/core/src/wlan_scan_main.h | 4 + umac/scan/core/src/wlan_scan_manager.c | 99 +++++++++++++++---- umac/scan/dispatcher/inc/wlan_scan_api.h | 9 ++ umac/scan/dispatcher/inc/wlan_scan_cfg.h | 22 +++++ umac/scan/dispatcher/src/wlan_scan_api.c | 11 +++ umac/scan/dispatcher/src/wlan_scan_ucfg_api.c | 4 + 6 files changed, 132 insertions(+), 17 deletions(-) diff --git a/umac/scan/core/src/wlan_scan_main.h b/umac/scan/core/src/wlan_scan_main.h index 929043151589..b4917c652156 100644 --- a/umac/scan/core/src/wlan_scan_main.h +++ b/umac/scan/core/src/wlan_scan_main.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -341,6 +342,8 @@ struct extscan_def_config { * @adaptive_dwell_time_mode_nc: adaptive dwell mode without connection * @honour_nl_scan_policy_flags: honour nl80211 scan policy flags * @extscan_adaptive_dwell_mode: Adaptive dwell mode during ext scan + * @skip_6g_and_indoor_freq: skip 6Ghz and 5Gh indoor freq channel for + * STA scan if hw is non-DBS and SAP is present * @scan_f_passive: passively scan all channels including active channels * @scan_f_bcast_probe: add wild card ssid prbreq even if ssid_list is specified * @scan_f_cck_rates: add cck rates to rates/xrates ie in prb req @@ -432,6 +435,7 @@ struct scan_default_params { enum scan_dwelltime_adaptive_mode adaptive_dwell_time_mode_nc; bool honour_nl_scan_policy_flags; enum scan_dwelltime_adaptive_mode extscan_adaptive_dwell_mode; + bool skip_6g_and_indoor_freq; union { struct { uint32_t scan_f_passive:1, diff --git a/umac/scan/core/src/wlan_scan_manager.c b/umac/scan/core/src/wlan_scan_manager.c index 3227a43aafda..3e2db7135001 100644 --- a/umac/scan/core/src/wlan_scan_manager.c +++ b/umac/scan/core/src/wlan_scan_manager.c @@ -803,6 +803,65 @@ static void scm_req_update_concurrency_params(struct wlan_objmgr_vdev *vdev, } } +/** + *scm_update_5g_chlist() - Modify channel list to skip 5Ghz channel + * @req: scan request + * + * Return: None + */ +static inline void scm_update_5g_chlist(struct scan_start_request *req) +{ + uint32_t i; + uint32_t num_scan_channels = 0; + qdf_freq_t freq; + + for (i = 0; i < req->scan_req.chan_list.num_chan; i++) { + freq = req->scan_req.chan_list.chan[i].freq; + if (WLAN_REG_IS_5GHZ_CH_FREQ(freq)) + continue; + + req->scan_req.chan_list.chan[num_scan_channels++] = + req->scan_req.chan_list.chan[i]; + } + if (num_scan_channels < req->scan_req.chan_list.num_chan) + scm_debug("5g chan skipped (%d, %d)", + req->scan_req.chan_list.num_chan, num_scan_channels); + req->scan_req.chan_list.num_chan = num_scan_channels; +} + +/** + * scm_filter_6g_and_indoor_freq() - Modify channel list to skip 6Ghz and 5Ghz + * indoor channel if hw mode is non dbs and SAP is present + * @pdev: pointer to pdev + * @req: scan request + * + * Return: None + */ +static void scm_filter_6g_and_indoor_freq(struct wlan_objmgr_pdev *pdev, + struct scan_start_request *req) +{ + uint32_t i; + uint32_t num_scan_channels; + qdf_freq_t freq; + + num_scan_channels = 0; + for (i = 0; i < req->scan_req.chan_list.num_chan; i++) { + freq = req->scan_req.chan_list.chan[i].freq; + if (WLAN_REG_IS_6GHZ_CHAN_FREQ(freq)) + continue; + + if (wlan_reg_is_freq_indoor(pdev, freq)) + continue; + + req->scan_req.chan_list.chan[num_scan_channels++] = + req->scan_req.chan_list.chan[i]; + } + if (num_scan_channels < req->scan_req.chan_list.num_chan) + scm_debug("6g and indoor channel chan skipped (%d, %d)", + req->scan_req.chan_list.num_chan, num_scan_channels); + req->scan_req.chan_list.num_chan = num_scan_channels; +} + /** * scm_scan_chlist_concurrency_modify() - modify chan list to skip 5G if * required @@ -817,31 +876,37 @@ static inline void scm_scan_chlist_concurrency_modify( struct wlan_objmgr_vdev *vdev, struct scan_start_request *req) { struct wlan_objmgr_psoc *psoc; - uint32_t i; - uint32_t num_scan_channels; + struct wlan_objmgr_pdev *pdev; + struct wlan_scan_obj *scan_obj; + + pdev = wlan_vdev_get_pdev(vdev); + if (!pdev) + return; psoc = wlan_vdev_get_psoc(vdev); if (!psoc) return; + + scan_obj = wlan_psoc_get_scan_obj(psoc); + if (!scan_obj) + return; + /* do this only for STA and P2P-CLI mode */ if (!(wlan_vdev_mlme_get_opmode(req->vdev) == QDF_STA_MODE) && !(wlan_vdev_mlme_get_opmode(req->vdev) == QDF_P2P_CLIENT_MODE)) return; - if (!policy_mgr_scan_trim_5g_chnls_for_dfs_ap(psoc)) - return; - num_scan_channels = 0; - for (i = 0; i < req->scan_req.chan_list.num_chan; i++) { - if (WLAN_REG_IS_5GHZ_CH_FREQ( - req->scan_req.chan_list.chan[i].freq)) { - continue; - } - req->scan_req.chan_list.chan[num_scan_channels++] = - req->scan_req.chan_list.chan[i]; - } - if (num_scan_channels < req->scan_req.chan_list.num_chan) - scm_debug("5g chan skipped (%d, %d)", - req->scan_req.chan_list.num_chan, num_scan_channels); - req->scan_req.chan_list.num_chan = num_scan_channels; + if (policy_mgr_scan_trim_5g_chnls_for_dfs_ap(psoc)) + scm_update_5g_chlist(req); + + /* + * Do not allow STA to scan on 6Ghz or indoor channel for non dbs + * hardware if SAP and skip_6g_and_indoor_freq_scan ini are present + */ + if (scan_obj->scan_def.skip_6g_and_indoor_freq && + !policy_mgr_is_hw_dbs_capable(psoc) && + (wlan_vdev_mlme_get_opmode(vdev) == QDF_STA_MODE) && + policy_mgr_mode_specific_connection_count(psoc, PM_SAP_MODE, NULL)) + scm_filter_6g_and_indoor_freq(pdev, req); } #else static inline diff --git a/umac/scan/dispatcher/inc/wlan_scan_api.h b/umac/scan/dispatcher/inc/wlan_scan_api.h index 4a39af7d2e18..84a54c6c0b9f 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_api.h +++ b/umac/scan/dispatcher/inc/wlan_scan_api.h @@ -335,4 +335,13 @@ QDF_STATUS wlan_scan_start(struct scan_start_request *req); */ QDF_STATUS wlan_scan_cancel(struct scan_cancel_request *req); +/** + * wlan_scan_cfg_skip_6g_and_indoor_freq() - API to get 6g and indoor freq + * scan ini val + * @psoc: psoc object + * + * Return: skip 6g and indoor freq scan or not + */ +bool wlan_scan_cfg_skip_6g_and_indoor_freq( + struct wlan_objmgr_psoc *psoc); #endif diff --git a/umac/scan/dispatcher/inc/wlan_scan_cfg.h b/umac/scan/dispatcher/inc/wlan_scan_cfg.h index b9dc233d63b5..61f79cc39939 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_cfg.h +++ b/umac/scan/dispatcher/inc/wlan_scan_cfg.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -1412,6 +1413,26 @@ enum scan_mode_6ghz { false, \ "scan allow bss with corrupted ie") +/* + * + * skip_6g_and_indoor_freq_scan - Skip scan on 6Ghz and indoor channel + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to skip 6Ghz and 5Gh indoor freq for STA scan if hw is + * non-DBS and SAP is present + * + * Related: scan + * + * Usage: External + * + * + */ +#define CFG_SKIP_6GHZ_AND_INDOOR_FREQ_SCAN CFG_INI_BOOL( \ + "skip_6g_and_indoor_freq_scan", \ + false, \ + "skip sta scan on 6Ghz and 5Ghz indoor channel") #define CFG_SCAN_ALL \ CFG(CFG_DROP_BCN_ON_CHANNEL_MISMATCH) \ CFG(CFG_DROP_BCN_ON_INVALID_FREQ) \ @@ -1449,6 +1470,7 @@ enum scan_mode_6ghz { CFG(CFG_6GHZ_SCAN_MODE) \ CFG(CFG_6GHZ_SCAN_MODE_DUTY_CYCLE) \ CFG(CFG_SCAN_ALLOW_BSS_WITH_CORRUPTED_IE) \ + CFG(CFG_SKIP_6GHZ_AND_INDOOR_FREQ_SCAN) \ CFG_SCAN_PNO #endif /* __CONFIG_SCAN_H */ diff --git a/umac/scan/dispatcher/src/wlan_scan_api.c b/umac/scan/dispatcher/src/wlan_scan_api.c index c4b77a972071..86015c58d1f5 100644 --- a/umac/scan/dispatcher/src/wlan_scan_api.c +++ b/umac/scan/dispatcher/src/wlan_scan_api.c @@ -430,3 +430,14 @@ req_free: return status; } + +bool wlan_scan_cfg_skip_6g_and_indoor_freq(struct wlan_objmgr_psoc *psoc) +{ + struct wlan_scan_obj *scan_obj; + + scan_obj = wlan_psoc_get_scan_obj(psoc); + if (!scan_obj) + return false; + + return scan_obj->scan_def.skip_6g_and_indoor_freq; +} diff --git a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c index 7aab4712ca76..0e723d0a6da3 100644 --- a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c +++ b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c @@ -983,6 +983,10 @@ wlan_scan_global_init(struct wlan_objmgr_psoc *psoc, cfg_get(psoc, CFG_6GHZ_SCAN_MODE_DUTY_CYCLE); scan_obj->allow_bss_with_incomplete_ie = cfg_get(psoc, CFG_SCAN_ALLOW_BSS_WITH_CORRUPTED_IE); + + scan_obj->scan_def.skip_6g_and_indoor_freq = + cfg_get(psoc, CFG_SKIP_6GHZ_AND_INDOOR_FREQ_SCAN); + /* init scan id seed */ qdf_atomic_init(&scan_obj->scan_ids); From fa5d0cffabcc17f3b574b53a2eb2e6c55a441330 Mon Sep 17 00:00:00 2001 From: Ananya Gupta Date: Mon, 23 May 2022 14:10:16 +0530 Subject: [PATCH 14/20] qcacmn: Increase status size for HTT WBM completion v3 In beryllium DP, htt_tx_wbm_completion_v3 is used in which 20B are used by host and only 16B is assigned to the htt tx status. To fix this, increase the macro HAL_TX_COMP_HTT_STATUS_LEN to 20 bytes. Change-Id: I973ba1f8118488089cd6d6baac7fd589886c2164 CRs-Fixed: 3199031 --- hal/wifi3.0/hal_tx.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hal/wifi3.0/hal_tx.h b/hal/wifi3.0/hal_tx.h index fde6f2bdb0fe..769ca0742f95 100644 --- a/hal/wifi3.0/hal_tx.h +++ b/hal/wifi3.0/hal_tx.h @@ -107,7 +107,11 @@ do { \ * (Exception frames and TQM bypass frames) */ #define HAL_TX_COMP_HTT_STATUS_OFFSET 8 +#ifdef CONFIG_BERYLLIUM +#define HAL_TX_COMP_HTT_STATUS_LEN 20 +#else #define HAL_TX_COMP_HTT_STATUS_LEN 16 +#endif #define HAL_TX_BUF_TYPE_BUFFER 0 #define HAL_TX_BUF_TYPE_EXT_DESC 1 From 9bb66a7d99bf80a877a18135d6c7b5040e1a8a5a Mon Sep 17 00:00:00 2001 From: Yu Tian Date: Wed, 25 May 2022 14:38:41 +0800 Subject: [PATCH 15/20] qcacmn: Set BA status to active when receiving ADDBA event Usually, ADDBA frame exchange is handled by HOST. But when this is offloaded to FW, an HTT event is reported and HOST only needs to update RX tid parameters, no need to send addba resp frame again. BA status update is in addba resp TX completion, so there is no chance to update this field in ADDBA offload case. This change is used to set ba status to active to make ba session in correct status. Change-Id: Iae4a1974cf4b8c55b20862df51b14d5011aefd73 CRs-Fixed: 3201455 --- dp/wifi3.0/dp_htt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dp/wifi3.0/dp_htt.c b/dp/wifi3.0/dp_htt.c index 3dc1b76ff8d0..3f92e71ee28e 100644 --- a/dp/wifi3.0/dp_htt.c +++ b/dp/wifi3.0/dp_htt.c @@ -4709,6 +4709,12 @@ static void dp_htt_t2h_msg_handler(void *context, HTC_PACKET *pkt) peer->mac_addr.raw, peer->vdev->vdev_id, 0, tid, 0, win_sz + 1, 0xffff); + dp_addba_resp_tx_completion_wifi3( + (struct cdp_soc_t *)soc->dp_soc, + peer->mac_addr.raw, peer->vdev->vdev_id, + tid, + status); + /* * If PEER_LOCK_REF_PROTECT enbled dec ref * which is inc by dp_peer_get_ref_by_id From 3c030c208611d18f9837bd7c73e095e170a3ef4b Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Wed, 25 May 2022 16:23:43 +0530 Subject: [PATCH 16/20] qcacmn: Add ini to set priority for TC ingress filter Add ini support to configure TC ingress filter priority value which would be used for TC based dynamic GRO. Change-Id: I1742f4539353939e3a40ff4096b3f833f2029b12 CRs-Fixed: 3206817 --- dp/inc/cdp_txrx_cmn_struct.h | 6 ++++-- dp/wifi3.0/dp_main.c | 7 +++++-- dp/wifi3.0/dp_stats.c | 6 ++++-- wlan_cfg/cfg_dp.h | 21 +++++++++++++++++---- wlan_cfg/wlan_cfg.c | 5 +++-- wlan_cfg/wlan_cfg.h | 6 ++++-- 6 files changed, 37 insertions(+), 14 deletions(-) diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h index 2950d9077021..b2b92dac4643 100644 --- a/dp/inc/cdp_txrx_cmn_struct.h +++ b/dp/inc/cdp_txrx_cmn_struct.h @@ -2333,7 +2333,8 @@ struct cdp_monitor_filter { * @cfg_dp_tso_enable: get TSO enable config * @cfg_dp_lro_enable: get LRO enable config * @cfg_dp_gro_enable: get GRP enable config - * @cfg_dp_force_gro_enable: get Force GRP enable config + * @cfg_dp_tc_based_dyn_gro_enable: get TC based dynamic gro enable config + * @cfg_dp_tc_ingress_prio: priority value to be checked for tc filters * @cfg_dp_tx_flow_start_queue_offset: get DP TX flow start queue offset * @cfg_dp_tx_flow_stop_queue_threshold: get DP TX flow stop queue threshold * @cfg_dp_ipa_uc_tx_buf_size: get IPA TX buf size config @@ -2356,7 +2357,8 @@ enum cdp_dp_cfg { cfg_dp_tso_enable, cfg_dp_lro_enable, cfg_dp_gro_enable, - cfg_dp_force_gro_enable, + cfg_dp_tc_based_dyn_gro_enable, + cfg_dp_tc_ingress_prio, cfg_dp_tx_flow_start_queue_offset, cfg_dp_tx_flow_stop_queue_threshold, cfg_dp_ipa_uc_tx_buf_size, diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 2e513c63c093..a24ee6735250 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -11113,8 +11113,11 @@ static uint32_t dp_get_cfg(struct cdp_soc_t *soc, enum cdp_dp_cfg cfg) case cfg_dp_gro_enable: value = dpsoc->wlan_cfg_ctx->gro_enabled; break; - case cfg_dp_force_gro_enable: - value = dpsoc->wlan_cfg_ctx->force_gro_enabled; + case cfg_dp_tc_based_dyn_gro_enable: + value = dpsoc->wlan_cfg_ctx->tc_based_dynamic_gro; + break; + case cfg_dp_tc_ingress_prio: + value = dpsoc->wlan_cfg_ctx->tc_ingress_prio; break; case cfg_dp_tx_flow_start_queue_offset: value = dpsoc->wlan_cfg_ctx->tx_flow_start_queue_offset; diff --git a/dp/wifi3.0/dp_stats.c b/dp/wifi3.0/dp_stats.c index b3453fe4a2da..b5356e6b5bee 100644 --- a/dp/wifi3.0/dp_stats.c +++ b/dp/wifi3.0/dp_stats.c @@ -4917,8 +4917,10 @@ void dp_print_soc_cfg_params(struct dp_soc *soc) soc_cfg_ctx->sg_enabled); DP_PRINT_STATS("Gro enabled: %u ", soc_cfg_ctx->gro_enabled); - DP_PRINT_STATS("Force Gro enabled: %u ", - soc_cfg_ctx->force_gro_enabled); + DP_PRINT_STATS("TC based dynamic GRO: %u ", + soc_cfg_ctx->tc_based_dynamic_gro); + DP_PRINT_STATS("TC ingress prio: %u ", + soc_cfg_ctx->tc_ingress_prio); DP_PRINT_STATS("rawmode enabled: %u ", soc_cfg_ctx->rawmode_enabled); DP_PRINT_STATS("peer flow ctrl enabled: %u ", diff --git a/wlan_cfg/cfg_dp.h b/wlan_cfg/cfg_dp.h index 482963db3ce1..5985617338c3 100644 --- a/wlan_cfg/cfg_dp.h +++ b/wlan_cfg/cfg_dp.h @@ -619,7 +619,8 @@ #define WLAN_CFG_GRO_ENABLE_MAX 3 #define WLAN_CFG_GRO_ENABLE_DEFAULT 0 #define DP_GRO_ENABLE_BIT_SET BIT(0) -#define DP_FORCE_USE_GRO_BIT_SET BIT(1) +#define DP_TC_BASED_DYNAMIC_GRO BIT(1) + /* * * CFG_DP_GRO - Enable the GRO feature standalonely @@ -629,9 +630,9 @@ * * This ini entry is used to enable/disable GRO feature standalonely. * Value 0: Disable GRO feature - * Value 1: Enable Dynamic GRO feature, TC rule can control GRO - * behavior of STA mode - * Value 3: Enable GRO feature forcibly + * Value 1: Enable GRO feature always + * Value 3: Enable GRO dynamic feature where TC rule can control GRO + * behavior * * Usage: External * @@ -644,6 +645,17 @@ WLAN_CFG_GRO_ENABLE_DEFAULT, \ CFG_VALUE_OR_DEFAULT, "DP GRO Enable") +#define WLAN_CFG_TC_INGRESS_PRIO_MIN 0 +#define WLAN_CFG_TC_INGRESS_PRIO_MAX 0xFFFF +#define WLAN_CFG_TC_INGRESS_PRIO_DEFAULT 0 + +#define CFG_DP_TC_INGRESS_PRIO \ + CFG_INI_UINT("tc_ingress_prio", \ + WLAN_CFG_TC_INGRESS_PRIO_MIN, \ + WLAN_CFG_TC_INGRESS_PRIO_MAX, \ + WLAN_CFG_TC_INGRESS_PRIO_DEFAULT, \ + CFG_VALUE_OR_DEFAULT, "DP tc ingress prio") + #define CFG_DP_OL_TX_CSUM \ CFG_INI_BOOL("dp_offload_tx_csum_support", false, \ "DP tx csum Enable") @@ -1165,6 +1177,7 @@ CFG(CFG_DP_LRO) \ CFG(CFG_DP_SG) \ CFG(CFG_DP_GRO) \ + CFG(CFG_DP_TC_INGRESS_PRIO) \ CFG(CFG_DP_OL_TX_CSUM) \ CFG(CFG_DP_OL_RX_CSUM) \ CFG(CFG_DP_RAWMODE) \ diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index 28a64b5903f5..35405fd7da5f 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -565,9 +565,10 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc) gro_bit_set = cfg_get(psoc, CFG_DP_GRO); if (gro_bit_set & DP_GRO_ENABLE_BIT_SET) { wlan_cfg_ctx->gro_enabled = true; - if (gro_bit_set & DP_FORCE_USE_GRO_BIT_SET) - wlan_cfg_ctx->force_gro_enabled = true; + if (gro_bit_set & DP_TC_BASED_DYNAMIC_GRO) + wlan_cfg_ctx->tc_based_dynamic_gro = true; } + wlan_cfg_ctx->tc_ingress_prio = cfg_get(psoc, CFG_DP_TC_INGRESS_PRIO); wlan_cfg_ctx->ol_tx_csum_enabled = cfg_get(psoc, CFG_DP_OL_TX_CSUM); wlan_cfg_ctx->ol_rx_csum_enabled = cfg_get(psoc, CFG_DP_OL_RX_CSUM); wlan_cfg_ctx->rawmode_enabled = cfg_get(psoc, CFG_DP_RAWMODE); diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index 98ffb9a4dda8..ad30286a7828 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -135,7 +135,8 @@ struct wlan_srng_cfg { * @lro_enabled: enable/disable LRO feature * @sg_enabled: enable disable scatter gather feature * @gro_enabled: enable disable GRO feature - * @force_gro_enabled: force enable GRO feature + * @tc_based_dynamic_gro: enable/disable tc based dynamic gro + * @tc_ingress_prio: ingress prio to be checked for dynamic gro * @ipa_enabled: Flag indicating if IPA is enabled * @ol_tx_csum_enabled: Flag indicating if TX csum is enabled * @ol_rx_csum_enabled: Flag indicating if Rx csum is enabled @@ -246,7 +247,8 @@ struct wlan_cfg_dp_soc_ctxt { bool lro_enabled; bool sg_enabled; bool gro_enabled; - bool force_gro_enabled; + bool tc_based_dynamic_gro; + uint32_t tc_ingress_prio; bool ipa_enabled; bool ol_tx_csum_enabled; bool ol_rx_csum_enabled; From 632f6b3e9ef8d86e17ec844ba11634586f21d0b6 Mon Sep 17 00:00:00 2001 From: Surya Prakash Sivaraj Date: Thu, 28 Apr 2022 18:56:07 +0530 Subject: [PATCH 17/20] qcacmn: Update preauth candidate entry to scan table During SAE roam auth offload, update the beacon/probe response frame coming from the FW via WMI_ROAM_FRAME_EVENTID into the scan db. When the bss info of the preauth candidate is unavailable in the host/kernel scan entry, supplicant fails to determine the proper SAE PWE config of the peer and the commit request fails. Change-Id: I8537147104f30b74ffb2e87946f2e5f4b129f0df CRs-Fixed: 3075460 --- .../cmn_defs/inc/wlan_cmn_ieee80211.h | 5 +++++ umac/scan/dispatcher/inc/wlan_scan_utils_api.h | 17 +++++++++++++++++ umac/scan/dispatcher/src/wlan_scan_utils_api.c | 12 ++++++++++++ wmi/inc/wmi_unified_param.h | 1 + wmi/src/wmi_unified_tlv.c | 2 ++ 5 files changed, 37 insertions(+) diff --git a/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h b/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h index 6a9907af33e7..24e7466ce7ef 100644 --- a/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h +++ b/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -196,6 +197,10 @@ /* 80 + 80 MHz Operating Channel (revised signalling) */ #define WLAN_VHTOP_CHWIDTH_REVSIG_80_80 1 +#define WLAN_MAX_HEOP_IE_LEN 16 +#define WLAN_HEOP_OUI_TYPE "\x24" +#define WLAN_HEOP_OUI_SIZE 1 + #define WLAN_HEOP_FIXED_PARAM_LENGTH 7 #define WLAN_HEOP_VHTOP_LENGTH 3 #define WLAN_HEOP_CO_LOCATED_BSS_LENGTH 1 diff --git a/umac/scan/dispatcher/inc/wlan_scan_utils_api.h b/umac/scan/dispatcher/inc/wlan_scan_utils_api.h index c5a3081582f4..08a36fab5508 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_utils_api.h +++ b/umac/scan/dispatcher/inc/wlan_scan_utils_api.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -1721,4 +1722,20 @@ static inline bool util_scan_is_null_ssid(struct wlan_ssid *ssid) return false; } +/** + * util_scan_get_6g_oper_channel() - function to get primary channel + * from he op IE + * he_op_ie : ie pointer + * + * Return : primary channel or 0 if 6g params is not present. + */ +#ifdef CONFIG_BAND_6GHZ +uint8_t util_scan_get_6g_oper_channel(uint8_t *he_op_ie); +#else +static inline uint8_t +util_scan_get_6g_oper_channel(uint8_t *he_op_ie) +{ + return 0; +} +#endif #endif diff --git a/umac/scan/dispatcher/src/wlan_scan_utils_api.c b/umac/scan/dispatcher/src/wlan_scan_utils_api.c index a7130b60551c..66a4555e03aa 100644 --- a/umac/scan/dispatcher/src/wlan_scan_utils_api.c +++ b/umac/scan/dispatcher/src/wlan_scan_utils_api.c @@ -339,6 +339,18 @@ util_scan_get_phymode_6g(struct wlan_objmgr_pdev *pdev, return phymode; } + +uint8_t +util_scan_get_6g_oper_channel(uint8_t *he_op_ie) +{ + struct he_oper_6g_param *he_6g_params; + + he_6g_params = util_scan_get_he_6g_params(he_op_ie); + if (!he_6g_params) + return 0; + + return he_6g_params->primary_channel; +} #else static QDF_STATUS util_scan_get_chan_from_he_6g_params(struct wlan_objmgr_pdev *pdev, diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 87bc26ff2175..0fa5f924d1c1 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -4697,6 +4697,7 @@ typedef enum { #ifdef WLAN_FEATURE_PKT_CAPTURE_V2 wmi_vdev_smart_monitor_event_id, #endif + wmi_roam_frame_event_id, wmi_events_max, } wmi_conv_event_id; diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 6edd7e6b616d..fb8e13a9fa61 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -15548,6 +15548,8 @@ event_ids[wmi_roam_scan_chan_list_id] = event_ids[wmi_vdev_smart_monitor_event_id] = WMI_VDEV_SMART_MONITOR_EVENTID; #endif + event_ids[wmi_roam_frame_event_id] = + WMI_ROAM_FRAME_EVENTID; } #ifdef WLAN_FEATURE_LINK_LAYER_STATS From 2c7cff8715dc9ae71297138abff374a44a2b2cc1 Mon Sep 17 00:00:00 2001 From: Rahul Gusain Date: Thu, 19 Nov 2020 16:56:30 +0800 Subject: [PATCH 18/20] qcacmn: Fix buffer overflow written in the dp_soc_interrupt_detach Use sizeof instead of REG_BAND_UNKNOWN to fix buffer overflow written in the dp_soc_interrupt_detach. Change-Id: Iffad59346c487e34632f1c60b2c88e635f6e83a0 CRs-Fixed: 2822433 --- dp/wifi3.0/dp_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index a24ee6735250..335d4232638e 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -2691,7 +2691,8 @@ static void dp_soc_interrupt_detach(struct cdp_soc_t *txrx_soc) } qdf_mem_set(&soc->mon_intr_id_lmac_map, - REG_BAND_UNKNOWN * sizeof(int), DP_MON_INVALID_LMAC_ID); + sizeof(soc->mon_intr_id_lmac_map), + DP_MON_INVALID_LMAC_ID); } #define AVG_MAX_MPDUS_PER_TID 128 From ad79a12e2aa7d22b72ed7fca95779e5e5d1871a1 Mon Sep 17 00:00:00 2001 From: Madhvapathi Sriram Date: Fri, 15 Apr 2022 18:57:39 +0530 Subject: [PATCH 19/20] qcacmn: Initialize wlan config structure When RRI over DDR feature is not enabled, the variable rri_over_ddr_cfg_valid goes uninitialzed. This can lead to unpredictable behaviour. Fix this by initializing pld_wlan_enable_cfg to zero before use. Change-Id: I485dc552201111834375411b9a493ddbf9a7505c CRs-Fixed: 3176497 --- hif/src/ce/ce_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c index 9a8fc114bbdd..14f4f978fef5 100644 --- a/hif/src/ce/ce_main.c +++ b/hif/src/ce/ce_main.c @@ -3163,7 +3163,7 @@ static void hif_update_rri_over_ddr_config(struct hif_softc *scn, */ int hif_wlan_enable(struct hif_softc *scn) { - struct pld_wlan_enable_cfg cfg; + struct pld_wlan_enable_cfg cfg = { 0 }; enum pld_driver_mode mode; uint32_t con_mode = hif_get_conparam(scn); From 796e14de237237b43639a90a07e497ef0d5d4041 Mon Sep 17 00:00:00 2001 From: Vulupala Shashank Reddy Date: Tue, 19 Jul 2022 22:40:52 +0530 Subject: [PATCH 20/20] qcacmn: Update dp_get_pdev_param for Channel and frequency Add provision to get channel and frequency from pdev. Change-Id: I73f291ebf1517f7f2885853d43b873cfdbd86a93 CRs-Fixed: 3248485 --- dp/wifi3.0/dp_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 335d4232638e..4451f5f47a76 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -9026,6 +9026,14 @@ static QDF_STATUS dp_get_pdev_param(struct cdp_soc_t *cdp_soc, uint8_t pdev_id, val->cdp_pdev_param_fltr_ucast = dp_pdev_get_filter_ucast_data(pdev); break; + case CDP_MONITOR_CHANNEL: + val->cdp_pdev_param_monitor_chan = + ((struct dp_pdev *)pdev)->mon_chan_num; + break; + case CDP_MONITOR_FREQUENCY: + val->cdp_pdev_param_mon_freq = + ((struct dp_pdev *)pdev)->mon_chan_freq; + break; default: return QDF_STATUS_E_FAILURE; }