GitHub/LineageOS/android_kernel_samsung_universal7580.git
15 years agoieee802154: Use '%Zu' printf format for size_t.
David S. Miller [Thu, 11 Jun 2009 09:10:19 +0000 (02:10 -0700)]
ieee802154: Use '%Zu' printf format for size_t.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Thu, 11 Jun 2009 06:41:43 +0000 (23:41 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-next-2.6

15 years agocfg80211: fix rfkill locking problem
Johannes Berg [Wed, 10 Jun 2009 14:50:29 +0000 (16:50 +0200)]
cfg80211: fix rfkill locking problem

rfkill currently requires a global lock within the
rfkill_register() function, and holds that lock over
calls to the set_block() methods. This means that we
cannot hold a lock around rfkill_register() that we
also require in set_block(), directly or indirectly.
Fix cfg80211 to register rfkill outside the block
locked by its global lock. Much of what cfg80211 does
in the locked block doesn't need to be locked anyway.

Reported-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: disable PS while probing AP
Johannes Berg [Wed, 10 Jun 2009 13:16:52 +0000 (15:16 +0200)]
mac80211: disable PS while probing AP

When associated, but probing the AP because we detected
beacon loss, we need to disable powersave to be able to
receive the probe response. Change the code to do that by
checking whether we're trying to probe when determining
the possibility of going into PS, and recalculate the PS
ability at the necessary spots.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: disable moving between PS modes during scan
Luis R. Rodriguez [Wed, 10 Jun 2009 13:16:15 +0000 (15:16 +0200)]
mac80211: disable moving between PS modes during scan

We don't want to trigger moving between PS mode during scan,
because then we will sometimes end up sending nullfunc frames
during scan. We're supposed to only send one prior to scan
and after scan.

This fixes an oops which occured due to an assert in ath9k:

http://marc.info/?l=linux-wireless&m=124277331319024

The assert was happening because the rate control algorithm
figures it should find at least one valid dual stream or
single stream rate. Since we allow mac80211 to send nullfunc
frames during scan and dynamic PS was enabled at times we ended
up trying to send nullfunc frames for the target sta on the
wrong band for which we have no valid rate to communicate with
it. This breaks the assumptions in rate control.

We determine we also need to disable moving between PS modes
when not associated so lets just add that now as well, and we
should not have a ps_sdata when that interface cannot actually
go into PS because it's not associated.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: minor rfkill cleanup
Bob Copeland [Wed, 10 Jun 2009 03:43:11 +0000 (23:43 -0400)]
ath5k: minor rfkill cleanup

Always enable rfkill since the ifdefs in the code is not really worth
the Kconfig option.  Also fix a few code style things, and remove the
usage of the ah_gpio[] array so we can remove it later.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: clean up return value of __ieee80211_parse_tx_radiotap
Johannes Berg [Tue, 9 Jun 2009 17:48:25 +0000 (19:48 +0200)]
mac80211: clean up return value of __ieee80211_parse_tx_radiotap

The return type has more than two values, but it can validly
only ever return TX_DROP and TX_CONTINUE, so use a bool
instead of ieee80211_tx_result.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: don't use master netdev name
Johannes Berg [Tue, 9 Jun 2009 14:18:32 +0000 (16:18 +0200)]
mac80211: don't use master netdev name

Always use the wiphy name instead.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Fix tx stuck when connected to aggr disabled HT AP
Vasanthakumar Thiagarajan [Tue, 9 Jun 2009 09:58:21 +0000 (15:28 +0530)]
ath9k: Fix tx stuck when connected to aggr disabled HT AP

This patch along with my previous patch in mac80211 "Fix the
way ADDBA count..", fixes hang in tx when connected to an HT
AP which rejects/times out on addba req.

AGGR_ADDBA_PROGRESS should be cleared in aggr state when addba
negotiation is terminated due to either addba response is timed out
or addba is denied by the AP. With out clearing this bit,
all frames are queued onto s/w queue for getting tx'd as aggr and
will never be scheduled onto hw queue.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: Fix the way ADDBA request count being modified
Vasanthakumar Thiagarajan [Tue, 9 Jun 2009 08:41:46 +0000 (14:11 +0530)]
mac80211: Fix the way ADDBA request count being modified

addba_req_num[tid] is supposed to have the count of consecutive
addba request attempts on 'tid' which failed. This count is checked
against a retry threshold (3 times) before starting the addba negotiation.
This patch fixes the way this addba count is incremented/reset and thereby
avoids indefinite addba attempts.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: fix for duplicate response for driver reg request
Luis R. Rodriguez [Tue, 9 Jun 2009 01:54:37 +0000 (18:54 -0700)]
cfg80211: fix for duplicate response for driver reg request

As Pavel puts userspace can be stupid and should not
cause kernel crashes. In this case Pavel was able to
find a crash here but unable to reproduce. Either way
lets deal with this.

This should fix:

------------[ cut here ]------------
kernel BUG at /home/proski/src/linux-2.6/net/wireless/reg.c:2132!
Oops: Exception in kernel mode, sig: 5 [#1]
PowerMac
Modules linked in: ath5k ath [last unloaded: scsi_wait_scan]
NIP: c02f3eac LR: c02f3d08 CTR: 00000000
REGS: ef107aa0 TRAP: 0700   Not tainted  (2.6.30-rc8-wl)
MSR: 00029032 <EE,ME,CE,IR,DR>  CR: 88002442  XER: 20000000
TASK = ef84acb0[834] 'crda' THREAD: ef106000
GPR00: ef953840 ef107b50 ef84acb0 ef1380bc 00000006 c035a5c8 ef107b90 c035a5c8
GPR08: 00080005 efb68980 c0445628 ef130004 28002422 10019ce0 10012d3c 00000001
GPR16: 1070b2ac 00000005 48023558 1070b380 4802304c 00000000 ef107ddc c035a5c8
GPR24: ef107b78 c0443350 ef8bcb00 00000005 ef138080 c04a6a70 c04a0000 ef8bcb00
NIP [c02f3eac] set_regdom+0x4c4/0x4ec
LR [c02f3d08] set_regdom+0x320/0x4ec
Call Trace:
[ef107b50] [c02f3d08] set_regdom+0x320/0x4ec (unreliable)
[ef107b70] [c02f9d10] nl80211_set_reg+0x140/0x2d0
[ef107bc0] [c02aa2b8] genl_rcv_msg+0x204/0x228
[ef107c10] [c02a97cc] netlink_rcv_skb+0xe8/0x10c
[ef107c30] [c02aa094] genl_rcv+0x3c/0x5c
[ef107c40] [c02a9050] netlink_unicast+0x308/0x36c
[ef107c80] [c02a92bc] netlink_sendmsg+0x208/0x2f0
[ef107cd0] [c0282048] sock_sendmsg+0xac/0xe4
[ef107db0] [c02822b4] sys_sendmsg+0x234/0x2d8
[ef107f00] [c0283a88] sys_socketcall+0x108/0x258
[ef107f40] [c0012790] ret_from_syscall+0x0/0x38

Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agob43: Add fw capabilities
Michael Buesch [Mon, 8 Jun 2009 19:04:57 +0000 (21:04 +0200)]
b43: Add fw capabilities

Add automagic feature flags, so the firmware can tell the driver
about supported features and the driver can switch features on/off as
needed.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agorfkill: don't impose global states on resume (just restore the previous states)
Alan Jenkins [Mon, 8 Jun 2009 12:12:23 +0000 (13:12 +0100)]
rfkill: don't impose global states on resume (just restore the previous states)

Once rfkill-input is disabled, the "global" states will only be used as
default initial states.

Since the states will always be the same after resume, we shouldn't
generate events on resume.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agosony-laptop: no need to unblock rfkill on load
Alan Jenkins [Mon, 8 Jun 2009 10:31:11 +0000 (11:31 +0100)]
sony-laptop: no need to unblock rfkill on load

The re-written rfkill core ensures rfkill devices are initialized to
the system default state.  The core calls set_block after registration
so the driver shouldn't need to.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agorfkill: remove set_global_sw_state
Alan Jenkins [Mon, 8 Jun 2009 12:27:27 +0000 (13:27 +0100)]
rfkill: remove set_global_sw_state

rfkill_set_global_sw_state() (previously rfkill_set_default()) will no
longer be exported by the rewritten rfkill core.

Instead, platform drivers which can provide persistent soft-rfkill state
across power-down/reboot should indicate their initial state by calling
rfkill_set_sw_state() before registration.  Otherwise, they will be
initialized to a default value during registration by a set_block call.

We remove existing calls to rfkill_set_sw_state() which happen before
registration, since these had no effect in the old model.  If these
drivers do have persistent state, the calls can be put back (subject
to testing :-).  This affects hp-wmi and acer-wmi.

Drivers with persistent state will affect the global state only if
rfkill-input is enabled.  This is required, otherwise booting with
wireless soft-blocked and pressing the wireless-toggle key once would
have no apparent effect.  This special case will be removed in future
along with rfkill-input, in favour of a more flexible userspace daemon
(see Documentation/feature-removal-schedule.txt).

Now rfkill_global_states[n].def is only used to preserve global states
over EPO, it is renamed to ".sav".

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: do not pass PS frames out of mac80211 again
Johannes Berg [Sun, 7 Jun 2009 19:58:37 +0000 (21:58 +0200)]
mac80211: do not pass PS frames out of mac80211 again

In order to handle powersave frames properly we had needed
to pass these out to the device queues again, and introduce
the skb->requeue bit. This, however, also has unnecessary
overhead by needing to 'clean up' already tried frames, and
this clean-up code is also buggy when software encryption
is used.

Instead of sending the frames via the master netdev queue
again, simply put them into the pending queue. This also
fixes a problem where frames for that particular station
could be reordered when some were still on the software
queues and older ones are re-injected into the software
queue after them.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agosony: fix rfkill code
Johannes Berg [Sun, 7 Jun 2009 19:57:08 +0000 (21:57 +0200)]
sony: fix rfkill code

During the rfkill conversion I added code to call
sony_nc_rfkill_set with the wrong argument, causing
a segfault Reinette reported. The compiler could not
catch that because the argument is, and needs to be,
void *.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reported-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agorfkill: remove input Kconfig
Johannes Berg [Mon, 8 Jun 2009 06:14:28 +0000 (08:14 +0200)]
rfkill: remove input Kconfig

Now that we added the ioctl, there's no need to ask
the user to configure this. We will keep it enabled
for now, and eventually swap the default to n. Also
let embedded users select it only if they need it.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agob43/legacy: port to cfg80211 rfkill
Johannes Berg [Sun, 7 Jun 2009 17:30:34 +0000 (12:30 -0500)]
b43/legacy: port to cfg80211 rfkill

This ports the b43/legacy rfkill code to the new API offered
by cfg80211 and thus removes a lot of useless stuff.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: added cfg80211 based rfkill support
Tobias Doerffel [Tue, 9 Jun 2009 15:33:27 +0000 (17:33 +0200)]
ath5k: added cfg80211 based rfkill support

This patch introduces initial rfkill support for the ath5k driver
based on rfkill support in the cfg80211 framework.
All rfkill related code is separated into newly created rfkill.c.

Changes to existing code are minimal:

* added a new data structure ath5k_rfkill to the ath5k_softc structure
* inserted calls to HW rfkill init/deinit routines
* ath5k_intr() has been extended to handle AR5K_INT_GPIO interrupts

Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agorfkill: print events when input handler is disabled/enabled
Johannes Berg [Sun, 7 Jun 2009 10:26:52 +0000 (12:26 +0200)]
rfkill: print events when input handler is disabled/enabled

It is useful for debugging when we know if something disabled
the in-kernel rfkill input handler.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoar9170: xmit code revamp
Christian Lamparter [Sat, 6 Jun 2009 03:07:23 +0000 (05:07 +0200)]
ar9170: xmit code revamp

This patch is a back-port from aggregation testing code.

In the past, we didn't limit the amount of active tx urbs.
However, ar9170 only has a limited buffer reserved for
pending data frames.

This wasn't much of a problem with the slower 802.11b/g.
We simply stopped the full queue and moved on to something different
in the mean time. But - as you guessed it -  this simple approach
stands in way for a decent aggregation implementation.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoar9170: interpret firmware debug commands
Johannes Berg [Fri, 5 Jun 2009 09:47:43 +0000 (11:47 +0200)]
ar9170: interpret firmware debug commands

This adds new commands that the original firmware will not send
but we can use them to debug firmware.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211 : fix unaligned rx skb
matthieu castet [Thu, 4 Jun 2009 20:16:18 +0000 (22:16 +0200)]
mac80211 : fix unaligned rx skb

mac80211 is checking is the skb is aligned on 32 bit boundary.
But it is checking against ethernet header, whereas Linux expect IP
header aligned.  And ethernet ether size is 6*2+2=14, so aligning
ethernet header make IP header unaligned.

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agob43: Fix possible unaligned u32 access
Matthieu CASTET [Thu, 4 Jun 2009 21:18:33 +0000 (23:18 +0200)]
b43: Fix possible unaligned u32 access

Fix possible unaligned u32 access in b43_generate_plcp_hdr().
Unaligned data is read/write with a u32 pointer instead of using the
packed structure. Some versions of gcc ignore the "packed" attribute, if the
structure element is accessed through a local pointer.

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: fix minstrel single-rate memory corruption
Bob Copeland [Fri, 5 Jun 2009 12:21:50 +0000 (08:21 -0400)]
mac80211: fix minstrel single-rate memory corruption

The minstrel rate controller periodically looks up rate indexes in
a sampling table.  When accessing a specific row and column, minstrel
correctly does a bounds check which, on the surface, appears to handle
the case where mi->n_rates < 2.  However, mi->sample_idx is actually
defined as an unsigned, so the right hand side is taken to be a huge
positive number when negative, and the check will always fail.

Consequently, the RC will overrun the array and cause random memory
corruption when communicating with a peer that has only a single rate.
The max value of mi->sample_idx is around 25 so casting to int should
have no ill effects.

Without the change, uptime is a few minutes under load with an AP
that has a single hard-coded rate, and both the AP and STA could
potentially crash.  With the change, both lasted 12 hours with a
steady load.

Thanks to Ognjen Maric for providing the single-rate clue so I could
reproduce this.

This fixes http://bugzilla.kernel.org/show_bug.cgi?id=12490 on the
regression list (also http://bugzilla.kernel.org/show_bug.cgi?id=13000).

Cc: stable@kernel.org
Reported-by: Sergey S. Kostyliov <rathamahata@gmail.com>
Reported-by: Ognjen Maric <ognjen.maric@gmail.com>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agonet/libertas: remove GPIO-CS handling in SPI interface code
Sebastian Andrzej Siewior [Thu, 4 Jun 2009 19:57:03 +0000 (21:57 +0200)]
net/libertas: remove GPIO-CS handling in SPI interface code

This removes the dependency on GPIO framework and lets the SPI host
driver handle the chip select. The SPI host driver is required to keep
the CS active for the entire message unless cs_change says otherwise.
This patch collects the two/three single SPI transfers into a message.
Also the delay in read path in case use_dummy_writes are not used is
moved into the SPI host driver.

Tested-by: Mike Rapoport <mike@compulab.co.il>
Tested-by: Andrey Yurovsky <andrey@cozybit.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agorndis_wlan: cleanup: rename all rndis_wext* objects to rndis_wlan*
Jussi Kivilinna [Thu, 4 Jun 2009 17:13:25 +0000 (20:13 +0300)]
rndis_wlan: cleanup: rename all rndis_wext* objects to rndis_wlan*

Driver used to be named rndis_wext before inclusion to upstream. Since
rndis_wlan is being converted to cfg80211, use of rndis_wext* names
can be confusing. So rename all rndis_wext to rndis_wlan (as should
have been when driver was renamed).

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agorndis_wlan: cleanup: capitalize enum labels
Jussi Kivilinna [Thu, 4 Jun 2009 17:13:19 +0000 (20:13 +0300)]
rndis_wlan: cleanup: capitalize enum labels

Capitalize enum labels as told in Documents/CodingStyle.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: port to cfg80211 rfkill
Johannes Berg [Thu, 4 Jun 2009 16:26:06 +0000 (18:26 +0200)]
iwlwifi: port to cfg80211 rfkill

This ports the iwlwifi rfkill code to the new API offered by
cfg80211 and thus removes a lot of useless stuff. The soft-
rfkill is completely removed since that is now handled by
setting the interfaces down.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Tested-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocan: sja1000_of_platform: fix build problems with printk format
Wolfgang Grandegger [Wed, 10 Jun 2009 08:12:39 +0000 (01:12 -0700)]
can: sja1000_of_platform: fix build problems with printk format

According to "Documentation/printk-formats.txt", if the type is
dependent on a config option for its size, like resource_size_t,
we should use a format specifier of its largest possible type and
explicitly cast to it.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosunrpc/auth_gss: Call rcu_barrier() on module unload.
Jesper Dangaard Brouer [Mon, 8 Jun 2009 03:11:48 +0000 (03:11 +0000)]
sunrpc/auth_gss: Call rcu_barrier() on module unload.

As the module uses rcu_call() we should make sure that all
rcu callback has been completed before removing the code.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosctp: protocol.c call rcu_barrier() on unload.
Jesper Dangaard Brouer [Mon, 8 Jun 2009 03:11:43 +0000 (03:11 +0000)]
sctp: protocol.c call rcu_barrier() on unload.

On module unload call rcu_barrier(), this is needed as synchronize_rcu()
is not strong enough.  The kmem_cache_destroy() does invoke
synchronize_rcu() but it does not provide same protection.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Acked-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocan: af_can.c use rcu_barrier() on module unload.
Jesper Dangaard Brouer [Mon, 8 Jun 2009 03:11:38 +0000 (03:11 +0000)]
can: af_can.c use rcu_barrier() on module unload.

This module uses rcu_call() thus it should use rcu_barrier()
on module unload.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Acked-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonfnetlink_queue: Use rcu_barrier() on module unload.
Jesper Dangaard Brouer [Mon, 8 Jun 2009 03:11:33 +0000 (03:11 +0000)]
nfnetlink_queue: Use rcu_barrier() on module unload.

This module uses rcu_call() thus it should use rcu_barrier() on module unload.

Also fixed a trivial typo 'nfetlink' -> 'nfnetlink' in comment.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years ago8021q: Vlan driver should use rcu_barrier() on unload instead of syncronize_net()
Jesper Dangaard Brouer [Mon, 8 Jun 2009 03:11:28 +0000 (03:11 +0000)]
8021q: Vlan driver should use rcu_barrier() on unload instead of syncronize_net()

The VLAN 8021q driver needs to call rcu_barrier() when unloading the module,
instead of syncronize_net().  This is needed to make sure that outstanding
call_rcu() callbacks have completed, before the callback function code is
removed on module unload.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqlge: bugfix: Get rid of errant spin_unlock().
Ron Mercer [Tue, 9 Jun 2009 06:35:12 +0000 (06:35 +0000)]
qlge: bugfix: Get rid of errant spin_unlock().

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqlge: Add set TX csum ethtool op.
Ron Mercer [Tue, 9 Jun 2009 05:39:31 +0000 (05:39 +0000)]
qlge: Add set TX csum ethtool op.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqlge: Add support for varied pcie function numbers.
Ron Mercer [Tue, 9 Jun 2009 05:39:32 +0000 (05:39 +0000)]
qlge: Add support for varied pcie function numbers.

Currently we support only PCIe NIC functions zero and one, and FCoE
functions as 3 and 4. Future configurations can mix these up in any
fashion.
This patch removes the 0-1 dependancy and allows usage of any of the 4
functions. We also find the alternate NIC function (if exist) and
determine our port number based on the comparison of the two functions:
Lower function number gets first port, higher function gets second port.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqlge: Add support for using alternate MAC address.
Ron Mercer [Tue, 9 Jun 2009 05:39:33 +0000 (05:39 +0000)]
qlge: Add support for using alternate MAC address.

Extract either manufacturer or Bladecenter Open Fabric
Manager (BOFM) MAC address.  BOFM may indicate an
alternate MAC address.  This patch honors that request
by extracting the MAC address from a different
flash location if a flag is set.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqlge: Drop inbound frames > MTU.
Ron Mercer [Tue, 9 Jun 2009 05:39:28 +0000 (05:39 +0000)]
qlge: Drop inbound frames > MTU.

The max frame size register is set higher than the MTU to
accomodate FCoE frames.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqlge: Drop inbound error frames.
Ron Mercer [Tue, 9 Jun 2009 05:39:27 +0000 (05:39 +0000)]
qlge: Drop inbound error frames.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqlge: Remove netif_set_gso_max_size() call.
Ron Mercer [Tue, 9 Jun 2009 05:39:30 +0000 (05:39 +0000)]
qlge: Remove netif_set_gso_max_size() call.

Not necessary if hardware supports 65536 as it's the default setting.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqlge: Add support for retrieving firmware version.
Ron Mercer [Tue, 9 Jun 2009 05:39:29 +0000 (05:39 +0000)]
qlge: Add support for retrieving firmware version.

This is used by driver banner and ethtool info.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetfilter: Fix extra semi-colon in skb_walk_frags() changes.
David S. Miller [Wed, 10 Jun 2009 01:05:28 +0000 (18:05 -0700)]
netfilter: Fix extra semi-colon in skb_walk_frags() changes.

Noticed by Jesper Dangaard Brouer

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agorfkill: include err.h
Johannes Berg [Wed, 10 Jun 2009 00:49:06 +0000 (17:49 -0700)]
rfkill: include err.h

Since we use ERR_PTR and similar macros, we need to include
linux/err.h.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2: no need to check before vfreeing
Breno Leitao [Mon, 8 Jun 2009 10:30:19 +0000 (10:30 +0000)]
bnx2: no need to check before vfreeing

There is no need to check if a pointer is NULL before calling
vfree(), since vfree() function already check for it.

Signed-off-by: Breno Leitão <leitao@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Include offloaded FCoE data into total rx/tx statistics for 82599
Yi Zou [Mon, 8 Jun 2009 14:38:44 +0000 (14:38 +0000)]
ixgbe: Include offloaded FCoE data into total rx/tx statistics for 82599

Include offloaded FCoE data into total rx/tx statistics for 82599 so they
are properly reflected by ethtool or ifconfig.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoe1000e: Expose MDI-X status via ethtool change
Chaitanya Lala [Mon, 8 Jun 2009 14:28:54 +0000 (14:28 +0000)]
e1000e: Expose MDI-X status via ethtool change

Ethtool is a standard way of getting information about
ethernet interfaces.  We enhance ethtool kernel interface
& e1000e to make the MDI-X status readable via ethtool in
userspace.

Signed-off-by: Chaitanya Lala <clala@riverbed.com>
Signed-off-by: Arthur Jones <ajones@riverbed.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoe1000e: Call e1000e_config_collision_dist() after TCTL has been set
Simon Horman [Mon, 8 Jun 2009 14:28:36 +0000 (14:28 +0000)]
e1000e: Call e1000e_config_collision_dist() after TCTL has been set

e1000e_config_collision_dist() sets tctl, but subsequently tctl is
overwritten.  It seems to me that as things stand the call to
e1000e_config_collision_dist() has no effect and should either be
removed or moved down a little bit.  This kernel patch takes the latter
option.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoe1000e: Fixes possible phy corrupton on 82571 designs.
Dave Graham [Mon, 8 Jun 2009 14:28:17 +0000 (14:28 +0000)]
e1000e: Fixes possible phy corrupton on 82571 designs.

Phy corruption has been observed on 2-port 82571 adapters, and is root-caused
to lack of synchronization between the 2 driver instances, which conflict
when attempting to access the phy via the single MDIC register.
A semaphore exists for this purpose, and is now used on these designs. Because
PXE &/or EFI boot code (which we cannot expect to be built with this fix) may
leave the inter-instance semaphore in an invalid initial state when the driver
first loads, this fix also includes a one-time (per driver load) fix-up of the
semaphore initial state.

Signed-off-by: dave graham <david.graham@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoieee802154: add simple HardMAC driver sample
Sergey Lapin [Mon, 8 Jun 2009 12:18:51 +0000 (12:18 +0000)]
ieee802154: add simple HardMAC driver sample

fakehard is a really simple driver implementing only necessary
callbacks and serves the role of an example of driver for HardMAC
IEEE 802.15.4 device.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Sergey Lapin <slapin@ossfans.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoieee802154: add documentation about our stack
Sergey Lapin [Mon, 8 Jun 2009 12:18:50 +0000 (12:18 +0000)]
ieee802154: add documentation about our stack

Add MAINTAINERS entry and a small text describing our stack interfaces,
how to hook the drivers, etc.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Sergey Lapin <slapin@ossfans.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: add NL802154 interface for configuration of 802.15.4 devices
Sergey Lapin [Mon, 8 Jun 2009 12:18:49 +0000 (12:18 +0000)]
net: add NL802154 interface for configuration of 802.15.4 devices

Add a netlink interface for configuration of IEEE 802.15.4 device. Also this
interface specifies events notification sent by devices towards higher layers.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Sergey Lapin <slapin@ossfans.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: add IEEE 802.15.4 socket family implementation
Sergey Lapin [Mon, 8 Jun 2009 12:18:48 +0000 (12:18 +0000)]
net: add IEEE 802.15.4 socket family implementation

Add support for communication over IEEE 802.15.4 networks. This implementation
is neither certified nor complete, but aims to that goal. This commit contains
only the socket interface for communication over IEEE 802.15.4 networks.
One can either send RAW datagrams or use SOCK_DGRAM to encapsulate data
inside normal IEEE 802.15.4 packets.

Configuration interface, drivers and software MAC 802.15.4 implementation will
follow.

Initial implementation was done by Maxim Gorbachyov, Maxim Osipov and Pavel
Smolensky as a research project at Siemens AG. Later the stack was heavily
reworked to better suit the linux networking model, and is now maitained
as an open project partially sponsored by Siemens.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Sergey Lapin <slapin@ossfans.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoAdd constants for the ieee 802.15.4 stack
Sergey Lapin [Mon, 8 Jun 2009 12:18:47 +0000 (12:18 +0000)]
Add constants for the ieee 802.15.4 stack

IEEE 802.15.4 stack requires several constants to be defined/adjusted.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Sergey Lapin <slapin@ossfans.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agopkt_sched: Change PSCHED_SHIFT from 10 to 6
Jarek Poplawski [Mon, 8 Jun 2009 22:05:13 +0000 (22:05 +0000)]
pkt_sched: Change PSCHED_SHIFT from 10 to 6

Change PSCHED_SHIFT from 10 to 6 to increase schedulers time
resolution. This will increase 16x a number of (internal) ticks per
nanosecond, and is needed to improve accuracy of schedulers based on
rate tables, like HTB, TBF or CBQ, with rates above 100Mbit. It is
assumed this change is safe for 32bit accounting of time diffs up
to 2 minutes, which should be enough for common use (extremely low
rate values may overflow, so get inaccurate instead). To make full
use of this change an updated iproute2 will be needed. (But using
older iproute2 should be safe too.)

This change breaks ticks - microseconds similarity, so some minor code
fixes might be needed. It is also planned to change naming adequately
eg. to PSCHED_TICKS2NS() etc. in the near future.

Reported-by: Antonio Almeida <vexwek@gmail.com>
Tested-by: Antonio Almeida <vexwek@gmail.com>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agopkt_sched: Use PSCHED_SHIFT in PSCHED time conversion
Jarek Poplawski [Mon, 8 Jun 2009 22:05:00 +0000 (22:05 +0000)]
pkt_sched: Use PSCHED_SHIFT in PSCHED time conversion

Use PSCHED_SHIFT constant instead of '10' in PSCHED_US2NS() and
PSCHED_NS2US() macros to enable changing this value later.

Additionally use PSCHED_SHIFT in sch_hfsc SM_SHIFT and ISM_SHIFT
definitions. This part of the patch is based on feedback from
Patrick McHardy <kaber@trash.net>.

Reported-by: Antonio Almeida <vexwek@gmail.com>
Tested-by: Antonio Almeida <vexwek@gmail.com>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: dev_addr_init() fix
Eric Dumazet [Mon, 8 Jun 2009 03:49:24 +0000 (03:49 +0000)]
net: dev_addr_init() fix

commit f001fde5eadd915f4858d22ed70d7040f48767cf
(net: introduce a list of device addresses dev_addr_list (v6))
added one regression Vegard Nossum found in its testings.

With kmemcheck help, Vegard found some uninitialized memory
was read and reported to user, potentialy leaking kernel data.
( thread can be found on http://lkml.org/lkml/2009/5/30/177 )

dev_addr_init() incorrectly uses sizeof() operator. We were
initializing one byte instead of MAX_ADDR_LEN bytes.

Reported-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobe2net: Remove unnecessary frag list traversing.
David S. Miller [Tue, 9 Jun 2009 08:01:31 +0000 (01:01 -0700)]
be2net: Remove unnecessary frag list traversing.

This driver does not indicate support for frag lists.

Furthermore, even if it did, the code is walking the frag
lists incorrectly.  The idiom is:

for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next)

but it's doing:

for (iter = skb_shinfo(skb)->frag_list; iter;
     iter = skb_shinfo(iter)->frag_list)

which would never work.  And this proves that this driver never
saw an SKB with active frag lists.

So just remove the code altogether and the driver TX path becomes
much simpler.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoxfrm: Use frag list abstraction interfaces.
David S. Miller [Tue, 9 Jun 2009 07:22:47 +0000 (00:22 -0700)]
xfrm: Use frag list abstraction interfaces.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosctp: Use frag list abstraction interfaces.
David S. Miller [Tue, 9 Jun 2009 07:22:35 +0000 (00:22 -0700)]
sctp: Use frag list abstraction interfaces.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agophonet: Use frag list abstraction interfaces.
David S. Miller [Tue, 9 Jun 2009 07:21:58 +0000 (00:21 -0700)]
phonet: Use frag list abstraction interfaces.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetfilter: Use frag list abstraction interfaces.
David S. Miller [Tue, 9 Jun 2009 07:23:58 +0000 (00:23 -0700)]
netfilter: Use frag list abstraction interfaces.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipv6: Use frag list abstraction interfaces.
David S. Miller [Tue, 9 Jun 2009 07:20:05 +0000 (00:20 -0700)]
ipv6: Use frag list abstraction interfaces.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipv4: Use frag list abstraction interfaces.
David S. Miller [Tue, 9 Jun 2009 07:19:37 +0000 (00:19 -0700)]
ipv4: Use frag list abstraction interfaces.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet/core/user_dma.c: Use frag list abstraction interfaces.
David S. Miller [Tue, 9 Jun 2009 07:19:10 +0000 (00:19 -0700)]
net/core/user_dma.c: Use frag list abstraction interfaces.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet/core/skbuff.c: Use frag list abstraction interfaces.
David S. Miller [Tue, 9 Jun 2009 07:18:59 +0000 (00:18 -0700)]
net/core/skbuff.c: Use frag list abstraction interfaces.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet/core/dev.c: Use frag list abstraction interfaces.
David S. Miller [Tue, 9 Jun 2009 07:18:51 +0000 (00:18 -0700)]
net/core/dev.c: Use frag list abstraction interfaces.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodatagram: Use frag list abstraction interfaces.
David S. Miller [Tue, 9 Jun 2009 07:18:15 +0000 (00:18 -0700)]
datagram: Use frag list abstraction interfaces.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoappletalk: Use frag list abstraction interfaces.
David S. Miller [Tue, 9 Jun 2009 07:17:44 +0000 (00:17 -0700)]
appletalk: Use frag list abstraction interfaces.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetdevice.h: Use frag list abstraction interfaces.
David S. Miller [Tue, 9 Jun 2009 07:17:27 +0000 (00:17 -0700)]
netdevice.h: Use frag list abstraction interfaces.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoskbuff: Add frag list abstraction interfaces.
David S. Miller [Tue, 9 Jun 2009 07:17:13 +0000 (00:17 -0700)]
skbuff: Add frag list abstraction interfaces.

With the hope that these can be used to eliminate direct
references to the frag list implementation.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobluetooth: Kill skb_frags_no(), unused.
David S. Miller [Mon, 8 Jun 2009 23:16:56 +0000 (16:16 -0700)]
bluetooth: Kill skb_frags_no(), unused.

Furthermore, it twiddles with the details of SKB list handling
directly, which we're trying to eliminate.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodeclance: Restore tx descriptor ring locking
Maciej W. Rozycki [Mon, 8 Jun 2009 09:42:35 +0000 (02:42 -0700)]
declance: Restore tx descriptor ring locking

A driver overhaul on 29 Feb 2000 (!) broke locking around fiddling with
the tx descriptor ring in start_xmit(); a follow-on "fix" removed the
broken remnants altogether.  Here's a patch to restore proper locking in
the function -- the complement in the interrupt handler has been correct
all the time.

 This *may* have been the reason for the occasional confusion of the chip
-- triggering a tx timeout followed by a chip reset sequence -- seen on
R4k-based DECstations with the onboard Ethernet interface.  Another theory
is the confusion is due to an unindentified problem -- perhaps a silicon
erratum -- associated with the variation of the MT ASIC used to interface
the R4k CPU to the rest of the system on these computers; with its
aggressive write-back buffering the design is particularly weakly ordered
when it comes to MMIO (in the absence of ordering barriers uncached reads
are allowed to bypass earlier uncached writes, even if to the same
location), which may trigger all kinds of corner cases in peripheral
hardware as well as software.

Either way this piece of code is buggy.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoisdn: extend INTERFACE.CAPI document
Tilman Schmidt [Sun, 7 Jun 2009 09:09:24 +0000 (09:09 +0000)]
isdn: extend INTERFACE.CAPI document

Clarify calling context and return codes of callback methods, and
add a description of the _cmsg structure and helper functions.

Impact: documentation
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoisdn: prevent NULL ptr Oops in capi_cmsg2str()
Tilman Schmidt [Sun, 7 Jun 2009 09:09:24 +0000 (09:09 +0000)]
isdn: prevent NULL ptr Oops in capi_cmsg2str()

The dereferencing of the private pointer cmsg->m in capi_cmsg2str() may
cause an Oops in case of an error, which is particularly inconvenient
as that function is typically used to format an error message. Add a
NULL pointer check to avoid this.

Impact: error handling improvement
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoisdn: kerneldoc for capiutil.c
Tilman Schmidt [Sun, 7 Jun 2009 09:09:23 +0000 (09:09 +0000)]
isdn: kerneldoc for capiutil.c

Add kerneldoc comments for the exported funtions in capiutil.c.

Impact: documentation
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoisdn: rename capi_ctr_reseted() to capi_ctr_down()
Tilman Schmidt [Sun, 7 Jun 2009 09:09:23 +0000 (09:09 +0000)]
isdn: rename capi_ctr_reseted() to capi_ctr_down()

Change the name of the Kernel CAPI exported function capi_ctr_reseted()
to something representing its purpose better.

Impact: renaming, no functional change
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotun: Fix unregister race
Eric W. Biederman [Mon, 8 Jun 2009 07:44:31 +0000 (00:44 -0700)]
tun: Fix unregister race

It is possible for tun_chr_close to race with dellink on the
a tun device.  In which case if __tun_get runs before dellink
but dellink runs before tun_chr_close calls unregister_netdevice
we will attempt to unregister the netdevice after it is already
gone.

The two cases are already serialized on the rtnl_lock, so I have
gone for the cheap simple fix of moving rtnl_lock to cover __tun_get
in tun_chr_close.  Eliminating the possibility of the tun device
being unregistered between __tun_get and unregister_netdevice in
tun_chr_close.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Tested-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoe100: Fix napi_enable BUG_ON when recovering from EEH error
Andre Detsch [Mon, 8 Jun 2009 07:42:30 +0000 (00:42 -0700)]
e100: Fix napi_enable BUG_ON when recovering from EEH error

BUG_ON(!test_bit(NAPI_STATE_SCHED, &n->state)) was being hit
during e100 EEH recovery. The problem source was a napi_enable
call being made during e100_io_error_detected. Napi should remain
disabled after e100_down, and only be reenabled when the interface
is recovered.

This patch also updates e100_io_error_detected in order to make
it similar to the current versions of the error_detected callback
in drivers such as e1000e and ixgbe.

Signed-off-by: Andre Detsch <adetsch@br.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet pkgen.c:fix no need for check
Figo.zhang [Mon, 8 Jun 2009 07:40:35 +0000 (00:40 -0700)]
net pkgen.c:fix no need for check

vfree() does its own 'NULL' check, so no need for check before
calling it.

Signed-off-by: Figo.zhang <figo1802@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomlx4: FIX error flow when initializing EQ table
Yevgeny Petrilin [Mon, 8 Jun 2009 07:39:58 +0000 (00:39 -0700)]
mlx4: FIX error flow when initializing EQ table

If mlx4_create_eq() would fail for one of EQ's assigned for
completion handling, the code would try to free the same EQ
we failed to create.
The crash was found by Christoph Lameter

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotun: Fix copy/paste error in tun_get_user
Sridhar Samudrala [Mon, 8 Jun 2009 07:27:28 +0000 (00:27 -0700)]
tun: Fix copy/paste error in tun_get_user

Use the right structure while incrementing the offset in tun_get_user.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Fix memcpy_toiovecend() to use the right offset
Sridhar Samudrala [Fri, 5 Jun 2009 09:35:44 +0000 (09:35 +0000)]
net: Fix memcpy_toiovecend() to use the right offset

Increment the iovec base by the offset passed in for the initial
copy_to_user() in memcpy_to_iovecend().

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Fix skb_copy_datagram_from_iovec() to pass the right offset
Sridhar Samudrala [Fri, 5 Jun 2009 09:35:40 +0000 (09:35 +0000)]
net: Fix skb_copy_datagram_from_iovec() to pass the right offset

I am working on enabling UFO between KVM guests using virtio-net and i have
some patches that i got working with 2.6.30-rc8. When i wanted to try them
with net-next-2.6, i noticed that virtio-net is not working with that tree.

After some debugging, it turned out to be several bugs in the recent patches
to fix aio with tun driver, specifically the following 2 commits.

http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=0a1ec07a67bd8b0033dace237249654d015efa21
http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=6f26c9a7555e5bcca3560919db9b852015077dae

Fix the call to memcpy_from_iovecend() in skb_copy_datagram_from_iovec
to pass the right iovec offset.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: skb_shared_info optimization
Eric Dumazet [Fri, 5 Jun 2009 04:04:16 +0000 (04:04 +0000)]
net: skb_shared_info optimization

skb_dma_unmap() is quite expensive for small packets,
because we use two different cache lines from skb_shared_info.

One to access nr_frags, one to access dma_maps[0]

Instead of dma_maps being an array of MAX_SKB_FRAGS + 1 elements,
let dma_head alone in a new dma_head field, close to nr_frags,
to reduce cache lines misses.

Tested on my dev machine (bnx2 & tg3 adapters), nice speedup !

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: num_dma_maps is not used
Eric Dumazet [Fri, 5 Jun 2009 04:03:35 +0000 (04:03 +0000)]
net: num_dma_maps is not used

Get rid of num_dma_maps in struct skb_shared_info, as it seems unused.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agos2io: Remove private boolean definitions
Tobias Klauser [Thu, 4 Jun 2009 23:07:59 +0000 (23:07 +0000)]
s2io: Remove private boolean definitions

Remove the private definition of TRUE/FALSE and use the ones from
linux/stddef.h. Also remove the definition of BOOL which is not referenced
inside the driver anyway.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agohso: convert dev_alloc_skb() to netdev_alloc_skb()
Paulius Zaleckas [Thu, 4 Jun 2009 05:50:29 +0000 (05:50 +0000)]
hso: convert dev_alloc_skb() to netdev_alloc_skb()

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetdev: Added KS8842 driver
Richard R\9aöjfors [Thu, 4 Jun 2009 03:35:55 +0000 (03:35 +0000)]
netdev: Added KS8842 driver

This is a driver for the Micrel KS8842 ethernet switch.

The supplied code is for driving the KS8842 through the Timberdale FPGA
on the Russellville board, a development board for Intel Atom CPU
in the automotive area.

Signed-off-by: Richard Röjfors <richard.rojfors.ext@mocean-labs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Ensure partial checksum offset is inside the skb head
Herbert Xu [Thu, 4 Jun 2009 01:22:01 +0000 (01:22 +0000)]
net: Ensure partial checksum offset is inside the skb head

On Thu, Jun 04, 2009 at 09:06:00PM +1000, Herbert Xu wrote:
>
> tun: Optimise handling of bogus gso->hdr_len
>
> As all current versions of virtio_net generate a value for the
> header length that's too small, we should optimise this so that
> we don't copy it twice.  This can be done by ensuring that it is
> at least as large as the place where we'll write the checksum.
>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

With this applied we can strengthen the partial checksum check:

In skb_partial_csum_set we check to see if the checksum offset
is within the packet.  However, we really should check that it
is within the skb head as that's the only bit we can modify
without copying.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotun: Optimise handling of bogus gso->hdr_len
Herbert Xu [Mon, 8 Jun 2009 07:20:01 +0000 (00:20 -0700)]
tun: Optimise handling of bogus gso->hdr_len

As all current versions of virtio_net generate a value for the
header length that's too small, we should optimise this so that
we don't copy it twice.  This can be done by ensuring that it is
at least as large as the place where we'll write the checksum.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agovirtio_net: Set correct gso->hdr_len
Herbert Xu [Thu, 4 Jun 2009 00:59:18 +0000 (00:59 +0000)]
virtio_net: Set correct gso->hdr_len

Through a bug in the tun driver, I noticed that virtio_net is
producing bogus hdr_len values.  In particular, it only includes
the IP header in the linear area, and excludes the entire TCP
header.  This causes the TCP header to be copied twice for each
packet.  (The bug omitted the second copy :)

This patch corrects this.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosis190: fix gigabit negotiation
Riccardo Ghetta [Thu, 4 Jun 2009 09:05:20 +0000 (09:05 +0000)]
sis190: fix gigabit negotiation

Fixes an initialization error; the chip negotiates gigabit, but
the driver mistakenly handled it as 100Mb.
Changes based on both SiS own GPL driver and forcedeth.
Hopefully should fix
http://bugzilla.kernel.org/show_bug.cgi?id=9735
http://bugzilla.kernel.org/show_bug.cgi?id=11149

Signed-off-by: Riccardo Ghetta <birrachiara@tin.it>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosis190: add new phy found on asus F5Sr laptop
Riccardo Ghetta [Thu, 4 Jun 2009 09:05:07 +0000 (09:05 +0000)]
sis190: add new phy found on asus F5Sr laptop

Signed-off-by: Riccardo Ghetta <birrachiara@tin.it>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosis190: better message on unknown PHY
Riccardo Ghetta [Thu, 4 Jun 2009 09:04:55 +0000 (09:04 +0000)]
sis190: better message on unknown PHY

Signed-off-by: Riccardo Ghetta <birrachiara@tin.it>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosis190: fix for x86_64 (bug 11509)
Riccardo Ghetta [Sun, 7 Jun 2009 19:47:58 +0000 (19:47 +0000)]
sis190: fix for x86_64 (bug 11509)

Corrected dma sync handling on small packets. Should fix
http://bugzilla.kernel.org/show_bug.cgi?id=11509
Note:
While this bug was reported only on x86_64, it could have affected
any architecture.

Signed-off-by: Riccardo Ghetta <birrachiara@tin.it>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqlge: Fix timeout on firmware mailbox commands.
Ron Mercer [Sun, 7 Jun 2009 13:58:29 +0000 (13:58 +0000)]
qlge: Fix timeout on firmware mailbox commands.

Some firmware mailbox commands require the firmware to
communicate with the FCoE driver running on another
PCI function.  This can potentially take several seconds.
This wait is done in process context only.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqlge: Fix timeout on indexed register wait.
Ron Mercer [Sun, 7 Jun 2009 13:58:28 +0000 (13:58 +0000)]
qlge: Fix timeout on indexed register wait.

There are 8 banks of 'sub-registers' each of which are accessed
through address/data register pair.  An example would be reading
flash or the xgmac.  Accessing these require the driver to wait for
a ready bit before writing the address and then accessing the data.
This patch increases the timeout to 100us to prevent timeouts
that have been seen on some platforms.
These register are accessed in process context only.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>