GitHub/LineageOS/android_kernel_samsung_universal7580.git
14 years agobnx2x: Fan failure
Eilon Greenstein [Tue, 21 Jul 2009 05:47:27 +0000 (05:47 +0000)]
bnx2x: Fan failure

Setup fan failure for different PHY types or according to nvram settings

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: Stop management traffic in loopback test
Eilon Greenstein [Tue, 21 Jul 2009 05:47:22 +0000 (05:47 +0000)]
bnx2x: Stop management traffic in loopback test

Since management traffic cannot go on the wire while configured to loopback,
simply stop it to avoid race condition when the MAC is set to loopback in the
middle of a packet

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agomcastv6: Local variable shadows function argument
Gerrit Renker [Tue, 21 Jul 2009 18:13:25 +0000 (11:13 -0700)]
mcastv6: Local variable shadows function argument

The local variable 'idev' shadows the function argument 'idev' to
ip6_mc_add_src(). Fixed by removing the local declaration, as pmc->idev
should be identical with 'idev' passed as argument.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocfg80211: double free in __cfg80211_scan_done
Christian Lamparter [Sun, 19 Jul 2009 03:05:37 +0000 (05:05 +0200)]
cfg80211: double free in __cfg80211_scan_done

This patch fixes a double free corruption in __cfg80211_scan_done:

 ================================================
 BUG kmalloc-512: Object already free
 ------------------------------------------------

 INFO: Allocated in load_elf_binary+0x18b/0x19af age=6
 INFO: Freed in load_elf_binary+0x104e/0x19af age=5
 INFO: Slab 0xffffea0001bae4c0 objects=14 used=7
 INFO: Object 0xffff88007e8a9918 @offset=6424 fp=0xffff88007e8a9488

 Bytes b4 0xffff88007e8a9908:  00 00 00 00 00 00 00 00 5a 5a
 [...]
 Pid: 28705, comm: rmmod Tainted: P         C 2.6.31-rc2-wl #1
 Call Trace:
  [<ffffffff810da9f4>] print_trailer+0x14e/0x16e
  [<ffffffff810daa56>] object_err+0x42/0x61
  [<ffffffff810dbcd9>] __slab_free+0x2af/0x396
  [<ffffffffa0ec9694>] ? wiphy_unregister+0x92/0x142 [cfg80211]
  [<ffffffff810dd5e3>] kfree+0x13c/0x17a
  [<ffffffffa0ec9694>] ? wiphy_unregister+0x92/0x142 [cfg80211]
  [<ffffffffa0ec9694>] wiphy_unregister+0x92/0x142 [cfg80211]
  [<ffffffffa0eed163>] ieee80211_unregister_hw+0xc8/0xff [mac80211]
  [<ffffffffa0f3fbc8>] p54_unregister_common+0x31/0x66 [p54common]
  [...]
 FIX kmalloc-512: Object at 0xffff88007e8a9918 not freed

The code path which leads to the *funny* double free:

       request = rdev->scan_req;
       dev = dev_get_by_index(&init_net, request->ifidx);
/*
 * the driver was unloaded recently and
 * therefore dev_get_by_index will return NULL!
 */
        if (!dev)
                goto out;
[...]
rdev->scan_req = NULL; /* not executed... */
[...]
 out:
        kfree(request);

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agorfkill: remove too-strict __must_check
Alan Jenkins [Sat, 18 Jul 2009 18:20:20 +0000 (19:20 +0100)]
rfkill: remove too-strict __must_check

Some drivers don't need the return value of rfkill_set_hw_state(),
so it should not be marked as __must_check.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Tune ANI function processing on AP mode during ANI reset
Luis R. Rodriguez [Thu, 16 Jul 2009 17:17:35 +0000 (10:17 -0700)]
ath9k: Tune ANI function processing on AP mode during ANI reset

For AP mode we must tune ANI specially for 2 GHz and
for 5 GHz. We mask in only the flags we want to toggle
on ath9k_hw_ani_control() through the ah->ani_function
bitmask, this will take care of ignoring changes during
ANI reset which we were disabling before.

Testedy-by: Steven Luo <steven@steven676.net>
Cc: Bennyam Malavazi <bennyam.malavazi@atheros.com>
Cc: Jouni Malinen <jouni.malinen@Atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: Fix chipset detection for rt2500usb
Andy Whitcroft [Thu, 16 Jul 2009 15:28:11 +0000 (16:28 +0100)]
rt2x00: Fix chipset detection for rt2500usb

The commit below changed the semantics of rt2x00_check_rev so that it no
longer checked the bottom 4 bits of the rev were non-zero.  During that
conversion this part of the check was not propogated to the rt2500usb
initialisation.

    commit 358623c22c9fd837b3b1b444377037f72553dc9f
    Author: Ivo van Doorn <ivdoorn@gmail.com>
    Date:   Tue May 5 19:46:08 2009 +0200

        rt2x00: Simplify rt2x00_check_rev

Without this check rt73 devices are miss recognised as rt2500 devices and
two drivers are loaded.  Preventing the device being used.  Reinstate this
check.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agonl80211: Memory leak fixed
Niko Jokinen [Wed, 15 Jul 2009 08:00:53 +0000 (11:00 +0300)]
nl80211: Memory leak fixed

Potential memory leak via msg pointer in nl80211_get_key() function.

Signed-off-by: Niko Jokinen <ext-niko.k.jokinen@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agortl8187: Fix for kernel oops when unloading with LEDs enabled
Larry Finger [Tue, 14 Jul 2009 20:55:16 +0000 (15:55 -0500)]
rtl8187: Fix for kernel oops when unloading with LEDs enabled

When rtl8187 is unloaded and CONFIG_RTL8187_LEDS is set, the kernel
may oops when the module is unloaded as the workqueue for led_on was
not being cancelled.

This patch fixes the problem reported in
http://marc.info/?l=linux-wireless&m=124742957615781&w=2.

Reported-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath5k: temporarily disable crypto for AP mode
Bob Copeland [Tue, 14 Jul 2009 01:57:39 +0000 (21:57 -0400)]
ath5k: temporarily disable crypto for AP mode

Pavel Roskin reported some issues with using AP mode without
nohwcrypt=1.  Most likely this is similar to the problem fixed
some time ago in ath9k by 3f53dd64f192450cb331c0fecfc26ca952fb242f,
"ath9k: Fix hw crypto configuration for TKIP in AP mode."

That only affects TKIP but it's easiest to just disable that and
WEP too until we get a proper fix in.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: use correct address for mesh Path Error
Javier Cardona [Tue, 14 Jul 2009 00:00:10 +0000 (17:00 -0700)]
mac80211: use correct address for mesh Path Error

