Archived
14
0
Fork 0
Commit graph

21504 commits

Author SHA1 Message Date
Stanislaw Gruszka
ac59b496d9 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>
2010-07-27 14:59:59 -04:00
Stanislaw Gruszka
1279f5edb6 rt2500usb: write keys to proper registers
Fix rt2500usb hardware encryption broken by commit
96b61bafe2
"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>
2010-07-27 14:59:59 -04:00
Senthil Balasubramanian
aaa41ec425 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>
2010-07-27 14:59:59 -04:00
Senthil Balasubramanian
812c7c35a0 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>
2010-07-27 14:59:58 -04:00
Senthil Balasubramanian
1d9d06a27a 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>
2010-07-27 14:59:58 -04:00
Senthil Balasubramanian
f63b340d1b 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>
2010-07-27 14:59:58 -04:00
John W. Linville
1b2fb7dc71 p54: Added get_survey callback in order to get channel noise
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-27 14:59:58 -04:00
Linus Torvalds
a376bca610 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  s2io: fixing DBG_PRINT() macro
  ath9k: fix dma direction for map/unmap in ath_rx_tasklet
  net: dev_forward_skb should call nf_reset
  net sched: fix race in mirred device removal
  tun: avoid BUG, dump packet on GSO errors
  bonding: set device in RLB ARP packet handler
  wimax/i2400m: Add PID & VID for Intel WiMAX 6250
  ipv6: Don't add routes to ipv6 disabled interfaces.
  net: Fix skb_copy_expand() handling of ->csum_start
  net: Fix corruption of skb csum field in pskb_expand_head() of net/core/skbuff.c
  macvtap: Limit packet queue length
  ixgbe/igb: catch invalid VF settings
  bnx2x: Advance a module version
  bnx2x: Protect statistics ramrod and sequence number
  bnx2x: Protect a SM state change
  wireless: use netif_rx_ni in ieee80211_send_layer2_update
2010-07-27 09:21:00 -07:00
John W. Linville
800f65bba8 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
2010-07-27 11:59:19 -04:00
Emil Tantilov
feb8f47809 e1000: use netif_<level> instead of netdev_<level>
This patch restores the ability to set msglvl through ethtool.
The issue was introduced by:
commit 675ad47375

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>
2010-07-26 23:37:21 -07:00
Kulikov Vasiliy
66cc42a4bc 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>
2010-07-26 21:05:04 -07:00
Richard Röjfors
db5824dd3d 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>
2010-07-26 21:05:03 -07:00
Dan Carpenter
7b7b0b9059 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>
2010-07-26 21:05:03 -07:00
Jonas Bonn
f78f09f765 ethoc: add devinit/devexit section initializers
Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-26 18:45:05 -07:00
Nick Nunley
08451e2587 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>
2010-07-26 18:42:53 -07:00
Nick Nunley
4085f746db 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>
2010-07-26 18:42:53 -07:00
Jean Delvare
ea7afd31fb 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>
2010-07-26 18:42:52 -07:00
Breno Leitao
5447080cfa s2io: fixing DBG_PRINT() macro
Patch 9e39f7c5b3 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>
2010-07-26 15:37:30 -07:00
David S. Miller
a9ad99a612 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2010-07-26 13:26:09 -07:00
Joe Perches
d7f61777e9 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>
2010-07-26 13:15:21 -07:00
Joe Perches
eddc5fbd80 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>
2010-07-26 13:15:21 -07:00
Ivo van Doorn
06b3cda0c1 rt2x00: Fix regression for rt2500pci
Since commit:
     commit f1aa4c541e
     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>
2010-07-26 15:32:43 -04:00
Felix Fietkau
487f0e010c 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>
2010-07-26 15:32:42 -04:00
Felix Fietkau
d9292c0db7 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>
2010-07-26 15:32:42 -04:00
Felix Fietkau
866b7780fc 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>
2010-07-26 15:32:42 -04:00
Felix Fietkau
4cee78614c 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>
2010-07-26 15:32:42 -04:00
Dan Carpenter
bd75eb8543 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>
2010-07-26 15:32:42 -04:00
Vasanthakumar Thiagarajan
68e8f2fae0 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>
2010-07-26 15:32:41 -04:00
Dan Carpenter
2189d13f6c 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>
2010-07-26 15:32:41 -04:00
Dan Carpenter
9746010bd3 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>
2010-07-26 15:32:41 -04:00
Julia Lawall
929ebd30e4 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>
2010-07-26 15:32:40 -04:00
John W. Linville
3289a8368c lib80211: remove unused host_build_iv option
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-26 15:09:04 -04:00
John W. Linville
a6e492b9b5 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>
2010-07-26 15:09:04 -04:00
John W. Linville
28eb3e5acf 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>
2010-07-26 15:09:03 -04:00
John W. Linville
8b73fb8e29 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>
2010-07-26 15:09:03 -04:00
John W. Linville
1ab36d68e3 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>
2010-07-26 15:09:03 -04:00
John W. Linville
da22f795ce 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>
2010-07-26 15:04:12 -04:00
Ming Lei
f792af250d 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>
2010-07-26 14:41:04 -04:00
Ralf Baechle
3852cc3343 NET: declance: Fix section mismatches
WARNING: drivers/net/built-in.o(.data+0x24): Section mismatch in reference from
the variable dec_lance_tc_driver to the function .init.text:dec_lance_tc_probe()
The variable dec_lance_tc_driver references
the function __init dec_lance_tc_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

Fixing this one results in a new mismatch:

