GitHub/exynos8895/android_kernel_samsung_universal8895.git
15 years ago[PATCH] net: remove superfluous call to synchronize_net()
Eric Dumazet [Fri, 17 Apr 2009 11:52:48 +0000 (04:52 -0700)]
[PATCH] net: remove superfluous call to synchronize_net()

inet_register_protosw() function is responsible for adding a new
inet protocol into a global table (inetsw[]) that is used with RCU rules.

As soon as the store of the pointer is done, other cpus might see
this new protocol in inetsw[], so we have to make sure new protocol
is ready for use. All pending memory updates should thus be committed
to memory before setting the pointer.
This is correctly done using rcu_assign_pointer()

synchronize_net() is typically used at unregister time, after
unsetting the pointer, to make sure no other cpu is still using
the object we want to dismantle. Using it at register time
is only adding an artificial delay that could hide a real bug,
and this bug could popup if/when synchronize_rcu() can proceed
faster than now.

This saves about 13 ms on boot time on a HZ=1000 8 cpus machine  ;)
(4 calls to inet_register_protosw(), and about 3200 us per call)

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agowan/pc300_drv: convert to net_device_ops
Alexander Beregalov [Thu, 16 Apr 2009 15:48:17 +0000 (15:48 +0000)]
wan/pc300_drv: convert to net_device_ops

