safe/jmp/linux-2.6
14 years agodrivers/net: Correct NULL test
Julia Lawall [Tue, 9 Feb 2010 06:44:18 +0000 (22:44 -0800)]
drivers/net: Correct NULL test

Test the value that was just allocated rather than the previously tested one.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r@
expression *x;
expression e;
identifier l;
@@

if (x == NULL || ...) {
    ... when forall
    return ...; }
... when != goto l;
    when != x = e
    when != &x
*x == NULL
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMAINTAINERS: networking drivers - Add git net-next tree
Joe Perches [Tue, 9 Feb 2010 06:42:40 +0000 (22:42 -0800)]
MAINTAINERS: networking drivers - Add git net-next tree

During the rc period, patches that are not bugfixes
should be done using the net-next tree.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/sched: Fix module name in Kconfig
Jan Luebbe [Tue, 9 Feb 2010 06:41:44 +0000 (22:41 -0800)]
net/sched: Fix module name in Kconfig

The action modules have been prefixed with 'act_', but the Kconfig
description was not changed.

Signed-off-by: Jan Luebbe <jluebbe@debian.org>
Acked-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocxgb3: fix GRO checksum check
Divy Le Ray [Tue, 9 Feb 2010 06:37:24 +0000 (22:37 -0800)]
cxgb3: fix GRO checksum check

Verify the HW checksum state for frames handed to GRO processing.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodst: call cond_resched() in dst_gc_task()
Eric Dumazet [Mon, 8 Feb 2010 23:00:39 +0000 (15:00 -0800)]
dst: call cond_resched() in dst_gc_task()

Kernel bugzilla #15239

On some workloads, it is quite possible to get a huge dst list to
process in dst_gc_task(), and trigger soft lockup detection.

Fix is to call cond_resched(), as we run in process context.

Reported-by: Pawel Staszewski <pstaszewski@itcare.pl>
Tested-by: Pawel Staszewski <pstaszewski@itcare.pl>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agomac80211: Reset dynamic ps timer in Rx path.
Vivek Natarajan [Mon, 8 Feb 2010 12:17:01 +0000 (17:47 +0530)]
mac80211: Reset dynamic ps timer in Rx path.

The current mac80211 implementation enables power save if there
is no Tx traffic for a specific timeout. Hence, PS is triggered
even if there is a continuous Rx only traffic(like UDP) going on.
This makes the drivers to wait on the tim bit in the next beacon
to awake which leads to redundant sleep-wake cycles.
Fix this by restarting the dynamic ps timer on receiving every
data packet.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
CC: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: make rate_control_alloc static
Andres Salomon [Mon, 8 Feb 2010 02:47:50 +0000 (21:47 -0500)]
mac80211: make rate_control_alloc static

rate_control_alloc is not used by anything outside of
ieee80211_init_rate_ctrl_alg.  Both are in rate.c; there's no reason to make
rate_control_alloc visible outside of it.

Signed-off-by: Andres Salomon <dilinger@collabora.co.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath: fix WARN_ON with Polish (Poland) Contry code
Christian Lamparter [Sun, 7 Feb 2010 15:01:55 +0000 (16:01 +0100)]
ath: fix WARN_ON with Polish (Poland) Contry code

This patch fixes a WARN_ON which is triggered
by Poland's country code.

ath: EEPROM regdomain: 0x8268
ath: EEPROM indicates we should expect a country code
ath: doing EEPROM country->regdmn map search
ath: country maps to regdmn code: 0x37
ath: Country alpha2 being used: PL
ath: Regpair used: 0x37
  -----------[ cut here ]------------
WARNING: at drivers/net/wireless/ath/regd.c:155 ath_regd_init+0x30b
Pid: 12661, comm: firmware/carl91 2.6.33-rc5-wl #18
Call Trace:
 [<>] ? warn_slowpath_common+0x76/0x8c
 [<>] ? ar9170_reg_notifier+0x0/0x2d [carl9170usb]
 [<>] ? ath_regd_init+0x30b/0x377 [ath]
 [<>] ? ar9170_register+0x3b3/0x3ca [carl9170usb]
[...]
---[ end trace ]---

Note: Poland is just an example. But it is very likely
that more country codes are affected.

Cc: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: remove get_tx_stats() driver op
Kalle Valo [Sun, 7 Feb 2010 08:22:01 +0000 (10:22 +0200)]
mac80211: remove get_tx_stats() driver op

get_tx_stats() driver operation is not currently used anywhere in mac80211
and there are no plans to use it in the not-so-near future. So it can go
without anyone missing it.

Signed-off-by: Kalle Valo <kalle.valo@iki.fi>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: remove get_tx_stats() mac80211 op
Kalle Valo [Sun, 7 Feb 2010 08:21:53 +0000 (10:21 +0200)]
rt2x00: remove get_tx_stats() mac80211 op

get_tx_stats() will be removed from mac80211.

Compile-tested only.

Signed-off-by: Kalle Valo <kalle.valo@iki.fi>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agop54: remove get_tx_stats() mac80211 op
Kalle Valo [Sun, 7 Feb 2010 08:21:46 +0000 (10:21 +0200)]
p54: remove get_tx_stats() mac80211 op

get_tx_stats() will be removed from mac80211.

p54 uses struct ieee80211_tx_queue_stats also internally, so create a new
identical struct p54_tx_queue_stats which the driver can use.

Compile-tested only.

Signed-off-by: Kalle Valo <kalle.valo@iki.fi>
Tested-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: remove get_tx_stats() mac80211 op
Kalle Valo [Sun, 7 Feb 2010 08:21:37 +0000 (10:21 +0200)]
iwlwifi: remove get_tx_stats() mac80211 op

