Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH v4] ath10k: create debugfs interface to trigger fw crash
From: Michal Kazior @ 2013-07-22 12:08 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Michal Kazior
In-Reply-To: <878v1122id.fsf@kamboji.qca.qualcomm.com>

This can be useful for testing. To perform a
forced firmware crash write 'crash' to
'simulate_fw_crash' debugfs file. E.g.

  echo crash > /sys/kernel/debug/ieee80211/phy1/ath10k/simulate_fw_crash

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
v3: return an appropriate errno instead of using ath10k_warn()

 drivers/net/wireless/ath/ath10k/debug.c |   57 +++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 65279f5..3d65594 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -445,6 +445,60 @@ static const struct file_operations fops_fw_stats = {
 	.llseek = default_llseek,
 };
 
+static ssize_t ath10k_read_simulate_fw_crash(struct file *file,
+					     char __user *user_buf,
+					     size_t count, loff_t *ppos)
+{
+	const char buf[] = "To simulate firmware crash write the keyword"
+			   " `crash` to this file.\nThis will force firmware"
+			   " to report a crash to the host system.\n";
+	return simple_read_from_buffer(user_buf, count, ppos, buf, strlen(buf));
+}
+
+static ssize_t ath10k_write_simulate_fw_crash(struct file *file,
+					      const char __user *user_buf,
+					      size_t count, loff_t *ppos)
+{
+	struct ath10k *ar = file->private_data;
+	char buf[32] = {};
+	int ret;
+
+	mutex_lock(&ar->conf_mutex);
+
+	simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+	if (strcmp(buf, "crash") && strcmp(buf, "crash\n")) {
+		ret = -EINVAL;
+		goto exit;
+	}
+
+	if (ar->state != ATH10K_STATE_ON &&
+	    ar->state != ATH10K_STATE_RESTARTED) {
+		ret = -ENETDOWN;
+		goto exit;
+	}
+
+	ath10k_info("simulating firmware crash\n");
+
+	ret = ath10k_wmi_force_fw_hang(ar, WMI_FORCE_FW_HANG_ASSERT, 0);
+	if (ret)
+		ath10k_warn("failed to force fw hang (%d)\n", ret);
+
+	if (ret == 0)
+		ret = count;
+
+exit:
+	mutex_unlock(&ar->conf_mutex);
+	return ret;
+}
+
+static const struct file_operations fops_simulate_fw_crash = {
+	.read = ath10k_read_simulate_fw_crash,
+	.write = ath10k_write_simulate_fw_crash,
+	.open = simple_open,
+	.owner = THIS_MODULE,
+	.llseek = default_llseek,
+};
+
 int ath10k_debug_create(struct ath10k *ar)
 {
 	ar->debug.debugfs_phy = debugfs_create_dir("ath10k",
@@ -461,6 +515,9 @@ int ath10k_debug_create(struct ath10k *ar)
 	debugfs_create_file("wmi_services", S_IRUSR, ar->debug.debugfs_phy, ar,
 			    &fops_wmi_services);
 
+	debugfs_create_file("simulate_fw_crash", S_IRUSR, ar->debug.debugfs_phy,
+			    ar, &fops_simulate_fw_crash);
+
 	return 0;
 }
 #endif /* CONFIG_ATH10K_DEBUGFS */
-- 
1.7.9.5


^ permalink raw reply related

* Disassociation immediately after joining AP - mac80211
From: Jahnavi @ 2013-07-22 17:35 UTC (permalink / raw)
  To: linux-wireless

Hi,
I am working in the station mode, using mac80211 in kernel 3.5.4. When I 
am trying to connect to the AP, station sends disassociation request 
with reason code 3 (deauthenticated because sending station is leaving) 
immediately after receiving association response.
Initially I received some IPv6 packets from mac80211 to transmit. I then 
disabled IPv6 by adding the line net.ipv6.conf.all.disable_ipv6 = 1 in 
/etc/sysctl.conf file. Then no packets are received from mac80211, only 
disassociation request is received.
This behaviour is persistent across channels in 2.4ghz.

The call trace when the disassociation request is received is as follows:

/// dump start ///
wlan2: RX AssocResp from 00:16:b6:d1:2c:16 (capab=0x401 status=0 aid=3)
wlan2: disassociating from 00:16:b6:d1:2c:16 by local choice (reason=3)

Call Trace:
  [<f985234d>] __ieee80211_tx+0x18d/0x300 [mac80211]
  [<f985423b>] ieee80211_tx+0xbb/0xf0 [mac80211]
  [<f98542fc>] ieee80211_xmit+0x8c/0xf0 [mac80211]
  [<f98552c1>] ieee80211_tx_skb_tid+0x51/0x60 [mac80211]
  [<f9869fd1>] ieee80211_send_deauth_disassoc+0x101/0x110 [mac80211]
  [<f986b54c>] ieee80211_set_disassoc+0x2cc/0x440 [mac80211]
  [<c094fcbe>] ? printk+0x4d/0x4f
  [<f986f530>] ieee80211_mgd_disassoc+0xd0/0x140 [mac80211]
  [<f9848fde>] ieee80211_disassoc+0x2e/0x40 [mac80211]
  [<f81e873f>] cfg80211_mlme_disassoc+0xaf/0xe0 [cfg80211]
  [<f81db468>] nl80211_disassociate+0xc8/0xf0 [cfg80211]
  [<f81dbec0>] ? nl80211_set_wiphy+0x630/0x630 [cfg80211]
  [<c088c784>] genl_rcv_msg+0x1e4/0x260
  [<c053d215>] ? __kmalloc_track_caller+0x185/0x1e0
  [<c088c5a0>] ? genl_rcv+0x30/0x30
  [<c088c01e>] netlink_rcv_skb+0x8e/0xb0
  [<c088c58c>] genl_rcv+0x1c/0x30
  [<c088ba54>] netlink_unicast+0x174/0x1f0
  [<c088bcb8>] netlink_sendmsg+0x1e8/0x310
  [<c0854e7f>] sock_sendmsg+0xff/0x120
  [<c04ffad7>] ? __generic_file_aio_write+0x257/0x4d0
  [<c06718e2>] ? _copy_from_user+0x42/0x60
  [<c08604f4>] ? verify_iovec+0x44/0xb0
  [<c08562d2>] __sys_sendmsg+0x262/0x270
  [<c05ac560>] ? ext4_file_write+0xb0/0x270
  [<c0545bc4>] ? do_sync_write+0xb4/0xf0
  [<c057c748>] ? fsnotify+0x198/0x250
  [<c08570eb>] sys_sendmsg+0x3b/0x60
  [<c0857793>] sys_socketcall+0x283/0x2e0
  [<c04b8484>] ? __audit_syscall_entry+0xb4/0x2b0
  [<c095fc9f>] sysenter_do_call+0x12/0x28

/// dump end ///


Thanks in advance.

Regards,
Jahnavi


^ permalink raw reply

* Re: pull-request: *mac80211* 2013-07-22
From: Johannes Berg @ 2013-07-22 12:02 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless
In-Reply-To: <1374494325.14517.4.camel@jlt4.sipsolutions.net>

Fixing subject, sorry ...

johannes


^ permalink raw reply

* pull-request: iwlwifi-fixes 2013-07-22
From: Johannes Berg @ 2013-07-22 12:01 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1944 bytes --]

