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

Commit b443a8ec authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Merge remote-tracking branch 'remotes/origin/tmp-bcb2f1e4' into msm-3.18"

parents 9080e240 870cccc2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ wil6210-y += debug.o
wil6210-y += rx_reorder.o
wil6210-y += ioctl.o
wil6210-y += fw.o
wil6210-y += pm.o
wil6210-y += pmc.o
wil6210-$(CONFIG_WIL6210_TRACING) += trace.o
wil6210-y += wil_platform.o
+61 −0
Original line number Diff line number Diff line
/* Copyright (c) 2015 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
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/* This file contains the definitions for the boot loader
 * for the Qualcomm "Sparrow" 60 Gigabit wireless solution.
 */
#ifndef BOOT_LOADER_EXPORT_H_
#define BOOT_LOADER_EXPORT_H_

struct bl_dedicated_registers_v1 {
	__le32	boot_loader_ready;		/* 0x880A3C driver will poll
						 * this Dword until BL will
						 * set it to 1 (initial value
						 * should be 0)
						 */
	__le32	boot_loader_struct_version;	/* 0x880A40 BL struct ver. */
	__le16	rf_type;			/* 0x880A44 connected RF ID */
	__le16	rf_status;			/* 0x880A46 RF status,
						 * 0 is OK else error
						 */
	__le32	baseband_type;			/* 0x880A48 board type ID */
	u8	mac_address[6];			/* 0x880A4c BL mac address */
	u8	bl_version_major;		/* 0x880A52 BL ver. major */
	u8	bl_version_minor;		/* 0x880A53 BL ver. minor */
	__le16	bl_version_subminor;		/* 0x880A54 BL ver. subminor */
	__le16	bl_version_build;		/* 0x880A56 BL ver. build */
	/* valid only for version 2 and above */
	__le32  bl_assert_code;         /* 0x880A58 BL Assert code */
	__le32  bl_assert_blink;        /* 0x880A5C BL Assert Branch */
	__le32  bl_reserved[22];        /* 0x880A60 - 0x880AB4 */
	__le32  bl_magic_number;        /* 0x880AB8 BL Magic number */
} __packed;

/* the following struct is the version 0 struct */

struct bl_dedicated_registers_v0 {
	__le32	boot_loader_ready;		/* 0x880A3C driver will poll
						 * this Dword until BL will
						 * set it to 1 (initial value
						 * should be 0)
						 */
#define BL_READY (1)	/* ready indication */
	__le32	boot_loader_struct_version;	/* 0x880A40 BL struct ver. */
	__le32	rf_type;			/* 0x880A44 connected RF ID */
	__le32	baseband_type;			/* 0x880A48 board type ID */
	u8	mac_address[6];			/* 0x880A4c BL mac address */
} __packed;

#endif /* BOOT_LOADER_EXPORT_H_ */
+31 −64
Original line number Diff line number Diff line
@@ -336,12 +336,9 @@ static int wil_cfg80211_scan(struct wiphy *wiphy,
	else
		wil_dbg_misc(wil, "Scan has no IE's\n");

	rc = wmi_set_ie(wil, WMI_FRAME_PROBE_REQ, request->ie_len,
			request->ie);
	if (rc) {
		wil_err(wil, "Aborting scan, set_ie failed: %d\n", rc);
	rc = wmi_set_ie(wil, WMI_FRAME_PROBE_REQ, request->ie_len, request->ie);
	if (rc)
		goto out;
	}

	rc = wmi_send(wil, WMI_START_SCAN_CMDID, &cmd, sizeof(cmd.cmd) +
			cmd.cmd.num_channels * sizeof(cmd.cmd.channel_list[0]));
@@ -462,10 +459,8 @@ static int wil_cfg80211_connect(struct wiphy *wiphy,
	 * ies in FW.
	 */
	rc = wmi_set_ie(wil, WMI_FRAME_ASSOC_REQ, sme->ie_len, sme->ie);
	if (rc) {
		wil_err(wil, "WMI_SET_APPIE_CMD failed\n");
	if (rc)
		goto out;
	}

	/* WMI_CONNECT_CMD */
	memset(&conn, 0, sizeof(conn));
@@ -722,56 +717,52 @@ static int wil_fix_bcon(struct wil6210_priv *wil,
{
	struct ieee80211_mgmt *f = (struct ieee80211_mgmt *)bcon->probe_resp;
	size_t hlen = offsetof(struct ieee80211_mgmt, u.probe_resp.variable);
	int rc = 0;

	if (bcon->probe_resp_len <= hlen)
		return 0;

/* always use IE's from full probe frame, they has more info
 * notable RSN
 */
	bcon->proberesp_ies = f->u.probe_resp.variable;
	bcon->proberesp_ies_len = bcon->probe_resp_len - hlen;
	if (!bcon->assocresp_ies) {
		bcon->assocresp_ies = f->u.probe_resp.variable;
		bcon->assocresp_ies_len = bcon->probe_resp_len - hlen;
		rc = 1;
		bcon->assocresp_ies = bcon->proberesp_ies;
		bcon->assocresp_ies_len = bcon->proberesp_ies_len;
	}

	return rc;
	return 1;
}

/* internal functions for device reset and starting AP */
static int _wil_cfg80211_set_ies(struct wiphy *wiphy,
				 size_t probe_ies_len, const u8 *probe_ies,
				 size_t assoc_ies_len, const u8 *assoc_ies)

				 struct cfg80211_beacon_data *bcon)
{
	int rc;
	struct wil6210_priv *wil = wiphy_to_wil(wiphy);

	/* FW do not form regular beacon, so bcon IE's are not set
	 * For the DMG bcon, when it will be supported, bcon IE's will
	 * be reused; add something like:
	 * wmi_set_ie(wil, WMI_FRAME_BEACON, bcon->beacon_ies_len,
	 * bcon->beacon_ies);
	 */
	rc = wmi_set_ie(wil, WMI_FRAME_PROBE_RESP, probe_ies_len, probe_ies);
	if (rc) {
		wil_err(wil, "set_ie(PROBE_RESP) failed\n");
	rc = wmi_set_ie(wil, WMI_FRAME_PROBE_RESP, bcon->proberesp_ies_len,
			bcon->proberesp_ies);
	if (rc)
		return rc;
	}

	rc = wmi_set_ie(wil, WMI_FRAME_ASSOC_RESP, assoc_ies_len, assoc_ies);
	if (rc) {
		wil_err(wil, "set_ie(ASSOC_RESP) failed\n");
	rc = wmi_set_ie(wil, WMI_FRAME_ASSOC_RESP, bcon->assocresp_ies_len,
			bcon->assocresp_ies);
#if 0 /* to use beacon IE's, remove this #if 0 */
	if (rc)
		return rc;
	}

	return 0;
	rc = wmi_set_ie(wil, WMI_FRAME_BEACON, bcon->tail_len, bcon->tail);
#endif

	return rc;
}

static int _wil_cfg80211_start_ap(struct wiphy *wiphy,
				  struct net_device *ndev,
				  const u8 *ssid, size_t ssid_len, u32 privacy,
				  int bi, u8 chan,
				  size_t probe_ies_len, const u8 *probe_ies,
				  size_t assoc_ies_len, const u8 *assoc_ies,
				  struct cfg80211_beacon_data *bcon,
				  u8 hidden_ssid)
{
	struct wil6210_priv *wil = wiphy_to_wil(wiphy);
@@ -792,8 +783,7 @@ static int _wil_cfg80211_start_ap(struct wiphy *wiphy,
	if (rc)
		goto out;

	rc = _wil_cfg80211_set_ies(wiphy, probe_ies_len, probe_ies,
				   assoc_ies_len, assoc_ies);
	rc = _wil_cfg80211_set_ies(wiphy, bcon);
	if (rc)
		goto out;

@@ -827,27 +817,20 @@ static int wil_cfg80211_change_beacon(struct wiphy *wiphy,
				      struct cfg80211_beacon_data *bcon)
{
	struct wil6210_priv *wil = wiphy_to_wil(wiphy);
	struct ieee80211_mgmt *f = (struct ieee80211_mgmt *)bcon->probe_resp;
	size_t hlen = offsetof(struct ieee80211_mgmt, u.probe_resp.variable);
	const u8 *pr_ies = NULL;
	size_t pr_ies_len = 0;
	int rc;
	u32 privacy = 0;

	wil_dbg_misc(wil, "%s()\n", __func__);
	wil_print_bcon_data(bcon);

	if (bcon->probe_resp_len > hlen) {
		pr_ies = f->u.probe_resp.variable;
		pr_ies_len = bcon->probe_resp_len - hlen;
	}

	if (wil_fix_bcon(wil, bcon)) {
		wil_dbg_misc(wil, "Fixed bcon\n");
		wil_print_bcon_data(bcon);
	}

	if (pr_ies && cfg80211_find_ie(WLAN_EID_RSN, pr_ies, pr_ies_len))
	if (bcon->proberesp_ies &&
	    cfg80211_find_ie(WLAN_EID_RSN, bcon->proberesp_ies,
			     bcon->proberesp_ies_len))
		privacy = 1;

	/* in case privacy has changed, need to restart the AP */
@@ -860,14 +843,10 @@ static int wil_cfg80211_change_beacon(struct wiphy *wiphy,
		rc = _wil_cfg80211_start_ap(wiphy, ndev, wdev->ssid,
					    wdev->ssid_len, privacy,
					    wdev->beacon_interval,
					    wil->channel, pr_ies_len, pr_ies,
					    bcon->assocresp_ies_len,
					    bcon->assocresp_ies,
					    wil->channel, bcon,
					    wil->hidden_ssid);
	} else {
		rc = _wil_cfg80211_set_ies(wiphy, pr_ies_len, pr_ies,
					   bcon->assocresp_ies_len,
					   bcon->assocresp_ies);
		rc = _wil_cfg80211_set_ies(wiphy, bcon);
	}

	return rc;
@@ -882,10 +861,6 @@ static int wil_cfg80211_start_ap(struct wiphy *wiphy,
	struct ieee80211_channel *channel = info->chandef.chan;
	struct cfg80211_beacon_data *bcon = &info->beacon;
	struct cfg80211_crypto_settings *crypto = &info->crypto;
	struct ieee80211_mgmt *f = (struct ieee80211_mgmt *)bcon->probe_resp;
	size_t hlen = offsetof(struct ieee80211_mgmt, u.probe_resp.variable);
	const u8 *pr_ies = NULL;
	size_t pr_ies_len = 0;
	u8 hidden_ssid;

	wil_dbg_misc(wil, "%s()\n", __func__);
@@ -925,11 +900,6 @@ static int wil_cfg80211_start_ap(struct wiphy *wiphy,
	wil_print_bcon_data(bcon);
	wil_print_crypto(wil, crypto);

	if (bcon->probe_resp_len > hlen) {
		pr_ies = f->u.probe_resp.variable;
		pr_ies_len = bcon->probe_resp_len - hlen;
	}

	if (wil_fix_bcon(wil, bcon)) {
		wil_dbg_misc(wil, "Fixed bcon\n");
		wil_print_bcon_data(bcon);
@@ -938,10 +908,7 @@ static int wil_cfg80211_start_ap(struct wiphy *wiphy,
	rc = _wil_cfg80211_start_ap(wiphy, ndev,
				    info->ssid, info->ssid_len, info->privacy,
				    info->beacon_interval, channel->hw_value,
				    pr_ies_len, pr_ies,
				    bcon->assocresp_ies_len,
				    bcon->assocresp_ies,
				    hidden_ssid);
				    bcon, hidden_ssid);

	return rc;
}
+10 −6
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ static void wil_print_vring(struct seq_file *s, struct wil6210_priv *wil,
	seq_printf(s, "  swhead = %d\n", vring->swhead);
	seq_printf(s, "  hwtail = [0x%08x] -> ", vring->hwtail);
	if (x) {
		v = ioread32(x);
		v = readl(x);
		seq_printf(s, "0x%08x = %d\n", v, v);
	} else {
		seq_puts(s, "???\n");
@@ -268,7 +268,7 @@ static const struct file_operations fops_mbox = {

static int wil_debugfs_iomem_x32_set(void *data, u64 val)
{
	iowrite32(val, (void __iomem *)data);
	writel(val, (void __iomem *)data);
	wmb(); /* make sure write propagated to HW */

	return 0;
@@ -276,7 +276,7 @@ static int wil_debugfs_iomem_x32_set(void *data, u64 val)

static int wil_debugfs_iomem_x32_get(void *data, u64 *val)
{
	*val = ioread32((void __iomem *)data);
	*val = readl((void __iomem *)data);

	return 0;
}
@@ -306,7 +306,7 @@ static int wil_debugfs_ulong_get(void *data, u64 *val)
}

DEFINE_SIMPLE_ATTRIBUTE(wil_fops_ulong, wil_debugfs_ulong_get,
			wil_debugfs_ulong_set, "%llu\n");
			wil_debugfs_ulong_set, "0x%llx\n");

static struct dentry *wil_debugfs_create_ulong(const char *name, umode_t mode,
					       struct dentry *parent,
@@ -477,7 +477,7 @@ static int wil_memread_debugfs_show(struct seq_file *s, void *data)
	void __iomem *a = wmi_buffer(wil, cpu_to_le32(mem_addr));

	if (a)
		seq_printf(s, "[0x%08x] = 0x%08x\n", mem_addr, ioread32(a));
		seq_printf(s, "[0x%08x] = 0x%08x\n", mem_addr, readl(a));
	else
		seq_printf(s, "[0x%08x] = INVALID\n", mem_addr);

@@ -1344,6 +1344,7 @@ static void wil_print_rxtid(struct seq_file *s, struct wil_tid_ampdu_rx *r)
{
	int i;
	u16 index = ((r->head_seq_num - r->ssn) & 0xfff) % r->buf_size;
	unsigned long long drop_dup = r->drop_dup, drop_old = r->drop_old;

	seq_printf(s, "([%2d] %3d TU) 0x%03x [", r->buf_size, r->timeout,
		   r->head_seq_num);
@@ -1353,7 +1354,10 @@ static void wil_print_rxtid(struct seq_file *s, struct wil_tid_ampdu_rx *r)
		else
			seq_printf(s, "%c", r->reorder_buf[i] ? '*' : '_');
	}
	seq_printf(s, "] last drop 0x%03x\n", r->ssn_last_drop);
	seq_printf(s,
		   "] total %llu drop %llu (dup %llu + old %llu) last 0x%03x\n",
		   r->total, drop_dup + drop_old, drop_dup, drop_old,
		   r->ssn_last_drop);
}

static int wil_sta_debugfs_show(struct seq_file *s, void *data)
+4 −10
Original line number Diff line number Diff line
@@ -50,19 +50,13 @@ static int wil_ethtoolops_get_coalesce(struct net_device *ndev,

	wil_dbg_misc(wil, "%s()\n", __func__);

	tx_itr_en = ioread32(wil->csr +
			     HOSTADDR(RGF_DMA_ITR_TX_CNT_CTL));
	tx_itr_en = wil_r(wil, RGF_DMA_ITR_TX_CNT_CTL);
	if (tx_itr_en & BIT_DMA_ITR_TX_CNT_CTL_EN)
		tx_itr_val =
			ioread32(wil->csr +
				 HOSTADDR(RGF_DMA_ITR_TX_CNT_TRSH));
		tx_itr_val = wil_r(wil, RGF_DMA_ITR_TX_CNT_TRSH);

	rx_itr_en = ioread32(wil->csr +
			     HOSTADDR(RGF_DMA_ITR_RX_CNT_CTL));
	rx_itr_en = wil_r(wil, RGF_DMA_ITR_RX_CNT_CTL);
	if (rx_itr_en & BIT_DMA_ITR_RX_CNT_CTL_EN)
		rx_itr_val =
			ioread32(wil->csr +
				 HOSTADDR(RGF_DMA_ITR_RX_CNT_TRSH));
		rx_itr_val = wil_r(wil, RGF_DMA_ITR_RX_CNT_TRSH);

	cp->tx_coalesce_usecs = tx_itr_val;
	cp->rx_coalesce_usecs = rx_itr_val;
Loading