Commit graph

57811 commits

Author SHA1 Message Date
Dan Carpenter db9107b497 mdio_bus: NULL dereference on allocation error
If bus = kzalloc() fails then we end up dereferencing bus when we do
"bus->irq[i] = PHY_POLL;".  The code is a little simpler if we reverse
the NULL check and return directly on failure.

Fixes: e7f4dc3536 ('mdio: Move allocation of interrupts into core')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-12 11:49:20 -05:00
David S. Miller 9d367eddf3 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
	drivers/net/bonding/bond_main.c
	drivers/net/ethernet/mellanox/mlxsw/spectrum.h
	drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c

The bond_main.c and mellanox switch conflicts were cases of
overlapping changes.

Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-11 23:55:43 -05:00
Andrew Lunn e47ad65b1b net: freescale: mac-fec: Fix build error from phy_device API change
dev has moved inside the new mdio structure.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-11 23:27:26 -05:00
Andrew Lunn 5e431650f0 net: freescale: ucc_geth: Fix build error from phy_device API change
dev has moved inside the new mdio structure.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-11 23:27:26 -05:00
Karl Heiss 03d84a5f83 bonding: Prevent IPv6 link local address on enslaved devices
Commit 1f718f0f4f ("bonding: populate neighbour's private on enslave")
undoes the fix provided by commit c2edacf80e ("bonding / ipv6: no addrconf
for slaves separately from master") by effectively setting the slave flag
after the slave has been opened.  If the slave comes up quickly enough, it
will go through the IPv6 addrconf before the slave flag has been set and
will get a link local IPv6 address.

In order to ensure that addrconf knows to ignore the slave devices on state
change, set IFF_SLAVE before dev_open() during bonding enslavement.

Fixes: 1f718f0f4f ("bonding: populate neighbour's private on enslave")
Signed-off-by: Karl Heiss <kheiss@gmail.com>
Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Reviewed-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-11 17:55:41 -05:00
Maor Gottlieb b217ea25af net/mlx5_core: Export flow steering API
Add exports to flow steering API for mlx5_ib usage.
The following functions are exported:

1. mlx5_create_auto_grouped_flow_table - used to create flow
table with auto flow grouping management (create and destroy
flow groups). In auto-grouped flow tables, we create groups
automatically if needed (if we don't find an existing
flow group with same match criteria when we add new rule).

2. mlx5_destroy_flow_table - used to destroy  a flow table.

3. mlx5_add_flow_rule - used to add flow rule into a flow table.

4. mlx5_del_flow_rule - used to delete flow rule from its flow table.

5. mlx5_get_flow_namespace - used to get a handle to the required
namespace sub-tree.

Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-11 17:48:53 -05:00
Maor Gottlieb 4cbdd30ed5 net/mlx5_core: Enable flow steering support for the IB driver
When the driver is loaded, we create flow steering namespace
for kernel bypass with nine priorities and another namespace
for leftovers(in order to catch packets that weren't matched).
Verbs applications will use these priorities.
we found nine as a number that balances the requirements from the
user and retains performance.

The bypass namespace is used by verbs applications that want to bypass
the kernel networking stack. The leftovers namespace is used by verbs
applications and the sniffer in order to catch packets that weren't
handled by any preceding rules.

Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-11 17:48:53 -05:00
Maor Gottlieb 8d40d162c0 net/mlx5_core: Initialize namespaces only when supported by device
Before we create the sub tree of a steering namespaces(kernel, bypass,
leftovers) we check that the device has the required capabilities
in order to create this subtree.

Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-11 17:48:53 -05:00
Maor Gottlieb 655227edae net/mlx5_core: Set priority attributes
Each priority has two attributes:
1. max_ft - maximum allowed flow tables under this priority.
2. start_level - start level range of the flow tables
in the priority.

These attributes are set by traversing the tree nodes by
DFS and set start level and max flow tables to each priority.
Start level depends on the max flow tables of the prior priorities
in the tree.

The leaves of the trees have max_ft set in them. Each node accumulates
the max_ft of its children and set it accordingly.

Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-11 17:48:53 -05:00
Maor Gottlieb f90edfd279 net/mlx5_core: Connect flow tables
Flow tables from different priorities should be chained together.
When a packet arrives we search for a match in the
by-pass flow tables (first we search for a match in priority 0
and if we don't find a match we move to the next priority).
If we can't find a match in any of the bypass flow-tables, we continue
searching in the flow-tables of the next priority, which are the
kernel's flow tables.

Setting the miss flow table in a new flow table to be the next one in
the list is performed via create flow table API. If we want to change an
existing flow table, for example in order to point from an
existing flow table to the new next-in-list flow table, we use the
modify flow table API.

Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-11 17:48:53 -05:00
Maor Gottlieb 34a40e6893 net/mlx5_core: Introduce modify flow table command
Introduce the modify flow table command. This command is used when
we want to change the next flow table of an existing flow table.
The next flow table is defined as the table we search (in order
to find a match), if we couldn't find a match in any of the flow table
entries in the current flow table.

Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-11 17:48:52 -05:00
Maor Gottlieb 2cc43b494a net/mlx5_core: Managing root flow table
The root Flow Table for each Flow Table Type is defined,
by default, as the Flow Table with level 0.

In order not to use an empty flow tables and introduce new hops,
but still preserve space for flow-tables that have a priority
greater(lower number) than the current flow table, we introduce this
new set root flow table command.
This command tells the HW to start matching packets from the
assigned root flow table.
This command is used when we create new flow table with level lower than the
current lowest flow table or it is the first flow table.

Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-11 17:48:52 -05:00
Maor Gottlieb fdb6896fd9 net/mlx5_core: Add utilities to find next and prev flow-tables
Add two utility functions for find next and prev flow table.
Find next flow table function gets priority and return the
first flow table of the next priority in the tree.
Find prev flow table return the last flow table of
the previous priority in the tree.

These utility functions are used for chaining flow table from different
priorities.

Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-11 17:48:52 -05:00
Maor Gottlieb f0d22d1874 net/mlx5_core: Introduce flow steering autogrouped flow table
When user add rule to autogrouped flow table, we search
for flow group with the same match criteria, if we don't
find such group then we create new flow group with the
required match criteria and insert the rule to this group.

We divide the flow table into required_groups + 1,
in order to reserve a part of the flow table for rules
which don't match any existing group.

Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-11 17:48:52 -05:00
Sergei Shtylyov bffa731f8f sh_eth: stop reading ECMR in sh_eth_dev_init()
The code in sh_eth_dev_init()  twiddling the ECMR bits always looked a bit
strange to me:  if one intends to respect 'mdp->duplex', why save old value
of the ECMR.DM bit? As all the other bits are zeroed anyway, we don't really
need to read ECMR before writing to it.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-11 17:31:09 -05:00
Sergei Shtylyov 1c1fa82119 ravb: stop reading ECMR in ravb_emac_init()
The code in ravb_emac_init() twiddling the ECMR bits always looked a bit
strange to me: if one intends to respect 'priv->duplex', why save old value
of the ECMR.DM bit?   As all the other bits are zeroed anyway, we don't
really need to read ECMR before writing to it.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-11 17:31:09 -05:00
Jarod Wilson c8086f6d88 bonding: make mii_status sysfs node consistent
The spew in /proc/net/bonding/bond0 uses netif_carrier_ok() to determine
mii_status, while /sys/class/net/bond0/bonding/mii_status looks at
curr_active_slave, which doesn't actually seem to be set sometimes when
the bond actually is up. A mode 4 bond configured via ifcfg-foo files on a
Red Hat Enterprise Linux system, after boot, comes up clean and
functional, but the sysfs node shows mii_status of down, while proc shows
up. A simple enough fix here seems to be to use the same method for
determining up or down in both places, and I'd opt for the one that seems
to match reality.

CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Veaceslav Falico <vfalico@gmail.com>
CC: Andy Gospodarek <gospo@cumulusnetworks.com>
CC: netdev@vger.kernel.org
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-11 17:14:42 -05:00
Ido Schimmel 366ce60315 mlxsw: spectrum: Add FDB lock to prevent session interleaving
Dumping the FDB (invoked with a process context) or handling FDB
notifications (polled periodicly in delayed work) might each entail
multiple EMAD transcations due to the number of entries.

While we only allow one EMAD transaction at a time, there is nothing
stopping the dump and notification processing sessions from
interleaving. However, this is forbidden by the hardware, so we need to
make sure only one of these sessions can run at a time.

Solve this by adding a mutex ('fdb_lock'), as both kernel threads can
sleep while waiting for the response EMAD.

Fixes: 56ade8fe3f ("mlxsw: spectrum: Add initial support for Spectrum ASIC")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-11 00:21:19 -05:00
Guenter Roeck 713d40248b net: bfin_mac: Use phy_find_first() instead of open-coding it
Use phy_find_first() to find the first phy device instead of
open-coding it.

Cc: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-11 00:00:34 -05:00
Guenter Roeck 3c6396d630 net: ti: cpmac: Fix build error due to missed API change
Commit 7f854420fb ("phy: Add API for {un}registering an mdio device to
a bus") introduces an API to access mii_bus structures, but missed to
update the TI cpamc driver. This results in the following error message.

drivers/net/ethernet/ti/cpmac.c: In function 'cpmac_probe':
drivers/net/ethernet/ti/cpmac.c:1119:18: error:
	'struct mii_bus' has no member named 'phy_map'

Fixes: 7f854420fb ("phy: Add API for {un}registering an mdio device to a bus")
Cc: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 23:34:49 -05:00
Guenter Roeck e253e8fbab net: tc35815: Drop unused variable
Commit e7f4dc3536 ("mdio: Move allocation of interrupts into core")
removes some code from tc_mii_init(), but does not remove a now unused
variable. This results in the following build warning.

drivers/net/ethernet/toshiba/tc35815.c: In function 'tc_mii_init':
drivers/net/ethernet/toshiba/tc35815.c:670:6: warning: unused variable 'i'

Fixes: e7f4dc3536 ("mdio: Move allocation of interrupts into core")
Cc: Andrew Lunn <andrew@lunn.ch>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 23:31:25 -05:00
Guenter Roeck a05876b30c net: tc35815: Fix build error due to missed API change
Commit 7f854420fb ("phy: Add API for {un}registering an mdio device to
a bus") introduces an API to access mii_bus structures, but missed to
update the tc35815 driver. This results in the following error message.

drivers/net/ethernet/toshiba/tc35815.c: In function 'tc_mii_probe':
drivers/net/ethernet/toshiba/tc35815.c:617:18: error:
	'struct mii_bus' has no member named 'phy_map'
drivers/net/ethernet/toshiba/tc35815.c:623:24: error:
	'struct mii_bus' has no member named 'phy_map'

Instead of looping over the list of phy addresses to find a phy chip,
use phy_find_first(). While the intent of the original code was to return
an error if more than one phy was specified, this code path was never
executed because the loop aborted after finding the first phy. The
original code is therefore semantically identical to phy_find_first(),
thus it is simpler and more straightforward to use phy_find_first()
directly.

Fixes: 7f854420fb ("phy: Add API for {un}registering an mdio device to a bus")
Cc: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 23:31:25 -05:00
Joshua Henderson 26706d43b8 net: phy: Add support for SMSC LAN8740 PHY
LAN8740 has a different phy_id than LAN8710/LAN8720.

Signed-off-by: Joshua Henderson <joshua.henderson@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 23:13:24 -05:00
David S. Miller 7d7f5d04c2 brcmfmac
* query features through firmware command
 * ARP offload through inet notifier
 * force probe to succeed for debugging purposes
 * random mac support for scheduled scan
 * support wowl upon net detect
 
 iwlwifi
 
 * bug fixes and improvements for firmware debug system
 * advertise support for Rx A-MSDU in A-MPDU
 * support -20.ucode
 * fix WoWLAN for iwldvm
 * preparations towards multiple Rx queues
 * platform power improvements for GO mode when no clients are associated
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQEcBAABAgAGBQJWkMH7AAoJEG4XJFUm622bXN4H/3Iwgf/W7M4sSgB4chMAq9Rh
 qfJW0gsHHyTdwwrvFCExN/hFUb/wBwwEDSS5Ht+k//1iDX5ixtkBgo8uEaC06EkX
 HsJQFSWBhyihm/ZWxYX/meM9RXrm2S+4k/H67posOR9OhX2RNTRIWgE34JZh35sU
 sigADXHH3yz21boUxWCicyrjlNs01d3g4Q4ARpK5tet6uWnhpFRbd3kK/ZPd6mwC
 36XPW9aKram828DgmuCWXhUMJ+YNgHcTFDzUHPj2Rcr7YD32vrMjzC+b/WyHoJs0
 dlf2/vgBSQvQY5GbcdJslWG7HOvJyh0ZIK/chlY6pJVn6LzD2Qq4OVsetl0PWzU=
 =qCp/
 -----END PGP SIGNATURE-----

Merge tag 'wireless-drivers-next-for-davem-2016-01-09' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next

Kalle Valo says:

====================
brcmfmac

* query features through firmware command
* ARP offload through inet notifier
* force probe to succeed for debugging purposes
* random mac support for scheduled scan
* support wowl upon net detect

iwlwifi

* bug fixes and improvements for firmware debug system
* advertise support for Rx A-MSDU in A-MPDU
* support -20.ucode
* fix WoWLAN for iwldvm
* preparations towards multiple Rx queues
* platform power improvements for GO mode when no clients are associated
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 23:10:10 -05:00
Fabio Estevam 541b8e291f net: lpc_eth: Remove unused variables
Commit e7f4dc3536 ("mdio: Move allocation of interrupts into core")
introduced the following build warnings:

drivers/net/ethernet/nxp/lpc_eth.c: In function 'lpc_mii_init':
drivers/net/ethernet/nxp/lpc_eth.c:865:1: warning: label 'err_out_1' defined but not used [-Wunused-label]
drivers/net/ethernet/nxp/lpc_eth.c:826:20: warning: unused variable 'i' [-Wunused-variable]

Remove the unused variables to fix them.

Reported-by: Olof's autobuilder <build@lixom.net>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 22:50:14 -05:00
Sudip Mukherjee fdffd2e8c7 bfin_mac: fix error path
While building blackfin defconfig we were getting a build warning:
warning: label 'out_err_irq_alloc' defined but not used.

Commit e7f4dc3536 ("mdio: Move allocation of interrupts into core")
removed the label out_err_mdiobus_register but then mistakenly jumped to
out_err_alloc. But it was actually supposed to jump to out_err_irq_alloc.

Fixes: e7f4dc3536 ("mdio: Move allocation of interrupts into core")
Cc: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 22:46:01 -05:00
Sudip Mukherjee 053842a8bf phy: fix blackfin build failure
The build of blackfin defconfig is failing with the error:
error: 'struct mii_bus' has no member named 'phy_map'

A new API mdiobus_get_phy() was introduced and phy_map was removed but
it was not changed here.

Fixes: 7f854420fb ("phy: Add API for {un}registering an mdio device to a bus.")
Cc: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 22:46:00 -05:00
Hariprasad Shenai 89e7a154e0 cxgb4: Fixes static checker warning in mps_tcam_show()
The commit 115b56af88 ("cxgb4: Update mps_tcam output to include T6
fields") from Dec 23, 2015, leads to the following static checker
warning:

        drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c:1735
mps_tcam_show()
        warn: we tested 'lookup_type' before and it was 'true'

Fixing it.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 22:42:03 -05:00
Xing Zheng af72261f33 net: ethernet: arc: Add support emac for RK3036
The RK3036's GRFs offset are different with RK3066/RK3188, and need to set
mac TX/RX clock before probe emac.

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 22:21:31 -05:00
Xing Zheng f4c9d3ee03 net: ethernet: arc: Keep emac compatibility for more Rockchip SoCs
On the RK3066/RK3188, there was fixed GRF offset configuration to set emac
and fixed DIV2 mac TX/RX clock. So, we need to easily set and fit to other
SoCs (RK3036) which maybe have different GRF offset, and need adjust mac
TX/RX clock.

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 22:21:31 -05:00
Xing Zheng c9bca2fe3c net: ethernet: arc: Probe emac after set RMII clock
After enter arc_emac_probe, emac will get_phy_id, phy_poll_reset and
other connecting PHY via mdiobus_read, so we need to set correct
ref clock rate for emac before probe emac.

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 22:21:31 -05:00
Rob Swindell d2d6318cb9 bnxt_en: Reset embedded processor after applying firmware upgrade
Use HWRM_FW_RESET command to request a self-reset of the embedded
processor(s) after successfully applying a firmware update. For boot
processor, the self-reset is currently deferred until the next PCIe reset.

Signed-off-by: Rob Swindell <swindell@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 22:19:19 -05:00
Michael Chan d79979a103 bnxt_en: Zero pad firmware messages to 128 bytes.
For future compatibility, zero pad all messages that the driver sends
to the firmware to 128 bytes.  If these messages are extended in the
future with new byte enables, zero padding these messages now will
guarantee future compatibility.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 22:19:19 -05:00
Andrew Lunn ede5599753 ethernet: amd: au1000: Remove pointless warning
The warning about being able to read any MDIO device, not just the
attached ethernet devices PHY applies to all MDIO drivers. So remove
it. This also removes a reference to a member in phy_device which has
moved.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 22:06:59 -05:00
Guenter Roeck e574f39816 net: ethernet: faraday: Use phy_find_first() instead of open coding it
Use phy_find_first() to find the first phy device instead of
open coding it.

Cc: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 22:05:30 -05:00
Guenter Roeck ee64f08ea9 net: ethernet: broadcom: Fix build errors
Commit 7f854420fb ("phy: Add API for {un}registering an mdio device to
a bus") introduces an API to access mii_bus structures, but missed to
update the sb1250 driver. This results in the following build error.

drivers/net/ethernet/broadcom/sb1250-mac.c: In function 'sbmac_mii_probe':
drivers/net/ethernet/broadcom/sb1250-mac.c:2360:24: error:
	'struct mii_bus' has no member named 'phy_map'

Use phy_find_first() instead of open coding it.

Commit 2220943a21 ("phy: Centralise print about attached phy") introduces
the following build error.

drivers/net/ethernet/broadcom/sb1250-mac.c: In function 'sbmac_mii_probe':
drivers/net/ethernet/broadcom/sb1250-mac.c:2383:20: error: 'phydev' undeclared

Fixes: 7f854420fb ("phy: Add API for {un}registering an mdio device to a bus")
Fixes: 2220943a21 ("phy: Centralise print about attached phy")
Cc: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 22:05:30 -05:00
Andrew Lunn 2a4fc4ea29 net: lantiq_etop.c: Use helper to find first phy
Make use of the helper to find the first phy device.
This also fixes the compile breakage.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 18:03:47 -05:00
Romain Perier 6c672c9bf4 stmmac: Don't exit mdio registration when mdio subnode is not found in the DTS
Originally, most of the platforms using this driver did not define an mdio subnode
in the devicetree. Commit e34d65 ("stmmac: create of compatible mdio bus for stmmac driver")
introduced a backward compatibily issue by using of_mdiobus_register explicitly
with an mdio subnode. This patch fixes the issue by calling the function
mdiobus_register, when mdio subnode is not found. The driver is now compatible
with both modes.

Fixes: e34d65696d ("stmmac: create of compatible mdio bus for stmmac driver")
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Tested-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 18:02:33 -05:00
Kristian Evensen 18715b2615 net: qmi_wwan: Add SIMCom 7230E
SIMCom 7230E is a QMI LTE module with support for most "normal" bands.
Manual testing has showed that only interface five works.

Cc: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
Acked-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 17:55:34 -05:00
Hannes Frederic Sowa 787d7ac308 udp: restrict offloads to one namespace
udp tunnel offloads tend to aggregate datagrams based on inner
headers. gro engine gets notified by tunnel implementations about
possible offloads. The match is solely based on the port number.

Imagine a tunnel bound to port 53, the offloading will look into all
DNS packets and tries to aggregate them based on the inner data found
within. This could lead to data corruption and malformed DNS packets.

While this patch minimizes the problem and helps an administrator to find
the issue by querying ip tunnel/fou, a better way would be to match on
the specific destination ip address so if a user space socket is bound
to the same address it will conflict.

Cc: Tom Herbert <tom@herbertland.com>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 17:28:24 -05:00
Elad Raz 3a49b4fde2 mlxsw: Adding layer 2 multicast support
Add SWITCHDEV_OBJ_ID_PORT_MDB switchdev ops support. On first MDB insertion
creates a new multicast group (MID) and add members port to the MID. Also
add new MDB entry for the flooding-domain (fid-vid) and link the MDB entry
to the newly constructed MC group.

Signed-off-by: Elad Raz <eladr@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 16:50:21 -05:00
Elad Raz e4b6f6931c mlxsw: Adding VID to FID translatation
Adding a generic function that translate VID to FID.

Signed-off-by: Elad Raz <eladr@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 16:50:21 -05:00
Elad Raz 53ae628316 mlxsw: Changing the maximum number of multicast group to a define
Signed-off-by: Elad Raz <eladr@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 16:50:21 -05:00
Elad Raz fabe548322 mlxsw: reg: Adding SMID register
Adding back SMID register definition and packing. For each MC group a new
SMID entry will be generated.

Signed-off-by: Elad Raz <eladr@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 16:50:21 -05:00
Elad Raz 5230b25f06 mlxsw: reg: Add definition of multicast record for SFD register
Multicast-related records have specific format in SFD register.

Signed-off-by: Elad Raz <eladr@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-10 16:50:21 -05:00
Jiri Pirko 12f1501e75 mlxsw: spectrum: remove FDB entry in case we get unknown object notification
It may happen that we get notification for FDB entry for object (port,
lag, vport), which does not exist. Currently we ignore that, which only
causes this being re-sent in next notification. The entry will never
disappear. So get rid of it by simply removing it using SFD register.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-09 21:06:33 -05:00
Jiri Pirko 2fa9d45e16 mlxsw: spectrum: pass local_port to mlxsw_sp_port_fdb_uc_op
Do not pass struct mlxsw_sp_port to mlxsw_sp_port_fdb_uc_op and rather
just pass local_port. This is needed in case this is called from SFN
process function and mlxsw_sp_port is not existent for particular
local_port.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-09 21:06:33 -05:00
Nicolas Dichtel 07b9b37c22 vxlan: fix test which detect duplicate vxlan iface
When a vxlan interface is created, the driver checks that there is not
another vxlan interface with the same properties. To do this, it checks
the existing vxlan udp socket. Since commit 1c51a9159d, the creation of
the vxlan socket is done only when the interface is set up, thus it breaks
that test.

Example:
$ ip l a vxlan10 type vxlan id 10 group 239.0.0.10 dev eth0 dstport 0
$ ip l a vxlan11 type vxlan id 10 group 239.0.0.10 dev eth0 dstport 0
$ ip -br l | grep vxlan
vxlan10          DOWN           f2:55:1c:6a:fb:00 <BROADCAST,MULTICAST>
vxlan11          DOWN           7a:cb:b9:38:59:0d <BROADCAST,MULTICAST>

Instead of checking sockets, let's loop over the vxlan iface list.

Fixes: 1c51a9159d ("vxlan: fix race caused by dropping rtnl_unlock")
Reported-by: Thomas Faivre <thomas.faivre@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-09 21:04:20 -05:00
Sudip Mukherjee 824b1a9740 net: plip: use new parport device model
Modify plip driver to use the new parallel port device model.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-09 21:02:05 -05:00
Oliver Neukum 29c6dd591b cdc-acm: fix NULL pointer reference
The union descriptor must be checked. Its usage was conditional
before the parser was introduced. This is important, because
many RNDIS device, which also use the common parser, have
bogus extra descriptors.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Tested-by: Vasily Galkin <galkin-vv@yandex.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-09 21:00:24 -05:00
hayeswang cda9fb01dc r8152: adjust ALDPS function
Replace disable_aldps() and enable_aldps() with aldps_en().

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-08 21:57:17 -05:00
hayeswang 216a8349d3 r8152: use test_and_clear_bit
Replace test_bit() followed by clear_bit() with test_and_clear_bit().

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-08 21:57:17 -05:00
hayeswang 5ee3c60c8d r8152: fix the wake event
When the autosuspend is enabled and occurs before system suspend, we should
wake the device before running system syspend. Then, we could change the wake
event for system suspend. Otherwise, the device would resume the system when
receiving any packet.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-08 21:50:18 -05:00
Roosen Henri b4c19f7125 phy: micrel: Fix finding PHY properties in MAC node for KSZ9031.
Commit 651df21835 ("phy: micrel: Fix finding PHY properties in MAC
 node.") only fixes finding PHY properties in MAC node for KSZ9021. This
commit applies the same fix for KSZ9031.

Fixes: 8b63ec1837 ("phylib: Make PHYs children of their MDIO bus, not the bus' parent.")
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Henri Roosen <henri.roosen@ginzinger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-08 21:48:34 -05:00
Al Viro 6108209c4a Merge branch 'for-linus' into work.misc 2016-01-08 21:20:11 -05:00
David S. Miller 7d39721466 Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says:

====================
10GbE Intel Wired LAN Driver Updates 2016-01-08

This series contains updates to ixgbe only.

Vasu provides three fixes for ixgbe, first assigns a minimum credit to
a traffic class to resolve a Tx hang for CEE mode configuration.  Second
fix changes the driver to use netdev->fcoe_ddp_xid instead of our local
IXGBE_FCOE_DDP_MAX, since it is correctly set for our different devices
and avoids a DDP skip error on X550.  Lastly fix the PFC configuration
to include X550 devices.

Emil provides a fix for reporting the speed in ethtool by using the
stored value in out adapter structure.  This is due to external drivers
may end up with unknown speed when calling ethtool_get_settings().

Mark fixes the handling of any outer UDP checksum, by passing the
skb up with CHECKSUM_NONE when an outer UDP checksum is set.  This
will cause the stack to check the checksum, also do not increment an
error counter because we do not really know if there is an actual error.
Ixgbe ATR was not handling IPv6 extended headers, so ATR is not being
performed on such packets.  Fix this by skipping extended headers
when they are present.

Usha fixes an issue with X550 and getting FDMI HBA attributes when
FCoE support is enabled.

Neerav fixes an issue for X550 when FCoE and SR-IOV are enabled, which
the hardware generates MDD events.  Resolve this by setting the expected
values in the transmit context descriptors for FCoE/FIP frames and
adding a flush after writing the RDLEN register.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-08 13:31:06 -05:00
Dan Carpenter 6757e6f5f4 irda: toim3232-sir: delete some dead code
I noticed this code because it has a typo in the module_param(),
the "trs" at the end of "toim3232fliptrs" should be "rts".  But it's
dead code so instead of fixing it, I just deleted it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-08 13:25:33 -05:00
David S. Miller 250fbf129e Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
Johan Hedberg says:

====================
pull request: bluetooth-next 2016-01-08

Here's one more bluetooth-next pull request for the 4.5 kernel:

 - Support for CRC check and promiscuous mode for CC2520
 - Fixes to btmrvl driver
 - New ACPI IDs for hci_bcm driver
 - Limited Discovery support for the Bluetooth mgmt interface
 - Minor other cleanups here and there

Please let me know if there are any issues pulling. Thanks.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-08 13:17:31 -05:00
Mark Rustad e19dcdeb35 ixgbe: Make ATR recognize IPv6 extended headers
Right now ATR is not handling IPv6 extended headers, so ATR is not
being performed on such packets. Fix that by skipping extended
headers when they are present. This also fixes a problem where
the ATR code was not checking that the inner protocol was actually
TCP before setting up the signature rules. Since the protocol check
is intimately involved with the extended header processing as well,
this all gets fixed together.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2016-01-08 04:18:43 -08:00
Neerav Parikh 8b75451be1 ixgbe: Fix MDD events generated when FCoE+SRIOV are enabled
When FCoE is enabled with SR-IOV on the X550 NIC the hardware
generates MDD events.

This patch fixes these by setting the expected values in the
Tx context descriptors for FCoE/FIP frames and adding a flush
after writing the RDLEN register.

Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2016-01-08 04:15:00 -08:00
Usha Ketineni b262a9a772 ixgbe: Fix to get FDMI HBA attributes information with X550
Check whether the FCOE support is enabled for the devices to get the
 FDMI HBA attributes information instead of checking each device id.
Also, add Model string information for X550.

Signed-off-by: Usha Ketineni <usha.k.ketineni@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2016-01-08 04:11:21 -08:00
Mark Rustad d469251bfd ixgbe: Correct handling of any outer UDP checksum setting
If an outer UDP checksum is set, pass the skb up with CHECKSUM_NONE
so that the stack will check the checksum. Do not increment an
error counter, because we don't know that there is an actual error.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2016-01-08 04:06:49 -08:00
Emil Tantilov 0e4d422f5f ixgbe: do not call check_link for ethtool in ixgbe_get_settings()
In ixgbe_get_settings() the link status and speed of the interface
are determined based on a read from the LINKS register via the call
to mac.ops.check.link(). This can cause issues where external drivers
may end up with unknown speed when calling ethtool_get_setings().

Instead of calling the mac.ops.check_link() we can report the speed
from the adapter structure which is populated by the driver.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2016-01-08 03:57:49 -08:00
Vasu Dev cb78cf12d6 ixgbe: fix broken PFC with X550
PFC is configuration is skipped for X550 devices due to a incorrect
device id check, fixing that to include X550 PFC configuration.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2016-01-08 03:54:08 -08:00
Vasu Dev f10166aba2 ixgbe: use correct FCoE DDP max check
Use fcoe_ddp_xid from netdev as this is correctly set for different
device IDs to avoid DDP skip error on X550 as "xid=0x20b out-of-range"

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2016-01-08 03:47:51 -08:00
Vasu Dev 3efcb86e2d ixgbe: Fill at least min credits to a TC credit refills
Currently credit_refill and credit_max could be zero for a TC and that
is causing Tx hang for CEE mode configuration, so to fix that have at
min credit assigned to a TC and that is as what IEEE mode already does.

Change-ID: If652c133093a21e530f4e9eab09097976f57fb12
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2016-01-08 03:25:14 -08:00
Jesse Brandeburg 56028154ca i40e: remove forever unused ID
Somehow an ID that has never been productized is in the
code.  There are no plans to use it, so just get
rid of it.

Change-ID: I59117d48ea9ee0360b0fe33833ac8092f8a24b4c
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2016-01-08 01:33:42 -08:00
Anjali Singhai Jain 857942fd1a i40e: Fix Rx hash reported to the stack by our driver
If the driver calls skb_set_hash even with a zero hash, that
indicates to the stack that the hash calculation is offloaded
in hardware. So the Stack doesn't do a SW hash which is required
for load balancing if the user decides to turn of rx-hashing
on our device.

This patch fixes the path so that we do not call skb_set_hash
if the feature is disabled.

Change-ID: Ic4debfa4ff91b5a72e447348a75768ed7a2d3e1b
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2016-01-08 01:30:11 -08:00
Sowmini Varadhan b499ffb0a2 i40e: Look up MAC address in Open Firmware or IDPROM
This is the i40e equivalent of commit c762dff24c ("ixgbe: Look up MAC
address in Open Firmware or IDPROM").

As with that fix, attempt to look up the MAC address in Open Firmware
on systems that support it, and use IDPROM on SPARC if no OF address
is found.

In the case of the i40e there is an assumption that the default mac
address has already been set up as the primary mac filter on probe,
so if this filter is obtained from the Open Firmware or IDPROM, an
explicit write is needed via i40e_aq_mac_address_write() and
i40e_aq_add_macvlan() invocation.

The I40E_FLAG_PF_MAC flag in the platform-private i40e_pf structure
tracks whether a platform-specific mac address was found, in which
case calls to i40e_aq_mac_address_write() and i40e_aq_add_macvlan()
will be triggered.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2016-01-08 01:12:47 -08:00
Mitch Williams efd8e39acc i40e: allow zero MAC address for VFs
Allow the user to specify a zero MAC address for VFs. This removes the
existing MAC address and allows the VF to use a random address. Libvirt
does this normally when removing a VF from a VM.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2016-01-08 00:59:26 -08:00
Mitch Williams 2d166c3040 i40e: change log messages and error returns
When VFs are being reset, there is a brief window of time when they
cannot be configured because they don't have a VSI to configure. If
a script is quick, it can fall through that window. To avoid
defenestration, log a useful error message and return -EAGAIN.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2016-01-08 00:49:59 -08:00
Hante Meuleman 42e0ed0d45 brcmfmac: Do not handle link downs for ibss.
Sometimes on module reload and reconnect to ibss a deauth from
other station can be received. This is treated as a link down but
for ibss this is wrong. It will close the interface and no data
is possible. Ignore the firmware generated link down events in
ibss mode, as ibss is always teared down by cfg80211.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-01-08 10:44:48 +02:00
Arend van Spriel 5ce96c0808 brcmfmac: use jiffies for timeout in btcoex
The btcoex uses a timeout which was in milliseconds and got
converted to jiffies upon using timer api. Instead, convert
it to jiffies and treat it as such further.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-01-08 10:44:46 +02:00
Arend van Spriel 63ce3d5db0 brcmfmac: use msecs_to_jiffies() in macro definitions
Instead to having macro definition for millisecond timeout have
the definition directly in jiffies. This makes the unit of the
value immediately clear and may result in code that is bit more
compact.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-01-08 10:44:43 +02:00
Arend van Spriel 4011fc4996 brcmfmac: change brcmf_sdio_wd_timer() prototype
The function brcmf_sdio_wd_timer() has wdtick parameter. However, it
is only called with two values and as such the parameter is replaced
with boolean value indicating the timer should be active or not.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-01-08 10:44:42 +02:00
Hante Meuleman 5419f7f17d brcmfmac: Reshuffle functions to avoid forward declarations
Function prototype forward declarations are to be avoided. This
patch shuffles some of the functions so the forward declarations
can be removed.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-01-08 10:44:40 +02:00
Hante Meuleman 3021ad9a4f brcmfmac: Add wowl net detect support
With wowl net detect it becomes possible to scan for specific ssids
and wakeup once found.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-01-08 10:44:38 +02:00
Woojung.Huh@microchip.com 9fb6066d0d net: lan78xx: Fix to write to OTP(One Time Programmable) per magic number.
This patch fixes a bug writing to EEPROM in lan78xx_ethtool_set_eeprom()
when asked to write to OTP.

Signed-off-by: Woojung Huh <woojung.huh@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 16:39:34 -05:00
Neil Armstrong e611b5b851 net: macb: Add NP4 macb config using USRIO_DISABLED
Declare a new NP4 SoC variant having USRIO_DISABLED as capability bit.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 16:26:36 -05:00
Neil Armstrong ce721a7021 net: ethernet: cadence-macb: Add disabled usrio caps
On some platforms, the macb integration does not use the USRIO
register to configure the (R)MII port and clocks.
When the register is not implemented and the MACB error signal
is connected to the bus error, reading or writing to the USRIO
register can trigger some Imprecise External Aborts on ARM platforms.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 16:26:36 -05:00
Kalle Valo aa8a7219d7 * bug fixes and improvements for firmware debug system (Golan and myself)
* fixes for D0i3 (Eliad)
 * prevent muliple stations with the same MAC address
 * advertise support for Rx A-MSDU in A-MPDU
 * scan related fixes
 * support -20.ucode
 * fix WoWLAN for iwldvm
 * preparations towards multiple Rx queues
 * platform power improvements for GO mode when no clients are associated
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWjpprAAoJEC0Llv5uNjIBvxQQAJspMW0WJInz854lndTAU7HA
 w5xB2EZefub+sxpU+arpTNVXmGWzFD1E3YDVc5u5/3QX1sD4O+olZgXUZcgXESEn
 2b2+cnVfVMGqJf2+ISnVzO25ywyYGpxndiZtszj5imklTrLBTVswgOkK8vP5Yshg
 99ZFnl+R4wVaPXAzReocLUHyiH4dlHfbOSKpENoO4Oh7TKy5XSONUAjisrut6nZZ
 QKSndO0sgH6agOMwhlc+E5eV0WHapUn1gsdoV0yh2yhYpXB+QzqAAgCwJgDm7nmk
 IcGFdVXG/mqsLu7JkwK9muJGbfYpqd8/TSmY0Rnjsci64KbWGGDgGKAhPAA+VTcg
 vbvqS0to3ehpjTu+ZROjGaZmbxlNgeVmUpwbGz5Fq3nebZkj2eTG+hVbomOWYRsm
 SpiwFmcRA6yk3n+iie92iI3JrjXyo8gSo4+7vUmyfi/XJAmkgzTt7nRIeCD0tQo+
 R93ORdrYYwS7+Va9Xw0WxFWe7wMRxx4Pm4f9NZFBYU3l/egPiNYjJHVSQFZmbZCY
 amxskYVLfzYHeQoh+N5YcCOQGvbn1rqlhztPI6pLGBTZtIPp+/rBAJPHrYbJC5vl
 fempR3UDo3t1GnVV0uKPo5m8gPwT/nWkgW9DYH+/8as5bvlxFYX0mD5W3FUWJszF
 swxp8xrLgdv9ju/y3ol/
 =SiLl
 -----END PGP SIGNATURE-----

Merge tag 'iwlwifi-next-for-kalle-2016-01-07_2' of https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

* bug fixes and improvements for firmware debug system (Golan and myself)
* fixes for D0i3 (Eliad)
* prevent muliple stations with the same MAC address
* advertise support for Rx A-MSDU in A-MPDU
* scan related fixes
* support -20.ucode
* fix WoWLAN for iwldvm
* preparations towards multiple Rx queues
* platform power improvements for GO mode when no clients are associated
2016-01-07 23:04:07 +02:00
Kalle Valo 236c52cac4 Merge ath-next from ath.git
No major changes to list.
2016-01-07 22:54:46 +02:00
Andrew Lunn 711fdba37a mdio: Abstract device_remove() and device_free()
Make device_free and device_remove operations in the mdio device
structure, so the core code does not need to differentiate between
phy devices and generic mdio devices.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 14:31:27 -05:00
Andrew Lunn a9049e0c51 mdio: Add support for mdio drivers.
Not all devices on an MDIO bus are PHYs. Meaning not all MDIO drivers
are PHY drivers. Add support for generic MDIO drivers.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 14:31:27 -05:00
Andrew Lunn f89df3f381 mdio_bus: Add comment to mdiobus_scan() and __mdiobus_register()
Make it clear that mdiobus_scan () will only find devices which have a
vendor/product ID in registers 2 and 3. These are typically PHY
devices. Other sort of MDIO devices, such as switches, are not
expected to be found during the scan.

Similarly, __mdiobus_register(), which calls mdiobus_scan() will only
find PHY devices, and other sorts of MDIO devices are expected to be
instantiated from device tree.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 14:31:27 -05:00
Andrew Lunn f03bc4ae55 mdio_bus: Generalise of_mdiobus_link_phydev()
This function should work with any sort of MDIO device which can be
probed on the bus, not just PHY devices. So generalise it.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 14:31:27 -05:00
Andrew Lunn e76a4957c5 phy: Move phy specific bus match into phy_device
Matching a driver to a device has both generic parts, and parts which
are specific to PHY devices. Move the PHY specific parts into
phy_device.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 14:31:27 -05:00
Andrew Lunn be01da72b1 phy: Centralize setting driver module owner
Rather than have each driver set the driver owner field, do it once in
the core code. This will also help with later changes, when the device
structure will move.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 14:31:27 -05:00
Andrew Lunn bc87922ff5 phy: Move PHY PM operations into phy_device
The MDIO PM operations are really PHY device PM operations. So move
them into phy_device. This will be needed when we support devices on
the mdio bus which are not PHYs.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 14:31:27 -05:00
Andrew Lunn 5cf11beef2 phy_device: Move phy attributes into phy_device
The mdio_bus exports three attributes:

- PHY ID is the unique 32-bits identifier for a MDIO device implementing
  standard MII registers MII_PHYSID1/2, which is not guaranteed to be the
  case for non-standard compliant devices (e.g: Ethernet switches)

- PHY interface describes the data-path of the PHY/MDIO device, which is
  not strictly a PHY thing, but is required and needed for PHY devices to
  function, a MDIO device could be a control device exclusively

- PHY has fixups describes what the PHY driver may have done, so
  completely PHY specific

These are all phy attributes, not generic mdio attributes. So move the
attributes into the phy device code.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 14:31:26 -05:00
Andrew Lunn 7f854420fb phy: Add API for {un}registering an mdio device to a bus.
Rather than have drivers directly manipulate the mii_bus structure,
provide and API for registering and unregistering devices on an MDIO
bus, and performing lookups.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 14:31:26 -05:00
Andrew Lunn e5a03bfd87 phy: Add an mdio_device structure
Not all devices attached to an MDIO bus are phys. So add an
mdio_device structure to represent the generic parts of an mdio
device, and place this structure into the phy_device.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 14:31:26 -05:00
Andrew Lunn e7f4dc3536 mdio: Move allocation of interrupts into core
Have mdio_alloc() create the array of interrupt numbers, and
initialize it to POLLING. This is what most MDIO drivers want, so
allowing code to be removed from the drivers.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 14:31:26 -05:00
Andrew Lunn 35d2aeac98 phy: mdio-octeon: Use devm_mdiobus_alloc_size()
Rather than use devm_kzalloc(), use the mdio helper function.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 14:31:25 -05:00
Andrew Lunn 2220943a21 phy: Centralise print about attached phy
Many Ethernet drivers contain the same netdev_info() print statement
about the attached phy. Move it into the phy device code. Additionally
add a varargs function which can be used to append additional
information.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 14:31:25 -05:00
Andrew Lunn 053e7e1692 phy: phy_{read|write}_mmd_indirect: get addr from phydev
The address of the device can be determined from the phydev structure,
rather than passing it as a parameter.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 14:31:25 -05:00
Andrew Lunn 04521bf840 net: dnet: Use phy_find_first() helper
Replace the open coded search for the first phy with a call to the
existing helper function.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 14:31:25 -05:00
Andrew Lunn 84eff6d194 phy: add phydev_name() wrapper
Add a phydev_name() function, to help with moving some structure members
from phy_device.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 14:31:25 -05:00
Andrew Lunn 72ba48be3e phy: Add phydev_err() and phydev_dbg() macros
In preparation for moving some of the phy_device structure members,
add macros for printing errors and debug information.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 14:31:24 -05:00
Andrew Lunn cd690e48f5 phy: Use phy_read() instead of mdiobus_read()
Since we have a phydev, make use of it and the phy_read() function.
This will help with later refactoring.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07 14:31:24 -05:00