firefly-linux-kernel-4.4.55.git
13 years agomac80211: Remove obsolete TKIP flexibility
Jouni Malinen [Thu, 3 Feb 2011 16:34:28 +0000 (18:34 +0200)]
mac80211: Remove obsolete TKIP flexibility

The TKIP implementation was originally prepared to be a bit more
flexible in the way Michael MIC TX/RX keys are configured. However, we
are now taking care of the TX/RX MIC key swapping in user space, so
this code will not be needed. Similarly, there were some remaining WPA
testing code that won't be used in their current form. Remove the
unneeded extra complexity.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agodrivers:net:ipw2100.c change a typo comamnd to command
Justin P. Mattock [Wed, 2 Feb 2011 05:06:21 +0000 (21:06 -0800)]
drivers:net:ipw2100.c change a typo comamnd to command

The below patch fixes a typo comamnd to command.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: reserve a beacon slot on beaconing vif addition
Rajkumar Manoharan [Tue, 1 Feb 2011 17:35:36 +0000 (23:05 +0530)]
ath9k: reserve a beacon slot on beaconing vif addition

The beaconing vif addition is based on max beacon slot
available. So it is better to reserve a beacon slot
on interface addition and let it be configured properly
on bss_info change.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: allow GO to scan like AP
Johannes Berg [Tue, 1 Feb 2011 14:35:36 +0000 (15:35 +0100)]
mac80211: allow GO to scan like AP

There's no point in disallowing scanning for a
GO interface when it's not beaconing yet.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: pass up beacons from external BSS when operating as AP
Arik Nemtsov [Tue, 1 Feb 2011 11:23:05 +0000 (13:23 +0200)]
mac80211: pass up beacons from external BSS when operating as AP

Beacons from external BSSes are required for updating overlapping BSS
info (i.e. ERP protection). Pass them up unconditionally.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: add HW flag for disabling auto link-PS in AP mode
Arik Nemtsov [Mon, 31 Jan 2011 20:29:13 +0000 (22:29 +0200)]
mac80211: add HW flag for disabling auto link-PS in AP mode

When operating in AP mode the wl1271 hardware filters out null-data
packets as well as management packets. This makes it impossible for
mac80211 to monitor the PS mode by using the PM bit of incoming frames.

Implement a HW flag to indicate that mac80211 should ignore the PM bit.
In addition, expose ieee80211_sta_ps_transition() to make low-level
drivers capable of controlling PS-mode.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: do not calc frame duration when using HW rate-control
Arik Nemtsov [Mon, 31 Jan 2011 20:29:12 +0000 (22:29 +0200)]
mac80211: do not calc frame duration when using HW rate-control

When rate-control is performed in HW, we cannot calculate frame
duration as we do not have the skb transmission rate in SW.

ieee80211_tx_h_calculate_duration() should only be called when
ieee80211_tx_h_rate_ctrl() has been called before to initialize data
in skb->cb. This doesn't happen for drivers with HW rate-control.

Fixes the following warning when operating in AP-mode
in a driver with HW rate-control.

WARNING: at net/mac80211/tx.c:57 ieee80211_duration+0x54/0x1d8 [mac80211]()
Modules linked in: wl1271_sdio wl1271 firmware_class crc7 mac80211 cfg80211
[<c0046090>] (unwind_backtrace+0x0/0x124) from [<c0064c10>] (warn_slowpath_common+0x4c/0x64)
[<c0064c10>] (warn_slowpath_common+0x4c/0x64) from [<c0064c40>] (warn_slowpath_null+0x18/0x1c)
[<c0064c40>] (warn_slowpath_null+0x18/0x1c) from [<bf040e34>] (ieee80211_duration+0x54/0x1d8 [mac80211])
[<bf040e34>] (ieee80211_duration+0x54/0x1d8 [mac80211]) from [<bf04200c>] (invoke_tx_handlers+0xfa0/0x1088 [mac80211])
[<bf04200c>] (invoke_tx_handlers+0xfa0/0x1088 [mac80211]) from [<bf042178>] (ieee80211_tx+0x84/0x248 [mac80211])
[<bf042178>] (ieee80211_tx+0x84/0x248 [mac80211]) from [<bf042f44>] (ieee80211_tx_pending+0x12c/0x278 [mac80211])
[<bf042f44>] (ieee80211_tx_pending+0x12c/0x278 [mac80211]) from [<c0069a9c>] (tasklet_action+0x68/0xbc)
[<c0069a9c>] (tasklet_action+0x68/0xbc) from [<c006a044>] (__do_softirq+0x84/0x114)
[<c006a044>] (__do_softirq+0x84/0x114) from [<c006a1b8>] (do_softirq+0x48/0x54)
[<c006a1b8>] (do_softirq+0x48/0x54) from [<c006a4f8>] (local_bh_enable+0x98/0xcc)
[<c006a4f8>] (local_bh_enable+0x98/0xcc) from [<bf074e60>] (wl1271_rx+0x2e8/0x3a4 [wl1271])
[<bf074e60>] (wl1271_rx+0x2e8/0x3a4 [wl1271]) from [<bf071ae4>] (wl1271_irq_work+0x230/0x310 [wl1271])
[<bf071ae4>] (wl1271_irq_work+0x230/0x310 [wl1271]) from [<c0076864>] (process_one_work+0x208/0x350)
[<c0076864>] (process_one_work+0x208/0x350) from [<c0076e14>] (worker_thread+0x1cc/0x300)
[<c0076e14>] (worker_thread+0x1cc/0x300) from [<c007bb88>] (kthread+0x84/0x8c)
[<c007bb88>] (kthread+0x84/0x8c) from [<c0041494>] (kernel_thread_exit+0x0/0x8)

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Recalculate channel-type on iface removal.
Ben Greear [Mon, 31 Jan 2011 19:30:09 +0000 (11:30 -0800)]
mac80211: Recalculate channel-type on iface removal.

When a vif goes away, it could cause the super-chan
to be recalculated differently, so do that calculation
on iface removal.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Show channel type and frequency in debugfs.
Ben Greear [Mon, 31 Jan 2011 18:37:36 +0000 (10:37 -0800)]
ath9k: Show channel type and frequency in debugfs.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: do not access hw registers in FULL SLEEP
Rajkumar Manoharan [Mon, 31 Jan 2011 18:17:46 +0000 (23:47 +0530)]
ath9k: do not access hw registers in FULL SLEEP

