Commit Graph

11905 Commits (9c74d9fbd59f3a69cbe08a6bd66479c190effe5f)

Author SHA1 Message Date
Eilon Greenstein 3910c8ae44 bnx2x: loopback test failure
A link change interrupt might be queued and activated after the loopback was set
and it will cause the loopback to fail. The PHY lock should be kept until the
loopback test is over.

That implies that the bnx2x_test_link should used within the loopback function
and not bnx2x_wait_for_link since that function also takes the PHY link

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:47:12 -08:00
Eilon Greenstein 5650d9d4cb bnx2x: Missing rmb when waiting for FW response
Waiting for the FW to response requires a memory barrier

Signed-off-by: Michal Kalderon <michals@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:47:12 -08:00
Eilon Greenstein 7cde1c8b79 bnx2x: Calling napi_del
rmmod might hang without this patch since the reference counter is not going
down

Signed-off-by: Yitchak Gertner <gertner@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:47:11 -08:00
Eilon Greenstein 6eccabb301 bnx2x: Carrier off first call
Call carrier off should not be called after register_netdev since after
register netdev open can be called at any time followed by an interrupt that
will set it to carrier_on and the probe will resume control and set it to off

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:45:06 -08:00
Eilon Greenstein 2dfe0e1fec bnx2x: Handling load failures
Failures on load were not handled correctly - separate the flow to handle

different failures

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:45:06 -08:00
Eilon Greenstein e94d8af3da bnx2x: Disable napi
Calling napi disabled unconditionally at netif stop

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:45:05 -08:00
Eilon Greenstein 81f75bbf67 bnx2x: Reset HW before use
To avoid complications, make sure that the HW is in reset (as it should be)
before trying to take it out of reset. In normal flows, the HW is indeed in rest
so this should have no effect

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:45:05 -08:00
Reinette Chatre 637f883739 iwlwifi: return NETDEV_TX_OK from _tx ops
be consistent with mac80211 drivers and return correct return code.
NETDEV_TX_OK is 0, but we need to be consistent wrt formatting amongst
implementations

re: http://marc.info/?l=linux-wireless&m=123119327419865&w=2

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Reviewed-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-22 13:55:03 -05:00
Hin-Tak Leung de2624966f zd1211rw: adding Sitecom WL-603 (0df6:0036) to the USB id list
Giuseppe Cala <jiveaxe@gmail.com> (The second "a" in "Cala" should be
a grave, U+00E0) reported success on zd1211-devs@lists.sourceforge.net.
The chip info is:
zd1211b chip 0df6:0036 v4810 high 00-0c-f6 AL2230_RF pa0 g--N-

The Sitecom WL-603 is detected as a zd1211b with a AL2230 RF transceiver chip.

Signed-off-by: Giuseppe Cala <jiveaxe@gmail.com>
Signed-off-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-22 13:55:03 -05:00
Christian Lamparter e2fe154e91 p54usb: fix nasty use after free
In theory, the firmware acks the received a data frame, before signaling the driver to free it again.
However Artur Skawina <art.08.09@gmail.com> has shown that it can happen in reverse order as well.
This is very bad and could lead to memory corruptions, oopses and panics.

Thanks to Artur Skawina <art.08.09@gmail.com> for reporting and debugging this issue.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Tested-by: Artur Skawina <art.08.09@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-22 13:55:02 -05:00
Christian Lamparter 12da401e0d p54: more cryptographic accelerator fixes
If we let the firmware do the data encryption, we have to remove the ICV and
(M)MIC at the end of the frame before we can give it back to mac80211.
Or, these data frames have a few trailing bytes on cooked monitor interfaces.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-22 13:55:02 -05:00
Chr 40ab73cc6c p54: add missing break in eeprom parser
This patch fixes a obvious memory leak in the eeprom parser.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-22 13:55:02 -05:00
Pavel Roskin 11eaea4167 orinoco: use KERN_DEBUG for link status messages
KERN_INFO is too "loud" for messages that are generated by the ordinary
events, such as accociation.  Use of KERN_DEBUG is consistent with
mac80211.

Suggested by Michael Gilbert <michael.s.gilbert@gmail.com>

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-22 13:55:01 -05:00
Ivo van Doorn 7490889c10 rt2x00: Fix TX rate short preamble detection
Mac80211 provides 2 structures to handle bitrates, namely
ieee80211_rate and ieee80211_tx_rate. To determine the short preamble
mode for an outgoing frame, the flag IEEE80211_TX_RC_USE_SHORT_PREAMBLE
must be checked on ieee80211_tx_rate and not ieee80211_rate (which rt2x00 did).

This fixes a regression which was triggered in 2.6.29-rcX as reported by Chris Clayton.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Tested-By: Chris Clayton <chris2553@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-22 13:55:01 -05:00
Andrey Borzenkov 7fe99c4e28 orinoco: move kmalloc(..., GFP_KERNEL) outside spinlock in orinoco_ioctl_set_genie
[   56.923623] BUG: sleeping function called from invalid context at /home/bor/src/linux-git/mm/slub.c:1599
[   56.923644] in_atomic(): 0, irqs_disabled(): 1, pid: 3031, name: wpa_supplicant
[   56.923656] 2 locks held by wpa_supplicant/3031:
[   56.923662]  #0:  (rtnl_mutex){--..}, at: [<c02abd1f>] rtnl_lock+0xf/0x20
[   56.923703]  #1:  (&priv->lock){++..}, at: [<dfc840c2>] orinoco_ioctl_set_genie+0x52/0x130 [orinoco]
[   56.923782] irq event stamp: 910
[   56.923788] hardirqs last  enabled at (909): [<c01957db>] __kmalloc+0x7b/0x140
[   56.923820] hardirqs last disabled at (910): [<c0309419>] _spin_lock_irqsave+0x19/0x80
[   56.923847] softirqs last  enabled at (880): [<c0124f54>] __do_softirq+0xc4/0x110
[   56.923865] softirqs last disabled at (871): [<c01049ae>] do_softirq+0x8e/0xe0
[   56.923895] Pid: 3031, comm: wpa_supplicant Not tainted 2.6.29-rc2-1avb #1
[   56.923905] Call Trace:
[   56.923919]  [<c01049ae>] ? do_softirq+0x8e/0xe0
[   56.923941]  [<c011ad12>] __might_sleep+0xd2/0x100
[   56.923952]  [<c0195837>] __kmalloc+0xd7/0x140
[   56.923963]  [<c030946a>] ? _spin_lock_irqsave+0x6a/0x80
[   56.923981]  [<dfc840e9>] ? orinoco_ioctl_set_genie+0x79/0x130 [orinoco]
[   56.923999]  [<dfc840c2>] ? orinoco_ioctl_set_genie+0x52/0x130 [orinoco]
[   56.924017]  [<dfc840e9>] orinoco_ioctl_set_genie+0x79/0x130 [orinoco]
[   56.924036]  [<c0209325>] ? copy_from_user+0x35/0x130
[   56.924061]  [<c02ffd96>] ioctl_standard_call+0x196/0x380
[   56.924085]  [<c029f945>] ? __dev_get_by_name+0x85/0xb0
[   56.924096]  [<c02ff88f>] wext_handle_ioctl+0x14f/0x230
[   56.924113]  [<dfc84070>] ? orinoco_ioctl_set_genie+0x0/0x130 [orinoco]
[   56.924132]  [<c02a3da5>] dev_ioctl+0x495/0x570
[   56.924155]  [<c0293e05>] ? sys_sendto+0xa5/0xd0
[   56.924171]  [<c0142fe8>] ? mark_held_locks+0x48/0x90
[   56.924183]  [<c0292880>] ? sock_ioctl+0x0/0x280
[   56.924193]  [<c029297d>] sock_ioctl+0xfd/0x280
[   56.924203]  [<c0292880>] ? sock_ioctl+0x0/0x280
[   56.924235]  [<c01a51d0>] vfs_ioctl+0x20/0x80
[   56.924246]  [<c01a53e2>] do_vfs_ioctl+0x72/0x570
[   56.924257]  [<c0293e62>] ? sys_send+0x32/0x40
[   56.924268]  [<c02947c0>] ? sys_socketcall+0x1d0/0x2a0
[   56.924280]  [<c010339f>] ? sysenter_exit+0xf/0x16
[   56.924292]  [<c01a5919>] sys_ioctl+0x39/0x70
[   56.924302]  [<c0103371>] sysenter_do_call+0x12/0x31

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-22 13:55:01 -05:00
Eric W. Biederman f019a7a594 tun: Implement ip link del tunXXX
This greatly simplifies testing to verify I have fixed the problems
with a tun device disappearing when the tun file descriptor is still
held open.

