1. 01 9月, 2015 1 次提交
    • F
      net: phy: Allow PHY devices to identify themselves as Ethernet switches, etc. · 5a11dd7d
      Florian Fainelli 提交于
      Some Ethernet MAC drivers using the PHY library require the hardcoding
      of link parameters when interfaced to a switch device, SFP module,
      switch to switch port, etc. This has typically lead to various ad-hoc
      implementations looking like this:
      
      - using a "fixed PHY" emulated device, which will provide link
        indication towards the Ethernet MAC driver and hardware
      
      - pretend there is no PHY and hardcode link parameters, ala mv643x_eth
      
      Based on that, it is desireable to have the PHY drivers advertise the
      correct link parameters, just like regular Ethernet PHYs towards their
      CPU Ethernet MAC drivers, however, Ethernet MAC drivers should be able
      to tell whether this link should be monitored or not. In the context
      of an Ethernet switch, SFP module, switch to switch link, we do not
      need to monitor this link since it should be always up.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5a11dd7d
  2. 11 7月, 2015 1 次提交
  3. 27 5月, 2015 1 次提交
  4. 15 5月, 2015 1 次提交
  5. 27 1月, 2015 2 次提交
  6. 07 1月, 2015 1 次提交
  7. 22 11月, 2014 1 次提交
  8. 13 11月, 2014 1 次提交
  9. 24 8月, 2014 1 次提交
  10. 31 7月, 2014 1 次提交
    • V
      net: libphy: Add phy specific function to access mmd phy registers · 0c1d77df
      Vince Bridgers 提交于
      libphy was originally written assuming all phy devices support clause 45
      access extensions to the mmd registers through the indirection registers
      located within the first 16 phy registers. This assumption is not true
      in all cases, and one specific example is the Micrel ksz9021 10/100/1000
      Mbps phy. Using the stmmac driver, accessing the mmd registers to query
      and configure energy efficient Ethernet (EEE) features yielded unexpected
      behavior.
      
      This patch adds mmd access functions to the phy driver that can be
      overriden by the phy specific driver if the phy does not support this
      mechanism or uses it's own non-standard access mechanism. By default,
      the IEEE Compatible clause 45 access mechanism described in clause 22
      is used. With this patch, EEE query/configure functions as expected
      using the stmmac and the Micrel ksz9021 phy.
      Signed-off-by: NVince Bridgers <vbridgers2013@gmail.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c1d77df
  11. 22 6月, 2014 1 次提交
  12. 03 5月, 2014 1 次提交
  13. 21 4月, 2014 1 次提交
  14. 17 4月, 2014 1 次提交
  15. 18 2月, 2014 2 次提交
  16. 14 2月, 2014 1 次提交
  17. 13 2月, 2014 4 次提交
  18. 14 1月, 2014 3 次提交
  19. 05 1月, 2014 3 次提交
  20. 18 12月, 2013 1 次提交
  21. 10 12月, 2013 1 次提交
  22. 07 12月, 2013 1 次提交
  23. 21 11月, 2013 1 次提交
  24. 01 6月, 2013 1 次提交
  25. 28 5月, 2013 1 次提交
  26. 21 5月, 2013 2 次提交
    • F
      phy: add phy_mac_interrupt() to use with PHY_IGNORE_INTERRUPT · 5ea94e76
      Florian Fainelli 提交于
      There is currently no way for an Ethernet MAC driver servicing PHY link
      interrupts to notify this to the PHY state machine without defining its
      own state machine. Since most drivers are not so special, introduce a
      helper: phy_mac_interrupt() which can be called from a link up/down
      interrupt routine to update the PHY state machine. To avoid code
      duplication some refactoring has been done to expose the workqueue and
      its corresponding callback internally.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5ea94e76
    • F
      phy: fix the use of PHY_IGNORE_INTERRUPT · 2c7b4921
      Florian Fainelli 提交于
      When a PHY device is registered with the special IRQ value
      PHY_IGNORE_INTERRUPT (-2) it will not properly be handled by the PHY
      library:
      
      - it continues to poll its register, while we do not want this
        because such PHY link events or register changes are serviced by an
        Ethernet MAC
      - it will still try to configure PHY interrupts at the PHY level, such
        interrupts do not exist at the PHY but at the MAC level
      - the state machine only handles PHY_POLL, but should also handle
        PHY_IGNORE_INTERRUPT similarly
      
      This patch updates the PHY state machine and initialization paths to
      account for the specific PHY_IGNORE_INTERRUPT. Based on an earlier patch
      by Thomas Petazzoni, and reworked to add the missing bits. Add a helper
      phy_interrupt_is_valid() which specifically tests for a PHY interrupt
      not to be PHY_POLL or PHY_IGNORE_INTERRUPT and use it throughout the
      code.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2c7b4921
  27. 12 3月, 2013 1 次提交
  28. 15 1月, 2013 1 次提交
  29. 09 7月, 2012 1 次提交
  30. 01 7月, 2012 1 次提交
    • G
      phy: add the EEE support and the way to access to the MMD registers. · a59a4d19
      Giuseppe CAVALLARO 提交于
      This patch adds the support for the Energy-Efficient Ethernet (EEE)
      to the Physical Abstraction Layer.
      To support the EEE we have to access to the MMD registers 3.20 and
      7.60/61. So two new functions have been added to read/write the MMD
      registers (clause 45).
      
      An Ethernet driver (I tested the stmmac) can invoke the phy_init_eee to properly
      check if the EEE is supported by the PHYs and it can also set the clock
      stop enable bit in the 3.0 register.
      The phy_get_eee_err can be used for reporting the number of time where
      the PHY failed to complete its normal wake sequence.
      
      In the end, this patch also adds the EEE ethtool support implementing:
       o phy_ethtool_set_eee
       o phy_ethtool_get_eee
      
      v1: initial patch
      v2: fixed some errors especially on naming convention
      v3: renamed again the mmd read/write functions thank to Ben's feedback
      v4: moved file to phy.c and added the ethtool support.
      v5: fixed phy_adv_to_eee, phy_eee_to_supported, phy_eee_to_adv return
          values according to ethtool API (thanks to Ben's feedback).
          Renamed some macros to avoid too long names.
      v6: fixed kernel-doc comments to be properly parsed.
          Fixed the phy_init_eee function: we need to check which link mode
          was autonegotiated and then the corresponding bits in 7.60 and 7.61
          registers.
      v7: reviewed the way to get the negotiated settings.
      v8: fixed a problem in the phy_init_eee return value erroneously added
          when included the phy_read_status call.
      v9: do not remove the MDIO_AN_EEE_ADV_100TX and MDIO_AN_EEE_ADV_1000T
          and fixed the eee_{cap,lp,adv} declaration as "int" instead of u16.
      Signed-off-by: NGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Reviewed-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a59a4d19