1. 24 8月, 2014 1 次提交
  2. 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
  3. 22 6月, 2014 1 次提交
  4. 03 5月, 2014 1 次提交
  5. 21 4月, 2014 1 次提交
  6. 17 4月, 2014 1 次提交
  7. 18 2月, 2014 2 次提交
  8. 14 2月, 2014 1 次提交
  9. 13 2月, 2014 4 次提交
  10. 14 1月, 2014 3 次提交
  11. 05 1月, 2014 3 次提交
  12. 18 12月, 2013 1 次提交
  13. 10 12月, 2013 1 次提交
  14. 07 12月, 2013 1 次提交
  15. 21 11月, 2013 1 次提交
  16. 01 6月, 2013 1 次提交
  17. 28 5月, 2013 1 次提交
  18. 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
  19. 12 3月, 2013 1 次提交
  20. 15 1月, 2013 1 次提交
  21. 09 7月, 2012 1 次提交
  22. 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
  23. 28 6月, 2012 2 次提交
    • D
      netdev/phy/of: Add more methods for binding PHY devices to drivers. · a30e2c18
      David Daney 提交于
      Allow PHY drivers to supply their own device matching function
      (match_phy_device()), or to be matched OF compatible properties.
      
      PHYs following IEEE802.3 clause 45 have more than one device
      identifier constants, which breaks the default device matching code.
      Other 10G PHYs don't follow the standard manufacturer/device
      identifier register layout standards, but they do use the standard
      MDIO bus protocols for register access.  Both of these require
      adjustments to the PHY driver to device matching code.
      
      If the there is an of_node associated with such a PHY, we can match it
      to its driver using the "compatible" properties, just as we do with
      certain platform devices.  If the "compatible" property match fails,
      first check if there is a driver supplied matching function, and if
      not fall back to the existing identifier matching rules.
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a30e2c18
    • D
      netdev/phy: Handle IEEE802.3 clause 45 Ethernet PHYs · ac28b9f8
      David Daney 提交于
      The IEEE802.3 clause 45 MDIO bus protocol allows for directly
      addressing PHY registers using a 21 bit address, and is used by many
      10G Ethernet PHYS.  Already existing is the ability of MDIO bus
      drivers to use clause 45, with the MII_ADDR_C45 flag.  Here we add
      struct phy_c45_device_ids to hold the device identifier registers
      present in clause 45. struct phy_device gets a couple of new fields:
      c45_ids to hold the identifiers and is_c45 to signal that it is clause
      45.
      
      get_phy_device() gets a new parameter is_c45 to indicate that the PHY
      device should use the clause 45 protocol, and its callers are adjusted
      to pass false.  The follow-on patch to of_mdio.c will pass true where
      appropriate.
      
      EXPORT phy_device_create() so that the follow-on patch to of_mdio.c
      can use it to create phy devices for PHYs, that have non-standard
      device identifier registers, based on the device tree bindings.
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ac28b9f8
  24. 16 5月, 2012 1 次提交
  25. 04 4月, 2012 1 次提交
  26. 16 3月, 2012 1 次提交
    • P
      device.h: audit and cleanup users in main include dir · 313162d0
      Paul Gortmaker 提交于
      The <linux/device.h> header includes a lot of stuff, and
      it in turn gets a lot of use just for the basic "struct device"
      which appears so often.
      
      Clean up the users as follows:
      
      1) For those headers only needing "struct device" as a pointer
      in fcn args, replace the include with exactly that.
      
      2) For headers not really using anything from device.h, simply
      delete the include altogether.
      
      3) For headers relying on getting device.h implicitly before
      being included themselves, now explicitly include device.h
      
      4) For files in which doing #1 or #2 uncovers an implicit
      dependency on some other header, fix by explicitly adding
      the required header(s).
      
      Any C files that were implicitly relying on device.h to be
      present have already been dealt with in advance.
      
      Total removals from #1 and #2: 51.  Total additions coming
      from #3: 9.  Total other implicit dependencies from #4: 7.
      
      As of 3.3-rc1, there were 110, so a net removal of 42 gives
      about a 38% reduction in device.h presence in include/*
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      313162d0
  27. 13 1月, 2012 1 次提交
  28. 24 10月, 2011 1 次提交
    • R
      net: hold sock reference while processing tx timestamps · da92b194
      Richard Cochran 提交于
      The pair of functions,
      
       * skb_clone_tx_timestamp()
       * skb_complete_tx_timestamp()
      
      were designed to allow timestamping in PHY devices. The first
      function, called during the MAC driver's hard_xmit method, identifies
      PTP protocol packets, clones them, and gives them to the PHY device
      driver. The PHY driver may hold onto the packet and deliver it at a
      later time using the second function, which adds the packet to the
      socket's error queue.
      
      As pointed out by Johannes, nothing prevents the socket from
      disappearing while the cloned packet is sitting in the PHY driver
      awaiting a timestamp. This patch fixes the issue by taking a reference
      on the socket for each such packet. In addition, the comments
      regarding the usage of these function are expanded to highlight the
      rule that PHY drivers must use skb_complete_tx_timestamp() to release
      the packet, in order to release the socket reference, too.
      
      These functions first appeared in v2.6.36.
      Reported-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NRichard Cochran <richard.cochran@omicron.at>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Reviewed-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      da92b194
  29. 27 7月, 2011 2 次提交