On Fri, Apr 17, 2009 at 05:23:02AM +0400, Alexander Beregalov wrote:
>
> Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
> ---
>  drivers/net/wan/pc300_drv.c |   22 ++++++++++++++--------
>  1 files changed, 14 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c
> index c23fde0..df10a4c 100644
> --- a/drivers/net/wan/pc300_drv.c
> +++ b/drivers/net/wan/pc300_drv.c
> @@ -225,6 +225,7 @@ static char rcsid[] =
>  #include <linux/skbuff.h>
>  #include <linux/if_arp.h>
>  #include <linux/netdevice.h>
> +#include <linux/etherdevice.h>
>  #include <linux/spinlock.h>
>  #include <linux/if.h>
>  #include <net/arp.h>
> @@ -3246,6 +3247,18 @@ static inline void show_version(void)
>   rcsvers, rcsdate, __DATE__, __TIME__);
>  } /* show_version */
>
> +static const struct net_device_ops cpc_netdev_ops = {
> + .ndo_init = NULL,
> + .ndo_open = cpc_open,
> + .ndo_stop = cpc_close,
> + .ndo_tx_timeout = cpc_tx_timeout,
> + .ndo_set_multicast_list = NULL,

In this case ndo_init and ndo_set_multicast_list
are not needed.

>From 1507a5a797a5f0005696a9bf10e390caca9c3800 Mon Sep 17 00:00:00 2001
From: Alexander Beregalov <a.beregalov@gmail.com>
Date: Fri, 17 Apr 2009 05:45:48 +0400
Subject: [PATCH] wan/pc300_drv: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoirda: include etherdevice.h for eth_*() functions
Alexander Beregalov [Thu, 16 Apr 2009 15:23:03 +0000 (15:23 +0000)]
irda: include etherdevice.h for eth_*() functions

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomyri10ge: fix tx ring size in ethtool -g
Brice Goglin [Fri, 17 Apr 2009 00:56:57 +0000 (17:56 -0700)]
myri10ge: fix tx ring size in ethtool -g

Fix tx ring size reported via ethtool -g.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomyri10ge: add MODULE_DEVICE_TABLE
Brice Goglin [Thu, 16 Apr 2009 02:29:22 +0000 (02:29 +0000)]
myri10ge: add MODULE_DEVICE_TABLE

Add MODULE_DEVICE_TABLE so that modinfo reports pci device id aliases.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomyri10ge: allow per-board firmware overriding
Brice Goglin [Thu, 16 Apr 2009 02:24:59 +0000 (02:24 +0000)]
myri10ge: allow per-board firmware overriding

Add myri10ge_fw_names to override the default firmware
on a per-board basis.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomyri10ge: force stats update in ethtool gstats
Brice Goglin [Thu, 16 Apr 2009 02:23:56 +0000 (02:23 +0000)]
myri10ge: force stats update in ethtool gstats

Force a statistics update when our ethtool gstats routine
is called.  Otherwise, ethtool will continue to read stale
stats until something forces an update by reading /proc/net/dev

This requires putting a lock around the stats update to guard
against 2 threads (one via ethtool, and one via procfs)
updating the stats at once.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Fri, 17 Apr 2009 00:35:26 +0000 (17:35 -0700)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

15 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6
David S. Miller [Thu, 16 Apr 2009 23:32:29 +0000 (16:32 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/kaber/nf-2.6

15 years agoixgbe: Be explict with what we are !'ing in ixgbe_sfp_config_module_task()
Tony Breeds [Thu, 16 Apr 2009 23:27:23 +0000 (16:27 -0700)]
ixgbe: Be explict with what we are !'ing in ixgbe_sfp_config_module_task()

GCC warns:
drivers/net/ixgbe/ixgbe_main.c: In function 'ixgbe_sfp_config_module_task':
drivers/net/ixgbe/ixgbe_main.c:3920: warning: suggest parantheses around
operand of '!' or change '&' to '&&' or '!' to '~'

Which I think is right.  Bracket to remove ambiguity.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetfilter: nf_nat: add support for persistent mappings
Patrick McHardy [Thu, 16 Apr 2009 16:33:01 +0000 (18:33 +0200)]
netfilter: nf_nat: add support for persistent mappings

The removal of the SAME target accidentally removed one feature that is
not available from the normal NAT targets so far, having multi-range
mappings that use the same mapping for each connection from a single
client. The current behaviour is to choose the address from the range
based on source and destination IP, which breaks when communicating
with sites having multiple addresses that require all connections to
originate from the same IP address.

Introduce a IP_NAT_RANGE_PERSISTENT option that controls whether the
destination address is taken into account for selecting addresses.

http://bugzilla.kernel.org/show_bug.cgi?id=12954

Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agophylib: Fix delay argument of schedule_delayed_work
Atsushi Nemoto [Thu, 16 Apr 2009 09:43:37 +0000 (02:43 -0700)]
phylib: Fix delay argument of schedule_delayed_work

The commit a390d1f3 ("phylib: convert state_queue work to
delayed_work") missed converting 'expires' value to 'delay' value.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Acked-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agofec: call fec_restart() in fec_open()
Sascha Hauer [Wed, 15 Apr 2009 01:32:25 +0000 (01:32 +0000)]
fec: call fec_restart() in fec_open()

We called fec_stop() in fec_enet_close(), thus we have to call
fec_restart() in fec_enet_open().

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoFEC Buffer rework
Sascha Hauer [Wed, 15 Apr 2009 01:32:24 +0000 (01:32 +0000)]
FEC Buffer rework

Allocate buffers in fec_open and free them again in fec_close. This makes
it possible to use this driver as a module.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agofec: switch to net_device_ops
Sascha Hauer [Wed, 15 Apr 2009 01:32:23 +0000 (01:32 +0000)]
fec: switch to net_device_ops

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agofec: remove debugging printks
Sascha Hauer [Wed, 15 Apr 2009 01:32:22 +0000 (01:32 +0000)]
fec: remove debugging printks

These printks in fec_timeout do not give useful information in
a production kernel.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agofec: align receive packets
Sascha Hauer [Wed, 15 Apr 2009 01:32:21 +0000 (01:32 +0000)]
fec: align receive packets

Otherwise we get a lot of alignment errors

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agofec: refactor init function
Sascha Hauer [Wed, 15 Apr 2009 01:32:20 +0000 (01:32 +0000)]
fec: refactor init function

fec_enet_init() does the hardware initialisation and then calls
fec_restart() which does the same initialisation again, so we
can safely remove the initialisation from fec_enet_init().

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agofec: refactor set_multicast_list() to make it more readable
Sascha Hauer [Wed, 15 Apr 2009 01:32:19 +0000 (01:32 +0000)]
fec: refactor set_multicast_list() to make it more readable

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agofec: Codingstyle cleanups
Sascha Hauer [Wed, 15 Apr 2009 01:32:18 +0000 (01:32 +0000)]
fec: Codingstyle cleanups

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agofec: remove unnecessary cast
Sascha Hauer [Wed, 15 Apr 2009 01:32:17 +0000 (01:32 +0000)]
fec: remove unnecessary cast

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agofec: do not typedef struct types
Sascha Hauer [Wed, 15 Apr 2009 01:32:16 +0000 (01:32 +0000)]
fec: do not typedef struct types

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agofec: switch to writel/readl
Sascha Hauer [Wed, 15 Apr 2009 03:11:30 +0000 (03:11 +0000)]
fec: switch to writel/readl

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosun3lance: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:53:00 +0000 (12:53 +0000)]
sun3lance: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosmc911x: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:59 +0000 (12:52 +0000)]
smc911x: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosgiseeq: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:58 +0000 (12:52 +0000)]
sgiseeq: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosb1250-mac: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:57 +0000 (12:52 +0000)]
sb1250-mac: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agorionet: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:56 +0000 (12:52 +0000)]
rionet: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agopci-skeleton: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:55 +0000 (12:52 +0000)]
pci-skeleton: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agopasemi_mac: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:54 +0000 (12:52 +0000)]
pasemi_mac: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetx-eth: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:53 +0000 (12:52 +0000)]
netx-eth: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomvme147: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:52 +0000 (12:52 +0000)]
mvme147: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomipsnet: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:51 +0000 (12:52 +0000)]
mipsnet: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agometh: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:50 +0000 (12:52 +0000)]
meth: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomacmace: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:49 +0000 (12:52 +0000)]
macmace: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomace: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:48 +0000 (12:52 +0000)]
mace: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agolib82596: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:47 +0000 (12:52 +0000)]
lib82596: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agokorina: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:46 +0000 (12:52 +0000)]
korina: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agojazzsonic: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:45 +0000 (12:52 +0000)]
jazzsonic: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixp2000/ixpdev: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:44 +0000 (12:52 +0000)]
ixp2000/ixpdev: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoiseries_veth: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:43 +0000 (12:52 +0000)]
iseries_veth: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoirda/sa1100_ir: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:42 +0000 (12:52 +0000)]
irda/sa1100_ir: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoirda/pxaficp_ir: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:41 +0000 (12:52 +0000)]
irda/pxaficp_ir: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoirda/au1k_ir: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:40 +0000 (12:52 +0000)]
irda/au1k_ir: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoibmveth: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:39 +0000 (12:52 +0000)]
ibmveth: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agohplance: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:38 +0000 (12:52 +0000)]
hplance: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodm9000: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:37 +0000 (12:52 +0000)]
dm9000: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocpmac: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:36 +0000 (12:52 +0000)]
cpmac: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobmac: convert to net_device_ops
Alexander Beregalov [Wed, 15 Apr 2009 12:52:35 +0000 (12:52 +0000)]
bmac: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years ago8390(p): remove old compat_net_dev_ops code
Alexander Beregalov [Wed, 15 Apr 2009 07:58:29 +0000 (07:58 +0000)]
8390(p): remove old compat_net_dev_ops code

