1. 01 3月, 2018 5 次提交
    • J
      sfp: add high power module support · 3bb35261
      Jon Nettleton 提交于
      This patch is the result of work by both Jon Nettleton and Russell King.
      Jon wrote the original patch, adding support for SFP modules which
      require a power level greater than '1'.
      
      Russell's changes:
      - Fix the power levels for big-endian, and make the code flow better.
      - Convert to use device_property_read_u8()
      - Warn for power levels exceeding host level
        SFF-8431 says:
      
        "To avoid exceeding system power supply limits and cooling capacity,
         all modules at power up by default shall operate with up to 1.0 W.
         Hosts supporting Power Level II or III operation may enable a Power
         Level II or III module through the 2-wire interface. Power Level II
         or III modules shall assert the power level declaration bit of
         SFF-8472."
      
        Print a warning for modules that exceed the host power level, and
        leave them operating in power level 1.
      
      - Fix i2c write
        The first byte of any write after the bus address is always the
        device address.  In order to write a value to device D, address I,
        value V, we need to generate on the bus:
      
          S DDDDDDDD A IIIIIIII A VVVVVVVV A P
      
        where S = start, R = restart, A = ack, P = stop.  Splitting this
        as two:
      
          S DDDDDDDD A IIIIIIII A R DDDDDDDD A VVVVVVVV A P
      
        results in the device's address register being written first by I
        and then by V - the addressed register within the device is not
        written.
      
      - Avoid power mode switching if 0xa2 is not implemented
        Some modules indicate that they support power level II or power level
        III, but do not implement address 0xa2, meaning that the bit to set
        them to high power mode is not accessible.
      
        These modules appear to have the sff8472_compliance field set to zero,
        and also do not implement diagnostics.  Detect this, but also ensure
        that the module does not require the address switching mode, which we
        do not implement.
      
      - Use mW for power level rather than power level number.
      
      - Fix high power mode transition
        We must not switch to SFP_MOD_PRESENT state until we have finished
        initialising, because the remaining state machines check for that
        state.  Add SFP_MOD_HPOWER as an intermediate state.
      
      - Use definition for I2C register address rather than constant.
      Signed-off-by: NJon Nettleton <jon@solid-run.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3bb35261
    • R
      dt-bindings: add maximum power level to SFP binding · 66f5325c
      Russell King 提交于
      Add the new maximum power level property to the SFP binding.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      66f5325c
    • R
      phylink,sfp: negotiate interface format with MAC · a9c79364
      Russell King 提交于
      Negotiate the interface format with the MAC rather than requiring it to
      be a fixed type specified solely by the SFP module.  This allows modules
      that can work with several different interface signalling formats to
      select a format compatible with the MAC - for example, a Fiber module
      supporing Gigabit ethernet and faster connected to a Gigabit only MAC
      needs to select the 1000BASE-X mode.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a9c79364
    • R
      sfp: support 1G BiDi (eg, FiberStore SFP-GE-BX) modules · 03145864
      Russell King 提交于
      Some BiDi modules (eg, FiberStore SFP-GE-BX) are not compliant with
      1000BASE-BX as they use different wavelengths from the 1000BASE-BX
      standard (eg, 1310nm/1550nm rather than 1310nm/1490nm).  These modules
      support 1000BASE-X ethernet, so detect them by a failure to find any
      other support, the 8B10B encoding and a bit rate that falls within the
      1Gbps window.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      03145864
    • I
      team: Use extack to report enslavement failures · 44d15d93
      Ido Schimmel 提交于
      Use extack inside team's enslavement function and also propagate it to
      the netdevice notifier to allow enslaved ports to report the failure
      reason. Example:
      
      $ teamd -t team0 -d -c '{"runner": {"name": "lacp"}}'
      $ ip link set dev lo master team0
      Error: Loopback device can't be added as a team port.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Acked-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      44d15d93
  2. 28 2月, 2018 35 次提交