Further it allows removal network namespace operations for the tun
driver.  Reducing the network namespace handling in the driver to the
minimum.  i.e. When we are creating a tun device.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:02:16 -08:00
Eric W. Biederman aec191aa2a tun: There is no longer any need to deny changing network namespaces
With the awkward case between free_netdev and dev_chr_close fixed
there is no longer any need to limit tun and tap devices to the
network namespace they were created in.  So remove the
NETIF_F_NETNS_LOCAL flag on the network device.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:00:47 -08:00
Eric W. Biederman c70f182940 tun: Fix races between tun_net_close and free_netdev.
The tun code does not cope gracefully if the network device goes away before
the tun file descriptor is closed.  It looks like we can trigger this with
rmmod, and moving tun devices between network namespaces will allow this
to be triggered when network namespaces exit.

To fix this I introduce an intermediate data structure tun_file which
holds a count of users and a pointer to the struct tun_struct.  tun_get
increments that reference count if it is greater than 0.  tun_put decrements
that reference count and detaches from the network device if the count is 0.

While we have a file attached to the network device I hold a reference
to the network device keeping it from going away completely.

When a network device is unregistered I decrement the count of the
attached tun_file and if that was the last user I detach the tun_file,
and all processes on read_wait are woken up to ensure they do not
sleep indefinitely. As some of those sleeps happen with the count on
the tun device elevated waking up the read waiters ensures that
tun_file will be detached in a timely manner.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:00:46 -08:00
Eric W. Biederman b2430de37e tun: Move read_wait into tun_file
The poll interface requires that the waitqueue exist while the struct
file is open.  In the rare case when a tun device disappears before
the tun file closes we fail to provide this property, so move
read_wait.

This is safe now that tun_net_xmit is atomic with tun_detach.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:00:46 -08:00
Eric W. Biederman 38231b7a8d tun: Make tun_net_xmit atomic wrt tun_attach && tun_detach
Currently this small race allows for a packet to be received when we
detach from an tun device and still be enqueued.  Not especially
important but not what the code is trying to do.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:00:45 -08:00
Eric W. Biederman 36b50bab53 tun: Grab the netns in open.
Grabbing namespaces in open, and putting them in close always seems to
be the cleanest approach with the fewest surprises.

So now that we have tun_file so we have somepleace to put the network
namespace, let's grab the network namespace on file open and put on
file close.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:00:45 -08:00
Eric W. Biederman 631ab46b79 tun: Introduce tun_file
Currently the tun code suffers from only having a single word of
data that exists for the entire life of the tun file descriptor.

This results in peculiar holding of references to the network namespace
as well as races between free_netdevice and tun_chr_close.

Fix this by introducing tun_file which will hold the per file state.
For the moment it still holds just a single word so the differences
are all logic changes with no changes in semantics.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:00:44 -08:00
Eric W. Biederman eac9e90265 tun: Use POLLERR not EBADF in tun_chr_poll
EBADF is meaningless in the context of a poll mask so use POLLERR
instead.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:00:44 -08:00
Eric W. Biederman a7385ba211 tun: Fix races in tun_set_iff
It is possible for two different tasks with access to the same file
descriptor to call tun_set_iff on it at the same time and race to
attach to a tap device.  Prevent this by placing all of the logic to
attach to a file descriptor in one function and testing the file
descriptor to be certain it is not already attached to another tun
device.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:00:43 -08:00
Eric W. Biederman 74a3e5a71c tun: Remove unnecessary tun_get_by_name
Currently the tun driver keeps a private list of tun devices for what
appears to be a small gain in performance when reconnecting a file
descriptor to an existing tun or tap device.  So simplify the code by
removing it.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:00:43 -08:00
Cyrill Gorcunov f5882c3050 net: pppoe,pppol2tp - register channels with explicit net
In PPPo[E|L2TP] we could explicitly point which net namespace
we're going to use for channels - make it so.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: James Chapman <jchapman@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 15:55:40 -08:00
Cyrill Gorcunov 273ec51dd7 net: ppp_generic - introduce net-namespace functionality v2
- Each namespace contains ppp channels and units separately
  with appropriate locks

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 15:55:35 -08:00
Cyrill Gorcunov 4e9fb8016a net: pppol2tp - introduce net-namespace functionality
- Each tunnel and appropriate lock are inside own namespace now.
- pppox code allows to create per-namespace sockets for
  both PX_PROTO_OE and PX_PROTO_OL2TP protocols. Actually since
  now pppox_create support net-namespaces new PPPo... protocols
  (if they ever will be) should support net-namespace too otherwise
  explicit check for &init_net would be needed.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: James Chapman <jchapman@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 15:55:15 -08:00
Cyrill Gorcunov a6bcf1c1d3 net: pppoe - introduce net-namespace functionality
- each net-namespace for pppoe module is having own
  hash table and appropriate locks wich are allocated
  at time of namespace intialization. It requires about
  140 bytes of memory for every new namespace but such
  approach allow us to escape from hash chains growing
  and additional lock contends (especially in SMP environment).

- pppox code allows to create per-namespace sockets for
  PX_PROTO_OE protocol only (since at this moment support
  for pppol2tp net-namespace is not implemented yet).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 15:54:54 -08:00
Cyrill Gorcunov 6aba915881 net: pppoe - code cleanup and helpers
- Introduce PPPOE_HASH_MASK.
- Remove redundant declaration of pppoe_chan_ops.
- Introduce stage_session helper.
- Tabs, space, long-line-split cleanup.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 15:54:15 -08:00
Thomas Klein e287880622 ehea: Improve driver behaviour in low mem conditions
Reworked receive queue fill policies to make the driver more tolerant
in low memory conditions.

Signed-off-by: Thomas Klein <tklein@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:45:57 -08:00
Thomas Klein 3faf2693bd ehea: Fix mem allocations which require page alignment
PAGE_SIZE allocations via slab are not guaranteed to be page-aligned. Fixed
all memory allocations where page alignment is required by firmware.

Signed-off-by: Thomas Klein <tklein@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:45:33 -08:00
Thomas Klein 086c1b2c52 ehea: Use net_device_ops structure
Adapt to lately introduced net_device_ops structure.

Signed-off-by: Thomas Klein <tklein@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:43:59 -08:00
Alexander Duyck 8017943e6b e1000: drop lltx, remove unnecessary lock
LLTX is deprecated, don't use it.  This completes the removal of LLTX from
the Intel Network drivers.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:42:47 -08:00
Alexander Duyck 921aa74912 igb: make certain to power on optics for 82576 fiber nics
It appears that a step was missed in the initialization of 82576 fiber nics
that resulted in it not powering on the optics.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:42:28 -08:00
Alexander Duyck 5851765cca igb: igb should not flag lltx
Igb has flags enabling lltx but this is a holdover from the earlier
e1000 driver which the igb driver was based off of.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:42:07 -08:00
Harvey Harrison 52d07b1f50 bnx2: annotate bp->phy_lock functions
It looks like the locking is OK as the locks were being taken before the
various phy setup functions, add the annotations as they release and
reacquire the phy_lock.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:39:26 -08:00
Herbert Xu 7be2df451f cxgb3: Replace LRO with GRO
This patch makes cxgb3 invoke the GRO hooks instead of LRO.  As
GRO has a compatible external interface to LRO this is a very
straightforward replacement.

I've kept the ioctl controls for per-queue LRO switches.  However,
we should not encourage anyone to use these.

Because of that, I've also kept the skb construction code in
cxgb3.  Hopefully we can phase out those per-queue switches
and then kill this too.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:39:13 -08:00
Roel Kluin 57a574993d phylib: unsigneds go unnoticed
both pdata->mdc and pdata->mdio are unsigned. Notice a negative
return value.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:53 -08:00
Mark McLoughlin 9f4d26d0f3 virtio_net: add link status handling
Allow the host to inform us that the link is down by adding
a VIRTIO_NET_F_STATUS which indicates that device status is
available in virtio_net config.

This is currently useful for simulating link down conditions
(e.g. using proposed qemu 'set_link' monitor command) but
would also be needed if we were to support device assignment
via virtio.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (added future masking)
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:53 -08:00
Vernon Sauder 357fe2c6d2 smc91x: enable ethtool EEPROM interface
Signed-off-by: Vernon Sauder <vsauder@inhand.com>
Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:52 -08:00
Masakazu Mokuno 31e2b7bd21 PS3: gelic: wireless: convert the wireless part to net_device_ops
Convert the gelic wireless driver to net_device_ops

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:52 -08:00
Masakazu Mokuno 5384e8361a PS3: gelic: convert the ethernet part to net_device_ops
Convert the gelic driver to net_device_ops

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:51 -08:00
Francois Romieu 3d16543d32 tg3: remove extra casting
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:31 -08:00
Herbert Xu 5c0999b72b igb: Replace LRO with GRO
This patch makes igb invoke the GRO hooks instead of LRO.  As
GRO has a compatible external interface to LRO this is a very
straightforward replacement.