Remove compat_net_dev_ops code and use struct net_device_ops
instead of it.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agousbnet: remove old compat_net_dev_ops code
Alexander Beregalov [Wed, 15 Apr 2009 07:58:28 +0000 (07:58 +0000)]
usbnet: remove old compat_net_dev_ops code

Since all usb network drivers are already converted to net_device_ops
this code is useless.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipw2x00: remove old compat_net_dev_ops code
Alexander Beregalov [Wed, 15 Apr 2009 07:58:27 +0000 (07:58 +0000)]
ipw2x00: remove old compat_net_dev_ops code

Since both ipw2100 and ipw2200 are already converted to new
net_device_ops this code is useless.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoNET/ixgbe: Fix powering off during shutdown
Rafael J. Wysocki [Wed, 15 Apr 2009 17:44:01 +0000 (17:44 +0000)]
NET/ixgbe: Fix powering off during shutdown

Prevent ixgbe from putting the adapter into D3 during shutdown except when
we're going to power off the system, since doing that may generally cause
problems with kexec to happen (such problems were observed for igb and
forcedeth).  For this purpose seperate ixgbe_shutdown() from ixgbe_suspend()
and use the appropriate PCI PM callbacks in both of them.

Signed-off-by: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoNET/e1000e: Fix powering off during shutdown
Rafael J. Wysocki [Wed, 15 Apr 2009 17:43:43 +0000 (17:43 +0000)]
NET/e1000e: Fix powering off during shutdown

