1. 09 12月, 2016 1 次提交
    • W
      phy: add phy fixup unregister functions · f38e7a32
      Woojung.Huh@microchip.com 提交于
      >From : Woojung Huh <woojung.huh@microchip.com>
      
      Add functions to unregister phy fixup for modules.
      
      int phy_unregister_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask)
      	Unregister phy fixup from phy_fixup_list per bus_id, phy_uid &
      	phy_uid_mask
      
      int phy_unregister_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask)
      	Unregister phy fixup from phy_fixup_list.
      	Use it for fixup registered by phy_register_fixup_for_uid()
      
      int phy_unregister_fixup_for_id(const char *bus_id)
      	Unregister phy fixup from phy_fixup_list.
      	Use it for fixup registered by phy_register_fixup_for_id()
      Signed-off-by: NWoojung Huh <woojung.huh@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f38e7a32
  2. 30 11月, 2016 2 次提交
  3. 26 11月, 2016 1 次提交
  4. 08 11月, 2016 1 次提交
  5. 18 10月, 2016 1 次提交
    • Z
      net: phy: leds: add support for led triggers on phy link state change · 2e0bc452
      Zach Brown 提交于
      Create an option CONFIG_LED_TRIGGER_PHY (default n), which will create a
      set of led triggers for each instantiated PHY device. There is one LED
      trigger per link-speed, per-phy.
      The triggers are registered during phy_attach and unregistered during
      phy_detach.
      
      This allows for a user to configure their system to allow a set of LEDs
      not controlled by the phy to represent link state changes on the phy.
      LEDS controlled by the phy are unaffected.
      
      For example, we have a board where some of the leds in the
      RJ45 socket are controlled by the phy, but others are not. Using the
      triggers provided by this patch the leds not controlled by the phy can
      be configured to show the current speed of the ethernet connection. The
      leds controlled by the phy are unaffected.
      Signed-off-by: NJosh Cartwright <josh.cartwright@ni.com>
      Signed-off-by: NNathan Sullivan <nathan.sullivan@ni.com>
      Signed-off-by: NZach Brown <zach.brown@ni.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2e0bc452
  6. 17 10月, 2016 1 次提交
  7. 21 5月, 2016 1 次提交
  8. 17 5月, 2016 1 次提交
  9. 27 4月, 2016 1 次提交
  10. 16 4月, 2016 1 次提交
  11. 17 2月, 2016 1 次提交
  12. 16 1月, 2016 1 次提交
    • S
      net: phy: turn carrier off on phy attach · 113c74d8
      Sjoerd Simons 提交于
      The operstate of a networking device initially IF_OPER_UNKNOWN aka
      "unknown", updated on carrier state changes (with carrier state being on
      by default). This means it will stay unknown unless the carrier state
      goes to off at some point, which is not the case if the phy is already
      up/connected at startup.
      
      Explicitly turn off the carrier on phy attach, leaving the phy state
      machine to turn the carrier on when it has done the initial negotiation.
      Signed-off-by: NSjoerd Simons <sjoerd.simons@collabora.co.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      113c74d8
  13. 13 1月, 2016 1 次提交
  14. 08 1月, 2016 10 次提交
  15. 03 11月, 2015 1 次提交
    • S
      net: phy: fix a bug in get_phy_c45_ids · 5f6c99e0
      Shaohui Xie 提交于
      When probing devices-in-package for a c45 phy, device zero is the last
      device to probe, however, if driver reads 0 from device zero,
      c45_ids->devices_in_package is set to '0', the loop condition of probing
      will be matched again, see codes below:
      
      for (i = 1;i < num_ids && c45_ids->devices_in_package == 0;i++)
      
      driver will run in a dead loop.
      
      This patch restructures the bug and confusing loop, it provides a helper
      function get_phy_c45_devs_in_pkg which to read devices-in-package registers
      of a MMD, and rewrites the loop with using the helper function.
      Signed-off-by: NShaohui Xie <Shaohui.Xie@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5f6c99e0
  16. 03 10月, 2015 1 次提交
    • S
      phylib: Add phy_set_max_speed helper · f3a6bd39
      Simon Horman 提交于
      Add a helper to allow ethernet drivers to limit the speed of a phy
      (that they are attached to).
      
      This mainly involves factoring out the business-end of
      of_set_phy_supported() and exporting a new symbol.
      
      This code seems to be open coded in several places, in several different
      variants.
      
      It is is envisaged that this will be used in situations where setting the
      "max-speed" property in DT is not appropriate, e.g. because the maximum
      speed is not a property of the phy hardware.
      Signed-off-by: NSimon Horman <horms+renesas@verge.net.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f3a6bd39
  17. 25 9月, 2015 3 次提交
    • R
      phy: add phy_device_remove() · 38737e49
      Russell King 提交于
      Add a phy_device_remove() function to complement phy_device_register(),
      which undoes the effects of phy_device_register() by removing the phy
      device from visibility, but not freeing it.
      
      This allows these details to be moved out of the mdio bus code into
      the phy code where this action belongs.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      38737e49
    • R
      phy: add proper phy struct device refcounting · 7322967b
      Russell King 提交于
      Take a refcount on the phy struct device when the phy device is attached
      to a network device, and drop it after it's detached.  This ensures that
      a refcount is held on the phy device while the device is being used by
      a network device, thereby preventing the phy_device from being
      unexpectedly kfree()'d by phy_device_release().
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7322967b
    • R
      phy: fix mdiobus module safety · 3e3aaf64
      Russell King 提交于
      Re-implement the mdiobus module refcounting to ensure that we actually
      ensure that the mdiobus module code does not go away while we might call
      into it.
      
      The old scheme using bus->dev.driver was buggy, because bus->dev is a
      class device which never has a struct device_driver associated with it,
      and hence the associated code trying to obtain a refcount did nothing
      useful.
      
      Instead, take the approach that other subsystems do: pass the module
      when calling mdiobus_register(), and record that in the mii_bus struct.
      When we need to increment the module use count in the phy code, use
      this stored pointer.  When the phy is deteched, drop the module
      refcount, remembering that the phy device might go away at that point.
      
      This doesn't stop the mii_bus going away while there are in-use phys -
      it merely stops the underlying code vanishing.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3e3aaf64
  18. 29 8月, 2015 2 次提交
  19. 26 8月, 2015 1 次提交
  20. 29 6月, 2015 2 次提交
  21. 27 1月, 2015 1 次提交
  22. 23 8月, 2014 1 次提交
  23. 30 7月, 2014 1 次提交
    • F
      net: phy: re-apply PHY fixups during phy_register_device · d92f5dec
      Florian Fainelli 提交于
      Commit 87aa9f9c ("net: phy: consolidate PHY reset in phy_init_hw()")
      moved the call to phy_scan_fixups() in phy_init_hw() after a software
      reset is performed.
      
      By the time phy_init_hw() is called in phy_device_register(), no driver
      has been bound to this PHY yet, so all the checks in phy_init_hw()
      against the PHY driver and the PHY driver's config_init function will
      return 0. We will therefore never call phy_scan_fixups() as we should.
      
      Fix this by calling phy_scan_fixups() and check for its return value to
      restore the intended functionality.
      
      This broke PHY drivers which do register an early PHY fixup callback to
      intercept the PHY probing and do things like changing the 32-bits unique
      PHY identifier when a pseudo-PHY address has been used, as well as
      board-specific PHY fixups that need to be applied during driver probe
      time.
      Reported-by: NHauke Merthens <hauke-m@hauke-m.de>
      Reported-by: NJonas Gorski <jogo@openwrt.org>
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d92f5dec
  24. 25 7月, 2014 1 次提交
  25. 09 7月, 2014 1 次提交
  26. 23 5月, 2014 1 次提交
    • S
      net: phy: make of_set_phy_supported work with genphy driver · de906af1
      Sascha Hauer 提交于
      of_set_phy_supported allows overwiting hardware capabilities of
      a phy with values from the devicetree. of_set_phy_supported is
      called right after phy_device_register in the assumption that
      phy_probe is called from phy_device_register and the features
      of the phy are already initialized. For the genphy driver this
      is not true, here phy_probe is called later during phy_connect
      time. phy_probe will then overwrite all settings done from
      of_set_phy_supported
      Fix this by moving of_set_phy_supported to the core phy code
      and calling it from phy_probe.
      Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      de906af1