net/phy: micrel: Disable asymmetric pause for KSZ9031

The KSZ9031 appears to suffer from the same hardware bug as described
for the KSZ9021 in commit 32fcafbcd1c9f6c7013016a22a5369b4acb93577
("net/phy: micrel: Disable asymmetric pause for KSZ9021")
you have to unplug the cable and plug it back to get it to work.

Remove the SUPPORTED_Asym_Pause flag for the KSZ9031 to fix this.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: David S. Miller <davem@davemloft.net>
net: fix creation adjacent device symlinks

__netdev_adjacent_dev_insert may add adjust device of different net
namespace, without proper check it leads to emergence of broken
sysfs links from/to devices in another namespace.
Fix: rewrite netdev_adjacent_is_neigh_list macro as a function,
     move net_eq check into netdev_adjacent_is_neigh_list.
     (thanks David)
     related to: 4c75431ac3520631f1d9e74aa88407e6374dbbc4

Signed-off-by: Alexander Fomichev <git.user@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
brcmfmac: Fix memory leak and missing assignment.

The function brcmf_enable_bw40_2g contains a memory leak. The
function is also missing initialisation of one of the members of
ch struct, which can lead to warning but this has no impact on
result.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
brcmfmac: conditionally compile firmware protocol source code

The host-interface can select which protocol implementation it
needs. Selecting PCIe will include the msgbuf protocol and selecting
USB and/or SDIO will include the bcdc protocol. The PCIe kconfig
option assures the dependencies for msgbuf are met, ie. HAS_DMA.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
brcmfmac: obtain ifp through wdev structure

For P2P_DEVICE interface the function brcmf_cfg80211_update_proto_addr_mode()
resulted in a crash, because it assumed wdev->netdev would be valid. The
ifp should be obtained through the driver vif structure which contains the
wireless_dev.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
brcmfmac: handle IF event for P2P_DEVICE interface

The firmware notifies about interface changes through the IF event
which has a NO_IF flag that means host can ignore the event. This
behaviour was introduced in the driver by:

  commit 2ee8382fc6c763c76396a6aaff77a27089eed3aa
  Author: Arend van Spriel <arend@broadcom.com>
  Date:   Sat Aug 10 12:27:24 2013 +0200

      brcmfmac: ignore IF event if firmware indicates it

It turns out that the IF event for the P2P_DEVICE also has this
flag set, but the event should not be ignored in this scenario.
The mentioned commit caused a regression in 3.12 kernel in creation
of the P2P_DEVICE interface.

Cc: <stable@vger.kernel.org> # 3.14, 3.16
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
ath9k_htc: fix random decryption failure

In v3.15 the driver stopped to accept network packets after successful
authentification, which could be worked around by passing the
nohwcrypt=1 module parameter.  This was not reproducible by
everyone, and showed random behaviour in some tests.
It was caused by an uninitialized variable introduced
in 4ed1a8d4a257 ("ath9k_htc: use ath9k_cmn_rx_accept") and
used in 341b29b9cd2f ("ath9k_htc: use ath9k_cmn_rx_skb_postprocess").

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78581
Fixes: 341b29b9cd2f ("ath9k_htc: use ath9k_cmn_rx_skb_postprocess")
Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
bridge: Fix br_should_learn to check vlan_enabled

As Toshiaki Makita pointed out, the BRIDGE_INPUT_SKB_CB will
not be initialized in br_should_learn() as that function
is called only from br_handle_local_finish().  That is
an input handler for link-local ethernet traffic so it perfectly
correct to check br->vlan_enabled here.

Reported-by: Toshiaki Makita<toshiaki.makita1@gmail.com>
Fixes: 20adfa1 bridge: Check if vlan filtering is enabled only once.
Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
cxgb4: Don't allocate adapter structure for all PF's

