]> Pileus Git - ~andy/linux/log
~andy/linux
11 years agonetfilter: nf_nat: missing condition in nf_xfrm_me_harder()
Dan Carpenter [Wed, 24 Apr 2013 05:11:51 +0000 (05:11 +0000)]
netfilter: nf_nat: missing condition in nf_xfrm_me_harder()

This if statement was accidentally dropped in (aaa795a netfilter:
nat: propagate errors from xfrm_me_harder()) so now it returns
unconditionally.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
11 years agoMerge branch 'qlcnic'
David S. Miller [Wed, 24 Apr 2013 23:34:12 +0000 (19:34 -0400)]
Merge branch 'qlcnic'

Jitendra Kalsaria says:

====================
This set of patches has following updates:
* Enhanced channel configuration logs by adding logs for various cases.
* Take EPORT out of reset before disabling pause frame generation in the
  adapter.
* Add eSwitch statistics support in ethtool stats.
* Enable interrupt coalescing for 83xx adapter.
* Rename IRQ description.
* Added PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_834X and PCI_DEVICE_ID_QLOGIC_824X
  for the patch "qlcnic: Add identifying string for 83xx adapter" as per Francois comment.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqlcnic: Update version to 5.2.42
Shahed Shaikh [Wed, 24 Apr 2013 12:42:45 +0000 (12:42 +0000)]
qlcnic: Update version to 5.2.42

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqlcnic: Add identifying string for 83xx adapter
Himanshu Madhani [Wed, 24 Apr 2013 12:42:44 +0000 (12:42 +0000)]
qlcnic: Add identifying string for 83xx adapter

o Added identifying strings for 8300 Series of adapters.
o updated PCI_VENDOR_ID_QLOGIC and PCI_DEVICE_ID_824X for 8200
  Series adapter.

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqlcnic: Rename the IRQ description.
Himanshu Madhani [Wed, 24 Apr 2013 12:42:43 +0000 (12:42 +0000)]
qlcnic: Rename the IRQ description.

Here's what modified vectors will look like
in the /proc/interrupts

        MSIx              INTx
-----------------------------------------
83xx    qlcnic[MB]
qlcnic-ethX[Rx0]
qlcnic-ethX[Rx1]
..
qlcnic-ethX[RxN]
qlcnic-ethx[Tx0]        qlcnic[MB+Tx0+Rx0]

82xx    qlcnic-ethX[Rx0]
qlcnic-ethX[Rx1]
..
qlcnic-ethX[Tx0+RxN]    qlcnic-ethX[Tx0+Rx0]

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqlcnic: Enable Interrupt Coalescing for 83xx adapter
Himanshu Madhani [Wed, 24 Apr 2013 12:42:42 +0000 (12:42 +0000)]
qlcnic: Enable Interrupt Coalescing for 83xx adapter

Enable Interrupt coalescing through ethtool on 83xx adapter.

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqlcnic: Add eSwitch statistics support
Shahed Shaikh [Wed, 24 Apr 2013 12:42:41 +0000 (12:42 +0000)]
qlcnic: Add eSwitch statistics support

o Read eSwitch statistics from adapter and display them as part
  of ethtool statistics.

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqlcnic: Take EPORT out of reset sequence before disabling PAUSE
Manish Chopra [Wed, 24 Apr 2013 12:42:40 +0000 (12:42 +0000)]
qlcnic: Take EPORT out of reset sequence before disabling PAUSE

o Disabling PAUSE requires access to EPORT registers,
  which may cause a wedge, if EPORT is in reset.

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqlcnic: Enhance channel configuration logs
Manish Chopra [Wed, 24 Apr 2013 12:42:39 +0000 (12:42 +0000)]
qlcnic: Enhance channel configuration logs

o Add logs for various failure conditions during channel configuration.

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'bnx2x'
David S. Miller [Wed, 24 Apr 2013 20:34:00 +0000 (16:34 -0400)]
Merge branch 'bnx2x'

Yuval Mintz says:

====================
This patch series contains several enhancements, as well as small fixes:

  - Patch [1/5] - Prevent a theoretical problem in our GRO implementation.

  - Patch [2/5] - Support Rx/Tx pause control configuration in autoneg.

  - Patch [3/5] - Enhance support for VF's MAC setting and removal.

  - Patch [4/5] - Fix a small memory leak between bnx2x and cnic.

  - Patch [5/5] - Allow bnx2x to recover after a second slot reset.

Please consider applying these patches to `net-next'.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2x: Allow recovery from second slot reset
Yuval Mintz [Wed, 24 Apr 2013 01:45:02 +0000 (01:45 +0000)]
bnx2x: Allow recovery from second slot reset

As part of PCIe Advanced Error Reporting flow, if a fatal PCI error occurs,
the AER driver will cause bnx2x's PCI-core to reset. The driver's PCI error
handlers will in turn restore the PCI configuration space values by calling
`pci_restore_state'.

However, as bnx2x does not save the PCI configuration after restoration,
An additional fatal PCI error will leave the function in an unstable state
until reboot, as the registers in the PCI configuration space will contain
reset values.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2x: Fix memory leak
Yuval Mintz [Wed, 24 Apr 2013 01:45:01 +0000 (01:45 +0000)]
bnx2x: Fix memory leak

