Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e29e911 authored by Rakesh Pillai's avatar Rakesh Pillai Committed by Gerrit - the friendly Code Review server
Browse files

ath10k: Refactor start scan cmd and add peer flag for WCN3990



WCN3990 target needs different value for scan flags.
Add proper scan flags for WCN3990 and attach based
on hardware detected.

CRs-Fixed: 1115143
Change-Id: Ie4c02adb5ae65e12d250389d945e048cb6720479
Signed-off-by: default avatarRakesh Pillai <pillair@codeaurora.org>
parent 15f78526
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2324,6 +2324,7 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev,
		ar->regs = &wcn3990_regs;
		ar->hw_values = &wcn3990_values;
		ar->qmi.is_qmi = true;
		ar->fw_flags = &wcn3990_fw_flags;
		break;
	default:
		ath10k_err(ar, "unsupported core hardware revision %d\n",
+5 −0
Original line number Diff line number Diff line
@@ -666,6 +666,10 @@ enum ath10k_tx_pause_reason {
	ATH10K_TX_PAUSE_MAX,
};

struct fw_flag {
	u32 flags;
};

struct ath10k_fw_file {
	const struct firmware *firmware;

@@ -925,6 +929,7 @@ struct ath10k {
	u32 (*bus_read32)(void *ar, u32 offset);
	spinlock_t ce_lock; /* lock for CE access */
	void *ce_states;
	struct fw_flag *fw_flags;
	/* must be last */
	u8 drv_priv[0] __aligned(sizeof(void *));
};
+5 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2014-2015 Qualcomm Atheros, Inc.
 * Copyright (c) 2014-2015, 2017 Qualcomm Atheros, Inc.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
@@ -216,6 +216,10 @@ const struct ath10k_hw_values wcn3990_values = {
	.ce_desc_meta_data_lsb		= 4,
};

struct fw_flag wcn3990_fw_flags = {
	.flags = 0x82E,
};

void ath10k_hw_fill_survey_time(struct ath10k *ar, struct survey_info *survey,
				u32 cc, u32 rcc, u32 cc_prev, u32 rcc_prev)
{
+3 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2005-2011 Atheros Communications Inc.
 * Copyright (c) 2011-2013 Qualcomm Atheros, Inc.
 * Copyright (c) 2011-2013,2017 Qualcomm Atheros, Inc.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
@@ -265,6 +265,8 @@ extern const struct ath10k_hw_regs qca99x0_regs;
extern const struct ath10k_hw_regs qca4019_regs;
extern const struct ath10k_hw_regs wcn3990_regs;

extern struct fw_flag wcn3990_fw_flags;

struct ath10k_hw_values {
	u32 rtc_state_val_on;
	u8 ce_count;
+7 −5
Original line number Diff line number Diff line
/*
 * Copyright (c) 2005-2011 Atheros Communications Inc.
 * Copyright (c) 2011-2014 Qualcomm Atheros, Inc.
 * Copyright (c) 2011-2014, 2017 Qualcomm Atheros, Inc.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
@@ -1512,10 +1512,11 @@ ath10k_wmi_tlv_op_gen_start_scan(struct ath10k *ar,
	cmd->ie_len = __cpu_to_le32(arg->ie_len);
	cmd->num_probes = __cpu_to_le32(3);

	/* FIXME: There are some scan flag inconsistencies across firmwares,
	 * e.g. WMI-TLV inverts the logic behind the following flag.
	 */
	cmd->common.scan_ctrl_flags ^= __cpu_to_le32(WMI_SCAN_FILTER_PROBE_REQ);
	if (QCA_REV_WCN3990(ar))
		cmd->common.scan_ctrl_flags = ar->fw_flags->flags;
	else
		cmd->common.scan_ctrl_flags ^=
			__cpu_to_le32(WMI_SCAN_FILTER_PROBE_REQ);

	ptr += sizeof(*tlv);
	ptr += sizeof(*cmd);
@@ -3646,6 +3647,7 @@ void ath10k_wmi_hl_1_0_attach(struct ath10k *ar)
	ar->wmi.vdev_param = &wmi_tlv_vdev_param_map;
	ar->wmi.pdev_param = &wmi_tlv_pdev_param_map;
	ar->wmi.ops = &wmi_hl_1_0_ops;
	ar->wmi.peer_flags = &wmi_tlv_peer_flags_map;
}

/* TLV init */