Skip to content

Commit

Permalink
drivers: qca-wifi-host-cmn: Merge tag 'LA.UM.8.3.r1-08500-sdm845.0' i…
Browse files Browse the repository at this point in the history
…nto canting-4.9-q

* tag 'LA.UM.8.3.r1-08500-sdm845.0' of https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wlan/qca-wifi-host-cmn: (22 commits)
  qcacmn: Fix possible OOB access while sending ext stats request
  qcacmn: FT-SAE roam fails due to null TLV in RSO Command
  qcacmn: Fix KW issue in the regulatory component
  qcacmn: Extend Tdls external mode config support
  qcacmn: Send vdev param NAN_CONFIG_FEATURES after creating vdev
  qcacmn: Define QDF API for cpumask abstraction
  qcacmn: Add QDF API to set thread cpu mask
  qcacmn: Add vdev param to configure NAN feature bitmap to firmware
  qcacmn: Invoke correct api to convert channel to frequency
  qcacmn: Make freq to chan and vice versa conversion more generic
  qcacmn: Fix OOB issue in wlan_parse_rsn_ie
  qcacmn: Add support for WMI_VDEV_BCN_LATENCY event
  qcacmn: fix format specifier in qdf_dpt_dump_stats_debugfs
  qcacmn: Clean up logs in Tdls path
  qcacmn: Add INI for P2P GO force SCC
  qcacmn: Add check in policy_mgr_dump_channel_list
  qcacmn: Get the valid vdev in get_vdev_by_macaddr_from_pdev
  qcacmn: Use IS_ENABLED for the definition of kernel module
  qcacmn: Fix buffer overflow while memcpy of pmk_ext
  qcacmn: Fix null pointer dereference at extract_11kv_stats_tlv
  ...

Change-Id: Ib1b7214667d1f05f553ab4ebe5e2535944ff26de
Signed-off-by: Khusika Dhamar Gusti <mail@khusika.com>
  • Loading branch information
Khusika Dhamar Gusti committed Sep 5, 2020
2 parents 83e8dca + c0f6830 commit 552e48f
Show file tree
Hide file tree
Showing 27 changed files with 619 additions and 133 deletions.
37 changes: 36 additions & 1 deletion drivers/staging/qca-wifi-host-cmn/qdf/inc/qdf_threads.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
Expand Down Expand Up @@ -111,4 +111,39 @@ void qdf_print_thread_trace(qdf_thread_t *thread);
* Return: pointer to task struct
*/
qdf_thread_t *qdf_get_current_task(void);

/**
* qdf_thread_set_cpus_allowed_mask() - set cpu mask for a particular thread
* @thread: thread for which new cpu mask is set
* @new_mask: new cpu mask to be set for the thread
*
* Return: None
*/
void
qdf_thread_set_cpus_allowed_mask(qdf_thread_t *thread, qdf_cpu_mask *new_mask);

/**
* qdf_cpumask_clear() - clear all cpus in a cpumask
* @dstp: cpumask pointer
*
* Return: None
*/
void qdf_cpumask_clear(qdf_cpu_mask *dstp);

/**
* qdf_cpumask_set_cpu() - set a cpu in a cpumask
* @cpu: cpu number
* @dstp: cpumask pointer
*
* Return: None
*/
void qdf_cpumask_set_cpu(unsigned int cpu, qdf_cpu_mask *dstp);

/**
* qdf_cpumask_setall - set all cpus
* @dstp: cpumask pointer
*
* Return: None
*/
void qdf_cpumask_setall(qdf_cpu_mask *dstp);
#endif /* __QDF_THREADS_H */
5 changes: 5 additions & 0 deletions drivers/staging/qca-wifi-host-cmn/qdf/inc/qdf_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ typedef __qdf_dma_context_t qdf_dma_context_t;
typedef __qdf_mem_info_t qdf_mem_info_t;
typedef __sgtable_t sgtable_t;

/**
* typepdef qdf_cpu_mask - CPU Mask
*/
typedef __qdf_cpu_mask qdf_cpu_mask;

/**
* pointer to net device
*/
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/qca-wifi-host-cmn/qdf/linux/src/i_qdf_mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
#endif /* __KERNEL__ */
#include <qdf_status.h>