get_tx_stats() will be removed from mac80211.

Compile-tested only.

Cc: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Kalle Valo <kalle.valo@iki.fi>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43legacy: remove get_tx_stats() mac80211 op
Kalle Valo [Sun, 7 Feb 2010 17:51:00 +0000 (19:51 +0200)]
b43legacy: remove get_tx_stats() mac80211 op

get_tx_stats() will be removed from mac80211.

Compile-tested only.

Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stefano Brivio <stefano.brivio@polimi.it>
Signed-off-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43: remove get_tx_stats() mac80211 op
Kalle Valo [Sun, 7 Feb 2010 17:50:50 +0000 (19:50 +0200)]
b43: remove get_tx_stats() mac80211 op

get_tx_stats() will be removed from mac80211.

Compile-tested only.

Cc: Stefano Brivio <stefano.brivio@polimi.it>
Cc: Michael Buesch <mb@bu3sch.de>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath5k: remove get_tx_stats() mac80211 op
Kalle Valo [Sun, 7 Feb 2010 08:21:07 +0000 (10:21 +0200)]
ath5k: remove get_tx_stats() mac80211 op

get_tx_stats() will be removed from mac80211.

Compile-tested only.

Cc: Jiri Slaby <jirislaby@gmail.com>
Cc: Nick Kossifidis <mickflemm@gmail.com>
Cc: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Kalle Valo <kalle.valo@iki.fi>
Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoar9170: remove get_tx_stats() mac80211 op
Kalle Valo [Sun, 7 Feb 2010 08:21:00 +0000 (10:21 +0200)]
ar9170: remove get_tx_stats() mac80211 op

get_tx_stats() will be removed from mac80211.

Because ar9170 uses ieee80211_tx_queue_stats internally, create a new
identical struct ar9170_tx_queue_stats which the driver can use.

Compile-tested only.

Signed-off-by: Kalle Valo <kalle.valo@iki.fi>
Tested-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomwl8k: remove get_tx_stats() mac80211 op
Kalle Valo [Sun, 7 Feb 2010 08:20:52 +0000 (10:20 +0200)]
mwl8k: remove get_tx_stats() mac80211 op

get_tx_stats() will be removed from mac80211.

mwl8k used struct ieee80211_tx_queue_stats internally to track the queue
lenght. Replace struct ieee80211_tx_queue_stats with a simple len field
in struct mwl8k_tx_queue. Limit and count fields seemed to be unused.

Compile-tested only.

Cc: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoadm821: remove get_tx_stats() mac80211 op
Kalle Valo [Sun, 7 Feb 2010 08:20:44 +0000 (10:20 +0200)]
adm821: remove get_tx_stats() mac80211 op

get_tx_stats() will be removed from mac80211.

Compile-tested only.

Cc: Michael Wu <flamingice@sourmilk.net>
Signed-off-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: fix keycache leak in split tkip case
Ming Lei [Sat, 6 Feb 2010 14:38:23 +0000 (22:38 +0800)]
ath9k: fix keycache leak in split tkip case

If split tkip key is used, ath_delete_key should delete
rx key and rx mic key. This patch fixes the leak of hw
keycache in the case.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: fix deauth race
Johannes Berg [Sat, 6 Feb 2010 14:20:13 +0000 (15:20 +0100)]
mac80211: fix deauth race

When userspace requests a deauth while the
authentication work is pending in the auth
(not probe) state, we do not properly abort
the work and then things get confused.

Fix that and also improve the checks here
to include the correct virtual interface,
just in case two virtual interfaces would
ever try to connect to the same BSS.

Also fix a bug -- need to use list_del_rcu
instead of just list_del to free a work
item.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: Send broadcast probe request only when asked to
Samuel Ortiz [Fri, 5 Feb 2010 19:33:48 +0000 (11:33 -0800)]
iwlwifi: Send broadcast probe request only when asked to

When running directed active scans we currently end up sending both the SSID
probe requests and an additional broadcast one.
This is due to the fact that we always leave the probe request template SSID IE
length to 0. Instead we should set it to the first SSID to scan, and fill the
direct_scan array with the remaining SSIDs to scan for. This way we only send
what we've been asked to: a broadcast probe request when no directed scan is
requested, and directed probe requests otherwise.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: Add chain_noise support for 6050
Ben Cahill [Fri, 5 Feb 2010 19:33:47 +0000 (11:33 -0800)]
iwlwifi: Add chain_noise support for 6050

Existing iwl6050_ops->iwl6050_hcmd_utils structure had no pointers to chain
noise functions (gain_computation and chain_noise_reset).  As it turns out,
by adding chain_noise_scale (see related patch), there is no need for separate
chain noise function, so simply use iwl6000_ops->iwl5000_hcmd_utils, and
remove those for 6050.

Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: Add chain noise scaling factor
Ben Cahill [Fri, 5 Feb 2010 19:33:46 +0000 (11:33 -0800)]
iwlwifi: Add chain noise scaling factor

6x50 device requires a different scaling factor for Rx gain values sent to
device via PHY_CALIBRATION_CMD (CHAIN_NOISE_GAIN_CMD).  Rather than create
a new iwlXXXX_gain_computation() function, add new chain_noise_scale member
to struct iwl_cfg, and keep using iwl5000_gain_computation().

Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: fix bss_conf.dtim_period
Johannes Berg [Fri, 5 Feb 2010 10:45:06 +0000 (11:45 +0100)]
mac80211: fix bss_conf.dtim_period

