1. 30 3月, 2015 1 次提交
  2. 26 3月, 2015 1 次提交
  3. 16 3月, 2015 1 次提交
  4. 15 3月, 2015 1 次提交
  5. 12 3月, 2015 2 次提交
  6. 26 2月, 2015 3 次提交
    • G
      net: dsa: Introduce dsa_is_port_initialized · d79d2107
      Guenter Roeck 提交于
      To avoid race conditions when using the ds->ports[] array,
      we need to check if the accessed port has been initialized.
      Introduce and use helper function dsa_is_port_initialized
      for that purpose and use it where needed.
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d79d2107
    • F
      net: dsa: integrate with SWITCHDEV for HW bridging · b73adef6
      Florian Fainelli 提交于
      In order to support bridging offloads in DSA switch drivers, select
      NET_SWITCHDEV to get access to the port_stp_update and parent_get_id
      NDOs that we are required to implement.
      
      To facilitate the integratation at the DSA driver level, we implement 3
      types of operations:
      
      - port_join_bridge
      - port_leave_bridge
      - port_stp_update
      
      DSA will resolve which switch ports that are currently bridge port
      members as some Switch hardware/drivers need to know about that to limit
      the register programming to just the relevant registers (especially for
      slow MDIO buses).
      
      We also take care of setting the correct STP state when slave network
      devices are brought up/down while being bridge members.
      
      Finally, when a port is leaving the bridge, we make sure we set in
      BR_STATE_FORWARDING state, otherwise the bridge layer would leave it
      disabled as a result of having left the bridge.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: NGuenter Roeck <linux@roeck-us.net>
      Tested-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b73adef6
    • G
      net: dsa: Ensure that port array elements are initialized before being used · d87d6f44
      Guenter Roeck 提交于
      A network device notifier can be called for one or more of the created
      slave devices before all slave devices have been registered. This can
      result in a mismatch between ds->phys_port_mask and the registered devices
      by the time the call is made, and it can result in a slave device being
      added to a bridge before its entry in ds->ports[] has been initialized.
      
      Rework the initialization code to initialize entries in ds->ports[] in
      dsa_slave_create. With this change, dsa_slave_create no longer needs
      to return slave_dev but can return an error code instead.
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d87d6f44
  7. 18 2月, 2015 1 次提交
    • G
      net: dsa: Set valid phy interface type · 19334920
      Guenter Roeck 提交于
      If the phy interface mode is not found in devicetree, or if devicetree
      is not configured, of_get_phy_mode returns -ENODEV. The current code
      sets the phy interface mode to the return value from of_get_phy_mode
      without checking if it is valid.
      
      This invalid phy interface mode is passed as parameter to of_phy_connect
      or to phy_connect_direct. This sets the phy interface mode to the invalid
      value, which in turn causes problems for any code using phydev->interface.
      
      Fixes: b31f65fb ("net: dsa: slave: Fix autoneg for phys on switch MDIO bus")
      Fixes: 0d8bcdd3 ("net: dsa: allow for more complex PHY setups")
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      19334920
  8. 10 2月, 2015 1 次提交
  9. 26 1月, 2015 1 次提交
    • V
      net: dsa: set slave MII bus PHY mask · 24df8986
      Vivien Didelot 提交于
      When registering a mdio bus, Linux assumes than every port has a PHY and tries
      to scan it. If a switch port has no PHY registered, DSA will fail to register
      the slave MII bus. To fix this, set the slave MII bus PHY mask to the switch
      PHYs mask.
      
      As an example, if we use a Marvell MV88E6352 (which is a 7-port switch with no
      registered PHYs for port 5 and port 6), with the following declared names:
      
      	static struct dsa_chip_data switch_cdata = {
      		[...]
      		.port_names[0] = "sw0",
      		.port_names[1] = "sw1",
      		.port_names[2] = "sw2",
      		.port_names[3] = "sw3",
      		.port_names[4] = "sw4",
      		.port_names[5] = "cpu",
      	};
      
      DSA will fail to create the switch instance. With the PHY mask set for the
      slave MII bus, only the PHY for ports 0-4 will be scanned and the instance will
      be successfully created.
      Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Tested-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      24df8986
  10. 12 12月, 2014 2 次提交
  11. 12 11月, 2014 1 次提交
  12. 07 11月, 2014 1 次提交
  13. 31 10月, 2014 2 次提交
  14. 20 10月, 2014 1 次提交
  15. 18 10月, 2014 1 次提交
  16. 05 10月, 2014 1 次提交
    • F
      net: dsa: do not call phy_start_aneg · f7d6b96f
      Florian Fainelli 提交于
      Commit f7f1de51 ("net: dsa: start and stop the PHY state machine")
      add calls to phy_start() in dsa_slave_open() respectively phy_stop() in
      dsa_slave_close().
      
      We also call phy_start_aneg() in dsa_slave_create(), and this call is
      messing up with the PHY state machine, since we basically start the
      auto-negotiation, and later on restart it when calling phy_start().
      phy_start() does not currently handle the PHY_FORCING or PHY_AN states
      properly, but such a fix would be too invasive for this window.
      
      Fixes: f7f1de51 ("net: dsa: start and stop the PHY state machine")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f7d6b96f
  17. 29 9月, 2014 3 次提交
  18. 23 9月, 2014 2 次提交
  19. 20 9月, 2014 1 次提交
  20. 16 9月, 2014 2 次提交
    • A
      dsa: Replace mii_bus with a generic host device · b4d2394d
      Alexander Duyck 提交于
      This change makes it so that instead of passing and storing a mii_bus we
      instead pass and store a host_dev.  From there we can test to determine the
      exact type of device, and can verify it is the correct device for our switch.
      
      So for example it would be possible to pass a device pointer from a pci_dev
      and instead of checking for a PHY ID we could check for a vendor and/or device
      ID.
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b4d2394d
    • A
      dsa: Split ops up, and avoid assigning tag_protocol and receive separately · 5075314e
      Alexander Duyck 提交于
      This change addresses several issues.
      
      First, it was possible to set tag_protocol without setting the ops pointer.
      To correct that I have reordered things so that rcv is now populated before
      we set tag_protocol.
      
      Second, it didn't make much sense to keep setting the device ops each time a
      new slave was registered.  So by moving the receive portion out into root
      switch initialization that issue should be addressed.
      
      Third, I wanted to avoid sending tags if the rcv pointer was not registered
      so I changed the tag check to verify if the rcv function pointer is set on
      the root tree.  If it is then we start sending DSA tagged frames.
      
      Finally I split the device ops pointer in the structures into two spots.  I
      placed the rcv function pointer in the root switch since this makes it
      easiest to access from there, and I placed the xmit function pointer in the
      slave for the same reason.
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5075314e
  21. 14 9月, 2014 1 次提交
  22. 28 8月, 2014 7 次提交
  23. 16 7月, 2014 1 次提交
    • T
      net: set name_assign_type in alloc_netdev() · c835a677
      Tom Gundersen 提交于
      Extend alloc_netdev{,_mq{,s}}() to take name_assign_type as argument, and convert
      all users to pass NET_NAME_UNKNOWN.
      
      Coccinelle patch:
      
      @@
      expression sizeof_priv, name, setup, txqs, rxqs, count;
      @@
      
      (
      -alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs)
      +alloc_netdev_mqs(sizeof_priv, name, NET_NAME_UNKNOWN, setup, txqs, rxqs)
      |
      -alloc_netdev_mq(sizeof_priv, name, setup, count)
      +alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, setup, count)
      |
      -alloc_netdev(sizeof_priv, name, setup)
      +alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, setup)
      )
      
      v9: move comments here from the wrong commit
      Signed-off-by: NTom Gundersen <teg@jklm.no>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c835a677
  24. 14 5月, 2014 1 次提交
  25. 22 1月, 2014 1 次提交