John,

And another one for iwlwifi.

Here I have a fix for debugfs directory creation (causing a spurious
error message), two scanning fixes from David Spinadel, an LED fix and
two patches related to a BA session problem that eventually caused
firmware crashes from Emmanuel and a small BT fix for older devices as
well as a workaround for a firmware problem with APs with very small
beacon intervals from myself.

Let me know if there's any problem.

johannes

The following changes since commit ad81f0545ef01ea651886dddac4bef6cec930092:

  Linux 3.11-rc1 (2013-07-14 15:18:27 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes.git for-john

for you to fetch changes up to a590ad411891de551e6de1b51ea635c0484148d6:

  iwlwifi: mvm: remove extra SSID from probe request (2013-07-16 13:55:15 +0300)

----------------------------------------------------------------
Alexander Bondar (1):
      iwlwifi: mvm: Fix VIF specific debugfs directory creation

David Spinadel (2):
      iwlwifi: mvm: fix bug in scan ssid
      iwlwifi: mvm: remove extra SSID from probe request

Emmanuel Grumbach (3):
      iwlwifi: mvm: unregister leds when registration failed
      iwlwifi: mvm: fix L2P BA ressources leak
      iwlwifi: mvm: track the number of Rx BA sessions

Johannes Berg (2):
      iwlwifi: dvm: don't send BT_CONFIG on devices w/o Bluetooth
      iwlwifi: mvm: refuse connection to APs with BI < 16

 drivers/net/wireless/iwlwifi/dvm/main.c     |  2 +-
 drivers/net/wireless/iwlwifi/mvm/debugfs.c  |  6 +++++-
 drivers/net/wireless/iwlwifi/mvm/mac80211.c | 23 ++++++++++++++++++++++-
 drivers/net/wireless/iwlwifi/mvm/mvm.h      |  1 +
 drivers/net/wireless/iwlwifi/mvm/scan.c     | 10 ++++++----
 drivers/net/wireless/iwlwifi/mvm/sta.c      | 23 +++++++++++++++++++++--
 6 files changed, 56 insertions(+), 9 deletions(-)


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* pull-request: 2013-07-22
From: Johannes Berg @ 2013-07-22 11:58 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1768 bytes --]

John,

Here's a pull request for 3.11 (and some fixes with cc stable), sorry
for the delay - I was travelling.

Here I have a fix for RSSI thresholds in mesh, two minstrel fixes from
Felix, an nl80211 fix from Michal and four various fixes I did myself.

Let me know if there's any problem.

johannes



