firefly-linux-kernel-4.4.55.git
16 years ago[netdrvr] sfc: Remove garbage from comment
Ben Hutchings [Wed, 7 May 2008 11:57:44 +0000 (12:57 +0100)]
[netdrvr] sfc: Remove garbage from comment

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[netdrvr] sfc: Removed bogus 'fall-thru' comments
Ben Hutchings [Wed, 7 May 2008 11:56:57 +0000 (12:56 +0100)]
[netdrvr] sfc: Removed bogus 'fall-thru' comments

Fall-through is expected outside a switch statement.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[netdrvr] sfc: Add phy_flash_cfg module parameter and implementation
Ben Hutchings [Wed, 7 May 2008 11:55:13 +0000 (12:55 +0100)]
[netdrvr] sfc: Add phy_flash_cfg module parameter and implementation

The 10Xpress PHY supports flash upgrades through MDIO, but needs to be
put in upgrade mode at power-up.  This adds a module parameter and other
logic to support that.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[netdrvr] sfc: Add TSO support
Ben Hutchings [Wed, 7 May 2008 11:51:12 +0000 (12:51 +0100)]
[netdrvr] sfc: Add TSO support

The SFC4000 controller does not have hardware support for TSO, and the
core GSO code incurs a high cost in allocating and freeing skbs.  This
TSO implementation uses lightweight packet header structures and is
substantially faster.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoehea: Add DLPAR memory remove support
Hannes Hering [Wed, 7 May 2008 12:43:36 +0000 (14:43 +0200)]
ehea: Add DLPAR memory remove support

The eHEA driver uses the recently modified walk_memory_resource for powerpc
functionality to detect the memory layout. It further uses the memory hotplug
notifiers to catch memory hotplug events.

Signed-off-by: Hannes Hering <hering2@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoehea: Add dependency to Kconfig
Hannes Hering [Wed, 7 May 2008 12:43:20 +0000 (14:43 +0200)]
ehea: Add dependency to Kconfig

The new ehea memory hot plug implementation depends on MEMORY_HOTPLUG.

Signed-off-by: Hannes Hering <hering2@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agomemory: Introduce exports for memory notifiers
Hannes Hering [Wed, 7 May 2008 12:43:01 +0000 (14:43 +0200)]
memory: Introduce exports for memory notifiers

This patch introduces two exports to allow modules to use memory notifiers.

Signed-off-by: Hannes Hering <hering2@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agogianfar: Fix a bug where the pointer never moves for dma_unmap...
Andy Fleming [Wed, 7 May 2008 18:20:55 +0000 (13:20 -0500)]
gianfar: Fix a bug where the pointer never moves for dma_unmap...

The loop that unmaps all of the TX Buffer Descriptors never actually
moves the txbd pointer, so we were just repeatedly unmapping the first one.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agocxgb3 - fix EEH
Divy Le Ray [Wed, 7 May 2008 02:26:01 +0000 (19:26 -0700)]
cxgb3 - fix EEH

Reset the chip when the PCI link goes down.
Preserve the napi structure when a sge qset's resources are freed.
Replay only HW initialization when the chip comes out of reset.

Signed-off-by: Divy Le ray <divy@chelsio.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agocxgb3 - fix port up/down error path
Divy Le Ray [Wed, 7 May 2008 02:25:56 +0000 (19:25 -0700)]
cxgb3 - fix port up/down error path

Fix faiures path when ports are stopped and restarted
in EEH recovery.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agomyri10ge: fix the number of interrupt slots
Brice Goglin [Fri, 9 May 2008 00:20:47 +0000 (02:20 +0200)]
myri10ge: fix the number of interrupt slots

Fix a long-standing bug/misunderstanding between the
driver and the firmware.  The size of the interrupt
queue must be set to the number of rx slots (big + small),
and it should never have been a tunable.
Setting it too small results in chaos.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Andrew Gallatin <gallatin@myri.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agomyri10ge: cleanup retrieving of firmware capabilities
Brice Goglin [Fri, 9 May 2008 00:20:25 +0000 (02:20 +0200)]
myri10ge: cleanup retrieving of firmware capabilities

Add myri10ge_get_firmware_capabilities() to retrieve TSO6 and
interrupt slots capabilities from the firmware.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Andrew Gallatin <gallatin@myri.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agomyri10ge: move data structures into a single slice
Brice Goglin [Fri, 9 May 2008 00:20:03 +0000 (02:20 +0200)]
myri10ge: move data structures into a single slice

To prepare and simplify multislice rx support, add a single slice
structure and move some fields in there.
No functional change yet.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Andrew Gallatin <gallatin@myri.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agomyri10ge: fix potential infinite loop in enable_ecrc
Brice Goglin [Fri, 9 May 2008 00:19:29 +0000 (02:19 +0200)]
myri10ge: fix potential infinite loop in enable_ecrc

Fix another potential for an infinite loop while looking for the
root port in myri10ge_enable_ecrc().

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Andrew Gallatin <gallatin@myri.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agomyri10ge: trivial formatting fix
Brice Goglin [Fri, 9 May 2008 00:19:08 +0000 (02:19 +0200)]
myri10ge: trivial formatting fix

Add some blank lines to uniformize the code and match
the upstream code.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Andrew Gallatin <gallatin@myri.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agomyri10ge: add barrier in myri10ge_send_cmd
Brice Goglin [Fri, 9 May 2008 00:18:45 +0000 (02:18 +0200)]
myri10ge: add barrier in myri10ge_send_cmd

Add a barrier() in the usleep() loop in  myri10ge_send_cmd().
Without the barrier, some mips machine never notices that the
firmware has DMA'ed the response.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Andrew Gallatin <gallatin@myri.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agomyri10ge: report FIBER in ethtool for XFP based NIC
Brice Goglin [Fri, 9 May 2008 00:18:24 +0000 (02:18 +0200)]
myri10ge: report FIBER in ethtool for XFP based NIC

Make ethtool report FIBER for XFP based NIC's port type.
Don't bother to poke around and try to find out what is in
the XFP cage, since Linux does not have separate media types
for -SR -LR, etc.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Andrew Gallatin <gallatin@myri.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agomyri10ge: properly align scratch buffers
Brice Goglin [Fri, 9 May 2008 00:17:37 +0000 (02:17 +0200)]
myri10ge: properly align scratch buffers