Prevent e1000e from putting the adapter into D3 during shutdown except when
we're going to power off the system, since doing that may generally cause
problems with kexec to happen (such problems were observed for igb and
forcedeth).  For this purpose seperate e1000e_shutdown() from e1000e_suspend()
and use the appropriate PCI PM callbacks in both of them.

Signed-off-by: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoNET/e1000: Fix powering off during shutdown
Rafael J. Wysocki [Wed, 15 Apr 2009 17:43:24 +0000 (17:43 +0000)]
NET/e1000: Fix powering off during shutdown

Prevent e1000 from putting the adapter into D3 during shutdown except when
we're going to power off the system, since doing that may generally cause
problems with kexec to happen (such problems were observed for igb and
forcedeth).  For this purpose seperate e1000_shutdown() from e1000_suspend()
and use the appropriate PCI PM callbacks in both of them.

Signed-off-by: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogro: New frags interface to avoid copying shinfo
Herbert Xu [Thu, 16 Apr 2009 09:02:07 +0000 (02:02 -0700)]
gro: New frags interface to avoid copying shinfo

It turns out that copying a 16-byte area at ~800k times a second
can be really expensive :) This patch redesigns the frags GRO
interface to avoid copying that area twice.

The two disciples of the frags interface have been converted.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetfilter: nf_conntrack: fix crash when unloading helpers
Patrick McHardy [Wed, 15 Apr 2009 10:45:08 +0000 (12:45 +0200)]
netfilter: nf_conntrack: fix crash when unloading helpers

Commit ea781f197d (netfilter: nf_conntrack: use SLAB_DESTROY_BY_RCU and)
get rid of call_rcu() was missing one conversion to the hlist_nulls
functions, causing a crash when unloading conntrack helper modules.

Reported-and-tested-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agopacket: avoid warnings when high-order page allocation fails
Eric Dumazet [Wed, 15 Apr 2009 10:39:52 +0000 (03:39 -0700)]
packet: avoid warnings when high-order page allocation fails

Latest tcpdump/libpcap triggers annoying messages because of high order page
allocation failures (when lowmem exhausted or fragmented)

These allocation errors are correctly handled so could be silent.

[22660.208901] tcpdump: page allocation failure. order:5, mode:0xc0d0
[22660.208921] Pid: 13866, comm: tcpdump Not tainted 2.6.30-rc2 #170
[22660.208936] Call Trace:
[22660.208950]  [<c04e2b46>] ? printk+0x18/0x1a
[22660.208965]  [<c02760f7>] __alloc_pages_internal+0x357/0x460
[22660.208980]  [<c0276251>] __get_free_pages+0x21/0x40
[22660.208995]  [<c04cc835>] packet_set_ring+0x105/0x3d0
[22660.209009]  [<c04ccd1d>] packet_setsockopt+0x21d/0x4d0
[22660.209025]  [<c0270400>] ? filemap_fault+0x0/0x450
[22660.209040]  [<c0449e34>] sys_setsockopt+0x54/0xa0
[22660.209053]  [<c044b97f>] sys_socketcall+0xef/0x270
[22660.209067]  [<c0202e34>] sysenter_do_call+0x12/0x26

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetfilter: nf_log regression fix
Eric Dumazet [Wed, 15 Apr 2009 10:16:19 +0000 (12:16 +0200)]
netfilter: nf_log regression fix

commit ca735b3aaa945626ba65a3e51145bfe4ecd9e222
'netfilter: use a linked list of loggers'
introduced an array of list_head in "struct nf_logger", but
forgot to initialize it in nf_log_register(). This resulted
in oops when calling nf_log_unregister() at module unload time.

Reported-and-tested-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Acked-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agogianfar: stop send queue before resetting gianfar
Markus Brunner [Wed, 15 Apr 2009 09:35:40 +0000 (02:35 -0700)]
gianfar: stop send queue before resetting gianfar