In AP mode, the only mode where the parameter
is supposed to be valid, we never assign it!
Fix that to allow drivers to avoid parsing
the TIM IE for the value.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: Added a new debugfs file for reading channel_type
Benoit Papillault [Thu, 4 Feb 2010 21:00:20 +0000 (22:00 +0100)]
mac80211: Added a new debugfs file for reading channel_type

This file helps debugging HT channels since it displays if we are on
ht20 or ht40+/ht40-

Signed-off-by: Benoit Papillault <benoit.papillault@free.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: don't retry commands
Holger Schurig [Thu, 4 Feb 2010 13:37:45 +0000 (14:37 +0100)]
libertas: don't retry commands

Retrying commands seldomly works, most often the firmware is in a
weird state anyway and needs the device to reset. So it's better
to report the broken state back to user-space.

Also rename command_timer_fn() into lbs_cmd_timeout_handler(),
which better reflect it's usage.

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowl1251: fix txop unit
Kalle Valo [Thu, 4 Feb 2010 13:33:25 +0000 (15:33 +0200)]
wl1251: fix txop unit

mac80211 uses unit units of 32 usec with txop but wl1251_acx_ac_cfg()
expects it to be usecs. This fortunately didn't cause any severe problems,
only that firmware was using incorrect WMM settings.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43: N-PHY: handle allocation fail in samples generation
Rafał Miłecki [Thu, 4 Feb 2010 12:11:54 +0000 (13:11 +0100)]
b43: N-PHY: handle allocation fail in samples generation

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43: N-PHY: load generated samples
Rafał Miłecki [Thu, 4 Feb 2010 12:08:08 +0000 (13:08 +0100)]
b43: N-PHY: load generated samples

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43: N-PHY: partly implement SPUR workaround
Rafał Miłecki [Thu, 4 Feb 2010 11:23:12 +0000 (12:23 +0100)]
b43: N-PHY: partly implement SPUR workaround

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43: N-PHY: save calibration for further restore
Rafał Miłecki [Thu, 4 Feb 2010 11:23:11 +0000 (12:23 +0100)]
b43: N-PHY: save calibration for further restore

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43: N-PHY: prepare code for reapplying TX cal coeffs
Rafał Miłecki [Thu, 4 Feb 2010 11:23:10 +0000 (12:23 +0100)]
b43: N-PHY: prepare code for reapplying TX cal coeffs

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43: N-PHY: implement overriding RF control intc
Rafał Miłecki [Thu, 4 Feb 2010 11:23:08 +0000 (12:23 +0100)]
b43: N-PHY: implement overriding RF control intc

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas/if_spi: needs linux/semaphore.h
Randy Dunlap [Wed, 3 Feb 2010 23:31:07 +0000 (15:31 -0800)]
libertas/if_spi: needs linux/semaphore.h

libertas/if_spi.c needs to #include linux/semaphore.h to fix build errors:

drivers/net/wireless/libertas/if_spi.c:59: error: field 'spi_ready' has incomplete type
drivers/net/wireless/libertas/if_spi.c:60: error: field 'spi_thread_terminated' has incomplete type
drivers/net/wireless/libertas/if_spi.c:785: error: implicit declaration of function 'down_interruptible'
drivers/net/wireless/libertas/if_spi.c:787: error: implicit declaration of function 'up'
drivers/net/wireless/libertas/if_spi.c:834: error: implicit declaration of function 'down'
drivers/net/wireless/libertas/if_spi.c:943: error: implicit declaration of function 'sema_init'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agossb: fix interrupt assignment
Jochen Friedrich [Wed, 3 Feb 2010 20:28:11 +0000 (21:28 +0100)]
ssb: fix interrupt assignment

Explicitely enable shared interrupt 2 for any core that didn't get a dedicated IRQ
anymore (fallthrough case) and for EXTIF cores to make gpio interrupts work.
Also remove a bogus comment.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43/b43legacy: Wake queues in wireless_core_start
Larry Finger [Wed, 3 Feb 2010 19:33:44 +0000 (13:33 -0600)]
b43/b43legacy: Wake queues in wireless_core_start

If b43 or b43legacy are deauthenticated or disconnected, there is a
possibility that a reconnection is tried with the queues stopped in
mac80211. To prevent this, start the queues before setting
STAT_INITIALIZED.

In b43, a similar change has been in place (twice) in the
wireless_core_init() routine. Remove the duplicate and add similar
code to b43legacy.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@kernel.org> [2.6.32]
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: tear down all agg queues when restart/reconfig hw
Wey-Yi Guy [Wed, 3 Feb 2010 17:28:55 +0000 (09:28 -0800)]
mac80211: tear down all agg queues when restart/reconfig hw

When there is a need to restart/reconfig hw, tear down all the
aggregation queues and let the mac80211 and driver get in-sync to have
the opportunity to re-establish the aggregation queues again.

Need to wait until driver re-establish all the station information before tear
down the aggregation queues, driver(at least iwlwifi driver) will reject the
stop aggregation queue request if station is not ready. But also need to make
sure the aggregation queues are tear down before waking up the queues, so
mac80211 will not sending frames with aggregation bit set.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Enable TIM timer interrupt only when needed.
Senthil Balasubramanian [Wed, 3 Feb 2010 17:21:13 +0000 (22:51 +0530)]
ath9k: Enable TIM timer interrupt only when needed.

The TIM timer interrupt is enabled even before the ACK of nullqos
is received which is unnecessary.

Also clean up the CONF_PS part of config callback properly for
better readability.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: configure the beacon only if the STA is associated
Senthil Balasubramanian [Wed, 3 Feb 2010 17:20:18 +0000 (22:50 +0530)]
ath9k: configure the beacon only if the STA is associated

beacons configuration SHOULD be done only if the STA is associated.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: allow station add/remove to sleep
Johannes Berg [Wed, 3 Feb 2010 12:59:58 +0000 (13:59 +0100)]
mac80211: allow station add/remove to sleep

Many drivers would like to sleep during station
addition and removal, and currently have a high
complexity there from not being able to.

This introduces two new callbacks sta_add() and
sta_remove() that drivers can implement instead
of using sta_notify() and that can sleep, and
the new sta_add() callback is also allowed to
fail.

The reason we didn't do this previously is that
the IBSS code wants to insert stations from the
RX path, which is a tasklet, so cannot sleep.
This patch will keep the station allocation in
that path, but moves adding the station to the
driver out of line. Since the addition can now
fail, we can have IBSS peer structs the driver
rejected -- in that case we still talk to the
station but never tell the driver about it in
the control.sta pointer. If there will ever be
a driver that has a low limit on the number of
stations and that cannot talk to any stations
that are not known to it, we need to do come up
with a new strategy of handling larger IBSSs,
maybe quicker expiry or rejecting peers.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: don't probe if we have probe response
Johannes Berg [Wed, 3 Feb 2010 12:57:46 +0000 (13:57 +0100)]
mac80211: don't probe if we have probe response

We can now easily determine whether we already
have probe response information for the BSS we
are asked to connect to, in which case there's
little point in probing the BSS again.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowireless: update radiotap parser
Johannes Berg [Wed, 3 Feb 2010 09:24:30 +0000 (10:24 +0100)]
wireless: update radiotap parser

Upstream radiotap has adopted the namespace
proposal David Young made and I then took care
of, for which I had adapted the radiotap parser
as a library outside the kernel. This brings
the in-kernel parser up to speed.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211_hwsim: add fake hw scan handler
Johannes Berg [Wed, 3 Feb 2010 09:47:55 +0000 (10:47 +0100)]
mac80211_hwsim: add fake hw scan handler

For debugging hardware scan trigger/complete
functionality, it was useful to have code in
hwsim that pretends to do a hardware scan.

