aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-02-03sfc: Do not include unneeded headersBen Hutchings2-3/+0
Earlier refactoring has made these inclusions unnecessary. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-03sfc: Fix some incorrect or redundant commentsBen Hutchings4-15/+7
In particular, the comment about EVQ_RPTR_REG is based on inconsistent preliminary hardware documentation, though the following code was fixed long before release. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-03sfc: Remove declarations of nonexistent functionsBen Hutchings1-2/+0
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-03sfc: Add some missing bits to register self-test masksSteve Hodgson2-2/+2
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-03sfc: Survive ISR0=0 bug in the shared IRQ caseGuido Barzini1-0/+9
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-03sfc: Implement NVRAM selftest for SFC9000 familyBen Hutchings3-0/+48
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-03sfc: Replace PHY MDIO test with an 'alive' testBen Hutchings9-40/+66
SFC9000-family boards do not all use MDIO PHYs, so we need a different test for PHY aliveness. Introduce a PHY operation test_alive(). For PHYs attached to Falcon, use a common implementation based on the existing PHY MDIO test. For PHYs managed through MCDI, use the appropriate MCDI request. Change test name in ethtool from 'core mdio' to 'phy alive'. Rename test_results::mdio to phy_alive and test_results::phy to phy_ext. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-03sfc: Enable autonegotiated flow-control by default if supportedSteve Hodgson3-7/+16
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-03sfc: Handle firmware assertion failure while resettingSteve Hodgson2-25/+44
This allows the driver to recover if the MC firmware has crashed due to an assertion failure. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-03sfc: Update MCDI protocol definitionsBen Hutchings1-23/+179
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-28Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller4-7/+10
2010-01-25sfc: Use fixed-size buffers for MCDI NVRAM requestsBen Hutchings3-6/+7
The low-level MCDI code always uses 32-bit MMIO operations, and callers must pad input and output buffers to multiples of 4 bytes. The MCDI NVRAM functions are not doing this. Also, their buffers are declared as variable-length arrays with no explicit maximum length. Switch to a fixed buffer size based on the chunk size used by the MTD driver (which is a multiple of 4). Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-25sfc: Add workspace for GMAC bug workaround to MCDI MAC_STATS bufferGuido Barzini1-1/+3
Due to a hardware bug in the SFC9000 family, the firmware must transfer raw GMAC statistics to host memory before aggregating them into the cooked (speed-independent) MAC statistics. Extend the stats buffer to support this. The length of the buffer is explicit in the MAC_STATS command, so this change is backward-compatible on both sides. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-23Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller3-10/+9
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-10Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller10-153/+369
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 <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29sfc: Implement TSO for TCP/IPv6Ben Hutchings3-14/+60
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29sfc: Add firmware protocol definitions (MCDI)Steve Hodgson1-0/+1578
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29sfc: Move shared NIC code from falcon.c to new source file nic.cBen Hutchings3-1537/+1549
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29sfc: Allow for additional checksum offload featuresBen Hutchings4-2/+21
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29sfc: Separate shared NIC code from Falcon-specific and rename accordinglyBen Hutchings7-306/+341
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29sfc: Add efx_nic_type operation for identity LED controlBen Hutchings3-3/+12
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29sfc: Add efx_nic_type operation for NVRAM self-testBen Hutchings4-7/+17
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29sfc: Add efx_nic_type operation for register self-testBen Hutchings4-8/+10
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29sfc: Implement ethtool reset operationBen Hutchings5-50/+84
Refactor efx_reset_down() and efx_reset_up() accordingly. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <shodgson@solarflare.com>. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>