Netdev List
 help / color / mirror / Atom feed
* Re:
From: luiz.malaquias @ 2015-01-17 23:32 UTC (permalink / raw)
  To: Recipients

I have a business worth $24.5 for you to handle for me.

^ permalink raw reply

* Wireless scanning while turning off the radio problem..
From: Linus Torvalds @ 2015-01-18  3:25 UTC (permalink / raw)
  To: Johannes Berg, David Miller; +Cc: Linux Wireless List, Network Development

So there seems to be some issue with unlucky timing when turning off
wireless while the driver is busy scanning. I can't reproduce this, so
it's a one-off, but it's not just ugly warnings, the kernel woudln't
scan any wireless on that device afterwards and I had to reboot to get
networking back, so there is some long-term damage.

This is with Intel wireless (iwlwifi, it's a iwl N7260 thing, rev
0x144 if anybody cares) , but the warning callbacks don't seem to be
iwl-specific.

This was a recent top-of-git kernel (3.19.0-rc4-00241-gfc7f0dd38172 to
be exact).

Anybody have any ideas? Anything in particular I should try out to
help possibly get more information?

              Linus

---
[  204.361145] iwlwifi 0000:01:00.0: RF_KILL bit toggled to disable radio.
[  204.362358] ------------[ cut here ]------------
[  204.362383] WARNING: CPU: 0 PID: 37 at net/wireless/core.c:1011
cfg80211_netdev_notifier_call+0x491/0x500 [cfg80211]()
[  204.362385] Modules linked in: ccm rfcomm fuse ip6t_rpfilter
ip6t_REJECT nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6
nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ebtable_nat
ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_mangle
ip6table_security ip6table_raw ip6table_filter ip6_tables
iptable_mangle iptable_security iptable_raw bnep arc4 vfat fat
x86_pkg_temp_thermal pn544_mei mei_phy pn544 coretemp hci kvm_intel
nfc iTCO_wdt iTCO_vendor_support kvm iwlmvm uvcvideo
snd_hda_codec_realtek microcode snd_hda_codec_generic
snd_hda_codec_hdmi mac80211 videobuf2_vmalloc videobuf2_memops
videobuf2_core v4l2_common snd_hda_intel videodev snd_hda_controller
joydev btusb media hid_multitouch i2c_i801 snd_hda_codec serio_raw
iwlwifi bluetooth snd_hwdep snd_seq cfg80211 snd_seq_device
[  204.362432]  snd_pcm sony_laptop rfkill mei_me snd_timer mei snd
lpc_ich mfd_core shpchp soundcore dm_crypt i915 crct10dif_pclmul
crc32_pclmul crc32c_intel i2c_algo_bit ghash_clmulni_intel
drm_kms_helper drm i2c_core video
[  204.362453] CPU: 0 PID: 37 Comm: kworker/0:1 Not tainted
3.19.0-rc4-00241-gfc7f0dd38172 #14
[  204.362455] Hardware name: Sony Corporation SVP11213CXB/VAIO, BIOS
R0270V7 05/17/2013
[  204.362464] Workqueue: events cfg80211_rfkill_sync_work [cfg80211]
[  204.362467]  0000000000000000 ffffffffc0375870 ffffffff815eb39a
0000000000000000
[  204.362471]  ffffffff8106c357 ffff8800d3b12890 ffff8800d9e08260
0000000000000002
[  204.362475]  ffff8800d3b12000 ffff8800d9e08000 ffffffffc0350161
ffff8800d365dc00
[  204.362479] Call Trace:
[  204.362490]  [<ffffffff815eb39a>] ? dump_stack+0x40/0x50
[  204.362496]  [<ffffffff8106c357>] ? warn_slowpath_common+0x77/0xb0
[  204.362506]  [<ffffffffc0350161>] ?
cfg80211_netdev_notifier_call+0x491/0x500 [cfg80211]
[  204.362513]  [<ffffffff814f3769>] ? __dev_remove_pack+0x39/0xa0
[  204.362538]  [<ffffffff815d9d0c>] ? __unregister_prot_hook+0xcc/0xd0
[  204.362542]  [<ffffffff815da89c>] ? packet_notifier+0x15c/0x1b0
[  204.362549]  [<ffffffff81086e65>] ? notifier_call_chain+0x45/0x70
[  204.362552]  [<ffffffff814f41a9>] ? dev_close_many+0xb9/0x110
[  204.362556]  [<ffffffff814f65da>] ? dev_close.part.87+0x2a/0x40
[  204.362559]  [<ffffffff814f6609>] ? dev_close+0x19/0x20
[  204.362569]  [<ffffffffc034f76d>] ?
cfg80211_shutdown_all_interfaces+0x3d/0xb0 [cfg80211]
[  204.362577]  [<ffffffffc034f809>] ?
cfg80211_rfkill_sync_work+0x29/0x30 [cfg80211]
[  204.362580]  [<ffffffff81081335>] ? process_one_work+0x135/0x370
[  204.362585]  [<ffffffff8107e927>] ? pwq_activate_delayed_work+0x27/0x40
[  204.362589]  [<ffffffff810818c3>] ? worker_thread+0x63/0x480
[  204.362592]  [<ffffffff81081860>] ? rescuer_thread+0x2f0/0x2f0
[  204.362596]  [<ffffffff8108606e>] ? kthread+0xce/0xf0
[  204.362600]  [<ffffffff81085fa0>] ? kthread_create_on_node+0x180/0x180
[  204.362605]  [<ffffffff815f0eac>] ? ret_from_fork+0x7c/0xb0
[  204.362609]  [<ffffffff81085fa0>] ? kthread_create_on_node+0x180/0x180
[  204.362612] ---[ end trace d0ac2826f7d2747f ]---

[  204.362614] ------------[ cut here ]------------
[  204.362628] WARNING: CPU: 0 PID: 37 at net/mac80211/driver-ops.h:12
ieee80211_request_sched_scan_stop+0xdd/0xf0 [mac80211]()
[  204.362630] wlp1s0:  Failed check-sdata-in-driver check, flags: 0x4
[  204.362631] Modules linked in: ccm rfcomm fuse ip6t_rpfilter
ip6t_REJECT nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6
nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ebtable_nat
ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_mangle
ip6table_security ip6table_raw ip6table_filter ip6_tables
iptable_mangle iptable_security iptable_raw bnep arc4 vfat fat
x86_pkg_temp_thermal pn544_mei mei_phy pn544 coretemp hci kvm_intel
nfc iTCO_wdt iTCO_vendor_support kvm iwlmvm uvcvideo
snd_hda_codec_realtek microcode snd_hda_codec_generic
snd_hda_codec_hdmi mac80211 videobuf2_vmalloc videobuf2_memops
videobuf2_core v4l2_common snd_hda_intel videodev snd_hda_controller
joydev btusb media hid_multitouch i2c_i801 snd_hda_codec serio_raw
iwlwifi bluetooth snd_hwdep snd_seq cfg80211 snd_seq_device
[  204.362677]  snd_pcm sony_laptop rfkill mei_me snd_timer mei snd
lpc_ich mfd_core shpchp soundcore dm_crypt i915 crct10dif_pclmul
crc32_pclmul crc32c_intel i2c_algo_bit ghash_clmulni_intel
drm_kms_helper drm i2c_core video
[  204.362695] CPU: 0 PID: 37 Comm: kworker/0:1 Tainted: G        W
  3.19.0-rc4-00241-gfc7f0dd38172 #14