WARNING: drivers/net/built-in.o(.devinit.text+0x14): Section mismatch in reference from the function dec_lance_tc_probe() to the function .init.text:dec_lance_probe()
The function __devinit dec_lance_tc_probe() references
a function __init dec_lance_probe().
If dec_lance_probe is only used by dec_lance_tc_probe then
annotate dec_lance_probe with a matching annotation.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-07-26 19:08:14 +01:00
Mike Ditto
7b5e078cf0 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>
2010-07-25 21:54:28 -07:00
Bhavesh Davda
1f4b161284 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>
2010-07-25 17:06:52 -07:00
Andrew O. Shadoura
690a1f2002 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>
2010-07-25 16:48:44 -07:00
Sony Chacko
57e46248a7 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>
2010-07-25 16:32:41 -07:00
Amit Kumar Salecha
36a1898ddf 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>
2010-07-25 16:32:40 -07:00
David S. Miller
76ac21f5ef Merge branch 'wimax-2.6.35.y' of git://git.kernel.org/pub/scm/linux/kernel/git/inaky/wimax 2010-07-24 20:51:45 -07:00
Michael S. Tsirkin
ef3db4a595 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>
2010-07-24 20:47:20 -07:00
Eric Dumazet
55bad82385 ixgbe: fix ethtool stats
In latest changes about 64bit stats on 32bit arches,
[commit 28172739f0 (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>
2010-07-24 20:43:19 -07:00
Rajesh Borundia
9963a8bde6 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>
2010-07-24 20:42:18 -07:00
Greg Edwards
d8190dff01 bonding: set device in RLB ARP packet handler
After:

commit 6146b1a4da
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 1f3c8804ac
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>
2010-07-24 20:37:48 -07:00
David S. Miller
2a88e7e559 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
2010-07-23 14:03:38 -07:00
Ben Hutchings
344e0f623c 3c59x: Fix call to mdio_sync() with the wrong argument
commit a095cfc40e
"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>
2010-07-23 13:05:13 -07:00
Kulikov Vasiliy
9c17978089 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>
2010-07-23 13:05:13 -07:00
Dan Carpenter
50a749c1f2 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
9b2c2ff7a1 "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>
2010-07-23 13:05:12 -07:00
Kulikov Vasiliy
f89f5d0e94 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>
2010-07-23 13:05:12 -07:00
Andy Shevchenko
882d829a23 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>
2010-07-23 12:50:51 -07:00
Andy Shevchenko
fd1f170dfc 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>
2010-07-23 12:50:50 -07:00
Andy Shevchenko
5c4ac8c60a 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>
2010-07-23 12:50:50 -07:00
Ajit Khaparde
e261984309 be2net: bump the driver version number
Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-23 12:42:47 -07:00
Ajit Khaparde
3486be29e6 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>
2010-07-23 12:42:46 -07:00
Ajit Khaparde
8943807c21 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>
2010-07-23 12:42:40 -07:00
Ajit Khaparde
e1d187353f 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>
2010-07-23 12:41:41 -07:00
Ajit Khaparde
1da87b7faf 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>
2010-07-23 12:40:53 -07:00
Ajit Khaparde
64600ea5f3 be2net: add support to get vf config
Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-23 12:40:53 -07:00
Ajit Khaparde
9cd9000bde 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>
2010-07-23 12:40:52 -07:00
Johannes Berg
1bd14eaf9e 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>
2010-07-23 08:42:45 -07:00
Johannes Berg
6abbe554ba iwlwifi: reduce beacon fill conditions
Since the ibss_beacon variable will only be
filled in the appropriate modes, there's no
reason to be checking the mode again.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-07-23 08:42:40 -07:00
Wey-Yi Guy
c6fa17ed3f iwlwifi: read multiple MAC addresses
Some devices may have multiple MAC
addresses in their EEPROM, read them
and advertise them to cfg80211.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2010-07-23 08:42:31 -07:00
Johannes Berg
0bc5774f4e iwlwifi: make iwl_mac_beacon_update static
This function is only needed in the same
file it is defined in, i.e. iwl-core.c

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-07-23 08:42:18 -07:00
Johannes Berg
704da534af iwlagn: fix firmware loading TLV error path
gcc complains about the firmware loading:

iwl-agn.c: In function ‘iwlagn_load_firmware’:
iwl-agn.c:1860: warning: ‘tlv_len’ may be used uninitialized in this function
iwl-agn.c:1861: warning: ‘tlv_type’ may be used uninitialized in this function
iwl-agn.c:1862: warning: ‘tlv_data’ may be used uninitialized in this function

This is almost correct but we do do break out of the TLV
parsing loop when setting ret. However, the code is hard
to follow, and clearly even the compiler is having issues
with it too.

Additionally, however, the current code is wrong. If there
is a TLV length check error, the code will report
	invalid TLV after parsing: ...
because "len" will still be non-zero as we broke out of
the loop.

So to remove the warning and fix that issue, make the code
easier to read by doing length checking with an error label.
As a result, we can completely remove the "ret" variable.

Also, while at it, remove the "fixed_tlv_size" variable
since each TLV type has its own specified length, it just
happens that we have only variable length, flags (0 length)
and u32 TLVs right now. It should still be checked with more
explicit length checks to make it easier to understand.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-07-23 08:42:04 -07:00
Wey-Yi Guy
6a822d060c iwlwifi: add TLV to specify the size of phy calibration table
Different devices have different size of phy calibration table; add
new TLV to specify the size. If the TLV is not part of uCode header, the
default table size will be used to make sure the backward
compatibilities.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-07-23 08:41:46 -07:00
Wey-Yi Guy
ffb7d896b3 iwlagn: add bluetooth stats to debugfs
For WiFi/BT combo devices, add bluetooth statistics counter
read function to debugfs.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-07-23 08:41:32 -07:00
Wey-Yi Guy
7980fba54e iwlagn: Add support for bluetooth statistics notification
WiFi/BT combo devices has different statistics notification
structure, adding the support here to make sure the structure
align correctly.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-07-23 08:41:18 -07:00
Wey-Yi Guy
af8ee0553b iwlagn: add .cfg flag to idenfity the need for bt statistics
Only WiFi/BT combo devices need to use bluetooth version of statistics
notification; adding the flag in .cfg file to indicate the need for
using different data structure.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-07-23 08:41:04 -07:00
Wey-Yi Guy
325322ee34 iwlagn: add statistic notification structure for WiFi/BT devices
If its WiFi/BT combo device, the statistics notification sent by
uCode will include the additional BT related statistics counters.

Adding new data structure to support the new layout.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-07-23 08:40:47 -07:00
Alexey Shvetsov
41a8730c23 wimax/i2400m: Add PID & VID for Intel WiMAX 6250
This version of intel wimax device was found in my IBM ThinkPad x201

Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
2010-07-22 14:50:34 -07:00
Dan Carpenter
1ff219068c stmmac: handle allocation errors in setup functions
If the allocations fail in either dwmac1000_setup() or dwmac100_setup()
then return NULL.  These are called from stmmac_mac_device_setup().  The
check for NULL returns in stmmac_mac_device_setup() needed to be moved
forward a couple lines.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-22 14:14:48 -07:00
Jay Vosburgh
03dc2f4c52 bonding: don't lock when copying/clearing VLAN list on slave
When copying VLAN information to or removing from a slave
during slave addition or removal, the bonding code currently holds
the bond->lock for write to prevent concurrent modification of the
vlan_list / vlgrp.

	This is unnecessary, as all of these operations occur under
RTNL.  Holding the bond->lock also caused might_sleep issues for
some drivers' ndo_vlan_* functions.  This patch removes the extra
locking.

	Problem reported by Michael Chan <mchan@broadcom.com>

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Cc: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-22 14:14:47 -07:00
Jay Vosburgh
f35188faa0 bonding: change test for presence of VLANs
After commit ad1afb0039
("vlan_dev: VLAN 0 should be treated as "no vlan tag" (802.1p packet)")
it is now regular practice for a VLAN "add vid" for VLAN 0 to
arrive prior to any VLAN registration or creation of a vlan_group.

	This patch updates the bonding code that tests for the presence
of VLANs configured above bonding.  The new logic tests for bond->vlgrp
to determine if a registration has occured, instead of testing that
bonding's internal vlan_list is empty.

	The old code would panic when vlan_list was not empty, but
vlgrp was still NULL (because only an "add vid" for VLAN 0 had occured).

	Bonding still adds VLAN 0 to its internal list so that 802.1p
frames are handled correctly on transmit when non-VLAN accelerated
slaves are members of the bond.  The test against bond->vlan_list
remains in bond_dev_queue_xmit for this reason.

	Modification to the bond->vlgrp now occurs under lock (in
addition to RTNL), because not all inspections of it occur under RTNL.

	Additionally, because 8021q will never issue a "kill vid" for
VLAN 0, there is now logic in bond_uninit to release any remaining
entries from vlan_list.

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Cc: Pedro Garcia <pedro.netdev@dondevamos.com>
Cc: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-22 14:14:46 -07:00
Wolfram Sang
4bee1f9ac0 net/fec: restore interrupt mask after software-reset in fec_stop()
After the change from mdio polling to irq, it became necessary to
restore the interrupt mask after resetting the chip in fec_stop().
Otherwise, with all irqs disabled, no communication with the PHY will be
possible after e.g. un-/replugging the cable and the device gets
stalled.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-22 14:14:46 -07:00
Kulikov Vasiliy
8cd47ea19b 3c59x: handle pci_iomap() errors
pci_iomap() can fail, handle this case and return -ENOMEM from probe
function.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-22 14:07:36 -07:00
Herbert Xu
8a35747a5d macvtap: Limit packet queue length
Mark Wagner reported OOM symptoms when sending UDP traffic over
a macvtap link to a kvm receiver.

This appears to be caused by the fact that macvtap packet queues
are unlimited in length.  This means that if the receiver can't
keep up with the rate of flow, then we will hit OOM. Of course
it gets worse if the OOM killer then decides to kill the receiver.

This patch imposes a cap on the packet queue length, in the same
way as the tuntap driver, using the device TX queue length.

Please note that macvtap currently has no way of giving congestion
notification, that means the software device TX queue cannot be
used and packets will always be dropped once the macvtap driver
queue fills up.

This shouldn't be a great problem for the scenario where macvtap
is used to feed a kvm receiver, as the traffic is most likely
external in origin so congestion notification can't be applied
anyway.

Of course, if anybody decides to complain about guest-to-guest
UDP packet loss down the track, then we may have to revisit this.

Incidentally, this patch also fixes a real memory leak when
macvtap_get_queue fails.

Chris Wright noticed that for this patch to work, we need a
non-zero TX queue length.  This patch includes his work to change
the default macvtap TX queue length to 500.

Reported-by: Mark Wagner <mwagner@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Chris Wright <chrisw@sous-sol.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-22 13:08:56 -07:00
Marc Kleine-Budde
e955cead03 CAN: Add Flexcan CAN controller driver
This core is found on some Freescale SoCs and also some Coldfire
SoCs. Support for Coldfire is missing though at the moment as
they have an older revision of the core which does not have RX FIFO
support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2010-07-22 18:06:25 +02:00
David S. Miller
4cfa580e7e r6040: Fix args to phy_mii_ioctl().
Reported by Stephen Rothwell.

Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-21 21:10:49 -07:00
Kulikov Vasiliy
2e4e7a97ed drivers/net/irda: use for_each_pci_dev()
Use for_each_pci_dev() to simplify the code.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-21 14:44:28 -07:00
Joe Perches
2037d5aa25 drivers/net/qlge: Use pr_<level>, shrink text a bit
Add and use a few neatening macros
Remove PFX
Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Convert printk(KERN_ERR to pr_err(

$ size drivers/net/qlge/built-in.o.*
  text	   data	    bss	    dec	    hex	filename
 116456	   2312	  25712	 144480	  23460	drivers/net/qlge/built-in.o.old
 114909	   2312	  25728	 142949	  22e65	drivers/net/qlge/built-in.o.new

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-21 14:44:18 -07:00
Andy Gospodarek
bded64a7ff ixgbe/igb: catch invalid VF settings
Some ixgbe cards put an invalid VF device ID in the PCIe SR-IOV
capability.  The ixgbe driver is only valid for PFs or non SR-IOV
hardware.  It seems that the same problem could occur on igb hardware as
well, so if we discover we are trying to initialize a VF in ixbge_probe
or igb_probe, print an error and exit.

Based on a patch for ixgbe from Chris Wright <chrisw@sous-sol.org>.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Cc: Chris Wright <chrisw@sous-sol.org>
Acked-by: Chris Wright <chrisw@sous-sol.org>
Acked-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-21 13:48:55 -07:00
Larry Finger
acd82aa868 b43: silence phy_n sparse warnings
drivers/net/wireless/b43/phy_n.c:512:53: warning: cast truncates bits from constant value (ffff0fff becomes fff)
drivers/net/wireless/b43/phy_n.c:765:66: warning: cast truncates bits from constant value (ffff7fff becomes 7fff)
drivers/net/wireless/b43/phy_n.c:1012:38: warning: cast truncates bits from constant value (ffff00ff becomes ff)
drivers/net/wireless/b43/phy_n.c:1119:38: warning: cast truncates bits from constant value (ffff0fff becomes fff)
drivers/net/wireless/b43/phy_n.c:2458:56: warning: cast truncates bits from constant value (ffff7fff becomes 7fff)
drivers/net/wireless/b43/phy_n.c:2933:38: warning: cast truncates bits from constant value (ffff0fff becomes fff)
drivers/net/wireless/b43/phy_n.c:3294:57: warning: cast truncates bits from constant value (ffff3fff becomes 3fff)

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-21 14:49:46 -04:00
John W. Linville
41950bdfb5 b43: silence most sparse warnings
CHECK   drivers/net/wireless/b43/main.c
drivers/net/wireless/b43/main.c:111:5: warning: symbol 'b43_modparam_pio' was not declared. Should it be static?
  CHECK   drivers/net/wireless/b43/phy_g.c
drivers/net/wireless/b43/phy_g.c:975:56: warning: cast truncates bits from constant value (ffff7fff becomes 7fff)
  CHECK   drivers/net/wireless/b43/phy_lp.c
drivers/net/wireless/b43/phy_lp.c:2701:6: warning: symbol 'b43_lpphy_op_switch_analog' was not declared. Should it be static?
drivers/net/wireless/b43/phy_lp.c:1148:30: warning: cast truncates bits from constant value (ffff1fff becomes 1fff)
drivers/net/wireless/b43/phy_lp.c:1525:30: warning: cast truncates bits from constant value (ffff1fff becomes 1fff)
drivers/net/wireless/b43/phy_lp.c:1529:30: warning: cast truncates bits from constant value (ffff1fff becomes 1fff)
  CHECK   drivers/net/wireless/b43/wa.c
drivers/net/wireless/b43/wa.c:385:60: warning: cast truncates bits from constant value (ffff00ff becomes ff)
drivers/net/wireless/b43/wa.c:403:55: warning: cast truncates bits from constant value (ffff00ff becomes ff)
drivers/net/wireless/b43/wa.c:405:55: warning: cast truncates bits from constant value (ffff00ff becomes ff)
drivers/net/wireless/b43/wa.c:415:71: warning: cast truncates bits from constant value (ffff0fff becomes fff)

AFAICT, none of these amount to real bugs.  But this reduces warning
spam from sparse w/o significantly affecting readability of the code (IMHO).

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-21 14:37:38 -04:00
Andy Shevchenko
df1086fb2e drivers/net/cxgb3/t3_hw.c: use new hex_to_bin() method
Get rid of own implementation of hex_to_bin().

Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Acked-by: Divy Le Ray <divy@chelsio.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-21 11:16:09 -07:00
Vladislav Zolotarov
0577589cc1 bnx2x: Advance a module version
Advance a module version to 1.52.53-2.

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-21 11:11:56 -07:00
Vladislav Zolotarov
d0996faeec bnx2x: Protect statistics ramrod and sequence number
Bug fix: Protect statistics ramrod sending code and a statistics counter update
with a spinlock. Otherwise there was a race condition that would allow sending
a statistics ramrods with the same sequence number or with sequence numbers not
in a natural order, which would cause a FW assert.

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-21 11:11:55 -07:00
Vladislav Zolotarov
a13773a53f bnx2x: Protect a SM state change
Bug fix: Protect the statistics state machine state update with a
spinlock.  Otherwise there was a race condition that would cause the
statistics to stay enabled despite the fact that they were disabled in
the LINK_DOWN event handler.

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-21 11:11:54 -07:00
David S. Miller
11fe883936 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/vhost/net.c
	net/bridge/br_device.c

Fix merge conflict in drivers/vhost/net.c with guidance from
Stephen Rothwell.

Revert the effects of net-2.6 commit 573201f36f
since net-next-2.6 has fixes that make bridge netpoll work properly thus
we don't need it disabled.

Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-20 18:25:24 -07:00
Linus Torvalds
516bd66415 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (24 commits)
  bridge: Partially disable netpoll support
  tcp: fix crash in tcp_xmit_retransmit_queue
  IPv6: fix CoA check in RH2 input handler (mip6_rthdr_input())
  ibmveth: lost IRQ while closing/opening device leads to service loss
  rt2x00: Fix lockdep warning in rt2x00lib_probe_dev()
  vhost: avoid pr_err on condition guest can trigger
  ipmr: Don't leak memory if fib lookup fails.
  vhost-net: avoid flush under lock
  net: fix problem in reading sock TX queue
  net/core: neighbour update Oops
  net: skb_tx_hash() fix relative to skb_orphan_try()
  rfs: call sock_rps_record_flow() in tcp_splice_read()
  xfrm: do not assume that template resolving always returns xfrms
  hostap_pci: set dev->base_addr during probe
  axnet_cs: use spin_lock_irqsave in ax_interrupt
  dsa: Fix Kconfig dependencies.
  act_nat: not all of the ICMP packets need an IP header payload
  r8169: incorrect identifier for a 8168dp
  Phonet: fix skb leak in pipe endpoint accept()
  Bluetooth: Update sec_level/auth_type for already existing connections
  ...
2010-07-20 16:26:42 -07:00
John W. Linville
8b74964c73 rtl8180: improve signal reporting for rtl8185 hardware
The existing code seemed to be somewhat based on the datasheet, but
varied substantially from the vendor-provided driver.  This mirrors the
handling of the rtl8185 case from that driver, but still neglects the
specifics for the rtl8180 hardware.  Those details are a bit muddled...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-20 16:53:09 -04:00
John W. Linville
b603742f49 mwl8k: correct/silence sparse warnings
drivers/net/wireless/mwl8k.c:1541:21: warning: incorrect type in assignment (different base types)
drivers/net/wireless/mwl8k.c:1541:21:    expected restricted __le16 [usertype] result
drivers/net/wireless/mwl8k.c:1541:21:    got int
drivers/net/wireless/mwl8k.c:1575:42:    expected unsigned short [unsigned] [usertype] cmd
drivers/net/wireless/mwl8k.c:1575:42:    got restricted __le16 [usertype] code
drivers/net/wireless/mwl8k.c:1587:50: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/mwl8k.c:1587:50:    expected unsigned short [unsigned] [usertype] cmd
drivers/net/wireless/mwl8k.c:1587:50:    got restricted __le16 [usertype] code
drivers/net/wireless/mwl8k.c:1592:50: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/mwl8k.c:1592:50:    expected unsigned short [unsigned] [usertype] cmd
drivers/net/wireless/mwl8k.c:1592:50:    got restricted __le16 [usertype] code
drivers/net/wireless/mwl8k.c:1845:27: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/mwl8k.c:1845:27:    expected unsigned int [unsigned] [usertype] <noident>
drivers/net/wireless/mwl8k.c:1845:27:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/mwl8k.c:1848:27: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/mwl8k.c:1848:27:    expected unsigned int [unsigned] [usertype] <noident>
drivers/net/wireless/mwl8k.c:1848:27:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/mwl8k.c:1851:27: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/mwl8k.c:1851:27:    expected unsigned int [unsigned] [usertype] <noident>
drivers/net/wireless/mwl8k.c:1851:27:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/mwl8k.c:1854:27: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/mwl8k.c:1854:27:    expected unsigned int [unsigned] [usertype] <noident>
drivers/net/wireless/mwl8k.c:1854:27:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/mwl8k.c:1857:27: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/mwl8k.c:1857:27:    expected unsigned int [unsigned] [usertype] <noident>
drivers/net/wireless/mwl8k.c:1857:27:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/mwl8k.c:1860:27: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/mwl8k.c:1860:27:    expected unsigned int [unsigned] [usertype] <noident>
drivers/net/wireless/mwl8k.c:1860:27:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/mwl8k.c:3055:20: warning: incorrect type in assignment (different base types)
drivers/net/wireless/mwl8k.c:3055:20:    expected restricted __le16 [usertype] ht_caps
drivers/net/wireless/mwl8k.c:3055:20:    got unsigned short [unsigned] [usertype] cap

At least the last one looks like a real bug...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
2010-07-20 16:49:42 -04:00
John W. Linville
1612454132 rt2x00: correct sparse warning in rt2x00debug.c
CHECK   drivers/net/wireless/rt2x00/rt2x00debug.c
drivers/net/wireless/rt2x00/rt2x00debug.c:193:28: warning: incorrect type in assignment (different base types)
drivers/net/wireless/rt2x00/rt2x00debug.c:193:28:    expected restricted __le32 [usertype] chip_rev
drivers/net/wireless/rt2x00/rt2x00debug.c:193:28:    got restricted __le16 [usertype] <noident>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
2010-07-20 16:49:41 -04:00
John W. Linville
cc40cc56f4 libipw: correct sparse warnings and mark some variables static
CHECK   drivers/net/wireless/ipw2x00/libipw_module.c
drivers/net/wireless/ipw2x00/libipw_module.c:65:21: warning: symbol 'libipw_config_ops' was not declared. Should it be static?
drivers/net/wireless/ipw2x00/libipw_module.c:66:6: warning: symbol 'libipw_wiphy_privid' was not declared. Should it be static?
  CHECK   drivers/net/wireless/ipw2x00/libipw_wx.c
drivers/net/wireless/ipw2x00/libipw_wx.c:415:17: warning: symbol 'ssid' shadows an earlier one
drivers/net/wireless/ipw2x00/libipw_wx.c:324:9: originally declared here

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-20 16:49:40 -04:00
John W. Linville
d267be307a ipw2100: mark ipw2100_pm_qos_req static
CHECK   drivers/net/wireless/ipw2x00/ipw2100.c
drivers/net/wireless/ipw2x00/ipw2100.c:177:28: warning: symbol 'ipw2100_pm_qos_req' was not declared. Should it be static?

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-20 16:49:39 -04:00
John W. Linville
a3d3da14fb ath9k: correct sparse identified endian bug in ath_paprd_calibrate
drivers/net/wireless/ath/ath9k/main.c:282:26: warning: incorrect type in assignment (different base types)
drivers/net/wireless/ath/ath9k/main.c:282:26:    expected restricted __le16 [usertype] duration_id
drivers/net/wireless/ath/ath9k/main.c:282:26:    got int

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-20 16:49:39 -04:00
Giuseppe Cavallaro
dab1086362 phy: add suspend/resume in the ic+
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-20 13:24:25 -07:00
Johannes Berg
4ced3f74da mac80211: move QoS-enable to BSS info
Ever since

commit e1b3ec1a2a
Author: Stanislaw Gruszka <sgruszka@redhat.com>
Date:   Mon Mar 29 12:18:34 2010 +0200

    mac80211: explicitly disable/enable QoS

mac80211 is telling drivers, in particular
iwlwifi, whether QoS is enabled or not.

However, this is only relevant for station mode,
since only then will any device send nullfunc
frames and need to know whether they should be
QoS frames or not. In other modes, there are
(currently) no frames the device is supposed to
send.

When you now consider virtual interfaces, it
becomes apparent that the current mechanism is
inadequate since it enables/disables QoS on a
global scale, where for nullfunc frames it has
to be on a per-interface scale.

Due to the above considerations, we can change
the way mac80211 advertises the QoS state to
drivers to only ever advertise it as "off" in
station mode, and make it a per-BSS setting.

Tested-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-20 16:02:58 -04:00
Casey Leedom
c8639a827f cxgb4vf: Fix bug where we were only allocating one queue in MSI mode
Fix bug in setup_sge_queues() where we were incorrectly only allocating a
single "Queue Set" for MSI mode.

Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-20 12:42:43 -07:00
Casey Leedom
024e6293f9 cxgb4vf: Fix off-by-one error checking for the end of the mailbox delay array
Fix off-by-one error in checking for the end of the mailbox response delay
array.  We ended up walking off the end and, if we were unlucky, we'd end up
pulling in a 0 and never terminate the mailbox response delay loop ...

Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-20 12:42:42 -07:00
Michael Chan
5ae482e01d bnx2: Update version to 2.0.17.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 20:30:07 -07:00
Michael Chan
11848b9647 bnx2: Remove some unnecessary smp_mb() in tx fast path.
smp_mb() inside bnx2_tx_avail() is used twice in the normal
bnx2_start_xmit() path (see illustration below).  The full memory
barrier is only necessary during race conditions with tx completion.
We can speed up the tx path by replacing smp_mb() in bnx2_tx_avail()
with a compiler barrier.  The compiler barrier is to force the
compiler to fetch the tx_prod and tx_cons from memory.

In the race condition between bnx2_start_xmit() and bnx2_tx_int(),
we have the following situation:

bnx2_start_xmit()                       bnx2_tx_int()
    if (!bnx2_tx_avail())
            BUG();

    ...

    if (!bnx2_tx_avail())
            netif_tx_stop_queue();          update_tx_index();
            smp_mb();                       smp_mb();
            if (bnx2_tx_avail())            if (netif_tx_queue_stopped() &&
                    netif_tx_wake_queue();      bnx2_tx_avail())

With smp_mb() removed from bnx2_tx_avail(), we need to add smp_mb() to
bnx2_start_xmit() as shown above to properly order netif_tx_stop_queue()
and bnx2_tx_avail() to check the ring index.  If it is not strictly
ordered, the tx queue can be stopped forever.

This improves performance by about 5% with 2 ports running bi-directional
64-byte packets.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 20:30:06 -07:00
Michael Chan
379b39a2ad bnx2: Call pci_enable_msix() with actual number of vectors.
Based on original patch by Breno Leitão <leitao@linux.vnet.ibm.com>.

Allocate the actual number of vectors and make use of fewer vectors
if pci_enable_msix() returns > 0.  We must allocate one additional
vector for the cnic driver.

Cc: Breno Leitão <leitao@linux.vnet.ibm.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 20:30:06 -07:00
Michael Chan
6fdae99555 bnx2: Use proper counter for net_device_stats->multicast.
We were using the wrong tx multicast counter instead of the rx multicast
counter.

Reported-by: Peter Snellman <peter.snellman@cinnober.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 20:30:05 -07:00
Don Skidmore
99faf68e2b ixgbe: fix version string for ixgbe
Bump the version string to better reflect what is in the driver.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 20:23:38 -07:00
Yi Zou
5575044661 ixgbe: use GFP_ATOMIC when allocating FCoE DDP context from the dma pool
The FCoE protocol stack may hold a lock when this gets called.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 20:23:37 -07:00
Yi Zou
5e09d7f630 ixgbe: properly toggling netdev feature flags when disabling FCoE
When FCoE is disabled, there is a race condition that FCoE offload is
turned off but the FCoE protocol driver is still queuing I/O thinking
offload support still exists. This patch toggles off corresponding FCoE
netdev feature flags and notify the FCoE stack first, allowing FCoE
protocol stack driver to update its flags upon NETDEV_FEAT_CHANGE so no
I/O will be using offload.

Also, indicate FCoE offload flags in vlan_features in ixgbe_probe once
and do not toggle them in ixgbe_fcoe_enable/disable so when FCoE is
created on the VLAN interface, vlan_transfer_features() would properly
update the VLAN netdev features flag and notify the FCoE protocol driver
for NETDEV_FEAT_CHANGE.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 20:23:37 -07:00
Alexander Duyck
d6ea7c9ccc ixgbe: drop support for UDP in RSS hash generation
This change removes UDP from the supported protocols for RSS hashing.  The
reason for removing this protocol is because IP fragmentation was causing a
network flow to be broken into two streams, one for fragmented, and one for
non-fragmented and this in turn was causing out-of-order issues.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Acked-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 20:23:36 -07:00
John Fastabend
fca562ad63 ixgbe: dcb, set DPF bit when PFC is enabled
Set the DPF bit when PFC is enabled.  This will discard
PFC frames so they do not get passed up the stack.

The DPF bit is set for flow control, but not priority
flow control this brings pfc inline with fc.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 20:23:36 -07:00
Alexander Duyck
b59544649d e1000: allow option to limit number of descriptors down to 48 per ring
This change makes it possible to limit the number of descriptors down to 48
per ring.  The reason for this change is to address a variation on hardware
errata 10 for 82546GB in which descriptors will be lost if more than 32
descriptors are fetched and the PCI-X MRBC is 512.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 20:23:35 -07:00
Andrew Morton
653954825d drivers/net/82596.c: fix warning
drivers/net/82596.c: In function 'i596_open':
drivers/net/82596.c:1044: warning: label 'err_irq_dev' defined but not used

Caused by "82596: free resources on error"

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 15:27:13 -07:00
David S. Miller
e2df8b7f66 ks8842: Fix ks8842_tx_frame() for 16bit case.
As reported by Andrew:

drivers/net/ks8842.c: In function 'ks8842_handle_rx':
drivers/net/ks8842.c:428: warning: 'status' may be used uninitialized in this function

Just use the 32-bit status for all reads, and delete the useless
cast to 'int' when reading a u16 into 'len'.

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 15:25:04 -07:00
Catalin Marinas
492c5d943d smsc911x: Add spinlocks around registers access
On SMP systems, the SMSC911x registers may be accessed by multiple CPUs
and this seems to put the chip in an inconsistent state. The patch adds
spinlocks to the smsc911x_reg_read, smsc911x_reg_write,
smsc911x_rx_readfifo and smsc911x_tx_writefifo functions.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 13:36:21 -07:00
Eric Dumazet
90e1795b9b bonding: avoid a warning
drivers/net/bonding/bond_main.c:179:12: warning: ‘disable_netpoll’
defined but not used

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 13:34:16 -07:00
Christoph Egger
e6e4ec2f98 net: Removing dead ARCH_PNX010X
ARCH_PNX010X doesn't exist in Kconfig, therefore removing all
references for it from the source code/Kconfig.

Signed-off-by: Christoph Egger <siccegge@cs.fau.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 13:32:57 -07:00
Shreyas Bhatewara
0bdc0d70c5 net-next: vmxnet3 fixes [5/5] Respect the interrupt type in VM configuration
Respect the interrupt type set in VM configuration.

When interrupt type is not auto, do not ignore the interrupt type set from
VM configuration.

Signed-off-by: Shreyas Bhatewara <sbhatewara@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 13:15:50 -07:00
Shreyas Bhatewara
d9a5f210c5 net-next: vmxnet3 fixes [4/5] Do not reset when the device is not opened
Hold rtnl_lock to get the right link state.

While asynchronously resetting the device, hold rtnl_lock to get the
right value from netif_running. If a reset is scheduled, and the device
goes thru close and open, it may happen that reset and open may run in
parallel. Holding rtnl_lock will avoid this.

Signed-off-by: Shreyas Bhatewara <sbhatewara@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 13:15:50 -07:00
David S. Miller
b508998f66 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2010-07-19 12:38:51 -07:00
Eric Dumazet
db5dda9057 bonding: fix bond_inet6addr_event()
After commit ad1afb0039 (vlan_dev: VLAN 0 should be treated
as "no vlan tag" (802.1p packet)),
bond_inet6addr_event() might be called with a NULL bond->vlgrp pointer, and
a non empty bond->vlan_list. vlan_group_get_device() is dereferencing a NULL pointer.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 09:34:31 -07:00
Tobias Klauser
c26875e2e1 s2io: Remove unnecessary memset of netdev private data
The memory for the private data is allocated using kzalloc in
alloc_etherdev (or alloc_netdev_mq respectively) so there is no need to
set it to 0 again.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-19 09:28:11 -07:00
Uwe Kleine-König
25d1fbfdd9 fix comment typos concerning "challenge"
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-07-19 11:09:52 +02:00
Richard Cochran
c1f19b51d1 net: support time stamping in phy devices.
This patch adds a new networking option to allow hardware time stamps
from PHY devices. When enabled, likely candidates among incoming and
outgoing network packets are offered to the PHY driver for possible
time stamping. When accepted by the PHY driver, incoming packets are
deferred for later delivery by the driver.

The patch also adds phylib driver methods for the SIOCSHWTSTAMP ioctl
and callbacks for transmit and receive time stamping. Drivers may
optionally implement these functions.

Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-18 19:15:26 -07:00
Richard Cochran
28b041139e net: preserve ifreq parameter when calling generic phy_mii_ioctl().
The phy_mii_ioctl() function unnecessarily throws away the original ifreq.
We need access to the ifreq in order to support PHYs that can perform
hardware time stamping.

Two maverick drivers filter the ioctl commands passed to phy_mii_ioctl().
This is unnecessary since phylib will check the command in any case.

Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-18 19:15:25 -07:00
James Bottomley
82f682514a pm_qos: Get rid of the allocation in pm_qos_add_request()
All current users of pm_qos_add_request() have the ability to supply
the memory required by the pm_qos routines, so make them do this and
eliminate the kmalloc() with pm_qos_add_request().  This has the
double benefit of making the call never fail and allowing it to be
called from atomic context.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: mark gross <markgross@thegnar.org>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-07-19 02:00:34 +02:00
Dan Carpenter
0a6efc78c0 arcnet: fix signed bug in probe function
probe_irq_off() returns the first irq found or if two irqs are found
then it returns the negative of the first irq found.  We can cast
dev->irq to an int so that the test for negative values works.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-18 15:07:15 -07:00
Amit Kumar Salecha
bfc978fa5f qlcnic: fix pci resource leak
pci_get_domain_bus_and_slot: caller must decrement the
reference count by calling pci_dev_put().

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-18 14:51:59 -07:00
Shreyas Bhatewara
4a1745fc54 net-next: vmxnet3 fixes [3/5] Initialize link state at probe time
This change initializes the state of link at the time when driver is
loaded. The ethtool output for 'link detected' and 'link speed'
is thus valid even before the interface is brought up.

Signed-off-by: Shreyas Bhatewara <sbhatewara@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-18 14:48:17 -07:00
Stanislaw Gruszka
36227e88c2 bnx2: use device model DMA API
Use DMA API as PCI equivalents will be deprecated. This change also allow
to allocate with GFP_KERNEL in some places.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-18 14:42:48 -07:00
Stanislaw Gruszka
a2df00aa33 bnx2: allocate with GFP_KERNEL flag on RX path init
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-18 14:42:48 -07:00
Wey-Yi Guy
b807b8a16b iwlwifi: "recover_from_tx_stall" function for 4965
"Recover from tx stall" function is available for all devices except
4965, here add the functionality to 4965.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-07-17 07:37:50 -07:00
Wey-Yi Guy
9cae611ff2 iwlwifi: more statistics counter for agn in debugfs
Display "wait_for_silence_timeout_cnt" for _agn devices
in debugfs as part of uCode statistics

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-07-17 07:37:41 -07:00
Wey-Yi Guy
7c094c5cc4 iwlwifi: additional statistic debug counter
Add wait_for_silence_timeout_cnt to statistics_dbg structure

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-07-17 07:37:34 -07:00
Benjamin Herrenschmidt
2f495c398e net/phy/marvell: Expose IDs and flags in a .h and add dns323 LEDs setup flag
This moves the various known Marvell PHY IDs to include/linux/marvell_phy.h
along with dev_flags definitions for use by the driver.

I then added a flag that changes the PHY init code to setup the LEDs
config to the values needed to operate a dns323 rev C1 NAS.

I moved the existing "resistance" flag to the .h as well, though I've
been unable to find whoever sets this to convert it to use that constant.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
2010-07-16 22:01:58 -04:00
Robert Jennings
ee2e6114de ibmveth: lost IRQ while closing/opening device leads to service loss
The order of freeing the IRQ and freeing the device in firmware
in ibmveth_close can cause the adapter to become unusable after a
subsequent ibmveth_open.  Only a reboot of the OS will make the
network device usable again. This is seen when cycling the adapter
up and down while there is network activity.

There is a window where an IRQ will be left unserviced (H_EOI will not
be called).  The solution is to make a VIO_IRQ_DISABLE h_call, free the
device with firmware, and then call free_irq.

Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-16 13:03:23 -07:00
Dan Carpenter
48d5548fc5 orinoco_usb: potential null dereference
Smatch complains that "upriv->read_urb" gets dereferenced before
checking for NULL.  It turns out that it's possible for
"upriv->read_urb" to be NULL so I added checks around the dereferences.

Also I remove an "if (upriv->bap_buf != NULL)" check because
"kfree(NULL) is OK.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-16 14:03:42 -04:00
Luis R. Rodriguez
9171acc7e0 ath9k_hw: Fix AR9003 MPDU delimeter CRC check for middle subframes
An A-MPDU may contain several subframes each containing its own
CRC for the data. Each subframe also has a respective CRC for the
MPDU length and 4 reserved bits (aka delimeter CRC). AR9003 will
ACK frames that have a valid data CRC but have failed to pass the
CRC for the MPDU length, if and only if the subframe is not the
last subframe in an A-MPDU and if an OFDM phy OFDM reset error has
been caught. Discarding those subframes results in packet loss under
heavy stress conditions, an example being UDP video. Since the
frames are ACK'd by hardware we need to let these frames through
and process them as valid frames.

Cc: Tushit Jain <tushit.jain@atheros.com>
Cc: Kyungwan Nam <kyungwan.nam@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-16 14:03:42 -04:00
Luis R. Rodriguez
9edd9520a2 ath9k_htc: make ath9k_htc_tx_aggr_oper() static
This fixes this sparse complaint:

  CHECK   drivers/net/wireless/ath/ath9k/htc_drv_main.c
drivers/net/wireless/ath/ath9k/htc_drv_main.c:441:5:
	warning: symbol 'ath9k_htc_tx_aggr_oper'
		 was not declared. Should it be static?

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-16 14:03:41 -04:00
Stephen Boyd
9acd56d3f2 rt2x00: Fix lockdep warning in rt2x00lib_probe_dev()
The rt2x00dev->intf_work workqueue is never initialized when a driver is
probed for a non-existent device (in this case rt2500usb). On such a
path we call rt2x00lib_remove_dev() to free any resources initialized
during the probe before we use INIT_WORK to initialize the workqueue.
This causes lockdep to get confused since the lock used in the workqueue
hasn't been initialized yet but is now being acquired during
cancel_work_sync() called by rt2x00lib_remove_dev().

Fix this by initializing the workqueue first before we attempt to probe
the device. This should make lockdep happy and avoid breaking any
assumptions about how the library cleans up after a probe fails.

phy0 -> rt2x00lib_probe_dev: Error - Failed to allocate device.
INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
Pid: 2027, comm: modprobe Not tainted 2.6.35-rc5+ #60
Call Trace:
 [<ffffffff8105fe59>] register_lock_class+0x152/0x31f
 [<ffffffff81344a00>] ? usb_control_msg+0xd5/0x111
 [<ffffffff81061bde>] __lock_acquire+0xce/0xcf4
 [<ffffffff8105f6fd>] ? trace_hardirqs_off+0xd/0xf
 [<ffffffff81492aef>] ?  _raw_spin_unlock_irqrestore+0x33/0x41
 [<ffffffff810628d5>] lock_acquire+0xd1/0xf7
 [<ffffffff8104f037>] ? __cancel_work_timer+0x99/0x17e
 [<ffffffff8104f06e>] __cancel_work_timer+0xd0/0x17e
 [<ffffffff8104f037>] ? __cancel_work_timer+0x99/0x17e
 [<ffffffff8104f136>] cancel_work_sync+0xb/0xd
 [<ffffffffa0096675>] rt2x00lib_remove_dev+0x25/0xb0 [rt2x00lib]
 [<ffffffffa0096bf7>] rt2x00lib_probe_dev+0x380/0x3ed [rt2x00lib]
 [<ffffffff811d78a7>] ? __raw_spin_lock_init+0x31/0x52
 [<ffffffffa00bbd2c>] ? T.676+0xe/0x10 [rt2x00usb]
 [<ffffffffa00bbe4f>] rt2x00usb_probe+0x121/0x15e [rt2x00usb]
 [<ffffffff813468bd>] usb_probe_interface+0x151/0x19e
 [<ffffffff812ea08e>] driver_probe_device+0xa7/0x136
 [<ffffffff812ea167>] __driver_attach+0x4a/0x66
 [<ffffffff812ea11d>] ? __driver_attach+0x0/0x66
 [<ffffffff812e96ca>] bus_for_each_dev+0x54/0x89
 [<ffffffff812e9efd>] driver_attach+0x19/0x1b
 [<ffffffff812e9b64>] bus_add_driver+0xb4/0x204
 [<ffffffff812ea41b>] driver_register+0x98/0x109
 [<ffffffff813465dd>] usb_register_driver+0xb2/0x173
 [<ffffffffa00ca000>] ? rt2500usb_init+0x0/0x20 [rt2500usb]
 [<ffffffffa00ca01e>] rt2500usb_init+0x1e/0x20 [rt2500usb]
 [<ffffffff81000203>] do_one_initcall+0x6d/0x17a
 [<ffffffff8106cae8>] sys_init_module+0x9c/0x1e0
 [<ffffffff8100296b>] system_call_fastpath+0x16/0x1b

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-16 13:57:59 -04:00
Casey Leedom
b97d13a53d cxgb4vf: fix SGE resource resource deallocation bug
Fix SGE resource resource deallocation bug.  Forgot to increment the RXQ and
TXQ cursors in the loop ...

Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-15 22:47:06 -07:00
Ronghua Zang
6929fe8a37 net-next: vmxnet3 fixes [2/5] Interrupt control bitmap
A new bit map 'intrCtrl' is introduced in the DriverShared area. The 
driver should update VMXNET3_IC_DISABLE_ALL bit before writing IMR.

Signed-off-by: Ronghua Zang <ronghua@vmware.com>
Signed-off-by: Shreyas Bhatewara <sbhatewara@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-15 22:18:47 -07:00
Shreyas Bhatewara
ca802447c0 net-next: fix LRO feature update in vmxnet3
Fix LRO feature update.

Signed-off-by: Shreyas Bhatewara <sbhatewara@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-15 22:17:29 -07:00
Jon Mason
6ce28c6f55 vxge: Version update
Version update

Signed-off-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@exar.com>
Signed-off-by: Ramkrishna Vepa <ramkrishna.vepa@exar.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-15 20:46:23 -07:00
Jon Mason
926bd900b1 vxge: Update copyright information
Update copyright information to reflect the Exar purchase of Neterion

Signed-off-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@exar.com>
Signed-off-by: Ramkrishna Vepa <ramkrishna.vepa@exar.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-15 20:46:22 -07:00
Jon Mason
98f45da247 vxge: NETIF_F_LLTX removal
NETIF_F_LLTX and it's usage of local transmit locks are depricated in
favor of using the netdev queue's transmit lock.  Remove the local
lock and all references to it, and use the netdev queue transmit lock
in the transmit completion handler.

Signed-off-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: Ramkrishna Vepa <ramkrishna.vepa@exar.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-15 20:46:22 -07:00
Jon Mason
7adf7d1b0d vxge: Fix multicast issues
Fix error in multicast flag check, add calls to restore the status of
multicast and promiscuous mode settings after change_mtu, and style
cleanups to shorten the function calls by using a temporary variable.

Signed-off-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@exar.com>
Signed-off-by: Ramkrishna Vepa <ramkrishna.vepa@exar.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-15 20:46:21 -07:00
Jon Mason
d03848e057 vxge: Remove queue_state references
Remove queue_state references, as they are no longer necessary.

Also, The driver needs to start/stop the queue regardless of which type
of steering is enabled.  Remove checks for TX_MULTIQ_STEERING only and
start/stop for all steering types.

Signed-off-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@exar.com>
Signed-off-by: Ramkrishna Vepa <ramkrishna.vepa@exar.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-15 20:46:21 -07:00
Kulikov Vasiliy
2540ddb512 drivers: ixgbevf: fix unsigned underflow
'count' is unsigned. It is initialized to zero, then it can be increased
multiple times, and finally it is used in such a way:

   >>>> count--;
   |
   |    /* clear timestamp and dma mappings for remaining portion of packet */
   |    while (count >= 0) {
   |            count--;
   |            ...
   ^
If count is zero here (so, it was never increased), we would have a very
long loop :)

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-15 20:27:58 -07:00
Kulikov Vasiliy
9f27fb8514 drivers: irda: fix sign bug
platform_get_irq_byname() can return negative results, it is not seen to
unsigned irq. Make it signed.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-15 20:27:57 -07:00
Kulikov Vasiliy
752ef8b541 drivers: irda: fix sign bug
platform_get_irq_byname() can return negative results, it is not seen to
unsigned irq. Make it signed.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-15 20:27:57 -07:00
Wan ZongShun
d1853dc8fa net/nuc900: enable Mac driver clock
This patch fixed a bug that Mac driver does not work,because I missed the clk enable.

I have ever tested the driver when I submitted previous Mac driver patch,
and it worked good, since my bootloader has enabled the clock in advance.

But when I try to use other bootloader where clock engine was disabled,the
Mac driver does not work, so I send this patch to fix this issue.

Signed-off-by: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-15 19:05:17 -07:00
Joe Perches
0a645e8097 drivers/net/mlx4: Use %pV, pr_<level>, printk_once
Remove near duplication of format string constants by using the newly
introduced vsprintf extention %pV to reduce text by 20k or so.

$ size drivers/net/mlx4/built-in.o*
   text	   data	    bss	    dec	    hex	filename
 161367	   1866	  48784	 212017	  33c31	drivers/net/mlx4/built-in.o
 142621	   1866	  46248	 190735	  2e90f	drivers/net/mlx4/built-in.o.new

Use printk_once as appropriate.
Convert printks to pr_<level>, some bare printks now use pr_cont.
Remove now unused #define PFX.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-15 19:05:17 -07:00
Nicolas de Pesloüan
79236680bd bonding: fix a buffer overflow in bonding_show_queue_id.
The test for buffer overflow ensures we have room for 6 more bytes.
sprintf, called with %s:%d, slave->dev->name, slave->queue_id may yield
far more than 6 bytes.

The correct test is res > (PAGE_SIZE - IFNAMSIZ - 6) .

Signed-off-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-14 18:24:54 -07:00
Kulikov Vasiliy
04d5821fa5 eth16i: fix memory leak
Free allocated netdev if no probe is expected.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-14 17:57:19 -07:00
Rajesh Borundia
f8320f0592 netxen: fix for kdump
When the crash kernel is loaded after crash, the device is in unknown state.
So reset the device contexts prior to its creation in case of kdump,
depending upon kernel parameter reset_devices.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-14 17:55:35 -07:00
Kulikov Vasiliy
bdb0f8672f wd: fix memory leak
Unmap mapped IO in wd_probe1() if register_netdev() failed.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-14 17:53:18 -07:00
Kulikov Vasiliy
8aa06af4d0 tulip: formatting of pointers in printk()
Use %p instead of %08x in printk().

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-14 15:06:10 -07:00
Anirban Chakraborty
cea8975e84 qlcnic: restore NPAR config data after recovery
o NPAR configuration which is programmed in fw, need to
  restore after fw recovery.
o Update version to 5.0.7

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
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>
2010-07-14 13:54:17 -07:00
Sucheta Chakraborty
451724c821 qlcnic: aer support
Pci error recovery support added.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-14 13:54:17 -07:00
Amit Kumar Salecha
0cf3a14cb2 qlcnic: fix netdev notifier in error path
netdev notifier are not unregistered if pci_register_driver fails.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-14 13:54:16 -07:00
Amit Kumar Salecha
0df170b607 qlcnic: disable tx timeout recovery
Disable tx timeout recovery, if auto_fw_reset is disable

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-14 13:54:15 -07:00
Rajesh Borundia
6d18168895 qlcnic: fix pause params setting
Turning off rx pause param and autoneg param is not supported so
return error in that case.

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>
2010-07-14 13:54:15 -07:00
Christoph Egger
2cb8d9d1da eth_v10: Removing dead ETRAX_NETWORK_RED_ON_NO_CONNECTION
ETRAX_NETWORK_RED_ON_NO_CONNECTION doesn't exist in Kconfig, therefore
removing all references for it from the source code.

Signed-off-by: Christoph Egger <siccegge@cs.fau.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-14 13:41:53 -07:00
Christoph Egger
ef3cf9f2fb cs89x0: Removing dead SH_HICOSH4
SH_HICOSH4 doesn't exist in Kconfig, therefore removing all references
for it from the source code.

Signed-off-by: Christoph Egger <siccegge@cs.fau.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-14 13:40:36 -07:00
Christoph Egger
7e4ee4d947 cassini: Removing dead CASSINI_NAPI
CASSINI_NAPI doesn't exist in Kconfig, therefore removing all
references for it from the source code.

Signed-off-by: Christoph Egger <siccegge@cs.fau.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-14 13:36:18 -07:00
Christoph Egger
ff08546b12 cassini: Removing dead CASSINI_MULTICAST_REG_WRITE
CASSINI_MULTICAST_REG_WRITE doesn't exist in Kconfig, therefore
removing all references for it from the source code.

Signed-off-by: Christoph Egger <siccegge@cs.fau.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-14 13:35:45 -07:00
Christoph Egger
c5f978eddd cassini: Removing dead CASSINI_QGE_DEBUG
CASSINI_QGE_DEBUG doesn't exist in Kconfig, therefore removing all
references for it from the source code.

Signed-off-by: Christoph Egger <siccegge@cs.fau.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-14 12:18:31 -07:00
Christoph Egger
2a710b59a9 net: Removing dead {AR,WAVE}LAN
{AR,WAVE}LAN doesn't exist in Kconfig, therefore removing all
references for it from the source code.

Signed-off-by: Christoph Egger <siccegge@cs.fau.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-14 12:17:35 -07:00
John W. Linville
0e954099b7 iwlwifi: convert new uses of __attribute__ ((packed)) to __packed
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14 13:52:46 -04:00
John W. Linville
beabe91462 libertas: convert new uses of __attribute__ ((packed)) to __packed
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14 13:52:46 -04:00
Bruno Randolf
b3f194e54b ath5k: clean up rxlink handling
There were a few places where the sc->rxlink pointer was set to NULL "just in
case". This helps nothing - quite to the contrary it is problematic since it
can create self-linked rx descriptors in the middle of the list of receive
buffers.

Here is an example how this could happen (thanks Bob!):

cpu 0:                                      cpu 1:

ath5k_rx_stop
                                            ath5k_tasklet_rx
sc->rxlink = NULL;   /* just in case */
                                              // following doesn't link used
                                              // buffer to prev.
                                              ath5k_rxbuf_setup()

In the case of ath5k_rx_stop() and ath5k_stop_locked() buffers/descriptors are
not changed so rxlink should not be changed as well.

In ath5k_intr() we seem to  try to work around a hardware bug, as the comment
(which is copied 1:1 from the HAL) suggests. I don't see how this could help.
Also the HAL does not set rxlink in this case (So where does this code come
from? It has been there since the first import of ath5k). Changed to just
increment a statistics counter.

After this patch rxlink is only set to NULL before we initialize rx descriptors
and updated when the descriptors are linked together.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14 13:52:46 -04:00
Bob Copeland
450464def7 ath5k: disable tasklets during reset
Based on a patch from Bruno Randolf, attempting useful
work while we are resetting the chip just leads to interface
lockups and bad descriptor data, and possibly DMAing to
freed buffers.  Let's suspend all tasklets while
reprogramming the registers in the card to avoid such
problems.

In the future we can convert the tasklets to threaded
interrupt handlers to simplify things.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14 13:52:46 -04:00
Bob Copeland
5faaff7477 ath5k: move reset to mac80211 workqueue
We currently trigger a reset via a tasklet when certain error
conditions are detected so that the card will (eventually)
restart.  Unfortunately this makes locking complicated since
reset can also be called in process context (e.g. for channel
change).  Currently nothing protects against concurrent resets,
which can be the source of corruption bugs.

Reset takes too long to spinlock the whole thing, so this
patch moves deferred resets into the mac80211 workqueue to
enable use of sc->lock mutex.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14 13:52:46 -04:00
Felix Fietkau
da5747eb89 ath9k_hw: remove initvals for hardware which was never sold
According to documentation, The following chip revisions were never sold:

- AR9280 v1.0
- AR9285 v1.0
- AR9285 v1.1
- AR9287 v1.0

Removing initvals specific to these chip revisions saves around 30k in
binary size (tested on MIPS).

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14 13:52:46 -04:00
Kulikov Vasiliy
ff4bf917cd wireless: airo: delete netdev from list after it is freed
We must call del_airo_dev() before free_netdev() since we call
add_airo_dev() exactly after alloc_netdev().

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14 13:52:45 -04:00
Felix Fietkau
31e79a5954 ath9k: another fix for the A-MPDU buffer leak
The patch 'ath9k: fix a buffer leak in A-MPDU completion' addressed the
issue of running out of buffers/descriptors in the tx path if a STA is
deleted while tx status feedback is still pending.
The remaining issue is that the skbs of the buffers are not reclaimed,
leaving a memory leak.
This patch fixes this issue by running the buffers through
ath_tx_complete_buf(), ensuring that the pending frames counter is also
updated.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14 13:52:45 -04:00
Joe Perches
57674308d0 drivers/net/wireless: Remove unnecessary casts of private_data
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14 13:52:45 -04:00
Rajkumar Manoharan
447a42c2fe ath9k: fix panic while cleaning up virtaul wifis
num_sec_wiphy means max secondary wifis that the driver can accomudate.
So cancelling wiphy work should be based on the presence of
secondary wifis.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14 13:52:45 -04:00
Pavel Roskin
6eb90d46c5 ath9k: remove unneeded calculation of minimal calibration power
Remove tMinCalPower from ath9k_hw_set_def_power_cal_table(), as it's
never used.  Remove corresponding arguments of the functions calculating
that value.

Original patch by Prarit Bhargava <prarit@redhat.com>

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14 13:52:45 -04:00
Vivek Natarajan
982723df56 ath9k: Fix the LED behaviour in idle unassociated state.
LED should be ON when the radio is put into FULL SLEEP mode during the idle
unassociated state.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14 13:52:44 -04:00
John W. Linville
0f4da2d77e hostap_pci: set dev->base_addr during probe
"hostap: Protect against initialization interrupt" (which reinstated
"wireless: hostap, fix oops due to early probing interrupt")
reintroduced Bug 16111.  This is because hostap_pci wasn't setting
dev->base_addr, which is now checked in prism2_interrupt.  As a result,
initialization was failing for PCI-based hostap devices.  This corrects
that oversight.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-14 13:49:46 -04:00
David S. Miller
fae88f7eed Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 2010-07-13 14:25:13 -07:00
David S. Miller
1e2cfeef06 Revert "tc35815: fix iomap leak"
This reverts commit b31fb86815.

pcim_*() managed drivers do not need explicit resource
releasing like this.

Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-13 14:20:58 -07:00
John W. Linville
e300d955de Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
Conflicts:
	drivers/net/wireless/wl12xx/wl1271_cmd.h
2010-07-13 15:57:29 -04:00
John W. Linville
815868e7b5 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2010-07-13 15:31:51 -04:00
David J. Choi
28bd620c7a drivers/net: Add Micrel KS8841/42 support to ks8842 driver
Body of the explanation:
   -support 16bit and 32bit bus width.
   -add device reset for ks8842/8841 Micrel device.
   -set 100Mbps as a default for Micrel device.
   -set MAC address in both MAC/Switch layer with different sequence for Micrel
    device, as mentioned in data sheet.
   -use private data to set options both 16/32bit bus width and Micrel device/
    Timberdale(FPGA).
   -update Kconfig in order to put more information about ks8842 device.

Signed-off-by: David J. Choi <david.choi@micrel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-13 10:13:49 -07:00
Filip Aben
242647bcf8 hso: remove driver version
This patch removes the driver version from the driver. This version
hasn't changed since the driver's inclusion in the kernel and is a
source of confusion for some customers.

Signed-off-by: Filip Aben <f.aben@option.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-12 21:21:27 -07:00
Joe Perches
cb8b6a9377 drivers/net/caif: Remove unnecessary casts of private_data
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-12 21:13:35 -07:00
Baruch Siach
97b72e4320 fec: use interrupt for MDIO completion indication
With the move to phylib (commit e6b043d) I was seeing sporadic "MDIO write
timeout" messages. Measure of the actual time spent showed latency times of
more than 1600us.

This patch uses the MII event indication of the FEC hardware to detect
completion of MDIO transactions.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-12 20:21:48 -07:00
Arnd Bergmann
15fd0cd9a2 net: autoconvert trivial BKL users to private mutex
All these files use the big kernel lock in a trivial
way to serialize their private file operations,
typically resulting from an earlier semi-automatic
pushdown from VFS.

None of these drivers appears to want to lock against
other code, and they all use the BKL as the top-level
lock in their file operations, meaning that there
is no lock-order inversion problem.

Consequently, we can remove the BKL completely,
replacing it with a per-file mutex in every case.
Using a scripted approach means we can avoid
typos.

file=$1
name=$2
if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
            sed -i '/include.*<linux\/smp_lock.h>/d' ${file}
    else
            sed -i 's/include.*<linux\/smp_lock.h>.*$/include <linux\/mutex.h>/g' ${file}
    fi
    sed -i ${file} \
        -e "/^#include.*linux.mutex.h/,$ {
                1,/^\(static\|int\|long\)/ {
                     /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

} }"  \
    -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
    -e '/[      ]*cycle_kernel_lock();/d'
else
    sed -i -e '/include.*\<smp_lock.h\>/d' ${file}  \
                -e '/cycle_kernel_lock()/d'
fi

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-12 20:21:47 -07:00
Kulikov Vasiliy
dbe000ed3f xtsonic: free irq if sonic_open() fails
xtsonic_open() doesn't check sonic_open() return code. If it is error
we must free requested IRQ.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-12 20:21:45 -07:00
Kulikov Vasiliy
546e3abde3 macsonic: free irqs if sonic_open() fails
macsonic_open() doesn't check sonic_open() return code. If it is error
we must free requested IRQs.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-12 20:21:44 -07:00
Kulikov Vasiliy
62cd69a106 jazzsonic: free irq if sonic_open() fails
jazzsonic_open() doesn't check sonic_open() return code. If it is error
we must free requested IRQ.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-12 20:21:44 -07:00
Kulikov Vasiliy
b31fb86815 tc35815: fix iomap leak
If tc35815_init_one() fails we must unmap mapped regions.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-12 20:21:42 -07:00
Denis Kirjanov
60eb5fd11d ll_temac: Fix missing validate_addr hook
Fix missing validate_addr hook

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-12 20:21:42 -07:00
Casey Leedom
7f9dd2fa4a cxgb4vf: fix TX Queue restart
Fix up TX Queue Host Flow Control to cause an Egress Queue Status Update to
be generated when we run out of TX Queue Descriptors.  This will, in turn,
allow us to restart a stopped TX Queue.

Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-12 20:21:41 -07:00
Kulikov Vasiliy
84c3b972f3 depca: fix leaks in depca_module_init()
Since some of xxx_register_driver() can return error we must unregister
already registered drivers.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-12 20:21:40 -07:00
Ken Kawasaki
ab83a38958 axnet_cs: use spin_lock_irqsave in ax_interrupt
Use spin_lock_irqsave instead of spin_lock in ax_interrupt because
the interrupt handler can also be invoked from ei_watchdog.

Signed-off-by: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-12 20:13:02 -07:00
David S. Miller
c4363d6acd Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2010-07-12 15:17:29 -07:00
Felix Fietkau
bbacee13f4 ath9k: merge noisefloor load implementations
AR5008+ and AR9003 currently use two separate implementations of the
ath9k_hw_loadnf function. There are three main differences:

 - PHY registers for AR9003 are different
 - AR9003 always uses 3 chains, earlier versions are more selective
 - The AR9003 variant contains a fix for NF load timeouts

This patch merges the two implementations into one, storing the
register array in the ath_hw struct. The fix for NF load timeouts is
not just relevant for AR9003, but also important for earlier hardware,
so it's better to just keep one common implementation.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:39 -04:00
Felix Fietkau
b11b160def ath9k: validate the TID in the tx status information
Occasionally the hardware can send out tx status information with the wrong
TID. In that case, the BA status cannot be trusted and the aggregate
must be retransmitted.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:38 -04:00
Felix Fietkau
e5cbef96cf ath9k_hw: report the TID in the tx status on AR5008-AR9002
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:38 -04:00
Felix Fietkau
9cc2f3e881 ath9k_hw: prevent a fast channel change after a rx DMA stuck issue
If the receive path gets stuck, a full hardware reset is necessary to
recover from it. If this happens during a scan, the whole scan might fail,
as each channel change bypasses the full reset sequence.
Fix this by resetting the fast channel change flag if stopping the
receive path fails.

This will reduce the number of error messages that look like this:
ath: DMA failed to stop in 10 ms AR_CR=0x00000024 AR_DIAG_SW=0x40000020

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:38 -04:00
Felix Fietkau
03b4776c40 ath9k_hw: fix an off-by-one error in the PDADC boundaries calculation
PDADC values were only generated for values surrounding the target
index, however not for the target index itself, leading to a minor
error in the generated curve.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:38 -04:00
Felix Fietkau
23399016d9 ath9k_hw: fix a sign error in the IQ calibration code
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:38 -04:00
Felix Fietkau
601e0cb165 ath9k_hw: fix antenna diversity on AR9285
On AR9285, the antenna switch configuration register uses more than just
16 bits. Because of an arbitrary mask applied to the EEPROM value that
stores this configuration, diversity was broken in some cases, leading
to a significant degradation in signal strength.
Fix this by changing the callback to return a 32 bit value and remove
the arbitrary mask.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:37 -04:00
Ivo van Doorn
e796643eaf rt2x00: Move driver callback functions into the ops structure
All callback functions are gathered in rt2x00dev->ops except
for the callback functions which are used in rt2800lib to
acces rt2800pci/usb.

Move the priv pointer from rt2x00dev to rt2x00dev->ops and
rename it to drv to make it obvious that it is the driver callback
structure.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:37 -04:00
Ivo van Doorn
f31c9a8c13 rt2x00: Move common firmware loading into rt2800lib
Large parts of the firmware initialization are shared
between rt2800pci and rt2800usb. Move this code into
rt2800lib.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:37 -04:00
Helmut Schaa
ab8966ddc2 rt2x00: Add missing TSF sync mode for AP operation
Currently rt2x00 uses the TSF_SYNC_BEACON mode for all beaconing
interface types. However, TSF_SYNC_BEACON is meant for IBSS networks and
thus implements TSF merging in the hardware. Rename TSF_SYNC_BEACON to
TSF_SYNC_ADHOC to better express its purpose and introduce the missing
TSF sync mode TSF_SYNC_AP_NONE which should be used for beaconing modes
that don't need TSF merging.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:37 -04:00
Helmut Schaa
8544df327c rt2x00: Don't initialize beacon interval to 0 on rt2800 devices
Activating the TBTT interrupt when a beacon interval of 0 is configured
results in an interrupt storm causing the machine to hang. Hence,
initialize the beacon interval to a reasonable default of 100TUs.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:35 -04:00
Helmut Schaa
ab0ed4aba8 rt2x00: Remove set_tim callback from PCI drivers
Using the set_tim callback without managing the DTIM count and the
broad- and multicast buffering in hw, fw or the driver results in wrong
DTIM count values being sent out in beacons. Since all PCI drivers
fetch new beacons periodically and hence get an updated TIM we can just
remove the set_tim callback from these.

The rt2x00 USB drivers don't update the beacon periodically and thus
rely on the set_tim callback to get a correct TIM for beacon
transmission. USB devices still suffer from the DTIM count being wrong
under some circumstances but removing the set_tim callback from these
would cause more harm then good.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:35 -04:00
Helmut Schaa
e783619ea8 rt2x00: Use separate mac80211_ops for rt2800pci and rt2800usb
Use separate mac80211_ops for rt2800pci and rt2800usb in preparation
for further fixes. This shouldn't introduce functional changes.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:35 -04:00
Helmut Schaa
9f926fb57a rt2x00: Use pretbtt irq for fetching beacons on rt2800pci
Updating the beacon on pre tbtt instead of beacondone allows much lower
latency in regard to TIM updates. Hence, use the pre tbtt interrupt for
updating the beacon in rt2800pci (older devices don't provide a pre tbtt
interrupt).

Also, add a new driver flag to indicate if a driver has pre tbtt support
or not and implement the according behavior in rt2x00lib.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:35 -04:00
Helmut Schaa
07896fe2f4 rt2x00: Implement broad- and multicast buffering
Although mac80211 buffers broad- and mutlicast frames for us in AP mode
we still have to send them out after a DTIM beacon. Implement this
behavior by sending out the buffered frames when the beacondone
interrupt is processed.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:35 -04:00
Helmut Schaa
4dee32f51b rt2x00: Allow beacon update without scheduling a work
Since all rt2x00 PCI drivers use threaded interrupts now we don't need
to schedule a work just to update the beacon. The only place where the
beacon still gets updated in atomic context is from the set_tim
callback. Hence, move the work scheduling there.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:34 -04:00
Helmut Schaa
78e256c9a3 rt2x00: Convert rt2x00 to use threaded interrupts
Use threaded interrupts for all rt2x00 PCI devices.

This has several generic advantages:
- Reduce the time we spend in hard irq context
- Use non-atmic mac80211 functions for rx/tx

Furthermore implementing broad- and multicast buffering will be
much easier in process context while maintaining low latency and
updating the beacon just before transmission (pre tbtt interrupt)
can also be done in process context.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:34 -04:00
Ivo van Doorn
50e888eae2 rt2x00: Make rt2800_write_beacon only export to GPL
rt2800_write_beacon is the only function which uses
EXPORT_SYMBOL instead of EXPORT_SYMBOL_GPL. All symbols
in rt2x00 should however use the GPL restricted export.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:34 -04:00
Ivo van Doorn
c965c74bbc rt2x00: Implement watchdog monitoring
Implement watchdog monitoring for USB devices (PCI support can
be added later). This will determine if URBs being uploaded to
the hardware are actually returning. Both rt2500usb and rt2800usb
have shown that URBs being uploaded can remain hanging without
being released by the hardware.
By using this watchdog, a queue can be reset when this occurs.
For rt2800usb it has been tested that the connection is preserved
even though this interruption.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:34 -04:00
Ivo van Doorn
223dcc2659 rt2x00: Fix vgc_level_reg handling
Currently vgc_level_reg and vgc_level are equal to eachother,
while the purpose of vgc_level_reg is the value last written
to the register and is remembered through link tuning resets.
The vgc_level is the currently active level, which is
reset during link tuning resets.

The usage of these variables depends on the drivers, some drivers
need both, while others need only one of the two.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:33 -04:00
Ivo van Doorn
d8147f9d9e rt2x00: Disable link tuning while scanning
While scanning the link tuner must be disabled. Otherwise
it will interfere with receiving all beacons for each channel
due to changing sensitivity levels.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:33 -04:00
Ivo van Doorn
27df2a9ce9 rt2x00: Rename CONFIG_DISABLE_LINK_TUNING
Rename CONFIG_DISABLE_LINK_TUNING to DRIVER_SUPPORT_LINK_TUNING
Link tuning support is not only based on EEPROM decisions, but
also if the device actually supports it.

Currently only rt2500usb doesn't support link tuning because
of hardware problems. But rt2800usb is also suspected of having
problems with link tuning.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:33 -04:00
Ivo van Doorn
7486192206 rt2x00: Convert AGC value from descriptor to RSSI (dBm)
The RSSI values in the RXWI descriptor aren't true RSSI
values. Instead they are more like the AGC values similar
to rt61pci. And as such, it needs the same conversion
before it can be passed to rt2x00lib/mac80211.

This requires the struct queue_entry to be passed to
rt2800_process_rxwi rather then the skb structure which
is contained in the queue_entry. This is required to
obtain the lna_gain information from the rt2x00_dev structure.

This fixes connection problems when using wpa_supplicant
which would try to connect to the worst AP's rather then the
best ones.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:33 -04:00
Helmut Schaa
5e84600491 rt2x00: Limit txpower by eeprom values
Limit the txpower per rate by the approriate values in the eeprom.
This avoids too high txpower values resulting in bad tx performance.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:32 -04:00
Dan Carpenter
8b967e41e0 hostap: fixup strlen() math
In hostap_add_interface() we do:
	sprintf(dev->name, "%s%s", prefix, name);

dev->name has IFNAMSIZ (16) characters.
prefix is local->dev->name.
name is "wds%d"

strlen() returns the number of characters in the string not counting the
NULL so if we have a string with 11 characters we get "12345678901wds%d"
which is 16 characters and a NULL so we're past the end of the array.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:32 -04:00
Kulikov Vasiliy
b85aeb5180 adm8211: fix memory leak
We must free priv->eeprom allocated in adm8211_read_eeprom().

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:32 -04:00
Dan Carpenter
4c92831d99 prism54: call BUG_ON() earlier
This test is off by one because strlen() doesn't include the NULL
terminator.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:32 -04:00
Luciano Coelho
72e93e9161 wl1271: use __packed annotation
This patch changes __attribute__ ((packed)) annotations to __packed in wl1271
code that was introduced in a recent patch in wireless-testing.

Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:31 -04:00
Amitkumar Karwar
1311843c58 libertas: Added support for host sleep feature
Existing "ethtool -s ethX wol X" command configures hostsleep
parameters, but those are activated only during suspend/resume,
there is no way to configure host sleep without actual suspend.

This patch adds debugfs command to enable/disable host sleep based on
already configured host sleep parameters using wol command.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-07-12 16:05:31 -04:00
Kulikov Vasiliy
ba80a25228 ac3200: fix error path
Do not call free_irq() if request_irq() failed.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-11 18:15:08 -07:00
Kulikov Vasiliy
451d33dd22 at1700: fix double free_irq
free_irq() is called both in net_close() and cleanup_card().  Since it
is requested in at1700_probe1(), leave free_irq() only in cleanup_card()
for balance.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-11 18:15:08 -07:00
Dimitris Michailidis
835bb606fa cxgb4: exclude registers with read side effects from register dumps
A few registers have side effects on reads, eg FIFO pointers that
auto advance or mailboxes which change ownership when read.  They are
unsafe to read so exclude them from ethtool register dumps.

Bump ethtool_regs.version to indicate the changed register set.

Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-11 17:33:48 -07:00
Francois Romieu
17c9929721 r8169: incorrect identifier for a 8168dp
Merge error.

See CFG_METHOD_8 (0x3c800000 + 0x00300000) since version 8.002.00
of Realtek's driver.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-11 17:10:09 -07:00
Dimitris Michailidis
f796564a5f cxgb4: implement the ETHTOOL_GRXFH command
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-11 17:07:46 -07:00
Dimitris Michailidis
671b0060d8 cxgb4: add user manipulation of the RSS table
Implement the get_rxnfc, get_rxfh_indir, and set_rxfh_indir ethtool
methods for user manipulation of the RSS table.  Besides the methods
themselves the rest of the changes here store, initialize, and write
the table contents.

Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-11 17:07:46 -07:00
Dimitris Michailidis
065463915c cxgb4: avoid duplicating some resource freeing code
Currently there are two copies of some resource freeing code, turn it into
a function and call it.

Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-11 17:07:45 -07:00
Dimitris Michailidis
f7cabcdd51 cxgb4: move the choice of interrupt type before net_device registration
We need to settle on the kind of interrupts we'll be using, a choice that
also impacts the number of queues, before registering and making visible
the net_devices.  Move the relevant code up a bit.

Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-11 17:07:45 -07:00
Matt Carlson
98e32a9cee tg3: Update version to 3.112
This patch updates the tg3 version to 3.112.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-11 17:07:44 -07:00
Matt Carlson
be98da6a10 tg3: Fix some checkpatch errors
This patch fixes the following checkpatch errors:

ERROR: do not use assignment in if condition
+	if ((mss = skb_shinfo(skb)->gso_size) != 0) {

ERROR: do not use assignment in if condition
+	if ((mss = skb_shinfo(skb)->gso_size) != 0) {

ERROR: space prohibited after that '!' (ctx:BxW)
+			if (! netif_carrier_ok(tp->dev) &&
 			    ^

ERROR: space required after that ',' (ctx:VxV)
+#define GET_REG32_LOOP(base,len)		\
                            ^

ERROR: "(foo*)" should be "(foo *)"
+		memcpy(data, ((char*)&val) + b_offset, b_count);

ERROR: do not use assignment in if condition
+		if ((err = tg3_do_mem_test(tp, mem_tbl[i].offset,

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-11 17:07:43 -07:00
Matt Carlson
702e52ccd3 tg3: Revert PCIe tx glitch fix
This patch reverts commit 52cdf8526f,
entitled "tg3: Prevent a PCIe tx glitch".  The problem does not have
any visible side-effects and happens too early for the driver to do
anything about it.  The proper place for this code is within the
device's bootcode.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-11 17:07:43 -07:00
Matt Carlson
6867c84381 tg3: Report driver version to firmware
This patch changes the code so that the driver version can be reported
to the firmware in addition to the current use.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-11 17:07:42 -07:00
Matt Carlson
2138c00217 tg3: Relax 5717 serdes restriction
tg3 is coded to refuse to attach to 5717 serdes devices.  Now that the
hardware is better supported, we can relax this restriction.  This patch
also fixes a recently introduced bug which will cause serdes parallel
detection not to work with 5780 class devices.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-11 17:07:42 -07:00
Matt Carlson
34195c3dce tg3: Fix IPv6 TSO code in tg3_start_xmit_dma_bug()
The tg3_start_xmit_dma_bug() function was missing code to process IPv6
TSO packets.  This patch adds the missing support.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-11 17:07:41 -07:00
Matt Carlson
20d7375c1f tg3: Fix single MSI-X vector coalescing
The interrupt coalescing setup code used the TG3_FLG2_USING_MSIX flag to
determine whether or not to configure the rx coalescing parameters.
This is incorrect for the single MSI-X vector case.  This patch changes
the code to look at the TG3_FLG3_ENABLE_RSS instead.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-11 17:07:41 -07:00
Matt Carlson
5efeeea1cf tg3: Revert RSS indir tbl setup change
This patch reverts commit 2601d8a004.  A
spectacular set of coincidences made it look as though the table was
setup incorrectly.  The original version was correct.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-11 17:07:40 -07:00
Kulikov Vasiliy
a607072b86 82596: free resources on error
IRQ 56 was not freed anywhere (neither in i596_open() on error nor in
i596_close()), rx_bufs were not freed if init_i596_mem() fails,
netif_stop_queue() was not called.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-10 19:42:06 -07:00
Kulikov Vasiliy
f163530407 82596: do not panic on out of memory
If dev_alloc_skb() failed then free already allocated skbs.
remove_rx_bufs() can be called multiple times, so set rbd->skb to NULL
to avoid double free. remove_rx_bufs() was moved upwards to be seen by
init_rx_bufs().

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-10 19:42:06 -07:00
Sarveshwar Bandi
344dbf1073 be2net: Patch to determine if function is VF while running in guest OS.
When driver is loaded in guest OS, the pci variables is_virtfn and is_physfn are
both set to 0. This change uses registers in controller to determine the same.

Signed-off-by: Sarveshwar Bandi <sarveshwarb@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-10 19:42:05 -07:00