The opmode recalculation is accessing hw registers.
When it is called from remove interface callback and
if there are no vifs present then hw is moved to FULL SLEEP
by radio disable. So use power save wrappers before
accessing hw registers in calculating opmode state.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: make use common of function to update txpower
Rajkumar Manoharan [Mon, 31 Jan 2011 18:17:45 +0000 (23:47 +0530)]
ath9k_htc: make use common of function to update txpower

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: move update tx power to common
Rajkumar Manoharan [Mon, 31 Jan 2011 18:17:44 +0000 (23:47 +0530)]
ath9k: move update tx power to common

move ath_update_txpow to common to remove code duplication
in both ath9k & ath9k_htc.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: use common get current channel function
Rajkumar Manoharan [Mon, 31 Jan 2011 18:17:43 +0000 (23:47 +0530)]
ath9k: use common get current channel function

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: cancel ani work in ath9k_htc_stop
Rajkumar Manoharan [Mon, 31 Jan 2011 18:17:42 +0000 (23:47 +0530)]
ath9k_htc: cancel ani work in ath9k_htc_stop

ani work is cancelled in dissaoctiation. But in some cases
during suspend, deauthention never be called. So we failed
to stop ani work which was identified by the following
warning.

Call Trace:
 [<ffffffffa0454a1d>] ieee80211_can_queue_work.clone.17+0x2d/0x40 [mac80211]
 [<ffffffffa0454a60>] ieee80211_queue_delayed_work+0x30/0x60 [mac80211]
 [<ffffffffa0567f82>] ath9k_ani_work+0x142/0x250 [ath9k_htc]
 [<ffffffff81073c70>] async_run_entry_fn+0x0/0x180
 [<ffffffffa0567e40>] ath9k_ani_work+0x0/0x250 [ath9k_htc]

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: Fix power save state after interface type change
Juuso Oikarinen [Mon, 31 Jan 2011 13:52:58 +0000 (15:52 +0200)]
cfg80211: Fix power save state after interface type change

Currently cfg80211 only configures the PSM state to the driver upon creation
of a new virtual interface, but not after interface type change. The mac80211
on the other hand reinitializes its sdata structure every time the interface
type is changed, losing the PSM configuration.

Hence, if the interface type is changed to, say, ad-hoc and then back to
managed, "iw wlan0 get power_save" will claim that PSM is enabled, when in
fact on mac80211 level it is not.

Fix this in cfg80211 by configuring the PSM state to the driver each time
the interface is brought up instead of just when the interface is created.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1251: set rate index and preamble flag on received packets
David Gnedt [Sun, 30 Jan 2011 19:11:10 +0000 (20:11 +0100)]
wl1251: set rate index and preamble flag on received packets

Set the rate index rate_idx and preamble flag RX_FLAG_SHORTPRE on received
packets.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Acked-by: Kalle Valo <kvalo@adurom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1251: enable adhoc mode
David Gnedt [Sun, 30 Jan 2011 19:11:04 +0000 (20:11 +0100)]
wl1251: enable adhoc mode

Enable adhoc support in wl1251 driver.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Acked-by: Kalle Valo <kvalo@adurom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1251: implement connection quality monitoring
David Gnedt [Sun, 30 Jan 2011 19:11:00 +0000 (20:11 +0100)]
wl1251: implement connection quality monitoring

Implement connection quality monitoring similar to the wl1271 driver.
It triggers ieee80211_cqm_rssi_notify with the corresponding event when
RSSI drops blow RSSI threshold or rises again above the RSSI threshold.
It should be noted that wl1251 doesn't support RSSI hysteresis, instead it
uses RSSI averageing and delays events until a certain count of frames
proved RSSI change.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Acked-by: Kalle Valo <kvalo@adurom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1251: enable beacon early termination while in power-saving mode
David Gnedt [Sun, 30 Jan 2011 19:10:57 +0000 (20:10 +0100)]
wl1251: enable beacon early termination while in power-saving mode

Port the beacon early termination feature from wl1251 driver version
included in the Maemo Fremantle kernel.
It is enabled when going to power-saving mode and disabled when leaving
power-saving mode.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Acked-by: Kalle Valo <kvalo@adurom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1251: fix 4-byte TX buffer alignment
David Gnedt [Sun, 30 Jan 2011 19:10:48 +0000 (20:10 +0100)]
wl1251: fix 4-byte TX buffer alignment

This implements TX buffer alignment for cloned or too small skb by
copying and replacing the original skb.
Recent changes in wireless-testing seems to make this really necessary.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Acked-by: Kalle Valo <kvalo@adurom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1251: fix queue stopping/waking for TX path
David Gnedt [Sun, 30 Jan 2011 19:10:46 +0000 (20:10 +0100)]
wl1251: fix queue stopping/waking for TX path

The queue stopping/waking functionality was broken in a way that could
cause the TX to stall if the right circumstances are met.

The problem was caused by tx_work, which is scheduled on each TX operation.
If the firmware buffer is full, tx_work does nothing. In combinition with
stopped queues or non-continues transfers, tx_work is never scheduled again.
Moreover the low watermark introduced by
9df86e2e702c6d5547aced7f241addd2d698bb11 never takes effect because of some
old code.

Solve this by scheduling tx_work every time tx_queue is non-empty and
firmware buffer is freed on tx_complete.

This also solves a possible but unlikely case: If less frames than the high
watermark are queued, but more than firmware buffer can hold. This results
in queues staying awake but the only scheduled tx_work doesn't transfer all
frames, so the remaining frames are stuck in the queue until more frames
get queued and tx_work is scheduled again.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Acked-by: Kalle Valo <kvalo@adurom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Warn users if HT fails because of freq mismatch.
Ben Greear [Sat, 29 Jan 2011 01:05:43 +0000 (17:05 -0800)]
mac80211: Warn users if HT fails because of freq mismatch.

I have a netgear WNDR3700 that appears to have an off-by-four
bug in how it fills out the hti->control_chan (I configure the
AP to channel 11, it reports 15 as control_chan).