Three things of note:

1) I've kept the LRO Kconfig option until we decide to enable
GRO across the board at which point it can also be killed.

2) The poll_controller stuff is broken in igb as it tries to do
the same work as the normal poll routine.  Since poll_controller
can be called in the middle of a poll, this can't be good.

I noticed this because poll_controller can invoke the GRO hooks
without flushing held GRO packets.

However, this should be harmless (assuming the poll_controller
bug above doesn't kill you first :) since the next ->poll will
clear the backlog.  The only time when we'll have a problem is
if we're already executing the GRO code on the same ring, but
that's no worse than what happens now.

3) I kept the ip_summed check before calling GRO so that we're
on par with previous behaviour.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:30 -08:00
Harvey Harrison 649aa95d75 typhoon: replace users of __constant_{endian}
The base versions handle constant folding just fine, use them
directly.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Acked-by: David Dillow <dave@thedillows.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:08 -08:00
Herbert Xu da3bc07171 sfc: Replace LRO with GRO
This patch makes sfc invoke the GRO hooks instead of LRO.  As
GRO has a compatible external interface to LRO this is a very
straightforward replacement.

Everything should appear identical to the user except that the
offload is now controlled by the GRO ethtool option instead of
LRO.  I've kept the lro module parameter as is since that's for
compatibility only.

I have eliminated efx_rx_mk_skb as the GRO layer can take care
of all packets regardless of whether GRO is enabled or not.

So the only case where we don't call GRO is if the packet checksum
is absent.  This is to keep the behaviour changes of the patch to
a minimum.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:06 -08:00
Herbert Xu 78b6f4ce58 ixgbe: Replace LRO with GRO
This patch makes ixgbe invoke the GRO hooks instead of LRO.  As
GRO has a compatible external interface to LRO this is a very
straightforward replacement.

As GRO uses the napi structure to track the held packets, I've
modified the code paths involved to pass that along.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:06 -08:00
Divy Le Ray 5cda9364f1 cxgb3: ease msi-x settings conditions
The driver currently drops to line interrupt mode
if it did not get all the msi-x vectors it requested.

Allow msi-x settings when a minimal amount of vectors
is provided.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:03 -08:00
Herbert Xu c405b82816 e1000e: Invoke VLAN GRO handler
Now that VLAN has GRO support as well, we can call its GRO handler
as well.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:03 -08:00
Ben Hutchings 288379f050 net: Remove redundant NAPI functions
Following the removal of the unused struct net_device * parameter from
the NAPI functions named *netif_rx_* in commit 908a7a1, they are
exactly equivalent to the corresponding *napi_* functions and are
therefore redundant.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:33:50 -08:00
Cesar Eduardo Barros 627af770c6 sc92031: add a link to the datasheet
Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:42 -08:00
Cesar Eduardo Barros 5ec99fdf8e sc92031: use device id directly instead of made-up name
Instead of making up a name for the device ids, put them directly in the
device id table. Also move the vendor id to pci_ids.h.

Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:41 -08:00
Cesar Eduardo Barros f08d7c36cc sc92031: inline SC92031_DESCRIPTION
SC92031_DESCRIPTION is only used in one place.

Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:39 -08:00
Cesar Eduardo Barros 3230d2b00e sc92031: remove meaningless version string
The version string makes no sense anymore, since this driver is only
maintained within the kernel.

Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:38 -08:00
Cesar Eduardo Barros eb5c8bc144 sc92031: more useful banner in kernel log
The banner currently printed when loading the module is mostly useless.

Replace it with a more informative one, printed after probing the device.

Output format copied from 8139cp/8139too.

Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:38 -08:00
Jan Engelhardt 4101dec9ca net: constify VFTs
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:37 -08:00
Krzysztof Hałasa 991990a12d WAN: Convert generic HDLC drivers to netdev_ops.
Also remove unneeded last_rx update from Synclink drivers.
Synclink part mostly by Stephen Hemminger.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:37 -08:00
Krzysztof Hałasa dff3fde7be WAN: Allow hw HDLC drivers to override dev->get_stats.
Use the internal get_stats() by default.
Fixes LMC and wanXL drivers.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:36 -08:00
Krzysztof Hałasa 7cdc15f5f9 WAN: Generic HDLC now uses IFF_WAN_HDLC private flag.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:35 -08:00
Inaky Perez-Gonzalez a962dc2520 wimax/i2400m: convert to net_device_ops
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:35 -08:00
Stephen Hemminger ba270ede10 dmascc: convert to internal net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:41 -08:00
Stephen Hemminger 6095e08126 dmascc: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:40 -08:00
Stephen Hemminger ddbe9a6868 mkiss: convert to internal network device stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:40 -08:00
Stephen Hemminger ff908cf834 scc: convert to internal net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:39 -08:00
Stephen Hemminger 3f75f7482f yam: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:39 -08:00
Stephen Hemminger 3c94acb7ee yam: convert to internal net_device_stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:38 -08:00
Stephen Hemminger 2d8b223d81 hdlcdrv: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:38 -08:00
Stephen Hemminger 5a7616af60 hdlcdrv: convert to internal net_device_stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:36 -08:00
Stephen Hemminger 52db625079 dmascc: convert to network_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:36 -08:00
Stephen Hemminger 13c0582d91 dmascc: convert to internal network device stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:35 -08:00
Stephen Hemminger 283767e705 bpqether: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:35 -08:00
Stephen Hemminger f57505fd7c bpqether: convert to internal net_device_stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:34 -08:00
Stephen Hemminger 9772a252b5 baycom: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:34 -08:00
Stephen Hemminger cd94f08658 baycom: convert to internal net_device_stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:33 -08:00
Stephen Hemminger b3672a7394 6pack: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:32 -08:00
Stephen Hemminger bc0443fc38 znet: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:31 -08:00
Stephen Hemminger 69d651692f 3c559: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:31 -08:00
Stephen Hemminger f1608f859a tms380tr: convert to net_device_ops
Conver this related group of drivers to new API

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:30 -08:00
Stephen Hemminger efda072393 olympic: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:30 -08:00
Stephen Hemminger dcc59a9789 olympic: convert to internal network device stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:29 -08:00
Stephen Hemminger be18827815 lanstreamer: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:29 -08:00
Stephen Hemminger 37423fff4f lanstreamer: convert to internal network stats
Use internal network_device_stats to keep track of statistics.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:27 -08:00
Stephen Hemminger c86d874029 ibmtr: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:26 -08:00
Stephen Hemminger 9fd3238e95 ibmtr: convert to internal network_device_stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:26 -08:00
Stephen Hemminger 48b47a5e30 3c59x: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:25 -08:00
Stephen Hemminger 4394e6533d 3c527: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:25 -08:00
Stephen Hemminger 90e64c6ad2 3c523: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:24 -08:00
Stephen Hemminger f3701c2f0e 3c515: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:24 -08:00
Stephen Hemminger 3186ae8f3f 3c509: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:23 -08:00
Stephen Hemminger 1722de5098 3c507: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:23 -08:00
Stephen Hemminger e6c42b7826 3c505: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:22 -08:00
Stephen Hemminger 878f64856d 3c501: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:21 -08:00
Stephen Hemminger a1799af4d7 com20020: convert to net_devic_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:20 -08:00
Stephen Hemminger bca5b8939f arcnet: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:19 -08:00
Stephen Hemminger 5803c5122a arcnet: convert to internal stats
Use pre-existing network_device_stats inside network_device rather than own
private structure.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:02:19 -08:00
Christian Eggers 6d31748294 usb/mcs7830: Don't use buffers from stack for USB transfers
mcs7830_set_reg() and mcs7830_get_reg() are called with buffers
from stack which must not be used directly for USB transfers.
This causes corruption of the stack particulary on non x86
architectures because DMA may be used for these transfers.

Signed-off-by: Christian Eggers <christian.eggers@kathrein.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 12:56:24 -08:00
Steve Glendinning 0b491eee46 usbnet: allow type check of devdbg arguments in non-debug build
Improve usbnet's devdbg to always type-check diagnostic arguments,
like dev_dbg (device.h).  This makes no change to the resulting size of
usbnet modules.

This patch also removes an #ifdef DEBUG directive from rndis_wlan so
it's devdbg statements are always type-checked at compile time.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 12:35:43 -08:00
roel kluin 0d1cfd20cc via-velocity: fix hot spin
while(--j >= 0) keeps spinning when j is unsigned:

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-20 14:44:01 -08:00
Brice Goglin e3fd553468 myri10ge: don't forget pci_disable_device()
Don't forget to call pci_disable_device() in myri10ge_remove()
and when myri10ge_probe() fails.

