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

Commit 889ca180 authored by Kalle Valo's avatar Kalle Valo
Browse files
ath.git patches for 5.3. Major changes:

ath10k

* enable SDIO support, first one being QCA6174 hw3.2
parents f4aa8012 9e7251fa
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -740,7 +740,7 @@ static int ath10k_ahb_probe(struct platform_device *pdev)
	enum ath10k_hw_rev hw_rev;
	size_t size;
	int ret;
	struct ath10k_bus_params bus_params;
	struct ath10k_bus_params bus_params = {};

	of_id = of_match_device(ath10k_ahb_of_match, &pdev->dev);
	if (!of_id) {
+44 −4
Original line number Diff line number Diff line
@@ -153,6 +153,33 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
		.hw_filter_reset_required = true,
		.fw_diag_ce_download = false,
	},
	{
		.id = QCA6174_HW_3_2_VERSION,
		.dev_id = QCA6174_3_2_DEVICE_ID,
		.bus = ATH10K_BUS_SDIO,
		.name = "qca6174 hw3.2 sdio",
		.patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
		.uart_pin = 19,
		.otp_exe_param = 0,
		.channel_counters_freq_hz = 88000,
		.max_probe_resp_desc_thres = 0,
		.cal_data_len = 0,
		.fw = {
			.dir = QCA6174_HW_3_0_FW_DIR,
			.board = QCA6174_HW_3_0_BOARD_DATA_FILE,
			.board_size = QCA6174_BOARD_DATA_SZ,
			.board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
		},
		.hw_ops = &qca6174_ops,
		.hw_clk = qca6174_clk,
		.target_cpu_freq = 176000000,
		.decap_align_bytes = 4,
		.n_cipher_suites = 8,
		.num_peers = 10,
		.ast_skid_limit = 0x10,
		.num_wds_entries = 0x20,
		.uart_pin_workaround = true,
	},
	{
		.id = QCA6174_HW_2_1_VERSION,
		.dev_id = QCA6164_2_1_DEVICE_ID,
@@ -629,7 +656,7 @@ static void ath10k_send_suspend_complete(struct ath10k *ar)
	complete(&ar->target_suspend);
}

static void ath10k_init_sdio(struct ath10k *ar)
static void ath10k_init_sdio(struct ath10k *ar, enum ath10k_firmware_mode mode)
{
	u32 param = 0;

@@ -646,7 +673,12 @@ static void ath10k_init_sdio(struct ath10k *ar)
	 * not big enough for mac80211 / native wifi frames. disable it
	 */
	param &= ~HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE;

	if (mode == ATH10K_FIRMWARE_MODE_UTF)
		param &= ~HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET;
	else
		param |= HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET;

	ath10k_bmi_write32(ar, hi_acs_flags, param);

	/* Explicitly set fwlog prints to zero as target may turn it on
@@ -2065,8 +2097,16 @@ static int ath10k_init_uart(struct ath10k *ar)
		return ret;
	}

	if (!uart_print)
	if (!uart_print && ar->hw_params.uart_pin_workaround) {
		ret = ath10k_bmi_write32(ar, hi_dbg_uart_txpin,
					 ar->hw_params.uart_pin);
		if (ret) {
			ath10k_warn(ar, "failed to set UART TX pin: %d", ret);
			return ret;
		}

		return 0;
	}

	ret = ath10k_bmi_write32(ar, hi_dbg_uart_txpin, ar->hw_params.uart_pin);
	if (ret) {
@@ -2501,7 +2541,7 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
			goto err;

		if (ar->hif.bus == ATH10K_BUS_SDIO)
			ath10k_init_sdio(ar);
			ath10k_init_sdio(ar, mode);
	}

	ar->htc.htc_ops.target_send_suspend_complete =
+11 −1
Original line number Diff line number Diff line
@@ -196,7 +196,7 @@ struct ath10k_fw_extd_stats_peer {
	struct list_head list;

	u8 peer_macaddr[ETH_ALEN];
	u32 rx_duration;
	u64 rx_duration;
};

struct ath10k_fw_stats_vdev {
@@ -400,6 +400,14 @@ struct ath10k_peer {

	/* protected by ar->data_lock */
	struct ieee80211_key_conf *keys[WMI_MAX_KEY_INDEX + 1];
	union htt_rx_pn_t tids_last_pn[ATH10K_TXRX_NUM_EXT_TIDS];
	bool tids_last_pn_valid[ATH10K_TXRX_NUM_EXT_TIDS];
	union htt_rx_pn_t frag_tids_last_pn[ATH10K_TXRX_NUM_EXT_TIDS];
	u32 frag_tids_seq[ATH10K_TXRX_NUM_EXT_TIDS];
	struct {
		enum htt_security_types sec_type;
		int pn_len;
	} rx_pn[ATH10K_HTT_TXRX_PEER_SECURITY_MAX];
};