#ifdef CONFIG_ARM_SMMU
#if IS_ENABLED(CONFIG_ARM_SMMU)
#include <pld_common.h>
#include <asm/dma-iommu.h>
#include <linux/iommu.h>
Expand Down Expand Up @@ -212,7 +212,7 @@ static inline bool __qdf_mem_smmu_s1_enabled(qdf_device_t osdev)
return osdev->smmu_s1_enabled;
}

#ifdef CONFIG_ARM_SMMU
#if IS_ENABLED(CONFIG_ARM_SMMU)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
/**
* __qdf_dev_get_domain() - get iommu domain from osdev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ typedef dma_addr_t __qdf_dma_addr_t;
typedef size_t __qdf_dma_size_t;
typedef dma_addr_t __qdf_dma_context_t;
typedef struct net_device *__qdf_netdev_t;
typedef struct cpumask __qdf_cpu_mask;
typedef __le16 __qdf_le16_t;
typedef __le32 __qdf_le32_t;
typedef __le64 __qdf_le64_t;
Expand Down
31 changes: 30 additions & 1 deletion drivers/staging/qca-wifi-host-cmn/qdf/linux/src/qdf_threads.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
Expand Down Expand Up @@ -196,3 +196,32 @@ qdf_thread_t *qdf_get_current_task(void)
return current;
}
qdf_export_symbol(qdf_get_current_task);

void
qdf_thread_set_cpus_allowed_mask(qdf_thread_t *thread, qdf_cpu_mask *new_mask)
{
set_cpus_allowed_ptr(thread, new_mask);
}

qdf_export_symbol(qdf_thread_set_cpus_allowed_mask);

void qdf_cpumask_clear(qdf_cpu_mask *dstp)
{
cpumask_clear(dstp);
}

qdf_export_symbol(qdf_cpumask_clear);

void qdf_cpumask_set_cpu(unsigned int cpu, qdf_cpu_mask *dstp)
{
cpumask_set_cpu(cpu, dstp);
}

qdf_export_symbol(qdf_cpumask_set_cpu);

void qdf_cpumask_setall(qdf_cpu_mask *dstp)
{
cpumask_setall(dstp);
}

qdf_export_symbol(qdf_cpumask_setall);
29 changes: 15 additions & 14 deletions drivers/staging/qca-wifi-host-cmn/qdf/linux/src/qdf_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2783,26 +2783,27 @@ QDF_STATUS qdf_dpt_dump_stats_debugfs(qdf_debugfs_file_t file,
break;

case QDF_DP_TRACE_HDD_TX_TIMEOUT:
qdf_debugfs_printf(file, "DPT: %04d: %s %s\n",
i, p_record.time,
qdf_dp_code_to_string(p_record.code));
qdf_debugfs_printf(file, "%s: HDD TX Timeout\n");
qdf_debugfs_printf(
file, "DPT: %04d: %llu %s\n",
i, p_record.time,
qdf_dp_code_to_string(p_record.code));
qdf_debugfs_printf(file, "HDD TX Timeout\n");
break;

case QDF_DP_TRACE_HDD_SOFTAP_TX_TIMEOUT:
qdf_debugfs_printf(file, "%04d: %s %s\n",
i, p_record.time,
qdf_dp_code_to_string(p_record.code));
qdf_debugfs_printf(file,
"%s: HDD SoftAP TX Timeout\n");
qdf_debugfs_printf(
file, "DPT: %04d: %llu %s\n",
i, p_record.time,
qdf_dp_code_to_string(p_record.code));
qdf_debugfs_printf(file, "HDD SoftAP TX Timeout\n");
break;

case QDF_DP_TRACE_CE_FAST_PACKET_ERR_RECORD:
qdf_debugfs_printf(file, "DPT: %04d: %s %s\n",
i, p_record.time,
qdf_dp_code_to_string(p_record.code));
qdf_debugfs_printf(file,
"%s: CE Fast Packet Error\n");
qdf_debugfs_printf(
file, "DPT: %04d: %llu %s\n",
i, p_record.time,
qdf_dp_code_to_string(p_record.code));
qdf_debugfs_printf(file, "CE Fast Packet Error\n");
break;

case QDF_DP_TRACE_MAX:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2017, 2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,8 @@ static inline QDF_STATUS wlan_parse_rsn_ie(uint8_t *rsn_ie,
rsn->pmkid_count = LE_READ_2(ie);
ie += 2;
rem_len -= 2;
if (rsn->pmkid_count > (unsigned int) rem_len / PMKID_LEN) {
if (rsn->pmkid_count > MAX_PMKID ||
rsn->pmkid_count > (unsigned int)rem_len / PMKID_LEN) {
rsn->pmkid_count = 0;
return QDF_STATUS_E_INVAL;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -711,14 +711,13 @@ struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_macaddr_from_pdev(
/* Iterate through pdev's vdev list, till vdev macaddr matches with
entry of vdev list */
while (vdev != NULL) {
if (WLAN_ADDR_EQ(wlan_vdev_mlme_get_macaddr(vdev), macaddr)
== QDF_STATUS_SUCCESS) {
if (wlan_objmgr_vdev_try_get_ref(vdev, dbg_id) !=
QDF_STATUS_SUCCESS)
vdev = NULL;

wlan_pdev_obj_unlock(pdev);
return vdev;
if (QDF_IS_STATUS_SUCCESS(
WLAN_ADDR_EQ(wlan_vdev_mlme_get_macaddr(vdev), macaddr))) {
if (QDF_IS_STATUS_SUCCESS(
wlan_objmgr_vdev_try_get_ref(vdev, dbg_id))) {
wlan_pdev_obj_unlock(pdev);
return vdev;
}
}
/* get next vdev */
vdev_next = wlan_vdev_get_next_vdev_of_pdev(vdev_list, vdev);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2262,6 +2262,16 @@ bool policy_mgr_is_safe_channel(struct wlan_objmgr_psoc *psoc,
*/
bool policy_mgr_is_force_scc(struct wlan_objmgr_psoc *psoc);

/**
* policy_mgr_go_scc_enforced() - Get GO force SCC enabled or not
* @psoc: psoc object
*
* This function checks if force SCC logic should be used on GO interface.
*
* Return: True if allow GO force SCC
*/
bool policy_mgr_go_scc_enforced(struct wlan_objmgr_psoc *psoc);

/**
* policy_mgr_valid_sap_conc_channel_check() - checks & updates
* the channel SAP to come up on in case of STA+SAP concurrency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,7 @@ struct dual_mac_config {
* Default is DBS for STA+STA and STA+P2P.
* @sta_sap_scc_on_lte_coex_chan: Is STA+SAP SCC allowed on a
* lte coex channel
* @go_force_scc: Enable/Disable P2P GO force SCC
* @enable_dfs_master_cap: Is DFS master capability enabled
*/
struct policy_mgr_user_cfg {
Expand All @@ -1020,6 +1021,7 @@ struct policy_mgr_user_cfg {
uint32_t is_sta_sap_scc_allowed_on_dfs_chan;
uint32_t channel_select_logic_conc;
uint32_t sta_sap_scc_on_lte_coex_chan;
uint32_t go_force_scc;
uint8_t enable_dfs_master_cap;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3368,3 +3368,24 @@ bool policy_mgr_is_sta_sap_scc(struct wlan_objmgr_psoc *psoc, uint8_t sap_ch)

return is_scc;
}

bool policy_mgr_go_scc_enforced(struct wlan_objmgr_psoc *psoc)
{
uint32_t mcc_to_scc_switch;
struct policy_mgr_psoc_priv_obj *pm_ctx;

pm_ctx = policy_mgr_get_context(psoc);
if (!pm_ctx) {
policy_mgr_err("Invalid Context");
return false;
}
mcc_to_scc_switch = pm_ctx->user_cfg.mcc_to_scc_switch_mode;
if (mcc_to_scc_switch ==
QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION)
return true;

if (pm_ctx->user_cfg.go_force_scc && policy_mgr_is_force_scc(psoc))
return true;

return false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -1935,7 +1935,7 @@ bool policy_mgr_dump_channel_list(uint32_t len, uint8_t *pcl_channels,
return false;

policymgr_nofl_debug("Total PCL Chan Freq %d", len);
for (idx = 0; idx < len; idx++) {
for (idx = 0; idx < len && idx < QDF_MAX_NUM_CHAN; idx++) {
num += qdf_scnprintf(chan_buff + num, buff_len - num, " %d[%d]",
pcl_channels[idx], pcl_weight[idx]);
count++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,3 @@ QDF_STATUS ucfg_nan_get_callbacks(struct wlan_objmgr_psoc *psoc,
struct nan_callbacks *cb_obj);

#endif /* _NAN_UCFG_API_H_ */

0 comments on commit 552e48f

Please sign in to comment.