By the way, update the copyright years.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-20 14:41:18 -08:00
David S. Miller 518aa1b544 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2009-01-20 14:37:10 -08:00
Inaky Perez-Gonzalez f4895b8bc8 wimax/i2400m: error paths that need to free an skb should use kfree_skb()
Roel Kluin reported a bug in two error paths where skbs were wrongly
being freed using kfree(). He provided a fix where it was replaced to
kfree_skb(), as it should be.

However, in i2400mu_rx(), the error path was missing returning an
indication of the failure. Changed to reset rx_skb to NULL and return
it to the caller, i2400mu_rxd(). It will be treated as a transient
error and just ignore the packet.

Depending on the buffering conditions inside the device, the data
packet might be dropped or the device will signal the host again for
data-ready-to-read and the host will retry.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 17:58:08 -08:00
Gabriel Paubert fe65e70453 mv643xx_eth: prevent interrupt storm on ifconfig down
Contrary to what the docs say, the 'extended interrupt cause' bit in
the interrupt cause register (bit 1) appears to not be maskable on at
least some of the mv643xx_eth platforms, making writing zeroes to the
interrupt mask register but not the extended interrupt mask register
insufficient to stop interrupts from occuring.  Therefore, also write
zeroes to the extended interrupt mask register when shutting down the
port.