For forwarded frames, we save the precursor address in addr1 in case it
needs to be used to send a Path Error.  mesh_path_discard_frame,
however, was using addr2 instead of addr1 to send Path Error frames, so
correct that and also make the comment regarding this more clear.

Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211_hwsim: fix use after free
Johannes Berg [Mon, 13 Jul 2009 11:25:58 +0000 (13:25 +0200)]
mac80211_hwsim: fix use after free

Once the "data" pointer is freed, we can't be iterating
to the next item in the list any more so we need to use
list_for_each_entry_safe with a temporary variable.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211_hwsim: fix unregistration
Johannes Berg [Mon, 13 Jul 2009 11:04:30 +0000 (13:04 +0200)]
mac80211_hwsim: fix unregistration

If you rmmod the module while associated, frames might
be transmitted during unregistration -- which will crash
if the hwsim%d interface is unregistered first, so only
do that after all the virtual wiphys are gone.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agorfkill: fix rfkill_set_states() to set the hw state
Alan Jenkins [Sun, 12 Jul 2009 16:03:13 +0000 (17:03 +0100)]
rfkill: fix rfkill_set_states() to set the hw state

The point of this function is to set the software and hardware state at
the same time.  When I tried to use it, I found it was only setting the
software state.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: fix injection in monitor mode
Pavel Roskin [Fri, 10 Jul 2009 20:42:29 +0000 (16:42 -0400)]
mac80211: fix injection in monitor mode

The location of the 802.11 header is calculated incorrectly due to a
wrong placement of parentheses.  Found by kmemcheck.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agorfkill: allow toggling soft state in sysfs again
Johannes Berg [Fri, 10 Jul 2009 19:41:39 +0000 (21:41 +0200)]
rfkill: allow toggling soft state in sysfs again

Apparently there actually _are_ tools that try to set
this in sysfs even though it wasn't supposed to be used
this way without claiming first. Guess what: now that
I've cleaned it all up it doesn't matter and we can
simply allow setting the soft-block state in sysfs.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Tested-By: Darren Salt <linux@youmustbejoking.demon.co.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: disable mesh
Johannes Berg [Fri, 10 Jul 2009 09:38:14 +0000 (11:38 +0200)]
mac80211: disable mesh

My kvm instance was complaining a lot about sleeping
in atomic contexts in the mesh code, and it turns out
that both mesh_path_add() and mpp_path_add() need to
be able to sleep (they even use synchronize_rcu()!).
I put in a might_sleep() to annotate that, but I see
no way, at least right now, of actually making sure
those functions are only called from process context
since they are both called during TX and RX and the
mesh code itself even calls them with rcu_read_lock()
"held".

Therefore, let's disable it completely for now.

It's possible that I'm only seeing this because the
hwsim's beaconing is broken and thus the peers aren't
discovered right away, but it is possible that this
happens even if beaconing is working, for a peer that
doesn't exist or so.

It should be possible to solve this by deferring the
freeing of the tables to call_rcu() instead of using
synchronize_rcu(), and also using atomic allocations,
but maybe it makes more sense to rework the code to
not call these from atomic contexts and defer more of
the work to the workqueue. Right now, I can't work on
either of those solutions though.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: only update byte count table during aggregation
Reinette Chatre [Thu, 9 Jul 2009 17:33:39 +0000 (10:33 -0700)]
iwlwifi: only update byte count table during aggregation

The byte count table is only used for aggregation. Updating it
in other cases caused fragmented frames to be dropped.

This fixes http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=2004

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: only show active power level via sysfs
Reinette Chatre [Thu, 9 Jul 2009 17:33:37 +0000 (10:33 -0700)]
iwlwifi: only show active power level via sysfs

This changes the power_level file to adhere to the "one value
per file" sysfs rule. The user will know which power level was
requested as it will be the number just written to this file. It
is thus not necessary to create a new sysfs file for this value.

In addition it fixes a problem where powertop's parsing expects
this value to be the first value in this file without any descriptions.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwmc3200wifi: fix NULL pointer dereference in iwm_if_free
Zhu Yi [Thu, 9 Jul 2009 09:24:15 +0000 (17:24 +0800)]
iwmc3200wifi: fix NULL pointer dereference in iwm_if_free

The driver private data is now based on wiphy. So we should not
touch the private data after wiphy_free() is called. The patch
fixes the potential NULL pointer dereference by making the
iwm_wdev_free() the last one on the interface removal path.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agocan: switch carrier on if device was stopped while in bus-off state
Wolfgang Grandegger [Mon, 20 Jul 2009 04:06:41 +0000 (04:06 +0000)]
can: switch carrier on if device was stopped while in bus-off state

This patch fixes a problem when a device is stopped while in the
bus-off state. Then the carrier remains off forever.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@skynet.be>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocan: restart device even if dev_alloc_skb() fails
Wolfgang Grandegger [Mon, 20 Jul 2009 04:06:40 +0000 (04:06 +0000)]
can: restart device even if dev_alloc_skb() fails

If dev_alloc_skb() failed in can_restart(), the device was left behind
in the bus-off state. This patch restarts the device nevertheless.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocan: sja1000: remove duplicated includes
Wolfgang Grandegger [Mon, 20 Jul 2009 04:06:39 +0000 (04:06 +0000)]
can: sja1000: remove duplicated includes

Remove duplicated #include('s) in
  drivers/net/can/sja1000/sja1000.c

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoNew device ID for sc92031 [1088:2031]
Cesar Eduardo Barros [Sun, 19 Jul 2009 08:03:32 +0000 (08:03 +0000)]
New device ID for sc92031 [1088:2031]