The following changes since commit ad81f0545ef01ea651886dddac4bef6cec930092:

  Linux 3.11-rc1 (2013-07-14 15:18:27 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git for-john

for you to fetch changes up to 5c9fc93bc9bc417418fc1b6366833ae6a07b804d:

  mac80211/minstrel: fix NULL pointer dereference issue (2013-07-16 17:48:14 +0300)

----------------------------------------------------------------
Chun-Yeow Yeoh (1):
      nl80211: fix the setting of RSSI threshold value for mesh

Felix Fietkau (2):
      mac80211/minstrel_ht: fix cck rate sampling
      mac80211/minstrel: fix NULL pointer dereference issue

Johannes Berg (4):
      cfg80211: fix bugs in new SME implementation
      regulatory: add missing rtnl locking
      mac80211: fix ethtool stats for non-station interfaces
      mac80211: fix duplicate retransmission detection

Michal Kazior (1):
      nl80211: fix mgmt tx status and testmode reporting for netns

 net/mac80211/cfg.c                 |  2 ++
 net/mac80211/rc80211_minstrel.c    |  3 ++-
 net/mac80211/rc80211_minstrel_ht.c | 10 +++++++++-
 net/mac80211/rx.c                  | 10 ++++++++--
 net/wireless/nl80211.c             | 11 +++++++----
 net/wireless/reg.c                 |  2 ++
 net/wireless/sme.c                 | 29 ++++++++++++++++++++++++++---
 7 files changed, 56 insertions(+), 11 deletions(-)


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: [BUG] 3.10 regression: hang on suspend
From: Stanislaw Gruszka @ 2013-07-22 11:22 UTC (permalink / raw)
  To: Ortwin Glück; +Cc: Arend van Spriel, linux-kernel, linux-wireless
In-Reply-To: <51E9899E.3080307@odi.ch>

[-- Attachment #1: Type: text/plain, Size: 1097 bytes --]

On Fri, Jul 19, 2013 at 08:46:54PM +0200, Ortwin Glück wrote:
> On 07/19/2013 02:08 PM, Stanislaw Gruszka wrote:
> >I'm attaching patch, which should prevent crash (but not fix the issue,
> >just workaround it), plese apply it. If it make suspend work, please then
> >reload iwlwifi module with debug=0x3 option, suspend/resume machine and
> >provide dmesg output after that.
> 
> 
> Here the requested dmesg. Please note that two different WARN_ONs
> trigger here directly after each other.
> 
> To me it looks like iwlagn_mac_remove_interface() is called twice,
> but I am not familiar with the code.

We remove interface that we do not add in the driver. I think I found
reason of that - I removed below code in bad commit:

        list_for_each_entry(sdata, &local->interfaces, list) {
[snip]
-               switch (sdata->vif.type) {
-               case NL80211_IFTYPE_AP_VLAN:
-               case NL80211_IFTYPE_MONITOR:
-                       /* skip these */
-                       continue;

Attached patch should correct that. Please test if it fixes the
crash.

Thanks
Stanislaw


[-- Attachment #2: mac80211_fix_suspend_crash.patch --]
[-- Type: text/plain, Size: 663 bytes --]

diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
index 7fc5d0d..3401262 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -99,10 +99,13 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
 	}
 	mutex_unlock(&local->sta_mtx);
 
-	/* remove all interfaces */
+	/* remove all interfaces that were created in the driver */
 	list_for_each_entry(sdata, &local->interfaces, list) {
-		if (!ieee80211_sdata_running(sdata))
+		if (!ieee80211_sdata_running(sdata) ||
+		    sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
+		    sdata->vif.type == NL80211_IFTYPE_MONITOR)
 			continue;
+
 		drv_remove_interface(local, sdata);
 	}
 

^ permalink raw reply related

* [PATCH for-3.11 2/2] brcmfmac: bail out of brcmf_txflowblock_if() for non-netdev interface
From: Arend van Spriel @ 2013-07-22 10:46 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Arend van Spriel
In-Reply-To: <1374489984-18250-1-git-send-email-arend@broadcom.com>

To avoid ending up in a NULL-pointer access, the function
brcmf_txflowblock_if() should only be called for interfaces
that have a netdev associated with it.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
index 8e89755..8009901 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
@@ -242,7 +242,7 @@ void brcmf_txflowblock_if(struct brcmf_if *ifp,
 {
 	unsigned long flags;
 
-	if (!ifp)
+	if (!ifp || !ifp->ndev)
 		return;
 
 	brcmf_dbg(TRACE, "enter: idx=%d stop=0x%X reason=%d state=%d\n",
-- 
1.7.10.4



^ permalink raw reply related

* [PATCH for-3.11 0/2] brcmfmac: fixing potential driver issues
From: Arend van Spriel @ 2013-07-22 10:46 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Arend van Spriel

Two patch that seem worth taking in 3.11. The first one could cause the
driver to lock up. This issue has been discovered reading the code. The
second issue has been observed during internal testing and resulted in
a NULL pointer access.

Arend van Spriel (2):
  brcmfmac: decrement pending 8021x count upon tx failure
  brcmfmac: bail out of brcmf_txflowblock_if() for non-netdev interface

 drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c |    2 +-
 drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c  |    8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

-- 
1.7.10.4



^ permalink raw reply

* [PATCH for-3.11 1/2] brcmfmac: decrement pending 8021x count upon tx failure
From: Arend van Spriel @ 2013-07-22 10:46 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Arend van Spriel
In-Reply-To: <1374489984-18250-1-git-send-email-arend@broadcom.com>

If the transmit fails because there are no hanger slots or
any other reason and the packet was an EAPOL packet the
pending coutner should be decreased although it was not
transmitted so the driver does not end up in a dead-lock.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
index f0d9f7f..29b1f24 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
@@ -1744,13 +1744,14 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
 	ulong flags;
 	int fifo = BRCMF_FWS_FIFO_BCMC;
 	bool multicast = is_multicast_ether_addr(eh->h_dest);
+	bool pae = eh->h_proto == htons(ETH_P_PAE);
 
 	/* determine the priority */
 	if (!skb->priority)
 		skb->priority = cfg80211_classify8021d(skb);
 
 	drvr->tx_multicast += !!multicast;
-	if (ntohs(eh->h_proto) == ETH_P_PAE)
+	if (pae)
 		atomic_inc(&ifp->pend_8021x_cnt);
 
 	if (!brcmf_fws_fc_active(fws)) {
@@ -1781,6 +1782,11 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
 		brcmf_fws_schedule_deq(fws);
 	} else {
 		brcmf_err("drop skb: no hanger slot\n");
+		if (pae) {
+			atomic_dec(&ifp->pend_8021x_cnt);
+			if (waitqueue_active(&ifp->pend_8021x_wait))
+				wake_up(&ifp->pend_8021x_wait);
+		}
 		brcmu_pkt_buf_free_skb(skb);
 	}
 	brcmf_fws_unlock(drvr, flags);
-- 
1.7.10.4



^ permalink raw reply related

* Re: [PATCH] ath: wil6210: Fix build error
From: Vladimir Kondratiev @ 2013-07-22  9:56 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: thomas, Larry Finger, linville, linux-wireless, netdev, wil6210,
	Stable
In-Reply-To: <1374457543.16248.8.camel@deadeye.wl.decadent.org.uk>

On Monday, July 22, 2013 02:45:43 AM Ben Hutchings wrote:
> > ifeq (, $(findstring -W,$(EXTRA_CFLAGS)))
> >       subdir-ccflags-y += -Werror
> > endif
> 
> This is a pretty weird thing to do, and you've failed to account for
> -Wextra.
> 
> -Werror is generally a bad default in free software, as you have no
> control over which compiler version will be used.
> 

Well, you convinced me. I'll send patch removing -Werror.

Thanks, Vladimir

^ permalink raw reply

* [PATCH] wil6210: drop -Werror compiler flag
From: Vladimir Kondratiev @ 2013-07-22  9:53 UTC (permalink / raw)
  To: John W . Linville
  Cc: Vladimir Kondratiev, linux-wireless, Luis R . Rodriguez, wil6210

In production code, don't use -Werror,
as it causes random compilation failures due to compiler version and options used.

With every new version of gcc, it becomes stricter and report more warnings.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/Makefile | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/Makefile b/drivers/net/wireless/ath/wil6210/Makefile
index f891d51..990dd42a 100644
--- a/drivers/net/wireless/ath/wil6210/Makefile
+++ b/drivers/net/wireless/ath/wil6210/Makefile
@@ -11,9 +11,6 @@ wil6210-y += txrx.o
 wil6210-y += debug.o
 wil6210-$(CONFIG_WIL6210_TRACING) += trace.o
 
-ifeq (, $(findstring -W,$(EXTRA_CFLAGS)))
-	subdir-ccflags-y += -Werror
-endif
 # for tracing framework to find trace.h
 CFLAGS_trace.o := -I$(src)
 
-- 
1.8.1.2


^ permalink raw reply related

* [PATCH 2/2] MAINTAINERS: update ath6kl git location
From: Kalle Valo @ 2013-07-22  9:32 UTC (permalink / raw)
  To: linux-wireless; +Cc: ath10k
In-Reply-To: <20130722093113.26562.11543.stgit@localhost6.localdomain6>

The git tree is in github.com nowadays.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 MAINTAINERS |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 44626b8..7a403ba 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1406,7 +1406,7 @@ ATHEROS ATH6KL WIRELESS DRIVER
 M:	Kalle Valo <kvalo@qca.qualcomm.com>
 L:	linux-wireless@vger.kernel.org
 W:	http://wireless.kernel.org/en/users/Drivers/ath6kl
-T:	git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath6kl.git
+T:	git git://github.com/kvalo/ath.git
 S:	Supported
 F:	drivers/net/wireless/ath/ath6kl/
 


^ permalink raw reply related

* [PATCH 1/2] MAINTAINERS: add ath10k
From: Kalle Valo @ 2013-07-22  9:32 UTC (permalink / raw)
  To: linux-wireless; +Cc: ath10k
In-Reply-To: <20130722093113.26562.11543.stgit@localhost6.localdomain6>

I forgot to add an entry to MAINTAINERS when submitting the driver.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 MAINTAINERS |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index bf61e04..44626b8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6719,6 +6719,14 @@ T:	git git://linuxtv.org/anttip/media_tree.git
 S:	Maintained
 F:	drivers/media/tuners/qt1010*
 
+QUALCOMM ATHEROS ATH10K WIRELESS DRIVER
+M:	Kalle Valo <kvalo@qca.qualcomm.com>
+L:	ath10k@lists.infradead.org
+W:	http://wireless.kernel.org/en/users/Drivers/ath10k
+T:	git git://github.com/kvalo/ath.git
+S:	Supported
+F:	drivers/net/wireless/ath/ath10k/
+
 QUALCOMM HEXAGON ARCHITECTURE
 M:	Richard Kuo <rkuo@codeaurora.org>
 L:	linux-hexagon@vger.kernel.org


^ permalink raw reply related

* [PATCH 0/2] MAINTAINERS: ath10k and ath6kl updates
From: Kalle Valo @ 2013-07-22  9:32 UTC (permalink / raw)
  To: linux-wireless; +Cc: ath10k

Hi,

here few patches for MAINTAINERS. If they are ok I'll add them to ath.git and
send a pull request to John.

---

Kalle Valo (2):
      MAINTAINERS: add ath10k
      MAINTAINERS: update ath6kl git location


 MAINTAINERS |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

^ permalink raw reply

* Re: [PATCH] ath: wil6210: Fix build error
From: Ben Hutchings @ 2013-07-22  1:45 UTC (permalink / raw)
  To: Vladimir Kondratiev
  Cc: thomas, Larry Finger, linville, linux-wireless, netdev, wil6210,
	Stable
In-Reply-To: <5330916.8NnOO4SNAp@lx-vladimir>

[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]

On Sun, 2013-07-21 at 18:52 +0300, Vladimir Kondratiev wrote:
> On Sunday, July 21, 2013 09:35:40 AM Thomas Fjellstrom wrote:
> > If it helps, I'm running a fresh install of Debian Sid with gcc 4.8.1. I've 
> > noticed that each newer successive version of gcc gets more strict with what 
> > code it accepts without warning, or error. A lot of my only somewhat old code 
> > tends to have a lot more warnings. Especially that signedness warning.
> 
> Yes, this is the case; I have 4.7.3
> 
> > 
> > It also looked like that that driver or section of the kernel was compiling 
> > with -Werror. I haven't verrified that but I remember seeing "treating all 
> > warnings as errors" at one point.
> > 
> You are right, I have this in Makefile:
> (if one turn on extra warnings with -W, there will be lots of false alarms,
> that's why this ifeq())
> 
> ifeq (, $(findstring -W,$(EXTRA_CFLAGS)))
> 	subdir-ccflags-y += -Werror
> endif

This is a pretty weird thing to do, and you've failed to account for
-Wextra.

-Werror is generally a bad default in free software, as you have no
control over which compiler version will be used.

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply

* Re: [PATCH] ath: wil6210: Fix build error
From: Kalle Valo @ 2013-07-21 16:55 UTC (permalink / raw)
  To: Vladimir Kondratiev
  Cc: thomas, Larry Finger, linville, linux-wireless, netdev, wil6210
In-Reply-To: <5330916.8NnOO4SNAp@lx-vladimir>

(Dropping stable)

Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> writes:

>> It also looked like that that driver or section of the kernel was compiling 
>> with -Werror. I haven't verrified that but I remember seeing "treating all 
>> warnings as errors" at one point.
>> 
> You are right, I have this in Makefile:
> (if one turn on extra warnings with -W, there will be lots of false alarms,
> that's why this ifeq())
>
> ifeq (, $(findstring -W,$(EXTRA_CFLAGS)))
> 	subdir-ccflags-y += -Werror
> endif

This is exactly why it's recommended not to use -Werror on releases.
It's ok when developers use it, but for end users -Werror should not be
enabled by default.

-- 
Kalle Valo

^ permalink raw reply

* Re: [PATCH] ath: wil6210: Fix build error
From: Vladimir Kondratiev @ 2013-07-21 15:52 UTC (permalink / raw)
  To: thomas; +Cc: Larry Finger, linville, linux-wireless, netdev, wil6210, Stable
In-Reply-To: <1559869.yu0fjJXVeX@balsa>

On Sunday, July 21, 2013 09:35:40 AM Thomas Fjellstrom wrote:
> If it helps, I'm running a fresh install of Debian Sid with gcc 4.8.1. I've 
> noticed that each newer successive version of gcc gets more strict with what 
> code it accepts without warning, or error. A lot of my only somewhat old code 
> tends to have a lot more warnings. Especially that signedness warning.

Yes, this is the case; I have 4.7.3

> 
> It also looked like that that driver or section of the kernel was compiling 
> with -Werror. I haven't verrified that but I remember seeing "treating all 
> warnings as errors" at one point.
> 
You are right, I have this in Makefile:
(if one turn on extra warnings with -W, there will be lots of false alarms,
that's why this ifeq())

ifeq (, $(findstring -W,$(EXTRA_CFLAGS)))
	subdir-ccflags-y += -Werror
endif

Thanks, Vladimir

^ permalink raw reply

* Re: [PATCH] ath: wil6210: Fix build error
From: Thomas Fjellstrom @ 2013-07-21 15:35 UTC (permalink / raw)
  To: Larry Finger
  Cc: Vladimir Kondratiev, linville, linux-wireless, netdev, wil6210,
	Stable
In-Reply-To: <51EBFABB.8080701@lwfinger.net>

On Sun 21 July 2013 10:14:03 Larry Finger wrote:
> On 07/21/2013 02:06 AM, Vladimir Kondratiev wrote:
> > On Saturday, July 20, 2013 09:46:48 PM Larry Finger wrote:
> >> Building driver wil6210 in 3.10 and 3.11 kernels yields the following 
errors:
> >>
> >>    CC [M]  drivers/net/wireless/ath/wil6210/debugfs.o
> >> drivers/net/wireless/ath/wil6210/debugfs.c: In function 'wil_print_ring':
> >> drivers/net/wireless/ath/wil6210/debugfs.c:163:11: error: pointer targets 
in passing argument 5 of 'hex_dump_to_buffer' differ in signedness [-
Werror=pointer-sign]
> >>             false);
> >>             ^
> >> In file included from include/linux/kernel.h:13:0,
> >>                   from include/linux/cache.h:4,
> >>                   from include/linux/time.h:4,
> >>                   from include/linux/stat.h:18,
> >>                   from include/linux/module.h:10,
> >>                   from drivers/net/wireless/ath/wil6210/debugfs.c:17:
> >> include/linux/printk.h:361:13: note: expected 'char *' but argument is of 
type 'unsigned char *'
> >>   extern void hex_dump_to_buffer(const void *buf, size_t len,
> >>               ^
> >> drivers/net/wireless/ath/wil6210/debugfs.c: In function 
'wil_txdesc_debugfs_show':
> >> drivers/net/wireless/ath/wil6210/debugfs.c:429:10: error: pointer targets 
in passing argument 5 of 'hex_dump_to_buffer' differ in signedness [-
Werror=pointer-sign]
> >>            sizeof(printbuf), false);
> >>            ^
> >> In file included from include/linux/kernel.h:13:0,
> >>                   from include/linux/cache.h:4,
> >>                   from include/linux/time.h:4,
> >>                   from include/linux/stat.h:18,
> >>                   from include/linux/module.h:10,
> >>                   from drivers/net/wireless/ath/wil6210/debugfs.c:17:
> >> include/linux/printk.h:361:13: note: expected 'char *' but argument is of 
type 'unsigned char *'
> >>   extern void hex_dump_to_buffer(const void *buf, size_t len,
> >>               ^
> >> cc1: all warnings being treated as errors
> >> make[5]: *** [drivers/net/wireless/ath/wil6210/debugfs.o] Error 1
> >> make[4]: *** [drivers/net/wireless/ath/wil6210] Error 2
> >> make[3]: *** [drivers/net/wireless/ath] Error 2
> >> make[2]: *** [drivers/net/wireless] Error 2
> >> make[1]: *** [drivers/net] Error 2
> >> make: *** [drivers] Error 2
> >>
> >> These errors are fixed by changing the type of the buffer from "unsigned 
char *" to "char *".
> >>
> >> Reported-by: Thomas Fjellstrom <thomas@fjellstrom.ca>
> >> Tested-by: Thomas Fjellstrom <thomas@fjellstrom.ca>
> >> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> >> Cc: Stable <stable@vger.kernel.org>  [3.10]
> >> Cc: Thomas Fjellstrom <thomas@fjellstrom.ca>
> >> ---
> >>   drivers/net/wireless/ath/wil6210/debugfs.c | 4 ++--
> >>   1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c 
b/drivers/net/wireless/ath/wil6210/debugfs.c
> >> index e8308ec..ab63676 100644
> >> --- a/drivers/net/wireless/ath/wil6210/debugfs.c
> >> +++ b/drivers/net/wireless/ath/wil6210/debugfs.c
> >> @@ -145,7 +145,7 @@ static void wil_print_ring(struct seq_file *s, const 
char *prefix,
> >>   				   le16_to_cpu(hdr.type), hdr.flags);
> >>   			if (len <= MAX_MBOXITEM_SIZE) {
> >>   				int n = 0;
> >> -				unsigned char printbuf[16 * 3 + 2];
> >> +				char printbuf[16 * 3 + 2];
> >>   				unsigned char databuf[MAX_MBOXITEM_SIZE];
> >>   				void __iomem *src = wmi_buffer(wil, d.addr) +
> >>   					sizeof(struct wil6210_mbox_hdr);
> >> @@ -416,7 +416,7 @@ static int wil_txdesc_debugfs_show(struct seq_file *s, 
void *data)
> >>   		seq_printf(s, "  SKB = %p\n", skb);
> >>
> >>   		if (skb) {
> >> -			unsigned char printbuf[16 * 3 + 2];
> >> +			char printbuf[16 * 3 + 2];
> >>   			int i = 0;
> >>   			int len = le16_to_cpu(d->dma.length);
> >>   			void *p = skb->data;
> >>
> > Hmm, I have no warning for this with neither 3.10 nor 3.11 kernel version; 
but
> > patch is correct, and here is my
> > Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
> 
> Thanks. I did not see any warning or error either; however, it did happen 
for 
> Thomas. I'm not sure what combination of compiler version and/or switches 
lead 
> to the problem, but his system apparently uses them.

If it helps, I'm running a fresh install of Debian Sid with gcc 4.8.1. I've 
noticed that each newer successive version of gcc gets more strict with what 
code it accepts without warning, or error. A lot of my only somewhat old code 
tends to have a lot more warnings. Especially that signedness warning.

It also looked like that that driver or section of the kernel was compiling 
with -Werror. I haven't verrified that but I remember seeing "treating all 
warnings as errors" at one point.

> Larry
> 
> 
-- 
Thomas Fjellstrom
thomas@fjellstrom.ca

^ permalink raw reply

* Re: [PATCH] ath: wil6210: Fix build error
From: Larry Finger @ 2013-07-21 15:14 UTC (permalink / raw)
  To: Vladimir Kondratiev
  Cc: linville, linux-wireless, netdev, wil6210, Stable,
	Thomas Fjellstrom
In-Reply-To: <1958736.oRuXAUfNGd@lx-vladimir>

On 07/21/2013 02:06 AM, Vladimir Kondratiev wrote:
> On Saturday, July 20, 2013 09:46:48 PM Larry Finger wrote:
>> Building driver wil6210 in 3.10 and 3.11 kernels yields the following errors:
>>
>>    CC [M]  drivers/net/wireless/ath/wil6210/debugfs.o
>> drivers/net/wireless/ath/wil6210/debugfs.c: In function 'wil_print_ring':
>> drivers/net/wireless/ath/wil6210/debugfs.c:163:11: error: pointer targets in passing argument 5 of 'hex_dump_to_buffer' differ in signedness [-Werror=pointer-sign]
>>             false);
>>             ^
>> In file included from include/linux/kernel.h:13:0,
>>                   from include/linux/cache.h:4,
>>                   from include/linux/time.h:4,
>>                   from include/linux/stat.h:18,
>>                   from include/linux/module.h:10,
>>                   from drivers/net/wireless/ath/wil6210/debugfs.c:17:
>> include/linux/printk.h:361:13: note: expected 'char *' but argument is of type 'unsigned char *'
>>   extern void hex_dump_to_buffer(const void *buf, size_t len,
>>               ^
>> drivers/net/wireless/ath/wil6210/debugfs.c: In function 'wil_txdesc_debugfs_show':
>> drivers/net/wireless/ath/wil6210/debugfs.c:429:10: error: pointer targets in passing argument 5 of 'hex_dump_to_buffer' differ in signedness [-Werror=pointer-sign]
>>            sizeof(printbuf), false);
>>            ^
>> In file included from include/linux/kernel.h:13:0,
>>                   from include/linux/cache.h:4,
>>                   from include/linux/time.h:4,
>>                   from include/linux/stat.h:18,
>>                   from include/linux/module.h:10,
>>                   from drivers/net/wireless/ath/wil6210/debugfs.c:17:
>> include/linux/printk.h:361:13: note: expected 'char *' but argument is of type 'unsigned char *'
>>   extern void hex_dump_to_buffer(const void *buf, size_t len,
>>               ^
>> cc1: all warnings being treated as errors
>> make[5]: *** [drivers/net/wireless/ath/wil6210/debugfs.o] Error 1
>> make[4]: *** [drivers/net/wireless/ath/wil6210] Error 2
>> make[3]: *** [drivers/net/wireless/ath] Error 2
>> make[2]: *** [drivers/net/wireless] Error 2
>> make[1]: *** [drivers/net] Error 2
>> make: *** [drivers] Error 2
>>
>> These errors are fixed by changing the type of the buffer from "unsigned char *" to "char *".
>>
>> Reported-by: Thomas Fjellstrom <thomas@fjellstrom.ca>
>> Tested-by: Thomas Fjellstrom <thomas@fjellstrom.ca>
>> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
>> Cc: Stable <stable@vger.kernel.org>  [3.10]
>> Cc: Thomas Fjellstrom <thomas@fjellstrom.ca>
>> ---
>>   drivers/net/wireless/ath/wil6210/debugfs.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
>> index e8308ec..ab63676 100644
>> --- a/drivers/net/wireless/ath/wil6210/debugfs.c
>> +++ b/drivers/net/wireless/ath/wil6210/debugfs.c
>> @@ -145,7 +145,7 @@ static void wil_print_ring(struct seq_file *s, const char *prefix,
>>   				   le16_to_cpu(hdr.type), hdr.flags);
>>   			if (len <= MAX_MBOXITEM_SIZE) {
>>   				int n = 0;
>> -				unsigned char printbuf[16 * 3 + 2];
>> +				char printbuf[16 * 3 + 2];
>>   				unsigned char databuf[MAX_MBOXITEM_SIZE];
>>   				void __iomem *src = wmi_buffer(wil, d.addr) +
>>   					sizeof(struct wil6210_mbox_hdr);
>> @@ -416,7 +416,7 @@ static int wil_txdesc_debugfs_show(struct seq_file *s, void *data)
>>   		seq_printf(s, "  SKB = %p\n", skb);
>>
>>   		if (skb) {
>> -			unsigned char printbuf[16 * 3 + 2];
>> +			char printbuf[16 * 3 + 2];
>>   			int i = 0;
>>   			int len = le16_to_cpu(d->dma.length);
>>   			void *p = skb->data;
>>
> Hmm, I have no warning for this with neither 3.10 nor 3.11 kernel version; but
> patch is correct, and here is my
> Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>

Thanks. I did not see any warning or error either; however, it did happen for 
Thomas. I'm not sure what combination of compiler version and/or switches lead 
to the problem, but his system apparently uses them.

Larry



^ permalink raw reply

* Re: [PATCH 2/2] regulatory: take RTNL when restoring settings on CRDA timeout
From: Arik Nemtsov @ 2013-07-21 14:18 UTC (permalink / raw)
  To: Sujith Manoharan; +Cc: linux-wireless, Johannes Berg, Luis R. Rodriguez
In-Reply-To: <20971.60401.394690.279877@gargle.gargle.HOWL>

On Sun, Jul 21, 2013 at 5:10 PM, Sujith Manoharan <sujith@msujith.org> wrote:
> Arik Nemtsov wrote:
>> The RTNL has to be held since this potentially changes the regdomain.
>> Locking was forgotten here due to recent locking simplification changes.
>
> This is already present in the mac80211 tree:
> https://git.kernel.org/cgit/linux/kernel/git/jberg/mac80211.git/commit/?id=f77b86d7d3acf9dfcb5ee834628d12207584b2cb
>

Ah thanks. I missed that. Disregard then please.

Arik

^ permalink raw reply

* Re: [PATCH 2/2] regulatory: take RTNL when restoring settings on CRDA timeout
From: Sujith Manoharan @ 2013-07-21 14:10 UTC (permalink / raw)
  To: Arik Nemtsov; +Cc: linux-wireless, Johannes Berg, Luis R. Rodriguez
In-Reply-To: <1374413809-26005-2-git-send-email-arik@wizery.com>

Arik Nemtsov wrote:
> The RTNL has to be held since this potentially changes the regdomain.
> Locking was forgotten here due to recent locking simplification changes.

This is already present in the mac80211 tree:
https://git.kernel.org/cgit/linux/kernel/git/jberg/mac80211.git/commit/?id=f77b86d7d3acf9dfcb5ee834628d12207584b2cb

Sujith

^ permalink raw reply

* [PATCH 2/2] regulatory: take RTNL when restoring settings on CRDA timeout
From: Arik Nemtsov @ 2013-07-21 13:36 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Luis R. Rodriguez, Arik Nemtsov
In-Reply-To: <1374413809-26005-1-git-send-email-arik@wizery.com>

The RTNL has to be held since this potentially changes the regdomain.
Locking was forgotten here due to recent locking simplification changes.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
 net/wireless/reg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 1ec3933..b25390a 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2285,7 +2285,9 @@ void wiphy_regulatory_deregister(struct wiphy *wiphy)
 static void reg_timeout_work(struct work_struct *work)
 {
 	REG_DBG_PRINT("Timeout while waiting for CRDA to reply, restoring regulatory settings\n");
+	rtnl_lock();
 	restore_regulatory_settings(true);
+	rtnl_unlock();
 }
 
 int __init regulatory_init(void)
-- 
1.8.1.2


^ permalink raw reply related

* [PATCH 1/2] regulatory: use correct regulatory initiator on wiphy register
From: Arik Nemtsov @ 2013-07-21 13:36 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Luis R. Rodriguez, Arik Nemtsov

The current regdomain was not always set by the core. This causes
cards with a custom regulatory domain to ignore user initiated changes
if done before the card was registered.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
 net/wireless/reg.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index ddeff80..1ec3933 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2250,10 +2250,13 @@ int reg_device_uevent(struct device *dev, struct kobj_uevent_env *env)
 
 void wiphy_regulatory_register(struct wiphy *wiphy)
 {
+	struct regulatory_request *lr;
+
 	if (!reg_dev_ignore_cell_hint(wiphy))
 		reg_num_devs_support_basehint++;
 
-	wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE);
+	lr = get_last_request();
+	wiphy_update_regulatory(wiphy, lr->initiator);
 }
 
 void wiphy_regulatory_deregister(struct wiphy *wiphy)
-- 
1.8.1.2


^ permalink raw reply related

* [PATCH 0/2] wil6210 checksum offload
From: Vladimir Kondratiev @ 2013-07-21  8:34 UTC (permalink / raw)
  To: John W . Linville
  Cc: Kirshenbaum Erez, Vladimir Kondratiev, linux-wireless,
	Luis R . Rodriguez, wil6210

Next ready for integration patches. This time, introduce checksum offload
by Erez. Other patch is pre-requisite for checksum patch, and for more
offload patches that are coming.

Kirshenbaum Erez (1):
  wil6210: Enable TCP/UDP checksum HW offload

Vladimir Kondratiev (1):
  wil6210: fix error path in wil_tx_vring

 drivers/net/wireless/ath/wil6210/netdev.c |  2 +
 drivers/net/wireless/ath/wil6210/txrx.c   | 83 +++++++++++++++++++++++++++++--
 drivers/net/wireless/ath/wil6210/txrx.h   | 20 +++++++-
 drivers/net/wireless/ath/wil6210/wmi.c    |  6 +++
 4 files changed, 105 insertions(+), 6 deletions(-)

-- 
1.8.1.2


^ permalink raw reply

* [PATCH 2/2] wil6210: Enable TCP/UDP checksum HW offload
From: Vladimir Kondratiev @ 2013-07-21  8:34 UTC (permalink / raw)
  To: John W . Linville
  Cc: Kirshenbaum Erez, linux-wireless, Luis R . Rodriguez, wil6210,
	Vladimir Kondratiev
In-Reply-To: <1374395677-16751-1-git-send-email-qca_vkondrat@qca.qualcomm.com>

From: Kirshenbaum Erez <erezk@wilocity.com>

Add support for TCP and UDP HW checksum offloading.
RX chain is allways configured for offload mode.
In case of checksum error in RX path the DMA L4 error bit(5)
will be set to 1 and driver will drop the packet.
TX checksum offloading is configrable (ethtool -K).
TX descriptors are configured for checksum offload according
to the SKB protocol type (TCP/UDP, IPV4/6), Upon mismatch drop
the TX packet (checksum required but not TCP/UDP IPV4/6 type).

Signed-off-by: Kirshenbaum Erez <erezk@wilocity.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/netdev.c |  2 +
 drivers/net/wireless/ath/wil6210/txrx.c   | 76 ++++++++++++++++++++++++++++++-
 drivers/net/wireless/ath/wil6210/txrx.h   | 20 +++++++-
 drivers/net/wireless/ath/wil6210/wmi.c    |  6 +++
 4 files changed, 101 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/netdev.c b/drivers/net/wireless/ath/wil6210/netdev.c
index 29dd1e5..717178f 100644
--- a/drivers/net/wireless/ath/wil6210/netdev.c
+++ b/drivers/net/wireless/ath/wil6210/netdev.c
@@ -127,6 +127,8 @@ void *wil_if_alloc(struct device *dev, void __iomem *csr)
 
 	ndev->netdev_ops = &wil_netdev_ops;
 	ndev->ieee80211_ptr = wdev;
+	ndev->hw_features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
+	ndev->features |= NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
 	SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy));
 	wdev->netdev = ndev;
 
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
index e563af1..ea1abeb 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -18,6 +18,9 @@
 #include <net/ieee80211_radiotap.h>
 #include <linux/if_arp.h>
 #include <linux/moduleparam.h>
+#include <linux/ip.h>
+#include <linux/ipv6.h>
+#include <net/ipv6.h>
 
 #include "wil6210.h"
 #include "wmi.h"
@@ -407,6 +410,21 @@ static struct sk_buff *wil_vring_reap_rx(struct wil6210_priv *wil,
 		return NULL;
 	}
 
+	/* L4 IDENT is on when HW calculated checksum, check status
+	 * and in case of error drop the packet
+	 * higher stack layers will handle retransmission (if required)
+	 */
+	if (d->dma.status & RX_DMA_STATUS_L4_IDENT) {
+		/* L4 protocol identified, csum calculated */
+		if ((d->dma.error & RX_DMA_ERROR_L4_ERR) == 0) {
+			skb->ip_summed = CHECKSUM_UNNECESSARY;
+		} else {
+			wil_err(wil, "Incorrect checksum reported\n");
+			kfree_skb(skb);
+			return NULL;
+		}
+	}
+
 	ds_bits = wil_rxdesc_ds_bits(d);
 	if (ds_bits == 1) {
 		/*
@@ -646,6 +664,53 @@ static int wil_tx_desc_map(struct vring_tx_desc *d, dma_addr_t pa, u32 len,
 	return 0;
 }
 
+static int wil_tx_desc_offload_cksum_set(struct wil6210_priv *wil,
+				struct vring_tx_desc *d,
+				struct sk_buff *skb)
+{
+	int protocol;
+
+	if (skb->ip_summed != CHECKSUM_PARTIAL)
+		return 0;
+
+	switch (skb->protocol) {
+	case cpu_to_be16(ETH_P_IP):
+		protocol = ip_hdr(skb)->protocol;
+		break;
+	case cpu_to_be16(ETH_P_IPV6):
+		protocol = ipv6_hdr(skb)->nexthdr;
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	switch (protocol) {
+	case IPPROTO_TCP:
+		d->dma.d0 |= (2 << DMA_CFG_DESC_TX_0_L4_TYPE_POS);
+		/* L4 header len: TCP header length */
+		d->dma.d0 |=
+		(tcp_hdrlen(skb) & DMA_CFG_DESC_TX_0_L4_LENGTH_MSK);
+		break;
+	case IPPROTO_UDP:
+		/* L4 header len: UDP header length */
+		d->dma.d0 |=
+		(sizeof(struct udphdr) & DMA_CFG_DESC_TX_0_L4_LENGTH_MSK);
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	d->dma.ip_length = skb_network_header_len(skb);
+	d->dma.b11 = ETH_HLEN; /* MAC header length */
+	d->dma.b11 |= BIT(DMA_CFG_DESC_TX_OFFLOAD_CFG_L3T_IPV4_POS);
+	/* Enable TCP/UDP checksum */
+	d->dma.d0 |= BIT(DMA_CFG_DESC_TX_0_TCP_UDP_CHECKSUM_EN_POS);
+	/* Calculate pseudo-header */
+	d->dma.d0 |= BIT(DMA_CFG_DESC_TX_0_PSEUDO_HEADER_CALC_EN_POS);
+
+	return 0;
+}
+
 static int wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
 			struct sk_buff *skb)
 {
@@ -655,7 +720,7 @@ static int wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
 	u32 swhead = vring->swhead;
 	int avail = wil_vring_avail_tx(vring);
 	int nr_frags = skb_shinfo(skb)->nr_frags;
-	uint f;
+	uint f = 0;
 	int vring_index = vring - wil->vring_tx;
 	uint i = swhead;
 	dma_addr_t pa;
@@ -686,13 +751,20 @@ static int wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
 		return -EINVAL;
 	/* 1-st segment */
 	wil_tx_desc_map(d, pa, skb_headlen(skb), vring_index);
+	/* Process TCP/UDP checksum offloading */
+	if (wil_tx_desc_offload_cksum_set(wil, d, skb)) {
+		wil_err(wil, "VRING #%d Failed to set cksum, drop packet\n",
+			vring_index);
+		goto dma_error;
+	}
+
 	d->mac.d[2] |= ((nr_frags + 1) <<
 		       MAC_CFG_DESC_TX_2_NUM_OF_DESCRIPTORS_POS);
 	if (nr_frags)
 		*_d = *d;
 
 	/* middle segments */
-	for (f = 0; f < nr_frags; f++) {
+	for (; f < nr_frags; f++) {
 		const struct skb_frag_struct *frag =
 				&skb_shinfo(skb)->frags[f];
 		int len = skb_frag_size(frag);
diff --git a/drivers/net/wireless/ath/wil6210/txrx.h b/drivers/net/wireless/ath/wil6210/txrx.h
index 859aea6..b382827 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.h
+++ b/drivers/net/wireless/ath/wil6210/txrx.h
@@ -235,7 +235,16 @@ struct vring_tx_mac {
 
 #define DMA_CFG_DESC_TX_0_L4_TYPE_POS 30
 #define DMA_CFG_DESC_TX_0_L4_TYPE_LEN 2
-#define DMA_CFG_DESC_TX_0_L4_TYPE_MSK 0xC0000000
+#define DMA_CFG_DESC_TX_0_L4_TYPE_MSK 0xC0000000 /* L4 type: 0-UDP, 2-TCP */
+
+
+#define DMA_CFG_DESC_TX_OFFLOAD_CFG_MAC_LEN_POS 0
+#define DMA_CFG_DESC_TX_OFFLOAD_CFG_MAC_LEN_LEN 7
+#define DMA_CFG_DESC_TX_OFFLOAD_CFG_MAC_LEN_MSK 0x7F /* MAC hdr len */
+
+#define DMA_CFG_DESC_TX_OFFLOAD_CFG_L3T_IPV4_POS 7
+#define DMA_CFG_DESC_TX_OFFLOAD_CFG_L3T_IPV4_LEN 1
+#define DMA_CFG_DESC_TX_OFFLOAD_CFG_L3T_IPV4_MSK 0x80 /* 1-IPv4, 0-IPv6 */
 
 
 #define TX_DMA_STATUS_DU         BIT(0)
@@ -334,8 +343,17 @@ struct vring_rx_mac {
 
 #define RX_DMA_D0_CMD_DMA_IT     BIT(10)
 
+/* Error field, offload bits */
+#define RX_DMA_ERROR_L3_ERR   BIT(4)
+#define RX_DMA_ERROR_L4_ERR   BIT(5)
+
+
+/* Status field */
 #define RX_DMA_STATUS_DU         BIT(0)
 #define RX_DMA_STATUS_ERROR      BIT(2)
+
+#define RX_DMA_STATUS_L3_IDENT   BIT(4)
+#define RX_DMA_STATUS_L4_IDENT   BIT(5)
 #define RX_DMA_STATUS_PHY_INFO   BIT(6)
 
 struct vring_rx_dma {
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index a62511a..5220f15 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -924,6 +924,12 @@ int wmi_rx_chain_add(struct wil6210_priv *wil, struct vring *vring)
 		cmd.sniffer_cfg.phy_support =
 			cpu_to_le32((wil->monitor_flags & MONITOR_FLAG_CONTROL)
 				    ? WMI_SNIFFER_CP : WMI_SNIFFER_DP);
+	} else {
+		/* Initialize offload (in non-sniffer mode).
+		 * Linux IP stack always calculates IP checksum
+		 * HW always calculate TCP/UDP checksum
+		 */
+		cmd.l3_l4_ctrl |= (1 << L3_L4_CTRL_TCPIP_CHECKSUM_EN_POS);
 	}
 	/* typical time for secure PCP is 840ms */
 	rc = wmi_call(wil, WMI_CFG_RX_CHAIN_CMDID, &cmd, sizeof(cmd),
-- 
1.8.1.2


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox