]> Pileus Git - ~andy/linux/log
~andy/linux
11 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Fri, 28 Sep 2012 15:11:16 +0000 (11:11 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem

Conflicts:
net/nfc/netlink.c

Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge tag 'nfc-next-3.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo... master-2012-09-28
John W. Linville [Fri, 28 Sep 2012 14:55:00 +0000 (10:55 -0400)]
Merge tag 'nfc-next-3.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-3.0

So says Samuel Ortiz <sameo@linux.intel.com>:

The 2nd NFC pull request for 3.7.

- A couple of wrong context sleep fixes.
- An LLCP rwlock intizialisation fix.
- A missing mutex unlocking for pn533.
- LLCP raw sockets support. This is going to be used for NFC sniffing.
- A build fix for llc_shdlc. It fixes a build error triggered by code that's
  living in wireless-next.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoRevert "be2net: fix vfs enumeration"
David S. Miller [Fri, 28 Sep 2012 02:19:02 +0000 (22:19 -0400)]
Revert "be2net: fix vfs enumeration"

This reverts commit 51af6d7c1f31e0f3d42c87d53657ec7acb6e3462.

Breaks the build with CONFIG_PCI_ATS not enabled.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: struct napi_struct fields reordering
Eric Dumazet [Wed, 26 Sep 2012 07:07:47 +0000 (07:07 +0000)]
net: struct napi_struct fields reordering

Remove two holes on 64bit arches, and put dev_list at the end of
napi_struct since its not used in fast path.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: use bigger pages in __netdev_alloc_frag
Eric Dumazet [Wed, 26 Sep 2012 06:46:57 +0000 (06:46 +0000)]
net: use bigger pages in __netdev_alloc_frag

We currently use percpu order-0 pages in __netdev_alloc_frag
to deliver fragments used by __netdev_alloc_skb()

Depending on NIC driver and arch being 32 or 64 bit, it allows a page to
be split in several fragments (between 1 and 8), assuming PAGE_SIZE=4096

Switching to bigger pages (32768 bytes for PAGE_SIZE=4096 case) allows :

- Better filling of space (the ending hole overhead is less an issue)

- Less calls to page allocator or accesses to page->_count

- Could allow struct skb_shared_info futures changes without major
  performance impact.

This patch implements a transparent fallback to smaller
pages in case of memory pressure.

It also uses a standard "struct page_frag" instead of a custom one.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Alexander Duyck <alexander.h.duyck@intel.com>
Cc: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agotcp: Remove unused parameter from tcp_v4_save_options
Christoph Paasch [Wed, 26 Sep 2012 11:59:09 +0000 (11:59 +0000)]
tcp: Remove unused parameter from tcp_v4_save_options

struct sock *sk is not used inside tcp_v4_save_options. Thus it can be
removed.

Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv6: gre: remove ip6gre_header_parse()
Eric Dumazet [Wed, 26 Sep 2012 01:39:20 +0000 (01:39 +0000)]
ipv6: gre: remove ip6gre_header_parse()

dev_parse_header() callers provide 8 bytes of storage,
so it's not possible to store an IPv6 address.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: remove sk_init() helper
Eric Dumazet [Tue, 25 Sep 2012 11:32:13 +0000 (11:32 +0000)]
net: remove sk_init() helper

It seems sk_init() has no value today and even does strange things :

# grep . /proc/sys/net/core/?mem_*
/proc/sys/net/core/rmem_default:212992
/proc/sys/net/core/rmem_max:131071
/proc/sys/net/core/wmem_default:212992
/proc/sys/net/core/wmem_max:131071

We can remove it completely.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Shan Wei <davidshan@tencent.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agopkt_sched: Fix warning false positives.
David S. Miller [Thu, 27 Sep 2012 22:35:47 +0000 (18:35 -0400)]
pkt_sched: Fix warning false positives.

GCC refuses to recognize that all error control flows do in fact
set err to something.

Add an explicit initialization to shut it up.

net/sched/sch_drr.c: In function ‘drr_enqueue’:
net/sched/sch_drr.c:359:11: warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized]
net/sched/sch_qfq.c: In function ‘qfq_enqueue’:
net/sched/sch_qfq.c:885:11: warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobna: Fix warning false positive.
David S. Miller [Thu, 27 Sep 2012 22:31:58 +0000 (18:31 -0400)]
bna: Fix warning false positive.

GCC can't see that in all non-error-return paths we do in fact
set *using_dac to something.

Add an explicit initialization to remove this warning:

drivers/net/ethernet/brocade/bna/bnad.c: In function ‘bnad_pci_probe’:
drivers/net/ethernet/brocade/bna/bnad.c:3079:5: warning: ‘using_dac’ may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/net/ethernet/brocade/bna/bnad.c:3233:7: note: ‘using_dac’ was declared here

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonf_defrag_ipv6: fix oops on module unloading
Konstantin Khlebnikov [Tue, 25 Sep 2012 06:07:50 +0000 (06:07 +0000)]
nf_defrag_ipv6: fix oops on module unloading

fix copy-paste error introduced in linux-next commit
"ipv6: add a new namespace for nf_conntrack_reasm"

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Amerigo Wang <amwang@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Acked-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: fix vfs enumeration
Ivan Vecera [Tue, 25 Sep 2012 02:50:42 +0000 (02:50 +0000)]
be2net: fix vfs enumeration

Current VFs enumeration algorithm used in be_find_vfs does not take domain
number into the match. The match found in igb/ixgbe is more elegant and
safe.

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agotunnel: drop packet if ECN present with not-ECT
stephen hemminger [Tue, 25 Sep 2012 11:02:48 +0000 (11:02 +0000)]
tunnel: drop packet if ECN present with not-ECT

Linux tunnels were written before RFC6040 and therefore never
implemented the corner case of ECN getting set in the outer header
and the inner header not being ready for it.

Section 4.2.  Default Tunnel Egress Behaviour.
 o If the inner ECN field is Not-ECT, the decapsulator MUST NOT
      propagate any other ECN codepoint onwards.  This is because the
      inner Not-ECT marking is set by transports that rely on dropped
      packets as an indication of congestion and would not understand or
      respond to any other ECN codepoint [RFC4774].  Specifically:

      *  If the inner ECN field is Not-ECT and the outer ECN field is
         CE, the decapsulator MUST drop the packet.

      *  If the inner ECN field is Not-ECT and the outer ECN field is
         Not-ECT, ECT(0), or ECT(1), the decapsulator MUST forward the
         outgoing packet with the ECN field cleared to Not-ECT.

This patch moves the ECN decap logic out of the individual tunnels
into a common place.

It also adds logging to allow detecting broken systems that
set ECN bits incorrectly when tunneling (or an intermediate
router might be changing the header).

Overloads rx_frame_error to keep track of ECN related error.

Thanks to Chris Wright who caught this while reviewing the new VXLAN
tunnel.

This code was tested by injecting faulty logic in other end GRE
to send incorrectly encapsulated packets.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoxfrm: remove extranous rcu_read_lock
stephen hemminger [Mon, 24 Sep 2012 18:12:25 +0000 (18:12 +0000)]
xfrm: remove extranous rcu_read_lock

The handlers for xfrm_tunnel are always invoked with rcu read lock
already.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agogre: remove unnecessary rcu_read_lock/unlock
stephen hemminger [Mon, 24 Sep 2012 18:12:24 +0000 (18:12 +0000)]
gre: remove unnecessary rcu_read_lock/unlock

The gre function pointers for receive and error handling are
always called (from gre.c) with rcu_read_lock already held.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agogre: fix handling of key 0
stephen hemminger [Mon, 24 Sep 2012 18:12:23 +0000 (18:12 +0000)]
gre: fix handling of key 0

GRE driver incorrectly uses zero as a flag value. Zero is a perfectly
valid value for key, and the tunnel should match packets with no key only
with tunnels created without key, and vice versa.

This is a slightly visible  change since previously it might be possible to
construct a working tunnel that sent key 0 and received only because
of the key wildcard of zero.  I.e the sender sent key of zero, but tunnel
was defined without key.

Note: using gre key 0 requires iproute2 utilities v3.2 or later.
The original utility code was broken as well.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agosparc: bpf_jit_comp: add XOR instruction for BPF JIT JIT
Daniel Borkmann [Mon, 24 Sep 2012 11:57:54 +0000 (11:57 +0000)]
sparc: bpf_jit_comp: add XOR instruction for BPF JIT JIT

This patch is a follow-up for patch "filter: add XOR instruction for use
with X/K" that implements BPF SPARC JIT parts for the BPF XOR operation.

Signed-off-by: Daniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agolxt PHY: Support for the buggy LXT973 rev A2
LEROY Christophe [Mon, 24 Sep 2012 04:00:58 +0000 (04:00 +0000)]
lxt PHY: Support for the buggy LXT973 rev A2

This patch adds proper handling of the buggy revision A2 of LXT973 phy, adding
precautions linked to ERRATA Item 4:

Revision A2 of LXT973 chip randomly returns the contents of the previous even
register when you read a odd register regularly

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agocxgb4: Don't attempt to upgrade T4 firmware when cxgb4 will end up as a slave
Vipul Pandya [Wed, 26 Sep 2012 02:39:42 +0000 (02:39 +0000)]
cxgb4: Don't attempt to upgrade T4 firmware when cxgb4 will end up as a slave

This patch adds a new common code routine to upgrade an adapter's
firmware.  This routine handles all of the complexities of working with the
the existing adapter firmware in order to quiesce the adapter and uP, etc.
For an automatic upgrade it will send a HELLO command to check if cxgb4
want/can upgrade firmware, i.e. if cxgb4 is MASTER and has newer firmware
that it wants to load and call the new common code routine t4_fw_upgrade.
Note that it should not issue a RESET command after a successful firmware
upgrade.

Signed-off-by: Jay Hernandez <jay@chelsio.com>
Signed-off-by: Vipul Pandya <vipul@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agocxgb4: Inform caller if driver didn't upgrade firmware
Vipul Pandya [Wed, 26 Sep 2012 02:39:41 +0000 (02:39 +0000)]
cxgb4: Inform caller if driver didn't upgrade firmware

If a card had already been initialized, on reloading cxgb4 driver firmware
required an upgrade but the upgrade did not happen. In that case a mailbox
timeout would occur during T4 configuration file stuff. The fix is to let the
caller know the firmware was not upgraded so a reset would be issued before
starting the T4 config stuff.

Signed-off-by: Jay Hernandez <jay@chelsio.com>
Signed-off-by: Vipul Pandya <vipul@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agocxgb4: Add support for T4 hardwired driver configuration settings
Vipul Pandya [Wed, 26 Sep 2012 02:39:40 +0000 (02:39 +0000)]
cxgb4: Add support for T4 hardwired driver configuration settings

In case if user defined configuration file at /lib/firmware/cxgb4/t4-config.txt
location and also factory default configuration file written to FLASH are not
present then driver will use hardwired configuration settings.

Signed-off-by: Jay Hernandez <jay@chelsio.com>
Signed-off-by: Vipul Pandya <vipul@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agocxgb4: Add support for T4 configuration file
Vipul Pandya [Wed, 26 Sep 2012 02:39:39 +0000 (02:39 +0000)]
cxgb4: Add support for T4 configuration file

Starting with T4 firmware version 1.3.11.0 the firmware now supports device
configuration via a Firmware Configuration File. The Firmware Configuration
File was primarily developed in order to centralize all of the configuration,
resource allocation, etc. for Unified Wire operation where multiple
Physical / Virtual Function Drivers would be using a T4 adapter simultaneously.

The Firmware Configuration file can live in three locations as shown below
in order of precedence.
1) User defined configuration file: /lib/firmware/cxgb4/t4-config.txt
2) Factory Default configuration file written to FLASH within
   the manufacturing process.
3) Hardwired driver configuration.

Signed-off-by: Jay Hernandez <jay@chelsio.com>
Signed-off-by: Vipul Pandya <vipul@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agocxgb4/cxgb4vf: Code cleanup to enable T4 Configuration File support
Vipul Pandya [Wed, 26 Sep 2012 02:39:38 +0000 (02:39 +0000)]
cxgb4/cxgb4vf: Code cleanup to enable T4 Configuration File support

This patch adds new enums and macros to enable T4 configuration file support. It
also removes duplicate macro definitions.

It fixes the build failure in cxgb4vf driver introduced because of old macro
definition removal.

It also performs SGE initialization based on T4 configuration file is provided
or not. If it is provided then it uses the parameters provided in it otherwise
it uses hard coded values.

Signed-off-by: Jay Hernandez <jay@chelsio.com>
Signed-off-by: Vipul Pandya <vipul@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agocxgb4: Add functions to read memory via PCIE memory window
Vipul Pandya [Wed, 26 Sep 2012 02:39:37 +0000 (02:39 +0000)]
cxgb4: Add functions to read memory via PCIE memory window

This patch implements two new functions t4_mem_win_read and t4_memory_read.
These new functions can be used to read memory via the PCIE memory window.
Please note, for proper execution of these functions PCIE_MEM_ACCESS_BASE_WIN
registers must be setup correctly like how setup_memwin in the cxgb4 driver
does it.

Signed-off-by: Jay Hernandez <jay@chelsio.com>
Signed-off-by: Vipul Pandya <vipul@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agocxgb4: Fix incorrect values for MEMWIN*_APERTURE and MEMWIN*_BASE
Vipul Pandya [Wed, 26 Sep 2012 02:39:36 +0000 (02:39 +0000)]
cxgb4: Fix incorrect values for MEMWIN*_APERTURE and MEMWIN*_BASE

Signed-off-by: Jay Hernandez <jay@chelsio.com>
Signed-off-by: Vipul Pandya <vipul@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoNFC: Fix sleeping in atomic when releasing socket
Szymon Janc [Wed, 26 Sep 2012 12:22:10 +0000 (14:22 +0200)]
NFC: Fix sleeping in atomic when releasing socket

nfc_llcp_socket_release is calling lock_sock/release_sock while holding
write lock for rwlock. Use bh_lock/unlock_sock instead.

BUG: sleeping function called from invalid context at net/core/sock.c:2138
in_atomic(): 1, irqs_disabled(): 0, pid: 56, name: kworker/1:1
4 locks held by kworker/1:1/56:
Pid: 56, comm: kworker/1:1 Not tainted 3.5.0-999-nfc+ #7
Call Trace:
[<ffffffff810952c5>] __might_sleep+0x145/0x200
[<ffffffff815d7686>] lock_sock_nested+0x36/0xa0
[<ffffffff81731569>] ? _raw_write_lock+0x49/0x50
[<ffffffffa04aa100>] ? nfc_llcp_socket_release+0x30/0x200 [nfc]
[<ffffffffa04aa122>] nfc_llcp_socket_release+0x52/0x200 [nfc]
[<ffffffffa04ab9f0>] nfc_llcp_mac_is_down+0x20/0x30 [nfc]
[<ffffffffa04a6fea>] nfc_dep_link_down+0xaa/0xf0 [nfc]
[<ffffffffa04a9bb5>] nfc_llcp_timeout_work+0x15/0x20 [nfc]
[<ffffffff810825f7>] process_one_work+0x197/0x7c0
[<ffffffff81082596>] ? process_one_work+0x136/0x7c0
[<ffffffff8172fbc9>] ? __schedule+0x419/0x9c0
[<ffffffffa04a9ba0>] ? nfc_llcp_build_gb+0x1b0/0x1b0 [nfc]
[<ffffffff81083090>] worker_thread+0x190/0x4c0
[<ffffffff81082f00>] ? rescuer_thread+0x2a0/0x2a0
[<ffffffff81088d1e>] kthread+0xae/0xc0
[<ffffffff810caafd>] ? trace_hardirqs_on+0xd/0x10
[<ffffffff8173acc4>] kernel_thread_helper+0x4/0x10
[<ffffffff81732174>] ? retint_restore_args+0x13/0x13
[<ffffffff81088c70>] ? flush_kthread_worker+0x150/0x150
[<ffffffff8173acc0>] ? gs_change+0x13/0x13

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Fix sleeping in invalid context when netlink socket is closed
Szymon Janc [Wed, 26 Sep 2012 12:17:12 +0000 (14:17 +0200)]
NFC: Fix sleeping in invalid context when netlink socket is closed

netlink_register_notifier requires notify functions to not sleep.
nfc_stop_poll locks device mutex and must not be called from notifier.
Create workqueue that will handle this for all devices.

BUG: sleeping function called from invalid context at kernel/mutex.c:269
in_atomic(): 0, irqs_disabled(): 0, pid: 4497, name: neard
1 lock held by neard/4497:
Pid: 4497, comm: neard Not tainted 3.5.0-999-nfc+ #5
Call Trace:
[<ffffffff810952c5>] __might_sleep+0x145/0x200
[<ffffffff81743dde>] mutex_lock_nested+0x2e/0x50
[<ffffffff816ffd19>] nfc_stop_poll+0x39/0xb0
[<ffffffff81700a17>] nfc_genl_rcv_nl_event+0x77/0xc0
[<ffffffff8174aa8c>] notifier_call_chain+0x5c/0x120
[<ffffffff8174abd6>] __atomic_notifier_call_chain+0x86/0x140
[<ffffffff8174ab50>] ? notifier_call_chain+0x120/0x120
[<ffffffff815e1347>] ? skb_dequeue+0x67/0x90
[<ffffffff8174aca6>] atomic_notifier_call_chain+0x16/0x20
[<ffffffff8162119a>] netlink_release+0x24a/0x280
[<ffffffff815d7aa8>] sock_release+0x28/0xa0
[<ffffffff815d7be7>] sock_close+0x17/0x30
[<ffffffff811b2a7c>] __fput+0xcc/0x250
[<ffffffff811b2c0e>] ____fput+0xe/0x10
[<ffffffff81085009>] task_work_run+0x69/0x90
[<ffffffff8101b951>] do_notify_resume+0x81/0xd0
[<ffffffff8174ef22>] int_signal+0x12/0x17

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Add dummy nfc_llc_shdlc_register definition
John W. Linville [Wed, 26 Sep 2012 17:39:10 +0000 (13:39 -0400)]
NFC: Add dummy nfc_llc_shdlc_register definition

This is used when CONFIG_NFC_SHDLC is disabled.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: LLCP raw socket support
Thierry Escande [Wed, 26 Sep 2012 16:16:44 +0000 (18:16 +0200)]
NFC: LLCP raw socket support

This adds support for socket of type SOCK_RAW to LLCP.
sk_buff are copied and sent to raw sockets with a 2 bytes extra header:
The first byte header contains the nfc adapter index.
The second one contains flags:
- 0x01 - Direction (0=RX, 1=TX)
- 0x02-0x80 - Reserved
A raw socket has to be explicitly bound to a nfc adapter. This is achieved
by specifying the adapter index to be bound to in the dev_idx field of the
sockaddr_nfc_llcp struct passed to bind().

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Fix missing mutex unlock in pn533_send_cmd_frame_async
Szymon Janc [Thu, 27 Sep 2012 07:16:54 +0000 (09:16 +0200)]
NFC: Fix missing mutex unlock in pn533_send_cmd_frame_async

If command allocation failed cmd_lock was not released and deadlock
would occur.

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Use dynamic initialization for rwlocks
Szymon Janc [Tue, 25 Sep 2012 10:42:50 +0000 (12:42 +0200)]
NFC: Use dynamic initialization for rwlocks

If rwlock is dynamically allocated but statically initialized it is
missing proper lockdep annotation.

INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
Pid: 3352, comm: neard Not tainted 3.5.0-999-nfc+ #2
Call Trace:
[<ffffffff810c8526>] __lock_acquire+0x8f6/0x1bf0
[<ffffffff81739045>] ? printk+0x4d/0x4f
[<ffffffff810c9eed>] lock_acquire+0x9d/0x220
[<ffffffff81702bfe>] ? nfc_llcp_sock_from_sn+0x4e/0x160
[<ffffffff81746724>] _raw_read_lock+0x44/0x60
[<ffffffff81702bfe>] ? nfc_llcp_sock_from_sn+0x4e/0x160
[<ffffffff81702bfe>] nfc_llcp_sock_from_sn+0x4e/0x160
[<ffffffff817034a7>] nfc_llcp_get_sdp_ssap+0xa7/0x1b0
[<ffffffff81706353>] llcp_sock_bind+0x173/0x210
[<ffffffff815d9c94>] sys_bind+0xe4/0x100
[<ffffffff8139209e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[<ffffffff8174ea69>] system_call_fastpath+0x16/0x1b

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agonfc: add dummy nfc_llc_shdlc_register definition
John W. Linville [Wed, 26 Sep 2012 17:30:16 +0000 (13:30 -0400)]
nfc: add dummy nfc_llc_shdlc_register definition

This is used when CONFIG_NFC_SHDLC is disabled.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath5k: add missing breaks in ath5k_hw_set_spur_mitigation_filter master-2012-09-25
John W. Linville [Mon, 24 Sep 2012 18:30:19 +0000 (14:30 -0400)]
ath5k: add missing breaks in ath5k_hw_set_spur_mitigation_filter

https://bugzilla.kernel.org/show_bug.cgi?id=47681

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: fix BT sleep state on chip wakeup
Rajkumar Manoharan [Mon, 24 Sep 2012 08:34:24 +0000 (14:04 +0530)]
ath9k_hw: fix BT sleep state on chip wakeup

Whenever both WLAN and BT in/out sleep mode, sometimes WLAN
is not able to take back the shared LNA control after resumes
from sleep mode. The idea is that for WLAN to check if BT owns
LNA control and BT is in sleep mode when WLAN just resumes from
sleep mode. If the condition is true, do a BTCOEX_RC_WARM_RESET
for WLAN to take back the control of shared LNA.
Now the issue is the BT sleep value read from MCI register is
overlooked by assigning u32 into u8. Hence the above condition never
be met so that WLAN used to report beacon losses and frequent
connection drops.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Tested-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2x00: Replace open coded interface checking with interface combinations.
Gertjan van Wingerde [Sun, 23 Sep 2012 18:22:54 +0000 (20:22 +0200)]
rt2x00: Replace open coded interface checking with interface combinations.

Mac80211 has formal infrastructure to specify which interface combinations
are supported. Make use of this facility in favor of open coding it
ourselves.
So far we only have to specify we can support multiple AP interfaces,
no other combinations are supported.

Inspired by an earlier patch from Paul Fertser.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2x00: Deprecate max_sta_intf field of struct rt2x00_ops.
Gertjan van Wingerde [Sun, 23 Sep 2012 18:22:53 +0000 (20:22 +0200)]
rt2x00: Deprecate max_sta_intf field of struct rt2x00_ops.

All drivers set this value to 1, so there is no need (currently) to let
drivers set this.
Therefor, remove the field; we can always add it back when it is needed.

Inspired by an earlier patch from Paul Fertser.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: potential corruption in mwifiex_update_uap_custom_ie()
Dan Carpenter [Sun, 23 Sep 2012 16:33:00 +0000 (19:33 +0300)]
mwifiex: potential corruption in mwifiex_update_uap_custom_ie()

ap_custom_ie is a struct mwifiex_ie_list which is quite different and
also larger than struct mwifiex_ie.  It's a difference between 4196
bytes and 262.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Tested-by: Stone Piao <piaoyun@marvell.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Disable ASPM only for AR9285
Sujith Manoharan [Fri, 21 Sep 2012 18:44:28 +0000 (00:14 +0530)]
ath9k: Disable ASPM only for AR9285

Currently, ASPM is disabled for all WLAN+BT combo chipsets
when BTCOEX is enabled. This is incorrect since the workaround
is required only for WB195, which is a AR9285+AR3011 combo
solution. Fix this by checking for the HW version when enabling
the workaround.

Cc: stable@vger.kernel.org
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Tested-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Tue, 25 Sep 2012 19:55:02 +0000 (15:55 -0400)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
John W. Linville [Tue, 25 Sep 2012 19:54:32 +0000 (15:54 -0400)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next

11 years agoMerge tag 'nfc-next-3.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo...
John W. Linville [Tue, 25 Sep 2012 19:50:56 +0000 (15:50 -0400)]
Merge tag 'nfc-next-3.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-3.0

So says Samuel Ortiz <sameo@linux.intel.com>:

This is the first NFC pull request for the 3.7 merge window.

With this one we get:

- HCI and LLC layers separation. We now can support various LLC
  protocols for HCI drivers, SHDLC being one of them. This will be needed as
  we're planning to support raw HCI chipsets that do the SHDLC encapsulation
  in firmware. So for now we have an SHDLC and a NOP LLC layers.

- pn533 command queueing implementation. This simplifies the pn533 locking
  logic and fixes a kernel warning.

- NCI p2p initiator mode implementation.

- Replace custom workqueues with system ones, for HCI and LLCP.

- Raw pn544 driver removal, as scheduled on the features-removal.txt file.

- A few HCI, SHDLC and LLCP fixes.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoipconfig: fix trivial build error
Andy Shevchenko [Mon, 24 Sep 2012 22:09:58 +0000 (22:09 +0000)]
ipconfig: fix trivial build error

The commit 5e953778a2aab04929a5e7b69f53dc26e39b079e ("ipconfig: add nameserver
IPs to kernel-parameter ip=") introduces ic_nameservers_predef() that defined
only for BOOTP. However it is used by ip_auto_config_setup() as well. This
patch moves it outside of #ifdef BOOTP.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Christoph Fritz <chf.fritz@googlemail.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agocfg80211: Fix regulatory check for 60GHz band frequencies
Vladimir Kondratiev [Sun, 23 Sep 2012 07:49:54 +0000 (09:49 +0200)]
cfg80211: Fix regulatory check for 60GHz band frequencies

The current regulatory code on cfg80211 performs a check to
see if a regulatory rule belongs to an IEEE band so that if
a Country IE is received and no rules are specified for a
band (which is allowed by IEEE) those bands are left intact.
The current band check assumes a rule is bound to a band
if the rule's start or end frequency is less than 2 GHz
apart from the center of frequency being inspected.

In order to support 60 GHz for 802.11ad we need to increase
this to account for the channel spacing of 2160 MHz whereby
a channel somewhere in the middle of a regulatory rule may
be more than 2 GHz apart from either the beginning or
end of the frequency rule.

Without a fix for this even though channels 1-3 are allowed world
wide on the rule (57240 - 63720 @ 2160), channel 2 at 60480 MHz
will end up getting disabled given that it is 3240 MHz from
both the frequency rule start and end frequency. Fix this by
using 2 GHz separation assumption for the 2.4 and 5 GHz bands
but for 60 GHz use a 10 GHz separation before assuming a rule
is not part of the band.

Since we have no 802.11ad drivers yet merged this change has
no impact to existing Linux upstream device drivers.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonet: raw: revert unrelated change
Eric Dumazet [Tue, 25 Sep 2012 06:21:16 +0000 (08:21 +0200)]
net: raw: revert unrelated change

Commit 5640f7685831 ("net: use a per task frag allocator")
accidentally contained an unrelated change to net/ipv4/raw.c,
later committed (without the pr_err() debugging bits) in
net tree as commit ab43ed8b749 (ipv4: raw: fix icmp_filter())

This patch reverts this glitch, noticed by Stephen Rothwell.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoNFC: Fix typo negociating -> negotiating
Waldemar Rymarkiewicz [Mon, 24 Sep 2012 06:07:07 +0000 (08:07 +0200)]
NFC: Fix typo negociating -> negotiating

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Don't handle consequent RSET frames after UA
Waldemar Rymarkiewicz [Fri, 21 Sep 2012 12:02:46 +0000 (14:02 +0200)]
NFC: Don't handle consequent RSET frames after UA

During processing incoming RSET frame chip, possibly due to
its internal timout, can retrnasmit an another RSET which
is next queued for processing in shdlc layer.

In case when we accept processed RSET skip those remaining on
the rcv queue until chip will send it's first S or I frame.
This will mean the chip completed connection as well.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Handle RSET in SHDLC_CONNECTING state
Waldemar Rymarkiewicz [Thu, 20 Sep 2012 06:59:11 +0000 (08:59 +0200)]
NFC: Handle RSET in SHDLC_CONNECTING state

As queue_work() does not guarantee immediate execution of sm_work it
can happen in crossover RSET usecase that connect timer will constantly
change the shdlc state from NEGOTIATING to CONNECTING before shdlc has
chance to handle incoming frame.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Acked-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: xmit from hci ops must return 0 or negative
Waldemar Rymarkiewicz [Thu, 20 Sep 2012 06:59:10 +0000 (08:59 +0200)]
NFC: xmit from hci ops must return 0 or negative

xmit callback provided by a driver encapsulates upper layers
data and sends it to the hardware. So, HCI does not know the
exact amount of data being sent and thus can't handle partially
sent frames properly.

Therefore, the driver must return 0 for completely sent frame or
negative for failure.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Acked-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoMAINTAINERS: Add NFC specific mailing list
Samuel Ortiz [Wed, 18 Jul 2012 10:58:51 +0000 (12:58 +0200)]
MAINTAINERS: Add NFC specific mailing list

linux-nfc@lists.01.org is where all the Linux NFC related discussions take
place, and one can also send kernel patches there.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Remove the pn544 raw driver
Cong Wang [Tue, 18 Sep 2012 17:31:58 +0000 (19:31 +0200)]
NFC: Remove the pn544 raw driver

This was scheduled for 3.6, we're late.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Add HCI module description
Eric Lapuyade [Tue, 18 Sep 2012 17:25:38 +0000 (19:25 +0200)]
NFC: Add HCI module description

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Fix LLC registration definitions for ANSI compliance
Eric Lapuyade [Tue, 18 Sep 2012 17:24:37 +0000 (19:24 +0200)]
NFC: Fix LLC registration definitions for ANSI compliance

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Move the pn544_hci dereference below the NULL test
Wei Yongjun [Sat, 8 Sep 2012 13:19:44 +0000 (21:19 +0800)]
NFC: Move the pn544_hci dereference below the NULL test

The dereference should be moved below the NULL test.

spatch with a semantic match is used to found this.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Move the nfcwilink dereference below the NULL test
Wei Yongjun [Sat, 8 Sep 2012 01:53:22 +0000 (09:53 +0800)]
NFC: Move the nfcwilink dereference below the NULL test

spatch with a semantic match is used to found this.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Remove unneeded LLC symbols export
Samuel Ortiz [Tue, 18 Sep 2012 17:17:33 +0000 (19:17 +0200)]
NFC: Remove unneeded LLC symbols export

After fixing the LLC Makefile, we no longer need those exports.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Changed HCI and PN544 HCI driver to use the new HCI LLC Core
Eric Lapuyade [Tue, 18 Sep 2012 17:45:48 +0000 (19:45 +0200)]
NFC: Changed HCI and PN544 HCI driver to use the new HCI LLC Core

The previous shdlc HCI driver and its header are removed from the tree.
PN544 now registers directly with HCI and passes the name of the llc it
requires (shdlc).
HCI instantiation now allocates the required llc instance. The llc is
started when the HCI device is brought up.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Add an shdlc llc module to llc core
Eric Lapuyade [Thu, 13 Sep 2012 15:11:37 +0000 (17:11 +0200)]
NFC: Add an shdlc llc module to llc core

This is used by HCI drivers such as the one for the pn544 which require
communications between HCI and the chip to use shdlc.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Add a nop (passthrough) llc module to llc core
Eric Lapuyade [Thu, 13 Sep 2012 15:10:48 +0000 (17:10 +0200)]
NFC: Add a nop (passthrough) llc module to llc core

This is a passthrough llc. It can be used by HCI drivers that don't
need link layer control. HCI will then write directly to the driver, and
driver will deliver incoming frames directly to HCI without any
processing.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Add an LLC Core layer to HCI
Eric Lapuyade [Thu, 13 Sep 2012 15:10:00 +0000 (17:10 +0200)]
NFC: Add an LLC Core layer to HCI

The LLC layer manages modules that control the link layer protocol (such
as shdlc) between HCI and an HCI driver. The driver must simply specify
the required llc when it registers with HCI.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Modified hci_transceive to become an asynchronous operation
Eric Lapuyade [Tue, 11 Sep 2012 08:43:50 +0000 (10:43 +0200)]
NFC: Modified hci_transceive to become an asynchronous operation

This enables the completion callback to be called from a different
context, preventing a possible deadlock if the callback resulted in the
invocation of a nested call to the currently locked nfc_dev.
This is also more in line with the im_transceive nfc_ops for NFC Core or
NCI drivers which already behave asynchronously.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Add a public nfc_hci_send_cmd_async method
Eric Lapuyade [Tue, 11 Sep 2012 08:42:54 +0000 (10:42 +0200)]
NFC: Add a public nfc_hci_send_cmd_async method

This method initiates execution of an HCI cmd. Result will be delivered
through an asynchronous callback.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Changed the HCI cmd execution callback prototype
Eric Lapuyade [Tue, 11 Sep 2012 08:41:41 +0000 (10:41 +0200)]
NFC: Changed the HCI cmd execution callback prototype

Make it match the data_exchange_cb_t so that it can be used directly in
the implementation of an asynchronous hci_transceive

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Correct outgoing frame before requeueing
Waldemar Rymarkiewicz [Fri, 7 Sep 2012 09:08:30 +0000 (11:08 +0200)]
NFC: Correct outgoing frame before requeueing

Driver must handle its data added to the frame, so at this point
removeing control field of shdlc frame is enough.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Acked-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Remove crc generation from shdlc layer
Waldemar Rymarkiewicz [Fri, 7 Sep 2012 09:08:29 +0000 (11:08 +0200)]
NFC: Remove crc generation from shdlc layer

Checksum is specific for a chip spcification and it varies
(in size and type) between different hardware. It should be
handled in the driver then.

Moreover, shdlc spec doesn't mention crc as a part of the frame.

Update pn544_hci driver as well.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Acked-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Fix possible LLCP memory leak
Wei Yongjun [Sun, 2 Sep 2012 13:21:46 +0000 (21:21 +0800)]
NFC: Fix possible LLCP memory leak

nfc_llcp_build_tlv() malloced the memory and should be free in
nfc_llcp_build_gb() after used, and the same in the error handling
case, otherwise it will cause memory leak.

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Remove pointless conditional before HCI kfree_skb()
Wei Yongjun [Tue, 28 Aug 2012 13:02:40 +0000 (21:02 +0800)]
NFC: Remove pointless conditional before HCI kfree_skb()

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Set the IRQF_ONESHOT flag from the pn544_hci IRQ handler request
Samuel Ortiz [Fri, 24 Aug 2012 22:40:16 +0000 (00:40 +0200)]
NFC: Set the IRQF_ONESHOT flag from the pn544_hci IRQ handler request

As we don't have a primary handler but only a threaded one, __setup_irq()
ends up failing if we don't set this flag.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Don't use WQ_MEM_RECLAIM for pn533
Tejun Heo [Wed, 22 Aug 2012 23:28:46 +0000 (16:28 -0700)]
NFC: Don't use WQ_MEM_RECLAIM for pn533

NFC driver doesn't sit in memory reclaim path and has no reason to use
WQ_MEM_RECLAIM.  Drop WQ_MEM_RECLAIM from pn533->wq and use
alloc_ordered_workqueue() instead of WQ_UNBOUND w/ max_active == 1.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Use system_nrt_wq instead of custom ones
Tejun Heo [Wed, 22 Aug 2012 23:22:16 +0000 (16:22 -0700)]
NFC: Use system_nrt_wq instead of custom ones

NFC is using a number of custom ordered workqueues w/ WQ_MEM_RECLAIM.
WQ_MEM_RECLAIM is unnecessary unless NFC is gonna be used as transport
for storage device, and all use cases match one work item to one
ordered workqueue - IOW, there's no actual ordering going on at all
and using system_nrt_wq gives the same behavior.

There's nothing to be gained by using custom workqueues.  Use
system_nrt_wq instead and drop all the custom ones.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Remove repeated code for NULL check
Syam Sidhardhan [Wed, 15 Aug 2012 19:25:43 +0000 (00:55 +0530)]
NFC: Remove repeated code for NULL check

This patch remove the repeated code for checking llcp_sock &
llcp_sock->dev against NULL.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Use module_platform_driver macro for nfcwilink.c
Syam Sidhardhan [Wed, 15 Aug 2012 08:34:10 +0000 (14:04 +0530)]
NFC: Use module_platform_driver macro for nfcwilink.c

Simplify the code by make use of module_platform_driver macro.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Implement NCI dep_link_up and dep_link_down
Ilan Elias [Wed, 15 Aug 2012 08:46:24 +0000 (11:46 +0300)]
NFC: Implement NCI dep_link_up and dep_link_down

During NFC-DEP target activation, store the remote
general bytes to be used later in dep_link_up.
When dep_link_up is called, activate the NFC-DEP target,
and forward the remote general bytes.
When dep_link_down is called, deactivate the target.

Signed-off-by: Ilan Elias <ilane@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Parse NCI NFC-DEP activation params
Ilan Elias [Wed, 15 Aug 2012 08:46:23 +0000 (11:46 +0300)]
NFC: Parse NCI NFC-DEP activation params

Signed-off-by: Ilan Elias <ilane@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Set local general bytes in nci_start_poll
Ilan Elias [Wed, 15 Aug 2012 08:46:22 +0000 (11:46 +0300)]
NFC: Set local general bytes in nci_start_poll

If initiator protocol is NFC-DEP, set the local general bytes
in nci_start_poll.

Signed-off-by: Ilan Elias <ilane@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Queue pn533 commands
Samuel Ortiz [Fri, 17 Aug 2012 21:47:54 +0000 (23:47 +0200)]
NFC: Queue pn533 commands

Instead of returning EBUSY when getting a command while another one is
running, we queue them. Upon completion of the pending command, the next
one is processed.
Besides the fact that it simplifies the pn533 locking scheme, it also
comes with the nice side effect of fixing the following warning:

[   82.274297] =====================================
[   82.274297] [ BUG: bad unlock balance detected! ]
[   82.274298] 3.5.0-rc1+ #1 Not tainted
[   82.274299] -------------------------------------
[   82.274300] kworker/u:1/16 is trying to release lock (&dev->cmd_lock) at:
[   82.274305] [<ffffffff8144f246>] mutex_unlock+0x9/0xb
[   82.274305] but there are no more locks to release!
[   82.274306]
[   82.274306] other info that might help us debug this:
[   82.274306] 2 locks held by kworker/u:1/16:
[   82.274311]  #0:  (pn533){.+.+..}, at: [<ffffffff8103a67d>]
+process_one_work+0x145/0x2e2
[   82.274314]  #1:  ((&dev->cmd_work)){+.+...}, at: [<ffffffff8103a67d>]
+process_one_work+0x145/0x2e2
[   82.274314]
[   82.274314] stack backtrace:
[   82.274315] Pid: 16, comm: kworker/u:1 Not tainted 3.5.0-rc1+ #1
[   82.274315] Call Trace:
[   82.274317]  [<ffffffff8144f246>] ? mutex_unlock+0x9/0xb
[   82.274321]  [<ffffffff81059841>] print_unlock_inbalance_bug+0xda/0xe4
[   82.274323]  [<ffffffff8105c74c>] lock_release_non_nested+0xb2/0x232
[   82.274325]  [<ffffffff8105a61e>] ? mark_held_locks+0x6d/0x95
[   82.274326]  [<ffffffff8144f246>] ? mutex_unlock+0x9/0xb
[   82.274328]  [<ffffffff81451105>] ? _raw_spin_unlock_irqrestore+0x40/0x5c
[   82.274329]  [<ffffffff8144f246>] ? mutex_unlock+0x9/0xb
[   82.274330]  [<ffffffff8105ca42>] lock_release+0x176/0x1ac
[   82.274333]  [<ffffffff8123de14>] ? pn533_send_complete+0xa8/0xa8
[   82.274334]  [<ffffffff8144f1d6>] __mutex_unlock_slowpath+0xb0/0x117
[   82.274336]  [<ffffffff8144f246>] mutex_unlock+0x9/0xb
[   82.274337]  [<ffffffff8123de65>] pn533_wq_cmd_complete+0x51/0x55
[   82.274338]  [<ffffffff8103a6db>] process_one_work+0x1a3/0x2e2
[   82.274340]  [<ffffffff8103a67d>] ? process_one_work+0x145/0x2e2
[   82.274341]  [<ffffffff8103b119>] worker_thread+0xcf/0x153
[   82.274343]  [<ffffffff8103b04a>] ? manage_workers.isra.22+0x16b/0x16b
[   82.274344]  [<ffffffff8103b04a>] ? manage_workers.isra.22+0x16b/0x16b
[   82.274346]  [<ffffffff8103eb11>] kthread+0x95/0x9d
[   82.274348]  [<ffffffff81452ef4>] kernel_thread_helper+0x4/0x10
[   82.274351]  [<ffffffff81046561>] ? finish_task_switch+0x45/0xc3
[   82.274352]  [<ffffffff814514f0>] ? retint_restore_args+0x13/0x13
[   82.274353]  [<ffffffff8103ea7c>] ? __init_kthread_worker+0x55/0x55
[   82.274354]  [<ffffffff81452ef0>] ? gs_change+0x13/0x13

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agox86: bpf_jit_comp: add XOR instruction for BPF JIT
Daniel Borkmann [Mon, 24 Sep 2012 07:34:51 +0000 (07:34 +0000)]
x86: bpf_jit_comp: add XOR instruction for BPF JIT

This patch is a follow-up for patch "filter: add XOR instruction for use
with X/K" that implements BPF x86 JIT parts for the BPF XOR operation.

Signed-off-by: Daniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agofilter: add XOR instruction for use with X/K
Daniel Borkmann [Mon, 24 Sep 2012 02:23:59 +0000 (02:23 +0000)]
filter: add XOR instruction for use with X/K

SKF_AD_ALU_XOR_X has been added a while ago, but as an 'ancillary'
operation that is invoked through a negative offset in K within BPF
load operations. Since BPF_MOD has recently been added, BPF_XOR should
also be part of the common ALU operations. Removing SKF_AD_ALU_XOR_X
might not be an option since this is exposed to user space.

Signed-off-by: Daniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: mipsnet: Remove the MIPSsim Ethernet driver.
Steven J. Hill [Mon, 24 Sep 2012 04:47:16 +0000 (04:47 +0000)]
net: mipsnet: Remove the MIPSsim Ethernet driver.

The MIPSsim platform is no longer supported or used. This patch
deletes the Ethernet driver.

Signed-off-by: Steven J. Hill <sjhill@mips.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: use a per task frag allocator
Eric Dumazet [Sun, 23 Sep 2012 23:04:42 +0000 (23:04 +0000)]
net: use a per task frag allocator

We currently use a per socket order-0 page cache for tcp_sendmsg()
operations.

This page is used to build fragments for skbs.

Its done to increase probability of coalescing small write() into
single segments in skbs still in write queue (not yet sent)

But it wastes a lot of memory for applications handling many mostly
idle sockets, since each socket holds one page in sk->sk_sndmsg_page

Its also quite inefficient to build TSO 64KB packets, because we need
about 16 pages per skb on arches where PAGE_SIZE = 4096, so we hit
page allocator more than wanted.

This patch adds a per task frag allocator and uses bigger pages,
if available. An automatic fallback is done in case of memory pressure.

(up to 32768 bytes per frag, thats order-3 pages on x86)

This increases TCP stream performance by 20% on loopback device,
but also benefits on other network devices, since 8x less frags are
mapped on transmit and unmapped on tx completion. Alexander Duyck
mentioned a probable performance win on systems with IOMMU enabled.

Its possible some SG enabled hardware cant cope with bigger fragments,
but their ndo_start_xmit() should already handle this, splitting a
fragment in sub fragments, since some arches have PAGE_SIZE=65536

Successfully tested on various ethernet devices.
(ixgbe, igb, bnx2x, tg3, mellanox mlx4)

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Cc: Vijay Subramanian <subramanian.vijay@gmail.com>
Cc: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Vijay Subramanian <subramanian.vijay@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agogianfar: Change default HW Tx queue scheduling mode
Claudiu Manoil [Sun, 23 Sep 2012 22:39:08 +0000 (22:39 +0000)]
gianfar: Change default HW Tx queue scheduling mode

This is primarily to address transmission timeout occurrences, when
multiple H/W Tx queues are being used concurrently. Because in
the priority scheduling mode the controller does not service the
Tx queues equally (but in ascending index order), Tx timeouts are
being triggered rightaway for a basic test with multiple simultaneous
connections like:
iperf -c <server_ip> -n 100M -P 8

resulting in kernel trace:
NETDEV WATCHDOG: eth1 (fsl-gianfar): transmit queue <X> timed out
------------[ cut here ]------------
WARNING: at net/sched/sch_generic.c:255
...
and controller reset during intense traffic, and possibly further
complications.

This patch changes the default H/W Tx scheduling setting (TXSCHED)
for multi-queue devices, from priority scheduling mode to a weighted
round robin mode with equal weights for all H/W Tx queues, and
addresses the issue above.

Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: loopback: set default mtu to 64K
Eric Dumazet [Sun, 23 Sep 2012 22:28:59 +0000 (22:28 +0000)]
net: loopback: set default mtu to 64K

loopback current mtu of 16436 bytes allows no more than 3 MSS TCP
segments per frame, or 48 Kbytes. Changing mtu to 64K allows TCP
stack to build large frames and significantly reduces stack overhead.

Performance boost on bulk TCP transferts can be up to 30 %, partly
because we now have one ACK message for two 64KB segments, and a lower
probability of hitting /proc/sys/net/ipv4/tcp_reordering default limit.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: Remove unnecessary NULL check in scm_destroy().
David S. Miller [Mon, 24 Sep 2012 19:52:33 +0000 (15:52 -0400)]
net: Remove unnecessary NULL check in scm_destroy().

All callers provide a non-NULL scm argument.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2x: Improve code around bnx2x_tests_str_arr
Merav Sicron [Sun, 23 Sep 2012 03:12:23 +0000 (03:12 +0000)]
bnx2x: Improve code around bnx2x_tests_str_arr

This patch changes the definition of bnx2x_tests_str_arr from static char
pointer to static const char bi-directional array. Also the
bnx2x_get_strings function is simplified.

Reported-by: Joe Perches <joe@perches.com>
Reported-by: David Laight <David.Laight@ACULAB.COM>
Signed-off-by: Merav Sicron <meravs@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoctcm: fix error return code
Peter Senna Tschudin [Mon, 24 Sep 2012 04:24:27 +0000 (04:24 +0000)]
ctcm: fix error return code

Convert a nonnegative error return code to a negative one, as returned
elsewhere in the function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agodrivers/s390/net: removes unnecessary semicolon
Peter Senna Tschudin [Mon, 24 Sep 2012 04:24:26 +0000 (04:24 +0000)]
drivers/s390/net: removes unnecessary semicolon

removes unnecessary semicolon

Found by Coccinelle: http://coccinelle.lip6.fr/

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqeth: fix possible memory leak in qeth_l3_add_[vipa|rxip]()
Wei Yongjun [Mon, 24 Sep 2012 04:24:25 +0000 (04:24 +0000)]
qeth: fix possible memory leak in qeth_l3_add_[vipa|rxip]()

ipaddr has been allocated in function qeth_l3_add_vipa() but
does not free before leaving from the error handling cases. The
same problem also exists in function qeth_l3_add_rxip().

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agolcs: ensure proper ccw setup
Sebastian Ott [Mon, 24 Sep 2012 04:24:24 +0000 (04:24 +0000)]
lcs: ensure proper ccw setup

Make sure that all ccws used for writing are initialized with
zeros - especially since the last ccw contains a TIC for which
the unused fields have to be zeros.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqeth: cleanup channel path descriptor function
Sebastian Ott [Mon, 24 Sep 2012 04:24:23 +0000 (04:24 +0000)]
qeth: cleanup channel path descriptor function

Cleanup the qeth_get_channel_path_desc function and rename it
to qeth_update_from_chp_desc. No functional change.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Acked-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'master' of git://1984.lsi.us.es/nf-next
David S. Miller [Mon, 24 Sep 2012 19:36:53 +0000 (15:36 -0400)]
Merge branch 'master' of git://1984.lsi.us.es/nf-next

Pablo Neira Ayuso says:

====================
This patchset contains updates for your net-next tree, they are:

* Mostly fixes for the recently pushed IPv6 NAT support:

- Fix crash while removing nf_nat modules from Patrick McHardy.
- Fix unbalanced rcu_read_unlock from Ulrich Weber.
- Merge NETMAP and REDIRECT into one single xt_target module, from
  Jan Engelhardt.
- Fix Kconfig for IPv6 NAT, which allows inconsistent configurations,
  from myself.

* Updates for ipset, all of the from Jozsef Kadlecsik:

- Add the new "nomatch" option to obtain reverse set matching.
- Support for /0 CIDR in hash:net,iface set type.
- One non-critical fix for a rare crash due to pass really
  wrong configuration parameters.
- Coding style cleanups.
- Sparse fixes.
- Add set revision supported via modinfo.i

* One extension for the xt_time match, to support matching during
  the transition between two days with one single rule, from
  Florian Westphal.

* Fix maximum packet length supported by nfnetlink_queue and add
  NFQA_CAP_LEN attribute, from myself.

You can notice that this batch contains a couple of fixes that may
go to 3.6-rc but I don't consider them critical to push them:

* The ipset fix for the /0 cidr case, which is triggered with one
  inconsistent command line invocation of ipset.

* The nfnetlink_queue maximum packet length supported since it requires
  the new NFQA_CAP_LEN attribute to provide a full workaround for the
  described problem.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoath5k: disable HW crypto in management frame master-2012-09-24
Chun-Yeow Yeoh [Fri, 14 Sep 2012 10:26:11 +0000 (18:26 +0800)]
ath5k: disable HW crypto in management frame

Hardware support for MFP is not available in ath5k. Thus,
this implementation allows the mac80211 stack to do the
actuall crypto operation.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agocarl9170: connect to 11w protected networks
Christian Lamparter [Sun, 2 Sep 2012 12:25:50 +0000 (14:25 +0200)]
carl9170: connect to 11w protected networks

Previously, it was not possible to connect to
networks which requires 11w to be supported by
the stations.

While the documentation hints that there's some
hardware support for offloading MFP "decryption",
this simple implementation relies on the mac80211
stack to do the actual crypto operations.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agop54: connect to 11w protected networks
Christian Lamparter [Fri, 7 Sep 2012 23:48:19 +0000 (01:48 +0200)]
p54: connect to 11w protected networks

Previously, it was not possible to connect to
networks which requires 11w to be supported by
the stations.

Note:

As all current (and old) firmwares corrupt
incoming, protected management frames, the
decryption offloading needs to be disabled.
This will be done automatically if needed.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoiwlegacy: use eth_broadcast_addr
Johannes Berg [Wed, 19 Sep 2012 09:57:17 +0000 (11:57 +0200)]
iwlegacy: use eth_broadcast_addr

Instead of copying from a constant array
(which is still needed for other purposes)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoipw2x00: silence GCC warning for unused variable 'dev'
Paul Bolle [Fri, 21 Sep 2012 10:02:02 +0000 (12:02 +0200)]
ipw2x00: silence GCC warning for unused variable 'dev'

Building the libipw component without CONFIG_LIBIPW_DEBUG set triggers this GCC
warning:
    drivers/net/wireless/ipw2x00/libipw_wx.c:526:21: warning: unused variable 'dev' [-Wunused-variable]

The cause of this warning is that, without CONFIG_LIBIPW_DEBUG set,
LIBIPW_DEBUG_WX compiles away. Fix it by substituting ieee->dev for (its
equivalent) dev.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobcma: handle BCM43227
Rafał Miłecki [Fri, 21 Sep 2012 06:38:38 +0000 (08:38 +0200)]
bcma: handle BCM43227

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Tested-by: Jack <x6719620@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: block scan request during heavy Tx traffic
Amitkumar Karwar [Fri, 21 Sep 2012 03:23:18 +0000 (20:23 -0700)]
mwifiex: block scan request during heavy Tx traffic

Currently scan operation is delayed/aborted based on Tx traffic
consistency. This decision is taken after receiving scan
response of first scan command from FW. But when heavy traffic
is running, we can not even afford to send first scan command
and go off channel for 30msec. We will block scan request in
this case.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: disconnect the device before entering suspend state
Amitkumar Karwar [Fri, 21 Sep 2012 03:23:17 +0000 (20:23 -0700)]
mwifiex: disconnect the device before entering suspend state

By default, device is disconnected before entering suspend state.
User can keep the connection alive by using module parameter
"disconect_on_suspend=0".

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: get rid of void pointer in struct brcmf_cfg80211_priv
Arend van Spriel [Wed, 19 Sep 2012 20:21:18 +0000 (22:21 +0200)]
brcmfmac: get rid of void pointer in struct brcmf_cfg80211_priv

Field 'pub' in struct brcmf_cfg80211_priv was types as void pointer
and filled with parameter passed in brcmf_cfg80211_attach(). This
patch makes the type specific, ie. struct brcmf_pub.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: change struct brcmf_cfg80211_priv comments to kernel-doc
Arend van Spriel [Wed, 19 Sep 2012 20:21:17 +0000 (22:21 +0200)]
brcmfmac: change struct brcmf_cfg80211_priv comments to kernel-doc

Small step to fix structure commenting using kernel-doc syntax.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: clear control lock on usb error.
Hante Meuleman [Wed, 19 Sep 2012 20:21:16 +0000 (22:21 +0200)]
brcmfmac: clear control lock on usb error.

On a usb error the lock bit should be cleared.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>