1. 10 2月, 2015 1 次提交
  2. 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
  3. 12 12月, 2014 2 次提交
  4. 12 11月, 2014 1 次提交
  5. 07 11月, 2014 1 次提交
  6. 31 10月, 2014 2 次提交
  7. 20 10月, 2014 1 次提交
  8. 18 10月, 2014 1 次提交
  9. 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
  10. 29 9月, 2014 3 次提交
  11. 23 9月, 2014 2 次提交
  12. 20 9月, 2014 1 次提交
  13. 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
  14. 14 9月, 2014 1 次提交
  15. 28 8月, 2014 7 次提交
  16. 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
  17. 14 5月, 2014 1 次提交
  18. 22 1月, 2014 1 次提交
  19. 04 9月, 2013 1 次提交
  20. 22 1月, 2013 1 次提交
    • F
      dsa: use an unique and non conflicting bus name for the slave MII bus · f490be04
      Florian Fainelli 提交于
      The slave MII bus registered by the DSA code is using the parent MII bus
      as part of its name (ds->master_mii_bus_id), in case the parent MII bus
      name is already 16 characters long (such as d0072004.mdio-mi) we will
      get the following WARN_ON in dsa_switch_setup() when calling
      mdiobus_register():
      
      [   79.088782] ------------[ cut here ]------------
      [   79.093448] WARNING: at fs/sysfs/dir.c:536 sysfs_add_one+0x80/0xa0()
      [   79.099831] sysfs: cannot create duplicate filename
      '/class/mdio_bus/d0072004.mdio-mi'
      
      This is a genuine warning, because the DSA slave MII bus will also be
      named d0072004.mdio-mi, and since MII_BUS_ID_SIZE is 17 characters long
      (with null-terminator) the following will truncate the slave MII bus id:
      
      snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "%s-%d:%.2x",
                              ds->master_mii_bus->id, ds->pd->sw_addr);
      
      Fix this by using dsa-<switch index->:<sw_add> which is guaranteed to be
      unique.
      Signed-off-by: NFlorian Fainelli <florian@openwrt.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f490be04
  21. 15 1月, 2013 1 次提交
  22. 07 1月, 2013 1 次提交
  23. 10 5月, 2012 1 次提交
    • J
      dsa: Convert compare_ether_addr to ether_addr_equal · 8feedbb4
      Joe Perches 提交于
      Use the new bool function ether_addr_equal to add
      some clarity and reduce the likelihood for misuse
      of compare_ether_addr for sorting.
      
      Done via cocci script:
      
      $ cat compare_ether_addr.cocci
      @@
      expression a,b;
      @@
      -	!compare_ether_addr(a, b)
      +	ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	compare_ether_addr(a, b)
      +	!ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	!ether_addr_equal(a, b) == 0
      +	ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	!ether_addr_equal(a, b) != 0
      +	!ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	ether_addr_equal(a, b) == 0
      +	!ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	ether_addr_equal(a, b) != 0
      +	ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	!!ether_addr_equal(a, b)
      +	ether_addr_equal(a, b)
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8feedbb4
  24. 29 11月, 2011 1 次提交
  25. 27 11月, 2011 1 次提交
  26. 18 8月, 2011 1 次提交
  27. 20 4月, 2011 1 次提交
  28. 19 7月, 2010 1 次提交