Properly align scratch buffers when making boot commands.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Andrew Gallatin <gallatin@myri.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agomyri10ge: increase and fix handoff timeout
Brice Goglin [Fri, 9 May 2008 00:17:16 +0000 (02:17 +0200)]
myri10ge: increase and fix handoff timeout

Increase the handoff timeout to 512ms so as to give the aeluros based
NICs sufficient time to handoff without relying on the msleep() being
sloppy, and accidentally sleeping way longer than the 20ms we specified
in 20 separate 1ms sleeps.

Fix typo in the handoff sleep delay, which made it additive, not
exponential.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Andrew Gallatin <gallatin@myri.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agomyri10ge: fix module parameter descriptions
Brice Goglin [Fri, 9 May 2008 00:16:53 +0000 (02:16 +0200)]
myri10ge: fix module parameter descriptions

Remove useless linebreaks at the end of MODULE_PARM_DESC
and fix the description of myri10ge_lro_max_pkts.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Andrew Gallatin <gallatin@myri.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agomyri10ge: update firmware headers
Brice Goglin [Fri, 9 May 2008 00:16:19 +0000 (02:16 +0200)]
myri10ge: update firmware headers

Update myri10ge firmware headers.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Andrew Gallatin <gallatin@myri.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoatl1: bump version number
Jay Cliburn [Sat, 10 May 2008 03:12:09 +0000 (22:12 -0500)]
atl1: bump version number

atl1-2.1.3.

Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoatl1: add shutdown callback
Jay Cliburn [Sat, 10 May 2008 03:12:08 +0000 (22:12 -0500)]
atl1: add shutdown callback

Add a shutdown callback that points to atl1_suspend().  This, along
with a working suspend function, fixes wake-on-lan.

Tested-by: Per Olofsson <pelle@dsv.su.se>
Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoatl1: fix broken suspend and resume
Jay Cliburn [Sat, 10 May 2008 03:12:07 +0000 (22:12 -0500)]
atl1: fix broken suspend and resume

Fix atl1_suspend() and atl1_resume() so they actually work.  We'll use
the suspend function for wake-on-lan in addition to just suspending.

Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoatl1: add PHY power save mode
Jay Cliburn [Sat, 10 May 2008 03:12:06 +0000 (22:12 -0500)]
atl1: add PHY power save mode

Using vendor-provided magic, add code to enter power save mode
on the PHY.  We'll need this for suspend and wake-on-lan.

Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Tue, 13 May 2008 02:36:33 +0000 (19:36 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

16 years agomac80211: add missing newlines in printk()
Pavel Roskin [Mon, 12 May 2008 13:02:24 +0000 (09:02 -0400)]
mac80211: add missing newlines in printk()

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoPS3: gelic: fix memory leak
Masakazu Mokuno [Mon, 12 May 2008 04:50:28 +0000 (13:50 +0900)]
PS3: gelic: fix memory leak

This fixes the bug that the I/O buffer is not freed at the driver removal.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211: fix association with some APs
Helmut Schaa [Thu, 8 May 2008 11:34:07 +0000 (13:34 +0200)]
mac80211: fix association with some APs

Some APs refuse association if the supported rates contained in the
association request do not match its own supported rates. This patch
introduces a new function which builds the intersection between the AP's
supported rates and the client's supported rates to work around such
problems. The same approach is already used in ipw2200 for example.

Signed-off-by: Helmut Schaa <hschaa@suse.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: Fix frequency in rx_status fill
Emmanuel Grumbach [Thu, 8 May 2008 03:34:05 +0000 (11:34 +0800)]
iwlwifi: Fix frequency in rx_status fill

This patch fixes a bug in RX path, the frequency was wrongly set in the
ieee80211_rx_status. This bug led to an empty scan list in A band.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agozd1211rw: fix potential use-after-free bug
Johannes Berg [Wed, 7 May 2008 23:43:59 +0000 (01:43 +0200)]
zd1211rw: fix potential use-after-free bug

zd_mac_tx_to_dev() could potentially free the skb, or hand it off
to mac80211 which might free it. Hence, this code needs to get the
usb pointer out of skb->cb before handing it off to that function.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoFix potential scheduling while atomic in mesh_path_add.
Pavel Emelyanov [Tue, 6 May 2008 14:51:31 +0000 (18:51 +0400)]
Fix potential scheduling while atomic in mesh_path_add.

Calling synchronize_rcu() under write-lock-ed pathtbl_resize_lock may
result in this warning (and other side effects).

It looks safe just dropping this lock before calling synchronize_rcu.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoFix not checked kmalloc() result.
Pavel Emelyanov [Tue, 6 May 2008 14:49:02 +0000 (18:49 +0400)]
Fix not checked kmalloc() result.

The new_node kmallocation is not checked for success, so add
this check.

BTW, it also happens under the read_lock.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoFix GFP_KERNEL allocation under read lock.
Pavel Emelyanov [Tue, 6 May 2008 14:46:36 +0000 (18:46 +0400)]
Fix GFP_KERNEL allocation under read lock.

The mesh_path_add() read-locks the pathtbl_resize_lock and calls
kmalloc with GFP_KERNEL mask.

Fix it and move the endadd2 label lower. It should be _before_ the
if() beyond, but it makes no sense for it being there, so I move it
right after this if().

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211: mesh hwmp: fix kfree(skb)
Patrick McHardy [Tue, 6 May 2008 10:52:07 +0000 (12:52 +0200)]
mac80211: mesh hwmp: fix kfree(skb)

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211: fix access to null skb
Luis Carlos Cobo [Mon, 5 May 2008 19:29:42 +0000 (12:29 -0700)]
mac80211: fix access to null skb

Without this patch, if xmit_skb is null but net_ratelimit() returns 0 we would
go to the else branch and access the null xmit_skb. Pointed out by Johannes
Berg.

Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211: fix incorrect mesh header length
Luis Carlos Cobo [Mon, 5 May 2008 19:02:35 +0000 (12:02 -0700)]
mac80211: fix incorrect mesh header length

This should have been updated at the same time we were transitioning from 3 byte
to 4 byte mesh sequence number. Pointed out by Johannes Berg.

Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211: Don't encrypt beacons
Ivo van Doorn [Mon, 5 May 2008 18:40:35 +0000 (20:40 +0200)]
mac80211: Don't encrypt beacons

mac80211 should set the IEEE80211_TX_CTL_DO_NOT_ENCRYPT flag in tx_control
structure to inform drivers not to encrypt the beacon. Drivers that only check
for that flag before accessing the hw_key field, will otherwise cause a NULL
pointer dereference since that field is not configured for beacons.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agort2x00: Clean up error handling of PCI queue DMA allocation.
Ivo van Doorn [Mon, 5 May 2008 15:24:03 +0000 (17:24 +0200)]
rt2x00: Clean up error handling of PCI queue DMA allocation.

When, for some reason, the rt2x00pci module fails to allocate DMA memory for
the queues, it tries to undo the complete initialization of the PCI device,
including freeing of the irq. This results in the following error in dmesg, as
the irq hadn't been requested yet:

[  78.123456] Trying to free already-free IRQ 17

Fix this by implementing proper error handling code, instead of just using the
full uninitialization function.

Signed-off-by: Gertjan van Wingerde <gwingerde@kpnplanet.nl>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agort2x00: Fix broken recover-on-error path
Ivo van Doorn [Mon, 5 May 2008 15:23:47 +0000 (17:23 +0200)]
rt2x00: Fix broken recover-on-error path

During initialization the initialize() callback function
in rt2x00pci and rt2x00usb will cleanup the mess they made.

rt2x00lib shouldn't call uninitialize because the callback function already
cleaned up _and_ the DEVICE_INITIALIZED isn't set which causes the
rt2x00lib_uninitialize() to halt directly anyway. All that is required
to be cleaned up by rt2x00lib is the queue, and that can be done by
calling rt2x00queue_uninitialize() directly.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agort2x00: Don't use pskb_expand_head()
Ivo van Doorn [Mon, 5 May 2008 15:23:31 +0000 (17:23 +0200)]
rt2x00: Don't use pskb_expand_head()

rt2x00pci allocates DMA for descriptor and data,
rt61pci doesn't use this for the beacon, but it can
use the descriptor part as temporary buffer instead
of using pskb_expand_head().
Using this temporary buffer is obviously much better
then reallocating the skb buffer...

At the same time we can set the data length for the
beacon queue at 0, to make sure no DMA is allocated for
data (but just for the descriptor).

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: fix compile error when CONFIG_MAC80211_DEBUGFS is not selected
Zhu Yi [Mon, 5 May 2008 02:22:46 +0000 (10:22 +0800)]
iwlwifi: fix compile error when CONFIG_MAC80211_DEBUGFS is not selected

Make iwl4965_lq_sta->drv available even without CONFIG_MAC80211_DEBUGFS.

Signed-off-by: Yi Zhu <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211: fix debugfs default key oops
Johannes Berg [Fri, 2 May 2008 23:04:47 +0000 (01:04 +0200)]
mac80211: fix debugfs default key oops

Under certain circumstances (in AP mode) the debugfs function
that is supposed to add the default key symlink can encounter
a NULL default_key pointer. This patch makes it handle that
situtation gracefully.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agowavelan: avoid index past end of array if DEBUG_SHOW_UNUSED is defined
John W. Linville [Fri, 2 May 2008 13:56:34 +0000 (09:56 -0400)]
wavelan: avoid index past end of array if DEBUG_SHOW_UNUSED is defined

Reported by Daniel Marjamäki <danielm77@spray.se> here:

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

Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agofix irq flags in mac80211 code
Steven Rostedt [Thu, 1 May 2008 22:58:17 +0000 (15:58 -0700)]
fix irq flags in mac80211 code

A file in the net/mac80211 directory uses "int" for flags.  This can cause
hard to find bugs on some architectures.  This patch converts the flags to use
"long" instead.

This bug was discovered by doing an allyesconfig make on the -rt kernel where
checks are done to ensure all flags are of size sizeof(long).

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoprism54: fix regression with missing carrier in AP-mode
Luis R. Rodriguez [Tue, 22 Apr 2008 18:03:32 +0000 (14:03 -0400)]
prism54: fix regression with missing carrier in AP-mode

This fixes a regression introduced by commit 7b463ced6 (prism54: set
carrier flags correctly) which causes the device to come up without
a carrier in AP-mode.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agopppol2tp: Remove null pointer dereference.
Julia Lawall [Mon, 12 May 2008 22:43:46 +0000 (15:43 -0700)]
pppol2tp: Remove null pointer dereference.

If session is NULL, it is not possible to access its name field.  So I
have split apart the printing of the error message to drop the
printing of the name field in this case.

The macro PRINTK actually only evaluates its arguments starting with
the third one if the bitwise conjunction of the first two is non-zero.
Normally, this conjunction would only be non-zero if debugging mode
were turned on, but when session is NULL, the first argument in both
the old and new code is -1, and thus the bitwise conjunction is true.
Perhaps a different strategy is desired, such as using tunnel->debug,
which session->debug is initialized to, but tunnel can also be NULL,
so this does not completely solve the problem.

This problem was found using the following semantic match
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression E, E1;
identifier f;
statement S1,S2,S3;
@@

* if (E == NULL)
{
  ... when != if (E == NULL) S1 else S2
      when != E = E1
* E->f
  ... when any
  return ...;
}
else S3
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agosyncppp: Fix crashes.
David S. Miller [Mon, 12 May 2008 10:29:11 +0000 (03:29 -0700)]
syncppp: Fix crashes.

The syncppp layer wants a mid-level netdev private pointer.

It was using netdev->priv but that only worked by accident,
and thus this scheme was broken when the device private
allocation strategy changed.

Add a proper mid-layer private pointer for uses like this,
update syncppp and all users, and remove the HDLC_PPP broken
tag from drivers/net/wan/Kconfig

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agosctp: Add address type check while process paramaters of ASCONF chunk
Wei Yongjun [Fri, 9 May 2008 22:11:53 +0000 (15:11 -0700)]
sctp: Add address type check while process paramaters of ASCONF chunk

If socket is create by AF_INET type, add IPv6 address to asoc will cause
kernel panic while packet is transmitted on that transport.

This patch add address type check before process paramaters of ASCONF
chunk. If peer is not support this address type, return with error
invald parameter.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agosctp: Do not enable peer IPv6 address support on PF_INET socket
Wei Yongjun [Fri, 9 May 2008 22:11:17 +0000 (15:11 -0700)]
sctp: Do not enable peer IPv6 address support on PF_INET socket

If socket is create by PF_INET type, it can not used IPv6 address to
send/recv DATA, So we can not used IPv6 address even if peer tell us it
support IPv6 address.
This patch fix to only enabled peer IPv6 address support on PF_INET6 socket.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoniu: Determine the # of ports from the card's VPD data
Matheos Worku [Mon, 12 May 2008 10:10:59 +0000 (03:10 -0700)]
niu: Determine the # of ports from the card's VPD data

Determine the number of physical ports from the card's VPD data.
Previous fix failed on Maramba platform which doesn't have the
"board-model" property. This fix uses the "model" property which
exists on all cards and Neptune based motherboards.

cstyle cleanup included.

Signed-off-by: Matheos Worku <matheos.worku@sun.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agosit: Add missing kfree_skb() on pskb_may_pull() failure.
David S. Miller [Fri, 9 May 2008 06:40:26 +0000 (23:40 -0700)]
sit: Add missing kfree_skb() on pskb_may_pull() failure.

Noticed by Paul Marks <paul@pmarks.net>.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotipc: Increase buffer header to support worst-case device
Allan Stephens [Fri, 9 May 2008 04:38:24 +0000 (21:38 -0700)]
tipc: Increase buffer header to support worst-case device

This patch increases the headroom TIPC reserves in each sk_buff
to accommodate the largest possible link level device header.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet: Added ASSERT_RTNL() to dev_open() and dev_close().
Ben Hutchings [Thu, 8 May 2008 09:53:17 +0000 (02:53 -0700)]
net: Added ASSERT_RTNL() to dev_open() and dev_close().

dev_open() and dev_close() must be called holding the RTNL, since they
call device functions and netdevice notifiers that are promised the RTNL.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agocan: Fix can_send() handling on dev_queue_xmit() failures
Oliver Hartkopp [Thu, 8 May 2008 09:49:55 +0000 (02:49 -0700)]
can: Fix can_send() handling on dev_queue_xmit() failures

The tx packet counting and the local loopback of CAN frames should
only happen in the case that the CAN frame has been enqueued to the
netdevice tx queue successfully.

Thanks to Andre Naujoks <nautsch@gmail.com> for reporting this issue.

Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: Urs Thuermann <urs@isnogud.escape.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoMerge branch 'upstream-davem' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
David S. Miller [Thu, 8 May 2008 09:35:54 +0000 (02:35 -0700)]
Merge branch 'upstream-davem' of /linux/kernel/git/jgarzik/netdev-2.6

16 years agonetns: Fix arbitrary net_device-s corruptions on net_ns stop.
Pavel Emelyanov [Thu, 8 May 2008 08:24:25 +0000 (01:24 -0700)]
netns: Fix arbitrary net_device-s corruptions on net_ns stop.

When a net namespace is destroyed, some devices (those, not killed
on ns stop explicitly) are moved back to init_net.

The problem, is that this net_ns change has one point of failure -
the __dev_alloc_name() may be called if a name collision occurs (and
this is easy to trigger). This allocator performs a likely-to-fail
GFP_ATOMIC allocation to find a suitable number. Other possible
conditions that may cause error (for device being ns local or not
registered) are always false in this case.

So, when this call fails, the device is unregistered. But this is
*not* the right thing to do, since after this the device may be
released (and kfree-ed) improperly. E. g. bridges require more
actions (sysfs update, timer disarming, etc.), some other devices
want to remove their private areas from lists, etc.

I. e. arbitrary use-after-free cases may occur.

The proposed fix is the following: since the only reason for the
dev_change_net_namespace to fail is the name generation, we may
give it a unique fall-back name w/o %d-s in it - the dev<ifindex>
one, since ifindexes are still unique.

So make this change, raise the failure-case printk loglevel to
EMERG and replace the unregister_netdevice call with BUG().

[ Use snprintf() -DaveM ]

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetfilter: Kconfig: default DCCP/SCTP conntrack support to the protocol config values
Patrick McHardy [Thu, 8 May 2008 08:16:04 +0000 (01:16 -0700)]
netfilter: Kconfig: default DCCP/SCTP conntrack support to the protocol config values

When conntrack and DCCP/SCTP protocols are enabled, chances are good
that people also want DCCP/SCTP conntrack and NAT support.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetfilter: nf_conntrack_sip: restrict RTP expect flushing on error to last request
Patrick McHardy [Thu, 8 May 2008 08:15:21 +0000 (01:15 -0700)]
netfilter: nf_conntrack_sip: restrict RTP expect flushing on error to last request

Some Inovaphone PBXs exhibit very stange behaviour: when dialing for
example "123", the device sends INVITE requests for "1", "12" and
"123" back to back.  The first requests will elicit error responses
from the receiver, causing the SIP helper to flush the RTP
expectations even though we might still see a positive response.

Note the sequence number of the last INVITE request that contained a
media description and only flush the expectations when receiving a
negative response for that sequence number.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agomacvlan: Fix memleak on device removal/crash on module removal
Patrick McHardy [Thu, 8 May 2008 08:13:31 +0000 (01:13 -0700)]
macvlan: Fix memleak on device removal/crash on module removal

As noticed by Ben Greear, macvlan crashes the kernel when unloading the
module. The reason is that it tries to clean up the macvlan_port pointer
on the macvlan device itself instead of the underlying device. A non-NULL
pointer is taken as indication that the macvlan_handle_frame_hook is
valid, when receiving the next packet on the underlying device it tries
to call the NULL hook and crashes.

Clean up the macvlan_port on the correct device to fix this.

Signed-off-by; Patrick McHardy <kaber@trash.net>
Tested-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet/ipv4: correct RFC 1122 section reference in comment
J.H.M. Dassen (Ray) [Thu, 8 May 2008 08:11:04 +0000 (01:11 -0700)]
net/ipv4: correct RFC 1122 section reference in comment

RFC 1122 does not have a section 3.1.2.2. The requirement to silently
discard datagrams with a bad checksum is in section 3.2.1.2 instead.

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

Signed-off-by: J.H.M. Dassen (Ray) <jdassen@debian.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotcp FRTO: SACK variant is errorneously used with NewReno
Ilpo Järvinen [Thu, 8 May 2008 08:09:11 +0000 (01:09 -0700)]
tcp FRTO: SACK variant is errorneously used with NewReno

Note: there's actually another bug in FRTO's SACK variant, which
is the causing failure in NewReno case because of the error
that's fixed here. I'll fix the SACK case separately (it's
a separate bug really, though related, but in order to fix that
I need to audit tp->snd_nxt usage a bit).

There were two places where SACK variant of FRTO is getting
incorrectly used even if SACK wasn't negotiated by the TCP flow.
This leads to incorrect setting of frto_highmark with NewReno
if a previous recovery was interrupted by another RTO.

An eventual fallback to conventional recovery then incorrectly
considers one or couple of segments as forward transmissions
though they weren't, which then are not LOST marked during
fallback making them "non-retransmittable" until the next RTO.
In a bad case, those segments are really lost and are the only
one left in the window. Thus TCP needs another RTO to continue.
The next FRTO, however, could again repeat the same events
making the progress of the TCP flow extremely slow.

In order for these events to occur at all, FRTO must occur
again in FRTOs step 3 while the key segments must be lost as
well, which is not too likely in practice. It seems to most
frequently with some small devices such as network printers
that *seem* to accept TCP segments only in-order. In cases
were key segments weren't lost, things get automatically
resolved because those wrongly marked segments don't need to be
retransmitted in order to continue.

I found a reproducer after digging up relevant reports (few
reports in total, none at netdev or lkml I know of), some
cases seemed to indicate middlebox issues which seems now
to be a false assumption some people had made. Bugzilla
#10063 _might_ be related. Damon L. Chesser <damon@damtek.com>
had a reproducable case and was kind enough to tcpdump it
for me. With the tcpdump log it was quite trivial to figure
out.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoe1000e: don't return half-read eeprom on error
Kok, Auke [Tue, 29 Apr 2008 18:18:55 +0000 (11:18 -0700)]
e1000e: don't return half-read eeprom on error

On a read error, e1000e might have returned uninitialized block of
eeprom data back to userspace. The convention is that 0xff is "empty",
so mark the entire eeprom as empty in case of an error.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoucc_geth: Don't use RX clock as TX clock.
Joakim Tjernlund [Tue, 29 Apr 2008 11:03:57 +0000 (13:03 +0200)]
ucc_geth: Don't use RX clock as TX clock.

Commit 9fb1e350e16164d56990dde036ae9c0a2fd3f634,
ucc_geth: use rx-clock-name and tx-clock-name device tree properties
Introduced a typo that made the driver use the RX clock
as TX clock, causing massive TX errors.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agocxgb3: Use CAP_SYS_RAWIO for firmware
Alan Cox [Tue, 29 Apr 2008 13:29:30 +0000 (14:29 +0100)]
cxgb3: Use CAP_SYS_RAWIO for firmware

Otherwise theoretically at least

CAP_NET_ADMIN
Reload new firmware
Wait..
Firmware patches kernel

So it should be CAY_SYS_RAWIO - not that I suspect this is in fact a
credible attack vector!

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agopcnet32: delete non NAPI code from driver.
Don Fry [Tue, 29 Apr 2008 20:49:58 +0000 (13:49 -0700)]
pcnet32: delete non NAPI code from driver.

Delete the non-napi code from the driver and Kconfig.
Tested x86_64.  Apply at next open opportunity.

Signed-off-by: Don Fry <pcnet32@verizon.net>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agofs_enet: Fix a memory leak in fs_enet_mdio_probe
Scott Wood [Fri, 2 May 2008 18:42:41 +0000 (13:42 -0500)]
fs_enet: Fix a memory leak in fs_enet_mdio_probe

There are more memory leaks in the !PPC_CPM_NEW_BINDING case, but that code
will disappear soon along with arch/ppc.

Reported by Daniel Marjamki <danielm77@spray.se> at
http://bugzilla.kernel.org/show_bug.cgi?id=10591

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[netdrvr] eexpress: IPv6 fails - multicast problems
Bruce Robson [Fri, 2 May 2008 20:40:53 +0000 (13:40 -0700)]
[netdrvr] eexpress: IPv6 fails - multicast problems

Taken from http://bugzilla.kernel.org/show_bug.cgi?id=10577

I was unable to access a computer containing an Intel EtherExpress 16 network
card using IPv6.

I traced this to failure of neighbour discovery.  When I used an "ip -6 neigh
add" command, on the computer attempting access, to insert a binding between
the IPv6 address of the computer with the Intel EtherExpress 16 network card
and the card's ethernet address, I was able to access that computer using
IPv6.

Neighbour discovery requires working multicast.  The driver sources file
eexpress.c contains an approximately 30 line function eexp_setup_filter used
when loading multicast addresses.

I found 3 problems in this function

1) It wrote the number of multicast addresses to the card instead of the
    number of bytes in the multicast addresses.