After a transmit timed out, the reset task will be called, which will free the
allocated resources(stop_gfar). If gfar_poll will be called before the
resources get allocated again gfar_clean_tx_ring will call
dev_kfree_skb_any(NULL).

Example crash:

ops: Kernel access of bad area, sig: 11 [#1]
PREEMPT RSBBA100
Modules linked in:
NIP: c01a10c4 LR: c013b254 CTR: c013c038
REGS: c02e7d20 TRAP: 0300   Not tainted  (2.6.27.20)
MSR: 00001032 <ME,IR,DR>  CR: 24000082  XER: 20000000
DAR: 000000a0, DSISR: 20000000
TASK = c02ce578[0] 'swapper' THREAD: c02e6000
GPR00: 000000a0 c02e7dd0 c02ce578 00000000 00000040 00000001 c02ec1c0
00001032
GPR08: c080d1e0 df9ea800 00000000 00000000 24000082 ffffffff 0404f000
00000000
GPR16: ffffffbf ffffffff ffffffff ffdff7ff ffffffff c02d0fd4 00100100
00200200
GPR24: c031220c 00000001 00000001 00000000 00000000 df849800 ff109000
df849b80
NIP [c01a10c4] dev_kfree_skb_irq+0x18/0x70
LR [c013b254] gfar_clean_tx_ring+0x70/0x11c
Call Trace:
[c02e7dd0] [c003e978] update_wall_time+0x730/0x744 (unreliable)
[c02e7df0] [c013b254] gfar_clean_tx_ring+0x70/0x11c
[c02e7e10] [c013c07c] gfar_poll+0x44/0x150
[c02e7e30] [c01a064c] net_rx_action+0xa8/0x19c
[c02e7e70] [c00251d4] __do_softirq+0x64/0xc0
[c02e7e90] [c0006384] do_softirq+0x40/0x58
[c02e7ea0] [c00250a8] irq_exit+0x40/0x9c
[c02e7eb0] [c000642c] do_IRQ+0x90/0xac
[c02e7ec0] [c0010ab4] ret_from_except+0x0/0x14
--- Exception: 501 at cpu_idle+0x9c/0xf8
    LR = cpu_idle+0x9c/0xf8
[c02e7f80] [c0009820] cpu_idle+0x58/0xf8 (unreliable)
[c02e7fa0] [c01fb8c8] __got2_end+0x7c/0x90
[c02e7fc0] [c026c794] start_kernel+0x2c0/0x2d4
[c02e7ff0] [00003438] 0x3438
Instruction dump:
7fa00124 80010024 bba10014 38210020 7c0803a6 4e800020 9421ffe0 7c0802a6
7c6b1b78 90010024 380300a0 bfa10014 <7d2000283129ffff 7d20012d 40a2fff4
Kernel panic - not syncing: Fatal exception in interrupt

This Patch calls netif_stop_queue before calling stop_gfar.

Signed-off-by: Markus Brunner <super.firetwister@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomyr10ge: again fix lro_gen_skb() alignment
Stanislaw Gruszka [Wed, 15 Apr 2009 09:26:49 +0000 (02:26 -0700)]
myr10ge: again fix lro_gen_skb() alignment

Add LRO alignment initially committed in
621544eb8c3beaa859c75850f816dd9b056a00a3 ("[LRO]: fix lro_gen_skb()
alignment") and removed in 0dcffac1a329be69bab0ac604bf7283737108e68
("myri10ge: add multislices support") during conversion to
multi-slice.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodeclance: convert to net_device_ops
Alexander Beregalov [Tue, 14 Apr 2009 18:30:25 +0000 (18:30 +0000)]
declance: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobfin_mac: convert to net_device_ops
Alexander Beregalov [Tue, 14 Apr 2009 18:30:24 +0000 (18:30 +0000)]
bfin_mac: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoau1000: convert to net_device_ops
Alexander Beregalov [Tue, 14 Apr 2009 18:30:23 +0000 (18:30 +0000)]
au1000: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoatarilance: convert to net_device_ops
Alexander Beregalov [Tue, 14 Apr 2009 18:30:22 +0000 (18:30 +0000)]
atarilance: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoa2065: convert to net_device_ops
Alexander Beregalov [Tue, 14 Apr 2009 18:30:21 +0000 (18:30 +0000)]
a2065: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: update real_num_tx_queues on changing num_rx_queues
Wu Fengguang [Wed, 15 Apr 2009 04:54:07 +0000 (21:54 -0700)]
ixgbe: update real_num_tx_queues on changing num_rx_queues

Move the update of real_num_tx_queues from
ixgbe_acquire_msix_vectors() to ixgbe_set_num_queues(), to ensure it
be always in sync with num_tx_queues.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: fix tx queue index
Wu Fengguang [Wed, 15 Apr 2009 04:53:48 +0000 (21:53 -0700)]
ixgbe: fix tx queue index

Don't do the num_tx_queues based masking on calculating tx queue
index.

 1) num_tx_queues is not always power-of-2, because it also depends on
    the online cpu numbers. So the masking could be a performance bug
    on a 6 cpu system.
 2) queue_mapping will be limited by real_num_tx_queues=num_tx_queues
    in the generic netdev function set_cur_queue_map(). So the bound
    limiting here is not necessary.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoRevert "rose: zero length frame filtering in af_rose.c"
David S. Miller [Wed, 15 Apr 2009 03:28:00 +0000 (20:28 -0700)]
Revert "rose: zero length frame filtering in af_rose.c"

This reverts commit 244f46ae6e9e18f6fc0be7d1f49febde4762c34b.

Alan Cox did the research, and just like the other radio protocols
zero-length frames have meaning because at the top level ROSE is
X.25 PLP.

So this zero-length filtering is invalid.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Use correct macro to set event bitfield
Ben Hutchings [Wed, 15 Apr 2009 02:48:34 +0000 (19:48 -0700)]
sfc: Use correct macro to set event bitfield

falcon_sim_phy_event() used EFX_OWORD_FIELD, which operates on
bitfields in 128-bit values, on an event, which is a 64-bit value.
This should be harmless - these macros always use little-endian
ordering, so it would read and write back the following 8 bytes
unchanged - but it is obviously wrong.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Match calls to netif_napi_add() and netif_napi_del()
Ben Hutchings [Wed, 15 Apr 2009 02:47:46 +0000 (19:47 -0700)]
sfc: Match calls to netif_napi_add() and netif_napi_del()

sfc could call netif_napi_add() multiple times for the same
napi_struct, corrupting the list of napi_structs for the associated
device and leading to a busy-loop on device removal.  Move the call to
netif_napi_add() and add a call to netif_napi_del() in the obvious
places.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: Remove debug printk
Jay Vosburgh [Tue, 14 Apr 2009 23:53:14 +0000 (16:53 -0700)]
bonding: Remove debug printk

Remove debug printk I accidently left in as part of commit:

commit 6146b1a4da98377e4abddc91ba5856bef8f23f1e
Author: Jay Vosburgh <fubar@us.ibm.com>
Date:   Tue Nov 4 17:51:15 2008 -0800

    bonding: Fix ALB mode to balance traffic on VLANs

Reported by Duncan Gibb <duncan.gibb@siriusit.co.uk>

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoe1000/e1000: fix compile warning
Jesse Brandeburg [Tue, 14 Apr 2009 23:38:49 +0000 (16:38 -0700)]
e1000/e1000: fix compile warning

e1000/e1000e compile report a possible unused variable, fix
that for now.  Shortly after this a small refactor and bug
fix will follow in the same code.

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>
15 years agoehea: Fix incomplete conversion to net_device_ops
Alexander Beregalov [Tue, 14 Apr 2009 22:18:00 +0000 (15:18 -0700)]
ehea: Fix incomplete conversion to net_device_ops

Reported-by: Subrata Modak <subrata@linux.vnet.ibm.com>
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoskge: fix occasional BUG during MTU change
Michal Schmidt [Tue, 14 Apr 2009 22:16:55 +0000 (15:16 -0700)]
skge: fix occasional BUG during MTU change

The BUG_ON(skge->tx_ring.to_use != skge->tx_ring.to_clean) in skge_up()
was sometimes observed when setting MTU.

skge_down() disables the TX queue, but then reenables it by mistake via
skge_tx_clean().
Fix it by moving the waking of the queue from skge_tx_clean() to the
other caller. And to make sure start_xmit is not in progress on another
CPU, skge_down() should call netif_tx_disable().

The bug was reported to me by Jiri Jilek whose Debian system sometimes
failed to boot. He tested the patch and the bug did not happen anymore.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogro: Restore correct value to gso_size
Herbert Xu [Tue, 14 Apr 2009 22:11:06 +0000 (15:11 -0700)]
gro: Restore correct value to gso_size

Since everybody has been focusing on baremetal GRO performance
no one noticed when I added a bug that zapped gso_size for all
GRO packets.  This only gets picked up when you forward the skb
out of an interface.

Thanks to Mark Wagner for noticing this bug when testing kvm.

Reported-by: Mark Wagner <mwagner@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipv6:remove useless check
Yang Hongyang [Mon, 13 Apr 2009 15:51:00 +0000 (15:51 +0000)]
ipv6:remove useless check

After switch (rthdr->type) {...},the check below is completely useless.Because:
if the type is 2,then hdrlen must be 2 and segments_left must be 1,clearly the
check is redundant;if the type is not 2,then goto sticky_done,the check is useless
too.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
Reviewed-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotun: Fix crash with non-GSO users
Herbert Xu [Tue, 14 Apr 2009 09:09:43 +0000 (02:09 -0700)]
tun: Fix crash with non-GSO users

When I made the tun driver use non-linear packets as the preferred
option, it broke non-GSO users because they would end up allocating
a completely non-linear packet, which triggers a crash when we call
eth_type_trans.

This patch reverts non-GSO users to using linear packets and adds
a check to ensure that GSO users can't cause crashes in the same
way.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotcp: fix >2 iw selection
Ilpo Järvinen [Tue, 14 Apr 2009 09:08:53 +0000 (02:08 -0700)]
tcp: fix >2 iw selection

A long-standing feature in tcp_init_metrics() is such that
any of its goto reset prevents call to tcp_init_cwnd().

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetsched: Allow meta match on vlan tag on receive
Stephen Hemminger [Tue, 14 Apr 2009 01:12:57 +0000 (18:12 -0700)]
netsched: Allow meta match on vlan tag on receive

When vlan acceleration is used on receive, the vlan tag is maintained
outside of the skb data. The existing vlan tag match only works on TX
path because it uses vlan_get_tag which tests for VLAN_HW_TX_ACCEL.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoNET/r8169: Rework suspend and resume
Rafael J. Wysocki [Sun, 5 Apr 2009 08:40:04 +0000 (08:40 +0000)]
NET/r8169: Rework suspend and resume

The recent changes of the PCI PM core allow us to simplify the
suspend and resume handling in a number of device drivers, since they
don't need to carry out the general PCI PM operations, such as
changing the power state of the device, during suspend and resume any
more.

Simplify the suspend and resume callbacks of r8169 using the
observation that the PCI PM core can take care of some operations
carried out by the driver.

Additionally, make the shutdown callback of r8169 only put the device
into a low power state if the system is going to be powered off
(kexec is known to have problems with network adapters that are put
into low power states on shutdown).

This patch has been tested on MSI Wind U100.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Tested-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogro: Normalise skb before bypassing GRO on netpoll VLAN path
Herbert Xu [Mon, 13 Apr 2009 04:41:01 +0000 (04:41 +0000)]
gro: Normalise skb before bypassing GRO on netpoll VLAN path

Hi:

gro: Normalise skb before bypassing GRO on netpoll VLAN path

When we detect netpoll RX on the GRO VLAN path we bail out and
call the normal VLAN receive handler.  However, the packet needs
to be normalised by calling eth_type_trans since that's what the
normal path expects (normally the GRO path does the fixup).

This patch adds the necessary call to vlan_gro_frags.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Thanks,
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodrivers/net: replace BUG() with BUG_ON() if possible
Alexander Beregalov [Sat, 11 Apr 2009 14:50:23 +0000 (14:50 +0000)]
drivers/net: replace BUG() with BUG_ON() if possible

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agokaweth: Clean up code
Larry Finger [Thu, 9 Apr 2009 07:11:55 +0000 (07:11 +0000)]
kaweth: Clean up code