There exists an `allocation race' between the CNIC and bnx2x drivers,
in which both drivers allocate the same t2 memory while disregarding a possible
previous allocation.

Additionally, due to the current order of memory releases, some of the
ILT memory in the driver is not released correctly when unloading the driver.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2x: Enhance MAC configuration for VFs
Dmitry Kravkov [Wed, 24 Apr 2013 01:45:00 +0000 (01:45 +0000)]
bnx2x: Enhance MAC configuration for VFs

Improved support for adding/removing vf mac addresses.

This includes the case where HyperVisor forced the address (sampled from
bulletin board), and the case where it did not in which the VF can
configure its own mac address.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2x: Allow RX/TX pause control in autoneg
Yaniv Rosner [Wed, 24 Apr 2013 01:44:59 +0000 (01:44 +0000)]
bnx2x: Allow RX/TX pause control in autoneg

Currently, when link is configured to auto-negotiate the flow control,
disabling RX/TX pause via ethtool doesn't work.

This fixes the behaviour, advertising asymmetric pause in case either one
is exclusively enabled.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2x: prevent GRO false checksum claims
Yuval Mintz [Wed, 24 Apr 2013 01:44:58 +0000 (01:44 +0000)]
bnx2x: prevent GRO false checksum claims

This patch introduces a more robust error handling flow in case of incorrect
behaviour by the FW when passing on GRO aggregations.

Although this should never happen (i.e., this is merely a theoretical fix),
if the bnx2x driver was to receive a GRO from FW with protocol other than
IPv4/IPv6, the driver would falsely claim to have performed partial
checksum and set various incorrect fields in the skb header.

Current behaviour of the bnx2x driver (i.e., print an error) is insufficient.
This patch remedies this by simply preventing the false claims.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'mlx4'
David S. Miller [Wed, 24 Apr 2013 20:30:23 +0000 (16:30 -0400)]
Merge branch 'mlx4'

Or Gerlitz says:

====================
This series adds support for the SRIOV ndo_set_vf callbacks to the mlx4 driver.

Series done against the net-next tree as of commit 0c501345c "batman-adv: fix
global protection fault during soft_iface destruction".

We have successfully tested the series on net-next, except for getting
the VF link info issue I have reported earlier today on netdev, we
see the problem for both ixgbe and mlx4 VFs. Just to make sure get
VF config is working OK with patch #6 - we have run it over 3.8.8 too.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/mlx4_en: Add a service task
Amir Vadai [Tue, 23 Apr 2013 06:06:51 +0000 (06:06 +0000)]
net/mlx4_en: Add a service task

Add a service task to run tasks that needed to be executed periodically.
Currently the only task is a watchdog to catch NIC clock overflow, to make
timestamping accurate.
Will move the statistics task into this framework in a later patch.

Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/mlx4_en: Support software timestamping
Amir Vadai [Tue, 23 Apr 2013 06:06:50 +0000 (06:06 +0000)]
net/mlx4_en: Support software timestamping

Kernel software timestamping requires that the driver calls skb_tx_timestamp
just before passing the skb to the HW MAC layer. This patch adds this call.

Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/mlx4_en: Add HW timestamping (TS) support
Amir Vadai [Tue, 23 Apr 2013 06:06:49 +0000 (06:06 +0000)]
net/mlx4_en: Add HW timestamping (TS) support

The patch allows to enable/disable HW timestamping for incoming and/or
outgoing packets. It adds and initializes all structs and callbacks
needed by kernel TS API.
To enable/disable HW timestamping appropriate ioctl should be used.
Currently HWTSTAMP_FILTER_ALL/NONE and HWTSAMP_TX_ON/OFF only are
supported.
When enabling TS on receive flow - VLAN stripping will be disabled.
Also were made all relevant changes in RX/TX flows to consider TS request
and plant HW timestamps into relevant structures.
mlx4_ib was fixed to compile with new mlx4_cq_alloc() signature.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/mlx4_core: Read HCA frequency and map internal clock
Eugenia Emantayev [Tue, 23 Apr 2013 06:06:48 +0000 (06:06 +0000)]
net/mlx4_core: Read HCA frequency and map internal clock

Read HCA frequency, read PCI clock bar and offset, map internal clock to
PCI bar.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/mlx4_core: Add timestamping device capability
Eugenia Emantayev [Tue, 23 Apr 2013 06:06:47 +0000 (06:06 +0000)]
net/mlx4_core: Add timestamping device capability

Add new device capability for timestamping support and query FW to retrieve it.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville...
David S. Miller [Wed, 24 Apr 2013 20:27:02 +0000 (16:27 -0400)]
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next

John W. Linville says:

====================
Here is one last(?) big wireless bits pull request before the merge window...

Regarding the mac80211 bits, Johannes says:

"Here's another big pull request for the -next stream. This one has a ton
of driver updates, which hopefully addresses all drivers, but maybe you
have more new drivers than I have in my tree? Not entirely sure, let me
know if this is the case and then I can merge wireless-next.

I'm including a large number of small changes, see the shortlog. The two
bigger things are making VHT compatible with not using channel contexts
(from Karl) and the stop-while-suspended fixes I developed together with
Stanislaw."

...and...

"This time I have a relatively large number of fixes and small
improvements, the most important one being Bob's RCU fix. The two big
things are Felix's work on rate scaling tables (with a big thanks to
Karl too) and my own work on CSA handling to finally properly handle HT
(and some VHT.)"

As for the iwlwifi bits, Johannes says:

"The biggest work here is Bluetooth coexistence and power saving. Other
than that, I have a few small fixes that weren't really needed for 3.9
and a new PCI ID."

About the NFC bits, Samuel says:

"With this one we have:

- A major pn533 update. The pn533 framing support has been changed in order to
  easily support all pn533 derivatives. For example we now support the ACR122
  USB dongle.

- An NFC MEI physical layer code factorization through the mei_phy NFC API.
  Both the microread and the pn544 drivers now use it.

- LLCP aggregation support. This allows NFC p2p devices to send aggregated
  frames containing all sort of LLCP frames except SYMM and aggregation
  frames.

- More LLCP socket options for getting the remote device link parameters.

- Fixes for the LLCP socket option code added with the first pull request for
  3.10.

- Some support for LLCP corner cases like 0 length SDUs and general DISC
  (tagged with a 0,0 dsap ssap couple) handling.

- RFKILL support for NFC."

For the b43 bits, Rafał says:

"Let me remind the changes for b43:
> Changes include:
> 1) Minor improvements for HT-PHY code (BCM4331)
> 2) Code cleaning for HT-PHY and N-PHY"

Concerning the bluetooth bits, Gustavo says:

"A set of changes intended for 3.10. The biggest changes here are from David
Herrmann, he rewrote most of the HIDP layer making it more reliable. Marcel
added a driver setup stage for device that need special handling on their
early initialization. Other than that we have the usual clean ups, bugfixes
and small improvements."

Along with all that, there is the usual collection of random/various
updates to ath9k, mwifiex, brcmfmac, brcmsmac, rt2x00, and wil6210.

I also included a pull of the wireless tree to resolve a merge conflict.

Please let me know if there are problems!
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonetlink: fix compilation after memory mapped patches
Nicolas Dichtel [Wed, 24 Apr 2013 08:36:23 +0000 (10:36 +0200)]
netlink: fix compilation after memory mapped patches

Depending of the kernel configuration (CONFIG_UIDGID_STRICT_TYPE_CHECKS), we can
get the following errors:

net/netlink/af_netlink.c: In function ‘netlink_queue_mmaped_skb’:
net/netlink/af_netlink.c:663:14: error: incompatible types when assigning to type ‘__u32’ from type ‘kuid_t’
net/netlink/af_netlink.c:664:14: error: incompatible types when assigning to type ‘__u32’ from type ‘kgid_t’
net/netlink/af_netlink.c: In function ‘netlink_ring_set_copied’:
net/netlink/af_netlink.c:693:14: error: incompatible types when assigning to type ‘__u32’ from type ‘kuid_t’
net/netlink/af_netlink.c:694:14: error: incompatible types when assigning to type ‘__u32’ from type ‘kgid_t’

We must use the helpers to get the uid and gid, and also take care of user_ns.

Fix suggested by Eric W. Biederman <ebiederm@xmission.com>.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Wed, 24 Apr 2013 14:54:20 +0000 (10:54 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem

11 years agonetlink: Fix build with mmap disabled.
David S. Miller [Tue, 23 Apr 2013 19:39:03 +0000 (15:39 -0400)]
netlink: Fix build with mmap disabled.

net/netlink/diag.c: In function 'sk_diag_put_rings_cfg':
net/netlink/diag.c:28:17: error: 'struct netlink_sock' has no member named 'pg_vec_lock'
net/netlink/diag.c:29:29: error: 'struct netlink_sock' has no member named 'rx_ring'
net/netlink/diag.c:31:30: error: 'struct netlink_sock' has no member named 'tx_ring'
net/netlink/diag.c:33:19: error: 'struct netlink_sock' has no member named 'pg_vec_lock'

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agomwifiex: rework round robin scheduling of bss nodes. master-2013-04-23-2
Andreas Fenkart [Thu, 18 Apr 2013 23:34:12 +0000 (16:34 -0700)]
mwifiex: rework round robin scheduling of bss nodes.

Rotate bss prio list, so the bss next to the one served, will come first
in the list of bss' with equal priority. This way we pick bss nodes in a
round robin fashion. Using list rotation instead of a cur ptr simplifies
iteration to calling list_for_each_entry. List rotation is done via
list_move, where the head itself is temporarily removed and then
re-inserted after the bss just served.

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: replace ra_list_curr by list rotation.
Andreas Fenkart [Thu, 18 Apr 2013 23:33:45 +0000 (16:33 -0700)]
mwifiex: replace ra_list_curr by list rotation.

After a packet is successfully transmitted, ra list is rotated, so the ra
next to the one transmitted, will be the first in the list. This way we
pick the ra' in a round robin fashion. This significantly simplifies
iteration in  mwifiex_wmm_get_highest_priolist_ptr to a call to
list_for_each_entry.
List rotation is done via list_move, where the head itself is temporarily
removed and then re-inserted after the item just transferred.

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: add credit borrowing mechanism master-2013-04-23
Arend van Spriel [Tue, 23 Apr 2013 10:53:15 +0000 (12:53 +0200)]
brcmfmac: add credit borrowing mechanism

The firmware provides credits to the driver per WMM-AC. When
only AC_BE are to be transmitted to the firmware the driver
may use credits from other priorities to send AC_BE packets
towards the firmware.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: correct error handling in brcmf_fws_init()
Arend van Spriel [Tue, 23 Apr 2013 10:53:14 +0000 (12:53 +0200)]
brcmfmac: correct error handling in brcmf_fws_init()

In brcmf_fws_init() the error flows were not properly handled
and the caller ignored the return value. The only action that
is allowed to fail in brcmf_fws_init() is setting the tlv in
firmware as the feature is not supported on all devices.

Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: flush queue upon MACDESC_DEL firmware signal
Arend van Spriel [Tue, 23 Apr 2013 10:53:13 +0000 (12:53 +0200)]
brcmfmac: flush queue upon MACDESC_DEL firmware signal

When firmware signals the driver to remove a destination entry
it may have sk_buff packets queued for it. These should be freed.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
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: support critical protocol API for DHCP
Piotr Haber [Tue, 23 Apr 2013 10:53:12 +0000 (12:53 +0200)]
brcmfmac: support critical protocol API for DHCP

Adds support for the critical protocol API provided by nl80211
which gives Wifi traffic priority over a Bluetooth (e)SCO connection
and disables scanning during DCHP negotiation.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: allow scanning to be suppressed in the driver
Arend van Spriel [Tue, 23 Apr 2013 10:53:11 +0000 (12:53 +0200)]
brcmfmac: allow scanning to be suppressed in the driver

During the DHCP protocol exchange it is benificial to suppress
scan requests which may decrease time to complete DHCP protocol.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Fix RX DMA mapping
Sujith Manoharan [Tue, 23 Apr 2013 06:52:19 +0000 (12:22 +0530)]
ath9k: Fix RX DMA mapping

After the commit "ath9k: improve dma map failure handling", the
wrong buffer was DMA-unmapped, introducing warnings like the one below.
This patch fixes the issue.

WARNING: at /home/sujith/dev/wireless-testing/lib/dma-debug.c:986 check_sync+0x4bc/0x580()
Hardware name: LIFEBOOK AH531
ath9k 0000:02:00.0: DMA-API: device driver tries to sync DMA memory it has not allocated [device address=0x00000000d9012800] [size=48 bytes]
Pid: 86, comm: kworker/u:5 Tainted: G        W  O 3.9.0-rc8-wl-debug #106
Call Trace:
 [<ffffffff810410c0>] warn_slowpath_common+0x70/0xa0
 [<ffffffff8104113c>] warn_slowpath_fmt+0x4c/0x50
 [<ffffffff8125432c>] check_sync+0x4bc/0x580
 [<ffffffff8109e5f7>] ? trace_hardirqs_on_caller+0xa7/0x190
 [<ffffffff8109e6ed>] ? trace_hardirqs_on+0xd/0x10
 [<ffffffff81254488>] debug_dma_sync_single_for_device+0x48/0x50
 [<ffffffffa0a53825>] ? ath9k_iowrite32+0x35/0x90 [ath9k]
 [<ffffffff812512f0>] ? swiotlb_tbl_sync_single+0x50/0x90
 [<ffffffff81251350>] ? swiotlb_sync_single+0x20/0x30
 [<ffffffff8125137f>] ? swiotlb_sync_single_for_device+0xf/0x20
 [<ffffffffa0a58baf>] ath_rx_edma_buf_link+0xef/0x140 [ath9k]
 [<ffffffffa0a58c4e>] ath_rx_addbuffer_edma+0x4e/0x90 [ath9k]
 [<ffffffffa0a59c51>] ath_startrecv+0xf1/0x120 [ath9k]
 [<ffffffffa0a550e0>] ath_complete_reset+0x20/0x130 [ath9k]
 [<ffffffffa0a5790d>] ath_reset_internal+0x10d/0x210 [ath9k]
 [<ffffffffa0a5878c>] ath9k_config+0x47c/0x7b0 [ath9k]
 [<ffffffffa06d4978>] ieee80211_hw_config+0x88/0x3f0 [mac80211]
 [<ffffffffa06d4a3f>] ? ieee80211_hw_config+0x14f/0x3f0 [mac80211]
 [<ffffffffa06dbed1>] __ieee80211_scan_completed+0xc1/0x440 [mac80211]
 [<ffffffffa06dd002>] ieee80211_scan_work+0x82/0x440 [mac80211]
 [<ffffffff810606a3>] process_one_work+0x1e3/0x530
 [<ffffffff81060641>] ? process_one_work+0x181/0x530
 [<ffffffff8106163f>] worker_thread+0x10f/0x3c0
 [<ffffffff81061530>] ? manage_workers+0x330/0x330
 [<ffffffff810665da>] kthread+0xea/0xf0
 [<ffffffff810664f0>] ? kthread_create_on_node+0x140/0x140
 [<ffffffff8146085c>] ret_from_fork+0x7c/0xb0
 [<ffffffff810664f0>] ? kthread_create_on_node+0x140/0x140

Cc: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Use lockless variants for the RX fifo queue
Sujith Manoharan [Tue, 23 Apr 2013 06:52:18 +0000 (12:22 +0530)]
ath9k: Use lockless variants for the RX fifo queue

The RX fifo can be accessed from the common tasklet or it can
be reaped/cleaned when RX is stopped, which is done when doing
a reset or channel change - this happens in process context.

Since it is ensured that there are no pending tasklets when
stopping RX and cleaning the FIFO, there is no need to use
SKB queue functions which take internal locks.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Reduce deep indentation
Sujith Manoharan [Tue, 23 Apr 2013 06:52:17 +0000 (12:22 +0530)]
ath9k: Reduce deep indentation

The EDMA case is handled first, so the else condition
can be removed.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Remove unused argument "size"
Sujith Manoharan [Tue, 23 Apr 2013 06:52:16 +0000 (12:22 +0530)]
ath9k: Remove unused argument "size"

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: add support for the new rate control API
Felix Fietkau [Mon, 22 Apr 2013 21:11:44 +0000 (23:11 +0200)]
ath9k: add support for the new rate control API

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: merge ath_tx_start_dma into ath_tx_start
Felix Fietkau [Mon, 22 Apr 2013 21:11:43 +0000 (23:11 +0200)]
ath9k: merge ath_tx_start_dma into ath_tx_start

The split makes no sense and merging the functions makes further changes
easier to implement

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agortl8192c:dm: Properly initialize local array and set value.
Han Shen [Mon, 22 Apr 2013 20:35:07 +0000 (13:35 -0700)]
rtl8192c:dm: Properly initialize local array and set value.

GCC 4.8 is spitting out uninitialized-variable warnings against
"drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c".  This patch adds
initialization to the variable and properly sets its value.

Signed-off-by: Han Shen (shenhan@google.com)
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: apply coverage class on slottime too
Mathias Kretschmer [Mon, 22 Apr 2013 20:34:41 +0000 (22:34 +0200)]
ath9k: apply coverage class on slottime too

According to 802.11-2007 17.3.8.6 (slot time), the slot time should
be increased by 3 us * coverage class. The code only increased the
ack timeout, which is fixed by this patch.

We have noticed in our long shot scenario that we see less collisions
with this patch.

Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
[add standard reference and commit message]
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'master' of git://git.infradead.org/users/rafal/b43-next
John W. Linville [Tue, 23 Apr 2013 18:10:10 +0000 (14:10 -0400)]
Merge branch 'master' of git://git.infradead.org/users/rafal/b43-next

11 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
John W. Linville [Tue, 23 Apr 2013 18:09:39 +0000 (14:09 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless

Conflicts:
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c

11 years agocaif: Update Dmitry's email address.
sjur.brandeland@stericsson.com [Mon, 22 Apr 2013 23:57:03 +0000 (23:57 +0000)]
caif: Update Dmitry's email address.

Dmitry's address will start bouncing in a few days,
update to his new mail address.

Cc: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com>
Cc: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agocaif: Remove bouncing address for Daniel Martensson
sjur.brandeland@stericsson.com [Mon, 22 Apr 2013 23:57:02 +0000 (23:57 +0000)]
caif: Remove bouncing address for Daniel Martensson

cc: Daniel Martensson <Daniel.Martensson@stericsson.com>
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agocaif: Remove my bouncing email address.
sjur.brandeland@stericsson.com [Mon, 22 Apr 2013 23:57:01 +0000 (23:57 +0000)]
caif: Remove my bouncing email address.

Remove my soon bouncing email address.
Also remove the "Contact:" line in file header.
The MAINTAINERS file is a better place to find the
contact person anyway.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMAINTAINERS: Change Maintainer for CAIF
sjur.brandeland@stericsson.com [Mon, 22 Apr 2013 23:57:00 +0000 (23:57 +0000)]
MAINTAINERS: Change Maintainer for CAIF

Dmitry Tarnyagin will take over as maintainer for CAIF.

Cc: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com>
Cc: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonetlink: fix typo in net/netlink/af_netlink.c
Stephen Rothwell [Tue, 23 Apr 2013 07:40:35 +0000 (17:40 +1000)]
netlink: fix typo in net/netlink/af_netlink.c

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agob43: N-PHY: don't use deprecated b43_radio_foo16
Rafał Miłecki [Fri, 12 Apr 2013 15:58:13 +0000 (17:58 +0200)]
b43: N-PHY: don't use deprecated b43_radio_foo16

All radio ops are 16b (there is only 1 exception for reg 0x1), so we
deprecated b43_radio_read16 and b43_radio_write16 long time ago.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: clean init tables
Rafał Miłecki [Sun, 31 Mar 2013 18:00:45 +0000 (20:00 +0200)]
b43: N-PHY: clean init tables

Sort defines, use one macro for all revs, support for 5GHz when
uploading antenna table.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: move tables init function to tables file
Rafał Miłecki [Sat, 30 Mar 2013 23:40:21 +0000 (00:40 +0100)]
b43: N-PHY: move tables init function to tables file

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: use defines for (re)storing VCM config
Rafał Miłecki [Sat, 30 Mar 2013 21:34:40 +0000 (22:34 +0100)]
b43: N-PHY: use defines for (re)storing VCM config

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: use shortcut "ctl" in functions names
Rafał Miłecki [Sat, 30 Mar 2013 20:50:46 +0000 (21:50 +0100)]
b43: N-PHY: use shortcut "ctl" in functions names

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: use enum for INTC override function argument
Rafał Miłecki [Fri, 29 Mar 2013 10:37:02 +0000 (11:37 +0100)]
b43: N-PHY: use enum for INTC override function argument

Also make a function name shorter so we can easily fit 80 chars.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: define missing registers
Rafał Miłecki [Fri, 29 Mar 2013 10:13:40 +0000 (11:13 +0100)]
b43: N-PHY: define missing registers

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: use defines for board_type
Rafał Miłecki [Thu, 28 Mar 2013 21:25:38 +0000 (22:25 +0100)]
b43: use defines for board_type

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: fix "NB" RSSI calibration on PHYs rev2-
Rafał Miłecki [Wed, 20 Mar 2013 18:13:47 +0000 (19:13 +0100)]
b43: N-PHY: fix "NB" RSSI calibration on PHYs rev2-

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: use enum for RSSI type everywhere we use it
Rafał Miłecki [Wed, 20 Mar 2013 17:24:47 +0000 (18:24 +0100)]
b43: N-PHY: use enum for RSSI type everywhere we use it

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: rename RSSI types to be shorter and more accurate
Rafał Miłecki [Wed, 20 Mar 2013 16:30:38 +0000 (17:30 +0100)]
b43: N-PHY: rename RSSI types to be shorter and more accurate

Thanks to Broadcom releasing some code we can use better names.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: use more friendly variables names in RSSI code
Rafał Miłecki [Wed, 20 Mar 2013 16:26:03 +0000 (17:26 +0100)]
b43: N-PHY: use more friendly variables names in RSSI code

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: simplify conditions in RSSI offset scale function
Rafał Miłecki [Wed, 20 Mar 2013 15:57:04 +0000 (16:57 +0100)]
b43: N-PHY: simplify conditions in RSSI offset scale function

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: use enum for RAIL type
Rafał Miłecki [Wed, 20 Mar 2013 15:51:39 +0000 (16:51 +0100)]
b43: N-PHY: use enum for RAIL type

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: use enum for RSSI types
Rafał Miłecki [Tue, 19 Mar 2013 17:12:00 +0000 (18:12 +0100)]
b43: HT-PHY: use enum for RSSI types

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: store TX power state before disabling it
Rafał Miłecki [Sun, 17 Mar 2013 18:49:08 +0000 (19:49 +0100)]
b43: HT-PHY: store TX power state before disabling it

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: define regs for power estimation
Rafał Miłecki [Sun, 17 Mar 2013 18:08:15 +0000 (19:08 +0100)]
b43: HT-PHY: define regs for power estimation

In MMIO dumps of ndiswrapper there are following PHY ops:
phy_read(0x0118) -> 0x013d
phy_read(0x01ed) -> 0x993d
phy_read(0x0119) -> 0x012f
phy_read(0x01ee) -> 0x992f
phy_read(0x011a) -> 0x0139
phy_read(0x0969) -> 0x9939
It matches the code of wlc_phy_txpower_est_power_nphy (from brcm80211),
so we know the registers meaning.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: do some extra TSSI setup after configuring TX
Rafał Miłecki [Sat, 16 Mar 2013 22:57:10 +0000 (23:57 +0100)]
b43: HT-PHY: do some extra TSSI setup after configuring TX

After b43_phy_ht_tx_power_ctl_setup there are some extra radio ops:
 radio_read(0x08bf) -> 0x0001
radio_write(0x08bf) <- 0x0001
radio_write(0x0159) <- 0x0011
On N-PHY we write 0x11 to TSSI regs, so it's probably sth similar.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: finish calculating values for idle TSSI
Rafał Miłecki [Sat, 16 Mar 2013 22:47:29 +0000 (23:47 +0100)]
b43: HT-PHY: finish calculating values for idle TSSI

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: tables: don't duplicate core-generic regs
Rafał Miłecki [Sat, 16 Mar 2013 22:40:01 +0000 (23:40 +0100)]
b43: HT-PHY: tables: don't duplicate core-generic regs

Now when we know many radio regs at 0x000 are core-generic, I've noticed
we duplicate some values in the tables.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: rename defines addressing cores on the 2059 radio
Rafał Miłecki [Sat, 16 Mar 2013 22:24:21 +0000 (23:24 +0100)]
b43: HT-PHY: rename defines addressing cores on the 2059 radio

After comparing writes to registers at 0x000, 0x400 and 0x800 it seems
there are many very similar writes. So 0x000 offset is not for accessing
something totally different, but probably just the first out of three
cores.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agoipvs: Use network byte order for sync message size
Simon Horman [Fri, 19 Apr 2013 01:43:44 +0000 (10:43 +0900)]
ipvs: Use network byte order for sync message size

struct ip_vs_sync_mesg and ip_vs_sync_mesg_v0 are both sent across the wire
and used internally to store IPVS synchronisation messages.

Up until now the scheme used has been to convert the size field
to network byte order before sending a message on the wire and
convert it to host byte order when sending a message.

This patch changes that scheme to always treat the field
as being network byte order. This seems appropriate as
the structure is sent across the wire. And by consistently
treating the field has network byte order it is now possible
to take advantage of sparse to flag any future miss-use.

Acked-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agoipvs: off by one in set_sctp_state()
Dan Carpenter [Sat, 20 Apr 2013 11:24:55 +0000 (14:24 +0300)]
ipvs: off by one in set_sctp_state()

The sctp_events[] come from sch->type in set_sctp_state().  They are
between 0-255 so that means we need 256 elements in the array.

I believe that because of how the code is aligned there is normally a
hole after sctp_events[] so this patch doesn't actually change anything.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agoipvs: Use min3() in ip_vs_dbg_callid()
Simon Horman [Fri, 19 Apr 2013 01:33:59 +0000 (10:33 +0900)]
ipvs: Use min3() in ip_vs_dbg_callid()

There are two motivations for this:

1. It improves readability to my eyes
2. Using nested min() calls results in a shadowed _min1 variable,
   which is a bit untidy. Sparse complained about this.

I have also replaced (size_t)64 with a variable of type size_t and value 64.
This also improves readability to my eyes.

Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agoipvs: Avoid shadowing net variable in ip_vs_leave()
Simon Horman [Fri, 19 Apr 2013 01:25:42 +0000 (10:25 +0900)]
ipvs: Avoid shadowing net variable in ip_vs_leave()

Flagged by sparse.
Compile and sparse tested only.

Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agoipvs: fix sparse warnings for some parameters
Julian Anastasov [Wed, 17 Apr 2013 20:50:49 +0000 (23:50 +0300)]
ipvs: fix sparse warnings for some parameters

Some service fields are in network order:

- netmask: used once in network order and also as prefix len for IPv6
- port

Other parameters are in host order:

- struct ip_vs_flags: flags and mask moved between user and kernel only
- sync state: moved between user and kernel only
- syncid: sent over network as single octet

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agoipvs: fix sparse warnings in lblc and lblcr
Julian Anastasov [Wed, 17 Apr 2013 20:50:47 +0000 (23:50 +0300)]
ipvs: fix sparse warnings in lblc and lblcr

kbuild test robot reports for sparse warnings in
commits c2a4ffb70eef39 ("ipvs: convert lblc scheduler to rcu")
and c5549571f975ab ("ipvs: convert lblcr scheduler to rcu").

Fix it by removing extra __rcu annotation.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agoipvs: fix the remaining sparse warnings in ip_vs_ctl.c
Julian Anastasov [Wed, 17 Apr 2013 20:50:50 +0000 (23:50 +0300)]
ipvs: fix the remaining sparse warnings in ip_vs_ctl.c

- RCU annotations for ip_vs_info_seq_start and _stop
- __percpu for cpustats
- properly dereference svc->pe in ip_vs_genl_fill_service

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agoipvs: fix sparse warnings for ip_vs_conn listing
Julian Anastasov [Wed, 17 Apr 2013 20:50:46 +0000 (23:50 +0300)]
ipvs: fix sparse warnings for ip_vs_conn listing

kbuild test robot reports for sparse warnings
in commit 088339a57d6042 ("ipvs: convert connection locking"):

net/netfilter/ipvs/ip_vs_conn.c:962:13: warning: context imbalance
in 'ip_vs_conn_array' - wrong count at exit
include/linux/rcupdate.h:326:30: warning: context imbalance in
'ip_vs_conn_seq_next' - unexpected unlock
include/linux/rcupdate.h:326:30: warning: context imbalance in
'ip_vs_conn_seq_stop' - unexpected unlock

Fix it by running ip_vs_conn_array under RCU lock
to avoid conditional locking and by adding proper RCU
annotations.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agoipvs: properly dereference dest_dst in ip_vs_forget_dev
Julian Anastasov [Wed, 17 Apr 2013 20:50:45 +0000 (23:50 +0300)]
ipvs: properly dereference dest_dst in ip_vs_forget_dev

Use rcu_dereference_protected to resolve
sparse warning, found by kbuild test robot:

net/netfilter/ipvs/ip_vs_ctl.c:1464:35: warning: dereference of
noderef expression

Problem from commit 026ace060dfe29
("ipvs: optimize dst usage for real server")

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agobatman-adv: fix global protection fault during soft_iface destruction
Antonio Quartulli [Fri, 19 Apr 2013 09:04:52 +0000 (11:04 +0200)]
batman-adv: fix global protection fault during soft_iface destruction

batadv_mesh_free() schedules some RCU callbacks which need the bat_priv struct
to do their jobs, while free_netdev(), which is called immediately after, is
destroying the private data.

Put an rcu_barrier() in the middle so that free_netdev() is invoked only after
all the callbacks returned.

This bug has been introduced by ab8f433dd39be94e8617cff2dfe9f7eca162eb15
("batman-adv: Move deinitialization of soft-interface to destructor")

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
David S. Miller [Tue, 23 Apr 2013 00:32:51 +0000 (20:32 -0400)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Conflicts:
drivers/net/ethernet/emulex/benet/be_main.c
drivers/net/ethernet/intel/igb/igb_main.c
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
include/net/scm.h
net/batman-adv/routing.c
net/ipv4/tcp_input.c

The e{uid,gid} --> {uid,gid} credentials fix conflicted with the
cleanup in net-next to now pass cred structs around.

The be2net driver had a bug fix in 'net' that overlapped with the VLAN
interface changes by Patrick McHardy in net-next.

An IGB conflict existed because in 'net' the build_skb() support was
reverted, and in 'net-next' there was a comment style fix within that
code.

Several batman-adv conflicts were resolved by making sure that all
calls to batadv_is_my_mac() are changed to have a new bat_priv first
argument.

Eric Dumazet's TS ECR fix in TCP in 'net' conflicted with the F-RTO
rewrite in 'net-next', mostly overlapping changes.

Thanks to Stephen Rothwell and Antonio Quartulli for help with several
of these merge resolutions.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: Fix vlan bitmask changes in EHEA driver.
David S. Miller [Mon, 22 Apr 2013 23:34:34 +0000 (19:34 -0400)]
net: Fix vlan bitmask changes in EHEA driver.

This driver uses the crummy "| foo" style, putting the
logical operation at the beginning of lines.  Then
when the VLAN tag flag bits got changed the operator
ended up at both the end and the beginning of some lines.

Fix the build error by having it uniformly use the operator
at the end of the line.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: Fix some __vlan_hwaccel_put_tag() callers.
David S. Miller [Mon, 22 Apr 2013 23:24:19 +0000 (19:24 -0400)]
net: Fix some __vlan_hwaccel_put_tag() callers.

Several call sites were missed when the protocol argument was added to
__vlan_hwaccel_put_tag() in commit
86a9bad3ab6b6f858fd4443b48738cabbb6d094c ("net: vlan: add protocol
argument to packet tagging functions").

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: sctp: minor: remove dead code from sctp_packet
Daniel Borkmann [Thu, 18 Apr 2013 21:59:37 +0000 (21:59 +0000)]
net: sctp: minor: remove dead code from sctp_packet

struct sctp_packet is currently embedded into sctp_transport or
sits on the stack as 'singleton' in sctp_outq_flush(). Therefore,
its member 'malloced' is always 0, thus a kfree() is never called.
Because of that, we can just remove this code.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoVXLAN: Allow L2 redirection with L3 switching
David Stevens [Fri, 19 Apr 2013 00:36:26 +0000 (00:36 +0000)]
VXLAN: Allow L2 redirection with L3 switching

Allow L2 redirection when VXLAN L3 switching is enabled

This patch restricts L3 switching to destination MAC addresses that are
marked as routers in order to allow virtual IP appliances that do L2
redirection to function with VXLAN L3 switching enabled.

We use L3 switching on VXLAN networks to avoid extra hops when the nominal
router for cross-subnet traffic for a VM is remote and the ultimate
destination may be local, or closer to the local node. Currently, the
destination IP address takes precedence over the MAC address in all cases.
Some network appliances receive packets for a virtualized IP address and
redirect by changing the destination MAC address (only) to be the final
destination for packet processing. VXLAN tunnel endpoints with L3 switching
enabled may then overwrite this destination MAC address based on the packet IP
address, resulting in potential loops and, at least, breaking L2 redirections
that travel through tunnel endpoints.

This patch limits L3 switching to the intended case where the original
destination MAC address is a next-hop router and relies on the destination
MAC address for all other cases, thus allowing L2 redirection and L3 switching
to coexist peacefully.

Signed-Off-By: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: Remove return value from list_netdevice()
dingtianhong [Wed, 17 Apr 2013 22:17:50 +0000 (22:17 +0000)]
net: Remove return value from list_netdevice()

The return value from list_netdevice() is not used and no need, so remove it.

Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: remove a stale comment for dl_next
Eric Dumazet [Fri, 19 Apr 2013 21:29:25 +0000 (14:29 -0700)]
net: remove a stale comment for dl_next

dl_next member in struct request_sock doesn't need to be first.

We expect to insert a "struct common_sock" or a subset of it,
so this claim had to be verified.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqeth: Fix missing pointer update
Stefan Raspl [Mon, 22 Apr 2013 01:12:29 +0000 (01:12 +0000)]
qeth: Fix missing pointer update

qeth_hdr_chk_and_bounce() can possibly shift the skb->data
pointer. However, the existing code didn't update the hdr pointer,
which should point to skb->data, accordingly.
Symptoms of this issue are sporadic recoveries.

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqeth: remove unused variable
Stefan Raspl [Mon, 22 Apr 2013 01:12:28 +0000 (01:12 +0000)]
qeth: remove unused variable

remove unused variable

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqeth: remove cast for kzalloc return value
Zhang Yanfei [Mon, 22 Apr 2013 01:12:27 +0000 (01:12 +0000)]
qeth: remove cast for kzalloc return value

remove cast for kzalloc return value.

Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agomwifiex: remove redundant initialization for bss_descriptor master-2013-04-22-2
Bing Zhao [Fri, 12 Apr 2013 17:34:18 +0000 (10:34 -0700)]
mwifiex: remove redundant initialization for bss_descriptor

Initialization of bss_descriptor is unnecessary as the entire
structure will be overwritten by a memcpy followed by.

Initialize disable_11ac flag properly by setting it to true in
mwifiex_fill_new_bss_desc().

Reported-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: fix use-after-free in beacon_ie processing
Bing Zhao [Fri, 12 Apr 2013 17:34:17 +0000 (10:34 -0700)]
mwifiex: fix use-after-free in beacon_ie processing

beacon_ie buffer is allocated in mwifiex_fill_new_bss_desc()
and the buffer pointer is saved in bss_desc->beacon_buf.
beacon_ie is freed before the function returns. However,
bss_desc->beacon_buf is still being accessed afterwards.

Fix it by freeing beacon_ie (bss_desc->beacon_buf) in
caller's scope.

Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoxen-netback: don't disconnect frontend when seeing oversize packet
Wei Liu [Mon, 22 Apr 2013 02:20:43 +0000 (02:20 +0000)]
xen-netback: don't disconnect frontend when seeing oversize packet

Some frontend drivers are sending packets > 64 KiB in length. This length
overflows the length field in the first slot making the following slots have
an invalid length.

Turn this error back into a non-fatal error by dropping the packet. To avoid
having the following slots having fatal errors, consume all slots in the
packet.

This does not reopen the security hole in XSA-39 as if the packet as an
invalid number of slots it will still hit fatal error case.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoxen-netback: coalesce slots in TX path and fix regressions
Wei Liu [Mon, 22 Apr 2013 02:20:42 +0000 (02:20 +0000)]
xen-netback: coalesce slots in TX path and fix regressions

This patch tries to coalesce tx requests when constructing grant copy
structures. It enables netback to deal with situation when frontend's
MAX_SKB_FRAGS is larger than backend's MAX_SKB_FRAGS.

With the help of coalescing, this patch tries to address two regressions
avoid reopening the security hole in XSA-39.

Regression 1. The reduction of the number of supported ring entries (slots)
per packet (from 18 to 17). This regression has been around for some time but
remains unnoticed until XSA-39 security fix. This is fixed by coalescing
slots.

Regression 2. The XSA-39 security fix turning "too many frags" errors from
just dropping the packet to a fatal error and disabling the VIF. This is fixed
by coalescing slots (handling 18 slots when backend's MAX_SKB_FRAGS is 17)
which rules out false positive (using 18 slots is legit) and dropping packets
using 19 to `max_skb_slots` slots.

To avoid reopening security hole in XSA-39, frontend sending packet using more
than max_skb_slots is considered malicious.

The behavior of netback for packet is thus:

    1-18            slots: valid
   19-max_skb_slots slots: drop and respond with an error
   max_skb_slots+   slots: fatal error

max_skb_slots is configurable by admin, default value is 20.

Also change variable name from "frags" to "slots" in netbk_count_requests.

Please note that RX path still has dependency on MAX_SKB_FRAGS. This will be
fixed with separate patch.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoxen-netfront: reduce gso_max_size to account for max TCP header
Wei Liu [Mon, 22 Apr 2013 02:20:41 +0000 (02:20 +0000)]
xen-netfront: reduce gso_max_size to account for max TCP header

The maximum packet including header that can be handled by netfront / netback
wire format is 65535. Reduce gso_max_size accordingly.

Drop skb and print warning when skb->len > 65535. This can 1) save the effort
to send malformed packet to netback, 2) help spotting misconfiguration of
netfront in the future.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoxen-netfront: frags -> slots in log message
Wei Liu [Mon, 22 Apr 2013 02:20:40 +0000 (02:20 +0000)]
xen-netfront: frags -> slots in log message

Also fix a typo in comment.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: enable IOMMU pass through for be2net
Craig Hada [Sun, 21 Apr 2013 23:28:18 +0000 (23:28 +0000)]
be2net: enable IOMMU pass through for be2net

This patch sets the coherent DMA mask to 64-bit after the be2net driver has
been acknowledged that the system is 64-bit DMA capable. The coherent DMA
mask is examined by the Intel IOMMU driver to determine whether to allow
pass through context mapping for all devices. With this patch, the be2net
driver combined with be2net compatible hardware provides comparable
performance to the case where vt-d is disabled. The main use-case for this
change is to decrease the time necessary to copy virtual machine memory
during KVM live migration instantiations.

This patch was tested on a system that enables the IOMMU in non-coherent
mode. Two DMA remapper issues were encountered in the previous version and
both patches have been committed.
    commit ea2447f700cab264019b52e2b417d689e052dcfd
    commit 2e12bc29fc5a12242d68e11875db3dd58efad9ff

Signed-off-by: Craig Hada <craig.hada@hp.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: Use GET_PROFILE_CONFIG V1 cmd for BE3-R
Vasundhara Volam [Sun, 21 Apr 2013 23:28:17 +0000 (23:28 +0000)]
be2net: Use GET_PROFILE_CONFIG V1 cmd for BE3-R

Use GET_PROFILE_CONFIG_V1 cmd for BE3-R, to query the maximum number of
TX rings available per function. On SH-R the same is queried via the
GET_FUNCTION_CONFIG cmd.

Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: Avoid flashing BE3 UFI on BE3-R chip.
Vasundhara Volam [Sun, 21 Apr 2013 23:28:16 +0000 (23:28 +0000)]
be2net: Avoid flashing BE3 UFI on BE3-R chip.

Avoid flashing BE3 UFI on BE3-R chip by verifying asic_revision
number of the chip.

Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: Don't log "Out of MCCQ wrbs" error
Vasundhara Volam [Sun, 21 Apr 2013 23:28:15 +0000 (23:28 +0000)]
be2net: Don't log "Out of MCCQ wrbs" error

Don't log "Out of MCCQ wrbs" msg. When the driver doesn't receive any
response from the FW it already logs a "FW not responding" message.
The driver runs out of MCCQ wrbs much later. Also, this message can
swamp the kernel log in HW/FW error scenarios.

Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: Use TXQ_CREATE_V2 cmd
Vasundhara Volam [Sun, 21 Apr 2013 23:28:14 +0000 (23:28 +0000)]
be2net: Use TXQ_CREATE_V2 cmd

Skyhawk-R and BE3-R (SuperNIC profile) require V2 version
of TXQ_CREATE cmd to be used.

Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2x: update version to 1.78.17-0
Dmitry Kravkov [Mon, 22 Apr 2013 03:48:11 +0000 (03:48 +0000)]
bnx2x: update version to 1.78.17-0

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>