]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: Initialize CPU port ethtool ops per tree
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 7 Jun 2016 23:32:42 +0000 (16:32 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Jun 2016 18:23:42 +0000 (11:23 -0700)
commiteec3d174777becf97a4e9a4acde9fbd32b88692f
tree153ba2b1b3dd0f85c6d6a22e75bc5096bf25249f
parent7092e7e78e2834f80982837c4a6df7f576f88f38
net: dsa: Initialize CPU port ethtool ops per tree

Now that we can properly support multiple distinct trees in the system,
using a global variable: dsa_cpu_port_ethtool_ops is getting clobbered
as soon as the second switch tree gets probed, and we don't want that.

We need to move this to be dynamically allocated, and since we can't
really be comparing addresses anymore to determine first time
initialization versus any other times, just move this to dsa.c and
dsa2.c where the remainder of the dst/ds initialization happens.

The operations teardown restores the master netdev's ethtool_ops to its
original ethtool_ops pointer (typically within the Ethernet driver)

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/dsa.h
net/dsa/dsa.c
net/dsa/dsa2.c
net/dsa/dsa_priv.h
net/dsa/slave.c