Poke a message into the kernel logs to give users a
clue as to why they are not getting the expected
channel-type or rate.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Show configured channel-type in netdev debugfs.
Ben Greear [Sat, 29 Jan 2011 01:05:42 +0000 (17:05 -0800)]
mac80211: Show configured channel-type in netdev debugfs.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Be more careful when changing channels.
Ben Greear [Fri, 28 Jan 2011 18:20:47 +0000 (10:20 -0800)]
mac80211: Be more careful when changing channels.

If we cannot set the channel type, set the channel back to the
original.

Don't update the driver hardware if nothing actually changed.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agolibertas: Prepare stuff for if_spi.c pm support
Vasily Khoruzhick [Fri, 21 Jan 2011 20:44:49 +0000 (22:44 +0200)]
libertas: Prepare stuff for if_spi.c pm support

To support suspend/resume in if_spi we need two things:
- re-setup fw in lbs_resume(), because if_spi powercycles card;
- don't touch hwaddr on second lbs_update_hw_spec() call for same
  reason;

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agolibertas_spi: Use workqueue in hw_host_to_card
Vasily Khoruzhick [Fri, 21 Jan 2011 20:44:48 +0000 (22:44 +0200)]
libertas_spi: Use workqueue in hw_host_to_card

Use workqueue to perform SPI xfers, it's necessary to fix
nasty "BUG: scheduling while atomic", because
spu_write() calls spi_sync() and spi_sync() may sleep, but
hw_host_to_card() callback can be called from atomic context.
Remove kthread completely, workqueue now does its job.
Restore intermediate buffers which were removed in commit
86c34fe89e9cad9e1ba4d1a8bbf98259035f4caf that introduced
mentioned bug.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMerge branch 'wireless-next-2.6' of git://git.kernel.org/pub/scm/linux/kernel/git...
John W. Linville [Thu, 3 Feb 2011 21:35:20 +0000 (16:35 -0500)]
Merge branch 'wireless-next-2.6' of git://git./linux/kernel/git/iwlwifi/iwlwifi-2.6

13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Thu, 3 Feb 2011 21:06:43 +0000 (13:06 -0800)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-next-2.6

13 years agowireless, wl1251: Fix potential NULL pointer dereference in wl1251_op_bss_info_changed()
Jesper Juhl [Thu, 3 Feb 2011 20:14:01 +0000 (21:14 +0100)]
wireless, wl1251: Fix potential NULL pointer dereference in wl1251_op_bss_info_changed()

In drivers/net/wireless/wl1251/main.c:wl1251_op_bss_info_changed() we make
a call to ieee80211_beacon_get() which may return NULL, but we do not
check the return value before dereferencing the pointer.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agosch_choke: Need linux/vmalloc.h
David S. Miller [Thu, 3 Feb 2011 07:06:31 +0000 (23:06 -0800)]
sch_choke: Need linux/vmalloc.h

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosched: CHOKe flow scheduler
stephen hemminger [Wed, 2 Feb 2011 15:21:10 +0000 (15:21 +0000)]
sched: CHOKe flow scheduler

CHOKe ("CHOose and Kill" or "CHOose and Keep") is an alternative
packet scheduler based on the Random Exponential Drop (RED) algorithm.

The core idea is:
  For every packet arrival:
   Calculate Qave
if (Qave < minth)
     Queue the new packet
else
     Select randomly a packet from the queue
     if (both packets from same flow)
     then Drop both the packets
     else if (Qave > maxth)
          Drop packet
     else
          Admit packet with proability p (same as RED)

See also:
  Rong Pan, Balaji Prabhakar, Konstantinos Psounis, "CHOKe: a stateless active
   queue management scheme for approximating fair bandwidth allocation",
  Proceeding of INFOCOM'2000, March 2000.

Help from:
     Eric Dumazet <eric.dumazet@gmail.com>
     Patrick McHardy <kaber@trash.net>

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosfq: deadlock in error path
stephen hemminger [Wed, 2 Feb 2011 15:19:51 +0000 (15:19 +0000)]
sfq: deadlock in error path

The change to allow divisor to be a parameter (in 2.6.38-rc1)
 commit 817fb15dfd988d8dda916ee04fa506f0c466b9d6
introduced a possible deadlock caught by sparse.

The scheduler tree lock was left locked in the case of an incorrect
divisor value. Simplest fix is to move test outside of lock
which also solves problem of partial update.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Fix fib_trie build in some configurations.
David S. Miller [Thu, 3 Feb 2011 04:48:10 +0000 (20:48 -0800)]
ipv4: Fix fib_trie build in some configurations.

If we end up including include/linux/node.h (either explicitly
or implicitly) that header has a definition of "structt node"
too.

So rename the one we use in fib_trie to "rt_trie_node" to avoid
the conflict.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotcp: Increase the initial congestion window to 10.
David S. Miller [Thu, 3 Feb 2011 01:05:11 +0000 (17:05 -0800)]
tcp: Increase the initial congestion window to 10.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Nandita Dukkipati <nanditad@google.com>
13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6
David S. Miller [Wed, 2 Feb 2011 23:52:23 +0000 (15:52 -0800)]
Merge branch 'master' of git://git./linux/kernel/git/kaber/nf-2.6

13 years agobna: use device model DMA API
Ivan Vecera [Wed, 2 Feb 2011 04:37:02 +0000 (04:37 +0000)]
bna: use device model DMA API

Use DMA API as PCI equivalents will be deprecated.

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotcp_ecn is an integer not a boolean
Peter Chubb [Wed, 2 Feb 2011 23:39:58 +0000 (15:39 -0800)]
tcp_ecn is an integer not a boolean

There was some confusion at LCA as to why the sysctl tcp_ecn took one
of three values when it was documented as a Boolean.  This patch fixes
the documentation.

Signed-off-by: Peter Chubb <peter.chubb@nicta.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
David S. Miller [Wed, 2 Feb 2011 23:24:48 +0000 (15:24 -0800)]
Merge branch 'master' of git://git./linux/kernel/git/kaber/nf-next-2.6

13 years agonetfilter: xtables: add device group match
Patrick McHardy [Wed, 2 Feb 2011 23:05:43 +0000 (00:05 +0100)]
netfilter: xtables: add device group match

