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

Commit c3d75acc authored by Hamad Kadmany's avatar Hamad Kadmany
Browse files

Merge remote-tracking branch 'remotes/origin/tmp-f5a5edd8' into msm-3.10



Update wil driver with the following changes: (35 commits)

  wil6210: fix PTR_ERR() usage after initialization to constant
  wil6210: fix for oops while stopping interface
  wil6210: rename [en|dis]able irq to [un]mask
  wil6210: fix typo in comment
  wil6210: specify max. IE length
  wil6210: introduce separate completion for WMI
  wil6210: enlarge TX/RX buffer length
  wil6210: add change_beacon() driver callback
  wil6210: send connect request IEs to FW also for non-secure connection
  wil6210: fix race condition between BACK event and Rx data
  wil6210: modify confusing printout
  wil6210: fix race condition of disconnect while BACK event
  wil6210: fix usage of print_hex_dump_debug
  wil6210: fix for memory corruption upon rmmod
  wil6210: fix for memory corruption while insmod
  wil6210: add more debug printouts
  wil6210: platform specific module
  wil6210: coding style fixes
  wil6210: some more debug for the WMI mechanism
  wil6210: print more information when connecting
  wil6210: debug prints for vring de-allocation
  wil6210: firmware download
  wil6210: fix access after free in wil_pcie_remove()
  wil6210: cfg80211_rx_mgmt to use GFP_ATOMIC
  wil6210: fix free'd memory access in wil_if_free()
  wil6210: Limit max number of associated stations
  wil6210: fix false "scan timeout"
  wil6210: fix beamforming data reporting
  wil6210: convert debugfs to the table mode
  wil6210: Workaround for Sparrow with bad device id
  wil6210: wait longer for hardware reset completion
  wil6210: check error in wil_target_reset()
  wil6210: update copyright year 2014
  wil6210: fix race in reset
  wil6210: map MAC timer for packet lifetime into debugfs

Change-Id: I8b4511dab4a98c51ee3a2f42b1218dd97695b3af
Signed-off-by: default avatarHamad Kadmany <hkadmany@codeaurora.org>
parents 3511ae2a f5a5edd8
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -39,3 +39,12 @@ config WIL6210_TRACING
	  option if you are interested in debugging the driver.

	  If unsure, say Y to make it easier to debug problems.

config WIL6210_PLATFORM_MSM
	bool "wil6210 MSM platform specific support"
	depends on WIL6210
	depends on ARCH_MSM
	default y
	---help---
	  Say Y here to enable wil6210 driver support for MSM
	  platform specific features
+3 −0
Original line number Diff line number Diff line
@@ -10,7 +10,10 @@ wil6210-y += interrupt.o
wil6210-y += txrx.o
wil6210-y += debug.o
wil6210-y += rx_reorder.o
wil6210-y += fw.o
wil6210-$(CONFIG_WIL6210_TRACING) += trace.o
wil6210-y += wil_platform.o
wil6210-$(CONFIG_WIL6210_PLATFORM_MSM) += wil_platform_msm.o

# for tracing framework to find trace.h
CFLAGS_trace.o := -I$(src)
+104 −28
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012 Qualcomm Atheros, Inc.
 * Copyright (c) 2012-2014 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
@@ -296,6 +296,7 @@ static int wil_cfg80211_scan(struct wiphy *wiphy,
	n = min(request->n_channels, 4U);
	for (i = 0; i < n; i++) {
		int ch = request->channels[i]->hw_value;

		if (ch == 0) {
			wil_err(wil,
				"Scan requested for unknown frequency %dMhz\n",
@@ -308,15 +309,47 @@ static int wil_cfg80211_scan(struct wiphy *wiphy,
			     request->channels[i]->center_freq);
	}

	if (request->ie_len)
		print_hex_dump_bytes("Scan IE ", DUMP_PREFIX_OFFSET,
				     request->ie, request->ie_len);
	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);
		goto out;
	}

	rc = wmi_send(wil, WMI_START_SCAN_CMDID, &cmd, sizeof(cmd.cmd) +
			cmd.cmd.num_channels * sizeof(cmd.cmd.channel_list[0]));

	if (rc)
out:
	if (rc) {
		del_timer_sync(&wil->scan_timer);
		wil->scan_request = NULL;
	}

	return rc;
}

static void wil_print_connect_params(struct wil6210_priv *wil,
				     struct cfg80211_connect_params *sme)
{
	wil_info(wil, "Connecting to:\n");
	if (sme->channel) {
		wil_info(wil, "  Channel: %d freq %d\n",
			 sme->channel->hw_value, sme->channel->center_freq);
	}
	if (sme->bssid)
		wil_info(wil, "  BSSID: %pM\n", sme->bssid);
	if (sme->ssid)
		print_hex_dump(KERN_INFO, "  SSID: ", DUMP_PREFIX_OFFSET,
			       16, 1, sme->ssid, sme->ssid_len, true);
	wil_info(wil, "  Privacy: %s\n", sme->privacy ? "secure" : "open");
}

static int wil_cfg80211_connect(struct wiphy *wiphy,
				struct net_device *ndev,
				struct cfg80211_connect_params *sme)