2) When loading multiple multicast addresses it loaded the first one
    provided multiple times instead of loading each one once.

3) The setting of pointer 'data' from 'dmi->dmi_addr' occured before the
    test for the error situation of 'dmi' being NULL.

Correcting these problems allows the computer with the Intel EtherExpress 16
network card to found by IPv6 neighbour discovery.

p.s. There is some information on the Intel EtherExpress 16 at
http://www.intel.com/support/etherexpress/vintage/sb/cs-013500.htm
Datasheet for the Intel 82586 ethernet controller used by the card
http://www.datasheetcatalog.com/datasheets_pdf/8/2/5/8/82586.shtml

Signed-off-by: Bruce Robson <bns_robson@hotmail.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago3c59x: use netstats in net_device structure
Paulius Zaleckas [Mon, 5 May 2008 12:01:29 +0000 (14:01 +0200)]
3c59x: use netstats in net_device structure

Use net_device_stats from net_device structure instead of local.

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Acked-by: Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago3c980-TX needs EXTRA_PREAMBLE
Gunnar Larisch [Mon, 5 May 2008 12:01:28 +0000 (14:01 +0200)]
3c980-TX needs EXTRA_PREAMBLE

The ethernet card 3c980-TX needs a mdio_sync() to initialize the ethernet
properly. This is forced by adding an EXTRA_PREAMBLE to its drv_flags.

Without this, the driver did not reconnect after a link loss.

Signed-off-by: Gunnar Larisch <Gunnar.Larisch@gmx.de>
Acked-by: Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoMerge branch 'for-2.6.26' of git://git.farnsworth.org/dale/linux-2.6-mv643xx_eth...
Jeff Garzik [Tue, 6 May 2008 16:22:03 +0000 (12:22 -0400)]
Merge branch 'for-2.6.26' of git://git.farnsworth.org/dale/linux-2.6-mv643xx_eth into upstream

16 years agofix warning in drivers/net/appletalk/cops.c
Jeff Garzik [Tue, 6 May 2008 16:16:24 +0000 (12:16 -0400)]
fix warning in drivers/net/appletalk/cops.c

drivers/net/appletalk/cops.c: In function ‘cops_reset’:
drivers/net/appletalk/cops.c:507: warning: comparison of distinct pointer
types lacks a cast

by replacing hand-woven msleep() with call to msleep()

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoe1000e: Add support for BM PHYs on ICH9
Bruce Allan [Tue, 29 Apr 2008 16:16:05 +0000 (09:16 -0700)]
e1000e: Add support for BM PHYs on ICH9

This patch adds support for the BM PHY, a new PHY model being used
on ICH9-based implementations.

This new PHY exposes issues in the ICH9 silicon when receiving
jumbo frames large enough to use more than a certain part of the
Rx FIFO, and this unfortunately breaks packet split jumbo receives.
For this reason we re-introduce (for affected adapters only) the
jumbo single-skb receive routine back so that people who do
wish to use jumbo frames on these ich9 platforms can do so.
Part of this problem has to do with CPU sleep states and to make
sure that all the wake up timings are correctly we force them
with the recently merged pm_qos infrastructure written by Mark
Gross. (See http://lkml.org/lkml/2007/10/4/400).

To make code read a bit easier we introduce a _IS_ICH flag so
that we don't need to do mac type checks over the code.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agouli526x: fix endianness issues in the setup frame
Anton Vorontsov [Tue, 29 Apr 2008 15:53:18 +0000 (19:53 +0400)]
uli526x: fix endianness issues in the setup frame

This patch fixes uli526x driver's issues on a PowerPC boards: uli chip
is unable to receive the packets.

It appears that send_frame_filter prepares the setup frame in the
endianness unsafe manner. On a big endian machines we should shift
the address nibble by two bytes.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agouli526x: initialize the hardware prior to requesting interrupts
Anton Vorontsov [Tue, 29 Apr 2008 15:53:13 +0000 (19:53 +0400)]
uli526x: initialize the hardware prior to requesting interrupts

The firmware on MPC8610HPCD boards enables ULI ethernet and leaves it
in some funky state before booting Linux. For drivers, it's always good
idea to (re)initialize the hardware prior to requesting interrupts.

This patch fixes the following oops:

Oops: Kernel access of bad area, sig: 11 [#1]
MPC86xx HPCD
NIP: c0172820 LR: c017287c CTR: 00000000
[...]
NIP [c0172820] allocate_rx_buffer+0x2c/0xb0
LR [c017287c] allocate_rx_buffer+0x88/0xb0
Call Trace:
[df82bdc0] [c017287c] allocate_rx_buffer+0x88/0xb0 (unreliable)
[df82bde0] [c0173000] uli526x_interrupt+0xe4/0x49c
[df82be20] [c0045418] request_irq+0xf0/0x114
[df82be50] [c01737b0] uli526x_open+0x48/0x160
[df82be70] [c0201184] dev_open+0xb0/0xe8
[df82be80] [c0200104] dev_change_flags+0x90/0x1bc
[df82bea0] [c035fab0] ip_auto_config+0x214/0xef4
[df82bf60] [c03421c8] kernel_init+0xc4/0x2ac
[df82bff0] [c0010834] kernel_thread+0x44/0x60
Instruction dump:
4e800020 9421ffe0 7c0802a6 bfa10014 7c7e1b78 90010024 80030060 83e30054
2b80002f 419d0078 3fa0c039 48000058 <907f001080630088 2f830000 419e0014

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoucc_geth: Fix a bunch of sparse warnings
Andy Fleming [Fri, 2 May 2008 18:01:23 +0000 (13:01 -0500)]
ucc_geth: Fix a bunch of sparse warnings

ucc_geth didn't have anything marked as __iomem.  It was also inconsistent
with its use of in/out accessors (using them sometimes, not using them other
times).  Cleaning this up cuts the warnings down from hundreds to just over a
dozen.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agophylib: Fix some sparse warnings
Andy Fleming [Fri, 2 May 2008 18:00:51 +0000 (13:00 -0500)]
phylib: Fix some sparse warnings

Declared some things static, declared some things in the header.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agogianfar: Fix a locking bug in gianfar's sysfs code
Andy Fleming [Fri, 2 May 2008 18:00:30 +0000 (13:00 -0500)]
gianfar: Fix a locking bug in gianfar's sysfs code

During sparse cleanup, found a locking bug.  Some of the sysfs functions were
acquiring a lock, and then returning in the event of an error.  We rearrange
the code so that the lock is released in error conditions, too.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agobonding: fix enslavement error unwinds
Jay Vosburgh [Sat, 3 May 2008 01:06:02 +0000 (18:06 -0700)]
bonding: fix enslavement error unwinds

As part of:

commit c2edacf80e155ef54ae4774379d461b60896bc2e
Author: Jay Vosburgh <fubar@us.ibm.com>
Date:   Mon Jul 9 10:42:47 2007 -0700

    bonding / ipv6: no addrconf for slaves separately from master

two steps were rearranged in the enslavement process: netdev_set_master
is now before the call to dev_open to open the slave.

This patch updates the error cases and unwind process at the
end of bond_enslave to match the new order.  Without this patch, it is
possible for the enslavement to fail, but leave the slave with IFF_SLAVE
set in its flags.

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agobonding: Deadlock between bonding_store_bonds and bond_destroy_sysfs.
Pavel Emelyanov [Sat, 3 May 2008 00:49:39 +0000 (17:49 -0700)]
bonding: Deadlock between bonding_store_bonds and bond_destroy_sysfs.

The sysfs layer has an internal protection, that ensures, that
all the process sitting inside ->sore/->show callback exits
before the appropriate entry is unregistered (the calltraces
are rather big, but I can provide them if required).

On the other hand, bonding takes rtnl_lock in
a) the bonding_store_bonds, i.e. in ->store callback,
b) module exit before calling the sysfs unregister routines.