[  204.362697] Hardware name: Sony Corporation SVP11213CXB/VAIO, BIOS
R0270V7 05/17/2013
[  204.362703] Workqueue: events cfg80211_rfkill_sync_work [cfg80211]
[  204.362705]  0000000000000000 ffffffffc04e3491 ffffffff815eb39a
ffff88011a697c18
[  204.362709]  ffffffff8106c357 ffff8800d9e08660 ffff8800d3b12880
00000000fffffffb
[  204.362713]  ffff8800d9e09618 ffff8800d9e08000 ffffffff8106c3d5
ffffffffc04e0e78
[  204.362717] Call Trace:
[  204.362723]  [<ffffffff815eb39a>] ? dump_stack+0x40/0x50
[  204.362726]  [<ffffffff8106c357>] ? warn_slowpath_common+0x77/0xb0
[  204.362730]  [<ffffffff8106c3d5>] ? warn_slowpath_fmt+0x45/0x50
[  204.362743]  [<ffffffffc049374d>] ?
ieee80211_request_sched_scan_stop+0xdd/0xf0 [mac80211]
[  204.362755]  [<ffffffffc0357a33>] ?
__cfg80211_stop_sched_scan+0x73/0xb0 [cfg80211]
[  204.362763]  [<ffffffffc035016b>] ?
cfg80211_netdev_notifier_call+0x49b/0x500 [cfg80211]
[  204.362768]  [<ffffffff814f3769>] ? __dev_remove_pack+0x39/0xa0
[  204.362772]  [<ffffffff815d9d0c>] ? __unregister_prot_hook+0xcc/0xd0
[  204.362776]  [<ffffffff815da89c>] ? packet_notifier+0x15c/0x1b0
[  204.362781]  [<ffffffff81086e65>] ? notifier_call_chain+0x45/0x70
[  204.362785]  [<ffffffff814f41a9>] ? dev_close_many+0xb9/0x110
[  204.362788]  [<ffffffff814f65da>] ? dev_close.part.87+0x2a/0x40
[  204.362792]  [<ffffffff814f6609>] ? dev_close+0x19/0x20
[  204.362800]  [<ffffffffc034f76d>] ?
cfg80211_shutdown_all_interfaces+0x3d/0xb0 [cfg80211]
[  204.362807]  [<ffffffffc034f809>] ?
cfg80211_rfkill_sync_work+0x29/0x30 [cfg80211]
[  204.362811]  [<ffffffff81081335>] ? process_one_work+0x135/0x370
[  204.362815]  [<ffffffff8107e927>] ? pwq_activate_delayed_work+0x27/0x40
[  204.362819]  [<ffffffff810818c3>] ? worker_thread+0x63/0x480
[  204.362822]  [<ffffffff81081860>] ? rescuer_thread+0x2f0/0x2f0
[  204.362826]  [<ffffffff8108606e>] ? kthread+0xce/0xf0
[  204.362830]  [<ffffffff81085fa0>] ? kthread_create_on_node+0x180/0x180
[  204.362834]  [<ffffffff815f0eac>] ? ret_from_fork+0x7c/0xb0
[  204.362838]  [<ffffffff81085fa0>] ? kthread_create_on_node+0x180/0x180
[  204.362840] ---[ end trace d0ac2826f7d27480 ]---
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH net-next v2] bridge: fix setlink/dellink notifications
From: David Miller @ 2015-01-18  4:50 UTC (permalink / raw)
  To: roopa
  Cc: netdev, shemminger, vyasevic, john.fastabend, tgraf, jhs, sfeldma,
	jiri, wkok, ronen.arad
In-Reply-To: <1421294545-52467-1-git-send-email-roopa@cumulusnetworks.com>

From: roopa@cumulusnetworks.com
Date: Wed, 14 Jan 2015 20:02:25 -0800

> problems with bridge getlink/setlink notifications today:
>         - bridge setlink generates two notifications to userspace
>                 - one from the bridge driver
>                 - one from rtnetlink.c (rtnl_bridge_notify)
>         - dellink generates one notification from rtnetlink.c. Which
> 	means bridge setlink and dellink notifications are not
> 	consistent
> 
>         - Looking at the code it appears,
> 	If both BRIDGE_FLAGS_MASTER and BRIDGE_FLAGS_SELF were set,
>         the size calculation in rtnl_bridge_notify can be wrong.
>         Example: if you set both BRIDGE_FLAGS_MASTER and BRIDGE_FLAGS_SELF
>         in a setlink request to rocker dev, rtnl_bridge_notify will
> 	allocate skb for one set of bridge attributes, but,
> 	both the bridge driver and rocker dev will try to add
> 	attributes resulting in twice the number of attributes
> 	being added to the skb.  (rocker dev calls ndo_dflt_bridge_getlink)
> 
> There are multiple options:
> 1) Generate one notification including all attributes from master and self:
>    But, I don't think it will work, because both master and self may use
>    the same attributes/policy. Cannot pack the same set of attributes in a
>    single notification from both master and slave (duplicate attributes).
> 
> 2) Generate one notification from master and the other notification from
>    self (This seems to be ideal):
>      For master: the master driver will send notification (bridge in this
> 	example)
>      For self: the self driver will send notification (rocker in the above
> 	example. It can use helpers from rtnetlink.c to do so. Like the
> 	ndo_dflt_bridge_getlink api).
> 
> This patch implements 2) (leaving the 'rtnl_bridge_notify' around to be used
> with 'self').
...
> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>

Applied, thanks.

^ permalink raw reply

* Re: [patch net-next v5 1/2] tc: add BPF based action
From: David Miller @ 2015-01-18  4:51 UTC (permalink / raw)
  To: jiri; +Cc: netdev, jhs, dborkman, ast, hannes, gaofeng
In-Reply-To: <1421311960-14744-1-git-send-email-jiri@resnulli.us>

From: Jiri Pirko <jiri@resnulli.us>
Date: Thu, 15 Jan 2015 09:52:39 +0100

> This action provides a possibility to exec custom BPF code.
> 
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>

Applied.

^ permalink raw reply

* Re: [patch net-next v5 2/2] tc: cls_bpf: rename bpf_len to bpf_num_ops
From: David Miller @ 2015-01-18  4:51 UTC (permalink / raw)
  To: jiri; +Cc: netdev, jhs, dborkman, ast, hannes, gaofeng
In-Reply-To: <1421311960-14744-2-git-send-email-jiri@resnulli.us>

From: Jiri Pirko <jiri@resnulli.us>
Date: Thu, 15 Jan 2015 09:52:40 +0100

> It was suggested by DaveM to change the name as "len" might indicate
> unit bytes.
> 
> Suggested-by: David Miller <davem@davemloft.net>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
> Acked-by: Daniel Borkmann <dborkman@redhat.com>

Applied.

^ permalink raw reply

* Re: [PATCH net] net: sctp: fix race for one-to-many sockets in sendmsg's auto associate
From: David Miller @ 2015-01-18  4:53 UTC (permalink / raw)
  To: dborkman; +Cc: vyasevich, netdev, linux-sctp
In-Reply-To: <1421336075-25061-1-git-send-email-dborkman@redhat.com>