This fixes the interrupt storm seen on the Pegasos board when shutting
down the interface.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 17:58:07 -08:00
Lennert Buytenhek 2b448334a2 mv643xx_eth: fix multicast filter programming
Commit 66e63ffbc0 ("mv643xx_eth:
implement ->set_rx_mode()") cleaned up mv643xx_eth's multicast filter
programming, but broke it as well.

The non-special multicast filter table (for multicast addresses that
are not of the form 01:00:5e:00:00:xx) consists of 256 hash table
buckets organised as 64 32-bit words, where the 'accept' bits are
in the LSB of each byte, so in bits 24 16 8 0 of each 32-bit word.
The old code got this right, but the referenced commit broke this by
using bits 3 2 1 0 instead.  This commit fixes this up.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 17:58:07 -08:00
Lennert Buytenhek e0c6ef9388 Revert "mv643xx_eth: use longer DMA bursts".
This reverts commit cd4ccf76bf.

On the Pegasos board, we can't do DMA burst that are longer than
one cache line.  For now, go back to using 32 byte DMA bursts for
all mv643xx_eth platforms -- we can switch the ARM-based platforms
back to doing long 128 byte bursts in the next development cycle.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Reported-by: Alan Curry <pacman@kosh.dhis.org>
Reported-by: Gabriel Paubert <paubert@iram.es>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 17:58:06 -08:00
Matt Carlson 9e9fd12dc0 tg3: Fix firmware loading
This patch modifies how the tg3 driver handles device firmware.

The patch starts by consolidating David Woodhouse's earlier patch under
the same name.  Specifically, the patch moves the request_firmware call
into a separate tg3_request_firmware() function and calls that function
from tg3_open() rather than tg3_init_one().

The patch then goes on to limit the number of devices that will make
request_firmware calls.  The original firmware patch unnecessarily
requested TSO firmware for devices that did not need it.  This patch
reduces the set of devices making TSO firmware patches to approximately
the following device set : 5703, 5704, and 5705.

Finally, the patch reduces the effects of a request_firmware() failure.
For those devices that are requesting TSO firmware, the driver will turn
off the TSO capability.  If TSO firmware becomes available at a later
time, the device can be closed and then opened again to reacquire the
TSO capability.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:57:45 -08:00
Peter P Waskiewicz Jr 1da100bb47 ixgbe: Fix usage of netif_*_all_queues() with netif_carrier_{off|on}()
netif_carrier_off() is sufficient to stop Tx into the driver.  Stopping the Tx
queues is redundant and unnecessary.  By the same token, netif_carrier_on()
will be sufficient to re-enable Tx, so waking the queues is unnecessary.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:55:03 -08:00
Don Skidmore 068c89b014 ixgbe: fix tag stripping for VLAN ID 0
Register VLAN ID 0 so that frames with VLAN ID 0 are received and get
their tag stripped when ixgbe is not in DCB mode.  VLAN ID 0 means
that the frame is 'priority tagged' only - it is not a VLAN, but the
priority value is the tag in valid.  The functions
ixgbe_vlan_rx_register() and ixgbe_vlan_rx_kill_vid() were moved up a
couple functions to correct compiling issues with this change.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Eric W Multanen <eric.w.multanen@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:54:36 -08:00
Don Skidmore 15005a3204 ixgbe: fix dca issue with relaxed ordering turned on
The is an issue where setting Relaxed Ordering (RO) bit
(in a PCI-E write transaction) on 82598 causing the chipset
to drop DCA hints.  This patch forces RO not to be set for
descriptors as well as payload.  This will only be in effect
while DCA is enabled and no performance difference was
noticed in testing.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:54:13 -08:00
Phil Sutter e85bf47e6d korina: drop leftover assignment
As the assigned value is being overwritten shortly after, it can be
dropped and so the whole variable definition moved to the start of the
function.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:23:01 -08:00
Phil Sutter 63a66c6c0d korina: adjust headroom for new skb's also
This is copy and paste from the original driver. As skb_reserve() is
also called within korina_alloc_ring() when initially allocating the
receive descriptors, the same should be done when allocating new space
after passing an skb to upper layers.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:23:00 -08:00
Phil Sutter 6a2fe9834e korina: fix loop back of receive descriptors
After the last loop iteration, i has the value RC32434_NUM_RDS and
therefore leads to an index overflow when used afterwards to address the
last element. This is yet another another bug introduced when rewriting
parts of the driver for upstream preparation, as the original driver
used 'RC32434_NUM_RDS - 1' instead.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:23:00 -08:00
Divy Le Ray eed087e367 cxgb3: Fix LRO misalignment
The lro manager's frag_align_pad setting was missing,
leading to misaligned access to the skb passed up
to the stack.

Tested-by: Rick Jones <rick.jones2@hp.com>
Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:20:16 -08:00
Richard Röjfors 39eddb4c39 macb: avoid lockup when TGO during underrun
In rare cases when an underrun occur, all macb buffers where consumed
and the netif_queue was stopped infinitely. This happens then the TGO
(transfer ongoing) bit in the TSR is set (and UND). It seems like
clening up after the underrun makes the driver and the macb hardware
end up in an inconsistent state. The result of this is that in the
following calls to macb_tx no TX buffers are released -> the
netif_queue was stopped, and never woken up again.

The solution is to disable the transmitter, if TGO is set, before
clening up after the underrun, and re-enable the transmitter when the
cleaning up is done.

Signed-off-by: Richard Röjfors <richard.rojfors@endian.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:20:16 -08:00
Eilon Greenstein d05c26ce69 bnx2x: Version update
Updating the version and the year of updated files

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:20:15 -08:00
Eilon Greenstein 237907c1de bnx2x: Barriers for the compiler
To make sure no swapping are made by the compiler, changed HAS_WORK to inline
functions and added all the necessary barriers

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:20:14 -08:00
Eilon Greenstein e47d7e6eb8 bnx2x: Driver description update
The Driver supports the 57711 and 57711E as well but the description was out of
date

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:20:13 -08:00
Eilon Greenstein 16b311cc29 bnx2x: Handling PHY FW load failure
If the default PHY version (0x4321) is read - the PHY FW load failed

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:20:13 -08:00
Eilon Greenstein 44722d1d21 bnx2x: Legacy speeds autoneg failures
10M/100M autoneg was not establishing link.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:20:12 -08:00
Eilon Greenstein 3858276b71 bnx2x: Prevent self test loopback failures
Setting loopback requires time to take effect

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:20:12 -08:00
Eilon Greenstein 6c55c3cdc8 bnx2x: 1G-10G toggling race
The HW should be configured so fast toggling between 1G and 10G will not be
missed. Make sure that the HW is re-configured in full

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:20:11 -08:00
Eilon Greenstein 632da4d663 bnx2x: Overstepping array bounds
If the page size is > 8KB this violation happens

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:20:11 -08:00
Eilon Greenstein 2add3acb11 bnx2x: Block nvram access when the device is inactive
Don't dump eeprom when bnx2x adapter is down.  Running ethtool -e causes an eeh
without it when the device is down

Signed-off-by: Paul Larson <pl@linux.vnet.ibm.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:20:10 -08:00
Eilon Greenstein 5a40e08e66 bnx2x: Read chip ID
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:20:10 -08:00
Eilon Greenstein af2464011f bnx2x: Wrong HDR offset in CAM
Has a negative side effect when sending MAC update with no content (as done in
the self-test)

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:20:09 -08:00
Eilon Greenstein b4661739c6 bnx2x: Potential race after iSCSI boot
The lock was release too soon. Make sure the HW is marked as locked until the
boot driver was unloaded from FW perspective

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:20:09 -08:00
Eilon Greenstein 693fc0d143 bnx2x: Handling probe failures
Failures in the probe not handled correctly - separate the flow to handle

different failures

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:20:08 -08:00
Eilon Greenstein 70b9986ca4 bnx2x: Free IRQ
Error check could result with not freeing the IRQ

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-19 16:20:07 -08:00
Linus Torvalds f3b8436ad9 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  IB/ehca: Use consistent types for ehca_plpar_hcall9()
  IB/ehca: Fix printk format warnings from u64 type change
  IPoIB: Do not print error messages for multicast join retries
  IB/mlx4: Fix memory ordering problem when posting LSO sends
  mlx4_core: Fix min() warning
  IPoIB: Fix deadlock between ipoib_open() and child interface create
  IPoIB: Fix hang in napi_disable() if P_Key is never found
2009-01-17 14:28:53 -08:00
Christian Lamparter 674743033c p54: fix p54_set_key's return code
p54 doesn't support AES-128-CMAC offload.

This patch will fix the noisy mac80211 warnings, when 802.11w is enabled:
mac80211-phy189: failed to set key (4, ff:ff:ff:ff:ff:ff) to hardware (-22)
mac80211-phy189: failed to set key (5, ff:ff:ff:ff:ff:ff) to hardware (-22)

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-16 17:08:25 -05:00
Artur Skawina 275719089b p54: set_tim must be atomic.
Fix for:

BUG: scheduling while atomic: named/2004/0x10000200
Pid: 2004, comm: named Not tainted 2.6.29-rc1-00271-ge9fa6b0 #45
Call Trace:
 [<c04d4ef7>] schedule+0x2a7/0x320
 [<c03aed74>] __alloc_skb+0x34/0x110
 [<c011f5b3>] __cond_resched+0x13/0x30
 [<c04d501d>] _cond_resched+0x2d/0x40
 [<c016d8c5>] kmem_cache_alloc+0x95/0xc0
 [<c016b8d4>] check_object+0xc4/0x230
 [<c03aed74>] __alloc_skb+0x34/0x110
 [<c02ede91>] p54_alloc_skb+0x71/0xf0
 [<c02ee36f>] p54_set_tim+0x3f/0xa0
 [<c04ae064>] sta_info_set_tim_bit+0x64/0x80
 [<c04c1017>] invoke_tx_handlers+0xd57/0xd80
 [<c016c397>] free_debug_processing+0x197/0x210
 [<c03ae215>] pskb_expand_head+0xf5/0x170
 [<c04bfd94>] __ieee80211_tx_prepare+0x164/0x2f0
 [<c04c1a8d>] ieee80211_skb_resize+0x6d/0xe0
 [<c04c250f>] ieee80211_master_start_xmit+0x23f/0x550
 [<c016d188>] __slab_alloc+0x2b8/0x4f0
 [<c013a711>] getnstimeofday+0x51/0x120
 [<c03b5e7b>] dev_hard_start_xmit+0x1db/0x240
 [<c03c6a4b>] __qdisc_run+0x1ab/0x200
 [<c0136aa1>] __run_hrtimer+0x31/0xf0
 [<c03b6247>] dev_queue_xmit+0x247/0x500
 [<c04c1e56>] ieee80211_subif_start_xmit+0x356/0x7d0
 [<c0466ff7>] packet_rcv_spkt+0x37/0x150
 [<c0466ff7>] packet_rcv_spkt+0x37/0x150
 [<c03b5e7b>] dev_hard_start_xmit+0x1db/0x240
 [<c03c6a4b>] __qdisc_run+0x1ab/0x200
 [<c03b6247>] dev_queue_xmit+0x247/0x500
 [<c03bc1e2>] neigh_resolve_output+0xe2/0x200
 [<c0410080>] ip_finish_output+0x0/0x290
 [<c0410267>] ip_finish_output+0x1e7/0x290
 [<c040f355>] ip_local_out+0x15/0x20
 [<c040f5d2>] ip_push_pending_frames+0x272/0x380
 [<c042bbc6>] udp_push_pending_frames+0x146/0x3a0
 [<c042d52a>] udp_sendmsg+0x2fa/0x6b0
 [<c0433bc7>] inet_sendmsg+0x37/0x70
 [<c03a7b7e>] sock_sendmsg+0xbe/0x100
 [<c0133cd0>] autoremove_wake_function+0x0/0x50
 [<c011c043>] __wake_up_common+0x43/0x70
 [<c024a892>] copy_from_user+0x32/0x130
 [<c024a892>] copy_from_user+0x32/0x130
 [<c03b001e>] verify_iovec+0x2e/0xb0
 [<c03a7d3f>] sys_sendmsg+0x17f/0x290
 [<c017730a>] pipe_write+0x29a/0x570
 [<c013a172>] update_wall_time+0x492/0x8e0
 [<c013a711>] getnstimeofday+0x51/0x120
 [<c011b05d>] sched_slice+0x3d/0x80
 [<c013a711>] getnstimeofday+0x51/0x120
 [<c0136657>] hrtimer_forward+0x147/0x1a0
 [<c01101b0>] lapic_next_event+0x10/0x20
 [<c013ccb3>] clockevents_program_event+0xa3/0x170
 [<c03a9054>] sys_socketcall+0xa4/0x290
 [<c0110920>] smp_apic_timer_interrupt+0x40/0x70
 [<c0103165>] sysenter_do_call+0x12/0x25

Signed-off-by: Artur Skawina <art.08.09@gmail.com>
Acked-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-16 17:08:24 -05:00
Rami Rosen e223b6dc05 rt2x00: fix a wrong parameter for __test_and_clear_bit() in rt2x00rfkill_free().
When running modprobe rt73usb, and then rmmod rt73usb, and then
iwconfig, the wlan0 device does not disappear. When repeating this
process again, we get a kernel Oops errors and "BUG: unable to handle
kernel paging request..." message in the kernel log.

The reason for this is that there is an error in rt2x00rfkill_free(),
which is called in the process of removing the device
(rt2x00lib_remove_dev() in rt2x00dev.c).
rt2x00rfkill_free() clears the RFKILL_STATE_ALLOCATED bit , which is
bit number 1 () in rt2x00dev->flags instead of in
rt2x00dev->rfkill_state. As a result, when checking the
DEVICE_STATE_REGISTERED_HW bit (bit number 1 in rt2x00dev->flags) in
rt2x00lib_remove_hw() it is **unset**, and we wrongly **don't** call
ieee80211_unregister_hw().

This patch corrects this: the parameter for __test_and_clear_bit() in
rt2x00rfkill_free() should be &rt2x00dev->rfkill_state and not
&rt2x00dev->flags.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-16 17:08:24 -05:00
Zhu Yi 73e1a65d3c iwlwifi: remove CMD_WANT_SKB flag if send_cmd_sync failure
In function iwl_send_cmd_sync(), if the flag CMD_WANT_SKB is set but
we are not provided with a valid SKB (cmd->meta.u.skb == NULL), we need
to remove the CMD_WANT_SKB flag from the TX cmd queue. Otherwise in case
the cmd comes in later, it will possibly set an invalid address. Thus
it causes an invalid memory access.

This fixed the bug http://bugzilla.kernel.org/show_bug.cgi?id=11326.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-16 17:08:23 -05:00
Jouni Malinen 9d97f2e55e ath9k: Fix an operator typo in REG_DOMAIN_2GHZ_MASK
Incorrect operator causes the REG_DOMAIN_2GHZ_MASK to be zero which
surely was not the goal of this definition. Mask out the 11a flags
correctly.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-16 17:08:23 -05:00
Jouni Malinen b657eade2f ath9k: Fix an operator typo in phy rate validation
This was not supposed to be a bitwise AND operation, but a check of
two separate conditions. Anyway, the old code happened to result in
the same behavior, so this is just changing the code to be easier to
understand and also to keep sparse from warning about dubious
operators.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-16 17:08:23 -05:00
Andrey Yurovsky d71038c059 libertas: Fix alignment issues in libertas core
Data structures that come over the wire from the WLAN firmware must be packed.
This fixes alignment problems on the blackfin architecture and, reportedly, on
the AVR32.

This is a replacement for the previous version of this patch which had also
explicitly used get_unaligned_ macros.  As Johannes Berg pointed out, these
macros were unnecessary.

Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
Signed-off-by: Colin McCabe <colin@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-16 17:08:23 -05:00
Christian Lamparter ef15aa490f p54: fix oops caused by bad eeproms
This patch fixes a bug that could occur, if it the eeprom is incomplete or partly corrupted.

BUG: unable to handle kernel NULL pointer dereference at 00000008
IP: p54_assign_address+0x108/0x15d [p54common]
Oops: 0002 [#1] SMP
Pid: 12988, comm: phy1 Tainted: P        W  2.6.28-rc6-wl #3
RIP: 0010: p54_assign_address+0x108/0x15d [p54common]
 [...]
Call Trace:
 p54_alloc_skb+0xa3/0xc0 [p54common]
 p54_scan+0x37/0x204 [p54common]
 [...]

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-16 17:08:22 -05:00
Linus Torvalds abcea85978 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:
  netxen: include ipv6.h (fixes build failure)
  netxen: avoid invalid iounmap
2009-01-16 12:40:11 -08:00
Dhananjay Phadke 0097778461 netxen: include ipv6.h (fixes build failure)
Fixes a build error in absence of CONFIG_IPV6:

drivers/net/netxen/netxen_nic_main.c:1189: error: implicit declaration of function 'ipv6_hdr'
drivers/net/netxen/netxen_nic_main.c:1189: error: invalid type argument of '->'

Reported-by: Ingo Molnar <mingo@elte.hu>

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-16 11:05:28 -08:00
Dhananjay Phadke 3bfafd6b13 netxen: avoid invalid iounmap
For NX3031 only one I/O range is mapped, so unmapping other
two which are used by older chips, causes this warning on
ppc64.

"Attempt to iounmap early bolted mapping at 0x0000000000000000"

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-16 11:03:01 -08:00
Andrew Morton d3b924d960 mlx4_core: Fix min() warning
Fix

    drivers/net/mlx4/profile.c: In function `mlx4_make_profile':
    drivers/net/mlx4/profile.c:110: warning: comparison of distinct pointer types lacks a cast

This happened because num_possible_cpus() was secretly changed by
commit ae7a47e7 ("cpumask: make cpumask.h eat its own dogfood.") from
returning "int" to (now) returning "unsigned int".  I think that was a
good change, so we should just swallow the fallout.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Cc: Jack Morgenstein <jackm@dev.mellanox.co.il>
Cc: Vladimir Sokolovsky <vlad@mellanox.co.il>
Cc: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2009-01-15 20:43:56 -08:00
Linus Torvalds 3feeba1e53 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: (95 commits)
  b44: GFP_DMA skb should not escape from driver
  korina: do not use IRQF_SHARED with IRQF_DISABLED
  korina: do not stop queue here
  korina: fix handling tx_chain_tail
  korina: do tx at the right position
  korina: do schedule napi after testing for it
  korina: rework korina_rx() for use with napi
  korina: disable napi on close and restart
  korina: reset resource buffer size to 1536
  korina: fix usage of driver_data
  bnx2x: First slow path interrupt race
  bnx2x: MTU Filter
  bnx2x: Indirection table initialization index
  bnx2x: Missing brackets
  bnx2x: Fixing the doorbell size
  bnx2x: Endianness issues
  bnx2x: VLAN tagged packets without VLAN offload
  bnx2x: Protecting the link change indication
  bnx2x: Flow control updated before reporting the link
  bnx2x: Missing mask when calculating flow control
  ...
2009-01-15 16:53:15 -08:00
Eric Dumazet a58c891a53 b44: GFP_DMA skb should not escape from driver
b44 chip has some hardware limitations, that need GFP_DMA bounce
buffers in some situations.

In order to not deplete DMA zone, we should keep allocated GFP_DMA skb
only for driver use. At rx time, we copy such skb to newly allocated
skb, reusing existing copybreak infrastructure.

On machines with low amount of memory, all skb meet the hardware limitation,
so no copy is needed. We detect this situation using a new device flag, set
to one if one GFP_DMA skb was ever allocated by b44_alloc_rx_skb().

Previously allocated skb, even outside from DMA zone will then be recycled,
to have minimal impact on DMA zone use.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Tested-by: Ionut Leonte <ionut.leonte@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 15:29:35 -08:00
Denis Joseph Barrow 5839b414f9 hso serial throttled tty kref fix.
This patch is for Alan Cox as it related to the tty layer.
Hopefully the hso driver is again relatively stable with this fix.

Signed-off-by: Denis Joseph Barrow <D.Barow@option.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-15 12:48:36 -08:00
Denis Joseph Barrow d45eb81c3e tty: Fix double grabbing of a spinlock
The HSO changes for kref introduced a recursive spinlock take. All
functions which call put_rxbuf_data already have serial->serial_lock
grabbed.

[Comment to code added-AC]

Signed-off-by: Denis Joseph Barrow <D.Barrow@option.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-15 12:48:36 -08:00
Alan Cox fe41cbb164 tty: Fix a kref leak in the HSO driver on re-open
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-15 12:48:36 -08:00
Phil Sutter 1c5625cf0f korina: do not use IRQF_SHARED with IRQF_DISABLED
As the kernel warning states: "IRQF_DISABLED is not guaranteed on shared
IRQs". Since these IRQs' values are hardcoded and my test system doesn't
show any shared use of IRQs at all, rather make them non-shared than
non-disabled.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:21 -08:00
Phil Sutter 5edc7668bb korina: do not stop queue here
Apparently this doesn't make sense. Otherwise the queue gets disabled as
soon as it's getting empty and can only be resurrected by a driver
restart.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:21 -08:00
Phil Sutter 97bc477cbc korina: fix handling tx_chain_tail
Originally this must have been a rewrite error when introducing
'chain_index'. But the original driver did not use the previous chain
item everywhere: when altering the address tx_chain_tail points to, it
should move forward, not backwards.
Also this is not an "index" but rather the penultimate element in the
chain, so rename it accordingly.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:20 -08:00
Phil Sutter 60d3f9827c korina: do tx at the right position
Triggering TX before the write to the DMA status mask register leads to
transferring packets with maximum payload no matter what the actual
packet size is.
While here, also trigger RX scheduling after writing the DMA status mask
register, like it was in the original driver before it was sent
upstream.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:20 -08:00
Phil Sutter 4676f63d4c korina: do schedule napi after testing for it
The called netif_rx_schedule() does all the work for us:
- it checks the return value of netif_rx_schedule_prep() and
- if everything is ok calls __netif_rx_schedule().
Before this change, the driver received absolutely nothing.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:19 -08:00
Phil Sutter 4cf83b664f korina: rework korina_rx() for use with napi
This function needs an early exit condition to function properly, or
else caller assumes napi workload wasn't enough to handle all received
packets and korina_rx is called again (and again and again and ...).

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:19 -08:00
Phil Sutter beb0babfb7 korina: disable napi on close and restart
Without this the driver will crash when the NIC is being restarted.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:18 -08:00
Phil Sutter a13b27826a korina: reset resource buffer size to 1536
The new value is the one used in the external patch before and allows at
least a standard MTU of 1500 to be handled correctly. Impact of this
change gets visible when bigger packets are to be received, issuing:
| ping -s 492 <IP>
and bigger payload sized led to 100% packet loss.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Acked-by: Florian Fainelli <florian@openwrt.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:18 -08:00
Phil Sutter b96ecfa689 korina: fix usage of driver_data
Using platform_set_drvdata() here makes no sense, since the driver_data
field has already been filled with valuable data (i.e. the MAC address).
Also having driver_data point to the net_device is rather pointless
since struct korina_device contains an apropriate field for it.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:17 -08:00
Eilon Greenstein 0ef00459a6 bnx2x: First slow path interrupt race
The "read for interrupts" flag must be set before enabling slow-path
interrupts as well (and not just before fast-path interrupts)

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:17 -08:00
Eilon Greenstein e7799c5f79 bnx2x: MTU Filter
Too big packets could pass due to wrong filter size

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:16 -08:00
Eilon Greenstein 26c8fa4d8a bnx2x: Indirection table initialization index
Wrong initialization of the multi-queue indirection table - it should
be using the function and not the port index

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:15 -08:00
Eilon Greenstein f5ba6772f2 bnx2x: Missing brackets
Calculation bug due to missing brackets

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:15 -08:00
Eilon Greenstein a5f67a04d9 bnx2x: Fixing the doorbell size
The size of the doorbell is 4KB, this bug become visible when using
more than 8 queues

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:14 -08:00
Eilon Greenstein 68d5948436 bnx2x: Endianness issues
Adding missing le_to_cpu and disabling wrong HW endianity flag (the
two complete each other)

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:14 -08:00
Eilon Greenstein 0c6671b0d9 bnx2x: VLAN tagged packets without VLAN offload
Wrong handling of tagged packet if VLAN offload is disabled caused
packets to get corrupted

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:13 -08:00
Eilon Greenstein a5e9a7cfad bnx2x: Protecting the link change indication
Without this lock, in some race conditions the driver missed link
change indication

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:12 -08:00
Eilon Greenstein 3c96c68b0c bnx2x: Flow control updated before reporting the link
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:12 -08:00
Eilon Greenstein ad33ea3a8d bnx2x: Missing mask when calculating flow control
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:11 -08:00
Eilon Greenstein 4f40f2cba2 bnx2x: Using system page size for SGE
When the page size is not 4KB, the FW must be programmed to work with
the right SGE boundaries and fragment list length.

To avoid confusion with the BCM_PAGE_SIZE which is set to 4KB for the
FW sake, another alias for the system page size was added to
explicitly indicate that it is meant for the SGE

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:11 -08:00
Eilon Greenstein 58f4c4cfce bnx2x: Missing memory barriers
While working on IA64, it became clear that the following memory
barriers are missing

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:10 -08:00
Eilon Greenstein 1cf167f27a bnx2x: Using singlethread work queue
Since slow-path events, including link update, are handled in
work-queue, a race condition was introduced in the self-test that
sometimes caused the link status to fail: the self-test was running
under RTNL lock, and if the link-watch was scheduled it stoped the
shared work-queue (waiting for the RTNL lock) and so the link update
event was not handled until the self-test ended (releasing the RTNL
lock) with failure (since the link status was not updated)

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-15 08:28:10 -08:00
Magnus Damm d57bc36e7a ax88796: start_xmit fix using net_device_ops
This patch hooks up the start_xmit/tx_timeout/get_stats callbacks
in the ax88796 driver since they no longer are installed by the
lib8390 code. Without this patch the function dev_hard_start_xmit()
crashes due to a start_xmit callback with the value NULL.

While at it, update the ax88796 driver to make use of use of struct
net_device_ops.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 21:05:55 -08:00
Benjamin Herrenschmidt 937f1ba56b net: Add init_dummy_netdev() and fix EMAC driver using it
This adds an init_dummy_netdev() function that gets a network device
structure (allocation and lifetime entirely under caller's control) and
initialize the minimum amount of fields so it can be used to schedule
NAPI polls without registering a full blown interface. This is to be
used by drivers that need to tie several hardware interfaces to a single
NAPI poll scheduler due to HW limitations.

It also updates the ibm_newemac driver to use that, this fixing the
oops on 2.6.29 due to passing NULL as "dev" to netif_napi_add()

Symbol is exported GPL only a I don't think we want binary drivers doing
that sort of acrobatics (if we want them at all).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Tested-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 21:05:05 -08:00
Jos-Vicente Gilabert 2950e95292 drivers/net/irda/irda-usb.c: fix buffer overflow
Taken from http://bugzilla.kernel.org/show_bug.cgi?id=12397

We're doing an sprintf of an 11-char string into an 11-char buffer. 
Whoops.  It breaks firmware uploading.

Reported-by: Jos-Vicente Gilabert <josevteg@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 20:55:00 -08:00
Dhananjay Phadke 6f70340698 netxen: handle dma mapping failures
o Bail out if pci_map_single() fails while replenishing rx ring.
o Drop packet if pci_map_{single,page}() fail in tx.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 20:50:00 -08:00
Dhananjay Phadke 03e678ee96 netxen: hold tx lock while sending firmware commands
Some firmware commands like mac address addition/deletion are sent
on the transmit ring. So need to hold the tx lock before touching
tx producer/consumer indices.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 20:49:43 -08:00
Dhananjay Phadke 06e9d9f978 netxen: cleanup mac list on driver unload
This fixes a tiny memory leak when driver is unloaded. The mac
address list maintained in netxen_adapter needs to deleted when
driver is going down.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 20:49:22 -08:00
Dhananjay Phadke 27c915a4d8 netxen: firmware init fix
o Fix order or rom register writes.
o Reduce udelays when writing rom registers.

This cuts the firmware init time by 40%.

o Do not reset core/memory clocks when reinitializing driver.
  Firmware willl handle this when initialized.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 20:49:00 -08:00
Dhananjay Phadke c7860a2aec netxen: fix link speed reporting for some boards
o Read negotiated link speed when link state changes.
o Fix link speed reporting for hybrid nic boards, which have both 1Gbps and
  10Gbps ports.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 20:48:32 -08:00
Dhananjay Phadke 391587c344 netxen: fix ipv6 offload and tx cleanup
o fix the ip/tcp hdr offset in tx descriptors for ipv6.
o cleanup xmit function, move the tso checks into separate function,
  this reduces unnecessary endian conversions back and forth.
o optimize macros to initialize tx descriptors.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 20:48:11 -08:00
Dhananjay Phadke 2edbb45442 netxen: fix endianness in firmware commands
o Set restricted (little endian) data types in firmware command
  requests and responses.
o Remove unnecessary conversion to LE when writing registers.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 20:47:30 -08:00
Daniele Venzano d1d5e6b1ce sis900: generate fake MAC address if the hardware doesn't have one
The attached patch modifies the sis900 driver when the MAC address
read from the hardware is invalid. As suggested, the patch now
generates a random address so that the user can go on and use
the hardware. In any case a message is also shown to warn on the
unexpected condition.
This seems to happen with newer HW implementation of the sis900
chipset, since this never came up before.

Patch is against vanilla 2.6.28 (but the driver doesn't change so often,
so it will probably apply to older/newer versions too).

See bugzilla ID 10201 and 11649 and ignore the previous patch.

Signed-off-by: Daniele Venzano <venza@brownhat.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 20:46:24 -08:00
Mike Ditto d7e094d421 powerpc/fs_enet: Add missing irq free in error path.
If something goes wrong attaching to phy driver, we weren't freeing
the IRQ.

Signed-off-by: Mike Ditto <mditto@consentry.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 20:43:43 -08:00
Linus Torvalds 5393f78027 Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (29 commits)
  powerpc/83xx: Move mcu_mpc8349emitx driver out of drivers/i2c/chips/
  powerpc/83xx: Make serial ports work on MPC8315E-RDB w/ FSL U-Boots
  powerpc/e500mc: Doorbells need to be taken w/exceptions disabled
  powerpc: Enable PS3 options and QPACE in ppc64_defconfig
  powerpc/powermac: Fix occasional SMP boot failure
  powerpc/cacheinfo: Rename cache_dir per-cpu variable
  hvc_console: Use kzalloc() instead of kmalloc() + memset()
  hvc_console: Do not set low_latency when using interrupts
  hvc_console: Call free_irq() only if request_irq() was successful
  hvc_console: Change an mb() to smp_mb() and add some comments
  powerpc: Cleanup from l64 to ll64 change: drivers/net
  powerpc: Cleanup from l64 to ll64 change: drivers/char
  powerpc: Cleanup from l64 to ll64 change: arch code
  powerpc: Change u64/s64 to a long long integer type
  powerpc/kexec: Check crash_base for relocatable kernel
  powerpc: Make dummy section a valid note header
  Xilinx: SPI: updated driver for device tree
  drivers/of: Add the of_find_i2c_device_by_node function.
  powerpc/xsysace: add compatible string for non-ipcore instance
  powerpc/mpc52xx: remove dead code from GPIO driver
  ...
2009-01-14 20:00:28 -08:00
Anton Vorontsov f0d44ae310 phylib: Fix Freescale TBI PHY detection
Freescale on-chip TBI PHYs reports PHY ID as 0x0, but as of

commit 3ee82383f0
Author: Giulio Benetti <giulio.benetti@micronovasrl.com>
Date:   Thu Nov 13 21:53:13 2008 +0000

    phy: fix phy address bug

    PHYID returns 0xffff and not 0xffffffff when not found and in some
    case(at91sam9263) 0x0. Maybe this patch could be useful.

phy_device.c treats PHY ID == 0x0 as bogus IDs, and that results in
gianfar driver failure to see the TBI PHYs. This code snippet triggers:

	if (!priv->tbiphy) {
		printk(KERN_WARNING "SGMII mode requires that the device "
				"tree specify a tbi-handle\n");
		return;
	}

Although tbi-handle is specified in the device tree.

Btw, technically PHY ID == 0x0 is a valid ID (if we ever see a PHY
manufactured by Xerox :-).

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 14:38:02 -08:00
David S. Miller 483a2b3a31 ARM etherh: Fix build failure.
Reported by Russell King:

drivers/net/arm/etherh.c:649: error: unknown field 'ndo_set_mac_addr' specified in initializer

Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 14:35:15 -08:00
David S. Miller 9a0811ca4e Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2009-01-13 12:22:26 -08:00
Linus Torvalds ccbf04f24c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  IB/iser: Add dependency on INFINIBAND_ADDR_TRANS
  IPoIB: Do not join broadcast group if interface is brought down
  RDMA/nes: Fix for NIPQUAD removal
  IPoIB: Fix loss of connectivity after bonding failover on both sides
  IB/mlx4: Don't register IB device for adapters with no IB ports
  mlx4_core: Fix warning from min()
  IB/ehca: spin_lock_irqsave() takes an unsigned long
2009-01-13 08:19:42 -08:00
John W. Linville 26d1597c9a p54: fix "‘ret’ may be used uninitialized" warning
drivers/net/wireless/p54/p54common.c: In function ‘p54_config’:
drivers/net/wireless/p54/p54common.c:1853: warning: ‘ret’ may be used uninitialized in this function

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-13 10:25:46 -05:00
John W. Linville 25a4cceaa4 iwl3945: fix "‘power_idx’ may be used uninitialized" warning
drivers/net/wireless/iwlwifi/iwl-3945.c: In function ‘iwl3945_txpower_set_from_eeprom’:
drivers/net/wireless/iwlwifi/iwl-3945.c:2222: warning: ‘power_idx’ may be used uninitialized in this function

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-13 10:25:45 -05:00
John W. Linville 08cb7e0167 b43legacy: fix "‘up_dev’ may be used uninitialized" warning
drivers/net/wireless/b43legacy/main.c: In function ‘b43legacy_op_dev_config’:
drivers/net/wireless/b43legacy/main.c:2468: warning: ‘up_dev’ may be used uninitialized in this function

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-13 10:25:45 -05:00
John W. Linville 922d8a0b6d b43: fix "‘gmode’ may be used uninitialized" warning
drivers/net/wireless/b43/main.c: In function ‘b43_op_config’:
drivers/net/wireless/b43/main.c:3264: warning: ‘gmode’ may be used uninitialized

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-13 10:25:45 -05:00
Cyrill Gorcunov 859975764f net: ppp_generic - fix regressions caused by IDR conversion
The commits:

	7a95d267fb
	("net: ppp_generic - use idr technique instead of cardmaps")

	ab5024ab23
	("net: ppp_generic - use DEFINE_IDR for static initialization")

introduced usage of IDR functionality but broke userspace side.

Before this commits it was possible to allocate new ppp interface with
specified number. Now it fails with EINVAL.  Fix it by trying to
allocate interface with specified unit number and return EEXIST if
fail which allow pppd to ask us to allocate new unit number.

And fix messages on memory allocation fails - add details that it's
PPP module who is complaining.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-12 22:11:56 -08:00
Anton Vorontsov a6d0b91ae5 gianfar: Fix soft lockup with multi-interrupt TSECs
This patch fixes following bug:

BUG: soft lockup - CPU#0 stuck for 61s! [S03mountvirtfs-:922]
Modules linked in:
NIP: c006505c LR: c00675f0 CTR: c0020438
REGS: c7a1db90 TRAP: 0901   Not tainted  (2.6.28-rc8-01311-g8c7396a)
MSR: 00009032 <EE,ME,IR,DR>  CR: 28248442  XER: 20000000
TASK = c7a288a0[922] 'S03mountvirtfs-' THREAD: c7a1c000
GPR00: 00009032 c7a1dc40 c7a288a0 00000024 c79a1840 00000000 00000300 00000020
GPR08: c035f97c 00000000 00004008 c04d5210 00000000
NIP [c006505c] handle_IRQ_event+0x34/0xb0
LR [c00675f0] handle_level_irq+0xa8/0x144
Call Trace:
[c7a1dc40] [c00204d8] ipic_mask_irq+0xa0/0xb4 (unreliable)
[c7a1dc60] [c00675f0] handle_level_irq+0xa8/0x144
[c7a1dc80] [c00067f8] do_IRQ+0x78/0x108
[c7a1dc90] [c0014d7c] ret_from_except+0x0/0x14
--- Exception: 501 at gfar_schedule_cleanup+0x54/0x7c
    LR = gfar_transmit+0x14/0x28
[c7a1dd50] [c0352a3c] _spin_unlock_irqrestore+0x18/0x30 (unreliable)
[c7a1dd60] [c01f49a8] gfar_transmit+0x14/0x28
[c7a1dd70] [c0065084] handle_IRQ_event+0x5c/0xb0
[c7a1dd90] [c00675f0] handle_level_irq+0xa8/0x144
[c7a1ddb0] [c00067f8] do_IRQ+0x78/0x108
[c7a1ddc0] [c0014d7c] ret_from_except+0x0/0x14
--- Exception: 501 at up_read+0x10/0x48
    LR = do_page_fault+0x2b0/0x3e0
[c7a1de80] [c7a177e8] 0xc7a177e8 (unreliable)
[c7a1de90] [c0017964] do_page_fault+0x2b0/0x3e0
[c7a1df40] [c0014b14] handle_page_fault+0xc/0x80
--- Exception: 301 at 0xfe98b7c
    LR = 0xfe989c0
Instruction dump:
7c0802a6 bf810010 7c9f2378 7c7c1b78 90010024 80040004 70090020 40820010
7c0000a6 60008000 7c000124 3bc00000 <3ba00000> 48000010 83ff0014 2f9f0000


The bug introduced by commit 8c7396aebb
("gianfar: Merge Tx and Rx interrupt for scheduling clean up ring").

The commit merged TX and RX interrupt code into a single routine that
schedules NAPI, but no locks were introduced. This causes irq races, so
when irqs are enabled and netif_rx_schedule_prep() returns 0, nobody
disable the interrupts again. This leads to interrupt storm and finally
to the lockup.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-12 21:57:34 -08:00
Denis Joseph Barrow b74f62c1e7 hso: driver fix for big endian machines.
Filip Aben says this fix is neccessary for big endian machines.

Signed-off-by: Denis Joseph Barrow <D.Barow@option.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-12 21:56:49 -08:00
Krzysztof Hałasa d9736749f5 WAN: Fix NAPI interface in IXP4xx HSS driver.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-12 21:18:32 -08:00
Stephen Rothwell a1c5a8932b powerpc: Cleanup from l64 to ll64 change: drivers/net
These are powerpc specific drivers.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-13 14:48:00 +11:00
Ingo Molnar fe333321e2 powerpc: Change u64/s64 to a long long integer type
Convert arch/powerpc/ over to long long based u64:

 -#ifdef __powerpc64__
 -# include <asm-generic/int-l64.h>
 -#else
 -# include <asm-generic/int-ll64.h>
 -#endif
 +#include <asm-generic/int-ll64.h>

This will avoid reoccuring spurious warnings in core kernel code that
comes when people test on their own hardware. (i.e. x86 in ~98% of the
cases) This is what x86 uses and it generally helps keep 64-bit code
32-bit clean too.

[Adjusted to not impact user mode (from paulus) - sfr]

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-01-13 14:47:59 +11:00
Andrey Yurovsky 51e99158d2 libertas_tf: return NETDEV_TX_OK in TX op
The TX op should return NETDEV_TX_OK or NETDEV_TX_BUSY.

Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:57 -05:00
Ivo van Doorn f1dd2b23ba rt2x00: Fix rt2500usb HW crypto: WEP 128 & AES
The TXD_W0_CIPHER field is a 1-bit field. It only acts as boolean value
to indicate if the frame must be encrypted or not.

The way rt2x00_set_field32() worked it would grab the least signifcant bit
from txdesc->cipher and use that as value. Because of that WEP 64 and TKIP
worked since they had odd-numbered values, while WEP 128 and AES were
even numbers and didn't work.

Correctly booleanize the txdecs->cipher value to allow the hardware to
encrypt the outgoing data. After this we can enable HW crypto by default again.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:57 -05:00
Bob Copeland 71ef99c8b7 ath5k: fix return values from ath5k_tx
Should return NETDEV_TX_{OK,BUSY} instead of 0,-1 (this doesn't change
any current functionality).

Changes-licensed-under: 3-Clause-BSD

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:57 -05:00
Johannes Berg d6e2be988d rtl8187: Fix module so that rmmod/insmod does not error
Due to misunderstanding of the returned values allowed for the tx callback
of mac80211, rtl8187 was using skb's that had been freed. This problem was
triggered when the module was sujected to a rmmod/insmod cycle.

After that was fixed, the modules would not work after the rmmod/insmod cycle
until the USB device was reset.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:56 -05:00
Christian Lamparter 124b68e755 p54: fix WARN_ON at line 2247 of net/mac80211/rx.c
This patch hopefully fixes a mac80211<->p54 interaction problem, which was
described by Larry Finger (ref: http://marc.info/?l=linux-wireless&m=123009889327707 )

I guess the warning was triggered by pending frames in the receive queue,
while we're doing a band change 5GHz.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:56 -05:00