rain_maker@root-forum.org wrote:
> Hello cesar,
>
> In a recent thread in a german linux forum, a user reported his PIC
> NIC not being recognized by the kernel.
>
> Fortunately he provided enough information and I was able to help him
> and get the device working with the sc92031 driver.
>
> The device ID is [1088:2031] (Vendor is called "Microcomputer Systems
> (M) Son"), here is the respective thread in "ubuntuusers.de"
>
> http://forum.ubuntuusers.de/topic/lankarte-unter-xubuntu-wird-nicht-erkannt/
>
> (Although you might not speak german, the code provided will show
> you, that the device is actually working with your driver).
>
> It would be nice, if you include this new device ID to the
> sc92031-driver.
>
> Regards,
>
> Axel Köllhofer (aka Rain_Maker)

Cc: rain_maker@root-forum.org
Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years ago3c589_cs: re-initialize the multicast in the tc589_reset
Ken Kawasaki [Sun, 19 Jul 2009 13:08:12 +0000 (13:08 +0000)]
3c589_cs: re-initialize the multicast in the tc589_reset

3c589_cs:
re-initialize the multicast in the tc589_reset,
and spin_lock the set_multicast_list function.

Signed-off-by: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoFix error return for setsockopt(SO_TIMESTAMPING)
Rémi Denis-Courmont [Mon, 20 Jul 2009 00:47:04 +0000 (00:47 +0000)]
Fix error return for setsockopt(SO_TIMESTAMPING)

I guess it should be -EINVAL rather than EINVAL. I have not checked
when the bug came in. Perhaps a candidate for -stable?

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: fix thermal check and shutdown
Dhananjay Phadke [Fri, 17 Jul 2009 15:27:08 +0000 (15:27 +0000)]
netxen: fix thermal check and shutdown

Check temperature for all PCI functions, that can allow
graceful shutdown of all interfaces on the overheated card.

Old code was only monitoring temperature for function 0 only.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: fix deadlock on dev close
Dhananjay Phadke [Fri, 17 Jul 2009 15:27:07 +0000 (15:27 +0000)]
netxen: fix deadlock on dev close

netxen: fix deadlock on dev close

The tx ring accounting fix in commit cb2107be43d2fc5eadec58b92b
("netxen: fix tx ring accounting") introduced intermittent
deadlock when inteface is going down.

This was possibly combined effect of speculative tx pause,
calling netif_tx_lock instead of queue lock and unclean
synchronization with napi which could end up unmasking
interrupt.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: fix context deletion sequence
Dhananjay Phadke [Fri, 17 Jul 2009 15:27:06 +0000 (15:27 +0000)]
netxen: fix context deletion sequence

o Use D3 reset context deletion for NX2031, it cleans up
  more resources in the firmware.
o Release rx buffers after hardware context has been reset.
o Delete tx context after rx context, some firmware control
  commands are sent on tx context, so it should be the last
  to go.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Micrel KS8851 SPI network driver
Ben Dooks [Thu, 16 Jul 2009 05:24:08 +0000 (05:24 +0000)]
net: Micrel KS8851 SPI network driver

Network driver for the SPI version of the Micrel KS8851
network chip.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRDS: Refactor end of __conn_create for readability
Andy Grover [Fri, 17 Jul 2009 13:13:36 +0000 (13:13 +0000)]
RDS: Refactor end of __conn_create for readability

Add a comment for what's going on. Remove negative logic.
I find this much easier to understand quickly, although
there are a few lines duplicated.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRDS/IW: Remove dead code
Andy Grover [Fri, 17 Jul 2009 13:13:35 +0000 (13:13 +0000)]
RDS/IW: Remove dead code

In iWARP code, node_type will always be RNIC

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRDS/IW: Remove page_shift variable from iwarp transport
Andy Grover [Fri, 17 Jul 2009 13:13:34 +0000 (13:13 +0000)]
RDS/IW: Remove page_shift variable from iwarp transport

The existing code treated page_shift as a variable, when in fact we
always want to have the fastreg page size be the same as the arch's
page size -- and it is, so this doesn't need to be a variable.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRDS/IB: Always use PAGE_SIZE for FMR page size
Andy Grover [Fri, 17 Jul 2009 13:13:33 +0000 (13:13 +0000)]
RDS/IB: Always use PAGE_SIZE for FMR page size

While FMRs allow significant flexibility in what size of pages they can use,
we really just want FMR pages to match CPU page size. Roland says we can
count on this always being supported, so this simplifies things.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRDS: Fix completion notifications on blocking sockets
Andy Grover [Fri, 17 Jul 2009 13:13:32 +0000 (13:13 +0000)]
RDS: Fix completion notifications on blocking sockets

Completion or congestion notifications were not being checked
if the socket went to sleep. This patch fixes that.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRDS/IB: Drop connection when a fatal QP event is received
Andy Grover [Fri, 17 Jul 2009 13:13:31 +0000 (13:13 +0000)]
RDS/IB: Drop connection when a fatal QP event is received

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRDS/IB: Disable flow control in sysctl and explain why
Andy Grover [Fri, 17 Jul 2009 13:13:30 +0000 (13:13 +0000)]
RDS/IB: Disable flow control in sysctl and explain why

Backwards compatibility with rds 3.0 causes protocol-
based flow control to be disabled as a side-effect.

I don't want to pull out FC support from the IB transport
but I do want to document and keep the sysctl consistent
if possible.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRDS/IB: Move tx/rx ring init and refill to later
Andy Grover [Fri, 17 Jul 2009 13:13:29 +0000 (13:13 +0000)]
RDS/IB: Move tx/rx ring init and refill to later

Since RDS 3.0 and 3.1 have different packet formats,
we need to wait until after protocol negotiation
is complete to layout the rx buffers.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRDS: Don't set c_version in __rds_conn_create()
Andy Grover [Fri, 17 Jul 2009 13:13:28 +0000 (13:13 +0000)]
RDS: Don't set c_version in __rds_conn_create()

Protocol negotiation is logically a property of the
transports, so rds core need not set it.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRDS/IB: Rename byte_len to data_len to enhance readability
Andy Grover [Fri, 17 Jul 2009 13:13:27 +0000 (13:13 +0000)]
RDS/IB: Rename byte_len to data_len to enhance readability

Of course len is in bytes. Calling it data_len hopefully indicates
a little better what the variable is actually for.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRDS/RDMA: Fix cut-n-paste errors in printks in rdma_transport.c
Andy Grover [Fri, 17 Jul 2009 13:13:26 +0000 (13:13 +0000)]
RDS/RDMA: Fix cut-n-paste errors in printks in rdma_transport.c

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRDS/IB: Fix printk to indicate remote IP, not local
Andy Grover [Fri, 17 Jul 2009 13:13:25 +0000 (13:13 +0000)]
RDS/IB: Fix printk to indicate remote IP, not local

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRDS/IB: Handle connections using RDS 3.0 wire protocol
Andy Grover [Fri, 17 Jul 2009 13:13:24 +0000 (13:13 +0000)]
RDS/IB: Handle connections using RDS 3.0 wire protocol

The big differences between RDS 3.0 and 3.1 are protocol-level
flow control, and with 3.1 the header is in front of the data. The header
always ends up in the header buffer, and the data goes in the data page.

In 3.0 our "header" is a trailer, and will end up either in the data
page, the header buffer, or split across the two. Since 3.1 is backwards-
compatible with 3.0, we need to continue to support these cases. This
patch does that -- if using RDS 3.0 wire protocol, it will copy the header
from wherever it ended up into the header buffer.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRDS/IB: Improve RDS protocol version checking
Andy Grover [Fri, 17 Jul 2009 13:13:23 +0000 (13:13 +0000)]
RDS/IB: Improve RDS protocol version checking

RDS on IB uses privdata to do protocol version negotiation. Apparently
the IB stack will return a larger privdata buffer than the struct we were
expecting. Just to be extra-sure, this patch adds some checks in this area.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRDS: Set retry_count to 2 and make modifiable via modparam
Andy Grover [Fri, 17 Jul 2009 13:13:22 +0000 (13:13 +0000)]
RDS: Set retry_count to 2 and make modifiable via modparam

This will be default cause IB connections to failover faster,
but allow a longer retry count to be used if desired.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: explain netns notifiers a little better
Johannes Berg [Wed, 15 Jul 2009 06:16:34 +0000 (06:16 +0000)]
net: explain netns notifiers a little better

Eric explained this to me -- and afterwards the comment
made sense, but not before. Add the the critical point
about interfaces having to be gone from the netns before
subsys notifiers are called.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agob44: strncpy does not null terminate string
roel kluin [Fri, 17 Jul 2009 08:01:54 +0000 (08:01 +0000)]
b44: strncpy does not null terminate string

strlcpy() will always null terminate the string. Also use the
sizeof(version) to strlcopy() the version string.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotcp: Use correct peer adr when copying MD5 keys
John Dykstra [Fri, 17 Jul 2009 09:23:22 +0000 (09:23 +0000)]
tcp: Use correct peer adr when copying MD5 keys

When the TCP connection handshake completes on the passive
side, a variety of state must be set up in the "child" sock,
including the key if MD5 authentication is being used.  Fix TCP
for both address families to label the key with the peer's
destination address, rather than the address from the listening
sock, which is usually the wildcard.

Reported-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: John Dykstra <john.dykstra1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotcp: Fix MD5 signature checking on IPv4 mapped sockets
John Dykstra [Thu, 16 Jul 2009 05:04:51 +0000 (05:04 +0000)]
tcp: Fix MD5 signature checking on IPv4 mapped sockets

Fix MD5 signature checking so that an IPv4 active open
to an IPv6 socket can succeed.  In particular, use the
correct address family's signature generation function
for the SYN/ACK.

Reported-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: John Dykstra <john.dykstra1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoAdd mac driver for w90p910
Wan ZongShun [Thu, 16 Jul 2009 02:55:05 +0000 (02:55 +0000)]
Add mac driver for w90p910

Add mac driver support for evaluation board based on w90p910.

Signed-off-by: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipv4: fib_trie: Use tnode_get_child_rcu() and node_parent_rcu() in lookups
Jarek Poplawski [Tue, 14 Jul 2009 11:20:32 +0000 (11:20 +0000)]
ipv4: fib_trie: Use tnode_get_child_rcu() and node_parent_rcu() in lookups

While looking for other fib_trie problems reported by Pawel Staszewski
I noticed there are a few uses of tnode_get_child() and node_parent()
in lookups instead of their rcu versions.

Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipv4: Fix inflate_threshold_root automatically
Jarek Poplawski [Tue, 14 Jul 2009 09:41:00 +0000 (09:41 +0000)]
ipv4: Fix inflate_threshold_root automatically

During large updates there could be triggered warnings like: "Fix
inflate_threshold_root. Now=25 size=11 bits" if inflate() of the root
node isn't finished in 10 loops. It should be much rarer now, after
changing the threshold from 15 to 25, and a temporary problem, so
this patch tries to handle it automatically using a fix variable to
increase by one inflate threshold for next root resizes (up to the 35
limit, max fix = 10). The fix variable is decreased when root's
inflate() finishes below 7 loops (even if some other, smaller table/
trie is updated -- for simplicity the fix variable is global for now).

Reported-by: Pawel Staszewski <pstaszewski@itcare.pl>
Reported-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Tested-by: Pawel Staszewski <pstaszewski@itcare.pl>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipv4: Use synchronize_rcu() during trie_rebalance()
Jarek Poplawski [Tue, 14 Jul 2009 08:33:08 +0000 (08:33 +0000)]
ipv4: Use synchronize_rcu() during trie_rebalance()

During trie_rebalance() we free memory after resizing with call_rcu(),
but large updates, especially with PREEMPT_NONE configs, can cause
memory stresses, so this patch calls synchronize_rcu() in
tnode_free_flush() after each sync_pages to guarantee such freeing
(especially before resizing the root node).

The value of sync_pages = 128 is based on Pawel Staszewski's tests as
the lowest which doesn't hinder updating times. (For testing purposes
there was a sysfs module parameter to change it on demand, but it's
removed until we're sure it could be really useful.)

The patch is based on suggestions by: Paul E. McKenney
<paulmck@linux.vnet.ibm.com>

Reported-by: Pawel Staszewski <pstaszewski@itcare.pl>
Tested-by: Pawel Staszewski <pstaszewski@itcare.pl>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovlan: Propagate physical MTU changes
Herbert Xu [Mon, 20 Jul 2009 14:35:37 +0000 (07:35 -0700)]
vlan: Propagate physical MTU changes

When the physical MTU changes we want to ensure that all existing
VLAN device MTUs do not exceed the new underlying MTU.  This patch
adds that propagation.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoconnector: get test code working by default
Mike Frysinger [Fri, 17 Jul 2009 17:14:26 +0000 (10:14 -0700)]
connector: get test code working by default

The connector test code currently does not work out of the box.  This is
because it uses a connector id that is above the registered limit.  So
rather than force people to stumble through undocumented code wondering
why it isn't working, have the test code use one of the "private" ids by
default.  While I'm in here, clean up the code (kernel and user app) so
that it's a bit more user friendly and verbose in significant things that
it does.  Terse test code wastes people time as they simply enumerate it
with all the same kind of debug messages to get a better feel of what code
is running at any time.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoconnector: clean up grammar/style in documentation
Mike Frysinger [Fri, 17 Jul 2009 17:13:58 +0000 (10:13 -0700)]
connector: clean up grammar/style in documentation

The grammar in most of this file is slightly off, and some sections are
hard to read due to lack of visual clues breaking up related material.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoconnector: make callback argument type explicit
Mike Frysinger [Fri, 17 Jul 2009 17:13:21 +0000 (10:13 -0700)]
connector: make callback argument type explicit

The connector documentation states that the argument to the callback
function is always a pointer to a struct cn_msg, but rather than encode it
in the API itself, it uses a void pointer everywhere.  This doesn't make
much sense to encode the pointer in documentation as it prevents proper C
type checking from occurring and can easily allow people to use the wrong
pointer type.  So convert the argument type to an explicit struct cn_msg
pointer.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotun: Allow tap device to send/receive UFO packets.
Sridhar Samudrala [Tue, 14 Jul 2009 14:21:04 +0000 (14:21 +0000)]
tun: Allow tap device to send/receive UFO packets.

- Allow setting UFO on tap device and handle UFO packets.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
---------------------------------------------------------
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovirtio-net: Allow UFO feature to be set and advertised.
Sridhar Samudrala [Tue, 14 Jul 2009 14:21:02 +0000 (14:21 +0000)]
virtio-net: Allow UFO feature to be set and advertised.

- Allow setting UFO on virtio-net and advertise to host.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoUpdate Andreas Koensgen's email address
Ralf Baechle [Fri, 17 Jul 2009 04:47:19 +0000 (04:47 +0000)]
Update Andreas Koensgen's email address

The kernel has used a stale email address of Andreas for a few years.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMAINTAINERS entry for STRIP driver
Ralf Baechle [Fri, 17 Jul 2009 04:42:28 +0000 (04:42 +0000)]
MAINTAINERS entry for STRIP driver

The web server does no longer exist, it's not on archive.org nor does there
seem to be any mirror.

 MAINTAINERS |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Bump version number
Peter P Waskiewicz Jr [Thu, 16 Jul 2009 15:51:11 +0000 (15:51 +0000)]
ixgbe: Bump version number

Keep the version number marching along as updates come in.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Add device support for a new copper 82598 device
Peter P Waskiewicz Jr [Thu, 16 Jul 2009 15:50:52 +0000 (15:50 +0000)]
ixgbe: Add device support for a new copper 82598 device

This adds support for a new copper device for 82598, device id 0x150b.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Make sure boolean assignments from bitwise operations done correctly
Peter P Waskiewicz Jr [Thu, 16 Jul 2009 15:50:32 +0000 (15:50 +0000)]
ixgbe: Make sure boolean assignments from bitwise operations done correctly

When the link comes up, the driver detects which flow control settings are
active.  This is done using bitwise operations directly from the hardware
registers, and assumes the proper boolean assignment.  Make this an
explicit boolean value before assignment to the bool.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Remove legacy descriptor support
Peter P Waskiewicz Jr [Thu, 16 Jul 2009 15:50:12 +0000 (15:50 +0000)]
ixgbe: Remove legacy descriptor support

The ethtool offline test is the only consumer of the legacy descriptors.
Update that path to only use advanced descriptors, and remove all support
for legacy descriptors.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoudp: cleanups
Eric Dumazet [Fri, 17 Jul 2009 00:26:32 +0000 (00:26 +0000)]
udp: cleanups

Pure style cleanups.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agofs_enet/mii-fec.c: fix MII speed calculation
Wolfgang Denk [Fri, 17 Jul 2009 02:27:07 +0000 (02:27 +0000)]
fs_enet/mii-fec.c: fix MII speed calculation

The MII speed calculation was based on the CPU clock (ppc_proc_freq),
but for MPC512x we must use the bus clock instead.

This patch makes it use the correct clock and makes sure we don't
clobber reserved bits in the MII_SPEED register.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: <netdev@vger.kernel.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Fri, 17 Jul 2009 03:21:24 +0000 (20:21 -0700)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

Conflicts:
drivers/net/wireless/orinoco/main.c

14 years agocdc-eem: bad crc checking
Vincent CUISSARD [Thu, 16 Jul 2009 06:08:58 +0000 (06:08 +0000)]
cdc-eem: bad crc checking

When the driver received an EEM packet with CRC option enabled, driver must
compute and check the CRC of the Ethernet data. Previous version computes CRC
on Ethernet data plus the original CRC value. Skbuff is correctly trimed but
the old length is used when CRC is computed.

Signed-off-by: Vincent CUISSARD <vincent.cuissard@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Remove DPRINTK messages in DCB mode
Lucy Liu [Thu, 16 Jul 2009 13:43:31 +0000 (13:43 +0000)]
ixgbe: Remove DPRINTK messages in DCB mode

Remove debug DPRINTK in DCB mode netlink interface.

Signed-off-by: Lucy Liu <lucy.liu@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: clear mac address data block in DCB mode
Lucy Liu [Thu, 16 Jul 2009 13:43:10 +0000 (13:43 +0000)]
ixgbe: clear mac address data block in DCB mode

This change clears the address data block memory space, which is needed for
the 82598 which does not have a SAN MAC.

Signed-off-by: Lucy Liu <lucy.liu@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosky2: revert shutdown changes
Stephen Hemminger [Thu, 16 Jul 2009 13:20:57 +0000 (13:20 +0000)]
sky2: revert shutdown changes

The commit changes to shutdown path broke startup on some systems.

revert commit c0bad0f2e4366d5bbfe0c4a7a80bca8f4b05272b

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: sock_copy() fixes
Eric Dumazet [Wed, 15 Jul 2009 23:13:10 +0000 (23:13 +0000)]
net: sock_copy() fixes

Commit e912b1142be8f1e2c71c71001dc992c6e5eb2ec1
(net: sk_prot_alloc() should not blindly overwrite memory)
took care of not zeroing whole new socket at allocation time.

sock_copy() is another spot where we should be very careful.
We should not set refcnt to a non null value, until
we are sure other fields are correctly setup, or
a lockless reader could catch this socket by mistake,
while not fully (re)initialized.

This patch puts sk_node & sk_refcnt to the very beginning
of struct sock to ease sock_copy() & sk_prot_alloc() job.

We add appropriate smp_wmb() before sk_refcnt initializations
to match our RCU requirements (changes to sock keys should
be committed to memory before sk_refcnt setting)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoE100: work around the driver using streaming DMA mapping for RX descriptors.
Krzysztof Halasa [Tue, 14 Jul 2009 11:01:54 +0000 (11:01 +0000)]
E100: work around the driver using streaming DMA mapping for RX descriptors.

E100 places it's RX packet descriptors inside skb->data and uses them
with bidirectional streaming DMA mapping. Unfortunately it fails to
transfer skb->data ownership to the device after it reads the
descriptor's status, breaking on non-coherent (e.g., ARM) platforms.

This have to be converted to use coherent memory for the descriptors.

Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobonding: clean muticast addresses when device changes type
Moni Shoua [Wed, 15 Jul 2009 04:56:31 +0000 (04:56 +0000)]
bonding: clean muticast addresses when device changes type

Bonding device forbids slave device of different types under the same
master.

However, it is possible for a bonding master to change type during its
lifetime.  This can be either from ARPHRD_ETHER to ARPHRD_INFINIBAND
or the other way arround.  The change of type requires device level
multicast address cleanup because device level multicast addresses
depend on the device type.

The patch adds a call to dev_close() before the bonding master changes
type and dev_open() just after that.

In the example below I enslaved an IPoIB device (ib0) under
bond0. Since each bonding master starts as device of type ARPHRD_ETHER
by default, a change of type occurs when ib0 is enslaved.

This is how /proc/net/dev_mcast looks like without the patch

5    bond0           1     0     00ffffffff12601bffff000000000001ff96ca05
5    bond0           1     0     01005e000116
5    bond0           1     0     01005e7ffffd
5    bond0           1     0     01005e000001
5    bond0           1     0     333300000001
6    ib0             1     0     00ffffffff12601bffff000000000001ff96ca05
6    ib0             1     0     333300000001
6    ib0             1     0     01005e000001
6    ib0             1     0     01005e7ffffd
6    ib0             1     0     01005e000116
6    ib0             1     0     00ffffffff12401bffff00000000000000000001
6    ib0             1     0     00ffffffff12601bffff00000000000000000001

and this is how it looks like after the patch.

5    bond0           1     0     00ffffffff12601bffff000000000001ff96ca05
5    bond0           1     0     00ffffffff12601bffff00000000000000000001
5    bond0           1     0     00ffffffff12401bffff0000000000000ffffffd
5    bond0           1     0     00ffffffff12401bffff00000000000000000116
5    bond0           1     0     00ffffffff12401bffff00000000000000000001
6    ib0             1     0     00ffffffff12601bffff000000000001ff96ca05
6    ib0             1     0     00ffffffff12401bffff00000000000000000116
6    ib0             1     0     00ffffffff12401bffff0000000000000ffffffd
6    ib0             2     0     00ffffffff12401bffff00000000000000000001
6    ib0             2     0     00ffffffff12601bffff00000000000000000001

Signed-off-by: Moni Shoua <monis@voltaire.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoatl1c: misplaced parenthesis
roel kluin [Sun, 12 Jul 2009 12:57:38 +0000 (12:57 +0000)]
atl1c: misplaced parenthesis

Fix misplaced parenthesis

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoatl1c: add missing parentheses
roel kluin [Sun, 12 Jul 2009 11:40:34 +0000 (11:40 +0000)]
atl1c: add missing parentheses

Parentheses are required or the comparison occurs before the bitand.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6
David S. Miller [Fri, 17 Jul 2009 00:34:50 +0000 (17:34 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/kaber/nf-2.6

14 years agonetfilter: nf_conntrack: nf_conntrack_alloc() fixes
Eric Dumazet [Thu, 16 Jul 2009 12:03:40 +0000 (14:03 +0200)]
netfilter: nf_conntrack: nf_conntrack_alloc() fixes

When a slab cache uses SLAB_DESTROY_BY_RCU, we must be careful when allocating
objects, since slab allocator could give a freed object still used by lockless
readers.

In particular, nf_conntrack RCU lookups rely on ct->tuplehash[xxx].hnnode.next
being always valid (ie containing a valid 'nulls' value, or a valid pointer to next
object in hash chain.)

kmem_cache_zalloc() setups object with NULL values, but a NULL value is not valid
for ct->tuplehash[xxx].hnnode.next.

Fix is to call kmem_cache_alloc() and do the zeroing ourself.

As spotted by Patrick, we also need to make sure lookup keys are committed to
memory before setting refcount to 1, or a lockless reader could get a reference
on the old version of the object. Its key re-check could then pass the barrier.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: xt_osf: fix nf_log_packet() arguments
Patrick McHardy [Thu, 16 Jul 2009 12:01:54 +0000 (14:01 +0200)]
netfilter: xt_osf: fix nf_log_packet() arguments

The first argument is the address family, the second one the hook
number.

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agogianfar: remove unused DECLARE_MAC_BUF
Johannes Berg [Wed, 15 Jul 2009 18:31:10 +0000 (11:31 -0700)]
gianfar: remove unused DECLARE_MAC_BUF

The use of it was converted to %pM, but the variable
stuck -- remove it now to not cause spurious warnings.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/can: add module alias to can protocol drivers
Lothar Waßmann [Tue, 14 Jul 2009 23:12:25 +0000 (23:12 +0000)]
net/can: add module alias to can protocol drivers

Add appropriate MODULE_ALIAS() to facilitate autoloading of can protocol drivers

Signed-off-by: Lothar Wassmann <LW@KARO-electronics.de>
Acked-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/can bugfix: use after free bug in can protocol drivers
Lothar Waßmann [Tue, 14 Jul 2009 23:10:21 +0000 (23:10 +0000)]
net/can bugfix: use after free bug in can protocol drivers

Fix a use after free bug in can protocol drivers

The release functions of the can protocol drivers lack a call to
sock_orphan() which leads to referencing freed memory under certain
circumstances.

This patch fixes a bug reported here:
https://lists.berlios.de/pipermail/socketcan-users/2009-July/000985.html

Signed-off-by: Lothar Wassmann <LW@KARO-electronics.de>
Acked-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/compat/wext: send different messages to compat tasks
Johannes Berg [Wed, 1 Jul 2009 11:26:02 +0000 (11:26 +0000)]
net/compat/wext: send different messages to compat tasks

Wireless extensions have the unfortunate problem that events
are multicast netlink messages, and are not independent of
pointer size. Thus, currently 32-bit tasks on 64-bit platforms
cannot properly receive events and fail with all kinds of
strange problems, for instance wpa_supplicant never notices
disassociations, due to the way the 64-bit event looks (to a
32-bit process), the fact that the address is all zeroes is
lost, it thinks instead it is 00:00:00:00:01:00.

The same problem existed with the ioctls, until David Miller
fixed those some time ago in an heroic effort.

A different problem caused by this is that we cannot send the
ASSOCREQIE/ASSOCRESPIE events because sending them causes a
32-bit wpa_supplicant on a 64-bit system to overwrite its
internal information, which is worse than it not getting the
information at all -- so we currently resort to sending a
custom string event that it then parses. This, however, has a
severe size limitation we are frequently hitting with modern
access points; this limitation would can be lifted after this
patch by sending the correct binary, not custom, event.

A similar problem apparently happens for some other netlink
users on x86_64 with 32-bit tasks due to the alignment for
64-bit quantities.

In order to fix these problems, I have implemented a way to
send compat messages to tasks. When sending an event, we send
the non-compat event data together with a compat event data in
skb_shinfo(main_skb)->frag_list. Then, when the event is read
from the socket, the netlink code makes sure to pass out only
the skb that is compatible with the task. This approach was
suggested by David Miller, my original approach required
always sending two skbs but that had various small problems.

To determine whether compat is needed or not, I have used the
MSG_CMSG_COMPAT flag, and adjusted the call path for recv and
recvfrom to include it, even if those calls do not have a cmsg
parameter.

I have not solved one small part of the problem, and I don't
think it is necessary to: if a 32-bit application uses read()
rather than any form of recvmsg() it will still get the wrong
(64-bit) event. However, neither do applications actually do
this, nor would it be a regression.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agowext: optimise, comment and fix event sending
Johannes Berg [Wed, 24 Jun 2009 01:34:49 +0000 (01:34 +0000)]
wext: optimise, comment and fix event sending

The current function for sending events first allocates the
event stream buffer, and then an skb to copy the event stream
into. This can be done in one go. Also, the current function
leaks kernel data to userspace in a 4 uninitialised bytes,
initialise those explicitly. Finally also add a few useful
comments, as opposed to the current comments.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agowireless extensions: make netns aware
Johannes Berg [Wed, 24 Jun 2009 01:34:48 +0000 (01:34 +0000)]
wireless extensions: make netns aware

This makes wireless extensions netns aware. The
tasklet sending the events is converted to a work
struct so that we can rtnl_lock() in it.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoRevert "NET: Fix locking issues in PPP, 6pack, mkiss and strip line disciplines."
David S. Miller [Tue, 14 Jul 2009 20:13:41 +0000 (13:13 -0700)]
Revert "NET: Fix locking issues in PPP, 6pack, mkiss and strip line disciplines."

This reverts commit adeab1afb7de89555c69aab5ca21300c14af6369.

As Alan Cox explained, the TTY layer changes that went recently
to get rid of the tty->low_latency stuff fixes this already,
and even for -stable it's the ->low_latency changes that should
go in to fix this, rather than this patch.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoskbuff.h: Fix comment for NET_IP_ALIGN
Tobias Klauser [Mon, 13 Jul 2009 22:48:16 +0000 (22:48 +0000)]
skbuff.h: Fix comment for NET_IP_ALIGN

Use the correct function call for skb_reserve in the comment for
NET_IP_ALIGN.

Signed-off-by: Tobias Klauser <klto@zhaw.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodrivers/net: using spin_lock_irqsave() in net_send_packet()
Dongdong Deng [Sun, 12 Jul 2009 20:27:06 +0000 (20:27 +0000)]
drivers/net: using spin_lock_irqsave() in net_send_packet()

spin_unlock_irq() will enable interrupt in net_send_packet(),
this patch changes it to spin_lock_irqsave/spin_lock_irqrestore,
so that it doesn't enable interrupts when already disabled,
and netconsole would work properly over cs89x0/isa-skeleton.

Call trace:
netconsole write_msg()
{
 ...
 -> spin_lock_irqsave();
        -> netpoll_send_udp()
          -> netpoll_send_skb()
            -> net_send_packet()
              ->...

 -> spin_unlock_irqrestore();
 ...
}

Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoNET: phy_device, fix lock imbalance
Jiri Slaby [Mon, 13 Jul 2009 11:23:39 +0000 (11:23 +0000)]
NET: phy_device, fix lock imbalance

Don't forget to unlock a mutex in phy_scan_fixups on a fail path.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogre: fix ToS/DiffServ inherit bug
Andreas Jaggi [Tue, 14 Jul 2009 16:35:59 +0000 (09:35 -0700)]
gre: fix ToS/DiffServ inherit bug

Fixes two bugs:
- ToS/DiffServ inheritance was unintentionally activated when using impair fixed ToS values
- ECN bit was lost during ToS/DiffServ inheritance

Signed-off-by: Andreas Jaggi <aj@open.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Rename lookup_neigh_params function
Tobias Klauser [Mon, 13 Jul 2009 18:17:49 +0000 (11:17 -0700)]
net: Rename lookup_neigh_params function

Rename lookup_neigh_params to lookup_neigh_parms as the struct is named
neigh_parms and all other functions dealing with the struct carry
neigh_parms in their names.

Signed-off-by: Tobias Klauser <klto@zhaw.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: gcc-3.4.6 fix
Eric Dumazet [Mon, 13 Jul 2009 18:11:41 +0000 (11:11 -0700)]
igb: gcc-3.4.6 fix

forward declaration of inline function should be avoided, or
old gcc cannot compile.

Reported-by: Teck Choon Giam <giamteckchoon@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoatlx: duplicate testing of MCAST flag
roel kluin [Sun, 12 Jul 2009 13:12:37 +0000 (13:12 +0000)]
atlx: duplicate testing of MCAST flag

Fix duplicate testing of MCAST flag

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Jay Cliburn <jcliburn@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoNET: Fix locking issues in PPP, 6pack, mkiss and strip line disciplines.
Ralf Baechle [Mon, 13 Jul 2009 04:09:20 +0000 (21:09 -0700)]
NET: Fix locking issues in PPP, 6pack, mkiss and strip line disciplines.

Guido Trentalancia reports:

I am trying to use the kiss driver in the Linux kernel that is being
shipped with Fedora 10 but unfortunately I get the following oops:

mkiss: AX.25 Multikiss, Hans Albas PE1AYX
mkiss: ax0: crc mode is auto.
ADDRCONF(NETDEV_CHANGE): ax0: link becomes ready
------------[ cut here ]------------
WARNING: at kernel/softirq.c:77 __local_bh_disable+0x2f/0x83() (Not
tainted)
[...]
unloaded: microcode]
Pid: 0, comm: swapper Not tainted 2.6.27.25-170.2.72.fc10.i686 #1
 [<c042ddfb>] warn_on_slowpath+0x65/0x8b
 [<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
 [<c04228b4>] ? __enqueue_entity+0xe3/0xeb
 [<c042431e>] ? enqueue_entity+0x203/0x20b
 [<c0424361>] ? enqueue_task_fair+0x3b/0x3f
 [<c041f88c>] ? resched_task+0x3a/0x6e
 [<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
 [<c06ab4e2>] ? _spin_lock_bh+0xb/0x16
 [<c043255b>] __local_bh_disable+0x2f/0x83
 [<c04325ba>] local_bh_disable+0xb/0xd
 [<c06ab4e2>] _spin_lock_bh+0xb/0x16
 [<f8b6f600>] mkiss_receive_buf+0x2fb/0x3a6 [mkiss]
 [<c0572a30>] flush_to_ldisc+0xf7/0x198
 [<c0572b12>] tty_flip_buffer_push+0x41/0x51
 [<f89477f2>] ftdi_process_read+0x375/0x4ad [ftdi_sio]
 [<f8947a5a>] ftdi_read_bulk_callback+0x130/0x138 [ftdi_sio]
 [<c05d4bec>] usb_hcd_giveback_urb+0x63/0x93
 [<c05ea290>] uhci_giveback_urb+0xe5/0x15f
 [<c05eaabf>] uhci_scan_schedule+0x52e/0x767
 [<c05f6288>] ? psmouse_handle_byte+0xc/0xe5
 [<c054df78>] ? acpi_ev_gpe_detect+0xd6/0xe1
 [<c05ec5b0>] uhci_irq+0x110/0x125
 [<c05d4834>] usb_hcd_irq+0x40/0xa3
 [<c0465313>] handle_IRQ_event+0x2f/0x64
 [<c046642b>] handle_level_irq+0x74/0xbe
 [<c04663b7>] ? handle_level_irq+0x0/0xbe
 [<c0406e6e>] do_IRQ+0xc7/0xfe
 [<c0405668>] common_interrupt+0x28/0x30
 [<c056821a>] ? acpi_idle_enter_simple+0x162/0x19d
 [<c0617f52>] cpuidle_idle_call+0x60/0x92
 [<c0403c61>] cpu_idle+0x101/0x134
 [<c069b1ba>] rest_init+0x4e/0x50
 =======================
---[ end trace b7cc8076093467ad ]---
------------[ cut here ]------------
WARNING: at kernel/softirq.c:136 _local_bh_enable_ip+0x3d/0xc4()
[...]
Pid: 0, comm: swapper Tainted: G        W 2.6.27.25-170.2.72.fc10.i686
 [<c042ddfb>] warn_on_slowpath+0x65/0x8b
 [<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
 [<c04228b4>] ? __enqueue_entity+0xe3/0xeb
 [<c042431e>] ? enqueue_entity+0x203/0x20b
 [<c0424361>] ? enqueue_task_fair+0x3b/0x3f
 [<c041f88c>] ? resched_task+0x3a/0x6e
 [<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
 [<c06ab4e2>] ? _spin_lock_bh+0xb/0x16
 [<f8b6f642>] ? mkiss_receive_buf+0x33d/0x3a6 [mkiss]
 [<c04325f9>] _local_bh_enable_ip+0x3d/0xc4
 [<c0432688>] local_bh_enable_ip+0x8/0xa
 [<c06ab54d>] _spin_unlock_bh+0x11/0x13
 [<f8b6f642>] mkiss_receive_buf+0x33d/0x3a6 [mkiss]
 [<c0572a30>] flush_to_ldisc+0xf7/0x198
 [<c0572b12>] tty_flip_buffer_push+0x41/0x51
 [<f89477f2>] ftdi_process_read+0x375/0x4ad [ftdi_sio]
 [<f8947a5a>] ftdi_read_bulk_callback+0x130/0x138 [ftdi_sio]
 [<c05d4bec>] usb_hcd_giveback_urb+0x63/0x93
 [<c05ea290>] uhci_giveback_urb+0xe5/0x15f
 [<c05eaabf>] uhci_scan_schedule+0x52e/0x767
 [<c05f6288>] ? psmouse_handle_byte+0xc/0xe5
 [<c054df78>] ? acpi_ev_gpe_detect+0xd6/0xe1
 [<c05ec5b0>] uhci_irq+0x110/0x125
 [<c05d4834>] usb_hcd_irq+0x40/0xa3
 [<c0465313>] handle_IRQ_event+0x2f/0x64
 [<c046642b>] handle_level_irq+0x74/0xbe
 [<c04663b7>] ? handle_level_irq+0x0/0xbe
 [<c0406e6e>] do_IRQ+0xc7/0xfe
 [<c0405668>] common_interrupt+0x28/0x30
 [<c056821a>] ? acpi_idle_enter_simple+0x162/0x19d
 [<c0617f52>] cpuidle_idle_call+0x60/0x92
 [<c0403c61>] cpu_idle+0x101/0x134
 [<c069b1ba>] rest_init+0x4e/0x50
 =======================
---[ end trace b7cc8076093467ad ]---
mkiss: ax0: Trying crc-smack
mkiss: ax0: Trying crc-flexnet

The issue was, that the locking code in mkiss was assuming it was only
ever being called in process or bh context.  Fixed by converting the
involved locking code to use irq-safe locks.

Review of other networking line disciplines shows that 6pack, both sync
and async PPP and STRIP have similar issues.  The ppp_async one is the
most interesting one as it sorts out half of the issue as far back as
2004 in commit http://git.kernel.org/?p=linux/kernel/git/tglx/history.git;a=commitdiff;h=2996d8deaeddd01820691a872550dc0cfba0c37d

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Reported-by: Guido Trentalancia <guido@trentalancia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodrivers/net/bonding: Adjust constant name
Julia Lawall [Sat, 11 Jul 2009 10:03:55 +0000 (10:03 +0000)]
drivers/net/bonding: Adjust constant name

AD_SHORT_TIMEOUT and AD_STATE_LACP_ACTIVITY have the same value, but
AD_STATE_LACP_ACTIVITY better reflects the intended semantics.

[ J adds: AD_STATE_LACP_ACTIVITY is a value defined by the standard, and
should be set here in accordance with 802.3ad 43.4.12; AD_SHORT_TIMEOUT
is a constant specific to the Linux 802.3ad implementation that happens
to have the same value ]

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
struct port_params p;
@@
* p.port_state |= AD_SHORT_TIMEOUT
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodropmon: remove duplicated #include
Huang Weiyi [Fri, 10 Jul 2009 15:33:49 +0000 (15:33 +0000)]
dropmon: remove duplicated #include

Remove duplicated #include('s) in
  include/linux/net_dropmon.h

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: remove redundant sched/ in net/Makefile
Changli Gao [Wed, 8 Jul 2009 18:06:47 +0000 (18:06 +0000)]
net: remove redundant sched/ in net/Makefile

Remove redundant sched/ in net/Makefile.

sched/ is contained in previous:
obj-$(CONFIG_NET) += ethernet/ 802/ sched/ netlink/,
so the later
obj-$(CONFIG_NET_SCHED) += sched/
isn't necessary.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
----
Makefile | 1 -
1 file changed, 1 deletion(-)
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoudpv6: Handle large incoming UDP/IPv6 packets and support software UFO
Sridhar Samudrala [Thu, 9 Jul 2009 08:10:04 +0000 (08:10 +0000)]
udpv6: Handle large incoming UDP/IPv6 packets and support software UFO

- validate and forward GSO UDP/IPv6 packets from untrusted sources.
- do software UFO if the outgoing device doesn't support UFO.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoudpv6: Remove unused skb argument of ipv6_select_ident()
Sridhar Samudrala [Thu, 9 Jul 2009 08:10:01 +0000 (08:10 +0000)]
udpv6: Remove unused skb argument of ipv6_select_ident()

- move ipv6_select_ident() inline function to ipv6.h and remove the unused
  skb argument

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>