Commit graph

10 commits

Author SHA1 Message Date
Ben Hutchings 843813453f sfc: If AN is enabled, always read speed/duplex from the AN advertising bits
When AN is enabled and the link is down the speed/duplex control bits
will not be meaningful.  Use the advertising bits instead, and mask
them with the LPA bits if and only if AN is complete (as before).

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-26 13:49:25 -08:00
Ben Hutchings caa8d8bbdd sfc: Fix unreliable link detection in some loopback modes
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-26 13:46:12 -08:00
Ben Hutchings 04cc8cacb0 sfc: Implement auto-negotiation
Add infrastructure for auto-negotiation of speed, duplex and flow
control.

When using 10Xpress, auto-negotiate flow control.  While we're
at it, clean up the code to warn when partner is not 10GBASE-T
capable.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-12 21:58:17 -08:00
Ben Hutchings 356eebb2b3 sfc: Clean up MDIO flag setting
We often want to set or clear a flag in an MDIO register, but avoid
writing if no change is required since this can have side-effects.
Encapsulate this in a function, mdio_clause45_set_flag().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-12 21:58:16 -08:00
Ben Hutchings 27dd2caca4 sfc: Add support for MMDs numbered >15
Combine DEVS0 and DEVS1 registers into a 32-bit mask instead of
reading just DEVS0.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-12 21:57:58 -08:00
Ben Hutchings 3e133c44d2 sfc: Use lm87 and lm90 drivers for board temperature/power monitoring
Add board monitoring to periodic work whenever link is down.
For SFE4001, report when a fault has caused the PHY to turn off.
For SFE4002, switch XFP PHY into low-power state in case of a fault.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-11-06 00:50:09 -05:00
Ben Hutchings f8b87c1701 sfc: Make PHY flash mode a device attribute, not a module parameter
This allows updating PHY firmware for one interface without removing
all other interfaces handled by the driver.

Replace tx_disabled flags and 10Xpress status enumeration with flags in
enum efx_phy_mode.

Prevent an interface from being brought up while in PHY flash mode.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-09-03 09:53:47 -04:00
Ben Hutchings dc8cfa55da sfc: Use explicit bool for boolean variables, parameters and return values
Replace (cond ? 1 : 0) with cond or !!cond as appropriate, and
(cond ? 0 : 1) with !cond.

Remove some redundant boolean temporaries.

Rename one field that looks like a flag but isn't.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-09-03 09:53:45 -04:00
Ben Hutchings 3273c2e8c6 [netdrvr] sfc: sfc: Add self-test support
Add a set of self-tests accessible thorugh ethtool.
Add hardware loopback and TX disable control code to support them.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-05-13 01:31:44 -04:00
Ben Hutchings 8ceee660aa New driver "sfc" for Solarstorm SFC4000 controller.
The driver supports the 10Xpress PHY and XFP modules on our reference
designs SFE4001 and SFE4002 and the SMC models SMC10GPCIe-XFP and
SMC10GPCIe-10BT.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-29 01:42:43 -04:00