struct ath10k_txq {
@@ -614,6 +622,7 @@ struct ath10k_debug {
	bool fw_stats_done;

	unsigned long htt_stats_mask;
	unsigned long reset_htt_stats;
	struct delayed_work htt_stats_dwork;
	struct ath10k_dfs_stats dfs_stats;
	struct ath_dfs_pool_stats dfs_pool_stats;
@@ -919,6 +928,7 @@ struct ath10k_bus_params {
	u32 chip_id;
	enum ath10k_dev_type dev_type;
	bool link_can_suspend;
	bool hl_msdu_ids;
};

struct ath10k {
+2 −2
Original line number Diff line number Diff line
@@ -1192,8 +1192,8 @@ static struct ath10k_dump_file_data *ath10k_coredump_build(struct ath10k *ar)
	if (test_bit(ATH10K_FW_CRASH_DUMP_CE_DATA, &ath10k_coredump_mask)) {
		dump_tlv = (struct ath10k_tlv_dump_data *)(buf + sofar);
		dump_tlv->type = cpu_to_le32(ATH10K_FW_CRASH_DUMP_CE_DATA);
		dump_tlv->tlv_len = cpu_to_le32(sizeof(*ce_hdr) +
						CE_COUNT * sizeof(ce_hdr->entries[0]));
		dump_tlv->tlv_len = cpu_to_le32(struct_size(ce_hdr, entries,
							    CE_COUNT));
		ce_hdr = (struct ath10k_ce_crash_hdr *)(dump_tlv->tlv_data);
		ce_hdr->ce_count = cpu_to_le32(CE_COUNT);
		memset(ce_hdr->reserved, 0, sizeof(ce_hdr->reserved));
+47 −3
Original line number Diff line number Diff line
@@ -305,6 +305,9 @@ void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb)
	if (is_end)
		ar->debug.fw_stats_done = true;

	if (stats.extended)
		ar->debug.fw_stats.extended = true;

	is_started = !list_empty(&ar->debug.fw_stats.pdevs);

	if (is_started && !is_end) {
@@ -873,7 +876,7 @@ static int ath10k_debug_htt_stats_req(struct ath10k *ar)
	cookie = get_jiffies_64();

	ret = ath10k_htt_h2t_stats_req(&ar->htt, ar->debug.htt_stats_mask,
				       cookie);
				       ar->debug.reset_htt_stats, cookie);
	if (ret) {
		ath10k_warn(ar, "failed to send htt stats request: %d\n", ret);
		return ret;
@@ -922,8 +925,8 @@ static ssize_t ath10k_write_htt_stats_mask(struct file *file,
	if (ret)
		return ret;

	/* max 8 bit masks (for now) */
	if (mask > 0xff)
	/* max 17 bit masks (for now) */
	if (mask > HTT_STATS_BIT_MASK)
		return -E2BIG;

	mutex_lock(&ar->conf_mutex);
@@ -2469,6 +2472,44 @@ static const struct file_operations fops_ps_state_enable = {
	.llseek = default_llseek,
};

static ssize_t ath10k_write_reset_htt_stats(struct file *file,
					    const char __user *user_buf,
					    size_t count, loff_t *ppos)
{
	struct ath10k *ar = file->private_data;
	unsigned long reset;
	int ret;

	ret = kstrtoul_from_user(user_buf, count, 0, &reset);
	if (ret)
		return ret;

	if (reset == 0 || reset > 0x1ffff)
		return -EINVAL;

	mutex_lock(&ar->conf_mutex);

	ar->debug.reset_htt_stats = reset;

	ret = ath10k_debug_htt_stats_req(ar);
	if (ret)
		goto out;

	ar->debug.reset_htt_stats = 0;
	ret = count;

out:
	mutex_unlock(&ar->conf_mutex);
	return ret;
}

static const struct file_operations fops_reset_htt_stats = {
	.write = ath10k_write_reset_htt_stats,
	.owner = THIS_MODULE,
	.open = simple_open,
	.llseek = default_llseek,
};

int ath10k_debug_create(struct ath10k *ar)
{
	ar->debug.cal_data = vzalloc(ATH10K_DEBUG_CAL_DATA_LEN);
@@ -2609,6 +2650,9 @@ int ath10k_debug_register(struct ath10k *ar)
	debugfs_create_file("ps_state_enable", 0600, ar->debug.debugfs_phy, ar,
			    &fops_ps_state_enable);

	debugfs_create_file("reset_htt_stats", 0200, ar->debug.debugfs_phy, ar,
			    &fops_reset_htt_stats);

	return 0;
}

Loading