aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/sfc
AgeCommit message (Collapse)AuthorFilesLines
2010-01-19sfc: QT202x: Remove unreliable MMD check at initialisationMatthew Slattery1-6/+0
Checking the PHY XS MMD here is unnecessary and can give false negatives. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-01-13sfc: Fix conditions for MDIO self-testBen Hutchings1-2/+6
The MDIO self-test should not be run on boards without an MDIO PHY, such as SFN5122F-R3 and later revisions. It should also not try to address a specific MMD in an MDIO clause 22 PHY. Check the mode_support field to decide which mode to use, if any. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-01-13sfc: Fix polling for slow MCDI operationsBen Hutchings1-2/+3
When the interface is down and we are using polled mode for MCDI operations, we busy-wait for completion for approximately 1 jiffy using udelay() and then back off to schedule(). But the completion will not wake the task, since we are using polled mode! We must use schedule_timeout_uninterruptible() instead. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-01-10Merge branch 'master' of ↵David S. Miller10-153/+369
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/net/benet/be_cmds.h include/linux/sysctl.h
2010-01-07drivers/net/: use DEFINE_PCI_DEVICE_TABLE()Alexey Dobriyan1-1/+1
Use DEFINE_PCI_DEVICE_TABLE() so we get place PCI ids table into correct section in every case. Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-12-23sfc: Disable TX descriptor prefetch watchdogBen Hutchings1-0/+2
This hardware watchdog can misfire, so it does more harm than good. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-12-23sfc: QT2025C: Add error message for suspected bad SFP+ cablesBen Hutchings1-1/+7
Some cables have EEPROMs that conflict with the PHY's on-board EEPROM so it cannot load firmware. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-12-23sfc: QT2025C: Work around PHY firmware initialisation bugMatthew Slattery1-8/+51
The PHY's firmware very occasionally appears to lock up very early, but with the heartbeat update still running. Rebooting the microcontroller core seems to be sufficient to recover. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-12-23sfc: QT2025C: Switch into self-configure mode when not in loopbackMatthew Slattery1-0/+119
The PHY boots in a mode which is not necessarily optimal. This change switches it to self-configure mode (except when in loopback, which won't work in that mode if an SFP+ module is not present) by rebooting the PHY's microcontroller, and replicating the sequence of configuration writes from the boot EEPROM with the appropriate changes. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-12-23sfc: QT2025C: Work around PHY bugMatthew Slattery1-0/+42
If we see the PHY remaining stuck in a link-down state due to PCS being down while PMA/PMD is up, we briefly switch to PMA/PMD loopback and back, which usually unsticks it. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-12-23sfc: Fix DMA mapping cleanup in case of an error in TSONeil Turton1-2/+2
We need buffer->len to remain valid to work out the correct address to be unmapped. We therefore need to clear buffer->len after the unmap operation. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-12-23sfc: Include XGXS in XMAC link status check except in XGMII loopbackBen Hutchings1-16/+22
The XGXS block may not get a link immediately in XGXS or XAUI loopback modes, so we still need to check it. Split falcon_xaui_link_ok() into falcon_xgxs_link_ok(), which checks only the Falcon XGXS block, and falcon_xmac_link_ok(), which checks one or both sides of the link as appropriate. Also rename falcon_check_xaui_link() to falcon_xmac_link_ok_retry(). Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-12-23sfc: Move PHY software state initialisation from init() into probe()Steve Hodgson7-131/+129
This prevents efx->link_advertising from being blatted during a reset. The phy_short_reach sysfs node is now destroyed later in the port shutdown process, so check for STATE_RUNNING after acquiring the rtnl_lock (just like in set_phy_flash_cfg). Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-12-13drivers/net/sfc: Correct code taking the size of a pointerJulia Lawall1-1/+1
The function efx_iterate_state contains the code memcpy(&payload->msg, payload_msg, sizeof(payload_msg)); This is the only use of payload_msg. The type of payload_msg is changed from a pointer to an array, so that the result of sizeof really is the length of the string. A simplified version of the semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression *x; expression f; type T; @@ *f(...,(T)x,...) // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Update version, copyright dates, authorsBen Hutchings23-26/+26
This driver has been mostly rewritten since Michael Brown's initial work, so swap the order of the authors. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Implement TSO for TCP/IPv6Ben Hutchings3-14/+60
Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Add support for SFC9000 family (2)Ben Hutchings14-29/+414
This integrates support for the SFC9000 family of 10G Ethernet controllers and LAN-on-motherboard chips, starting with the SFL9021 'Siena' and SFC9020 'Bethpage'. Credit for this code is largely due to my colleagues at Solarflare: Guido Barzini Steve Hodgson Kieran Mansley Matthew Slattery Neil Turton Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Add support for SFC9000 family (1)Ben Hutchings5-0/+2595
This adds support for the SFC9000 family of 10G Ethernet controllers and LAN-on-motherboard chips, starting with the SFL9021 'Siena' and SFC9020 'Bethpage'. The SFC9000 family is based on the SFC4000 'Falcon' architecture, but with some significant changes: - Two ports are associated with two independent PCI functions (except SFC9010) - Integrated 10GBASE-T PHY(s) (SFL9021/9022) - MAC, PHY and board peripherals are managed by firmware - Driver does not require board-specific code - Firmware supports wake-on-LAN and lights-out management through NC-SI - IPv6 checksum offload and RSS - Filtering by MAC address and VLAN (not included in this code) - PCI SR-IOV (not included in this code) Credit for this code is largely due to my colleagues at Solarflare: Guido Barzini Steve Hodgson Kieran Mansley Matthew Slattery Neil Turton Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Add firmware protocol definitions (MCDI)Steve Hodgson1-0/+1578
Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Move shared NIC code from falcon.c to new source file nic.cBen Hutchings3-1537/+1549
Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Rename falcon.h to nic.hBen Hutchings14-16/+16
nic.h is no longer specific to Falcon. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Allow for additional checksum offload featuresBen Hutchings4-2/+21
Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Extend MTD driver for use with new NICsBen Hutchings6-124/+255
In new NICs flash is managed by firmware and we will use high-level operations on partitions rather than direct SPI commands. Add support for multiple MTD partitions per flash device and remove the direct link between MTD and SPI devices. Maintain a list of MTD partitions in struct efx_nic. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Remove static PHY data and enumerationsBen Hutchings9-65/+95
New NICs have firmware managing the PHY, and we will discover the PHY capabilities at run-time. Replace the static data with probe() and test_name() operations. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Extend loopback mode enumerationBen Hutchings7-28/+111
New NICs and PHYs support a wider variety of loopback modes. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Fold falcon_probe_nic_variant() into falcon_probe_nic()Ben Hutchings1-40/+24
falcon_probe_nic_variant() does a lot less than it used to, and a lot less than it claims to. Fold the remainder into its caller. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Separate shared NIC code from Falcon-specific and rename accordinglyBen Hutchings7-306/+341
Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Add efx_nic_type operation for identity LED controlBen Hutchings3-3/+12
Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Add efx_nic_type operation for NVRAM self-testBen Hutchings4-7/+17
Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Add efx_nic_type operation for register self-testBen Hutchings4-8/+10
Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Implement ethtool reset operationBen Hutchings5-50/+84
Refactor efx_reset_down() and efx_reset_up() accordingly. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Add power-management and wake-on-LAN supportBen Hutchings4-0/+146
Wake-on-LAN is a stub for Falcon, but will be implemented fully for new NICs. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Generalise link state monitoringSteve Hodgson2-34/+61
Use the efx_nic_type::monitor operation or event handling as appropriate. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Refactor link configurationBen Hutchings15-182/+273
Refactor PHY, MAC and NIC configuration operations so that the existing link configuration can be re-pushed with: efx->phy_op->reconfigure(efx); efx->mac_op->reconfigure(efx); and a new configuration with: efx->nic_op->reconfigure_port(efx); (plus locking and error-checking). We have not held the link settings in software (aside from flow control), and have relied on asking the hardware what they are. This is a problem because in some cases the hardware may no longer be in a state to tell us. In particular, if an entire multi-port board is reset through one port, the driver bindings to other ports have no chance to save settings before recovering. We only actually need to keep track of the autonegotiation settings, so add an ethtool advertising mask to struct efx_nic, initialise it in PHY init and update it as necessary. Remove now-unneeded uses of efx_phy_op::{get,set}_settings() and struct ethtool_cmd. Much of this was done by Steve Hodgson <[email protected]>. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Move Falcon NIC operations to efx_nic_typeBen Hutchings6-63/+105
This is preparation for adding differing implementations for new NICs. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Turn pause frame generation on and off at the MAC, not the RX FIFOBen Hutchings2-8/+8
Pause frame generation is gated by both RX_XOFF_MAC_EN and an enable bit in each MAC. RX_XOFF_MAC_EN bit always reads back as 0 so we need to set it correctly every time we modify RX_CFG_REG. Simplify this by always setting it to 1 and only changing the enable bits in the MACs. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Remove duplicate hardware structure definitionsBen Hutchings2-15/+3
Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Remove redundant writes to INT_ADR_KERBen Hutchings1-8/+7
This register only needs to be written after reset, not each time we enable interrupts. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-29sfc: Clean up RX event handlingBen Hutchings3-8/+8
Add 'likely' hint to test of rx_checksum_enabled. Don't count IP fragments; the IP stack can do that. Do count non-matching multicast packets. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-28sfc: Move descriptor cache base addresses to struct efx_nic_typeBen Hutchings2-4/+12
Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-28sfc: Decouple NIC revision number from Falcon PCI revision numberBen Hutchings8-52/+48
Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-28sfc: Remove some redundant whitespaceBen Hutchings1-2/+0
Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-28sfc: Remove another unused workaround macroBen Hutchings1-2/+0
Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-28sfc: Remove EFX_WORKAROUND_9141 macroMatthew Slattery2-3/+1
The "bug9141 workaround" of setting TX_FLUSH_MIN_LEN_EN should really be considered as a normal bit of configuration rather than a workaround. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-28sfc: Limit some hardware workarounds to FalconBen Hutchings2-3/+4
Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-28sfc: Always start Falcon using the XMACSteve Hodgson3-8/+16
The strap bits are only important on Falcon A and all production boards using it have fixed-speed 10G PHYs. Replace dummy MAC operations with default MAC operations. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-28sfc: Replace MDIO spinlock with mutexSteve Hodgson3-9/+9
We never use MDIO in atomic context, so we don't need to spin. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-28sfc: QT202x: Reset before reading PHY idSteve Hodgson1-14/+8
Reading standard registers on the QT2025C before its firmware has booted may cause the boot process to fail. Therefore, follow the recommended reset sequence before reading its id registers. Either order works for the QT2022C2, so don't differentiate. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-28sfc: Simplify PHY pollingSteve Hodgson7-124/+103
Falcon can generate events for LASI interrupts from the PHY, but in practice we have never implemented this in reference designs. Instead we have polled, inserted the appropriate events, and then handled the events later. This is a waste of time and code. Instead, make PHY poll functions update the link state synchronously and report whether it changed. We can still make use of the LASI registers as a shortcut on the SFT9001. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-11-26sfc: Do not set net_device::trans_start in self-testBen Hutchings1-1/+0
Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>