Change MSI-X vector names to "ethx-%d".
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
In each case, if the NULL test is necessary, then the dereference should be
moved below the NULL test.
The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@@
type T;
expression E;
identifier i,fld;
statement S;
@@
- T i = E->fld;
+ T i;
... when != E
when != i
if (E == NULL) S
+ i = E->fld;
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
genphy_setup_forced hasn't actually reset the PHY for a long time,
but a comment to that effect remained in the code, so code continued
to act as if it *had* reset the PHY, and called the necessary fixup
functions to respond to a PHY reset. With no reset, those functions
are no longer needed, so we remove them.
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Whenever we want to update the status field in a BD, we usually want to
update the length field, too. By combining them into one 32-bit field, we
reduce the number of stores to memory shared with the controller, and we
eliminate the need for order-enforcement, as the length and "READY" bit are
now updated atomically at the same time.
Signed-off-by: Dai Haruki <Dai.Haruki@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This code is based strongly on code from Dai Haruki <Dai.Haruki@freescale.com>.
The gianfar Buffer Descriptors are arranged in a circular array, the end of
which is denoted by setting the "WRAP" bit in the descriptor. However, the
software knows the end of the ring because it knows how many descriptors are
there. Rather than check each descriptor for whether the WRAP bit is set,
use pointer math to determine where the next BD is. This is also useful for
when we want to look at BDs other than the very next one (for Scatter-Gather).
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
- Also, use cacheable_memzero instead of memset for performance reasons.
Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
The eTSEC can prepend up to 32 bytes to a received frame, usually for the
purpose of aligning the IP address to a word boundary, so this turns it on.
While we're in there, make the handling of the pre-frame bytes (padding and
Frame Control Block) cleaner.
Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Optimize the VLAN checking logic as well.
Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Fix some bugs in the ethtool configuration functions:
* gfar_clean_rx_ring should not be called with interrupts disabled.
* Update last transmission time to avoid tx timeout.
* Delete redundant NETIF_F_IP_CSUM check in gfar_start_xmit
* Use netif_tx_lock_bh when reconfiguring the tx csum
Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Store the interrupt coalescing values in the form in which they will be
written to the interrupt coalescing registers. This puts a little overhead
into the ethtool configuration, and takes it out of the interrupt handler
Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Does the same for the accompanying MDIO driver, and then modifies the TBI
configuration method. The old way used fields in einfo, which no longer
exists. The new way is to create an MDIO device-tree node for each instance
of gianfar, and create a tbi-handle property to associate ethernet controllers
with the TBI PHYs they are connected to.
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
gfar_halt does everything we want to do there, including disabling
TX/RX. It also doesn't unnecessarily enable DMA if it's already
stopped.
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
The big rx/tx buffer support is broken and unlikely to be very useful
as such. Remove it.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Fix pci unmapping problem introduced by commit id
8953f12827 "tlan: Fix small (< 64 bytes)
datagram transmissions".
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
These 4 drivers have identical full duplex flow control resolution
functions. This patch changes them all to use one common function.
The function in question decides whether a device should enable TX and
RX flow control in a standard way (IEEE 802.3-2005 table 28B-3), so this
should also be useful for other drivers.
Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
flags used within drivers for indicating tx and rx flow control are
defined in 4 drivers (and probably more), move these constants to mii.h.
The 3 SMSC drivers use the same constants (FLOW_CTRL_TX), but TG3 uses
TG3_FLOW_CTRL_TX, so this patch also renames the constants within TG3.
Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
The NIC driver can work with mutliple versions of the FW.
Let the driver load when the embedded FW does not match,
and the FW update mechanism failed.
The iWARP module will make its own loading decision.
Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
The enc28j60 driver reads incoming packets in the process (workqueue) context,
not in a tasklet or the interrupt context. Thus, we should use netif_rx_ni()
to deliver those packets to the networking layer, instead of netif_rx(). This
way incoming packets don't wait in the incoming queue for the next IRQ to be
serviced.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
The TLAN chip does not support tranmissions smaller than 64
bytes. Smaller transfers need to be padded up to that size. This was
broken by commit id 41873e9aff ("tlan:
get rid of padding buffer").
<URL:http://bugzilla.kernel.org/show_bug.cgi?id=11754>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
The pppol2tp driver has had broken UDP checksum code for a long
time. This patch fixes it. If UDP checksums are enabled in the
tunnel's UDP socket, the L2TP driver now properly validates the
checksum on receive and fills in the checksum on transmit. If the
network device has hardware checksum support and is enabled, it is
used instead of generating/checking the checksum in software.
Signed-off-by: James Chapman <jchapman@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Implement NIC Tx multiqueue.
Bump up driver version.
Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This patch adds GRO support to e1000e by making it invoke napi_gro_receive
instead of netif_receive_skb.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Based upon a report from Randy Dunlap.
The compat netdev ops assignments need to happen in
8390.c and 8390p.c, not lib8390.c, as only the type
specific code can assign the correct function pointers.
Signed-off-by: David S. Miller <davem@davemloft.net>
This issue was initially reported by Joerg Roedel <joerg.roedel@amd.com>
It appears that ixgbe has had a long standing bug where it was unmapping a different size than it had mapped.
ixgbe 0000:02:00.0: PCI-DMA: device driver frees DMA memory with different sizes than it mapped.
ixgbe 0000:02:00.0: PCI-DMA: device driver frees DMA memory with different size [device address=0x0000000003fed812] [map size=258 bytes] [unmap size=256 bytes]
Pid: 6178, comm: rmmod Not tainted 2.6.28-rc5 #4 Call Trace:
[<ffffffff8022a2ae>] iommu_queue_inv_iommu_pages+0x5e/0x70
[<ffffffff80225956>] check_unmap+0x1c6/0x240 [<ffffffff80225ff5>] debug_unmap_single+0xb5/0x110 [<ffffffffa0213997>] ixgbe_clean_rx_ring+0x147/0x220 [<ffffffffa0214d7d>] ixgbe_down+0x2fd/0x3d0 [ixgbe] [<ffffffffa02150b3>] ixgbe_close+0x13/0xc0 [ixgbe] [<ffffffff80431326>] dev_close+0x56/0xa0 [<ffffffff804313b3>] rollback_registered+0x43/0x220 [<ffffffff804315a5>] unregister_netdevice+0x15/0x60 [<ffffffff80431601>] unregister_netdev+0x11/0x20 [<ffffffffa021aef8>] ixgbe_remove+0x48/0x16e [ixgbe] [<ffffffff80386ffc>] pci_device_remove+0x2c/0x60 [<ffffffff803ef929>] __device_release_driver+0x99/0x100
[<ffffffff803efa48>] driver_detach+0xb8/0xc0 [<ffffffff803eea6e>] bus_remove_driver+0x8e/0xd0 [<ffffffff80387374>] pci_unregister_driver+0x34/0x90 [<ffffffff8026c6c7>] sys_delete_module+0x1c7/0x2a0 [<ffffffff802a9ce9>] do_munmap+0x349/0x390 [<ffffffff80374481>] __up_write+0x21/0x150 [<ffffffff8020c30b>] system_call_fastpath+0x16/0x1b
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This patch adds support for SMSC's LAN9420 PCI ethernet controller
to ethtool's dump registers (-d) command.
This patch is for use with an accompanying ethtool patch, which decodes
the register dump.
Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Currently efx_mtd_rename() can race with the probe() and remove()
functions.
Move probe() before device registration and remove() after
unregistration. Move initialisation/update of all names based on the
netdev name into a new function and call it under the RTNL immediately
after registration.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Currently the mtd field is not initialised early enough.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
From: Steve Hodgson <shodgson@solarflare.com>
efx_pci_probe_main() can return success despite a reset being scheduled.
Catch this and retry or abort probe depending on the reset type.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Some of the PHY type names are overly generic. Change them to include
the model numbers of the PHYs they represent.
Correct the model number reference at the top of xfp_phy.c.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
ethtool must contend with the MTD driver for the SPI bus lock, which
may carry out long operations such as flash erase. Allow it to be
interrupted while waiting.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Our ethtool self-test result names each begin with a component name. For
some results this is "port0", which is not very meaningful. Change that
to "rx" or "phy" as appropriate.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Add support code for the SFN4111T 100/1000/10GBASE-T reference design,
based in part on the existing code for the SFE4001.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Add type codes for the new PHY and rename the SFX7101 type code.
Add definition of clause 22 extension MMD.
Adapt the 10Xpress SFX7101 code to support the SFT9001 as well.
Clean up register definitions.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
From: Steve Hodgson <shodgson@solarflare.com>
MAC, PHY and board events may be separately enabled and signalled.
Our current arrangement of chaining the polling functions can result
in events being missed. Change them to be more independent.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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>
The SFC4000 has a separate MAC for use at sub-10G speeds. Introduce
an efx_mac_operations structure with implementations for the two MACs.
Switch between the MACs as necessary.
PHY settings are independent of the MAC, so add get_settings() and
set_settings() to efx_phy_operations. Also add macs field to indicate
which MACs the PHY is connected to.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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>
Remove kluge for development boards with unspecified board type.
Remove assumption of contiguous board type code assignments.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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>