The driver kaweth yields a -EBUSY error when starting, and a -ETIME
error when shutting down. These errors are avoided, and the RX status
is further checked for other potential errors.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoat76c50x-usb: remove pointless conditional before kfree_skb()
Wei Yongjun [Wed, 8 Apr 2009 22:16:38 +0000 (22:16 +0000)]
at76c50x-usb: remove pointless conditional before kfree_skb()

Remove pointless conditional before kfree_skb().

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobe2net: fix for default setting of pause auto-negotiation
Ajit Khaparde [Mon, 13 Apr 2009 22:41:50 +0000 (15:41 -0700)]
be2net: fix for default setting of pause auto-negotiation

This patch fixes the default value of pause auto-negotiation supported
by PCS.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobe2net: changes for checksum and segmentation offload
Ajit Khaparde [Mon, 13 Apr 2009 22:41:22 +0000 (15:41 -0700)]
be2net: changes for checksum and segmentation offload

- Enables Rx checksum feature by default.
- Disables support for ipv6 tso.
- Changes in Rx path to handle Rx completions with various checksum options.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoeth_v10: convert to net_device_ops
Alexander Beregalov [Sat, 11 Apr 2009 07:45:55 +0000 (07:45 +0000)]
eth_v10: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoioc3-eth: convert to net_device_ops
Alexander Beregalov [Sat, 11 Apr 2009 07:44:55 +0000 (07:44 +0000)]
ioc3-eth: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoisa-skeleton: convert to net_device_ops
Alexander Beregalov [Sat, 11 Apr 2009 07:44:06 +0000 (07:44 +0000)]
isa-skeleton: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomac89x0: convert to net_device_ops
Alexander Beregalov [Sat, 11 Apr 2009 07:43:11 +0000 (07:43 +0000)]
mac89x0: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomacb: convert to net_device_ops
Alexander Beregalov [Sat, 11 Apr 2009 07:42:26 +0000 (07:42 +0000)]
macb: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomacsonic: convert to net_device_ops
Alexander Beregalov [Sat, 11 Apr 2009 07:41:28 +0000 (07:41 +0000)]
macsonic: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosh_eth: convert to net_device_ops
Alexander Beregalov [Sat, 11 Apr 2009 07:40:49 +0000 (07:40 +0000)]
sh_eth: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosun3_82586: convert to net_device_ops
Alexander Beregalov [Sat, 11 Apr 2009 07:39:58 +0000 (07:39 +0000)]
sun3_82586: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotc35815: convert to net_device_ops
Alexander Beregalov [Sat, 11 Apr 2009 07:38:54 +0000 (07:38 +0000)]
tc35815: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotsi108_eth: convert to net_device_ops
Alexander Beregalov [Sat, 11 Apr 2009 07:37:59 +0000 (07:37 +0000)]
tsi108_eth: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoxtsonic: convert to net_device_ops
Alexander Beregalov [Sat, 11 Apr 2009 07:30:19 +0000 (07:30 +0000)]
xtsonic: convert to net_device_ops

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agophylib: Add interrupt source check function to M88E1121R driver
Anatolij Gustschin [Tue, 7 Apr 2009 02:01:43 +0000 (02:01 +0000)]
phylib: Add interrupt source check function to M88E1121R driver

Add did_interrupt() function to check if a PHY port
really caused an interrupt. This is needed in the case
of shared PHY interrupt pin configuration to stop
interrupt event processing for PHY ports which didn't
cause an interrupt.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agophylib: Allow early-out in phy_change
Anatolij Gustschin [Tue, 7 Apr 2009 02:01:42 +0000 (02:01 +0000)]
phylib: Allow early-out in phy_change

Marvell 88E1121R Dual PHY device can be hardware-configured
to use shared interrupt pin for both PHY ports. For such
PHY configurations using shared PHY interrupt phy_interrupt()
handler will also schedule a work for PHY port which didn't
cause an interrupt.

This patch adds a possibility for PHY drivers to provide
did_interrupt() function which reports if the PHY (or a PHY
port in a multi-PHY device) generated an interrupt. This
function is called in phy_change() as phy_change() shouldn't
proceed if it is invoked for a PHY which didn't cause an
interrupt. So check for interrupt originator in phy_change()
to allow early-out.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>