Thus, the classical AB-BA deadlock may occur. To reproduce run
# while :; do modprobe bonding; rmmod bonding; done
and
# while :; do echo '+bond%d' > /sys/class/net/bonding_masters ; done
in parallel.

The fix is to move the bond_destroy_sysfs out of the rtnl_lock,
but _before_ bond_free_all to make sure no bonding devices exist
after module unload.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agobonding: fix error unwind in bonding_store_bonds
Jay Vosburgh [Sat, 3 May 2008 00:49:38 +0000 (17:49 -0700)]
bonding: fix error unwind in bonding_store_bonds

Fixed an error unwind in bonding_store_bonds that didn't release
the locks it held, and consolidated unwinds into a common block at the
end of the function.  Bug reported by Pavel Emelyanov <xemul@openvz.org>,
who provided a different fix.

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agobonding: Do not call free_netdev for already registered device.
Pavel Emelyanov [Sat, 3 May 2008 00:49:37 +0000 (17:49 -0700)]
bonding: Do not call free_netdev for already registered device.

If the call to bond_create_sysfs_entry in bond_create fails, the
proper rollback is to call unregister_netdevice, not free_netdev.
Otherwise - kernel BUG at net/core/dev.c:4057!

Checked with artificial failures injected into bond_create_sysfs_entry.

Pavel's original patch modified by Jay Vosburgh to move code around
for clarity (remove goto-hopping within the unwind block).

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agonet_cls_act: act_simple dont ignore realloc code
Jamal Hadi Salim [Tue, 6 May 2008 07:10:24 +0000 (00:10 -0700)]
net_cls_act: act_simple dont ignore realloc code

reallocation of the policy data was being ignored. It could fail.
Simplify so that there is no need for reallocating.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoiwlwifi: make IWLWIFI a tristate
Adrian Bunk [Tue, 6 May 2008 07:04:47 +0000 (00:04 -0700)]
iwlwifi: make IWLWIFI a tristate

IWLWIFI should be a tristate so that if IWLCORE and/or IWL3945 are m
and none of them is y kbuild doesn't create an empty
drivers/net/wireless/built-in.o

This patch also removes the pointless "default n".

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoRevert "atm: Do not free already unregistered net device."
David S. Miller [Tue, 6 May 2008 07:00:16 +0000 (00:00 -0700)]
Revert "atm: Do not free already unregistered net device."

This reverts commit 65e4113684e50cee75357ce10dc9026b0929e4e9.

Unlike the other cases Pavel fixed, this case did not
setup a netdev->destructor of free_netdev, therefore this
change was not correct.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agodccp: return -EINVAL on invalid feature length
Chris Wright [Mon, 5 May 2008 20:50:24 +0000 (13:50 -0700)]
dccp: return -EINVAL on invalid feature length

dccp_feat_change() validates length and on error is returning 1.
This happens to work since call chain is checking for 0 == success,
but this is returned to userspace, so make it a real error value.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoirda: fix !PNP support for drivers/net/irda/smsc-ircc2.c
Ingo Molnar [Mon, 5 May 2008 08:06:54 +0000 (01:06 -0700)]
irda: fix !PNP support for drivers/net/irda/smsc-ircc2.c

x86.git testing found this build bug on v2.6.26-rc1:

  ERROR: "pnp_get_resource" [drivers/net/irda/smsc-ircc2.ko] undefined!
  make[1]: *** [__modpost] Error 1
  make: *** [modules] Error 2

the driver did not anticipate the case of !CONFIG_PNP which is rare but
still possible. Instead of restricting the driver to PNP-only in the
Kconfig space, add the (trivial) dummy struct pnp_driver - this is that
other drivers use in the !PNP case too.

The driver itself can in theory be initialized on !PNP too in certain
cases, via smsc_ircc_legacy_probe().

Patch only minimally build tested, i dont have this hardware.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoirda: fix !PNP support in drivers/net/irda/nsc-ircc.c
Ingo Molnar [Mon, 5 May 2008 08:04:06 +0000 (01:04 -0700)]
irda: fix !PNP support in drivers/net/irda/nsc-ircc.c