From: Daniel Borkmann <dborkman@redhat.com>
Date: Thu, 15 Jan 2015 16:34:35 +0100

 ...
> The fix defers waiting after sctp_primitive_ASSOCIATE() and
> sctp_primitive_SEND() succeeded, so that DATA chunks cooked up
> from sctp_sendmsg() have already been placed into the output
> queue through the side-effect interpreter, and therefore can then
> be bundeled together with COOKIE_ECHO control chunks.
 ...
> Looks like this bug is from the pre-git history museum. ;)
> 
> Fixes: 08707d5482df ("lksctp-2_5_31-0_5_1.patch")
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next 0/5] s390: network patches for net-next
From: David Miller @ 2015-01-18  4:55 UTC (permalink / raw)
  To: ubraun; +Cc: netdev, linux-s390, ursula.braun
In-Reply-To: <1421413549-56937-1-git-send-email-ubraun@linux.vnet.ibm.com>

From: Ursula Braun <ubraun@linux.vnet.ibm.com>
Date: Fri, 16 Jan 2015 14:05:44 +0100

> here are some s390 related patches for net-next

Series applied, thank you.

^ permalink raw reply

* Re: [PATCH net-next] socket: use ki_nbytes instead of iov_length()
From: David Miller @ 2015-01-18  4:58 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: viro, netdev
In-Reply-To: <1421415309-4639-1-git-send-email-nicolas.dichtel@6wind.com>

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Fri, 16 Jan 2015 14:35:09 +0100

> This field already contains the length of the iovec, no need to calculate it
> again.
> 
> Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] niu: remove one compound_head() call
From: David Miller @ 2015-01-18  4:59 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1421415570.11734.130.camel@edumazet-glaptop2.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 16 Jan 2015 05:39:30 -0800

> From: Eric Dumazet <edumazet@google.com>
> 
> After a "page = alloc_page(mask);", we do not need to use
> compound_head() : page already points to the right place.
> 
> This would be true even if using alloc_pages().
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied.

^ permalink raw reply

* [PATCH 0/7] net: wireless: wcn36xx: add basic wcn3620 support
From: Andy Green @ 2015-01-18  5:10 UTC (permalink / raw)
  To: Kalle Valo, Eugene Krasnikov
  Cc: wcn36xx-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA

The following series adds some basic wcn3620 support to the
mainline wcn36xx driver.

 - modify the chip detection to be told which chip from
   platform ops, which can get it from Device Tree... the
   existing detection is just assume it's a wcn3680 if it
   has AC mode which is not enough

 - Adapt the DXE register selection to use 3680 mode for
   3620 as well

 - Add a couple of async "indication" messages which can
   appear down smd on 3620, just accept and ignore

 - Accept a modified form of trigger_ba response that is
   sent by the wcn3620 firmware, if device is a 3620

 - Disable powersaving mode if 3620

With these the 3620 can associate and work for a while
before needing to be forcibly reassociated again.

It's tested on an msm8916-QRD "phone" dev platform that
includes wcn3620.

---

Andy Green (7):
      net: wireless: wcn36xx: add wcn3620 chip type definition
      net: wireless: wcn36xx: get chip type from platform ops
      net: wireless: wcn36xx: use 3680 dxe regs for 3620
      net: wireless: wcn36xx: introduce WCN36XX_HAL_AVOID_FREQ_RANGE_IND
      net: wireless: wcn36xx: swallow two wcn3620 IND messages
      net: wireless: wcn36xx: remove powersaving for wcn3620
      net: wireless: wcn36xx: handle new trigger_ba format


 drivers/net/wireless/ath/wcn36xx/dxe.c     |    2 +-
 drivers/net/wireless/ath/wcn36xx/hal.h     |    2 ++
 drivers/net/wireless/ath/wcn36xx/main.c    |   22 +++++++-----------
 drivers/net/wireless/ath/wcn36xx/smd.c     |   34 ++++++++++++++++++++++++++--
 drivers/net/wireless/ath/wcn36xx/smd.h     |    9 +++++++
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h |   13 +++++++----
 6 files changed, 62 insertions(+), 20 deletions(-)

--
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH 1/7] net: wireless: wcn36xx: add wcn3620 chip type definition
From: Andy Green @ 2015-01-18  5:10 UTC (permalink / raw)
  To: Kalle Valo, Eugene Krasnikov
  Cc: wcn36xx-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20150118050741.31866.36490.stgit-FDDIDLfWL9/T9rR/E2HzMujRB4CPm7EUkgzjau31qRg@public.gmane.org>

Convert the list of chip types to an enum, add the default
UNKNOWN type and a type for WCN3620 chip

Signed-off-by: Andy Green <andy.green-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
index f0fb81d..a5366b6 100644
--- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
+++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
@@ -93,6 +93,13 @@ struct nv_data {
 	u8	table;
 };
 
+enum wcn36xx_chip_type {
+	WCN36XX_CHIP_UNKNOWN,
+	WCN36XX_CHIP_3660,
+	WCN36XX_CHIP_3680,
+	WCN36XX_CHIP_3620,
+};
+
 /* Interface for platform control path
  *
  * @open: hook must be called when wcn36xx wants to open control channel.
@@ -179,7 +186,7 @@ struct wcn36xx {
 	u8			fw_minor;
 	u8			fw_major;
 	u32			fw_feat_caps[WCN36XX_HAL_CAPS_SIZE];
-	u32			chip_version;
+	enum wcn36xx_chip_type	chip_version;
 
 	/* extra byte for the NULL termination */
 	u8			crm_version[WCN36XX_HAL_VERSION_LENGTH + 1];
@@ -227,9 +234,6 @@ struct wcn36xx {
 
 };
 
-#define WCN36XX_CHIP_3660	0
-#define WCN36XX_CHIP_3680	1

^ permalink raw reply related

* [PATCH 2/7] net: wireless: wcn36xx: get chip type from platform ops
From: Andy Green @ 2015-01-18  5:10 UTC (permalink / raw)
  To: Kalle Valo, Eugene Krasnikov; +Cc: wcn36xx, linux-wireless, netdev
In-Reply-To: <20150118050741.31866.36490.stgit@114-36-241-182.dynamic.hinet.net>

Autodetecting the chip type does not work well.
Stop attempting to do it and require a platform op
that tells us what the chip is.

Signed-off-by: Andy Green <andy.green@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/main.c    |   18 +++++-------------
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h |    1 +
 2 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index 7dd8873..c4178c7 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -221,17 +221,6 @@ static void wcn36xx_feat_caps_info(struct wcn36xx *wcn)
 	}
 }
 
-static void wcn36xx_detect_chip_version(struct wcn36xx *wcn)
-{
-	if (get_feat_caps(wcn->fw_feat_caps, DOT11AC)) {
-		wcn36xx_info("Chip is 3680\n");
-		wcn->chip_version = WCN36XX_CHIP_3680;
-	} else {
-		wcn36xx_info("Chip is 3660\n");
-		wcn->chip_version = WCN36XX_CHIP_3660;
-	}
-}
-
 static int wcn36xx_start(struct ieee80211_hw *hw)
 {
 	struct wcn36xx *wcn = hw->priv;
@@ -286,8 +275,6 @@ static int wcn36xx_start(struct ieee80211_hw *hw)
 			wcn36xx_feat_caps_info(wcn);
 	}
 