This code could be extended to actually do the
scan, but for now it was sufficient for me to
only pretend. Since hwsim was written to ease
debugging, it only makes sense to add it to it
permanently.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Mon, 8 Feb 2010 21:38:38 +0000 (16:38 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

Conflicts:
net/mac80211/scan.c

14 years agomac80211: fix deferred hardware scan requests
Johannes Berg [Wed, 3 Feb 2010 09:22:31 +0000 (10:22 +0100)]
mac80211: fix deferred hardware scan requests

Reinette found the reason for the warnings that
happened occasionally when a hw-offloaded scan
finished; her description of the problem:

  mac80211 will defer the handling of scan requests if it is
  busy with management work at the time. The scan requests
  are deferred and run after the work has completed. When
  this occurs there are currently two problems.

  * The scan request for hardware scan is not fully populated
    with the band and channels to scan not initialized.

  * When the scan is queued the state is not correctly updated
    to reflect that a scan is in progress. The problem here is
    that when the driver completes the scan and calls
    ieee80211_scan_completed() a warning will be triggered
    since mac80211 was not aware that a scan was in progress.

The reason is that the queued scan work will start
the hw scan right away when the hw_scan_req struct
has already been allocated. However, in the first
pass it will not have been filled, which happens
at the same time as setting the bits. To fix this,
simply move the allocation after the pending work
test as well, so that the first iteration of the
scan work will call __ieee80211_start_scan() even
in the hardware scan case.

Bug-identified-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: Fix to set correct ht configuration
Wey-Yi Guy [Fri, 5 Feb 2010 19:40:00 +0000 (11:40 -0800)]
iwlwifi: Fix to set correct ht configuration

iwl_set_rxon_ht() only get called in iwl_post_associate(); which cause
possible incorrect ht configuration. Adding the call in iwl_mac_config() if
IEEE80211_CONF_CHANGE_CHANNEL flag is set to re-configure and send rxon
command.

Fixes
http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2146

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
CC: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: Fix probe request filtering in IBSS mode
Benoit Papillault [Fri, 5 Feb 2010 00:21:03 +0000 (01:21 +0100)]
mac80211: Fix probe request filtering in IBSS mode

We only reply to probe request if either the requested SSID is the
broadcast SSID or if the requested SSID matches our own SSID. This
latter case was not properly handled since we were replying to different
SSID with the same length as our own SSID.

Signed-off-by: Benoit Papillault <benoit.papillault@free.fr>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agonetfilter: nf_conntrack: fix hash resizing with namespaces
Patrick McHardy [Mon, 8 Feb 2010 19:18:07 +0000 (11:18 -0800)]
netfilter: nf_conntrack: fix hash resizing with namespaces

As noticed by Jon Masters <jonathan@jonmasters.org>, the conntrack hash
size is global and not per namespace, but modifiable at runtime through
/sys/module/nf_conntrack/hashsize. Changing the hash size will only
resize the hash in the current namespace however, so other namespaces
will use an invalid hash size. This can cause crashes when enlarging
the hashsize, or false negative lookups when shrinking it.

Move the hash size into the per-namespace data and only use the global
hash size to initialize the per-namespace value when instanciating a
new namespace. Additionally restrict hash resizing to init_net for
now as other namespaces are not handled currently.

Cc: stable@kernel.org
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetfilter: xtables: compat out of scope fix
Alexey Dobriyan [Mon, 8 Feb 2010 19:17:43 +0000 (11:17 -0800)]
netfilter: xtables: compat out of scope fix

As per C99 6.2.4(2) when temporary table data goes out of scope,
the behaviour is undefined:

if (compat) {
struct foo tmp;
...
private = &tmp;
}
[dereference private]

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: nf_conntrack: restrict runtime expect hashsize modifications
Alexey Dobriyan [Mon, 8 Feb 2010 19:17:22 +0000 (11:17 -0800)]
netfilter: nf_conntrack: restrict runtime expect hashsize modifications

Expectation hashtable size was simply glued to a variable with no code
to rehash expectations, so it was a bug to allow writing to it.
Make "expect_hashsize" readonly.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: nf_conntrack: per netns nf_conntrack_cachep
Eric Dumazet [Mon, 8 Feb 2010 19:16:56 +0000 (11:16 -0800)]
netfilter: nf_conntrack: per netns nf_conntrack_cachep

nf_conntrack_cachep is currently shared by all netns instances, but
because of SLAB_DESTROY_BY_RCU special semantics, this is wrong.

If we use a shared slab cache, one object can instantly flight between
one hash table (netns ONE) to another one (netns TWO), and concurrent
reader (doing a lookup in netns ONE, 'finding' an object of netns TWO)
can be fooled without notice, because no RCU grace period has to be
observed between object freeing and its reuse.

We dont have this problem with UDP/TCP slab caches because TCP/UDP
hashtables are global to the machine (and each object has a pointer to
its netns).

If we use per netns conntrack hash tables, we also *must* use per netns
conntrack slab caches, to guarantee an object can not escape from one
namespace to another one.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
[Patrick: added unique slab name allocation]
Cc: stable@kernel.org
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: nf_conntrack: fix memory corruption with multiple namespaces
Patrick McHardy [Mon, 8 Feb 2010 19:16:26 +0000 (11:16 -0800)]
netfilter: nf_conntrack: fix memory corruption with multiple namespaces

As discovered by Jon Masters <jonathan@jonmasters.org>, the "untracked"
conntrack, which is located in the data section, might be accidentally
freed when a new namespace is instantiated while the untracked conntrack
is attached to a skb because the reference count it re-initialized.

The best fix would be to use a seperate untracked conntrack per
namespace since it includes a namespace pointer. Unfortunately this is
not possible without larger changes since the namespace is not easily
available everywhere we need it. For now move the untracked conntrack
initialization to the init_net setup function to make sure the reference
count is not re-initialized and handle cleanup in the init_net cleanup
function to make sure namespaces can exit properly while the untracked
conntrack is in use in other namespaces.

Cc: stable@kernel.org
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agopacket: Kill CONFIG_PACKET_MMAP.
David S. Miller [Sat, 6 Feb 2010 00:29:48 +0000 (16:29 -0800)]
packet: Kill CONFIG_PACKET_MMAP.

Early on this was an experimental facility that few
people other than Alexey Kuznetsov played with.

Now it's a pretty fundamental thing and as people add
more features to AF_PACKET sockets this config options
creates ifdef spaghetti.

So kill it off.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoBluetooth: Keep a copy of each HID device's report descriptor
Michael Poole [Fri, 5 Feb 2010 17:23:43 +0000 (12:23 -0500)]
Bluetooth: Keep a copy of each HID device's report descriptor

The report descriptor is read by user space (via the Service
Discovery Protocol), so it is only available during the ioctl
to connect. However, the HID probe function that needs the
descriptor might not be called until a specific module is
loaded. Keep a copy of the descriptor so it is available for
later use.

Signed-off-by: Michael Poole <mdpoole@troilus.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agonet: e1000e: convert to use mc helpers
Jiri Pirko [Fri, 5 Feb 2010 02:52:39 +0000 (02:52 +0000)]
net: e1000e: convert to use mc helpers

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: dm9601: convert to use mc helpers
Jiri Pirko [Fri, 5 Feb 2010 02:51:24 +0000 (02:51 +0000)]
net: dm9601: convert to use mc helpers

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: 8139too: convert to use mc helpers
Jiri Pirko [Fri, 5 Feb 2010 02:48:11 +0000 (02:48 +0000)]
net: 8139too: convert to use mc helpers

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: 8139cp: convert to use mc helpers
Jiri Pirko [Fri, 5 Feb 2010 02:47:28 +0000 (02:47 +0000)]
net: 8139cp: convert to use mc helpers

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoe1000e: Fix namespace conflicts wrt. e1000_has_link
David S. Miller [Fri, 5 Feb 2010 06:31:41 +0000 (22:31 -0800)]
e1000e: Fix namespace conflicts wrt. e1000_has_link

Reported by Stephen Rothwell.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobridge: Remove unused age_list
Herbert Xu [Fri, 5 Feb 2010 04:28:48 +0000 (20:28 -0800)]
bridge: Remove unused age_list

This patch removes the unused age_list member from the net_bridge
structure.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agopacket: Add GSO/csum offload support.
Sridhar Samudrala [Fri, 5 Feb 2010 04:24:10 +0000 (20:24 -0800)]
packet: Add GSO/csum offload support.

This patch adds GSO/checksum offload to af_packet sockets using
virtio_net_hdr. Based on Rusty's patch to add this support to tun.
It allows GSO/checksum offload to be enabled when using raw socket
backend with virtio_net.
Adds PACKET_VNET_HDR socket option to prepend virtio_net_hdr in the
receive path and process/skip virtio_net_hdr in the send path. This
option is only allowed with SOCK_RAW sockets attached to ethernet
type devices.

v2 updates
----------
Michael's Comments
- Perform length check in packet_snd() when GSO is off even when
  vnet_hdr is present.
- Check for SKB_GSO_FCOE type and return -EINVAL
- don't allow tx/rx ring when vnet_hdr is enabled.
Herbert's Comments
- Removed ethernet specific code.
- protocol value is assumed to be passed in by the caller.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqlge: Code clean up
Breno Leitao [Thu, 4 Feb 2010 10:11:19 +0000 (10:11 +0000)]
qlge: Code clean up

Just reordering this assignment that doesn't depend on any
condition.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqlge: removing unreachable block of code
Breno Leitao [Thu, 4 Feb 2010 10:11:18 +0000 (10:11 +0000)]
qlge: removing unreachable block of code

Currently the qlge_change_mtu() is never called if the new_mtu is
equal current MTU, due this condition on dev_set_mtu():

        if (new_mtu == dev->mtu)
                return 0;

So, this block of code is never reached and is being removed.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipv4: obsolete config in kernel source (IP_ROUTE_PERVASIVE)
Christoph Egger [Wed, 3 Feb 2010 06:05:54 +0000 (06:05 +0000)]
ipv4: obsolete config in kernel source (IP_ROUTE_PERVASIVE)

CONFIG_IP_ROUTE_PERVASIVE is missing a corresponding config
IP_ROUTE_PERVASIVE somewhere in KConfig (and missing it for ages
already) so it looks like some aging artefact no longer needed.

Therefor this patch kills of the only remaining reference to that
config Item removing the already unrechable code snipet.

Signed-off-by: Christoph Egger <siccegge@stud.informatik.uni-erlangen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agopktgen: Fix freezing problem
Rafael J. Wysocki [Thu, 4 Feb 2010 22:00:41 +0000 (14:00 -0800)]
pktgen: Fix freezing problem

Add missing try_to_freeze() to one of the pktgen_thread_worker() code
paths so that it doesn't block suspend/hibernation.

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

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reported-and-tested-by: Ciprian Dorin Craciun <ciprian.craciun@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodoc: document IPv6 parameters
Brian Haley [Thu, 4 Feb 2010 21:36:50 +0000 (13:36 -0800)]
doc: document IPv6 parameters

Update documentation to describe IPv6 parameters.
Reported by <greg@enjellic.com>.

Signed-off-by: Brian Haley <brian.haley@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqlge: Add watchdog timer.
Ron Mercer [Thu, 4 Feb 2010 21:32:46 +0000 (13:32 -0800)]
qlge: Add watchdog timer.

Add periodic heartbeat register read to trigger the eeh
recovery process.
We see cases where an eeh error was injected and the slot was
suspended.  An asic access attempt is required to flush the recovery process,
but without interrupts the process can stall.
Adding this periodic register read causes the recovery process to begin.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agolibphy: add phy_find_first function
Jiri Pirko [Thu, 4 Feb 2010 18:23:02 +0000 (10:23 -0800)]
libphy: add phy_find_first function

Many drivers do this in them manually. Now they can use this function.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: use helpers to access mc list V2
Jiri Pirko [Thu, 4 Feb 2010 18:22:25 +0000 (10:22 -0800)]
net: use helpers to access mc list V2

This patch introduces the similar helpers as those already done for uc list.
However multicast lists are no list_head lists but "mademanually". The three
macros added by this patch will make the transition of mc_list to list_head
smooth in two steps:

1) convert all drivers to use these macros (with the original iterator of type
   "struct dev_mc_list")