Add a new 'devgroup' match to match on the device group of the
incoming and outgoing network device of a packet.

Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agoatl1c: Add missing PCI device ID
Chuck Ebbert [Wed, 2 Feb 2011 23:02:08 +0000 (15:02 -0800)]
atl1c: Add missing PCI device ID

Commit 8f574b35f22fbb9b5e5f1d11ad6b55b6f35f4533 ("atl1c: Add AR8151 v2
support and change L0s/L1 routine") added support for a new adapter
but failed to add it to the PCI device table.

Signed-Off-By: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agos390: Fix possibly wrong size in strncmp (smsgiucv)
Stefan Weil [Wed, 2 Feb 2011 06:04:36 +0000 (06:04 +0000)]
s390: Fix possibly wrong size in strncmp (smsgiucv)

This error was reported by cppcheck:
drivers/s390/net/smsgiucv.c:63: error: Using sizeof for array given as
function argument returns the size of pointer.

Although there is no runtime problem as long as sizeof(u8 *) == 8,
this misleading code should get fixed.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agos390: Fix wrong size in memcmp (netiucv)
Stefan Weil [Wed, 2 Feb 2011 06:04:35 +0000 (06:04 +0000)]
s390: Fix wrong size in memcmp (netiucv)

This error was reported by cppcheck:
drivers/s390/net/netiucv.c:568: error: Using sizeof for array given
as function argument returns the size of pointer.

sizeof(ipuser) did not result in 16 (as many programmers would have
expected) but sizeof(u8 *), so it is 4 or 8, too small here.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqeth: allow OSA CHPARM change in suspend state
Ursula Braun [Wed, 2 Feb 2011 06:04:34 +0000 (06:04 +0000)]
qeth: allow OSA CHPARM change in suspend state

For OSA the CHPARM-definition determines the number of available
outbound queues.
A CHPARM-change may occur while a Linux system with probed
OSA device is in suspend state. This patch enables proper
resuming of an OSA device in this case.

Signed-off-by: Ursula braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqeth: allow HiperSockets framesize change in suspend
Ursula Braun [Wed, 2 Feb 2011 06:04:33 +0000 (06:04 +0000)]
qeth: allow HiperSockets framesize change in suspend

For HiperSockets the framesize-definition determines the selected
mtu-size and the size of the allocated qdio buffers.
A framesize-change may occur while a Linux system with probed
HiperSockets device is in suspend state. This patch enables proper
resuming of a HiperSockets device in this case.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqeth: add more strict MTU checking
Frank Blaschka [Wed, 2 Feb 2011 06:04:32 +0000 (06:04 +0000)]
qeth: add more strict MTU checking

HiperSockets and OSA hardware report a maximum MTU size. Add checking
to reject larger MTUs than allowed by hardware.

Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqeth: show new mac-address if its setting fails
Ursula Braun [Wed, 2 Feb 2011 06:04:31 +0000 (06:04 +0000)]
qeth: show new mac-address if its setting fails

Setting of a MAC-address may fail because an already used MAC-address
is to bet set or because of authorization problems. In those cases
qeth issues a message, but the mentioned MAC-address is not the
new MAC-address to be set, but the actual MAC-address. This patch
chooses now the new MAC-address to be set for the error messages.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetfilter: ipset: send error message manually
Jozsef Kadlecsik [Wed, 2 Feb 2011 22:56:00 +0000 (23:56 +0100)]
netfilter: ipset: send error message manually

When a message carries multiple commands and one of them triggers
an error, we have to report to the userspace which one was that.
The line number of the command plays this role and there's an attribute
reserved in the header part of the message to be filled out with the error
line number. In order not to modify the original message received from
the userspace, we construct a new, complete netlink error message and
modifies the attribute there, then send it.
Netlink is notified not to send its ACK/error message.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agogro: reset skb_iif on reuse
Andy Gospodarek [Wed, 2 Feb 2011 22:53:25 +0000 (14:53 -0800)]
gro: reset skb_iif on reuse

Like Herbert's change from a few days ago:

66c46d741e2e60f0e8b625b80edb0ab820c46d7a gro: Reset dev pointer on reuse

this may not be necessary at this point, but we should still clean up
the skb->skb_iif.  If not we may end up with an invalid valid for
skb->skb_iif when the skb is reused and the check is done in
__netif_receive_skb.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetfilter: ipset: fix linking with CONFIG_IPV6=n
Patrick McHardy [Wed, 2 Feb 2011 22:50:01 +0000 (23:50 +0100)]
netfilter: ipset: fix linking with CONFIG_IPV6=n

Add a dummy ip_set_get_ip6_port function that unconditionally
returns false for CONFIG_IPV6=n and convert the real function
to ipv6_skip_exthdr() to avoid pulling in the ip6_tables module
when loading ipset.

Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agomac80211: fix TX status cookie in HW offload case
Johannes Berg [Wed, 2 Feb 2011 15:58:06 +0000 (16:58 +0100)]
mac80211: fix TX status cookie in HW offload case

When the off-channel TX is done with remain-on-channel
offloaded to hardware, the reported cookie is wrong as
in that case we shouldn't use the SKB as the cookie but
need to instead use the corresponding r-o-c cookie
(XOR'ed with 2 to prevent API mismatches).

Fix this by keeping track of the hw_roc_skb pointer
just for the status processing and use the correct
cookie to report in this case. We can't use the
hw_roc_skb pointer itself because it is NULL'ed when
the frame is transmitted to prevent it being used
twice.

This fixes a bug where the P2P state machine in the
supplicant gets stuck because it never gets a correct
result for its transmitted frame.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlagn: overwrite EEPROM chain setting for 6250 devices
Wey-Yi Guy [Mon, 31 Jan 2011 21:56:03 +0000 (13:56 -0800)]
iwlagn: overwrite EEPROM chain setting for 6250 devices

6250 2x2 devices have 2 tx chain and 2 rx chain. For some reason,
the EEPROM contain incorrect information and indicate it only has single
tx chain. overwrite it with .cfg parameter to make sure both chain 'A' and
chain 'B' can be used for transmit and receive

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonetfilter: ipset: add missing break statemtns in ip_set_get_ip_port()
Patrick McHardy [Wed, 2 Feb 2011 08:31:37 +0000 (09:31 +0100)]
netfilter: ipset: add missing break statemtns in ip_set_get_ip_port()

Don't fall through in the switch statement, otherwise IPv4 headers
are incorrectly parsed again as IPv6 and the return value will always
be 'false'.

Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agobe2net: remove netif_stop_queue being called before register_netdev.
Ajit Khaparde [Tue, 1 Feb 2011 23:41:59 +0000 (15:41 -0800)]
be2net: remove netif_stop_queue being called before register_netdev.

It is illegal to call netif_stop_queue before register_netdev.

Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobe2net: fix a crash seen during insmod/rmmod test
Ajit Khaparde [Tue, 1 Feb 2011 23:41:13 +0000 (15:41 -0800)]
be2net: fix a crash seen during insmod/rmmod test

While running insmod/rmood in a loop, an unnecessary netif_stop_queue
causes the system to crash. Remove the netif_stop_queue call
and netif_start_queue in the link status update path.

Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Rename fib_hash_* locals in fib_semantics.c
David S. Miller [Tue, 1 Feb 2011 23:34:21 +0000 (15:34 -0800)]
ipv4: Rename fib_hash_* locals in fib_semantics.c

To avoid confusion with the recently deleted fib_hash.c
code, use "fib_info_hash_*" instead of plain "fib_hash_*".

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Update some fib_hash centric interface names.
David S. Miller [Tue, 1 Feb 2011 23:30:56 +0000 (15:30 -0800)]
ipv4: Update some fib_hash centric interface names.

fib_hash_init() --> fib_trie_init()
fib_hash_table() --> fib_trie_table()

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Remove fib_hash.
David S. Miller [Tue, 1 Feb 2011 23:15:39 +0000 (15:15 -0800)]
ipv4: Remove fib_hash.

The time has finally come to remove the hash based routing table
implementation in ipv4.

FIB Trie is mature, well tested, and I've done an audit of it's code
to confirm that it implements insert, delete, and lookup with the same
identical semantics as fib_hash did.

If there are any semantic differences found in fib_trie, we should
simply fix them.

I've placed the trie statistic config option under advanced router
configuration.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
13 years agoisdn: icn: Fix potentially wrong string handling
Stefan Weil [Sun, 30 Jan 2011 10:31:26 +0000 (10:31 +0000)]
isdn: icn: Fix potentially wrong string handling

This warning was reported by cppcheck:
drivers/isdn/icn/icn.c:1641: error: Dangerous usage of 'rev' (strncpy doesn't always 0-terminate it)

If strncpy copied 20 bytes, the destination string rev was not terminated.
The patch adds one more byte to rev and makes sure that this byte is
always 0.

Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Tejun Heo <tj@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: multicasts in NPAR mode
Vladislav Zolotarov [Tue, 1 Feb 2011 22:05:30 +0000 (14:05 -0800)]
bnx2x: multicasts in NPAR mode

The chip was erroneously configured to accept all multicast frames
in a normal (none-promisc) rx mode both on the RSS and on the FCoE L2 rings
when in an NPAR mode. This caused packet duplication for every received multicast
frame in this mode.

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodepca: Fix warnings
Alan Cox [Tue, 1 Feb 2011 21:19:07 +0000 (13:19 -0800)]
depca: Fix warnings

Replace the rather weird use of ++ with + 1 as the value is being assigned

Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Tue, 1 Feb 2011 21:08:59 +0000 (13:08 -0800)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

13 years agoMerge branch 'vhost-net' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
David S. Miller [Tue, 1 Feb 2011 20:56:11 +0000 (12:56 -0800)]
Merge branch 'vhost-net' of git://git./linux/kernel/git/mst/vhost

13 years agovxge: Fix wrong boolean operator
Stefan Weil [Fri, 28 Jan 2011 12:30:17 +0000 (12:30 +0000)]
vxge: Fix wrong boolean operator

This error is reported by cppcheck:
drivers/net/vxge/vxge-config.c:3693: warning: Mutual exclusion over || always evaluates to true. Did you intend to use && instead?

It looks like cppcheck is correct, so fix this. No test was run.

Cc: Ramkrishna Vepa <ramkrishna.vepa@exar.com>
Cc: Sivakumar Subramani <sivakumar.subramani@exar.com>
Cc: Sreenivasa Honnur <sreenivasa.honnur@exar.com>
Cc: Jon Mason <jon.mason@exar.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Acked-by: Ram Vepa <ram.vepa@exar.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetfilter: ipset: install ipset related header files
Patrick McHardy [Tue, 1 Feb 2011 17:52:42 +0000 (18:52 +0100)]
netfilter: ipset: install ipset related header files

Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agoIPVS: Remove ip_vs_sync_cleanup from section __exit
Simon Horman [Tue, 1 Feb 2011 17:30:26 +0000 (18:30 +0100)]
IPVS: Remove ip_vs_sync_cleanup from section __exit

ip_vs_sync_cleanup() may be called from ip_vs_init() on error
and thus needs to be accesible from section __init

Reporte-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Hans Schillstrom <hans@schillstrom.com>
Tested-by: Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agoIPVS: Allow compilation with CONFIG_SYSCTL disabled
Simon Horman [Tue, 1 Feb 2011 17:29:04 +0000 (18:29 +0100)]
IPVS: Allow compilation with CONFIG_SYSCTL disabled

This is a rather naieve approach to allowing PVS to compile with
CONFIG_SYSCTL disabled.  I am working on a more comprehensive patch which
will remove compilation of all sysctl-related IPVS code when CONFIG_SYSCTL
is disabled.

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Hans Schillstrom <hans@schillstrom.com>
Tested-by: Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agoIPVS: Remove unused variables
Simon Horman [Tue, 1 Feb 2011 17:27:51 +0000 (18:27 +0100)]
IPVS: Remove unused variables

These variables are unused as a result of the recent netns work.

Signed-off-by: Simon Horman <horms@verge.net.au>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Hans Schillstrom <hans@schillstrom.com>
Tested-by: Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agoIPVS: remove duplicate initialisation or rs_table
Simon Horman [Tue, 1 Feb 2011 17:24:09 +0000 (18:24 +0100)]
IPVS: remove duplicate initialisation or rs_table

Signed-off-by: Simon Horman <horms@verge.net.au>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Hans Schillstrom <hans@schillstrom.com>
Tested-by: Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agoIPVS: use z modifier for sizeof() argument
Simon Horman [Tue, 1 Feb 2011 17:21:53 +0000 (18:21 +0100)]
IPVS: use z modifier for sizeof() argument

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Hans Schillstrom <hans@schillstrom.com>
Tested-by: Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Tue, 1 Feb 2011 17:01:27 +0000 (12:01 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

Conflicts:
drivers/net/wireless/wl12xx/spi.c

13 years agonetfilter: ctnetlink: fix ctnetlink_parse_tuple() warning
Patrick McHardy [Tue, 1 Feb 2011 16:26:37 +0000 (17:26 +0100)]
netfilter: ctnetlink: fix ctnetlink_parse_tuple() warning

net/netfilter/nf_conntrack_netlink.c: In function 'ctnetlink_parse_tuple':
net/netfilter/nf_conntrack_netlink.c:832:11: warning: comparison between 'enum ctattr_tuple' and 'enum ctattr_type'

Use ctattr_type for the 'type' parameter since that's the type of all attributes
passed to this function.

Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agoath9k: Fix memory leak due to failed PAPRD frames
Mohammed Shafi Shajakhan [Mon, 31 Jan 2011 07:55:29 +0000 (13:25 +0530)]
ath9k: Fix memory leak due to failed PAPRD frames

free the skb's when the Tx of PAPRD frames fails and also add a debug
message indicating that.

Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonetfilter: ipset: remove unnecessary includes
Patrick McHardy [Tue, 1 Feb 2011 15:57:37 +0000 (16:57 +0100)]
netfilter: ipset: remove unnecessary includes

None of the set types need uaccess.h since this is handled centrally
in ip_set_core. Most set types additionally don't need bitops.h and
spinlock.h since they use neither. tcp.h is only needed by those
using before(), udp.h is not needed at all.

Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: ipset: use nla_parse_nested()
Patrick McHardy [Tue, 1 Feb 2011 15:27:25 +0000 (16:27 +0100)]
netfilter: ipset: use nla_parse_nested()

Replace calls of the form:

nla_parse(tb, ATTR_MAX, nla_data(attr), nla_len(attr), policy)

by:

nla_parse_nested(tb, ATTR_MAX, attr, policy)

Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: ecache: always set events bits, filter them later
Pablo Neira Ayuso [Tue, 1 Feb 2011 15:06:30 +0000 (16:06 +0100)]
netfilter: ecache: always set events bits, filter them later

For the following rule:

iptables -I PREROUTING -t raw -j CT --ctevents assured

The event delivered looks like the following:

 [UPDATE] tcp      6 src=192.168.0.2 dst=192.168.1.2 sport=37041 dport=80 src=192.168.1.2 dst=192.168.1.100 sport=80 dport=37041 [ASSURED]

Note that the TCP protocol state is not included. For that reason
the CT event filtering is not very useful for conntrackd.

To resolve this issue, instead of conditionally setting the CT events
bits based on the ctmask, we always set them and perform the filtering
in the late stage, just before the delivery.

Thus, the event delivered looks like the following:

 [UPDATE] tcp      6 432000 ESTABLISHED src=192.168.0.2 dst=192.168.1.2 sport=37041 dport=80 src=192.168.1.2 dst=192.168.1.100 sport=80 dport=37041 [ASSURED]

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: arpt_mangle: fix return values of checkentry
Pablo Neira Ayuso [Tue, 1 Feb 2011 15:03:46 +0000 (16:03 +0100)]
netfilter: arpt_mangle: fix return values of checkentry

In 135367b "netfilter: xtables: change xt_target.checkentry return type",
the type returned by checkentry was changed from boolean to int, but the
return values where not adjusted.

arptables: Input/output error

This broke arptables with the mangle target since it returns true
under success, which is interpreted by xtables as >0, thus
returning EIO.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: xtables: "set" match and "SET" target support
Jozsef Kadlecsik [Tue, 1 Feb 2011 14:56:00 +0000 (15:56 +0100)]
netfilter: xtables: "set" match and "SET" target support

The patch adds the combined module of the "SET" target and "set" match
to netfilter. Both the previous and the current revisions are supported.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: ipset: list:set set type support
Jozsef Kadlecsik [Tue, 1 Feb 2011 14:54:59 +0000 (15:54 +0100)]
netfilter: ipset: list:set set type support

The module implements the list:set type support in two flavours:
without and with timeout. The sets has two sides: for the userspace,
they store the names of other (non list:set type of) sets: one can add,
delete and test set names. For the kernel, it forms an ordered union of
the member sets: the members sets are tried in order when elements are
added, deleted and tested and the process stops at the first success.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: ipset: hash:net,port set type support
Jozsef Kadlecsik [Tue, 1 Feb 2011 14:53:55 +0000 (15:53 +0100)]
netfilter: ipset: hash:net,port set type support

The module implements the hash:net,port type support in four flavours:
for IPv4 and IPv6, both without and with timeout support. The elements
are two dimensional: IPv4/IPv6 network address/prefix and protocol/port
pairs.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: ipset: hash:net set type support
Jozsef Kadlecsik [Tue, 1 Feb 2011 14:52:54 +0000 (15:52 +0100)]
netfilter: ipset: hash:net set type support

The module implements the hash:net type support in four flavours:
for IPv4 and IPv6, both without and with timeout support. The elements
are one dimensional: IPv4/IPv6 network address/prefixes.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: ipset: hash:ip,port,net set type support
Jozsef Kadlecsik [Tue, 1 Feb 2011 14:51:00 +0000 (15:51 +0100)]
netfilter: ipset: hash:ip,port,net set type support

The module implements the hash:ip,port,net type support in four flavours:
for IPv4 and IPv6, both without and with timeout support. The elements
are three dimensional: IPv4/IPv6 address, protocol/port and IPv4/IPv6
network address/prefix triples. The different prefixes are searched/matched
from the longest prefix to the shortes one (most specific to least).
In other words the processing time linearly grows with the number of
different prefixes in the set.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agovhost: rcu annotation fixup
Michael S. Tsirkin [Tue, 18 Jan 2011 11:04:43 +0000 (13:04 +0200)]
vhost: rcu annotation fixup

When built with rcu checks enabled, vhost triggers
bogus warnings as vhost features are read without
dev->mutex sometimes, and private pointer is read
with our kind of rcu where work serves as a
read side critical section.

Fixing it properly is not trivial.
Disable the warnings by stubbing out the checks for now.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agonetfilter: ipset: hash:ip,port,ip set type support
Jozsef Kadlecsik [Tue, 1 Feb 2011 14:41:26 +0000 (15:41 +0100)]
netfilter: ipset: hash:ip,port,ip set type support

The module implements the hash:ip,port,ip type support in four flavours:
for IPv4 and IPv6, both without and with timeout support. The elements
are three dimensional: IPv4/IPv6 address, protocol/port and IPv4/IPv6
address triples.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: ipset: hash:ip,port set type support
Jozsef Kadlecsik [Tue, 1 Feb 2011 14:39:52 +0000 (15:39 +0100)]
netfilter: ipset: hash:ip,port set type support

The module implements the hash:ip,port type support in four flavours:
for IPv4 and IPv6, both without and with timeout support. The elements
are two dimensional: IPv4/IPv6 address and protocol/port pairs. The port
is interpeted for TCP, UPD, ICMP and ICMPv6 (at the latters as type/code
of course).

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: ipset: hash:ip set type support
Jozsef Kadlecsik [Tue, 1 Feb 2011 14:38:36 +0000 (15:38 +0100)]
netfilter: ipset: hash:ip set type support

The module implements the hash:ip type support in four flavours:
for IPv4 or IPv6, both without and with timeout support.

All the hash types are based on the "array hash" or ahash structure
and functions as a good compromise between minimal memory footprint
and speed. The hashing uses arrays to resolve clashes. The hash table
is resized (doubled) when searching becomes too long. Resizing can be
triggered by userspace add commands only and those are serialized by
the nfnl mutex. During resizing the set is read-locked, so the only
possible concurrent operations are the kernel side readers. Those are
protected by RCU locking.

Because of the four flavours and the other hash types, the functions
are implemented in general forms in the ip_set_ahash.h header file
and the real functions are generated before compiling by macro expansion.
Thus the dereferencing of low-level functions and void pointer arguments
could be avoided: the low-level functions are inlined, the function
arguments are pointers of type-specific structures.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: ipset; bitmap:port set type support
Jozsef Kadlecsik [Tue, 1 Feb 2011 14:37:04 +0000 (15:37 +0100)]
netfilter: ipset; bitmap:port set type support

The module implements the bitmap:port type in two flavours, without
and with timeout support to store TCP/UDP ports from a range.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: ipset: bitmap:ip,mac type support
Jozsef Kadlecsik [Tue, 1 Feb 2011 14:35:12 +0000 (15:35 +0100)]
netfilter: ipset: bitmap:ip,mac type support

The module implements the bitmap:ip,mac set type in two flavours,
without and with timeout support. In this kind of set one can store
IPv4 address and (source) MAC address pairs. The type supports elements
added without the MAC part filled out: when the first matching from kernel
happens, the MAC part is automatically filled out. The timing out of the
elements stars when an element is complete in the IP,MAC pair.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: ipset: bitmap:ip set type support
Jozsef Kadlecsik [Tue, 1 Feb 2011 14:33:17 +0000 (15:33 +0100)]
netfilter: ipset: bitmap:ip set type support

The module implements the bitmap:ip set type in two flavours, without
and with timeout support. In this kind of set one can store IPv4
addresses (or network addresses) from a given range.

In order not to waste memory, the timeout version does not rely on
the kernel timer for every element to be timed out but on garbage
collection. All set types use this mechanism.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: ipset: IP set core support
Jozsef Kadlecsik [Tue, 1 Feb 2011 14:28:35 +0000 (15:28 +0100)]
netfilter: ipset: IP set core support

The patch adds the IP set core support to the kernel.

The IP set core implements a netlink (nfnetlink) based protocol by which
one can create, destroy, flush, rename, swap, list, save, restore sets,
and add, delete, test elements from userspace. For simplicity (and backward
compatibilty and for not to force ip(6)tables to be linked with a netlink
library) reasons a small getsockopt-based protocol is also kept in order
to communicate with the ip(6)tables match and target.

The netlink protocol passes all u16, etc values in network order with
NLA_F_NET_BYTEORDER flag. The protocol enforces the proper use of the
NLA_F_NESTED and NLA_F_NET_BYTEORDER flags.

For other kernel subsystems (netfilter match and target) the API contains
the functions to add, delete and test elements in sets and the required calls
to get/put refereces to the sets before those operations can be performed.

The set types (which are implemented in independent modules) are stored
in a simple RCU protected list. A set type may have variants: for example
without timeout or with timeout support, for IPv4 or for IPv6. The sets
(i.e. the pointers to the sets) are stored in an array. The sets are
identified by their index in the array, which makes possible easy and
fast swapping of sets. The array is protected indirectly by the nfnl
mutex from nfnetlink. The content of the sets are protected by the rwlock
of the set.

There are functional differences between the add/del/test functions
for the kernel and userspace:

- kernel add/del/test: works on the current packet (i.e. one element)
- kernel test: may trigger an "add" operation  in order to fill
  out unspecified parts of the element from the packet (like MAC address)
- userspace add/del: works on the netlink message and thus possibly
  on multiple elements from the IPSET_ATTR_ADT container attribute.
- userspace add: may trigger resizing of a set

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: NFNL_SUBSYS_IPSET id and NLA_PUT_NET* macros
Jozsef Kadlecsik [Tue, 1 Feb 2011 14:20:14 +0000 (15:20 +0100)]
netfilter: NFNL_SUBSYS_IPSET id and NLA_PUT_NET* macros

The patch adds the NFNL_SUBSYS_IPSET id and NLA_PUT_NET* macros to the
vanilla kernel.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agoenc28j60: Fix reading of transmit status vector
Stefan Weil [Tue, 1 Feb 2011 04:56:54 +0000 (20:56 -0800)]
enc28j60: Fix reading of transmit status vector

This error was reported by cppcheck:
drivers/net/enc28j60.c:815: error: Using sizeof for array given as function argument returns the size of pointer.

The original code reads 4 or 8 bytes instead of TSV_SIZE (= 100) bytes.
I just fixed the code, but did not run any tests.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: Fix ipv6 neighbour unregister_sysctl_table warning
Eric W. Biederman [Tue, 1 Feb 2011 04:54:17 +0000 (20:54 -0800)]
net: Fix ipv6 neighbour unregister_sysctl_table warning

In my testing of 2.6.37 I was occassionally getting a warning about
sysctl table entries being unregistered in the wrong order.  Digging
in it turns out this dates back to the last great sysctl reorg done
where Al Viro introduced the requirement that sysctl directories
needed to be created before and destroyed after the files in them.

It turns out that in that great reorg /proc/sys/net/ipv6/neigh was
overlooked.  So this patch fixes that oversight and makes an annoying
warning message go away.

>------------[ cut here ]------------
>WARNING: at kernel/sysctl.c:1992 unregister_sysctl_table+0x134/0x164()
>Pid: 23951, comm: kworker/u:3 Not tainted 2.6.37-350888.2010AroraKernelBeta.fc14.x86_64 #1
>Call Trace:
> [<ffffffff8103e034>] warn_slowpath_common+0x80/0x98
> [<ffffffff8103e061>] warn_slowpath_null+0x15/0x17
> [<ffffffff810452f8>] unregister_sysctl_table+0x134/0x164
> [<ffffffff810e7834>] ? kfree+0xc4/0xd1
> [<ffffffff813439b2>] neigh_sysctl_unregister+0x22/0x3a
> [<ffffffffa02cd14e>] addrconf_ifdown+0x33f/0x37b [ipv6]
> [<ffffffff81331ec2>] ? skb_dequeue+0x5f/0x6b
> [<ffffffffa02ce4a5>] addrconf_notify+0x69b/0x75c [ipv6]
> [<ffffffffa02eb953>] ? ip6mr_device_event+0x98/0xa9 [ipv6]
> [<ffffffff813d2413>] notifier_call_chain+0x32/0x5e
> [<ffffffff8105bdea>] raw_notifier_call_chain+0xf/0x11
> [<ffffffff8133cdac>] call_netdevice_notifiers+0x45/0x4a
> [<ffffffff8133d2b0>] rollback_registered_many+0x118/0x201
> [<ffffffff8133d3af>] unregister_netdevice_many+0x16/0x6d
> [<ffffffff8133d571>] default_device_exit_batch+0xa4/0xb8
> [<ffffffff81337c42>] ? cleanup_net+0x0/0x194
> [<ffffffff81337a2a>] ops_exit_list+0x4e/0x56
> [<ffffffff81337d36>] cleanup_net+0xf4/0x194
> [<ffffffff81053318>] process_one_work+0x187/0x280
> [<ffffffff8105441b>] worker_thread+0xff/0x19f
> [<ffffffff8105431c>] ? worker_thread+0x0/0x19f
> [<ffffffff8105776d>] kthread+0x7d/0x85
> [<ffffffff81003824>] kernel_thread_helper+0x4/0x10
> [<ffffffff810576f0>] ? kthread+0x0/0x85
> [<ffffffff81003820>] ? kernel_thread_helper+0x0/0x10
>---[ end trace 8a7e9310b35e9486 ]---

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoaxnet_cs: reduce delay time at ei_rx_overrun
Ken Kawasaki [Sun, 30 Jan 2011 11:16:16 +0000 (11:16 +0000)]
axnet_cs: reduce delay time at ei_rx_overrun

axnet_cs:
    mdelay of 10ms is too long at ei_rx_overrun.
    It should be reduced to 2ms.

Signed-off-by: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x, cnic: Consolidate iSCSI/FCoE shared mem logic in bnx2x
Vladislav Zolotarov [Mon, 31 Jan 2011 14:39:17 +0000 (14:39 +0000)]
bnx2x, cnic: Consolidate iSCSI/FCoE shared mem logic in bnx2x

Move all shared mem code to bnx2x to avoid code duplication.  bnx2x now
performs:

- Read the FCoE and iSCSI max connection information.
- Read the iSCSI and FCoE MACs from NPAR configuration in shmem.
- Block the CNIC for the current function if there is neither FCoE nor
  iSCSI valid configuration by returning NULL from bnx2x_cnic_probe().

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: Check rps_flow_table when RPS map length is 1
Tom Herbert [Tue, 1 Feb 2011 00:23:42 +0000 (16:23 -0800)]
net: Check rps_flow_table when RPS map length is 1

In get_rps_cpu, add check that the rps_flow_table for the device is
NULL when trying to take fast path when RPS map length is one.
Without this, RFS is effectively disabled if map length is one which
is not correct.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Consolidate all default route selection implementations.
David S. Miller [Tue, 1 Feb 2011 00:16:50 +0000 (16:16 -0800)]
ipv4: Consolidate all default route selection implementations.

Both fib_trie and fib_hash have a local implementation of
fib_table_select_default().  This is completely unnecessary
code duplication.

Since we now remember the fib_table and the head of the fib
alias list of the default route, we can implement one single
generic version of this routine.

Looking at the fib_hash implementation you may get the impression
that it's possible for there to be multiple top-level routes in
the table for the default route.  The truth is, it isn't, the
insert code will only allow one entry to exist in the zero
prefix hash table, because all keys evaluate to zero and all
keys in a hash table must be unique.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Remember FIB alias list head and table in lookup results.
David S. Miller [Tue, 1 Feb 2011 00:10:03 +0000 (16:10 -0800)]
ipv4: Remember FIB alias list head and table in lookup results.

This will be used later to implement fib_select_default() in a
completely generic manner, instead of the current situation where the
default route is re-looked up in the TRIE/HASH table and then the
available aliases are analyzed.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-merge
David S. Miller [Mon, 31 Jan 2011 21:24:56 +0000 (13:24 -0800)]
Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-merge

13 years agobnx2x: Update bnx2x version to 1.62.11-0
Yaniv Rosner [Mon, 31 Jan 2011 04:22:57 +0000 (04:22 +0000)]
bnx2x: Update bnx2x version to 1.62.11-0

Update bnx2x version to 1.62.11-0

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Remove support for emulation/FPGA
Yaniv Rosner [Mon, 31 Jan 2011 04:22:53 +0000 (04:22 +0000)]
bnx2x: Remove support for emulation/FPGA

Remove unneeded support for emulation/FPGA from the code

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>