@@ -333,6 +366,8 @@ static int wil_cfg80211_connect(struct wiphy *wiphy,
	    test_bit(wil_status_fwconnected, &wil->status))
		return -EALREADY;

	wil_print_connect_params(wil, sme);

	bss = cfg80211_get_bss(wiphy, sme->channel, sme->bssid,
			       sme->ssid, sme->ssid_len,
			       WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
@@ -358,23 +393,23 @@ static int wil_cfg80211_connect(struct wiphy *wiphy,
				sme->ie_len);
			goto out;
		}
		/*
		 * For secure assoc, send:
		 * (1) WMI_DELETE_CIPHER_KEY_CMD
		 * (2) WMI_SET_APPIE_CMD
		 */
		/* For secure assoc, send WMI_DELETE_CIPHER_KEY_CMD */
		rc = wmi_del_cipher_key(wil, 0, bss->bssid);
		if (rc) {
			wil_err(wil, "WMI_DELETE_CIPHER_KEY_CMD failed\n");
			goto out;
		}
		/* WMI_SET_APPIE_CMD */
	}

	/* WMI_SET_APPIE_CMD. ie may contain rsn info as well as other info
	 * elements. Send it also in case it's empty, to erase previously set
	 * 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");
		goto out;
	}
	}

	/* WMI_CONNECT_CMD */
	memset(&conn, 0, sizeof(conn));
@@ -619,6 +654,45 @@ static int wil_fix_bcon(struct wil6210_priv *wil,
	return rc;
}

static int wil_cfg80211_change_beacon(struct wiphy *wiphy,
				      struct net_device *ndev,
				      struct cfg80211_beacon_data *bcon)
{
	struct wil6210_priv *wil = wiphy_to_wil(wiphy);
	int rc;

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

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

	/* 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,
			bcon->proberesp_ies_len,
			bcon->proberesp_ies);
	if (rc) {
		wil_err(wil, "set_ie(PROBE_RESP) failed\n");
		return rc;
	}

	rc = wmi_set_ie(wil, WMI_FRAME_ASSOC_RESP,
			bcon->assocresp_ies_len,
			bcon->assocresp_ies);
	if (rc) {
		wil_err(wil, "set_ie(ASSOC_RESP) failed\n");
		return rc;
	}

	return 0;
}

static int wil_cfg80211_start_ap(struct wiphy *wiphy,
				 struct net_device *ndev,
				 struct cfg80211_ap_settings *info)
@@ -656,12 +730,8 @@ static int wil_cfg80211_start_ap(struct wiphy *wiphy,

	mutex_lock(&wil->mutex);

	rc = wil_reset(wil);
	if (rc)
		goto out;

	/* Rx VRING. */
	rc = wil_rx_init(wil);
	__wil_down(wil);
	rc = __wil_up(wil);
	if (rc)
		goto out;

@@ -669,9 +739,6 @@ static int wil_cfg80211_start_ap(struct wiphy *wiphy,
	if (rc)
		goto out;

	/* MAC address - pre-requisite for other commands */
	wmi_set_mac_address(wil, ndev->dev_addr);

	/* IE's */
	/* bcon 'head IE's are not relevant for 60g band */
	/*
@@ -693,7 +760,6 @@ static int wil_cfg80211_start_ap(struct wiphy *wiphy,
	if (rc)
		goto out;


	netif_carrier_on(ndev);

out:
@@ -704,7 +770,7 @@ out:
static int wil_cfg80211_stop_ap(struct wiphy *wiphy,
				struct net_device *ndev)
{
	int rc = 0;
	int rc, rc1;
	struct wil6210_priv *wil = wiphy_to_wil(wiphy);

	wil_dbg_misc(wil, "%s()\n", __func__);
@@ -713,8 +779,12 @@ static int wil_cfg80211_stop_ap(struct wiphy *wiphy,

	rc = wmi_pcp_stop(wil);

	__wil_down(wil);
	rc1 = __wil_up(wil);

	mutex_unlock(&wil->mutex);
	return rc;

	return min(rc, rc1);
}

static int wil_cfg80211_del_station(struct wiphy *wiphy,
@@ -744,6 +814,7 @@ static struct cfg80211_ops wil_cfg80211_ops = {
	.del_key = wil_cfg80211_del_key,
	.set_default_key = wil_cfg80211_set_default_key,
	/* AP mode */
	.change_beacon = wil_cfg80211_change_beacon,
	.start_ap = wil_cfg80211_start_ap,
	.stop_ap = wil_cfg80211_stop_ap,
	.del_station = wil_cfg80211_del_station,
@@ -753,6 +824,7 @@ static void wil_wiphy_init(struct wiphy *wiphy)
{
	/* TODO: set real value */
	wiphy->max_scan_ssids = 10;
	wiphy->max_scan_ie_len = WMI_MAX_IE_LEN;
	wiphy->max_num_pmkids = 0 /* TODO: */;
	wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
				 BIT(NL80211_IFTYPE_AP) |
@@ -762,7 +834,7 @@ static void wil_wiphy_init(struct wiphy *wiphy)
	 */
	wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME |
			WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD;
	dev_warn(wiphy_dev(wiphy), "%s : flags = 0x%08x\n",
	dev_dbg(wiphy_dev(wiphy), "%s : flags = 0x%08x\n",
		__func__, wiphy->flags);
	wiphy->probe_resp_offload =
		NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS |
@@ -784,7 +856,9 @@ struct wireless_dev *wil_cfg80211_init(struct device *dev)
	int rc = 0;
	struct wireless_dev *wdev;

	wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL);
	dev_dbg(dev, "%s()\n", __func__);

	wdev = kzalloc(sizeof(*wdev), GFP_KERNEL);
	if (!wdev)
		return ERR_PTR(-ENOMEM);

@@ -816,6 +890,8 @@ void wil_wdev_free(struct wil6210_priv *wil)
{
	struct wireless_dev *wdev = wil_to_wdev(wil);

	dev_dbg(wil_to_dev(wil), "%s()\n", __func__);

	if (!wdev)
		return;

+291 −98

File changed.

Preview size limit exceeded, changes collapsed.

+45 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading