Commit Graph

4394 Commits (7d9f99eccc8f94ace31030a2a7ff73cf5f8c12a0)

Author SHA1 Message Date
Daniel Drake d2d7c05210 [PATCH] zd1211rw: Mark some data const
This is a backport of Helge Deller's recent patch for wireless-dev.git

Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:01:01 -04:00
Jouni Malinen 85d32e7b0e [PATCH] Update my email address from jkmaline@cc.hut.fi to j@w1.fi
After 13 years of use, it looks like my email address is finally going
to disappear. While this is likely to drop the amount of incoming spam
greatly ;-), it may also affect more appropriate messages, so let's
update my email address in various places. In addition, Host AP mailing
list is subscribers-only and linux-wireless can also be used for
discussing issues related to this driver which is now shown in
MAINTAINERS.

Signed-off-by: Jouni Malinen <j@w1.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:01:01 -04:00
Jan-Bernd Themann e542aa6bd5 ehea: code cleanup
This patch includes:

- code cleanup related to resource management
- extended error data gathering for resource management
- removing trailing whitespaces

Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:01:01 -04:00
Jan-Bernd Themann 1eef4e04c9 ehea: fix for dynamic lpar support
The patch fixes bugs related to the probe / remove adapter
functionality (handling of OFDT nodes)

Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:01:01 -04:00
Deepak Saxena d683001828 Netpoll support for Sibyte MAC
NETPOLL support for Sibyte MAC

Signed-off-by: Manish Lachwani <mlachwani@mvista.com>
Signed-off-by: Deepak Saxena <dsaxena@mvista.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:01:01 -04:00
Ramkrishna Vepa 0c61ed5fe2 S2io: Remove unused variables
- Remove unused variables from s2io_nic structure

- Changed the memory failure printk messages to print only in debug mode

- Updated the copyright messages

(Resending; due to patch being corrupted)

Signed-off-by: Santosh Rastapur <santosh.rastapur@neterion.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:01:01 -04:00
Ralf Baechle 1e2b980fdf MIPSnet: Modernize use platform_device API.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:01:01 -04:00
Stephen Hemminger a5f8f3b6c9 skge: version 1.11
New version to track changes.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:01:00 -04:00
Stephen Hemminger 3f0dec7f60 skge: rearrange fields
Do some minor rearrangement of data structures to try and optimize
cache usage.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:01:00 -04:00
Stephen Hemminger 992c9623b1 skge: transmit locking improvements
Don't need to lock when processing transmit complete unless queue fills.
Modeled after tg3.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:01:00 -04:00
Stephen Hemminger 7e0038a414 skge: ignore unused error interrupts
The following hardware error bits only show up on Genesis chipset
and are handled elsewhere, so they can be masked off.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:01:00 -04:00
Tony Breeds d2f11e0991 [PATCH] libertas: use standard kernel macros
Cleanup drivers/net/wireless/libertas/debugfs.c to use standard kernel
macros and functions.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:01:00 -04:00
Michal Schmidt af5b5c9aa9 [PATCH] airo: Make /sys/bus/pci/drivers/airo/{,un}bind work
The way airo.c keeps track of all its devices is complicated and buggy
as well (del_airo_dev forgets to free the memory add_airo_dev allocates).
It's cleaner to use the standard list primitives.
While we're at it, it's not necessary to put PCI cards in the list, because
the kernel already keeps track of them. We can take advantage of it and
use the .remove callback as it was meant to be.
This makes /sys/bus/pci/drivers/airo/{,un}bind work.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:01:00 -04:00
Michal Schmidt fd48f8d3a3 [PATCH] airo: Don't check for NULL before kfree()
It's unnecessary to check for NULL before calling kfree().

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:01:00 -04:00
Larry Finger aa93c85d09 [PATCH] bcm43xx:Eliminate some 'G Mode Enable' magic numbers
In code manipulating the TM State Low register of 802.11 cores, two
different magic numbers are used to reference the 'G Mode Enable' bit.
One of these, 0x20000000, is clear, but the other, (0x800 << 18), is not.
This patch replaces both types with a defined constant. In addition, two
bits in the TM State High registers are given definitions to help in
following the code.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:00:59 -04:00
Daniel Drake aec91028db [PATCH] zd1211rw: More device IDs
ASUS A9Rp
Tested by Serge
zd1211b chip 0b05:171b v4802 high 00-17-31 AL2230_RF pa0 g--

ZyXEL G-202
Tested by Marcus D. Hanwell
zd1211b chip 0586:3410 v4810 high 00-13-49 AL2230_RF pa0 g---

US Robotics USR805423
Tested by Pascal S. de Kloe
FCC ID: RAXWN4501H
zd1211b chip 0baf:0121 v4810 high 00-14-c1 AL2230_RF pa0 g--N
Julien Pinon reports this also comes in AL2230S form

Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:00:59 -04:00
Daniel Drake f2a81a161d [PATCH] zd1211rw: Add AL2230S RF support
ZD1211 appears to be back in production: a number of new devices have
been appearing! Some of them are using new radios.

This patch adds support for the next generation AL2230 RF chip which has
been spotted in a few new devices.

Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:00:59 -04:00
Daniel Drake 832855dc5a [PATCH] zd1211rw: Use compare_ether_addr()
Suggested by Maxime Austruy, based on mac80211 changes from Stephen
Hemminger

Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:00:59 -04:00
Valerie Henson 6bab99be91 Rev tulip version
Rev tulip version... things have changed since 2002!

Signed-off-by: Valerie Henson <val_henson@linux.intel.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:59 -04:00
Valerie Henson 1ddb98618d Fix tulip SytemError typo
Fix an annoying typo - SytemError -> SystemError

Signed-off-by: Valerie Henson <val_henson@linux.intel.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:59 -04:00
Thibaut VARENE eb117b1786 TULIP: Natsemi dp83840a PHY fix
Fix a problem with Tulip 21142 HP branded PCI cards (PN#: B5509-66001),
which feature a NatSemi DP83840A PHY.

Without that patch, it is impossible to properly initialize the card's PHY,
and it's thus impossible to monitor/configure it.

[VAL: I'm happy with the 1.5 ms max delay; it doesn't seem excessive.]

Signed-off-by: Thibaut VARENE <varenet@parisc-linux.org>
Cc: Jeff Garzik <jgarzik@pobox.com>
Acked-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Valerie Henson <val_henson@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:58 -04:00
Valerie Henson b3bff39a2b TULIP: Fix for 64-bit MIPS
From: Jim Gifford <maillist@jg555.com>, Grant Grundler <grundler@parisc-linux.org>, Peter Horton <pdh@colonel-panic.org>

With Grant's help I was able to get the tulip driver to work with 64 bit
MIPS.

[VAL: I'm happy with the 1.5 ms max delay; it doesn't seem excessive.]

Signed-off-by: Valerie Henson <val_henson@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:58 -04:00
Atsushi Nemoto c28896a424 tc35815: Zap changelog from source code
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:58 -04:00
Atsushi Nemoto 793bc0afbd tc35815: Fix an usage of streaming DMA API.
The tc35815 driver lacks a call to pci_dma_sync_single_for_device() on
receiving.  Recent fix of MIPS dma_sync_single_for_cpu() reveal this
bug.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:58 -04:00
Don Fry 1e56a4b402 pcnet32: change to use netdev_priv
use netdev_priv() instead of dev->priv

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Don Fry <pcnet32@verizon.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:58 -04:00
Don Fry 6ecb766710 pcnet32: only allocate init_block dma consistent
The patch below moves the init_block out of the private struct and
only allocates init block with pci_alloc_consistent.

This has two effects:

1. Performance increase for non cache coherent machines, because the
   CPU only data in the private struct are now cached

2. locks are working now for platforms, which need to have locks
   in cached memory

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Acked-by: Don Fry <pcnet32@verizon.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:58 -04:00
Ahmed S. Darwish 1c8816c6fe ixgb: Use ARRAY_SIZE macro when appropriate.
Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:58 -04:00
Ramkrishna Vepa 363dc36733 S2IO: Save/Restore unused buffer mappings in 2/3 buffer mode
- Save/Restore unused buffer mappings in 2/3 buffer mode to avoid
frequent mapping

- Save/Restore adapter reset count during adapter reset

  (Resending; forgot to cc netdev)

Signed-off-by: Santosh Rastapur <santosh.rastapur@neterion.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:58 -04:00
Yan Burman 1c7e5b125a e1000: Use kcalloc()
Replace kmalloc+memsetout the driver. Slightly modified by Auke Kok.

Signed-off-by: Yan Burman <burman.yan@gmail.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:57 -04:00
Ahmed S. Darwish c38db30b22 e1000: Use ARRAY_SIZE macro when appropriate
A patch to use ARRAY_SIZE macro already defined in kernel.h.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:57 -04:00
Shan Lu 024a0a3cfb network: add the missing phy_device speed information to phy_mii_ioctl
Function `phy_mii_ioctl' returns physical device's information based on
user requests.  When requested to return the basic mode control register
information (BMCR), the original implementation only returns the physical
device's duplex information and forgets to return speed information, which
should not be because BMCR register is used to hold both duplex and speed
information.

The patch checks the BMCR value against speed-related flags and fills the
return structure's speed field accordingly.

Signed-off-by: Shan <shanlu@cs.uiuc.edu>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:57 -04:00
Dmitriy Monakhov 2b272221ad sk98lin: handle pci_enable_device() return value in skge_resume()
Signed-off-by: Monakhov Dmitriy <dmonakhov@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:57 -04:00
Maxim Levitsky f1069046b4 dmfe: add support for Wake on lan
Add support for WOL on Magic Packet and on link change

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: Valerie Henson <val_henson@linux.intel.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:57 -04:00
Maxim Levitsky bc8a8387ba dmfe: add support for suspend/resume
This adds support for suspend resume

[akpm@linux-foundation.org: fix CONFIG_PM=n, coding style]
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: Valerie Henson <val_henson@linux.intel.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:57 -04:00
Randy Dunlap b3df0da886 phy layer: add kernel-doc + DocBook
Convert function documentation in drivers/net/phy/ to kernel-doc
and add it to DocBook.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:57 -04:00
Arjan van de Ven 56e1393f82 user of the jiffies rounding code: e1000
Use the round_jiffies() function in e1000.

These timers all were of the "about once a second" or "about once every X
seconds" variety and several showed up in the "what wakes the cpu up" profiles
that the tickless patches provide.  Some timers are highly dynamic based on
network load; but even on low activity systems they still show up so the
rounding is done only in cases of low activity, allowing higher frequency
timers in the high activity case.

The various hardware watchdogs are an obvious case; they run every 2 seconds
but aren't otherwise specific of exactly when they need to run.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Auke Kok <auke-jan.h.kok@intel.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:57 -04:00
Atsushi Nemoto eea221ce48 tc35815 driver update (take 2)
Current tc35815 driver is very obsolete and less maintained for a long
time.  Replace it with a new driver based on one from CELF patch
archive.

Major advantages of CELF version (version 1.23, for kernel 2.6.10) are:

* Independent of JMR3927.
  (Actually independent of MIPS, but AFAIK the chip is used only on
   MIPS platforms)
* TX4938 support.
* 64-bit proof.
* Asynchronous and on-demand auto negotiation.
* High performance on non-coherent architecture.
* ethtool support.
* Many bugfixes and cleanups.

And improvoments since version 1.23 are:

* TX4939 support.
* NETPOLL support.
* NAPI support. (disabled by default)
* Reduce memcpy on receiving.
* PM support.
* Many cleanups and bugfixes.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:56 -04:00
Adrian Bunk 3664006ab9 drivers/net/qla3xxx.c: make 2 functions static
This patch makes two needlessly global functions static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:56 -04:00
Adrian Bunk 7b49034399 make drivers/net/s2io.c:vlan_strip_flag static
This patch makes the needlessly global vlan_strip_flag static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:56 -04:00
Ladislav Michl 78ee5b3cc8 Add support for Seeq 8003 on Challenge S Mezz board.
Thanks to Jö Fahlke for donating hardware.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>

Forward porting of Ladis' 2.4 patch.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:56 -04:00
Jan-Bernd Themann 18604c5485 ehea: NAPI multi queue TX/RX path for SMP
This patch provides a functionality that allows parallel
RX processing on multiple RX queues by using dummy netdevices.

Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:56 -04:00
Jan-Bernd Themann 1acf2318dd ehea: dynamic add / remove port
This patch introduces functionality to dynamically add / remove
ehea ports via an userspace DLPAR tool. It creates a subnode for
each logical port in the sysfs.

Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:56 -04:00
Stephen Hemminger 459e536b1d chelsio: use const for virtual functions
There are several uses of _ops structure in this driver that
can be converted to const.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:56 -04:00
Stephen Hemminger 4c247db114 chelsio: use C99 style initialization
Convert some initialized structures to C99 style.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:56 -04:00
Stephen Hemminger 4d2b8f66b8 chelsio: remove unused code for 1G boards
Some code for Chelsio 1G boards was put in the driver
based on the vendor version (minus TOE). Well some of those board
versions are only supported with TOE on the vendor driver, so additional
dead code was added.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28 11:00:55 -04:00
Sam Ravnborg 0ae08183d8 [PATCH] bcm43xx: do not rebuild when kernel version changes
In bcm43xx_ethtool, UTS_RELEASE is used. Replacing this with utsname()->release
avoids rebuilding this module each time the kernel version changes.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:00:55 -04:00
Jouni Malinen 99d3184ac7 [PATCH] hostap: Add D-Link DWL-650 Rev. P1 product id
It looks like some of the PC Card manfid/product strings were lost
when Host AP driver was converted to use PCMCIA_DEVICE_* helpers. This
patch adds back D-Link DWL-650 Rev. P1 using the same product ID
string match as the pcmcia-cs/cardmgr configuration used before.

Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:00:55 -04:00
Andrew Morton 742e9910d6 [PATCH] ipw2200: fix ieee80211_get_geo typo
testing much?

Cc: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:00:55 -04:00
John W. Linville b3f1b8cf11 [PATCH] libertas: fix build breakage from netdev class_device -> device
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:00:55 -04:00
John W. Linville ebb4e07e35 [PATCH] wireless: remove obsolete text files
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:00:55 -04:00
Pavel Roskin c6710e50f6 [PATCH] hostap: use offsetof() instead of own equivalent
The original macros result in gcc 4.2 warning about "cast from pointer
to integer of different size" on 64-bit systems.

Use of offsetof() on fields in substructures is widespread throughout
the kernel code and should work whether offsetof() is defined using
__compiler_offsetof() or a cast.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:00:55 -04:00
Marcelo Tosatti 876c9d3aeb [PATCH] Marvell Libertas 8388 802.11b/g USB driver
Add the Marvell Libertas 8388 802.11 USB driver.

Signed-off-by: Marcelo Tosatti <marcelo@kvack.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:00:54 -04:00
Ulrich Kunitz 35c3404efa [PATCH] zd1211rw: changed GFP_NOFS to GFP_KERNEL
Michael Buesch commented that GFP_NOFS should not be used in a
network driver.

Signed-off-by: Ulrich Kunitz <kune@deine-taler.de>
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:00:54 -04:00
Zhu Yi 375dd24428 [PATCH] ipw2200: add channels sysfs entry
Add 'channels' sysfs entry for ipw2200. The entry exports channels
information for the user space.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-04-28 11:00:54 -04:00
Neil Horman dc5a144991 sis900: Allocate rx replacement buffer before rx operation
Just found a hole in my last patch.  It was reported to me that shortly after we
integrated this patch.  The report was of an oops that took place inside of
netif_rx when using the sis900 driver.  Looking at my origional patch I noted
that there was a spot between the new skb_alloc and the refill_rx_ring label
where skb got reassigned to the pointer currently held in the rx_ring for the
purposes of receiveing the frame.  The result of this is however that the buffer
that gets passed to netif_rx (if it is called), then gets placed right back into
the rx_ring.  So if you receive frames fast enough the skb being processed by
the network stack can get corrupted.  The reporter is testing out the fix I've
written for this below (I'm not near my hardware at the moment to test myself),
but I wanted to post it for review ASAP.  I'll post test results when I hear
them, but I think this is a pretty straightforward fix.  It just uses a separate
pointer to do the rx operation, so that we don't improperly reassign the pointer
that we use to refill the rx ring.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-27 20:16:41 -04:00
Greg Kroah-Hartman 87aebe078e PHY: remove rwsem use from phy core
The subsystem rwsem is not used by the driver core at all, so the use of
it in the phy code doesn't make any sense.  They might possibly
want to use a local lock, but I am unsure about that.

Cc: netdev <netdev@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-04-27 10:57:31 -07:00
Linus Torvalds c58b8e4a25 Merge branch 'e1000-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'e1000-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
  e1000: FIX: Stop raw interrupts disabled nag from RT
  e1000: FIX: firmware handover bits
  e1000: FIX: be ready for incoming irq at pci_request_irq
2007-04-27 10:14:53 -07:00
Linus Torvalds 0278ef8b48 Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: (67 commits)
  [SCSI] SUNESP: Complete driver rewrite to version 2.0
  [SPARC64]: Convert PCI over to generic struct iommu/strbuf.
  [SPARC]: device_node name constification fallout
  [SPARC64]: Convert SBUS over to generic iommu/strbuf structs.
  [SPARC64]: Add generic iommu and strbuf structs to iommu.h
  [SPARC64]: Consolidate {sbus,pci}_iommu_arena.
  [SPARC]: Make device_node name and type const
  [SPARC64]: constify some paramaters of OF routines
  [TIGON3]: of_get_property() returns const.
  [SPARC64]: Fix PCI rework to adhere to of_get_property() const return.
  [SPARC64]: Document and fix calculation of pages_avail.
  [SPARC64]: Make sure pbm->prom_node is setup easly enough in psycho.c
  [SPARC64]: Use bootmem_bootmap_pages() in choose_bootmap_pfn().
  [SPARC64]: Add proper header file extern for cmdline_memory_size.
  [SPARC64]: Kill sparc_ultra_dump_{i,d}tlb()
  [SPARC64]: Use DECLARE_BITMAP and BITS_TO_LONGS in mm/init.c
  [SPARC64]: Give move verbose show_mem() output just like i386.
  [SPARC64]: Mark show_mem() printk's with KERN_INFO.
  [SPARC64]: Kill kvaddr_to_phys() and friends.
  [SPARC64]: Privatize sun4u_get_pte() and fix name.
  ...
2007-04-27 09:29:04 -07:00
Stephen Rothwell 5bcec54f02 [POWERPC] Partially revert a7edd0e676
Due to conflicts with the network drivers tree.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-27 15:51:56 +10:00
Paul Mackerras a48141db68 Revert "[POWERPC] Rename get_property to of_get_property: drivers"
This reverts commit d05c7a80cf,
which included changes which should go via other subsystem
maintainers.
2007-04-26 22:24:31 +10:00
David S. Miller 374d4cac62 [TIGON3]: of_get_property() returns const.
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:55:38 -07:00
David S. Miller d297c31fd1 [TULIP]: Use pci_device_to_OF_node() on sparc.
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:54:57 -07:00
David S. Miller 49345103fe [TULIP]: Use CONFIG_SPARC consistently in ifdef tests.
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:54:55 -07:00
David S. Miller 49b6e95ff6 [TG3]: Use pci_device_to_OF_node() on sparc.
And use CONFIG_SPARC instead of CONFIG_SPARC64 as the
test.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:54:53 -07:00
David S. Miller 6f85a8597d [SUNHME]: Use pci_device_to_OF_node().
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:54:51 -07:00
David S. Miller 457e1a8afb [SUNGEM]: Consolidate powerpc and sparc MAC probing code.
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:54:48 -07:00
David S. Miller dadb830dac [SUNGEM]: __sparc__ --> CONFIG_SPARC
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:54:46 -07:00
Stephen Rothwell ccf0dec6fc [SPARC/64] constify of_get_property return: drivers
The only unfortunate bit here is that the name field of struct map_info
is not const, so for now we put a cast on the assignment of it.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:54:27 -07:00
Milind Arun Choudhary 57cd5f754e [NET]: ROUND_UP macro cleanup in drivers/net/ppp_generic.c
ROUND_UP macro cleanup use DIV_ROUND_UP

Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:01:53 -07:00
Brian Braunstein 36226a8ded [NET] tun/tap: fixed hw address handling
Fixed tun/tap driver's handling of hw addresses.  The hw address is stored
in both the net_device.dev_addr and tun.dev_addr fields.  These fields were
not kept synchronized, and in fact weren't even initialized to the same
value.  Now during both init and when performing SIOCSIFHWADDR on the tun
device these values are both updated.  However, if SIOCSIFHWADDR is
performed on the net device directly (for instance, setting the hw address
using ifconfig), the tun device does not get updated.  Perhaps the
tun.dev_addr field should be removed completely at some point, as it is
redundant and net_device.dev_addr can be used anywhere it is used.

Signed-off-by: Brian Braunstein <linuxkernel@bristyle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 01:00:55 -07:00
Andrew Morton 55404bca6c [NET]: Fix yam.c
drivers/net/hamradio/yam.c: In function `yam_tx_byte':
drivers/net/hamradio/yam.c:643: warning: passing arg 1 of `skb_copy_from_linear_data_offset' from incompatible pointer type

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-26 00:55:53 -07:00
Mark Huth f50393fe86 e1000: FIX: Stop raw interrupts disabled nag from RT
Current e1000_xmit_frame spews raw interrupt disabled nag messages when
used with RT kernel patches.  This patch uses spin_trylock_irqsave,
which allows RT patches to properly manage the irq semantics.

Signed-off-by: Mark Huth <mhuth@mvista.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-26 02:22:41 -04:00
Bruce Allan 31d76442f7 e1000: FIX: firmware handover bits
Upon code inspection it was spotted that the firmware handover bit get/set
mismatched, which may have resulted in management issues on PCI-E
adapters. Setting them correctly may fix some management issues such
as arp routing etc.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-26 02:22:41 -04:00
Auke Kok e0aac5a289 e1000: FIX: be ready for incoming irq at pci_request_irq
DEBUG_SHIRQ code exposed that e1000 was not ready for incoming interrupts
after having called pci_request_irq. This obviously requires us to finish
our software setup which assigns the irq handler before we request the
irq.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-26 02:22:41 -04:00
John W. Linville 42431592e7 [WIRELESS] drivers/net/wireless/Kconfig: correct minor typo
Correct minor typo in drivers/net/wireless/Kconfig identified by
Stefano Brivio <stefano.brivio@polimi.it>.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:29:43 -07:00
Johannes Berg 2a5e1c0eb9 [WIRELESS]: Refactor wireless Kconfig.
This patch refactors the wireless Kconfig all over and already
introduces net/wireless/Kconfig with just the WEXT bit for now,
the cfg80211 patch will add to that as well.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:29:40 -07:00
Samuel Ortiz 599b1fa914 [IrDA]: Adding carriage returns to mcs7780 debug statements
Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:29:31 -07:00
Michal Ostrowski 42dc9cd54b [PPPOE]: Fix device tear-down notification.
pppoe_flush_dev() kicks all sockets bound to a device that is going down.
In doing so, locks must be taken in the right order consistently (sock lock,
followed by the pppoe_hash_lock).  However, the scan process is based on
us holding the sock lock.  So, when something is found in the scan we must
release the lock we're holding and grab the sock lock.

This patch fixes race conditions between this code and pppoe_release(),
both of which perform similar functions but would naturally prefer to grab
locks in opposing orders.  Both code paths are now going after these locks
in a consistent manner.

pppoe_hash_lock protects the contents of the "pppox_sock" objects that reside
inside the hash.  Thus, NULL'ing out the pppoe_dev field should be done
under the protection of this lock.

Signed-off-by: Michal Ostrowski <mostrows@earthlink.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:29:21 -07:00
Florian Zumbiehl 202a03acf9 [PPPOE]: memory leak when socket is release()d before PPPIOCGCHAN has been called on it
below you find a patch that fixes a memory leak when a PPPoE socket is
release()d after it has been connect()ed, but before the PPPIOCGCHAN ioctl
ever has been called on it.

This is somewhat of a security problem, too, since PPPoE sockets can be
created by any user, so any user can easily allocate all the machine's
RAM to non-swappable address space and thus DoS the system.

Is there any specific reason for PPPoE sockets being available to any
unprivileged process, BTW? After all, you need a packet socket for the
discovery stage anyway, so it's unlikely that any unprivileged process
will ever need to create a PPPoE socket, no? Allocating all session IDs
for a known AC is a kind of DoS, too, after all - with Juniper ERXes,
this is really easy, actually, since they don't ever assign session ids
above 8000 ...

Signed-off-by: Florian Zumbiehl <florz@florz.de>
Acked-by: Michal Ostrowski <mostrows@earthlink.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:29:20 -07:00
Florian Zumbiehl 74b885cf86 [PPPOE]: race between interface going down and connect()
below you find a patch that (hopefully) fixes a race between an interface
going down and a connect() to a peer on that interface. Before,
connect() would determine that an interface is up, then the interface
could go down and all entries referring to that interface in the
item_hash_table would be marked as ZOMBIEs and their references to
the device would be freed, and after that, connect() would put a new
entry into the hash table referring to the device that meanwhile is
down already - which also would cause unregister_netdevice() to wait
until the socket has been release()d.

This patch does not suffice if we are not allowed to accept connect()s
referring to a device that we already acked a NETDEV_GOING_DOWN for
(that is: all references are only guaranteed to be freed after
NETDEV_DOWN has been acknowledged, not necessarily after the
NETDEV_GOING_DOWN already). And if we are allowed to, we could avoid
looking through the hash table upon NETDEV_GOING_DOWN completely and
only do that once we get the NETDEV_DOWN ...

mostrows:
pppoe_flush_dev is called on NETDEV_GOING_DOWN and NETDEV_DOWN to deal with
this "late connect" issue.  Ideally one would hope to notify users at the
"NETDEV_GOING_DOWN" phase (just to pretend to be nice).  However, it is the
NETDEV_DOWN scan that takes all the responsibility for ensuring nobody is
hanging around at that time.

Signed-off-by: Florian Zumbiehl <florz@florz.de>
Acked-by: Michal Ostrowski <mostrows@earthlink.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:29:19 -07:00
Florian Zumbiehl bfafb26e11 [PPPoE]: miscellaneous smaller cleanups
below is a patch that just removes dead code/initializers without any
effect (first access is an assignment) that I stumbled accross while
reading the source.

Signed-off-by: Florian Zumbiehl <florz@florz.de>
Acked-by: Michal Ostrowski <mostrows@earthlink.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:29:18 -07:00
Eric Dumazet 33036807b3 [NET]: loopback driver can use loopback_dev integrated net_device_stats
Rusty added a new 'stats' field to struct net_device.

loopback driver can use it instead of declaring another struct
net_device_stats This saves some memory.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:28:52 -07:00
Herbert Xu 628592ccdb [NETDRV]: Perform missing csum_offset conversions
When csum_offset was introduced we did a conversion from csum to
csum_offset where applicable.  A couple of drivers were missed in
this process.

It was harmless to begin with since the two fields coincided.  Now
that we've made them different with the addition of csum_start, the
missed drivers must be converted or they can't send packets out at
all that require checksum offload.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:28:41 -07:00
Arnaldo Carvalho de Melo 27d7ff46a3 [SK_BUFF]: Introduce skb_copy_to_linear_data{_offset}
To clearly state the intent of copying to linear sk_buffs, _offset being a
overly long variant but interesting for the sake of saving some bytes.

Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
2007-04-25 22:28:29 -07:00
David S. Miller 3dbad80ac7 [NET]: Fix warnings in 3c523.c and ni52.c
We have to put back the cast to "char *" because these
pointers are volatile.

Reported by Andrew Morton.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:28:27 -07:00
Rusty Russell c45d286e72 [NET]: Inline net_device_stats
Network drivers which keep stats allocate their own stats structure
then write a get_stats() function to return them.  It would be nice if
this were done by default.

1) Add a new "stats" field to "struct net_device".
2) Add a new feature field to say "this driver uses the internal one"
3) Have a default "get_stats" which returns NULL if that feature not set.
4) Change callers to check result of get_stats call for NULL, not if
   ->get_stats is set.

This should not break backwards compatibility with older drivers, yet
allow modern drivers to shed some boilerplate code.

Lightly tested: works for a modified lguest network driver.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:28:26 -07:00
Arnaldo Carvalho de Melo d626f62b11 [SK_BUFF]: Introduce skb_copy_from_linear_data{_offset}
To clearly state the intent of copying from linear sk_buffs, _offset being a
overly long variant but interesting for the sake of saving some bytes.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2007-04-25 22:28:23 -07:00
David S. Miller 2f7826c024 [WAN] cosa.c: Build fix.
Caused by skb_reset_mac_header() changes, missing semicolon.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:28:11 -07:00
Arnaldo Carvalho de Melo 8b5be26831 [FORCEDETH]: Use skb_tailroom where appropriate
Reducing the number of skb->data direct accesses.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:26:41 -07:00
Arnaldo Carvalho de Melo d004b8d490 [LMC]: lmc_main wants to use skb_tailroom
At that point it is equivalent to what was being used, skb->end - skb->data,
and the need is clearly the one skb_tailroom satisfies.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:26:40 -07:00
Arnaldo Carvalho de Melo 4305b54135 [SK_BUFF]: Convert skb->end to sk_buff_data_t
Now to convert the last one, skb->data, that will allow many simplifications
and removal of some of the offset helpers.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:26:29 -07:00
Arnaldo Carvalho de Melo 27a884dc3c [SK_BUFF]: Convert skb->tail to sk_buff_data_t
So that it is also an offset from skb->head, reduces its size from 8 to 4 bytes
on 64bit architectures, allowing us to combine the 4 bytes hole left by the
layer headers conversion, reducing struct sk_buff size to 256 bytes, i.e. 4
64byte cachelines, and since the sk_buff slab cache is SLAB_HWCACHE_ALIGN...
:-)

Many calculations that previously required that skb->{transport,network,
mac}_header be first converted to a pointer now can be done directly, being
meaningful as offsets or pointers.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:26:28 -07:00
Peter Kovar afdf27c956 [IrDA]: SMC SuperIO Chip LPC47N227 not identified properly
SMC SuperIO Chip LPC47N227 used for IrDA is not detected because its device
identification byte can be 0x7A instead of 0x5A.

Patch from Peter Kovar <peter.kovar@gmail.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:26:25 -07:00
Samuel Ortiz 5c81cd75fa [IrDA]: removing stir4200 useless include
stir4200 doesn't need to include irlap.h

Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:26:22 -07:00
Arnaldo Carvalho de Melo b0e380b1d8 [SK_BUFF]: unions of just one member don't get anything done, kill them
Renaming skb->h to skb->transport_header, skb->nh to skb->network_header and
skb->mac to skb->mac_header, to match the names of the associated helpers
(skb[_[re]set]_{transport,network,mac}_header).

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:26:20 -07:00
Arnaldo Carvalho de Melo cfe1fc7759 [SK_BUFF]: Introduce skb_network_header_len
For the common sequence "skb->h.raw - skb->nh.raw", similar to skb->mac_len,
that is precalculated tho, don't think we need to bloat skb with one more
member, so just use this new helper, reducing the number of non-skbuff.h
references to the layer headers even more.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:26:19 -07:00
Arnaldo Carvalho de Melo 9c70220b73 [SK_BUFF]: Introduce skb_transport_header(skb)
For the places where we need a pointer to the transport header, it is
still legal to touch skb->h.raw directly if just adding to,
subtracting from or setting it to another layer header.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:25:31 -07:00
Arnaldo Carvalho de Melo b0061ce49c [SK_BUFF]: Introduce ipip_hdr(), remove skb->h.ipiph
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:25:27 -07:00
Arnaldo Carvalho de Melo aa8223c7bb [SK_BUFF]: Introduce tcp_hdr(), remove skb->h.th
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:25:26 -07:00
Arnaldo Carvalho de Melo ab6a5bb6b2 [TCP]: Introduce tcp_hdrlen() and tcp_optlen()
The ip_hdrlen() buddy, created to reduce the number of skb->h.th-> uses and to
avoid the longer, open coded equivalent.

Ditched a no-op in bnx2 in the process.

I wonder if we should have a BUG_ON(skb->h.th->doff < 5) in tcp_optlen()...

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:25:24 -07:00
Arnaldo Carvalho de Melo 4bedb45203 [SK_BUFF]: Introduce udp_hdr(), remove skb->h.uh
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:25:22 -07:00
Arnaldo Carvalho de Melo ea2ae17d64 [SK_BUFF]: Introduce skb_transport_offset()
For the quite common 'skb->h.raw - skb->data' sequence.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:25:16 -07:00
Arnaldo Carvalho de Melo badff6d01a [SK_BUFF]: Introduce skb_reset_transport_header(skb)
For the common, open coded 'skb->h.raw = skb->data' operation, so that we can
later turn skb->h.raw into a offset, reducing the size of struct sk_buff in
64bit land while possibly keeping it as a pointer on 32bit.

This one touches just the most simple cases:

skb->h.raw = skb->data;
skb->h.raw = {skb_push|[__]skb_pull}()

The next ones will handle the slightly more "complex" cases.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:25:15 -07:00
Arnaldo Carvalho de Melo 0660e03f6b [SK_BUFF]: Introduce ipv6_hdr(), remove skb->nh.ipv6h
Now the skb->nh union has just one member, .raw, i.e. it is just like the
skb->mac union, strange, no? I'm just leaving it like that till the transport
layer is done with, when we'll rename skb->mac.raw to skb->mac_header (or
->mac_header_offset?), ditto for ->{h,nh}.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:25:14 -07:00
Arnaldo Carvalho de Melo d0a92be05e [SK_BUFF]: Introduce arp_hdr(), remove skb->nh.arph
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:25:12 -07:00
Arnaldo Carvalho de Melo eddc9ec53b [SK_BUFF]: Introduce ip_hdr(), remove skb->nh.iph
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:25:10 -07:00
Arnaldo Carvalho de Melo c9bdd4b525 [IP]: Introduce ip_hdrlen()
For the common sequence "skb->nh.iph->ihl * 4", removing a good number of open
coded skb->nh.iph uses, now to go after the rest...

Just out of curiosity, here are the idioms found to get the same result:

skb->nh.iph->ihl << 2
skb->nh.iph->ihl<<2
skb->nh.iph->ihl * 4
skb->nh.iph->ihl*4
(skb->nh.iph)->ihl * sizeof(u32)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:25:07 -07:00
Arnaldo Carvalho de Melo d56f90a7c9 [SK_BUFF]: Introduce skb_network_header()
For the places where we need a pointer to the network header, it is still legal
to touch skb->nh.raw directly if just adding to, subtracting from or setting it
to another layer header.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:24:59 -07:00
Arnaldo Carvalho de Melo bbe735e424 [SK_BUFF]: Introduce skb_network_offset()
For the quite common 'skb->nh.raw - skb->data' sequence.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:24:58 -07:00
Arnaldo Carvalho de Melo e7dd65dafd [SK_BUFF] bonding: Set skb->nh.raw relative to skb->mac.raw
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:24:56 -07:00
Arnaldo Carvalho de Melo c1d2bbe1cd [SK_BUFF]: Introduce skb_reset_network_header(skb)
For the common, open coded 'skb->nh.raw = skb->data' operation, so that we can
later turn skb->nh.raw into a offset, reducing the size of struct sk_buff in
64bit land while possibly keeping it as a pointer on 32bit.

This one touches just the most simple case, next will handle the slightly more
"complex" cases.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:24:46 -07:00
Arnaldo Carvalho de Melo a16aeb3623 [BONDING]: Introduce arp_pkt()
For consistency with all the other skb->nh.raw accessors.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:24:44 -07:00
Arnaldo Carvalho de Melo 797659fb4a [PPPOE]: Introduce pppoe_hdr()
For consistency with all the other skb->nh.raw accessors.

Also do some really obvious simplifications in pppoe_recvmsg, well the
kfree_skb one is not so obvious, but free() and kfree() have the same behaviour
(hint :-) ).

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:24:43 -07:00
Arnaldo Carvalho de Melo 98e399f82a [SK_BUFF]: Introduce skb_mac_header()
For the places where we need a pointer to the mac header, it is still legal to
touch skb->mac.raw directly if just adding to, subtracting from or setting it
to another layer header.

This one also converts some more cases to skb_reset_mac_header() that my
regex missed as it had no spaces before nor after '=', ugh.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:24:41 -07:00
Arnaldo Carvalho de Melo 48d49d0ccd [SK_BUFF]: Introduce skb_set_mac_header()
For the cases where we want to set skb->mac.raw to an offset from skb->data.

Simple cases first, the memmove ones and specially pktgen will be left for later.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:24:37 -07:00
Arnaldo Carvalho de Melo 459a98ed88 [SK_BUFF]: Introduce skb_reset_mac_header(skb)
For the common, open coded 'skb->mac.raw = skb->data' operation, so that we can
later turn skb->mac.raw into a offset, reducing the size of struct sk_buff in
64bit land while possibly keeping it as a pointer on 32bit.

This one touches just the most simple case, next will handle the slightly more
"complex" cases.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:24:32 -07:00
Arnaldo Carvalho de Melo 4c13eb6657 [ETH]: Make eth_type_trans set skb->dev like the other *_type_trans
One less thing for drivers writers to worry about.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:24:30 -07:00
Arnaldo Carvalho de Melo 0a4f23fbbf [HIPPI/FDDI]: Make {hippi,fddi}_type_trans set skb->dev
Now all the _type_trans routines are consistent in this regard.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:24:26 -07:00
Arnaldo Carvalho de Melo c8fb7948dc [TR]: Make tr_type_trans set skb->dev
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:24:24 -07:00
Arnaldo Carvalho de Melo c1a4b86e39 [TR]: Use tr_hdr() were appropriate
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25 22:24:23 -07:00
Linus Torvalds 12145387a0 Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [BNX2]: Fix occasional NETDEV WATCHDOG on 5709.
  [IPV6]: Disallow RH0 by default.
  [XFRM]: beet: fix pseudo header length value
  [TCP]: Congestion control initialization.
2007-04-24 18:20:32 -07:00
Michael Chan 68c9f75a05 [BNX2]: Fix occasional NETDEV WATCHDOG on 5709.
Tweak a register setting to prevent the tx mailbox from halting.

Update version to 1.5.8.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-24 15:35:53 -07:00
Andrew Morton 5efb764c86 drivers/net/hamradio/baycom_ser_fdx build fix
sparc64:

drivers/net/hamradio/baycom_ser_fdx.c: In function `ser12_open':
drivers/net/hamradio/baycom_ser_fdx.c:417: error: `NR_IRQS' undeclared (first us
e in this function)
drivers/net/hamradio/baycom_ser_fdx.c:417: error: (Each undeclared identifier is
 reported only once
drivers/net/hamradio/baycom_ser_fdx.c:417: error: for each function it appears i
n.)

Cc: Folkert van Heusden <folkert@vanheusden.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-24 12:51:03 -04:00
Neil Horman b748d9e3b8 sis900: Allocate rx replacement buffer before rx operation
The sis900 driver appears to have a bug in which the receive routine
passes the skbuff holding the received frame to the network stack before
refilling the buffer in the rx ring.  If a new skbuff cannot be allocated, the
driver simply leaves a hole in the rx ring, which causes the driver to stop
receiving frames and become non-recoverable without an rmmod/insmod according to
reporters.  This patch reverses that order, attempting to allocate a replacement
buffer first, and receiving the new frame only if one can be allocated.  If no
skbuff can be allocated, the current skbuf in the rx ring is recycled, dropping
the current frame, but keeping the NIC operational.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-24 12:43:07 -04:00
Andrea Righi d91c088b39 [netdrvr] depca: handle platform_device_add() failure
The following patch fixes a kernel bug in depca_platform_probe().

We don't use a dynamic pointer for pldev->dev.platform_data, so it seems
that the correct way to proceed if platform_device_add(pldev) fails is
to explicitly set the pldev->dev.platform_data pointer to NULL, before
calling the platform_device_put(pldev), or it will be kfree'ed by
platform_device_release().

Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-24 12:40:57 -04:00
S.Çağlar Onur c445a31cd7 Add missing USRobotics Wireless Adapter (Model 5423) id into zd1211rw
USRobotics Wireless Adapter (Model 5423) works well with current
zd1211rw driver also (i have tested 2.6.18, 2.6.20 and 2.6.21-rc7).

It just needs its ID added to the list of devices.

Signed-off-by: S.Çağlar Onur <caglar@pardus.org.tr>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-04-23 11:20:00 -07:00
Linus Torvalds 66c7d2f1d9 Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SUNHME]: Fix module unload.
  [SUNLANCE]: Fix module unload.
  [SUNQE]: Fix MAC address assignment.
  [SBUS] vfc_dev.c: kzalloc
2007-04-23 11:13:19 -07:00
Linus Torvalds 36e82dfda5 Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [PPP]: Fix skbuff.c:BUG due incorrect logic in process_input_packet()
2007-04-23 11:13:00 -07:00
Marcel van Nies c3b99f0db9 [SUNHME]: Fix module unload.
Signed-off-by: Marcel van Nies <morcles@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-21 15:34:55 -07:00
Marcel van Nies 9f9b6693ed [SUNLANCE]: Fix module unload.
Signed-off-by: Marcel van Nies <morcles@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-21 15:34:10 -07:00
Marcel van Nies d0dc1129c2 [SUNQE]: Fix MAC address assignment.
The MAC address assignment at module loading is simply forgotten.
The bug at module unloading is caused by an incorrect call.

The bug at module unloading does not only happen for sunqe,
sunlance and sunhme (sbus) suffer from it too.

I've tested this on my SS20.

Signed-off-by: Marcel van Nies <morcles@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-21 15:31:58 -07:00
Eric Miao 7053acbd78 [ARM] 4304/1: removes the unnecessary bit number from CKENnn_XXXX
This patch removes the unnecessary bit number from CKENnn_XXXX
definitions for PXA, so that

	CKEN0_PWM0 --> CKEN_PWM0
	CKEN1_PWM1 --> CKEN_PWM1
	...
	CKEN24_CAMERA --> CKEN_CAMERA

The reasons for the change of these defitions are:

1. they do not scale - they are currently valid for pxa2xx, but
definitely not valid for pxa3xx, e.g., pxa3xx has bit 3 for camera
instead of bit 24

2. they are unnecessary - the peripheral name within the definition
has already announced its usage, we don't need those bit numbers
to know which peripheral we are going to enable/disable clock for

3. they are inconvenient - think about this: a driver programmer
for pxa has to remember which bit in the CKEN register to turn
on/off

Another change in the patch is to make the definitions equal to its
clock bit index, so that

   #define CKEN_CAMERA  (24)

instead of

   #define CKEN_CAMERA  (1 << 24)

this change, however, will add a run-time bit shift operation in
pxa_set_cken(), but the benefit of this change is that it scales
when bit index exceeds 32, e.g., pxa3xx has two registers CKENA
and CKENB, totally 64 bit for this, suppose CAMERA clock enabling
bit is CKENB:10, one can simply define CKEN_CAMERA to be (32 + 10)
and so that pxa_set_cken() need minimum change to adapt to that.

Signed-off-by: eric miao <eric.y.miao@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-04-21 23:14:01 +01:00
Linus Torvalds 46fcc86dd7 Revert "e1000: fix NAPI performance on 4-port adapters"
This reverts commit 60cba200f1.  It's been
linked to lockups of the e1000 hardware, see for example

	https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=229603

but it's likely that the commit itself is not really introducing the
bug, but just allowing an unrelated problem to rear its ugly head (ie
one current working theory is that the code exposes us to a hardware
race condition by decreasing the amount of time we spend in each NAPI
poll cycle).

We'll revert it until root cause is known.  Intel has a repeatable
reproduction on two different machines and bus traces of the hardware
doing something bad.

Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Greg KH <gregkh@suse.de>
Cc: Dave Jones <davej@redhat.com>
Cc: Auke Kok <auke-jan.h.kok@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-04-19 18:21:01 -07:00
Paul Mackerras 7c5050e3e4 [PPP]: Fix skbuff.c:BUG due incorrect logic in process_input_packet()
From: Paul Mackerras <paulus@samba.org>

This fixes:

Subject: kernel BUG at net/core/skbuff.c in linux-2.6.21-rc6

process_input_packet() treats the case where the first byte is 0xff
(PPP_ALLSTATIONS) but the second byte is 0x03 (PPP_UI) as indicating a
packet with a PPP protocol number of 0xff.  Arguably that's wrong
since PPP protocol 0xff is reserved, and the RFC does envision the
possibility of receiving frames where the control field has values
other than 0x03.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-19 13:05:52 -07:00
Stephen Hemminger 93cd791e02 sky2: version 1.14
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-19 15:01:17 -04:00
Stephen Hemminger d2adf4f65a sky2: no jumbo on Yukon FE
The Yukon FE (100mbit only) chips do not support large packets.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-19 15:01:17 -04:00
Stephen Hemminger b628ed986d sky2: EC-U performance and jumbo support
The Yukon EC Ultra chips have transmit settings for store and
forward and PCI buffering. By setting these appropriately, normal
performance goes from 750Mbytes/sec to 940Mbytes/sec (non-jumbo).

It is also possible to do Jumbo mode, but it means turning off
TSO and checksum offload so the performance gets worse. There isn't
enough buffering for checksum offload to work.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-19 15:01:17 -04:00
Stephen Hemminger 4f44d8ba09 sky2: disable ASF on all chip types
Need to make sure and disable ASF on all chip types. Otherwise, there may be
random reboots.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-19 15:01:17 -04:00
Stephen Hemminger 40b01727a5 sky2: handle descriptor errors
There should never be descriptor error unless hardware or driver is buggy.
But if an error occurs, print useful information, clear irq, and recover.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-19 15:01:17 -04:00
Stephen Hemminger 0a17e4c252 sky2: disable support for 88E8056
This device is having all sorts of problems that lead to data corruption
and system instability.  It gets receive status and data out of order,
it generates descriptor and TSO errors, etc.

Until the problems are resolved, it should not be used by anyone
who cares about there system.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-19 15:01:17 -04:00
Dave Jiang bf41a7c5d9 gianfar needs crc32 lib dependency
Gianfar needs crc32 to be selected to compile.

Signed-off-by: Dave Jiang <djiang@mvista.com>

--
 drivers/net/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
--
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-19 15:01:16 -04:00
Linas Vepstas 33bdeec806 spidernet: Fix problem sending IP fragments
The basic structure of "normal" UDP/IP/Ethernet
frames (that actually work):
 - It starts with the Ethernet header (dest MAC, src MAC, etc.)
 - The next part is occupied by the IP header (version info, length of
packet, id=0, fragment offset=0, checksum, from / to address, etc.)
 - Then comes the UDP header (src / dest port, length, checksum)
 - Actual payload
 - Ethernet checksum

Now what's different for IP fragment:
 - The IP header has id set to some value (same for all fragments),
offset is set appropriately (i.e. 0 for first fragment, following
according to size of other fragments), size is the length of the frame.
 - UDP header is unchanged. I.e. length is according to full UDP
datagram, not just the part within the actual frame! But this is only
true within the first frame: all following frames don't have a valid
UDP-header at all.

The spidernet silicon seems to be quite intelligent: It's able to
compute (IP / UDP / Ethernet) checksums on the fly and tests if frames
are conforming to RFC -- at least conforming to RFC on complete frames.

But IP fragments are different as explained above:
I.e. for IP fragments containing part of a UDP datagram it sees
incompatible length in the headers for IP and UDP in the first frame
and, thus, skips this frame. But the content *is* correct for IP
fragments. For all following frames it finds (most probably) no valid
UDP header at all. But this *is* also correct for IP fragments.

The Linux IP-stack seems to be clever in this point. It expects the
spidernet to calculate the checksum (since the module claims to be able
to do so) and marks the skb's for "normal" frames accordingly
(ip_summed set to CHECKSUM_HW).
But for the IP fragments it does not expect the driver to be capable to
handle the frames appropriately. Thus all checksums are allready
computed. This is also flaged within the skb (ip_summed set to
CHECKSUM_NONE).

Unfortunately the spidernet driver ignores that hints. It tries to send
the IP fragments of UDP datagrams as normal UDP/IP frames. Since they
have different structure the silicon detects them the be not
"well-formed" and skips them.

The following one-liner against 2.6.21-rc2 changes this behavior. If the
IP-stack claims to have done the checksumming, the driver should not
try to checksum (and analyze) the frame but send it as is.

Signed-off-by: Norbert Eicker <n.eicker@fz-juelich.de>
Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-19 15:01:16 -04:00
Divy Le Ray 1ca03cbc20 cxgb3 - PHY interrupts and GPIO pins.
Remove assumption that PHY interrupts use GPIOs 3 and 5.
Deal with PHY interrupts connected to any GPIO pins.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-19 15:01:16 -04:00
Divy Le Ray 606fcd0b94 cxgb3 - Fix low memory conditions
Reuse the incoming skb when a clientless abort req is recieved.

The release of RDMA connections HW resources might be deferred in
low memory situations.
Ensure that no further activity is passed up to the RDMA driver
for these connections.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-19 15:01:16 -04:00
Stephen Rothwell d05c7a80cf [POWERPC] Rename get_property to of_get_property: drivers
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-13 03:55:19 +10:00
Stephen Rothwell a7edd0e676 [POWERPC] get_property returns const
This just tidies up some of the remains.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-13 03:55:17 +10:00
Paul Mackerras e049d1ca30 Merge branch 'linux-2.6' into for-2.6.22 2007-04-13 03:50:03 +10:00
Jeff Garzik cec34dda71 Merge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 into upstream-fixes 2007-04-11 11:55:45 -04:00
Brice Goglin 4b2281c7aa myri10ge: update driver version to 1.3.0-1.233
Update the myri10ge driver version number to 1.3.0-1.233.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-11 11:54:44 -04:00
Brice Goglin f19baaeaad myri10ge: more Intel chipsets providing aligned PCIe completions
Add the Intel 5000 southbridge (aka Intel 6310/6311/6321ESB) PCIe ports
and the Intel E30x0 chipsets to the whitelist of aligned PCIe completion.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-11 11:54:44 -04:00