commit 35b1de557970 ("rdma/cxgb4: Fixes cxgb4 probe failure in VM when PF is
exposed through PCI Passthrough") moved the code to check for SR-IOV PF[0..3]
much further down in init_one() past the point where we allocate a (struct
adapter) for PF[0..3]. As a result, we left four of these on ever module remove.

Fix: Allocate adapter structure only for PF4

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
scsi_netlink : Make SCSI_NETLINK dependent on NET instead of selecting NET

Required for avoiding recursive dependencies in the Kconfig, brought out
by fixing randconfig error for bnx2i/bnx2fc in the patch that follows.
As suggested by Randy Dunlap

Signed-off-by: Anish Bhatt <anish@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
bnx2i/bnx2fc : fix randconfig error in next-20140909

Just like CNIC, tristate of these two modules is also dependent on IPV6.
These need to be handled separately as they select CNIC, which can override
tristate for CNIC from 'm' to 'y', which can cause build failures when ipv6 is
 compiled as a module even if CNIC's Kconfig will only 'm' or 'n' when ipv6 is
compiled as a module.

Fixes: c99d667e8527 ("cnic : Cleanup CONFIG_IPV6 & VLAN check")
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Merge branch 'bnx2-deps'

Anish Bhatt says:

====================
net: Fix randconfig errros in bnx2i/bnx2fc caused by IPV6

Just like CNIC bnx2i/bnx2fc also have their tristate dependent on IPV6, however
using the same solution as CNIC can cause recursive dependecies during make.

Based on suggestions by Randy Dunlap, SCSI_NETLINK now depends on NET instead
 of selecting NET. Second patch fixes the actual randconfig error.

Entire thread can be followed here : https://lkml.org/lkml/2014/9/9/500

Fixes: c99d667e8527 ("cnic : Cleanup CONFIG_IPV6 & VLAN check")
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
scsi: fix build errors, SCSI_FC_ATTRS needs to depend on SCSI && NET

Fix build errors when CONFIG_SCSI_NETLINK is enabled but
CONFIG_NET is not enabled:

drivers/built-in.o: In function `scsi_nl_rcv_msg':
scsi_netlink.c:(.text+0x1850fa): undefined reference to `netlink_ack'
scsi_netlink.c:(.text+0x185105): undefined reference to `skb_pull'
scsi_netlink.c:(.text+0x18515d): undefined reference to `netlink_capable'
drivers/built-in.o: In function `scsi_netlink_init':
(.text+0x185244): undefined reference to `init_net'
drivers/built-in.o: In function `scsi_netlink_init':
(.text+0x185258): undefined reference to `__netlink_kernel_create'
drivers/built-in.o: In function `scsi_netlink_exit':
(.text+0x185291): undefined reference to `netlink_kernel_release'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Anish Bhatt <anish@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
r8169: adjust __rtl8169_set_features

Remove the "changed" test in __rtl8169_set_features(). Instead, do
simple test in rtl8169_set_features().

Set the RxChkSum and RxVlan through __rtl8169_set_features() in
rtl_open().

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net: rfkill: gpio: Enable module auto-loading for ACPI based switches

For the ACPI based switches the MODULE_DEVICE_TABLE is missing to
export the entries for module auto-loading.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
sfc: fix addr_list_lock spinlock use before init

Reported by Nikolay Aleksandrov.  In efx_init_port() we call
 efx_mac_reconfigure() to work around a Falcon/A1 limitation, and this calls
 efx_{arch}_filter_sync_rx_mode(), which takes the addr_list_lock; but this
 lock is uninitialised, because we haven't called register_netdevice() yet.
So, in efx_farch_filter_sync_rx_mode(), check efx_dev_registered() before
 doing anything else.
The EF10 equivalent, efx_ef10_filter_sync_rx_mode(), already has the
 corresponding check.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Tested-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
scsi: use 'depends' instead of 'select' for SCSI_FC_ATTRS

There are other kconfig symbols which use SCSI_FC_ATTRS.
In order to maintain sanity and prevent kconfig warnings, change
all of these from using 'select' to using 'depends on' so that
proper symbol dependencies will be honored and circular depends
problems will be avoided.
This fixes kconfig warnings and build errors:

warning: (LIBFC && SCSI_IBMVFC && SCSI_QLA_FC && SCSI_LPFC && ZFCP && SCSI_BFA_FC && SCSI_CHELSIO_FCOE && FUSION_FC) selects SCSI_FC_ATTRS which has unmet direct dependencies (SCSI && NET)
drivers/scsi/scsi_transport_fc.c: In function 'fc_host_post_event':
drivers/scsi/scsi_transport_fc.c:543:7: error: 'scsi_nl_sock' undeclared (first use in this function)
drivers/scsi/scsi_transport_fc.c: In function 'fc_host_post_vendor_event':
drivers/scsi/scsi_transport_fc.c:611:7: error: 'scsi_nl_sock' undeclared (first use in this function)

Reported-by: Fengguang Wu <fengguang.wu@intel.com> [0-day test robot]
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
can: c_can_platform: fix parameters of c_can_hw_raminit_ti()

Pass the correct 'mask' and 'value' bits to c_can_hw_raminit_wait_ti(). They
seem to have been swapped in the usage instances.

Reported-by: Jay Schroeder <jay.schroeder@garmin.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
can: peak_pci: add PCI ID definition pcie card variant

Add PCI ID definition for the single channel PCAN ExpressCard 34 adapter. Due
to the subsystem id evaluation the correct number of channels (here 1) is
created at initialization time. Tested including the LED functionality.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Acked-by: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
can: flexcan: mark TX mailbox as TX_INACTIVE

This patch fixes the initialization of the TX mailbox. It is now correctly
initialized as TX_INACTIVE not RX_EMPTY.

Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>