linux-stable/drivers/net
Jon Nettleton 3bb35261c7 sfp: add high power module support
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: Jon Nettleton <jon@solid-run.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-02-28 11:07:11 -05:00
..
appletalk
arcnet
bonding net: Convert bond_net_ops 2018-02-27 11:01:36 -05:00
caif
can
cris
dsa net: dsa: mv88e6xxx: Poll when no interrupt defined 2018-02-26 11:28:10 -05:00
ethernet mlx5-update-2018-02-23 (IB representors) 2018-02-28 09:54:54 -05:00
fddi
fjes
hamradio
hippi
hyperv
ieee802154 ieee802154: Add NXP MCR20A IEEE 802.15.4 transceiver driver 2018-02-21 09:08:39 +01:00
ipvlan net: Convert ipvlan_net_ops 2018-02-27 11:01:38 -05:00
netdevsim
phy sfp: add high power module support 2018-02-28 11:07:11 -05:00
plip
ppp net: Convert ppp_net_ops 2018-02-27 11:01:37 -05:00
slip
team team: Use extack to report enslavement failures 2018-02-28 11:01:30 -05:00
usb smsc75xx: fix smsc75xx_set_features() 2018-02-22 14:05:15 -05:00
vmxnet3
wan
wimax
wireless Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-02-24 00:04:20 -05:00
xen-netback xen-netback: make function xenvif_rx_skb static 2018-02-26 11:36:54 -05:00
dummy.c
eql.c
geneve.c net: Convert geneve_net_ops 2018-02-27 11:01:36 -05:00
gtp.c net: Convert gtp_net_ops 2018-02-27 11:01:37 -05:00
ifb.c
Kconfig ipvlan: fix building with modular IPV6 2018-02-27 10:37:14 -05:00
LICENSE.SRC
loopback.c net: Convert loopback_net_ops 2018-02-13 10:36:09 -05:00
macsec.c
macvlan.c macvlan: fix use-after-free in macvlan_common_newlink() 2018-02-23 10:48:10 -05:00
macvtap.c
Makefile
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c net/mac8390: Convert to nubus_driver 2018-02-21 14:14:05 -05:00
sungem_phy.c
tap.c vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
thunderbolt.c net: thunderbolt: Run disconnect flow asynchronously when logout is received 2018-02-12 12:03:04 -05:00
tun.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-02-19 18:46:11 -05:00
veth.c
virtio_net.c virtio_net: fix ndo_xdp_xmit crash towards dev not ready for XDP 2018-02-21 15:09:29 -05:00
vrf.c net: Convert simple pernet_operations 2018-02-27 11:01:35 -05:00
vsockmon.c
vxlan.c net: Convert vxlan_net_ops 2018-02-27 11:01:37 -05:00
xen-netfront.c