-	wcn36xx_detect_chip_version(wcn);
-
 	/* DMA channel initialization */
 	ret = wcn36xx_dxe_init(wcn);
 	if (ret) {
@@ -1023,6 +1010,11 @@ static int wcn36xx_probe(struct platform_device *pdev)
 	wcn->hw = hw;
 	wcn->dev = &pdev->dev;
 	wcn->ctrl_ops = pdev->dev.platform_data;
+	if (!wcn->ctrl_ops->get_chip_type) {
+		dev_err(&pdev->dev, "Missing ops->get_chip_type\n");
+		return -EINVAL;
+	}
+	wcn->chip_version = wcn->ctrl_ops->get_chip_type();
 
 	mutex_init(&wcn->hal_mutex);
 
diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
index a5366b6..04793c6 100644
--- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
+++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
@@ -110,6 +110,7 @@ struct wcn36xx_platform_ctrl_ops {
 	void (*close)(void);
 	int (*tx)(char *buf, size_t len);
 	int (*get_hw_mac)(u8 *addr);
+	int (*get_chip_type)(void);
 	int (*smsm_change_state)(u32 clear_mask, u32 set_mask);
 };
 

^ permalink raw reply related

* [PATCH 3/7] net: wireless: wcn36xx: use 3680 dxe regs for 3620
From: Andy Green @ 2015-01-18  5:10 UTC (permalink / raw)
  To: Kalle Valo, Eugene Krasnikov; +Cc: wcn36xx, linux-wireless, netdev
In-Reply-To: <20150118050741.31866.36490.stgit@114-36-241-182.dynamic.hinet.net>

Between 3620, 3660 and 3680, only 3660 has a different dxe register

Signed-off-by: Andy Green <andy.green@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/dxe.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c
index 73f12f1..334f265 100644
--- a/drivers/net/wireless/ath/wcn36xx/dxe.c
+++ b/drivers/net/wireless/ath/wcn36xx/dxe.c
@@ -46,7 +46,7 @@ static void wcn36xx_dxe_write_register(struct wcn36xx *wcn, int addr, int data)
 
 #define wcn36xx_dxe_write_register_x(wcn, reg, reg_data)		 \
 do {									 \
-	if (wcn->chip_version == WCN36XX_CHIP_3680)			 \
+	if (wcn->chip_version != WCN36XX_CHIP_3660)			 \
 		wcn36xx_dxe_write_register(wcn, reg ## _3680, reg_data); \
 	else								 \
 		wcn36xx_dxe_write_register(wcn, reg ## _3660, reg_data); \

^ permalink raw reply related

* [PATCH 4/7] net: wireless: wcn36xx: introduce WCN36XX_HAL_AVOID_FREQ_RANGE_IND
From: Andy Green @ 2015-01-18  5:11 UTC (permalink / raw)
  To: Kalle Valo, Eugene Krasnikov; +Cc: wcn36xx, linux-wireless, netdev
In-Reply-To: <20150118050741.31866.36490.stgit@114-36-241-182.dynamic.hinet.net>

WCN3620 firmware introduces a new async indication, we need to
add it as a known message type so we can accept it

Signed-off-by: Andy Green <andy.green@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/hal.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h
index a1f1127..b947de0 100644
--- a/drivers/net/wireless/ath/wcn36xx/hal.h
+++ b/drivers/net/wireless/ath/wcn36xx/hal.h
@@ -345,6 +345,8 @@ enum wcn36xx_hal_host_msg_type {
 	WCN36XX_HAL_DHCP_START_IND = 189,
 	WCN36XX_HAL_DHCP_STOP_IND = 190,
 
+	WCN36XX_HAL_AVOID_FREQ_RANGE_IND = 233,
+
 	WCN36XX_HAL_MSG_MAX = WCN36XX_HAL_MSG_TYPE_MAX_ENUM_SIZE
 };
 

^ permalink raw reply related

* [PATCH 5/7] net: wireless: wcn36xx: swallow two wcn3620 IND messages
From: Andy Green @ 2015-01-18  5:11 UTC (permalink / raw)
  To: Kalle Valo, Eugene Krasnikov; +Cc: wcn36xx, linux-wireless, netdev
In-Reply-To: <20150118050741.31866.36490.stgit@114-36-241-182.dynamic.hinet.net>

WCN3620 can asynchronously send two new kinds of indication message,
since we can't handle them just accept them quietly.

Signed-off-by: Andy Green <andy.green@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 6398693..819741c 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -2061,6 +2061,8 @@ static void wcn36xx_smd_rsp_process(struct wcn36xx *wcn, void *buf, size_t len)
 		complete(&wcn->hal_rsp_compl);
 		break;
 
+	case WCN36XX_HAL_COEX_IND:
+	case WCN36XX_HAL_AVOID_FREQ_RANGE_IND:
 	case WCN36XX_HAL_OTA_TX_COMPL_IND:
 	case WCN36XX_HAL_MISSED_BEACON_IND:
 	case WCN36XX_HAL_DELETE_STA_CONTEXT_IND:
@@ -2107,6 +2109,10 @@ static void wcn36xx_ind_smd_work(struct work_struct *work)
 	msg_header = (struct wcn36xx_hal_msg_header *)hal_ind_msg->msg;
 
 	switch (msg_header->msg_type) {
+	case WCN36XX_HAL_COEX_IND:
+		break;
+	case WCN36XX_HAL_AVOID_FREQ_RANGE_IND:
+		break;
 	case WCN36XX_HAL_OTA_TX_COMPL_IND:
 		wcn36xx_smd_tx_compl_ind(wcn,
 					 hal_ind_msg->msg,

^ permalink raw reply related

* [PATCH 6/7] net: wireless: wcn36xx: remove powersaving for wcn3620
From: Andy Green @ 2015-01-18  5:11 UTC (permalink / raw)
  To: Kalle Valo, Eugene Krasnikov; +Cc: wcn36xx, linux-wireless, netdev
In-Reply-To: <20150118050741.31866.36490.stgit@114-36-241-182.dynamic.hinet.net>

WCN3620 powersaving mode is not stable.  Disable it if we're
on a wcn3620 chip type.

Signed-off-by: Andy Green <andy.green@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/main.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index c4178c7..569d45b 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -924,6 +924,10 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn)
 		IEEE80211_HW_AMPDU_AGGREGATION |
 		IEEE80211_HW_TIMING_BEACON_ONLY;
 
+	/* 3620 powersaving currently unstable */
+	if (wcn->chip_version == WCN36XX_CHIP_3620)
+		wcn->hw->flags &= ~IEEE80211_HW_SUPPORTS_PS;
+
 	wcn->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
 		BIT(NL80211_IFTYPE_AP) |
 		BIT(NL80211_IFTYPE_ADHOC) |

^ permalink raw reply related

* [PATCH 7/7] net: wireless: wcn36xx: handle new trigger_ba format
From: Andy Green @ 2015-01-18  5:11 UTC (permalink / raw)
  To: Kalle Valo, Eugene Krasnikov; +Cc: wcn36xx, linux-wireless, netdev
In-Reply-To: <20150118050741.31866.36490.stgit@114-36-241-182.dynamic.hinet.net>

wcn3620 has a new message structure for the reply to trigger_ba
We don't know what to do with the candidate list he sends back,
but we can at least accept and ignore it nicely instead of dying.

Signed-off-by: Andy Green <andy.green@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/smd.c |   28 ++++++++++++++++++++++++++--
 drivers/net/wireless/ath/wcn36xx/smd.h |    9 +++++++++
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 819741c..dc24e1b 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -243,8 +243,31 @@ static int wcn36xx_smd_rsp_status_check(void *buf, size_t len)
 	rsp = (struct wcn36xx_fw_msg_status_rsp *)
 		(buf + sizeof(struct wcn36xx_hal_msg_header));
 
-	if (WCN36XX_FW_MSG_RESULT_SUCCESS != rsp->status)
+	if (WCN36XX_FW_MSG_RESULT_SUCCESS != rsp->status) {
+		pr_err("%s: bad status, len = %d\n", __func__, len);
+		return rsp->status;
+	}
+
+	return 0;
+}
+
+static int wcn36xx_smd_rsp_status_check_bav2(struct wcn36xx *wcn, void *buf,
+					     size_t len)
+{
+	struct wcn36xx_fw_msg_status_rspv2 *rsp;
+
+	if (wcn->chip_version != WCN36XX_CHIP_3620)
+		return wcn36xx_smd_rsp_status_check(buf, len);
+
+	if (len < sizeof(struct wcn36xx_hal_msg_header) + sizeof(*rsp))
+		return -EIO;
+
+	rsp = buf + sizeof(struct wcn36xx_hal_msg_header);
+
+	if (WCN36XX_FW_MSG_RESULT_SUCCESS != rsp->status) {
+		pr_err("%s: bad status, len = %d\n", __func__, len);
 		return rsp->status;
+	}
 
 	return 0;
 }
@@ -1884,7 +1907,8 @@ int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 sta_index)
 		wcn36xx_err("Sending hal_trigger_ba failed\n");
 		goto out;
 	}
-	ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len);
+	ret = wcn36xx_smd_rsp_status_check_bav2(wcn, wcn->hal_buf,
+						wcn->hal_rsp_len);
 	if (ret) {
 		wcn36xx_err("hal_trigger_ba response failed err=%d\n", ret);
 		goto out;
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h
index 008d034..432d3b8 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.h
+++ b/drivers/net/wireless/ath/wcn36xx/smd.h
@@ -44,6 +44,15 @@ struct wcn36xx_fw_msg_status_rsp {
 	u32	status;
 } __packed;
 
+/* wcn3620 returns this for tigger_ba */
+
+struct wcn36xx_fw_msg_status_rspv2 {
+	u8	bss_id[6];
+	u32	status __packed;
+	u16	count_following_candidates __packed;
+	/* candidate list follows */
+};
+
 struct wcn36xx_hal_ind_msg {
 	struct list_head list;
 	u8 *msg;

^ permalink raw reply related

* [PATCH 0/2] net: wireless: wcn36xx: OOT platform reference patch for msm8916 / wcn36xx
From: Andy Green @ 2015-01-18  5:16 UTC (permalink / raw)
  To: Kalle Valo, Eugene Krasnikov; +Cc: wcn36xx, linux-wireless, netdev

These patches are not intended for upstreaming.  They are
included as a reference to show how to hook up wcn36xx to
msm platforms using the OOT PIL support needed.

The following series adds Eugene's OOT msm platform shim to
wcn36xx and modifies it to provide wcn36xx platform data
about chip type from Device Tree.

It's useful as an example for how to implement on msm
platforms that do not have all the necessary support
upstreamed yet.

This was tested on msm8916-QRD "phone" dev platform.

---

Andy Green (1):
      net wireless wcn36xx adapt wcnss platform to select module by DT

Eugene Krasnikov (1):
      net wireless wcn36xx add wcnss platform code


 drivers/net/wireless/ath/wcn36xx/Makefile      |    2 
 drivers/net/wireless/ath/wcn36xx/wcn36xx-msm.c |  360 ++++++++++++++++++++++++
 2 files changed, 361 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/wireless/ath/wcn36xx/wcn36xx-msm.c

--

^ permalink raw reply

* [PATCH 1/2] net wireless wcn36xx add wcnss platform code
From: Andy Green @ 2015-01-18  5:16 UTC (permalink / raw)
  To: Kalle Valo, Eugene Krasnikov; +Cc: wcn36xx, linux-wireless, netdev
In-Reply-To: <20150118051222.32019.32719.stgit@114-36-241-182.dynamic.hinet.net>

From: Eugene Krasnikov <k.eugene.e@gmail.com>

AG modified to remove regulator handling not needed on msm8916-qrd

Signed-off-by: Eugene Krasnikov <k.eugene.e@gmail.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/Makefile      |    2 
 drivers/net/wireless/ath/wcn36xx/wcn36xx-msm.c |  357 ++++++++++++++++++++++++
 2 files changed, 358 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/wireless/ath/wcn36xx/wcn36xx-msm.c

diff --git a/drivers/net/wireless/ath/wcn36xx/Makefile b/drivers/net/wireless/ath/wcn36xx/Makefile
index 50c43b4..e889f2c 100644
--- a/drivers/net/wireless/ath/wcn36xx/Makefile
+++ b/drivers/net/wireless/ath/wcn36xx/Makefile
@@ -1,4 +1,4 @@
-obj-$(CONFIG_WCN36XX) := wcn36xx.o
+obj-$(CONFIG_WCN36XX) := wcn36xx.o wcn36xx-msm.o
 wcn36xx-y +=   main.o \
                dxe.o \
                txrx.o \
diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx-msm.c b/drivers/net/wireless/ath/wcn36xx/wcn36xx-msm.c
new file mode 100644
index 0000000..f6f6c83
--- /dev/null
+++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx-msm.c
@@ -0,0 +1,357 @@
+/*
+ * Copyright (c) 2013 Eugene Krasnikov <k.eugene.e@gmail.com>
+ * Copyright (c) 2013 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.
+ */
+
+#include <linux/completion.h>
+#include <linux/firmware.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/workqueue.h>
+#include <soc/qcom/smd.h>
+#include <soc/qcom/smsm.h>
+#include "wcn36xx.h"
+
+#include <soc/qcom/subsystem_restart.h>
+#include <soc/qcom/subsystem_notif.h>
+
+#define MAC_ADDR_0 "wlan/macaddr0"
+
+static void *pil;
+
+struct wcn36xx_msm {
+	struct wcn36xx_platform_ctrl_ops ctrl_ops;
+	struct platform_device *core;
+	void *drv_priv;
+	void (*rsp_cb)(void *drv_priv, void *buf, size_t len);
+	/* SMD related */
+	struct workqueue_struct	*wq;
+	struct work_struct	smd_work;
+	struct completion	smd_compl;
+	smd_channel_t		*smd_ch;
+	struct pinctrl *pinctrl;
+} wmsm;
+
+static int wcn36xx_msm_smsm_change_state(u32 clear_mask, u32 set_mask)
+{
+	 return smsm_change_state(SMSM_APPS_STATE, clear_mask, set_mask);
+}
+
+static int wcn36xx_msm_get_hw_mac(u8 *addr)
+{
+	const struct firmware *addr_file = NULL;
+	int status;
+	u8 tmp[18];
+	static const u8 qcom_oui[3] = {0x00, 0x0A, 0xF5};
+	static const char *files = {MAC_ADDR_0};
+
+	status = request_firmware(&addr_file, files, &wmsm.core->dev);
+
+	if (status < 0) {
+		/* Assign a random mac with Qualcomm oui */
+		dev_err(&wmsm.core->dev, "Failed (%d) to read macaddress file %s, using a random address instead", status,
+			     files);
+		memcpy(addr, qcom_oui, 3);
+		get_random_bytes(addr + 3, 3);
+	} else {
+		memset(tmp, 0, sizeof(tmp));
+		memcpy(tmp, addr_file->data, sizeof(tmp) - 1);
+		sscanf(tmp, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
+		       &addr[0],
+		       &addr[1],
+		       &addr[2],
+		       &addr[3],
+		       &addr[4],
+		       &addr[5]);
+
+		release_firmware(addr_file);
+	}
+
+	return 0;
+}
+
+static int wcn36xx_msm_smd_send_and_wait(char *buf, size_t len)
+{
+	int avail;
+	int ret = 0;
+
+	avail = smd_write_avail(wmsm.smd_ch);
+
+	if (avail >= len) {
+		avail = smd_write(wmsm.smd_ch, buf, len);
+		if (avail != len) {
+			dev_err(&wmsm.core->dev,
+				"Cannot write to SMD channel\n");
+			ret = -EAGAIN;
+			goto out;
+		}
+	} else {
+		dev_err(&wmsm.core->dev,
+			"SMD channel can accept only %d bytes\n", avail);
+		ret = -ENOMEM;
+		goto out;
+	}
+
+out:
+	return ret;
+}
+
+static void wcn36xx_msm_smd_notify(void *data, unsigned event)
+{
+	struct wcn36xx_msm *wmsm_priv = (struct wcn36xx_msm *)data;
+
+	switch (event) {
+	case SMD_EVENT_OPEN:
+		complete(&wmsm_priv->smd_compl);
+		break;
+	case SMD_EVENT_DATA:
+		queue_work(wmsm_priv->wq, &wmsm_priv->smd_work);
+		break;
+	case SMD_EVENT_CLOSE:
+		break;
+	case SMD_EVENT_STATUS:
+		break;
+	case SMD_EVENT_REOPEN_READY:
+		break;
+	default:
+		dev_err(&wmsm_priv->core->dev,
+			"%s: SMD_EVENT (%d) not supported\n", __func__, event);
+		break;
+	}
+}
+
+static void wcn36xx_msm_smd_work(struct work_struct *work)
+{
+	int avail;
+	int msg_len;
+	void *msg;
+	int ret;
+	struct wcn36xx_msm *wmsm_priv =
+		container_of(work, struct wcn36xx_msm, smd_work);
+
+	while (1) {
+		msg_len = smd_cur_packet_size(wmsm_priv->smd_ch);
+		if (0 == msg_len) {
+			return;
+		}
+		avail = smd_read_avail(wmsm_priv->smd_ch);
+		if (avail < msg_len) {
+			return;
+		}
+		msg = kmalloc(msg_len, GFP_KERNEL);
+		if (NULL == msg) {
+			return;
+		}
+
+		ret = smd_read(wmsm_priv->smd_ch, msg, msg_len);
+		if (ret != msg_len) {
+			return;
+		}
+		wmsm_priv->rsp_cb(wmsm_priv->drv_priv, msg, msg_len);
+		kfree(msg);
+	}
+}
+
+int wcn36xx_msm_smd_open(void *drv_priv, void *rsp_cb)
+{
+	int ret, left;
+	wmsm.drv_priv = drv_priv;
+	wmsm.rsp_cb = rsp_cb;
+	INIT_WORK(&wmsm.smd_work, wcn36xx_msm_smd_work);
+	init_completion(&wmsm.smd_compl);
+
+	wmsm.wq = create_workqueue("wcn36xx_msm_smd_wq");
+	if (!wmsm.wq) {
+		dev_err(&wmsm.core->dev, "failed to allocate wq");
+		ret = -ENOMEM;
+		return ret;
+	}
+
+	ret = smd_named_open_on_edge("WLAN_CTRL", SMD_APPS_WCNSS,
+		&wmsm.smd_ch, &wmsm, wcn36xx_msm_smd_notify);
+	if (ret) {
+		dev_err(&wmsm.core->dev,
+			"smd_named_open_on_edge failed: %d\n", ret);
+		return ret;
+	}
+
+	left = wait_for_completion_interruptible_timeout(&wmsm.smd_compl,
+		msecs_to_jiffies(HAL_MSG_TIMEOUT));
+	if (left <= 0) {
+		dev_err(&wmsm.core->dev,
+			"timeout waiting for smd open: %d\n", ret);
+		return left;
+	}
+
+	/* Not to receive INT until the whole buf from SMD is read */
+	smd_disable_read_intr(wmsm.smd_ch);
+
+	return 0;
+}
+
+void wcn36xx_msm_smd_close(void)
+{
+	smd_close(wmsm.smd_ch);
+	flush_workqueue(wmsm.wq);
+	destroy_workqueue(wmsm.wq);
+}
+
+int wcn36xx_msm_shutdown(const struct subsys_desc *desc, bool force_stop)
+{
+	return 0;
+}
+int wcn36xx_msm_powerup(const struct subsys_desc *desc)
+{
+	return 0;
+}
+
+static int wcn36xx_msm_probe(struct platform_device *pdev)
+{
+	int ret;
+	struct resource *wcnss_memory;
+	struct resource *tx_irq;
+	struct resource *rx_irq;
+	struct resource res[3];
+	struct pinctrl_state *ps;
+
+	wmsm.pinctrl = devm_pinctrl_get(&pdev->dev);
+	if (IS_ERR_OR_NULL(wmsm.pinctrl))
+		return PTR_ERR(wmsm.pinctrl);
+
+	ps = pinctrl_lookup_state(wmsm.pinctrl, "wcnss_default");
+	if (IS_ERR_OR_NULL(ps))
+			return PTR_ERR(ps);
+
+	ret = pinctrl_select_state(wmsm.pinctrl, ps);
+	if (ret)
+		return ret;
+
+	if (IS_ERR_OR_NULL(pil))
+		pil = subsystem_get("wcnss");
+		if (IS_ERR_OR_NULL(pil))
+			return PTR_ERR(pil);
+
+	wmsm.core = platform_device_alloc("wcn36xx", -1);
+
+	//dev_err(&pdev->dev, "%s starting\n", __func__);
+
+	memset(res, 0x00, sizeof(res));
+	wmsm.ctrl_ops.open = wcn36xx_msm_smd_open;
+	wmsm.ctrl_ops.close = wcn36xx_msm_smd_close;
+	wmsm.ctrl_ops.tx = wcn36xx_msm_smd_send_and_wait;
+	wmsm.ctrl_ops.get_hw_mac = wcn36xx_msm_get_hw_mac;
+	wmsm.ctrl_ops.smsm_change_state = wcn36xx_msm_smsm_change_state;
+	wcnss_memory =
+		platform_get_resource_byname(pdev,
+					      IORESOURCE_MEM,
+					      "wcnss_mmio");
+	if (wcnss_memory == NULL) {
+		dev_err(&wmsm.core->dev,
+			"Failed to get wcnss wlan memory map.\n");
+		ret = -ENOMEM;
+		return ret;
+	}
+	memcpy(&res[0], wcnss_memory, sizeof(*wcnss_memory));
+
+	tx_irq = platform_get_resource_byname(pdev,
+					      IORESOURCE_IRQ,
+					      "wcnss_wlantx_irq");
+	if (tx_irq == NULL) {
+		dev_err(&wmsm.core->dev, "Failed to get wcnss tx_irq");
+		ret = -ENOMEM;
+		return ret;
+	}
+	memcpy(&res[1], tx_irq, sizeof(*tx_irq));
+
+	rx_irq = platform_get_resource_byname(pdev,
+					      IORESOURCE_IRQ,
+					      "wcnss_wlanrx_irq");
+	if (rx_irq == NULL) {
+		dev_err(&wmsm.core->dev, "Failed to get wcnss rx_irq");
+		ret = -ENOMEM;
+		return ret;
+	}
+	memcpy(&res[2], rx_irq, sizeof(*rx_irq));
+
+	platform_device_add_resources(wmsm.core, res, ARRAY_SIZE(res));
+
+	ret = platform_device_add_data(wmsm.core, &wmsm.ctrl_ops,
+				       sizeof(wmsm.ctrl_ops));
+	if (ret) {
+		dev_err(&wmsm.core->dev, "Can't add platform data\n");
+		ret = -ENOMEM;
+		return ret;
+	}
+
+	platform_device_add(wmsm.core);
+
+	dev_info(&pdev->dev, "%s initialized\n", __func__);
+
+	return 0;
+}
+static int wcn36xx_msm_remove(struct platform_device *pdev)
+{
+        struct pinctrl_state *ps;
+
+	platform_device_del(wmsm.core);
+	platform_device_put(wmsm.core);
+
+	if (wmsm.pinctrl) {
+		ps = pinctrl_lookup_state(wmsm.pinctrl, "wcnss_sleep");
+		if (IS_ERR_OR_NULL(ps))
+			return PTR_ERR(ps);
+
+		pinctrl_select_state(wmsm.pinctrl, ps);
+	}
+
+	return 0;
+}
+
+static const struct of_device_id wcn36xx_msm_match_table[] = {
+	{ .compatible = "qcom,wcn36xx" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, wcn36xx_msm_match_table);
+
+static struct platform_driver wcn36xx_msm_driver = {
+	.probe		= wcn36xx_msm_probe,
+	.remove		= wcn36xx_msm_remove,
+	.driver		= {
+		.name	= "wcn36xx-msm",
+		.owner	= THIS_MODULE,
+		.of_match_table = wcn36xx_msm_match_table,
+	},
+};
+
+static int __init wcn36xx_msm_init(void)
+{
+	return platform_driver_register(&wcn36xx_msm_driver);
+}
+module_init(wcn36xx_msm_init);
+
+static void __exit wcn36xx_msm_exit(void)
+{
+	platform_driver_unregister(&wcn36xx_msm_driver);
+	if (pil)
+		subsystem_put(pil);
+
+
+}
+module_exit(wcn36xx_msm_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Eugene Krasnikov k.eugene.e@gmail.com");
+MODULE_FIRMWARE(MAC_ADDR_0);
+

^ permalink raw reply related

* [PATCH 2/2] net wireless wcn36xx adapt wcnss platform to select module by DT
From: Andy Green @ 2015-01-18  5:16 UTC (permalink / raw)
  To: Kalle Valo, Eugene Krasnikov; +Cc: wcn36xx, linux-wireless, netdev
In-Reply-To: <20150118051222.32019.32719.stgit@114-36-241-182.dynamic.hinet.net>

Simplify the resource handling and use DT to indicate which chip type
we are dealing with

Signed-off-by: Andy Green <andy.green@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/wcn36xx-msm.c |  101 ++++++++++++------------
 1 file changed, 52 insertions(+), 49 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx-msm.c b/drivers/net/wireless/ath/wcn36xx/wcn36xx-msm.c
index f6f6c83..c9250e0 100644
--- a/drivers/net/wireless/ath/wcn36xx/wcn36xx-msm.c
+++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx-msm.c
@@ -42,7 +42,10 @@ struct wcn36xx_msm {
 	struct completion	smd_compl;
 	smd_channel_t		*smd_ch;
 	struct pinctrl *pinctrl;
-} wmsm;
+	enum wcn36xx_chip_type chip_type;
+};
+
+static struct wcn36xx_msm wmsm;
 
 static int wcn36xx_msm_smsm_change_state(u32 clear_mask, u32 set_mask)
 {
@@ -217,14 +220,47 @@ int wcn36xx_msm_powerup(const struct subsys_desc *desc)
 	return 0;
 }
 
+static const struct of_device_id wcn36xx_msm_match_table[] = {
+	{ .compatible = "qcom,wcn3660", .data = (void *)WCN36XX_CHIP_3660 },
+	{ .compatible = "qcom,wcn3680", .data = (void *)WCN36XX_CHIP_3680 },
+	{ .compatible = "qcom,wcn3620", .data = (void *)WCN36XX_CHIP_3620 },
+	{ }
+};
+
+static int wcn36xx_msm_get_chip_type(void)
+{
+	return wmsm.chip_type;
+}
+
+static struct wcn36xx_msm wmsm = {
+	.ctrl_ops = {
+		.open = wcn36xx_msm_smd_open,
+		.close = wcn36xx_msm_smd_close,
+		.tx = wcn36xx_msm_smd_send_and_wait,
+		.get_hw_mac = wcn36xx_msm_get_hw_mac,
+		.smsm_change_state = wcn36xx_msm_smsm_change_state,
+		.get_chip_type = wcn36xx_msm_get_chip_type,
+	},
+};
+
 static int wcn36xx_msm_probe(struct platform_device *pdev)
 {
 	int ret;
-	struct resource *wcnss_memory;
-	struct resource *tx_irq;
-	struct resource *rx_irq;
+	const struct of_device_id *of_id;
+	struct resource *r;
 	struct resource res[3];
 	struct pinctrl_state *ps;
+	static const char const *rnames[] = {
+		"wcnss_mmio", "wcnss_wlantx_irq", "wcnss_wlanrx_irq" };
+	static const int rtype[] = {
+		IORESOURCE_MEM, IORESOURCE_IRQ, IORESOURCE_IRQ };
+	int n;
+
+	of_id = of_match_node(wcn36xx_msm_match_table, pdev->dev.of_node);
+	if (!of_id)
+		return -EINVAL;
+
+	wmsm.chip_type = (enum wcn36xx_chip_type)of_id->data;
 
 	wmsm.pinctrl = devm_pinctrl_get(&pdev->dev);
 	if (IS_ERR_OR_NULL(wmsm.pinctrl))
@@ -240,52 +276,23 @@ static int wcn36xx_msm_probe(struct platform_device *pdev)
 
 	if (IS_ERR_OR_NULL(pil))
 		pil = subsystem_get("wcnss");
-		if (IS_ERR_OR_NULL(pil))
-			return PTR_ERR(pil);
+	if (IS_ERR_OR_NULL(pil))
+		return PTR_ERR(pil);
 
 	wmsm.core = platform_device_alloc("wcn36xx", -1);
 
-	//dev_err(&pdev->dev, "%s starting\n", __func__);
-
-	memset(res, 0x00, sizeof(res));
-	wmsm.ctrl_ops.open = wcn36xx_msm_smd_open;
-	wmsm.ctrl_ops.close = wcn36xx_msm_smd_close;
-	wmsm.ctrl_ops.tx = wcn36xx_msm_smd_send_and_wait;
-	wmsm.ctrl_ops.get_hw_mac = wcn36xx_msm_get_hw_mac;
-	wmsm.ctrl_ops.smsm_change_state = wcn36xx_msm_smsm_change_state;
-	wcnss_memory =
-		platform_get_resource_byname(pdev,
-					      IORESOURCE_MEM,
-					      "wcnss_mmio");
-	if (wcnss_memory == NULL) {
-		dev_err(&wmsm.core->dev,
-			"Failed to get wcnss wlan memory map.\n");
-		ret = -ENOMEM;
-		return ret;
-	}
-	memcpy(&res[0], wcnss_memory, sizeof(*wcnss_memory));
-
-	tx_irq = platform_get_resource_byname(pdev,
-					      IORESOURCE_IRQ,
-					      "wcnss_wlantx_irq");
-	if (tx_irq == NULL) {
-		dev_err(&wmsm.core->dev, "Failed to get wcnss tx_irq");
-		ret = -ENOMEM;
-		return ret;
-	}
-	memcpy(&res[1], tx_irq, sizeof(*tx_irq));
-
-	rx_irq = platform_get_resource_byname(pdev,
-					      IORESOURCE_IRQ,
-					      "wcnss_wlanrx_irq");
-	if (rx_irq == NULL) {
-		dev_err(&wmsm.core->dev, "Failed to get wcnss rx_irq");
-		ret = -ENOMEM;
-		return ret;
+	for (n = 0; n < ARRAY_SIZE(rnames); n++) {
+		r = platform_get_resource_byname(pdev, rtype[n], rnames[n]);
+		if (!r) {
+			dev_err(&wmsm.core->dev,
+				"Missing resource %s'\n", rnames[n]);
+			ret = -ENOMEM;
+			return ret;
+		}
+		res[n] = *r;
 	}
-	memcpy(&res[2], rx_irq, sizeof(*rx_irq));
 
-	platform_device_add_resources(wmsm.core, res, ARRAY_SIZE(res));
+	platform_device_add_resources(wmsm.core, res, n);
 
 	ret = platform_device_add_data(wmsm.core, &wmsm.ctrl_ops,
 				       sizeof(wmsm.ctrl_ops));
@@ -319,10 +326,6 @@ static int wcn36xx_msm_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id wcn36xx_msm_match_table[] = {
-	{ .compatible = "qcom,wcn36xx" },
-	{ }
-};
 MODULE_DEVICE_TABLE(of, wcn36xx_msm_match_table);
 
 static struct platform_driver wcn36xx_msm_driver = {

^ permalink raw reply related

* Re: [patch net-next 1/2] switchdev: introduce switchdev notifier
From: David Miller @ 2015-01-18  5:24 UTC (permalink / raw)
  To: jiri; +Cc: netdev, jhs, sfeldma, stephen, linus.luessing, tgraf
In-Reply-To: <1421362177-10719-1-git-send-email-jiri@resnulli.us>

From: Jiri Pirko <jiri@resnulli.us>
Date: Thu, 15 Jan 2015 23:49:36 +0100

> This patch introduces new notifier for purposes of exposing events which happen
> on switch driver side. The consumers of the event messages are mainly involved
> masters, namely bridge and ovs.
> 
> Suggested-by: Thomas Graf <tgraf@suug.ch>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>

Applied.

^ permalink raw reply

* Re: [patch net-next 2/2] net: replace br_fdb_external_learn_* calls with switchdev notifier events
From: David Miller @ 2015-01-18  5:24 UTC (permalink / raw)
  To: jiri; +Cc: netdev, jhs, sfeldma, stephen, linus.luessing, tgraf
In-Reply-To: <1421362177-10719-2-git-send-email-jiri@resnulli.us>

From: Jiri Pirko <jiri@resnulli.us>
Date: Thu, 15 Jan 2015 23:49:37 +0100

> This patch benefits from newly introduced switchdev notifier and uses it
> to propagate fdb learn events from rocker driver to bridge. That avoids
> direct function calls and possible use by other listeners (ovs).
> 
> Suggested-by: Thomas Graf <tgraf@suug.ch>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>

Applied.

^ permalink raw reply

* Re: pull request: bluetooth-next 2015-01-16
From: David Miller @ 2015-01-18  5:25 UTC (permalink / raw)
  To: johan.hedberg; +Cc: netdev, linux-bluetooth
In-Reply-To: <20150116113301.GA3818@t440s.lan>

From: Johan Hedberg <johan.hedberg@gmail.com>
Date: Fri, 16 Jan 2015 13:33:01 +0200

> Here are some more bluetooth & ieee802154 patches intended for 3.20:
> 
>  - Refactoring & cleanups of ieee802154 & 6lowpan code
>  - Various fixes to the btmrvl driver
>  - Fixes for Bluetooth Low Energy Privacy feature handling
>  - Added build-time sanity checks for sockaddr sizes
>  - Fixes for Security Manager registration on LE-only controllers
>  - Refactoring of broken inquiry mode handling to a generic quirk
> 
> Please let me know if there are any issues pulling. Thanks.

Pulled, thanks Johan.

^ permalink raw reply

* Re: [PATCH net-next] tipc: fix socket list regression in new nl api
From: David Miller @ 2015-01-18  5:27 UTC (permalink / raw)
  To: richard.alpe; +Cc: netdev, tipc-discussion
In-Reply-To: <1421407840-30726-1-git-send-email-richard.alpe@ericsson.com>

From: <richard.alpe@ericsson.com>
Date: Fri, 16 Jan 2015 12:30:40 +0100

> From: Richard Alpe <richard.alpe@ericsson.com>
> 
> Commit 07f6c4bc (tipc: convert tipc reference table to use generic
> rhashtable) introduced a problem with port listing in the new netlink
> API. It broke the resume functionality resulting in a never ending
> loop. This was caused by starting with the first hash table every time
> subsequently never returning an empty skb (terminating).
> 
> This patch fixes the resume mechanism by keeping a logical reference
> to the last hash table along with a logical reference to the socket
> (port) that didn't fit in the previous message.
> 
> Signed-off-by: Richard Alpe <richard.alpe@ericsson.com>
> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
> Reviewed-by: Ying Xue <ying.xue@windriver.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH 2/2] Drivers: Isdn: sc: Fixed coding style & spelling mistakes.
From: David Miller @ 2015-01-18  5:28 UTC (permalink / raw)
  To: akash0x53s; +Cc: isdn, netdev, linux-kernel
In-Reply-To: <1421415762-21596-1-git-send-email-akash0x53s@gmail.com>

From: Akash Shende <akash0x53s@gmail.com>
Date: Fri, 16 Jan 2015 19:12:42 +0530

> Fix some spelling mistakes, coding style and don't assign value to static var.
> 
> Signed-off-by: Akash Shende <akash0x53s@gmail.com>

Applied, thanks.

^ permalink raw reply


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