x86.git testing found the following build failure in latest -git:

 drivers/built-in.o: In function `nsc_ircc_pnp_probe':
 nsc-ircc.c:(.text+0xdf1b6): undefined reference to `pnp_get_resource'
 nsc-ircc.c:(.text+0xdf1d4): undefined reference to `pnp_get_resource'
 nsc-ircc.c:(.text+0xdf1ee): undefined reference to `pnp_get_resource'
 nsc-ircc.c:(.text+0xdf237): undefined reference to `pnp_get_resource'
 nsc-ircc.c:(.text+0xdf24c): undefined reference to `pnp_get_resource'
 drivers/built-in.o:nsc-ircc.c:(.text+0xdf266): more undefined references to `pnp_get_resource' follow
 make: *** [.tmp_vmlinux1] Error 1

triggered via this config:

  http://redhat.com/~mingo/misc/config-Sat_May__3_20_53_13_CEST_2008.bad

while generally most users will have PNP enabled, drivers can support
non-PNP build mode too - and most drivers implement it. That is typically
done by providing a dummy pnp_driver structure that will not probe anything.

The fallback routines in the driver will handle this dumber mode of
operation too.

This patch implements that. I have not tested whether this actually
works on real hardware so take care. It does resolve the build bug.

[ Another solution that is used by a few drivers is to exclude the driver
  in the Kconfig if PNP is disabled, via "depends on PNP", but this would
  limit the availability of the driver needlessly. ]

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet_cls_act: Make act_simple use of netlink policy.
Jamal Hadi Salim [Mon, 5 May 2008 07:22:35 +0000 (00:22 -0700)]
net_cls_act: Make act_simple use of netlink policy.

Convert to netlink helpers by using netlink policy validation.
As a side effect fixes a leak.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoip: Use inline function dst_metric() instead of direct access to dst->metric[]
Satoru SATOH [Mon, 5 May 2008 05:14:42 +0000 (22:14 -0700)]
ip: Use inline function dst_metric() instead of direct access to dst->metric[]

There are functions to refer to the value of dst->metric[THE_METRIC-1]
directly without use of a inline function "dst_metric" defined in
net/dst.h.

The following patch changes them to use the inline function
consistently.

Signed-off-by: Satoru SATOH <satoru.satoh@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoip: Make use of the inline function dst_metric_locked()
Satoru SATOH [Mon, 5 May 2008 05:12:43 +0000 (22:12 -0700)]
ip: Make use of the inline function dst_metric_locked()

Signed-off-by: Satoru SATOH <satoru.satoh@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoatm: Bad locking on br2684_devs modifications.
Pavel Emelyanov [Mon, 5 May 2008 01:00:36 +0000 (18:00 -0700)]
atm: Bad locking on br2684_devs modifications.

The list_del happens under read-locked devs_lock.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoatm: Do not free already unregistered net device.
Pavel Emelyanov [Mon, 5 May 2008 01:00:05 +0000 (18:00 -0700)]
atm: Do not free already unregistered net device.

Both br2684_push and br2684_exit do so, but unregister_netdev()
releases the device itself.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agomac80211: Do not free net device after it is unregistered.
Pavel Emelyanov [Mon, 5 May 2008 00:59:30 +0000 (17:59 -0700)]
mac80211: Do not free net device after it is unregistered.

The error path in ieee80211_register_hw() may call the unregister_netdev()
and right after it - the free_netdev(), which is wrong, since the
unregister releases the device itself.

So the proposed fix is to NULL the local->mdev after unregister is done
and check this before calling free_netdev().

I checked - no code uses the local->mdev after unregister in this error
path (but even if some did this would be a BUG).

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agobridge: Consolidate error paths in br_add_bridge().
Pavel Emelyanov [Mon, 5 May 2008 00:58:07 +0000 (17:58 -0700)]
bridge: Consolidate error paths in br_add_bridge().

This actually had to be merged with the patch #1, but I decided not to
mix two changes in one patch.

There are already two calls to free_netdev() in there, so merge them
into one.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agobridge: Net device leak in br_add_bridge().
Pavel Emelyanov [Mon, 5 May 2008 00:57:29 +0000 (17:57 -0700)]
bridge: Net device leak in br_add_bridge().

In case the register_netdevice() call fails the device is leaked,
since the out: label is just rtnl_unlock()+return.

Free the device.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoniu: Fix probing regression for maramba on-board chips.
David S. Miller [Sun, 4 May 2008 08:34:31 +0000 (01:34 -0700)]
niu: Fix probing regression for maramba on-board chips.

Changeset 7f7c4072ea552f97a0898331322f71986a97299c ("niu: Determine
the # of ports from the card's VPD data") caused maramba on-board
NIU ports to stop probing properly.

The old code had a fallback that would use a num_ports value of
4 if all the probing methods failed, but that was removed.

This restores the fallback of 4 ports, to get things working
again.

Bump driver version and release date.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agolapbeth: Release ->ethdev when unregistering device.
David S. Miller [Sun, 4 May 2008 04:10:58 +0000 (21:10 -0700)]
lapbeth: Release ->ethdev when unregistering device.

Otherwise it leaks forever.

Based upon a report by Roland <devzero@web.de>

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoxfrm: convert empty xfrm_audit_* macros to functions
Marcin Slusarz [Sun, 4 May 2008 04:03:01 +0000 (21:03 -0700)]
xfrm: convert empty xfrm_audit_* macros to functions

it removes these warnings when CONFIG_AUDITSYSCALL is unset:

net/xfrm/xfrm_user.c: In function 'xfrm_add_sa':
net/xfrm/xfrm_user.c:412: warning: unused variable 'sid'
net/xfrm/xfrm_user.c:411: warning: unused variable 'sessionid'
net/xfrm/xfrm_user.c:410: warning: unused variable 'loginuid'
net/xfrm/xfrm_user.c: In function 'xfrm_del_sa':
net/xfrm/xfrm_user.c:485: warning: unused variable 'sid'
net/xfrm/xfrm_user.c:484: warning: unused variable 'sessionid'
net/xfrm/xfrm_user.c:483: warning: unused variable 'loginuid'
net/xfrm/xfrm_user.c: In function 'xfrm_add_policy':
net/xfrm/xfrm_user.c:1132: warning: unused variable 'sid'
net/xfrm/xfrm_user.c:1131: warning: unused variable 'sessionid'
net/xfrm/xfrm_user.c:1130: warning: unused variable 'loginuid'
net/xfrm/xfrm_user.c: In function 'xfrm_get_policy':
net/xfrm/xfrm_user.c:1382: warning: unused variable 'sid'
net/xfrm/xfrm_user.c:1381: warning: unused variable 'sessionid'
net/xfrm/xfrm_user.c:1380: warning: unused variable 'loginuid'
net/xfrm/xfrm_user.c: In function 'xfrm_add_pol_expire':
net/xfrm/xfrm_user.c:1620: warning: unused variable 'sid'
net/xfrm/xfrm_user.c:1619: warning: unused variable 'sessionid'
net/xfrm/xfrm_user.c:1618: warning: unused variable 'loginuid'
net/xfrm/xfrm_user.c: In function 'xfrm_add_sa_expire':
net/xfrm/xfrm_user.c:1658: warning: unused variable 'sid'
net/xfrm/xfrm_user.c:1657: warning: unused variable 'sessionid'
net/xfrm/xfrm_user.c:1656: warning: unused variable 'loginuid'

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet: Fix useless comment reference loop.
Johannes Berg [Sun, 4 May 2008 03:56:42 +0000 (20:56 -0700)]
net: Fix useless comment reference loop.

include/linux/skbuff.h says:
        /* These elements must be at the end, see alloc_skb() for details.  */

net/core/skbuff.c says:
* See comment in sk_buff definition, just before the 'tail' member

This patch contains my guess as to the actual reason rather than a
dead comment reference loop.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>