]> bbs.cooldavid.org Git - net-next-2.6.git/log
net-next-2.6.git
13 years agolibertas: remove unused indirect TPC_CFG command leftovers
Dan Williams [Tue, 27 Jul 2010 19:56:44 +0000 (12:56 -0700)]
libertas: remove unused indirect TPC_CFG command leftovers

These were no longer used but were left around; Transmit Power
Control is done through the lbs_set_tpc_cfg() function.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agolibertas: convert 11D_DOMAIN_INFO to a direct command
Dan Williams [Tue, 27 Jul 2010 19:56:05 +0000 (12:56 -0700)]
libertas: convert 11D_DOMAIN_INFO to a direct command

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agolibertas: clean up RSSI command
Dan Williams [Tue, 27 Jul 2010 19:55:21 +0000 (12:55 -0700)]
libertas: clean up RSSI command

Convert to a full direct command; previous code rolled a direct
command by hand but left the original indirect command code intact
but disabled.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agolibertas: clean up MONITOR_MODE command
Dan Williams [Tue, 27 Jul 2010 19:54:34 +0000 (12:54 -0700)]
libertas: clean up MONITOR_MODE command

Convert to a full direct command; previous code rolled a direct
command by handle but left the original indirect command code
lying around.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2500usb: disallow to set WEP key with non zero index
Stanislaw Gruszka [Tue, 27 Jul 2010 14:48:24 +0000 (10:48 -0400)]
rt2500usb: disallow to set WEP key with non zero index

On our hardware (050d:7050 Belkin Components F5D7050 Wireless G Adapter),
setting any WEP key with non zero index, cause rx frames corruption.

Note: perhaps (I did not check) this can be fixed differently - by using
hw_key_idx the same as true MAC key index. But according to the comment in
rt2x00mac_set_key():

"the hardware requires keys to be assigned in correct order (When key 1
is provided but key 0 is not, then the key is not found by the hardware
during RX)"

this will be quite problematic. Since WEP should not be used, disabling
hardware crypto offload for it will not hurt much. Beside static
one key WEP will still be offloaded.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2500usb: truly disable encryption when initialize
Stanislaw Gruszka [Tue, 27 Jul 2010 14:48:17 +0000 (10:48 -0400)]
rt2500usb: truly disable encryption when initialize

Without cipher part nullify of TXRX_CSR0 register we can receive
corrupted frames (removed IV or IVC), after reloading rt2500usb module
with nohwcrypt=1 option, if previous some keys were configured into
the hardware.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2500usb: write keys to proper registers
Stanislaw Gruszka [Tue, 27 Jul 2010 14:48:10 +0000 (10:48 -0400)]
rt2500usb: write keys to proper registers

Fix rt2500usb hardware encryption broken by commit
96b61bafe22b2f2abcc833d651739edb977f1b1e
"rt2x00: Clean up USB vendor request buffer functions"

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: remove unused base_index from rate table.
Senthil Balasubramanian [Tue, 27 Jul 2010 13:46:34 +0000 (19:16 +0530)]
ath9k: remove unused base_index from rate table.

base index is not used anymore and so remove it.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Fix incorrect user ratekbs of MCS15 ShortGI
Senthil Balasubramanian [Tue, 27 Jul 2010 13:46:33 +0000 (19:16 +0530)]
ath9k: Fix incorrect user ratekbs of MCS15 ShortGI

The user ratekbs of MCS15 ShortGI is incorrect and can not be lesser
than MCS15 rate. This incorrect rate may affect switching to higher
rates as the rate control algorithm always finds MCS15 is better
than MCS15 ShortGI and results in lower throughput. Fix this by
feeding the correct user ratekbs for MCS15 ShortGI rate.

This issue affects 3 stream case very badly as the 3 stream rates are
not used at all once we scale down to MCS15 from 3 stream rates.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Add three stream rate control support for AR938X.
Senthil Balasubramanian [Tue, 27 Jul 2010 13:46:32 +0000 (19:16 +0530)]
ath9k: Add three stream rate control support for AR938X.

This patch adds 3 stream rate control support for AR938X family
chipsets which supports 3 streams.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Introduce bit masks for valid and valid_single_stream.
Senthil Balasubramanian [Tue, 27 Jul 2010 13:46:31 +0000 (19:16 +0530)]
ath9k: Introduce bit masks for valid and valid_single_stream.

replace valid and valid_single_stream in rate table with bit masks
and reorganize the code so adding 3x3 rate control would be easier.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Fix key freeing to handle unlinked keys
Jouni Malinen [Mon, 26 Jul 2010 22:52:03 +0000 (15:52 -0700)]
mac80211: Fix key freeing to handle unlinked keys

Key locking simplification removed key->sdata != NULL verification from
ieee80211_key_free(). While that is fine for most use cases, there is one
path where this function can be called with an unlinked key (i.e.,
key->sdata == NULL && key->local == NULL). This results in a NULL pointer
dereference with the current implementation. This is known to happen at
least with FT protocol when wpa_supplicant tries to configure the key
before association.

Avoid the issue by passing in the local pointer to
ieee80211_key_free(). In addition, do not clear the key from hw_accel
or debugfs if it has not yet been added. At least the hw_accel one could
trigger another NULL pointer dereference.

Signed-off-by: Jouni Malinen <j@w1.fi>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agop54: Added get_survey callback in order to get channel noise
John W. Linville [Mon, 3 May 2010 20:06:47 +0000 (16:06 -0400)]
p54: Added get_survey callback in order to get channel noise

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluet...
John W. Linville [Tue, 27 Jul 2010 15:59:19 +0000 (11:59 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-next-2.6

Conflicts:
drivers/net/wireless/iwlwifi/iwl-commands.h

13 years agoe1000: use netif_<level> instead of netdev_<level>
Emil Tantilov [Tue, 27 Jul 2010 06:37:21 +0000 (23:37 -0700)]
e1000: use netif_<level> instead of netdev_<level>

This patch restores the ability to set msglvl through ethtool.
The issue was introduced by:
commit 675ad47375c76a7c3be4ace9554d92cd55518ced

Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agousbnet: use jiffies in schedule_timeout(), not msecs
Kulikov Vasiliy [Sun, 25 Jul 2010 22:25:42 +0000 (22:25 +0000)]
usbnet: use jiffies in schedule_timeout(), not msecs

usbnet_terminate_urbs() uses schedule_timeout() with argument 3 msecs.
schedule_timeout() uses jiffies as argument, so convert msecs to jiffies
with msecs_to_jiffies().

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoks8842: Support 100Mbps when accessed via timberdale
Richard Röjfors [Sun, 25 Jul 2010 22:51:05 +0000 (22:51 +0000)]
ks8842: Support 100Mbps when accessed via timberdale

This patch removes the code which disables 100Mbps advertising when
the ks8842 is accessed via timberdale.

At higher speed it's good to be nice to the internal state machine
of timberdale by acking interrupts. That is done by a write to the
interrupt ack register (IAR).

Signed-off-by: Richard Röjfors <richard.rojfors@pelagicore.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocaif: handle snprintf() return
Dan Carpenter [Sun, 25 Jul 2010 21:23:59 +0000 (21:23 +0000)]
caif: handle snprintf() return

snprintf() returns the number of bytes that would have been written.  It
can be larger than the size of the buffer.  The current code won't
overflow, but people cut and paste this stuff so lets do it right and
also make the static checkers happy.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agogenetlink: use genl_register_family_with_ops()
Changli Gao [Sun, 25 Jul 2010 23:21:05 +0000 (23:21 +0000)]
genetlink: use genl_register_family_with_ops()

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrop_monitor: use genl_register_family_with_ops()
Changli Gao [Tue, 27 Jul 2010 03:59:42 +0000 (20:59 -0700)]
drop_monitor: use genl_register_family_with_ops()

[ Fix unused local variable build warnings. -DaveM ]

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agogenetlink: cleanup code according to CodingStyle
Changli Gao [Sun, 25 Jul 2010 20:46:01 +0000 (20:46 +0000)]
genetlink: cleanup code according to CodingStyle

If the function is exported, the EXPORT* macro for it should follow immediately
after the closing function brace line.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
----
 net/netlink/genetlink.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethoc: add devinit/devexit section initializers
Jonas Bonn [Tue, 27 Jul 2010 01:45:05 +0000 (18:45 -0700)]
ethoc: add devinit/devexit section initializers

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoigb: restore EEPROM values of MDICNFG on reset with 82580
Nick Nunley [Mon, 26 Jul 2010 13:15:29 +0000 (13:15 +0000)]
igb: restore EEPROM values of MDICNFG on reset with 82580

On a reset the MDICNFG.Destination and MDICNFG.COM_MDIO
register fields are not restored to the EEPROM default.
This patch modifies the reset code to read the EEPROM
and restore the default values.

Signed-off-by: Nicholas Nunley <nicholas.d.nunley@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoigb: add support for SGMII-based MDIO PHYs
Nick Nunley [Mon, 26 Jul 2010 13:15:06 +0000 (13:15 +0000)]
igb: add support for SGMII-based MDIO PHYs

This patch adds support for external MDIO PHYs, in addition to
the standard SFP support for SGMII PHYs over the I2C interface.

Signed-off-by: Nicholas Nunley <nicholas.d.nunley@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoe1000e: Drop a useless statement
Jean Delvare [Mon, 26 Jul 2010 12:20:43 +0000 (12:20 +0000)]
e1000e: Drop a useless statement

err is set again a few lines below.

Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agos2io: fixing DBG_PRINT() macro
Breno Leitao [Mon, 26 Jul 2010 22:37:30 +0000 (15:37 -0700)]
s2io: fixing DBG_PRINT() macro

Patch 9e39f7c5b311a306977c5471f9e2ce4c456aa038 changed the
DBG_PRINT() macro and the if clause was wrongly changed. It means
that currently all the DBG_PRINT are being printed, flooding the
kernel log buffer with things like:

s2io: eth6: Next block at: c0000000b9c90000
s2io: eth6: In Neterion Tx routine

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Acked-by: Sreenivasa Honnur <Sreenivasa.Honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Mon, 26 Jul 2010 20:26:09 +0000 (13:26 -0700)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6

13 years agodrivers/net/qla3xxx.c: Checkpatch cleanups
Joe Perches [Thu, 22 Jul 2010 15:36:17 +0000 (15:36 +0000)]
drivers/net/qla3xxx.c: Checkpatch cleanups

Remove typedefs
Indentation and spacing
Use a temporary for a very long pointer variable
More 80 column compatible
Convert a switch to if/else if

Compile tested only, depends on patch "Update logging message style"

(old)
$ scripts/checkpatch.pl -f drivers/net/qla3xxx.c | grep "^total:"
total: 209 errors, 82 warnings, 3995 lines checked

(new)
$ scripts/checkpatch.pl -f drivers/net/qla3xxx.c | grep "^total:"
total: 2 errors, 0 warnings, 3970 lines checked

$ size drivers/net/qla3xxx.o.*
   text    data     bss     dec     hex filename
  50413     212   13864   64489    fbe9 drivers/net/qla3xxx.o.old
  49959     212   13728   63899    f99b drivers/net/qla3xxx.o.new

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net/qla3xxx.c: Update logging message style
Joe Perches [Thu, 22 Jul 2010 12:33:31 +0000 (12:33 +0000)]
drivers/net/qla3xxx.c: Update logging message style

Use pr_<level>
Use netdev_<level>
Use netif_<level>
Remove #define PFX
Improve a couple of loops to avoid deep indentation.

Compile tested only

$ size drivers/net/qla3xxx.o.*
   text    data     bss     dec     hex filename
  51603     212   13864   65679   1008f drivers/net/qla3xxx.o.old
  50413     212   13864   64489    fbe9 drivers/net/qla3xxx.o.new

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agowireless: Make COMPAT_NETLINK_MESSAGES depend upon WEXT_CORE
David S. Miller [Mon, 26 Jul 2010 20:13:49 +0000 (13:13 -0700)]
wireless: Make COMPAT_NETLINK_MESSAGES depend upon WEXT_CORE

WIRELESS_EXT is not the correct dependency.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetlink: netlink_recvmsg() fix
Eric Dumazet [Mon, 26 Jul 2010 20:09:16 +0000 (13:09 -0700)]
netlink: netlink_recvmsg() fix

commit 1dacc76d0014
(net/compat/wext: send different messages to compat tasks)
introduced a race condition on netlink, in case MSG_PEEK is used.

An skb given by skb_recv_datagram() might be shared, we must copy it
before any modification, or risk fatal corruption.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agort2x00: Fix regression for rt2500pci
Ivo van Doorn [Sat, 24 Jul 2010 17:32:25 +0000 (19:32 +0200)]
rt2x00: Fix regression for rt2500pci

Since commit:
     commit f1aa4c541e98afa8b770a75ccaa8504d0bff44a7
     Author: Ivo van Doorn <ivdoorn@gmail.com>
     Date:   Tue Jun 29 21:38:55 2010 +0200

     rt2x00: Write the BSSID to register when interface is added

mananged mode in rt2500pci was broken, due to intf->bssid containing
random data rather then the expected 00:00:00:00:00:00

This is corrected by sending the BSSID to rt2x00lib_config_intf
only in AP mode where the bssid is set to a valid value.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Don't set per-BSS QoS for monitor interfaces
Sujith [Fri, 23 Jul 2010 05:17:11 +0000 (10:47 +0530)]
mac80211: Don't set per-BSS QoS for monitor interfaces

In AP mode, there is no need to notify the driver about QoS
changes for the monitor interface that is created. The warning
in ieee80211_bss_info_change_notify() would be hit otherwise.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: simplify noisefloor calibration chainmask calculation
Felix Fietkau [Fri, 23 Jul 2010 02:31:56 +0000 (04:31 +0200)]
ath9k_hw: simplify noisefloor calibration chainmask calculation

The noisefloor array index always corresponds to the rx chain number it
belongs to (with an offset of 3 for the extension chain).

It's much simpler (and actually more correct) to directly use the
chainmask to calculate the bitmask for the noisefloor array, instead of
using these weird chip revision checks and hardcoded mask values.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: fix a small typo in the noisefloor calibration debug code
Felix Fietkau [Fri, 23 Jul 2010 02:12:19 +0000 (04:12 +0200)]
ath9k_hw: fix a small typo in the noisefloor calibration debug code

In the noisefloor array, the extension channel values start at index 3

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: fix invalid extension channel noisefloor readings in HT20
Felix Fietkau [Fri, 23 Jul 2010 02:07:48 +0000 (04:07 +0200)]
ath9k_hw: fix invalid extension channel noisefloor readings in HT20

When the hardware is configured in HT20 mode, noise floor readings for
the extension channel often return invalid values, which keep the
values in the NF history buffer at the hardware-specific maximum limit.
Fix this by discarding the extension channel values when in HT20 mode.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix yet another buffer leak in the tx aggregation code
Felix Fietkau [Fri, 23 Jul 2010 01:53:16 +0000 (03:53 +0200)]
ath9k: fix yet another buffer leak in the tx aggregation code

When an aggregation session is being cleaned up, while the tx status
for some frames is being processed, the TID is flushed and its buffers
are sent out.

Unfortunately that left the pending un-acked frames unprocessed, thus
leaking buffers. Fix this by reordering the code so that those frames
are processed first, before the TID is flushed.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: fix sta assignment
Johannes Berg [Thu, 22 Jul 2010 15:11:28 +0000 (17:11 +0200)]
mac80211: fix sta assignment

I just had the following:
WARNING: at drivers/net/wireless/iwlwifi/iwl-agn-tx.c:574 iwlagn_tx_skb+0x1576/0x15f0 [iwlagn]()
Call Trace:
 <IRQ>  [<ffffffff8105c5df>] warn_slowpath_common+0x7f/0xc0
 [<ffffffff8105c63a>] warn_slowpath_null+0x1a/0x20
 [<ffffffffa0290b46>] iwlagn_tx_skb+0x1576/0x15f0 [iwlagn]
 [<ffffffffa027076c>] iwl_mac_tx+0x5c/0x260 [iwlagn]
 [<ffffffffa01bdf5b>] __ieee80211_tx+0x10b/0x1a0 [mac80211]
 [<ffffffffa01bfb86>] ieee80211_tx_pending+0x186/0x2d0 [mac80211]
 [<ffffffff81062ea5>] tasklet_action+0x125/0x130
 [<ffffffff810634a6>] __do_softirq+0x106/0x270
 [<ffffffff8100c09c>] call_softirq+0x1c/0x30
iwlagn 0000:02:00.0: Attempting to modify non-existing station 107

Note that 107 == 0x6b which is slab poison.

The reason is that mac80211 passed a freed station
pointer to mac80211, because as it happened iwlwifi
reset itself while mac80211 was disconnecting from
the network.

It turns out that we do take care to look up the
station pointer in ieee80211_tx_pending_skb, but
then don't use it, which obviously is a bug. Fix
this by removing the ieee80211_tx_h_sta handler
and assigning the station pointer directly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agolibertas: precedence bug
Dan Carpenter [Thu, 22 Jul 2010 12:21:02 +0000 (14:21 +0200)]
libertas: precedence bug

Negate has precedence over comparison so the original test was always
false.  (Neither 0 nor 1 are equal to NL80211_IFTYPE_MONITOR).

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: fix IBSS default management key
Johannes Berg [Thu, 22 Jul 2010 11:59:15 +0000 (13:59 +0200)]
cfg80211: fix IBSS default management key

When wireless extensions are used to control
an encrypted IBSS, we erroneously can try to
set the default management key. Fix this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: remove bogus rcu_read_lock()
Johannes Berg [Thu, 22 Jul 2010 11:58:51 +0000 (13:58 +0200)]
mac80211: remove bogus rcu_read_lock()

Another remnant of the previous key locking scheme
needs to be removed -- this causes a warning
otherwise as ieee80211_set_default_mgmt_key will
acquire a mutex.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowireless: remove unneeded variable from regulatory_hint_11d()
Dan Carpenter [Thu, 22 Jul 2010 11:26:50 +0000 (13:26 +0200)]
wireless: remove unneeded variable from regulatory_hint_11d()

The "rd" variable isn't needed any more since 4f366c5dabcb
"wireless: only use alpha2 regulatory information from country IE"

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: freeing the wrong variable
Dan Carpenter [Thu, 22 Jul 2010 11:14:19 +0000 (13:14 +0200)]
mac80211: freeing the wrong variable

The intent was to free "msp->ratelist" here.  "msp->sample_table" is
always NULL at this point.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Fix inconsistency between txq->stopped and the actual queue state
Vasanthakumar Thiagarajan [Thu, 22 Jul 2010 09:24:11 +0000 (02:24 -0700)]
ath9k: Fix inconsistency between txq->stopped and the actual queue state

Sometimes txq state(txq->stopped) can be marked as started but the actual
queue may not be started (in ATH_WIPHY_SCAN state, for example). Fix this.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: snprintf() returns largish values
Dan Carpenter [Thu, 22 Jul 2010 08:52:02 +0000 (10:52 +0200)]
ath5k: snprintf() returns largish values

snprintf() returns the number of characters that would have been written
(not counting the NUL character).  So we can't use it as the limiter to
simple_read_from_buffer() without capping it first at sizeof(buf).

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: snprintf() returns largish values
Dan Carpenter [Thu, 22 Jul 2010 08:50:28 +0000 (10:50 +0200)]
ath9k: snprintf() returns largish values

The snprintf() function returns the number of characters that would have
been written (not counting the NUL character on the end).  It could
potentially be larger than the size of the buffer.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agodrivers/net/wireless/wl12xx: Use kmemdup
Julia Lawall [Sat, 15 May 2010 21:16:39 +0000 (23:16 +0200)]
drivers/net/wireless/wl12xx: Use kmemdup

Use kmemdup when some other buffer is immediately copied into the
allocated region.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression from,to,size,flag;
statement S;
@@

-  to = \(kmalloc\|kzalloc\)(size,flag);
+  to = kmemdup(from,size,flag);
   if (to==NULL || ...) S
-  memcpy(to, from, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agolib80211: remove unused host_build_iv option
John W. Linville [Thu, 22 Jul 2010 20:31:48 +0000 (16:31 -0400)]
lib80211: remove unused host_build_iv option

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agominstrel: don't complain about feedback for unrequested rates
John W. Linville [Thu, 22 Jul 2010 19:43:13 +0000 (15:43 -0400)]
minstrel: don't complain about feedback for unrequested rates

"It's not problematic if minstrel gets feedback for rates that it
doesn't have in its list, it should just ignore it. - Felix"

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Cc: Felix Fietkau <nbd@openwrt.org>
13 years agominstrel_ht: remove unnecessary NULL check in minstrel_ht_update_caps
John W. Linville [Thu, 22 Jul 2010 19:36:02 +0000 (15:36 -0400)]
minstrel_ht: remove unnecessary NULL check in minstrel_ht_update_caps

If sta is NULL, we will have problems long before we get here...

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Cc: Felix Fietkau <nbd@openwrt.org>
13 years agoiwlwifi: assume vif is NULL for internal scans and non-NULL otherwise
John W. Linville [Thu, 22 Jul 2010 19:24:56 +0000 (15:24 -0400)]
iwlwifi: assume vif is NULL for internal scans and non-NULL otherwise

The current practice of checking vif for NULL in one place but not
another seems to confuse some static checkers, smatch in particular.
Since vif will only be NULL in the case of internal scans, adjust the
checks accordingly.

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMAINTAINERS: remove entry for wavelan
John W. Linville [Thu, 22 Jul 2010 18:45:02 +0000 (14:45 -0400)]
MAINTAINERS: remove entry for wavelan

The driver is already removed from drivers/staging.  The wireless
extensions part is not really valid anymore either, since wext got moved
and refactored, etc.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMAINTAINERS: orphan the zd1201 wireless driver
John W. Linville [Thu, 22 Jul 2010 18:41:08 +0000 (14:41 -0400)]
MAINTAINERS: orphan the zd1201 wireless driver

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMAINTAINERS: orphan the raylink wireless driver
John W. Linville [Thu, 22 Jul 2010 18:36:52 +0000 (14:36 -0400)]
MAINTAINERS: orphan the raylink wireless driver

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMAINTAINERS: mark prism54 obsolete
John W. Linville [Thu, 22 Jul 2010 18:25:40 +0000 (14:25 -0400)]
MAINTAINERS: mark prism54 obsolete

The prism54 driver had an entry in feature-removal-schedule.txt and it
sees very little activity other than API-change "bombing runs".  The
mac80211-based p54 driver should be used instead.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortl8180: silence "dubious: x | !y" sparse warning
John W. Linville [Wed, 21 Jul 2010 20:36:06 +0000 (16:36 -0400)]
rtl8180: silence "dubious: x | !y" sparse warning

  CHECK   drivers/net/wireless/rtl818x/rtl8180_rtl8225.c
drivers/net/wireless/rtl818x/rtl8180_rtl8225.c:53:33: warning: dubious: x | !y

The existing code is clever and works fine, but it's not worth even a
single line of Sparse warning SPAM...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortl8180: improve signal reporting for actual rtl8180 hardware
John W. Linville [Wed, 21 Jul 2010 20:26:40 +0000 (16:26 -0400)]
rtl8180: improve signal reporting for actual rtl8180 hardware

Adapted from Realtek-provided driver...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Tested-by: Pauli Nieminen <suokkos@gmail.com>
13 years agowl1251: fix sparse-generated warnings
John W. Linville [Wed, 21 Jul 2010 16:25:10 +0000 (12:25 -0400)]
wl1251: fix sparse-generated warnings

  CHECK   drivers/net/wireless/wl12xx/wl1251_tx.c
drivers/net/wireless/wl12xx/wl1251_tx.c:118:32: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_tx.c:118:32:    expected unsigned short [unsigned] [usertype] frag_threshold
drivers/net/wireless/wl12xx/wl1251_tx.c:118:32:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_tx.c:164:24: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_tx.c:164:24:    expected unsigned short [unsigned] [usertype] length
drivers/net/wireless/wl12xx/wl1251_tx.c:164:24:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_tx.c:166:22: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_tx.c:166:22:    expected unsigned short [unsigned] [usertype] rate
drivers/net/wireless/wl12xx/wl1251_tx.c:166:22:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_tx.c:167:29: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_tx.c:167:29:    expected unsigned int [unsigned] [usertype] expiry_time
drivers/net/wireless/wl12xx/wl1251_tx.c:167:29:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_tx.c:200:43: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/wl12xx/wl1251_tx.c:200:43:    expected restricted __le16 [usertype] fc
drivers/net/wireless/wl12xx/wl1251_tx.c:200:43:    got unsigned short [unsigned] [assigned] [usertype] fc
  CHECK   drivers/net/wireless/wl12xx/wl1251_cmd.c
drivers/net/wireless/wl12xx/wl1251_cmd.c:428:39: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_cmd.c:428:39:    expected unsigned int [unsigned] [usertype] rx_config_options
drivers/net/wireless/wl12xx/wl1251_cmd.c:428:39:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_cmd.c:429:39: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_cmd.c:429:39:    expected unsigned int [unsigned] [usertype] rx_filter_options
drivers/net/wireless/wl12xx/wl1251_cmd.c:429:39:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_cmd.c:435:29: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_cmd.c:435:29:    expected unsigned short [unsigned] [usertype] tx_rate
drivers/net/wireless/wl12xx/wl1251_cmd.c:435:29:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_cmd.c:439:47: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_cmd.c:439:47:    expected unsigned int [unsigned] [usertype] min_duration
drivers/net/wireless/wl12xx/wl1251_cmd.c:439:47:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_cmd.c:441:47: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_cmd.c:441:47:    expected unsigned int [unsigned] [usertype] max_duration
drivers/net/wireless/wl12xx/wl1251_cmd.c:441:47:    got restricted __le32 [usertype] <noident>
  CHECK   drivers/net/wireless/wl12xx/wl1251_boot.c
drivers/net/wireless/wl12xx/wl1251_boot.c:228:22: warning: symbol 'interrupt' shadows an earlier one
/home/linville/git/wireless-next-2.6/arch/x86/include/asm/hw_irq.h:132:13: originally declared here

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlagn: use __packed on new structure definitions
John W. Linville [Mon, 26 Jul 2010 19:04:12 +0000 (15:04 -0400)]
iwlagn: use __packed on new structure definitions

"iwlagn: add statistic notification structure for WiFi/BT devices" added
several new '__attribute__ ((packed))' lines.  Change them to the
generic __packed.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix dma direction for map/unmap in ath_rx_tasklet
Ming Lei [Fri, 14 May 2010 13:15:38 +0000 (21:15 +0800)]
ath9k: fix dma direction for map/unmap in ath_rx_tasklet

For edma, we should use DMA_BIDIRECTIONAL, or else use
DMA_FROM_DEVICE.

This is found to address "BUG at arch/x86/mm/physaddr.c:5"
as described here:

http://lkml.org/lkml/2010/7/14/21

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonet: dev_forward_skb should call nf_reset
Ben Greear [Thu, 22 Jul 2010 09:54:47 +0000 (09:54 +0000)]
net: dev_forward_skb should call nf_reset

With conn-track zones and probably with different network
namespaces, the netfilter logic needs to be re-calculated
on packet receive.  If the netfilter logic is not reset,
it will not be recalculated properly.  This patch adds
the nf_reset logic to dev_forward_skb.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoforcedeth: Fix different hardware statistics versions.
Mike Ditto [Mon, 26 Jul 2010 04:54:28 +0000 (21:54 -0700)]
forcedeth: Fix different hardware statistics versions.

The macros for the values of the bit field describing the four
different versions of statistics supported by different hardware
variants were being misused.  Where the code was trying to test if the
hardware implements V3, it was actually testing whether it implements
any of V1, V2, or V3, causing the driver to report statistics that
don't really exist in the hardware, with bogus values.

Signed-off-by: Mike Ditto <mditto@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet-next: Fix an overflow bug in vmxnet3 Tx descriptor
Bhavesh Davda [Sat, 24 Jul 2010 14:43:29 +0000 (14:43 +0000)]
net-next: Fix an overflow bug in vmxnet3 Tx descriptor

Fix an overflow bug in vmxnet3 Tx descriptor

This patch fixes a bug where a 16K buffer on a Tx descriptor was overflowing
into the 'gen' bit in the descriptor thereby corrupting the descriptor and
stalling the transmit ring.

Signed-off-by: Bhavesh Davda <bhavesh@vmware.com>
Signed-off-by: Shreyas Bhatewara <sbhatewara@vmware.com>
Signed-off-by: Matthew Delco <delcoM@vmware.com>
Signed-off-by: Ronghua Zhang <ronghua@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years ago3c59x: Add ethtool WOL support
Andrew O. Shadoura [Sat, 24 Jul 2010 16:24:17 +0000 (16:24 +0000)]
3c59x: Add ethtool WOL support

This patch adds wrappers for ethtool to get or set wake-on-LAN
setting without re-inserting the kernel module.

Signed-off-by: Andrew O. Shadoura <andrew@beldisplaytech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: fix diag resource allocation
Sony Chacko [Sat, 24 Jul 2010 18:32:18 +0000 (18:32 +0000)]
qlcnic: fix diag resource allocation

netif_device_attach missing from error path in qlcnic_diag_alloc_res

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: fix loopback test
Amit Kumar Salecha [Sat, 24 Jul 2010 18:32:17 +0000 (18:32 +0000)]
qlcnic: fix loopback test

o Loopback not supported for virtual function.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: pskb_expand_head() optimization
Eric Dumazet [Thu, 22 Jul 2010 19:09:08 +0000 (19:09 +0000)]
net: pskb_expand_head() optimization

Move frags[] at the end of struct skb_shared_info, and make
pskb_expand_head() copy only the used part of it instead of whole array.

This should avoid kmemcheck warnings and speedup pskb_expand_head() as
well, avoiding a lot of cache misses.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet sched: fix race in mirred device removal
stephen hemminger [Thu, 22 Jul 2010 18:45:04 +0000 (18:45 +0000)]
net sched: fix race in mirred device removal

This fixes hang when target device of mirred packet classifier
action is removed.

If a mirror or redirection action is configured to cause packets
to go to another device, the classifier holds a ref count, but was assuming
the adminstrator cleaned up all redirections before removing. The fix
is to add a notifier and cleanup during unregister.

The new list is implicitly protected by RTNL mutex because
it is held during filter add/delete as well as notifier.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'wimax-2.6.35.y' of git://git.kernel.org/pub/scm/linux/kernel/git/inaky...
David S. Miller [Sun, 25 Jul 2010 03:51:45 +0000 (20:51 -0700)]
Merge branch 'wimax-2.6.35.y' of git://git.kernel.org/pub/scm/linux/kernel/git/inaky/wimax

13 years agosysfs: add attribute to indicate hw address assignment type
Stefan Assmann [Thu, 22 Jul 2010 02:50:21 +0000 (02:50 +0000)]
sysfs: add attribute to indicate hw address assignment type

Add addr_assign_type to struct net_device and expose it via sysfs.
This new attribute has the purpose of giving user-space the ability to
distinguish between different assignment types of MAC addresses.

For example user-space can treat NICs with randomly generated MAC
addresses differently than NICs that have permanent (locally assigned)
MAC addresses.
For the former udev could write a persistent net rule by matching the
device path instead of the MAC address.
There's also the case of devices that 'steal' MAC addresses from slave
devices. In which it is also be beneficial for user-space to be aware
of the fact.

This patch also introduces a helper function to assist adoption of
drivers that generate MAC addresses randomly.

Signed-off-by: Stefan Assmann <sassmann@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotun: avoid BUG, dump packet on GSO errors
Michael S. Tsirkin [Wed, 21 Jul 2010 04:32:45 +0000 (04:32 +0000)]
tun: avoid BUG, dump packet on GSO errors

There are still some LRO cards that cause GSO errors in tun,
and BUG on this is an unfriendly way to tell the admin
to disable LRO.

Further, experience shows we might have more GSO bugs lurking.
See https://bugzilla.kernel.org/show_bug.cgi?id=16413
as a recent example.
dumping a packet will make it easier to figure it out.

Replace BUG with warning+dump+drop the packet to make
GSO errors in tun less critical and easier to debug.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Alex Unigovsky <unik@compot.ru>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoixgbe: fix ethtool stats
Eric Dumazet [Fri, 23 Jul 2010 13:44:21 +0000 (13:44 +0000)]
ixgbe: fix ethtool stats

In latest changes about 64bit stats on 32bit arches,
[commit 28172739f0a276eb8 (net: fix 64 bit counters on 32 bit arches)],
I missed ixgbe uses a bit of magic in its ixgbe_gstrings_stats
definition.

IXGBE_NETDEV_STAT() must now assume offsets relative to
rtnl_link_stats64, not relative do dev->stats.

As a bonus, we also get 64bit stats on ethtool -S

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: fix bandwidth check
Rajesh Borundia [Fri, 23 Jul 2010 21:24:25 +0000 (21:24 +0000)]
qlcnic: fix bandwidth check

Fix maximum and minmum bandwith value.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobonding: set device in RLB ARP packet handler
Greg Edwards [Fri, 23 Jul 2010 10:02:04 +0000 (10:02 +0000)]
bonding: set device in RLB ARP packet handler

After:

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

    bonding: Fix ALB mode to balance traffic on VLANs

the dev field in the RLB ARP packet handler was set to NULL to wildcard
and accommodate balancing VLANs on top of bonds.

This has the side-effect of the packet handler being called against
other, non RLB-enabled bonds, and a kernel oops results when it tries to
dereference rx_hashtbl in rlb_update_entry_from_arp(), which won't be
set for those bonds, e.g. active-backup.

With the __netif_receive_skb() changes from:

commit 1f3c8804acba841b5573b953f5560d2683d2db0d
Author: Andy Gospodarek <andy@greyhouse.net>
Date:   Mon Dec 14 10:48:58 2009 +0000

    bonding: allow arp_ip_targets on separate vlans to use arp validation

frames received on VLANs correctly make their way to the bond's handler,
so we no longer need to wildcard the device.

The oops can be reproduced by:

modprobe bonding

echo active-backup > /sys/class/net/bond0/bonding/mode
echo 100 > /sys/class/net/bond0/bonding/miimon
ifconfig bond0 xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx
echo +eth0 > /sys/class/net/bond0/bonding/slaves
echo +eth1 > /sys/class/net/bond0/bonding/slaves

echo +bond1 > /sys/class/net/bonding_masters
echo balance-alb > /sys/class/net/bond1/bonding/mode
echo 100 > /sys/class/net/bond1/bonding/miimon
ifconfig bond1 xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx
echo +eth2 > /sys/class/net/bond1/bonding/slaves
echo +eth3 > /sys/class/net/bond1/bonding/slaves

Pass some traffic on bond0.  Boom.

[ Tested, behaves as advertised.  I do not believe a test of the bonding
mode is necessary, as there is no race between the packet handler and
the bonding mode changing (the mode can only change when the device is
closed).  Also updated the log message to include the reproduction and
full commit ids.  -J ]

Signed-off-by: Greg Edwards <greg.edwards@hp.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Acked-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Fri, 23 Jul 2010 21:03:38 +0000 (14:03 -0700)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6

Conflicts:
drivers/net/wireless/iwlwifi/iwl-commands.h

13 years ago3c59x: Fix call to mdio_sync() with the wrong argument
Ben Hutchings [Thu, 22 Jul 2010 14:18:28 +0000 (14:18 +0000)]
3c59x: Fix call to mdio_sync() with the wrong argument

commit a095cfc40ec7ebe63e9532383c5b5c2a27b14075
"3c59x: Specify window explicitly for access to windowed registers"
changed the first parameter to mdio_sync(), from a pointer to the
register mapping, to a pointer to the vortex_private structure,
and changed all but one of the call sites.  Fix that last one.

Reported-by: Luca Falavigna <dktrkranz@debian.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: s2io: fix buffer overflow
Kulikov Vasiliy [Fri, 23 Jul 2010 06:36:15 +0000 (06:36 +0000)]
net: s2io: fix buffer overflow

vpd_data[] is allocated as kmalloc(256, GFP_KERNEL), so if cnt = 255
then (cnt + 3) overflows 256. memset() is executed without checking.
vpd_data[cnt+2] must be less than 256-cnt-2 as the latter is number of
vpd_data[] elements to copy.

Do not fill with zero the beginning of nic->serial_num as it will
be filled with vpd_data[].

String in product_name[] should be terminated by '\0'.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agomv643xx_eth: potential null dereference
Dan Carpenter [Fri, 23 Jul 2010 01:05:05 +0000 (01:05 +0000)]
mv643xx_eth: potential null dereference

We assume that "pd" can be null on the previous line, and throughout the
function so we should check it here as well.  This was introduced by
9b2c2ff7a1c0 "mv643xx_eth: use sw csum for big packets"

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: 3c59x: fix leak of iomaps
Kulikov Vasiliy [Fri, 23 Jul 2010 06:44:44 +0000 (06:44 +0000)]
net: 3c59x: fix leak of iomaps

If vortex_probe1() fails we should unmap ioaddr mapped earlier.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: core: don't use own hex_to_bin() method
Andy Shevchenko [Fri, 23 Jul 2010 03:18:10 +0000 (03:18 +0000)]
net: core: don't use own hex_to_bin() method

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agowireless: use newly introduced hex_to_bin()
Andy Shevchenko [Fri, 23 Jul 2010 03:18:09 +0000 (03:18 +0000)]
wireless: use newly introduced hex_to_bin()

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Corey Thomas <coreythomas@charter.net>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agousb: usbnet: use newly introduced hex_to_bin()
Andy Shevchenko [Fri, 23 Jul 2010 03:18:08 +0000 (03:18 +0000)]
usb: usbnet: use newly introduced hex_to_bin()

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: linux-usb@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers: net: use newly introduced hex_to_bin()
Andy Shevchenko [Fri, 23 Jul 2010 03:18:07 +0000 (03:18 +0000)]
drivers: net: use newly introduced hex_to_bin()

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers: atm: don't use private copy of hex_to_bin()
Andy Shevchenko [Fri, 23 Jul 2010 03:18:06 +0000 (03:18 +0000)]
drivers: atm: don't use private copy of hex_to_bin()

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Chas Williams <chas@cmf.nrl.navy.mil>
Cc: linux-atm-general@lists.sourceforge.net
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobe2net: bump the driver version number
Ajit Khaparde [Fri, 23 Jul 2010 02:05:36 +0000 (02:05 +0000)]
be2net: bump the driver version number

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobe2net: variable name changes
Ajit Khaparde [Fri, 23 Jul 2010 02:04:54 +0000 (02:04 +0000)]
be2net: variable name changes

This patch changes names of some variables.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobe2net: supress printing error when mac query fails for VF
Ajit Khaparde [Fri, 23 Jul 2010 19:42:40 +0000 (12:42 -0700)]
be2net: supress printing error when mac query fails for VF

When a virtual function driver in initialized, the network mac
query command can fail. Skip display of error message in that case.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobe2net: code to support tx rate configuration on virtual functions
Ajit Khaparde [Fri, 23 Jul 2010 01:52:13 +0000 (01:52 +0000)]
be2net: code to support tx rate configuration on virtual functions

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobe2net: add vlan support for sriov virtual functions
Ajit Khaparde [Fri, 23 Jul 2010 01:51:22 +0000 (01:51 +0000)]
be2net: add vlan support for sriov virtual functions

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobe2net: add support to get vf config
Ajit Khaparde [Fri, 23 Jul 2010 01:50:34 +0000 (01:50 +0000)]
be2net: add support to get vf config

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobe2net: change to call pmac_del only if necessary
Ajit Khaparde [Fri, 23 Jul 2010 01:49:04 +0000 (01:49 +0000)]
be2net: change to call pmac_del only if necessary

If a mac address has not been configured for a VF,
there is no need to call be_cmd_pmac_del.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqeth: avoid useless removal of multicast addresses
Ursula Braun [Thu, 22 Jul 2010 23:15:10 +0000 (23:15 +0000)]
qeth: avoid useless removal of multicast addresses

Function qeth_l2_remove_device invokes qeth_l2_del_all_mc at the end.
This is needless, because it is already called in the offline function.
And even more this is invalid, because multicast addresses cannot be
removed in DOWN state. Thus this patch deletes invocation of
qeth_l2_del_all_mc in function qeth_l2_remove_device.

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: Use memdup_user when user data is immediately copied into the allocated region.
Julia Lawall [Thu, 22 Jul 2010 23:15:09 +0000 (23:15 +0000)]
qeth: Use memdup_user when user data is immediately copied into the allocated region.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression from,to,size,flag;
position p;
identifier l1,l2;
@@

-  to = \(kmalloc@p\|kzalloc@p\)(size,flag);
+  to = memdup_user(from,size);
   if (
-      to==NULL
+      IS_ERR(to)
                 || ...) {
   <+... when != goto l1;
-  -ENOMEM
+  PTR_ERR(to)
   ...+>
   }
-  if (copy_from_user(to, from, size) != 0) {
-    <+... when != goto l2;
-    -EFAULT
-    ...+>
-  }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqeth: return zero from reply callback functions
Ursula Braun [Thu, 22 Jul 2010 23:15:08 +0000 (23:15 +0000)]
qeth: return zero from reply callback functions

Reply callback functions in qeth should return zero if command
response consists of one part only, otherwise qeth continues
waiting for further parts of the command response.

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 agoclaw: A claw device is a group of just 2 ccw devices
Ursula Braun [Thu, 22 Jul 2010 23:15:07 +0000 (23:15 +0000)]
claw: A claw device is a group of just 2 ccw devices

When creating a claw device, just 2 subchannels have to be grouped.

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: avoid loop if ipa command response is missing
Ursula Braun [Thu, 22 Jul 2010 23:15:06 +0000 (23:15 +0000)]
qeth: avoid loop if ipa command response is missing

If qeth issues an ipa command, but for some reasons the response
never comes back, qeth reaches a timeout.
Reset the irq_pending flag of the write channel in timeout handling
code and trigger a recovery to avoid endless looping for the following
ipa command.

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: serialize sysfs-triggered device configurations
Ursula Braun [Thu, 22 Jul 2010 23:15:05 +0000 (23:15 +0000)]
qeth: serialize sysfs-triggered device configurations

This patch serializes device removal and other sysfs-triggered
configurations by moving removal of sysfs-attributes to the beginning
of the remove functions. And it serializes online/offline setting
and discipline-switching (causing reestablishing of the net_device)
by making use of a new discipline mutex.

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: Clear mac_bits field when switching between Layer 2 and Layer 3
Carsten Otte [Thu, 22 Jul 2010 23:15:04 +0000 (23:15 +0000)]
qeth: Clear mac_bits field when switching between Layer 2 and Layer 3

This patch fixes a problem that occurs when switching from layer 3 to layer 2
mode. Resetting this mac_bits makes sure that we retrieve our mac address from
the card, otherwise the interface simply would'nt work.

Signed-off-by: Carsten Otte <cotte@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: IP address takeover flag setting
Klaus-Dieter Wacker [Thu, 22 Jul 2010 23:15:03 +0000 (23:15 +0000)]
qeth: IP address takeover flag setting

The qeth IP address flag setting is possible when device is
offline. When setting device online afterwards the current set
IP addresses have to be correctly registered with the device
regarding the IP address takeover attribute.

Signed-off-by: Klaus-Dieter Wacker <kdwacker@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoiwlwifi: remove spurious semicolons
Johannes Berg [Thu, 15 Jul 2010 18:48:21 +0000 (11:48 -0700)]
iwlwifi: remove spurious semicolons

defines shouldn't be terminated with a
semicolon, the code using them should
supply it. Luckily these are not used
in a context where it matters.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>