2) once all drivers are converted, convert list type and iterators to "struct
   netdev_hw_addr" in one patch.

>From now on, drivers can (and should) use "netdev_for_each_mc_addr" to iterate
over the addresses with iterator of type "struct netdev_hw_addr". Also macros
"netdev_mc_count" and "netdev_mc_empty" to read list's length. This is the state
which should be reached in all drivers.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoigb: make certain to reassign legacy interrupt vectors after reset
Alexander Duyck [Wed, 3 Feb 2010 21:59:51 +0000 (21:59 +0000)]
igb: make certain to reassign legacy interrupt vectors after reset

This change corrects an issue that will cause false hangs when using either
82575 or 82580 in legacy interrupt mode.  The issue is caused when there is
a slow traffic flow and an "ethtool -r" is executed while using legacy or
MSI interrupts.  MSI-X is not affected by this issue due to the fact that
we were already reconfiguring the vectors after reset.

If possible it would be best to push this for net-2.6 since it is resolving
a bug but if that is not possible then net-next-2.6 will be fine.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agostmmac: fix 'lenght' typo in comments and code
Giuseppe Cavallaro [Thu, 4 Feb 2010 17:33:21 +0000 (09:33 -0800)]
stmmac: fix 'lenght' typo in comments and code

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocan: ems_usb: removed duplicated code setting local echo support
Thadeu Lima de Souza Cascardo [Thu, 4 Feb 2010 17:21:28 +0000 (09:21 -0800)]
can: ems_usb: removed duplicated code setting local echo support

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.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/linville/wirel...
David S. Miller [Thu, 4 Feb 2010 16:58:14 +0000 (08:58 -0800)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-next-2.6

14 years agosky2: Flow control frames recorded as dropped packets
Stephen Hemminger [Wed, 3 Feb 2010 08:31:12 +0000 (08:31 +0000)]
sky2: Flow control frames recorded as dropped packets

Thanks for your patch.  A more general solution would be to move the
rx_dropped up into sky2_receive.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosky2: hand receive DMA mapping failures
stephen hemminger [Mon, 1 Feb 2010 13:45:41 +0000 (13:45 +0000)]
sky2: hand receive DMA mapping failures

If receive buffer mapping failed, then it was possible to get
stuck with unmapped receive buffer in DMA ring.

This would be an extremely rare condition because the driver had just
released the map for the last receive so it should be able to get
another map again (in soft-irq).

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: CONFIG_COMPAT redux
Alexey Dobriyan [Mon, 1 Feb 2010 09:44:19 +0000 (09:44 +0000)]
net: CONFIG_COMPAT redux

Ifdef out
struct proto_ops::compat_ioctl
struct proto_ops::compat_setsockopt
struct proto_ops::compat_getsockopt
to make structures smaller on COMPAT=n kernels.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocan: mcp251x: Move to threaded interrupts instead of workqueues.
Christian Pellegrin [Wed, 3 Feb 2010 07:39:54 +0000 (07:39 +0000)]
can: mcp251x: Move to threaded interrupts instead of workqueues.

This patch addresses concerns about efficiency of handling incoming
packets. Handling of interrupts is done in a threaded interrupt handler
which has a smaller latency than workqueues. This change needed a rework
of the locking scheme that was much simplified. Some other (more or less
longstanding) bugs are fixed: utilization of just half of the RX
buffers, useless wait for interrupt on open, more reliable reset
sequence. The MERR interrupt is not used anymore: it overloads the CPU
in error-passive state without any additional information. One shot mode
is disabled because it's not clear if it can be handled efficiently on
this CAN controller.

Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobonding: Remove net_device_stats from bonding struct
Ajit Khaparde [Mon, 1 Feb 2010 14:06:52 +0000 (14:06 +0000)]
bonding: Remove net_device_stats from bonding struct

There is no need to maintain stats in the bonding structure.
Use the instance of net_device_stats in netdevice.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/net/davinci_emac.c: Fix continuation line formats
Joe Perches [Mon, 1 Feb 2010 21:22:11 +0000 (21:22 +0000)]
drivers/net/davinci_emac.c: Fix continuation line formats

String constants that are continued on subsequent lines with \
are not good.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotrivial: remove duplicated "from" in CAN USB EMS Kconfig help
Thadeu Lima de Souza Cascardo [Mon, 1 Feb 2010 07:58:59 +0000 (07:58 +0000)]
trivial: remove duplicated "from" in CAN USB EMS Kconfig help

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: macvtap driver
Arnd Bergmann [Sat, 30 Jan 2010 12:24:26 +0000 (12:24 +0000)]
net: macvtap driver

In order to use macvlan with qemu and other tools that require
a tap file descriptor, the macvtap driver adds a small backend
with a character device with the same interface as the tun
driver, with a minimum set of features.

Macvtap interfaces are created in the same way as macvlan
interfaces using ip link, but the netif is just used as a
handle for configuration and accounting, while the data
goes through the chardev. Each macvtap interface has its
own character device, simplifying permission management
significantly over the generic tun/tap driver.

Cc: Patrick McHardy <kaber@trash.net>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: David S. Miller" <davem@davemloft.net>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Or Gerlitz <ogerlitz@voltaire.com>
Cc: netdev@vger.kernel.org
Cc: bridge@lists.linux-foundation.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agomacvlan: allow multiple driver backends
Arnd Bergmann [Sat, 30 Jan 2010 12:23:40 +0000 (12:23 +0000)]
macvlan: allow multiple driver backends

This makes it possible to hook into the macvlan driver
from another kernel module. In particular, the goal is
to extend it with the macvtap backend that provides
a tun/tap compatible interface directly on the macvlan
device.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: maintain namespace isolation between vlan and real device
Arnd Bergmann [Sat, 30 Jan 2010 12:23:03 +0000 (12:23 +0000)]
net: maintain namespace isolation between vlan and real device

In the vlan and macvlan drivers, the start_xmit function forwards
data to the dev_queue_xmit function for another device, which may
potentially belong to a different namespace.

To make sure that classification stays within a single namespace,
this resets the potentially critical fields.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/rds: remove uses of NIPQUAD, use %pI4
Joe Perches [Tue, 2 Feb 2010 12:43:59 +0000 (12:43 +0000)]
net/rds: remove uses of NIPQUAD, use %pI4

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Andy Grover <andy.grover@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agomISDN: positive error return should be negative in mode_hfcmulti()
Roel Kluin [Tue, 2 Feb 2010 12:43:47 +0000 (12:43 +0000)]
mISDN: positive error return should be negative in mode_hfcmulti()

The error return should be negative.  Its only caller that acts upon its
return, handle_bmsg(), transmits the positive error but can also return
negative errors.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoisdn: mISDN, don't compile unused stuff
Jiri Slaby [Tue, 2 Feb 2010 12:43:46 +0000 (12:43 +0000)]
isdn: mISDN, don't compile unused stuff

Remove these compiler warnings:

drivers/isdn/hardware/mISDN/w6692.c:534: warning: `setvolume' defined but not used
drivers/isdn/hardware/mISDN/w6692.c:561: warning: `enable_pots' defined but not used

by moving the functions inside #if 0 ...  #endif.  And an alternative is
to remove them completely if nobody has plans to use them.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agohardware/mISDN/mISDNinfineon.c: bail out of loop on error
Darren Jenkins [Tue, 2 Feb 2010 12:43:45 +0000 (12:43 +0000)]
hardware/mISDN/mISDNinfineon.c: bail out of loop on error

If setup_instance() fails we kfree() the card, and then use it in the next
loop iteration.  So lets bail out of the loop instead.

Coverity CID: 13357

Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com>
Cc: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agohisax: timeout off by one in waitrecmsg()
Roel Kluin [Tue, 2 Feb 2010 12:43:44 +0000 (12:43 +0000)]
hisax: timeout off by one in waitrecmsg()

With `while (timeout++ < maxdelay)' timeout reaches maxdelay + 1 after the
loop This is probably unlikely a problem in practice.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoirda: add missing BKL in irnet_ppp ioctl
Thadeu Lima de Souza Cascardo [Mon, 1 Feb 2010 08:21:35 +0000 (08:21 +0000)]
irda: add missing BKL in irnet_ppp ioctl

One ioctl has been forgotten when the BKL was push down into irnet_ppp
ioctl function.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoirda: unbalanced lock_kernel in irnet_ppp
Thadeu Lima de Souza Cascardo [Mon, 1 Feb 2010 08:21:34 +0000 (08:21 +0000)]
irda: unbalanced lock_kernel in irnet_ppp

Add the missing unlock_kernel in one ioctl operation.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqlge: Add check for eeh failure when closing device.
Ron Mercer [Wed, 3 Feb 2010 07:24:12 +0000 (07:24 +0000)]
qlge: Add check for eeh failure when closing device.

Fix crash where resources are freed twice on an eeh recovery failure.
If eeh recovery fails we set a flag to indicate to close() that
resources have been freed.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqlge: Move reset from eeh io_resume to slot_reset.
Ron Mercer [Wed, 3 Feb 2010 07:24:11 +0000 (07:24 +0000)]
qlge: Move reset from eeh io_resume to slot_reset.

Issue asic reset and verify functionality before continuing to the
resume call.  This allows proper error code to be returned in the case
the asic does not recover.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Make descriptor ring allocations NUMA-aware
PJ Waskiewicz [Wed, 3 Feb 2010 14:19:12 +0000 (14:19 +0000)]
ixgbe: Make descriptor ring allocations NUMA-aware

This patch allocates the ring structures themselves on each
NUMA node along with the buffer_info structures.  This way we
don't allocate the entire ring memory on a single node in one
big block, thus reducing NUMA node memory crosstalk.

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: Allocate driver resources per NUMA node
Jesse Brandeburg [Wed, 3 Feb 2010 14:18:50 +0000 (14:18 +0000)]
ixgbe: Allocate driver resources per NUMA node

The default policy for the current driver is to do all its memory
allocation on whatever processor is running insmod/modprobe.  This
is less than optimal.

This driver's default mode of operation will be to use each node for each
subsequent transmit/receive queue.  The most efficient allocation will be
to then have the interrupts bound in such a way as to match up the
interrupt of the queue to the cpu where its memory was allocated.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
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 agoe1000: call pci_save_state after pci_restore_state
Nick Nunley [Wed, 3 Feb 2010 14:49:48 +0000 (14:49 +0000)]
e1000: call pci_save_state after pci_restore_state

This patch adds a call to pci_save_state() immediately after
the call to pci_restore_state(). Due to a change in the behavior
of pci_restore_state() it is necessary to call pci_save_state()
to keep the state_saved flag. This patch is based on a similar
patch for ixgbe.

Signed-off-by: Nicholas Nunley <nicholasx.d.nunley@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoe1000: Report link status in ethtool when interface is down
Nick Nunley [Wed, 3 Feb 2010 14:49:28 +0000 (14:49 +0000)]
e1000: Report link status in ethtool when interface is down

With this change ethtool will correctly report link status when
the interface is down. Currently ethtool reports the link as not
detected when the interface is down.

Signed-off-by: Nicholas Nunley <nicholasx.d.nunley@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: only process one ixgbe_watchdog_task at a time.
John Fastabend [Wed, 3 Feb 2010 14:23:32 +0000 (14:23 +0000)]
ixgbe: only process one ixgbe_watchdog_task at a time.

Processing multiple ixgbe_watchdog_task calls may cause
the link_up variable and IXGBE_FLAG_NEED_LINK_UPDATE flag
to be set incorrectly.  In the worse case this is causing
the netif_carrier_off to be called inappropriately which
results in an interface that can't be brought up.

Although schedule_work() will only schedule the task if
it is not already on the work queue the WORK_STRUCT_PENDING
bits are cleared just before calling the work function.
This allows WORK_STRUCT_PENDING to be cleared, the work
function to start and meanwhile schedule another task.

This patch adds a mutex to the watchdog task. This bug is
actualized by changing DCB settings or doing extended
cable pull or reset tests.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
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 [Thu, 4 Feb 2010 03:38:22 +0000 (19:38 -0800)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

14 years agoixgbe: Fix return of invalid txq
Krishna Kumar [Wed, 3 Feb 2010 13:13:10 +0000 (13:13 +0000)]
ixgbe: Fix return of invalid txq

a developer had complained of getting lots of warnings:

"eth16 selects TX queue 98, but real number of TX queues is 64"

http://www.mail-archive.com/e1000-devel@lists.sourceforge.net/msg02200.html

As there was no follow up on that bug, I am submitting this
patch assuming that the other return points will not return
invalid txq's, and also that this fixes the bug (not tested).

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@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: Fix ixgbe_tx_map error path
Anton Blanchard [Wed, 3 Feb 2010 13:12:51 +0000 (13:12 +0000)]
ixgbe: Fix ixgbe_tx_map error path

Commit e5a43549f7a58509a91b299a51337d386697b92c (ixgbe: remove
skb_dma_map/unmap calls from driver) looks to have introduced a bug in
ixgbe_tx_map. If we get an error from a PCI DMA call, we loop backwards
through count until it becomes -1 and return that.

The caller of ixgbe_tx_map expects 0 on error, so return that instead.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>