summaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa
Commit message (Collapse)AuthorAgeFilesLines
* net: dsa: mv88e6171: Use common port configurationGuenter Roeck2015-03-291-23/+1Star
| | | | | | | Reviewed-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: dsa: mv88e6123_61_65: Use common port configurationGuenter Roeck2015-03-291-23/+1Star
| | | | | | | | This will simplify adding offloaded bridge support later on. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: dsa: mv88e6352: Use common port initialization codeGuenter Roeck2015-03-291-23/+1Star
| | | | | | | | This prepares the driver for hardware bridging. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: dsa: mv88e6xxx: Split mv88e6xxx_reg_read and mv88e6xxx_reg_writeGuenter Roeck2015-03-291-9/+26
| | | | | | | | | | | Split mv88e6xxx_reg_read and mv88e6xxx_reg_write into two functions each, one to acquire smi_mutex and one to get struct mii_bus *bus from struct dsa_switch *ds and to call the actual read/write function. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: dsa: mv88e6xxx: Disable Message Port bit for CPU portGuenter Roeck2015-03-291-4/+3Star
| | | | | | | | | | | | | | | | Datasheet says that the Message Port bit should not be set for the CPU port. Having it set causes DSA tagged packets to be sent to the CPU port roughly every 30 seconds. Those packets are the same as real packets forwarded between switch ports if the switch is configured for switching between multiple ports. The packets are then bridged by the software bridge, resulting in duplicated packets on the network. Reported-by: Andrew Lunn <andrew@lunn.ch> Cc: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: dsa: mv88e6xxx: Provide function for common port initializationGuenter Roeck2015-03-292-0/+40
| | | | | | | | | | | | Provide mv88e6xxx_setup_port_common() for common port initialization. Currently only write Port 1 Control and VLAN configuration since this will be needed for hardware bridging. More can be added later if desired/needed. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: dsa: mv88e6xxx: Factor out common initialization codeGuenter Roeck2015-03-295-12/+22
| | | | | | | | | | Code used and needed in mv886xxx.c should be initialized there as well, so factor it out from the individual initialization files. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* dsa: change "select" to "depends on" for NET_SWITCHDEV and for NET_DSAJiri Pirko2015-03-161-7/+6Star
| | | | | | | | | | | | | | | | This would fix randconfig compile error: net/built-in.o: In function `netdev_switch_fib_ipv4_abort': (.text+0xf7811): undefined reference to `fib_flush_external' Also it fixes following warnings: warning: (NET_DSA) selects NET_SWITCHDEV which has unmet direct dependencies (NET && INET) warning: (NET_DSA_MV88E6060 && NET_DSA_MV88E6131 && NET_DSA_MV88E6123_61_65 && NET_DSA_MV88E6171 && NET_DSA_MV88E6352 && NET_DSA_BCM_SF2) selects NET_DSA which has unmet direct dependencies (NET && HAVE_NET_DSA && NET_SWITCHDEV) Reported-by: Randy Dunlap <rdunlap@infradead.org> Suggested-by: Alexei Starovoitov <alexei.starovoitov@gmail.com> Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: dsa: mv88e6352: Add support for EEEGuenter Roeck2015-03-081-0/+2
| | | | | | | Enable EEE support for MV88E6352. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: dsa: mv88e6xxx: Add EEE supportGuenter Roeck2015-03-082-0/+54
| | | | | | | | | EEE configuration is similar for the various MV88E6xxx chips. Add generic support for it. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2015-03-041-1/+1
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/net/ethernet/rocker/rocker.c The rocker commit was two overlapping changes, one to rename the ->vport member to ->pport, and another making the bitmask expression use '1ULL' instead of plain '1'. Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: dsa: bcm_sf2: fix 64-bits register readsFlorian Fainelli2015-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Reading 64-bits register was not working because we inverted the steps between reading the lower 32-bits of the register and reading the upper 32-bits. Swapping these operations is how the HW guarantees that 64-bits reads are latched correctly. We only have a handful of 64-bits registers for now, mostly MIB counters, so the imapct is low. Fixes: 246d7f773c13 ("net: dsa: add Broadcom SF2 switch driver") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa: bcm_sf2: add HW bridging supportFlorian Fainelli2015-02-253-1/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement the bridge join, leave and set_stp callbacks by making that we do the following: - when a port joins the bridge, all existing ports in the bridge get their VLAN control register updated with that joining port - the joining port is including all existing bridge ports in its own VLAN control register The leave operation is fairly similar, special care must be taken to make sure that port leaving the bridging is not removing itself from its own VLAN control register. Since the various BR_* states apply directly to our HW semantics, we just need to translate these constants into their corresponding HW settings, and voila! We make sure to trigger a fast-ageing process for ports that are joining/leaving the bridge and transition from incompatible states, this is equivalent to triggering an ARL flush for that port. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa: mv88e6171: Enable access to phys via internal mdio busAndrew Lunn2015-02-191-8/+10
| | | | | | | | | | | | | | | | | | | | When the device is configured to use single chip addressing mode, the phy devices of the port are not accessible on the host MDIO bus. Instead the switch internal MDIO bus must be used. For this to work, the phy polling unit must be enabled. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa: mv88e6352: Refactor shareable codeAndrew Lunn2015-02-193-65/+71
|/ | | | | | | | | | | The mv88e6352 allows access to the port phys via an internal mdio bus which is accessed using registers in the GLOBAL 2 range. The mv88e6171 and probably other devices use the same mechanism. Move this code into the shared mv88e6xxx.c library. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2015-02-091-1/+2
|\ | | | | | | Signed-off-by: David S. Miller <davem@davemloft.net>
| * dsa: do not dereference non-existing routing tableTobias Waldekranz2015-02-081-1/+2
| | | | | | | | | | | | | | | | In the case where there is only one switch, no routing table will have been allocated, so do not dereference it in this case. Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa: bcm_sf2: implement GPHY power downFlorian Fainelli2015-02-082-9/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement the power on/off recommended procedure for the Single GPHY we have on our Starfighter 2 switch. In order to make sure we get proper LED link/activity signaling during suspend, switch the link indication from the Switch/MAC to the PHY. Finally, since the GPHY needs to be reset to be put in low power mode, we will loose any context applied to it: workarounds, EEE etc.. so we need to call phy_init_hw() to get our fixups re-applied successfully. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa: bcm_sf2: move GPHY enabling to its own functionFlorian Fainelli2015-02-081-12/+20
| | | | | | | | | | | | | | | | | | | | Move the code that touches the single GPHY register from bcm_sf2_sw_resume() to a separate function since we will have to enable/disable the GPHY from different locations, and we want the code to be self-contained. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa/mv88e6352: make mv88e6352_wait genericVivien Didelot2015-01-271-8/+5Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some busy bits are available in the global register 1, such as the ATU Busy bit. We may want to use this function to wait for them to change, so add a new parameter to mv88e6352_wait() instead of hard-coding REG_GLOBAL2. In the meantime, since the REG_READ() macro already checks for error, remove the redundant check for ret < 0. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa/mv88e6xxx: add reg read and write debugVivien Didelot2015-01-271-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds debug messages for the generic mv88e6xxx read and write routines. The output is similar to this: mdio-gpio mdio-gpio.0: <- addr: 0x1b reg: 0x05 val: 0x4000 mdio-gpio mdio-gpio.0: -> addr: 0x1b reg: 0x07 val: 0x3113 mdio-gpio mdio-gpio.0: -> addr: 0x1b reg: 0x08 val: 0x0330 mdio-gpio mdio-gpio.0: -> addr: 0x1b reg: 0x09 val: 0x0000 This is convenient to dynamically debug operations through debugfs with: echo file mv88e6xxx.c +p > <debugfs>/dynamic_debug/control Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa: bcm_sf2: factor interrupt disabling in a functionFlorian Fainelli2015-01-261-12/+12
|/ | | | | | | | Factor the interrupt disabling in a function: bcm_sf2_intr_disable() since we are doing the same thing in the setup and suspend paths. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: dsa: bcm_sf2: always select FIXED_PHYFlorian Fainelli2014-12-161-1/+1
| | | | | | | | | | | | | There is no need to do the following: select FIXED_PHY if NET_DSA_BCM_SF2=y, as this implies that we will not be able to build and/or run the driver correctly when built as a module, which is no longer an issue since commit 37e9a6904520 ("net: phy: export fixed_phy_register()"). Fixes: 246d7f773c13ca ("net: dsa: add Broadcom SF2 switch driver") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: dsa: bcm_sf2: force link for all fixed PHY devicesFlorian Fainelli2014-12-121-10/+13
| | | | | | | | | | | | | | | For ports of the switch that we define as "fixed PHYs" such as MoCA, we would have our Port 7 special handling that would allow us to assert the link status indication. For other ports, such as e.g: RGMII_1 connected to a cable modem, we would rely on whatever the bootloader has left configured, which is a bad assumption to make, we really need to force the link status indication here. Fixes: 246d7f773c13 ("net: dsa: add Broadcom SF2 switch driver") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2014-11-301-25/+33
|\
| * net: dsa: bcm_sf2: reset switch prior to initializationFlorian Fainelli2014-11-261-23/+29
| | | | | | | | | | | | | | | | | | | | | | Our boot agent may have left the switch in an certain configuration state, make sure we issue a software reset prior to configuring the switch in order to ensure the HW is in a consistent state, in particular transmit queues and internal buffers. Fixes: 246d7f773c13 ("net: dsa: add Broadcom SF2 switch driver") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: dsa: bcm_sf2: fix unmapping registers in case of errorsFlorian Fainelli2014-11-261-2/+4
| | | | | | | | | | | | | | | | | | In case we fail to ioremap() one of our registers, we would be leaking existing mappings, unwind those accordingly on errors. Fixes: 246d7f773c13 ("net: dsa: add Broadcom SF2 switch driver") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa: mv88e6171: Add support for reading switch registersAndrew Lunn2014-11-161-0/+2
| | | | | | | | | | | | | | | | The infrastructure can now report switch registers to ethtool. Add support for it to the mv88e6171 driver. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa: mv88e6171: Add support for reading the temperatureAndrew Lunn2014-11-161-2/+17
| | | | | | | | | | | | | | | | | | This chip also has a temperature sensor which can be read using the common code. In order to use it, add the needed mutex protection for accessing registers via the shared code. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa: Centralise code for reading the temperature sensorAndrew Lunn2014-11-163-49/+50
| | | | | | | | | | | | | | | | | | The method to read the temperature used in the mve6123_61_65 driver can also be used for other chips. Move the code into the shared code base of mv88e6xxx.c. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
* | dsa: mv88e6171: Add support for mv88e6172Andrew Lunn2014-11-062-4/+7
| | | | | | | | | | | | | | | | The mv88e6172 is very similar to the mv88e6171. So extend the mv88e6171 driver to support it. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2014-11-011-1/+1
|\| | | | | | | | | | | | | | | | | Conflicts: drivers/net/phy/marvell.c Simple overlapping changes in drivers/net/phy/marvell.c Signed-off-by: David S. Miller <davem@davemloft.net>
| * dsa: mv88e6171: Fix tagging protocol/KconfigAndrew Lunn2014-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mv88e6171 can support two different tagging protocols, DSA and EDSA. The switch driver structure only allows one protocol to be enumerated, and DSA was chosen. However the Kconfig entry ensures the EDSA tagging code is built. With a minimal configuration, we then end up with a mismatch. The probe is successful, EDSA tagging is used, but the switch is configured for DSA, resulting in mangled packets. Change the switch driver structure to enumerate EDSA, fixing the mismatch. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Fixes: 42f272539487 ("net: DSA: Marvell mv88e6171 switch driver") Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa: Provide additional RMON statisticsGuenter Roeck2014-10-303-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | Display sw_in_discards, sw_in_filtered, and sw_out_filtered for chips supported by mv88e6123_61_65 and mv88e6352 drivers. The variables are provided in port registers, not the normal status registers. Mark by adding 0x100 to the register offset and add special handling code to mv88e6xxx_get_ethtool_stats. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa/mv88e6352: Add support for reading switch registersGuenter Roeck2014-10-301-0/+2
| | | | | | | | | | | | | | Report switch register values to ethtool. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa/mv88e6123_61_65: Add support for reading switch registersGuenter Roeck2014-10-303-0/+29
| | | | | | | | | | | | | | | | The infrastructure can now report switch registers to ethtool. Add support for it to the mv88e6123_61_65 driver. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa/mv88e6352: Implement EEPROM access functionsGuenter Roeck2014-10-302-3/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | MV88E6352 supports read and write access to its configuration eeprom. There is no means to detect if an EEPROM is connected to the switch. Also, the switch supports EEPROMs with different sizes, but can not detect or report the type or size of connected EEPROMs. Therefore, do not implement the get_eeprom_len callback but depend on platform or devicetree data to provide information about EEPROM presence and size. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa/mv88e6123_61_65: Report chip temperatureGuenter Roeck2014-10-301-2/+66
| | | | | | | | | | | | | | | | MV88E6123 and compatible chips support reading the chip temperature from PHY register 6:26. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa/mv88e6352: Report chip temperatureGuenter Roeck2014-10-301-0/+101
| | | | | | | | | | | | | | | | | | MV88E6352 supports reading the chip temperature from two PHY registers, 6:26 and 6:27. Report it using the more accurate register 6:27. Also report temperature limit and alarm. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa/mv88e6352: Add support for MV88E6176Guenter Roeck2014-10-302-2/+5
| | | | | | | | | | | | | | | | MV88E6176 is mostly compatible to MV88E6352 and is documented in the same functional specification. Add support for it. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa: Add support for Marvell 88E6352Guenter Roeck2014-10-305-0/+485
| | | | | | | | | | | | | | | | | | Marvell 88E6352 is mostly compatible to MV88E6123/61/65, but requires indirect phy access. Also, its configuration registers are a bit different. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa: Report known silicon revisions for Marvell 88E6131Guenter Roeck2014-10-301-4/+8
| | | | | | | | | | | | | | Report known silicon revisions when probing Marvell 88E6131 switches. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa: Report known silicon revisions for Marvell 88E6060Guenter Roeck2014-10-301-1/+4
|/ | | | | | | Report known silicon revisions when probing Marvell 88E6060 switches. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* dsa: Fix conversion from host device to mii busGuenter Roeck2014-10-182-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit b4d2394d01bc ("dsa: Replace mii_bus with a generic host device") replaces mii_bus with a generic host_dev, and introduces dsa_host_dev_to_mii_bus() to support conversion from host_dev to mii_bus. However, in some cases it uses to_mii_bus to perform that conversion. Since host_dev is not the phy bus device but typically a platform device, this fails and results in a crash with the affected drivers. BUG: unable to handle kernel NULL pointer dereference at (null) IP: [<ffffffff81781d35>] __mutex_lock_slowpath+0x75/0x100 PGD 406783067 PUD 406784067 PMD 0 Oops: 0002 [#1] SMP ... Call Trace: [<ffffffff810a538b>] ? pick_next_task_fair+0x61b/0x880 [<ffffffff81781de3>] mutex_lock+0x23/0x37 [<ffffffff81533244>] mdiobus_read+0x34/0x60 [<ffffffff8153b95a>] __mv88e6xxx_reg_read+0x8a/0xa0 [<ffffffff8153b9bc>] mv88e6xxx_reg_read+0x4c/0xa0 Fixes: b4d2394d01bc ("dsa: Replace mii_bus with a generic host device") Cc: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Alexander Duyck <alexander.h.duyck@redhat.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* dsa: mv88e6171: Fix tag_protocol checkGuenter Roeck2014-10-141-1/+1
| | | | | | | | | | tag_protocol is now an enum, so drivers have to check against it. Cc: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Acked-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers/net/dsa/Kconfig: Let NET_DSA_BCM_SF2 depend on HAS_IOMEMChen Gang2014-10-041-0/+1
| | | | | | | | | | | | | | | NET_DSA_BCM_SF2 need HAS_IOMEM, so depend on it, the related error (with allmodconfig under um): CC [M] drivers/net/dsa/bcm_sf2.o drivers/net/dsa/bcm_sf2.c: In function ‘bcm_sf2_sw_setup’: drivers/net/dsa/bcm_sf2.c:487:3: error: implicit declaration of function ‘iounmap’ [-Werror=implicit-function-declaration] iounmap(*base); ^ Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: dsa: bcm_sf2: add support for controlling EEEFlorian Fainelli2014-09-283-0/+79
| | | | | | | | | | | | | When EEE is enabled, negotiate this feature with the PHY and make sure that the capability checking, local EEE advertisement, link partner EEE advertisement and auto-negotiation resolution returned by phy_init_eee() is positive, and enable EEE at the switch level. While querying the current EEE settings, verify the low-power indication and indicate its status. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: dsa: bcm_sf2: add port_enable/disable callbacksFlorian Fainelli2014-09-281-20/+40
| | | | | | | | | | | | | | | The SF2 switch driver is already architected around per-port enable/disable callbacks, so we just need a slight update to our existing bcm_sf2_port_setup() resp. bcm_sf2_port_disable() functions to be suitable as callbacks for port_enable/port_disable. We need to shuffle a little the code that does the per-port VLAN configuration/isolation since ports can now be brought up/down separately, so we need to make sure that IMP (CPU, management) port is always included in that specific port setup. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: dsa: bcm_sf2: disable RGMII interface(s) when link is downFlorian Fainelli2014-09-281-0/+9
| | | | | | | | | When the link is down, disable the RGMII interface to conserve as much power as possible. We re-enable the RGMII interface whenever the link is detected. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: dsa: bcm_sf2: add support for Wake-on-LANFlorian Fainelli2014-09-222-0/+61
| | | | | | | | | | | | | | | In order for Wake-on-LAN to work properly, we query the parent network device Wake-on-LAN features and advertise those. Similarly, when configuring Wake-on-LAN on a per-port network interface, we make sure that we do not accept something the master network devices does not support. Finally, we need to maintain a bitmask of the ports enabled for Wake-on-LAN to prevent the suspend() callback from disabling a port that is used for waking up the system. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>