1. 04 8月, 2020 1 次提交
  2. 09 7月, 2020 1 次提交
  3. 08 7月, 2020 1 次提交
  4. 01 7月, 2020 2 次提交
    • B
      net: phy: don't abuse devres in devm_mdiobus_register() · ac3a68d5
      Bartosz Golaszewski 提交于
      We currently have two managed helpers for mdiobus - devm_mdiobus_alloc()
      and devm_mdiobus_register(). The idea behind devres is that the release
      callback releases whatever resource the devm function allocates. In the
      mdiobus case however there's no devres associated with the device by
      devm_mdiobus_register(). Instead the release callback for
      devm_mdiobus_alloc(): _devm_mdiobus_free() unregisters the device if
      it is marked as managed.
      
      This all seems wrong. The managed structure shouldn't need to know or
      care about whether it's managed or not - and this is the case now for
      struct mii_bus. The devres wrapper should be opaque to the managed
      resource.
      
      This changeset makes devm_mdiobus_alloc() and devm_mdiobus_register()
      conform to common devres standards: devm_mdiobus_alloc() allocates a
      devres structure and registers a callback that will call mdiobus_free().
      __devm_mdiobus_register() allocated another devres and registers a
      callback that will unregister the bus.
      Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ac3a68d5
    • B
      phy: un-inline devm_mdiobus_register() · 8b11c20a
      Bartosz Golaszewski 提交于
      Functions should only be static inline if they're very short. This
      devres helper is already over 10 lines and it will grow soon as we'll
      be improving upon its approach. Pull it into mdio_devres.c.
      Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8b11c20a
  5. 26 6月, 2020 1 次提交
  6. 25 6月, 2020 2 次提交
  7. 24 6月, 2020 1 次提交
  8. 20 6月, 2020 3 次提交
  9. 27 5月, 2020 3 次提交
  10. 22 5月, 2020 1 次提交
  11. 19 5月, 2020 1 次提交
    • D
      net: phy: simplify phy_link_change arguments · a307593a
      Doug Berger 提交于
      This function was introduced to allow for different handling of
      link up and link down events particularly with regard to the
      netif_carrier. The third argument do_carrier allowed the flag to
      be left unchanged.
      
      Since then the phylink has introduced an implementation that
      completely ignores the third parameter since it never wants to
      change the flag and the phylib always sets the third parameter
      to true so the flag is always changed.
      
      Therefore the third argument (i.e. do_carrier) is no longer
      necessary and can be removed. This also means that the phylib
      phy_link_down() function no longer needs its second argument.
      Signed-off-by: NDoug Berger <opendmb@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a307593a
  12. 11 5月, 2020 4 次提交
  13. 07 5月, 2020 2 次提交
    • O
      ethtool: provide UAPI for PHY master/slave configuration. · bdbdac76
      Oleksij Rempel 提交于
      This UAPI is needed for BroadR-Reach 100BASE-T1 devices. Due to lack of
      auto-negotiation support, we needed to be able to configure the
      MASTER-SLAVE role of the port manually or from an application in user
      space.
      
      The same UAPI can be used for 1000BASE-T or MultiGBASE-T devices to
      force MASTER or SLAVE role. See IEEE 802.3-2018:
      22.2.4.3.7 MASTER-SLAVE control register (Register 9)
      22.2.4.3.8 MASTER-SLAVE status register (Register 10)
      40.5.2 MASTER-SLAVE configuration resolution
      45.2.1.185.1 MASTER-SLAVE config value (1.2100.14)
      45.2.7.10 MultiGBASE-T AN control 1 register (Register 7.32)
      
      The MASTER-SLAVE role affects the clock configuration:
      
      -------------------------------------------------------------------------------
      When the  PHY is configured as MASTER, the PMA Transmit function shall
      source TX_TCLK from a local clock source. When configured as SLAVE, the
      PMA Transmit function shall source TX_TCLK from the clock recovered from
      data stream provided by MASTER.
      
      iMX6Q                     KSZ9031                XXX
      ------\                /-----------\        /------------\
            |                |           |        |            |
       MAC  |<----RGMII----->| PHY Slave |<------>| PHY Master |
            |<--- 125 MHz ---+-<------/  |        | \          |
      ------/                \-----------/        \------------/
                                                     ^
                                                      \-TX_TCLK
      
      -------------------------------------------------------------------------------
      
      Since some clock or link related issues are only reproducible in a
      specific MASTER-SLAVE-role, MAC and PHY configuration, it is beneficial
      to provide generic (not 100BASE-T1 specific) interface to the user space
      for configuration flexibility and trouble shooting.
      Signed-off-by: NOleksij Rempel <o.rempel@pengutronix.de>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bdbdac76
    • M
      net: phy: add concept of shared storage for PHYs · 63490847
      Michael Walle 提交于
      There are packages which contain multiple PHY devices, eg. a quad PHY
      transceiver. Provide functions to allocate and free shared storage.
      
      Usually, a quad PHY contains global registers, which don't belong to any
      PHY. Provide convenience functions to access these registers.
      Signed-off-by: NMichael Walle <michael@walle.cc>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      63490847
  14. 25 4月, 2020 1 次提交
  15. 23 4月, 2020 1 次提交
  16. 24 3月, 2020 3 次提交
  17. 18 3月, 2020 2 次提交
  18. 15 3月, 2020 1 次提交
  19. 13 3月, 2020 1 次提交
  20. 02 3月, 2020 1 次提交
  21. 25 2月, 2020 1 次提交
    • J
      mdio_bus: Add generic mdio_find_bus() · ce69e216
      Jeremy Linton 提交于
      It appears most ethernet drivers follow one of two main strategies
      for mdio bus/phy management. A monolithic model where the net driver
      itself creates, probes and uses the phy, and one where an external
      mdio/phy driver instantiates the mdio bus/phy and the net driver
      only attaches to a known phy. Usually in this latter model the phys
      are discovered via DT relationships or simply phy name/address
      hardcoding.
      
      This is a shame because modern well behaved mdio buses are self
      describing and can be probed. The mdio layer itself is fully capable
      of this, yet there isn't a clean way for a standalone net driver
      to attach and enumerate the discovered devices. This is because
      outside of of_mdio_find_bus() there isn't a straightforward way
      to acquire the mii_bus pointer.
      
      So, lets add a mdio_find_bus which can return the mii_bus based
      only on its name.
      Signed-off-by: NJeremy Linton <jeremy.linton@arm.com>
      Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ce69e216
  22. 17 2月, 2020 1 次提交
  23. 21 1月, 2020 2 次提交
  24. 20 1月, 2020 1 次提交
  25. 17 1月, 2020 1 次提交
    • F
      net: phy: Maintain MDIO device and bus statistics · 080bb352
      Florian Fainelli 提交于
      We maintain global statistics for an entire MDIO bus, as well as broken
      down, per MDIO bus address statistics. Given that it is possible for
      MDIO devices such as switches to access MDIO bus addresses for which
      there is not a mdio_device instance created (therefore not a a
      corresponding device directory in sysfs either), we also maintain
      per-address statistics under the statistics folder. The layout looks
      like this:
      
      /sys/class/mdio_bus/../statistics/
      	transfers
      	errrors
      	writes
      	reads
      	transfers_<addr>
      	errors_<addr>
      	writes_<addr>
      	reads_<addr>
      
      When a mdio_device instance is registered, a statistics/ folder is
      created with the tranfers, errors, writes and reads attributes which
      point to the appropriate MDIO bus statistics structure.
      
      Statistics are 64-bit unsigned quantities and maintained through the
      u64_stats_sync.h helper functions.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Tested-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      080bb352
  26. 15 1月, 2020 1 次提交