cascardo/linux.git
13 years agoath9k: fix spurious MIC failure reports
Felix Fietkau [Sat, 28 Aug 2010 16:21:21 +0000 (18:21 +0200)]
ath9k: fix spurious MIC failure reports

According to the hardware documentation, the MIC failure bit is only
valid if the frame was decrypted using a valid TKIP key and is not a
fragment.
In some setups I've seen hardware-reported MIC failures on an AP that
was configured for CCMP only, so it's clear that additional checks are
necessary.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonet/wireless: Remove double test
Julia Lawall [Sat, 28 Aug 2010 15:41:06 +0000 (17:41 +0200)]
net/wireless: Remove double test

The same expression is tested twice and the result is the same each time.

The sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@expression@
expression E;
@@

(
* E
  || ... || E
|
* E
  && ... && E
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1251: Fix queue stopping/waking for TX path
Denis 'GNUtoo' Carikli [Fri, 27 Aug 2010 21:48:19 +0000 (23:48 +0200)]
wl1251: Fix queue stopping/waking for TX path

This patch was adapted from 06f7bc7db79fabe6b2ec16eff0f59e4acc21eb72
(from linus's linux-2.6 tree of kernel.org)

here's the original message:
    The queue stopping/waking functionality was broken in a way that could
    cause huge latencies in TX transfers and even cause the TX to stall in the
    right circumstances. Correct these problems.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Acked-by: Kalle Valo <kvalo@adurom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Do not generate CQM events based on first Beacon frames
Jouni Malinen [Fri, 27 Aug 2010 19:22:00 +0000 (22:22 +0300)]
mac80211: Do not generate CQM events based on first Beacon frames

The signal strength value in a single RX frame is not that reliable,
so it is better to delay start of CQM events until there is a real
average signal strength from more than a single Beacon frame
available.

Signed-off-by: Jouni Malinen <j@w1.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Fix signal strength average initialization for CQM events
Jouni Malinen [Fri, 27 Aug 2010 19:21:13 +0000 (22:21 +0300)]
mac80211: Fix signal strength average initialization for CQM events

The ave_beacon_signal value uses 1/16 dB unit and as such, must be
initialized with the signal level of the first Beacon frame multiplied
by 16. This fixes an issue where the initial CQM events are reported
incorrectly with a burst of events while the running average
approaches the correct value after the incorrect initialization. This
could cause user space -based roaming decision process to get quite
confused at the moment when we would like to go through authentication
and DHCP.

Cc: stable@kernel.org
Signed-off-by: Jouni Malinen <j@w1.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMerge branch 'wireless-next-2.6' of git://git.kernel.org/pub/scm/linux/kernel/git...
John W. Linville [Tue, 31 Aug 2010 18:12:19 +0000 (14:12 -0400)]
Merge branch 'wireless-next-2.6' of git://git./linux/kernel/git/iwlwifi/iwlwifi-2.6

13 years agostmmac: Fix build warnings.
David S. Miller [Tue, 31 Aug 2010 04:55:17 +0000 (21:55 -0700)]
stmmac: Fix build warnings.

In file included from drivers/net/stmmac/stmmac_ethtool.c:30:
drivers/net/stmmac/stmmac.h:111: warning: 'struct platform_device' declared inside parameter list
drivers/net/stmmac/stmmac.h:111: warning: its scope is only this definition or declaration, which is probably not what you want
drivers/net/stmmac/stmmac_main.c: In function 'stmmac_dvr_probe':
drivers/net/stmmac/stmmac_main.c:1744: warning: cast from pointer to integer of different size
In file included from drivers/net/stmmac/stmmac_mdio.c:31:
drivers/net/stmmac/stmmac.h:111: warning: 'struct platform_device' declared inside parameter list
drivers/net/stmmac/stmmac.h:111: warning: its scope is only this definition or declaration, which is probably not what you want
drivers/net/stmmac/dwmac1000_core.c: In function 'dwmac1000_dump_regs':
drivers/net/stmmac/dwmac1000_core.c:56: warning: cast from pointer to integer of different size

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv6: struct xfrm6_tunnel in read_mostly section
Eric Dumazet [Mon, 30 Aug 2010 10:27:10 +0000 (10:27 +0000)]
ipv6: struct xfrm6_tunnel in read_mostly section

tunnel6_handlers chain being scanned for each incoming packet,
make sure it doesnt share an often dirtied cache line.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: struct xfrm_tunnel in read_mostly section
Eric Dumazet [Mon, 30 Aug 2010 07:04:14 +0000 (07:04 +0000)]
net: struct xfrm_tunnel in read_mostly section

tunnel4_handlers chain being scanned for each incoming packet,
make sure it doesnt share an often dirtied cache line.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet/m68k: Hydra Ethernet - print whole resource instead of start address
Geert Uytterhoeven [Sun, 29 Aug 2010 21:43:46 +0000 (21:43 +0000)]
net/m68k: Hydra Ethernet - print whole resource instead of start address

resource_size_t changed from `unsigned long' to `phys_addr_t`, which is either
`u32' or `u64'.
Print the whole resource to remove the cast and to make it future-proof.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoTCP: update initial windows according to RFC 5681
Gerrit Renker [Sun, 29 Aug 2010 19:27:34 +0000 (19:27 +0000)]
TCP: update initial windows according to RFC 5681

This updates the use of larger initial windows, as originally specified in
RFC 3390, to use the newer IW values specified in RFC 5681, section 3.1.

The changes made in RFC 5681 are:
 a) the setting now is more clearly specified in units of segments (as the
    comments  by John Heffner emphasized, this was not very clear in RFC 3390);
 b) for connections with 1095 < SMSS <= 2190 there is now a change:
    - RFC 3390 says that IW <= 4380,
    - RFC 5681 says that IW = 3 * SMSS <= 6570.

Since RFC 3390 is older and "only" proposed standard, whereas the newer RFC 5681
is already draft standard, it seems preferable to use the newer IW variant.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodccp ccid-3: use per-route RTO or TCP RTO as fallback
Gerrit Renker [Sun, 29 Aug 2010 19:23:14 +0000 (19:23 +0000)]
dccp ccid-3: use per-route RTO or TCP RTO as fallback

This makes RTAX_RTO_MIN also available to CCID-3, replacing the compile-time
RTO lower bound with a per-route tunable value.

The original Kconfig option solved the problem that a very low RTT (in the
order of HZ) can trigger too frequent and unnecessary reductions of the
sending rate.

This tunable does not affect the initial RTO value of 2 seconds specified in
RFC 5348, section 4.2 and Appendix B. But like the hardcoded Kconfig value,
it allows to adapt to network conditions.

The same effect as the original Kconfig option of 100ms is now achieved by

> ip route replace to unicast 192.168.0.0/24 rto_min 100j dev eth0

(assuming HZ=1000).

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodccp ccid-2: Share TCP's minimum RTO code
Gerrit Renker [Sun, 29 Aug 2010 19:23:13 +0000 (19:23 +0000)]
dccp ccid-2: Share TCP's minimum RTO code

Using a fixed RTO_MIN of 0.2 seconds was found to cause problems for CCID-2
over 802.11g: at least once per session there was a spurious timeout. It
helped to then increase the the value of RTO_MIN over this link.

Since the problem is the same as in TCP, this patch makes the solution from
commit "05bb1fad1cde025a864a90cfeb98dcbefe78a44a"
       "[TCP]: Allow minimum RTO to be configurable via routing metrics."
available to DCCP.

This avoids reinventing the wheel, so that e.g. the following works in the
expected way now also for CCID-2:

> ip route change 10.0.0.2 rto_min 800 dev ath0

Luckily this useful rto_min function was recently moved to net/tcp.h,
which simplifies sharing code originating from TCP.

Documentation also updated (plus minor whitespace fixes).

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotcp/dccp: Consolidate common code for RFC 3390 conversion
Gerrit Renker [Sun, 29 Aug 2010 19:23:12 +0000 (19:23 +0000)]
tcp/dccp: Consolidate common code for RFC 3390 conversion

This patch consolidates initial-window code common to TCP and CCID-2:
 * TCP uses RFC 3390 in a packet-oriented manner (tcp_input.c) and
 * CCID-2 uses RFC 3390 in packet-oriented manner (RFC 4341).

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodccp ccid-2: Remove wrappers around sk_{reset,stop}_timer()
Gerrit Renker [Sun, 29 Aug 2010 19:23:11 +0000 (19:23 +0000)]
dccp ccid-2: Remove wrappers around sk_{reset,stop}_timer()

This removes the wrappers around the sk timer functions, since not much is
gained from using them: the BUG_ON in start_rto_timer will never trigger
since that function is called only if:

 * the RTO timer expires (rto_expire, and then timer_pending() is false);
 * in tx_packet_sent only if !timer_pending() (BUG_ON is redundant here);
 * previously in new_ack, after stopping the timer (timer_pending() false).

Removing the wrappers also clears the way for eventually replacing the
RTO timer with the icsk-retransmission-timer, as it is already part of the
DCCP socket.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodccp ccid-2: Use u32 timestamps uniformly
Gerrit Renker [Sun, 29 Aug 2010 19:23:10 +0000 (19:23 +0000)]
dccp ccid-2: Use u32 timestamps uniformly

Since CCID-2 is de facto a mini implementation of TCP, it makes sense to share
as much code as possible.

Hence this patch aligns CCID-2 timestamping with TCP timestamping.
This also halves the space consumption (on 64-bit systems).

The necessary include file <net/tcp.h> is already included by way of
net/dccp.h. Redundant includes have been removed.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotcp: Add TCP_USER_TIMEOUT socket option.
Jerry Chu [Fri, 27 Aug 2010 19:13:28 +0000 (19:13 +0000)]
tcp: Add TCP_USER_TIMEOUT socket option.

This patch provides a "user timeout" support as described in RFC793. The
socket option is also needed for the the local half of RFC5482 "TCP User
Timeout Option".

TCP_USER_TIMEOUT is a TCP level socket option that takes an unsigned int,
when > 0, to specify the maximum amount of time in ms that transmitted
data may remain unacknowledged before TCP will forcefully close the
corresponding connection and return ETIMEDOUT to the application. If
0 is given, TCP will continue to use the system default.

Increasing the user timeouts allows a TCP connection to survive extended
periods without end-to-end connectivity. Decreasing the user timeouts
allows applications to "fail fast" if so desired. Otherwise it may take
upto 20 minutes with the current system defaults in a normal WAN
environment.

The socket option can be made during any state of a TCP connection, but
is only effective during the synchronized states of a connection
(ESTABLISHED, FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, or LAST-ACK).
Moreover, when used with the TCP keepalive (SO_KEEPALIVE) option,
TCP_USER_TIMEOUT will overtake keepalive to determine when to close a
connection due to keepalive failure.

The option does not change in anyway when TCP retransmits a packet, nor
when a keepalive probe will be sent.

This option, like many others, will be inherited by an acceptor from its
listener.

Signed-off-by: H.K. Jerry Chu <hkchu@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: fix datapath typo
Simon Horman [Mon, 30 Aug 2010 04:57:55 +0000 (21:57 -0700)]
net: fix datapath typo

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoIPVS: include net/ip6_checksum.h for csum_ipv6_magic
Stephen Rothwell [Sun, 29 Aug 2010 17:04:53 +0000 (17:04 +0000)]
IPVS: include net/ip6_checksum.h for csum_ipv6_magic

Fixes this build error:

net/netfilter/ipvs/ip_vs_core.c: In function 'ip_vs_nat_icmp_v6':
net/netfilter/ipvs/ip_vs_core.c:640: error: implicit declaration of function 'csum_ipv6_magic'

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net/atl1c: Remove double test
Julia Lawall [Sat, 28 Aug 2010 05:41:02 +0000 (05:41 +0000)]
drivers/net/atl1c: Remove double test

The nic_type field is compared to athr_l2c twice.

The sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@expression@
expression E;
@@

(
* E
  || ... || E
|
* E
  && ... && E
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agostarfire: use BUILD_BUG_ON for netdrv_addr_t
Akinobu Mita [Fri, 27 Aug 2010 19:08:45 +0000 (19:08 +0000)]
starfire: use BUILD_BUG_ON for netdrv_addr_t

Detect size mismatch for netdrv_addr_t at build time rather than
checking at module load time.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Ion Badulescu <ionut@badula.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agostarfire: use PCI_VDEVICE
Akinobu Mita [Fri, 27 Aug 2010 19:08:36 +0000 (19:08 +0000)]
starfire: use PCI_VDEVICE

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Ion Badulescu <ionut@badula.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agophonet: use for_each_set_bit
Akinobu Mita [Fri, 27 Aug 2010 19:08:26 +0000 (19:08 +0000)]
phonet: use for_each_set_bit

Replace open-coded loop with for_each_set_bit().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agomlx4: use bitmap library
Akinobu Mita [Fri, 27 Aug 2010 19:08:13 +0000 (19:08 +0000)]
mlx4: use bitmap library

Replace loops calling set_bit() and clear_bit() with bitmap_set() and
bitmap_clear().

Unlike loops calling set_bit() and clear_bit(), bitmap_set() and
bitmap_clear() are not atomic. But this is ok.
Because the bitmap operations are protected by bitmap->lock
except for initialization of the bitmap in mlx4_bitmap_init().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoeconet: kill unnecessary spin_lock_init()
Akinobu Mita [Fri, 27 Aug 2010 16:41:56 +0000 (16:41 +0000)]
econet: kill unnecessary spin_lock_init()

The spinlock aun_queue_lock is initialized statically. It is unnecessary
to initialize by spin_lock_init() at module load time.

This is detected by the semantic patch.

// <smpl>
@def@
declarer name DEFINE_SPINLOCK;
identifier spinlock;
@@

DEFINE_SPINLOCK(spinlock);

@@
identifier def.spinlock;
@@

- spin_lock_init(&spinlock);
// </smpl>

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Julia Lawall <julia@diku.dk>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoslip: Use net_device_stats from struct net_device
Tobias Klauser [Thu, 26 Aug 2010 22:12:08 +0000 (22:12 +0000)]
slip: Use net_device_stats from struct net_device

Use net_device->stats for stats instead of private variable copies in
struct slip. Use ndo_get_stat64 so the additions can be performed on a private
destination buffer.

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agomac80211: fix offchannel queue stop
Johannes Berg [Fri, 27 Aug 2010 11:45:28 +0000 (13:45 +0200)]
mac80211: fix offchannel queue stop

Somebody noticed this problem, and I outlined
to them how to fix it, but haven't heard back
from them. So while I was adding the state
field I figured I could use it to fix it.

The problem, as I understand it, is that when
we go offchannel while the driver has a queue
stopped, the driver will likely start draining
the queue and then enable it while offchannel.
This in turn will enable the interface queue,
and that leads to transmitting data frames on
the wrong channel.

Fix this by keeping track of offchannel status
per interface, and not enabling the interface
queues on interfaces that are offchannel when
the driver enables a queue.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211_hwsim: support runtime iftype changes
Johannes Berg [Fri, 27 Aug 2010 10:35:59 +0000 (12:35 +0200)]
mac80211_hwsim: support runtime iftype changes

Add the trivial support for runtime interface
type changes to mac80211_hwsim for testing.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: support runtime interface type changes
Johannes Berg [Fri, 27 Aug 2010 10:35:58 +0000 (12:35 +0200)]
mac80211: support runtime interface type changes

Add support to mac80211 for changing the interface
type even when the interface is UP, if the driver
supports it.

To achieve this
 * add a new driver callback for switching,
 * split some of the interface up/down code out
   into new functions (do_open/do_stop), and
 * maintain an own __SDATA_RUNNING bit that will
   not be set during interface type, so that any
   other code doesn't use the interface.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: split out concurrent vif checks
Johannes Berg [Fri, 27 Aug 2010 10:35:57 +0000 (12:35 +0200)]
mac80211: split out concurrent vif checks

Split the concurrent virtual interface checks
into a new function that can be used to check
for any given new interface type.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: simplify zero address checks
Johannes Berg [Fri, 27 Aug 2010 10:35:56 +0000 (12:35 +0200)]
mac80211: simplify zero address checks

The libertas_tf special code for zero addresses
is a bit too complex, it compares against a stack
value instead of using is_zero_ether_addr() and
tries to update all interfaces even if just the
one that's being brought up needs to be changed.
Additionally, the repeated check for a valid MAC
address need only be done if we actually changed
it on the fly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: switch to ieee80211_sdata_running
Johannes Berg [Fri, 27 Aug 2010 10:35:55 +0000 (12:35 +0200)]
mac80211: switch to ieee80211_sdata_running

Since the introduction of ieee80211_sdata_running(),
some new code was introduced that uses netif_running()
instead. Switch all these instances over.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: clean up ifdown/cleanup paths
Johannes Berg [Fri, 27 Aug 2010 10:35:54 +0000 (12:35 +0200)]
mac80211: clean up ifdown/cleanup paths

There's a lot of redundant code in mac80211's
interface cleanup/down, for example freeing
AP beacons is done both when the interface is
set DOWN as well as when it is torn down, of
which only the former has any effect.

Also, a bunch of things should be closer to
where they matter, like the MLME timers that
we should cancel when disassociating, rather
than only when the interface is set DOWN.

Clean up all this code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: use subqueue helpers
Johannes Berg [Fri, 27 Aug 2010 11:36:49 +0000 (13:36 +0200)]
mac80211: use subqueue helpers

There are subqueue helpers so that we don't
need to get the TX queue and then wake/stop
it, use those helpers.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: allow changing port control protocol
Johannes Berg [Fri, 27 Aug 2010 11:26:54 +0000 (14:26 +0300)]
mac80211: allow changing port control protocol

Some vendor specified mechanisms for 802.1X-style
functionality use a different protocol than EAP
(even if EAP is vendor-extensible). Support this
in mac80211 via the cfg80211 API for it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: allow changing port control protocol
Johannes Berg [Fri, 27 Aug 2010 11:26:53 +0000 (14:26 +0300)]
cfg80211: allow changing port control protocol

Some vendor specified mechanisms for 802.1X-style
functionality use a different protocol than EAP
(even if EAP is vendor-extensible). Allow setting
the ethertype for the protocol when a driver has
support for this. The default if unspecified is
EAP, of course.

Note: This is suitable only for station mode, not
      for AP implementation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: allow vendor specific cipher suites
Johannes Berg [Fri, 27 Aug 2010 11:26:52 +0000 (14:26 +0300)]
mac80211: allow vendor specific cipher suites

Allow drivers to specify their own set of cipher
suites to advertise vendor-specific ciphers. The
driver is then required to implement hardware
crypto offload for it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: allow vendor specific cipher suites
Johannes Berg [Fri, 27 Aug 2010 11:26:51 +0000 (14:26 +0300)]
cfg80211: allow vendor specific cipher suites

cfg80211 currently rejects all cipher suites it
doesn't know about for key length checking
purposes. This can lead to inconsistencies when
a driver advertises an algorithm that cfg80211
doesn't know about. Remove this rejection so
drivers can specify any algorithm they like.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211 docbook: remove erronous !A
Johannes Berg [Fri, 27 Aug 2010 09:29:24 +0000 (11:29 +0200)]
cfg80211 docbook: remove erronous !A

My previous patch erroneously included an
!A line (for some checking I am working on)
that isn't yet supported by the docbook
tools, so remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Enable ANI in associated state only
Rajkumar Manoharan [Fri, 27 Aug 2010 06:39:00 +0000 (12:09 +0530)]
ath9k_htc: Enable ANI in associated state only

While scanning, ANI is triggered unnecessarily where sta is in
unassociated state. And cancelling ani work in ath9k_htc_stop
is not required.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl12xx: remove unneeded locking
Johannes Berg [Thu, 26 Aug 2010 11:30:27 +0000 (13:30 +0200)]
wl12xx: remove unneeded locking

With the scan callback now being callable from
any context, these unlocks/locks can go away.
This makes the code easier to understand, since
callers of these functions must no longer be
aware that the mutex may be dropped.

As Stanislaw is working on iwlwifi scanning, I
didn't change it to take advantage of the new
mac80211 semantics.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: allow scan to complete from any context
Johannes Berg [Thu, 26 Aug 2010 11:30:26 +0000 (13:30 +0200)]
mac80211: allow scan to complete from any context

The ieee80211_scan_completed() function was a frequent
source of potential deadlocks, since it is called by
drivers but may call back into drivers, so drivers had
to make sure to call it without any locks held, which
frequently lead to more complex code in drivers. Avoid
that problem by allowing the function to be called in
any context, and queueing the actual work it does.
Also update the documentation for it to indicate this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: remove unused scan expire define
Johannes Berg [Thu, 26 Aug 2010 11:30:25 +0000 (13:30 +0200)]
mac80211: remove unused scan expire define

Since cfg80211 manages the BSS list completely,
this define hasn't been used for a long time
and will never be used again.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Change the default LED pattern.
Vivek Natarajan [Wed, 25 Aug 2010 14:04:52 +0000 (19:34 +0530)]
ath9k: Change the default LED pattern.

All major Atheros customers require the led to be in continuous
ON state rather than the blinking pattern.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: fix off-by-one in pilot magnitude mask
Bob Copeland [Wed, 25 Aug 2010 01:37:14 +0000 (21:37 -0400)]
ath5k: fix off-by-one in pilot magnitude mask

If the symbol offset is 46, it will be counted in both
the third and fourth bytes of the mask, and in this
case the shift will be negative which can pollute
high order bits in the mask.  This may negatively impact
OFDM symbol detection.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: re-order one of the frees on unwind
Dan Carpenter [Sat, 21 Aug 2010 19:24:59 +0000 (21:24 +0200)]
ath5k: re-order one of the frees on unwind

There was a small misordering here.  In the original code, if we were to
go to err_free_ah then it wouldn't free the irq.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: allow using multiple contexts
Johannes Berg [Mon, 23 Aug 2010 08:46:58 +0000 (10:46 +0200)]
iwlwifi: allow using multiple contexts

We're now ready to start using multiple contexts.
We do this by keeping track of the valid interface
types per context (exclusive [ibss] and normal)
and checking which context is "free" when a new
interface is added.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: follow main beacon interval
Johannes Berg [Mon, 23 Aug 2010 08:46:57 +0000 (10:46 +0200)]
iwlwifi: follow main beacon interval

It is necessary that the PAN context always
use the same beacon interval as the BSS
context unless it is in dual-station mode,
ie. the PAN context is a station as well,
so implement that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: always send RXON timing
Johannes Berg [Mon, 23 Aug 2010 08:46:56 +0000 (10:46 +0200)]
iwlagn: always send RXON timing

The PAN context requires also getting
RXON timing when we send an unassociated
RXON in some cases.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: pass context to iwl_send_rxon_timing
Johannes Berg [Mon, 23 Aug 2010 08:46:55 +0000 (10:46 +0200)]
iwlwifi: pass context to iwl_send_rxon_timing

Sometimes we need to send RXON timing even
when we don't have a virtual interface yet,
so pass the context and allow passing one
without a virtual interface pointer.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: send PAN parameters
Johannes Berg [Fri, 27 Aug 2010 16:44:50 +0000 (09:44 -0700)]
iwlwifi: send PAN parameters

In order for the microcode to be able to handle
multiple interfaces, we need to give it the PAN
parameters that state how to allocate the time
between the two interfaces. Do this, and update
it wherever necessary.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: send beacon before committing associated RXON
Johannes Berg [Mon, 23 Aug 2010 08:46:53 +0000 (10:46 +0200)]
iwlagn: send beacon before committing associated RXON

Newer AGN microcode requires know the beacon
before starting the AP so that it can start
beaconing right away. Implement that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: send RXON timing before associating
Johannes Berg [Mon, 23 Aug 2010 08:46:52 +0000 (10:46 +0200)]
iwlagn: send RXON timing before associating

The PAN functionality requires us to send the
timing including a valid DTIM period to the
microcode before associating, so request this
data from mac80211 and send it to the device.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: queue frames according to context
Johannes Berg [Mon, 23 Aug 2010 08:46:51 +0000 (10:46 +0200)]
iwlagn: queue frames according to context

Frames for different contexts need to be put
on different queues, and multicast after DTIM
frames have a special queue yet which also
depends on the context, so put all this into
the context.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: remove iw_mode check for beacon
Johannes Berg [Mon, 23 Aug 2010 08:46:50 +0000 (10:46 +0200)]
iwlagn: remove iw_mode check for beacon

Since we have the beacon context now, we no
longer need to rely on iw_mode but can check
the beacon context interface's type. However,
that check must be in the work item instead
due to locking constraints (mutex must be
held when dereferencing beacon_ctx pointer).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: detect PAN capability
Johannes Berg [Mon, 23 Aug 2010 08:46:49 +0000 (10:46 +0200)]
iwlagn: detect PAN capability

Detect whether or not the ucode is PAN
capable and adjust the valid contexts
accordingly. To be able to do this, add
the PAN context to the array as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: add PAN API
Johannes Berg [Mon, 23 Aug 2010 08:46:48 +0000 (10:46 +0200)]
iwlwifi: add PAN API

Define the new host commands and notifications
REPLY_WIPAN_PARAMS
REPLY_WIPAN_RXON
REPLY_WIPAN_RXON_TIMING
REPLY_WIPAN_RXON_ASSOC
REPLY_WIPAN_QOS_PARAM
REPLY_WIPAN_WEPKEY
REPLY_WIPAN_P2P_CHANNEL_SWITCH
REPLY_WIPAN_NOA_NOTIFICATION

and their corresponding structures along with the PAN
station flag, the PAN AP sta ID and new dev types for
the second context.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: introduce beacon context
Johannes Berg [Mon, 23 Aug 2010 08:46:47 +0000 (10:46 +0200)]
iwlwifi: introduce beacon context

Only one context can be beaconing at a time,
but we need to track which one. Introduce a
new variable priv->beacon_ctx to do that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: move HT configuration data into context
Johannes Berg [Mon, 23 Aug 2010 08:46:46 +0000 (10:46 +0200)]
iwlwifi: move HT configuration data into context

A lot of HT configuration semantically belongs into
the context, even if right now it will never be
different between contexts. Move it so we're better
prepared for future changes in mac80211.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: add context pointer to station
Johannes Berg [Mon, 23 Aug 2010 08:46:45 +0000 (10:46 +0200)]
iwlwifi: add context pointer to station

Sometimes we only pass around station
pointers but need to find the context
they belong to, so store it in there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: store default station flags in context
Johannes Berg [Mon, 23 Aug 2010 08:46:44 +0000 (10:46 +0200)]
iwlwifi: store default station flags in context

Since the default context is initialised to zero,
and the default flags are zero, no more code is
needed to initialise them right now, but another
context can have different default flags.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: make hw crypto context aware
Johannes Berg [Mon, 23 Aug 2010 08:46:43 +0000 (10:46 +0200)]
iwlwifi: make hw crypto context aware

HW crypto needs to be aware of the context, and there
are different command IDs for the WEP keys per context,
so move the key tracking variables and command IDs into
the context structure.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: move AP sta ID to context
Johannes Berg [Mon, 23 Aug 2010 08:46:42 +0000 (10:46 +0200)]
iwlwifi: move AP sta ID to context

Each context needs to use a different AP sta
ID, so we need to move that into the context
struct instead of hardcoding it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: clamp scanning dwell time to all contexts
Johannes Berg [Mon, 23 Aug 2010 08:46:41 +0000 (10:46 +0200)]
iwlwifi: clamp scanning dwell time to all contexts

The dwell time should at least fit into all
context's beacon intervals.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: move virtual interface pointer into context
Johannes Berg [Mon, 23 Aug 2010 08:46:40 +0000 (10:46 +0200)]
iwlwifi: move virtual interface pointer into context

iwlwifi occasionally needs to find the virtual
interface pointer to give it to mac80211, but right
now it only keeps one. Move it into the context so
that we can keep one pointer each.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: add context into tx descriptor
Johannes Berg [Mon, 23 Aug 2010 08:46:39 +0000 (10:46 +0200)]
iwlwifi: add context into tx descriptor

In status processing we'll need to find the context
for a given frame, so add a context pointer to the
TX info for each frame.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: move QoS into context
Johannes Berg [Mon, 23 Aug 2010 08:46:38 +0000 (10:46 +0200)]
iwlwifi: move QoS into context

Since mac80211 doesn't currently enable/disable
QoS per interface, we can't yet do it properly,
but we can already prepare for it and move the
QoS data and command ID into the context struct.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: contextify command sending
Johannes Berg [Mon, 23 Aug 2010 08:46:37 +0000 (10:46 +0200)]
iwlwifi: contextify command sending

Some commands will have different command IDs
for different contexts, so we need to store
those IDs in the context structure and use
them instead of hardcoding the commands.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: contextify-stations-completely
Johannes Berg [Fri, 27 Aug 2010 15:55:52 +0000 (08:55 -0700)]
iwlwifi: contextify-stations-completely

The microcode tracks stations per context, so
the driver needs to do that as well for adding,
deleting and restoring them, especially in the
implicit removal case when we send an RXON.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: contextify broadcast station
Johannes Berg [Fri, 27 Aug 2010 15:53:46 +0000 (08:53 -0700)]
iwlwifi: contextify broadcast station

The broadcast station ID is per context, so
add a variable for the ID in the context and
use it everywhere we previously hardcoded it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: define PAN queues/FIFOs
Johannes Berg [Mon, 23 Aug 2010 08:46:34 +0000 (10:46 +0200)]
iwlwifi: define PAN queues/FIFOs

PAN capable microcode has a different
queue assignment (not just more queues
for PAN) due to the way multicast is
handled for AP mode.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: prepare for PAN queue/fifo assignment
Johannes Berg [Mon, 23 Aug 2010 08:46:33 +0000 (10:46 +0200)]
iwlwifi: prepare for PAN queue/fifo assignment

PAN ucode will require a different queue assignment,
in particular queue 9 instead of 4 should be used for
commands.

This is required because the ucode will stop/start
queues 4 and 8 depending on the PAN state, since
queue 8 will be used for PAN multicast (after DTIM).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: initial contextification
Johannes Berg [Mon, 23 Aug 2010 08:46:32 +0000 (10:46 +0200)]
iwlwifi: initial contextification

In order to support multiple interfaces, we must move
a lot of data into per-context structures so we can
use the contexts the device offers. To start with,
this makes a lot of code context-aware, more changes
will move more things into the context structure.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agobnx2x: fix wrong return from bnx2x_trylock_hw_lock
Eric Dumazet [Fri, 27 Aug 2010 05:03:53 +0000 (22:03 -0700)]
bnx2x: fix wrong return from bnx2x_trylock_hw_lock

bnx2x_trylock_hw_lock() returns a bool :

true if succeeded to acquire the lock.
false in case of error.

-EINVAL is not an acceptable value, since its promoted to true.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agogro: __napi_gro_receive() optimizations
Eric Dumazet [Fri, 27 Aug 2010 05:03:08 +0000 (22:03 -0700)]
gro: __napi_gro_receive() optimizations

compare_ether_header() can have a special implementation on 64 bit
arches if CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is defined.

__napi_gro_receive() and vlan_gro_common() can avoid a conditional
branch to perform device match.

On x86_64, __napi_gro_receive() has now 38 instructions instead of 53

As gcc-4.4.3 still choose to not inline it, add inline keyword to this
performance critical function.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agostmmac: Make time functionality depend upon RTC_HCTOSYS_DEVICE
David S. Miller [Fri, 27 Aug 2010 03:32:02 +0000 (20:32 -0700)]
stmmac: Make time functionality depend upon RTC_HCTOSYS_DEVICE

Based upon a report by Stephen Rothwell.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: PCI ID addition
Sritej Velaga [Thu, 26 Aug 2010 14:03:05 +0000 (14:03 +0000)]
qlcnic: PCI ID addition

Added PCI ID to board info.

Signed-off-by: Sritej Velaga <sritej.velaga@qlogic.com>
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: Fix driver load issue in FW hang
Anirban Chakraborty [Thu, 26 Aug 2010 14:02:52 +0000 (14:02 +0000)]
qlcnic: Fix driver load issue in FW hang

If there is a FW hang when the driver loads, it can not determine the FW operational
mode. Fix it by checking the FW state first before issuing any FW commands to
determine its capabilities and thereby detecting driver operational mode.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: Fix missing error codes
Sony Chacko [Thu, 26 Aug 2010 14:02:41 +0000 (14:02 +0000)]
qlcnic: Fix missing error codes

In the original code, the error codes returned from some of the functions
are not caught and sent up the caller chain. Fixed it here.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: use scnprintf() to avoid potential buffer overflow
Changli Gao [Tue, 24 Aug 2010 13:32:58 +0000 (13:32 +0000)]
net: use scnprintf() to avoid potential buffer overflow

strlcpy() returns the total length of the string they tried to create, so
we should not use its return value without any check. scnprintf() returns
the number of characters written into @buf not including the trailing '\0',
so use it instead here.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet/sctp: Use pr_fmt and pr_<level>
Joe Perches [Tue, 24 Aug 2010 13:21:08 +0000 (13:21 +0000)]
net/sctp: Use pr_fmt and pr_<level>

Change SCTP_DEBUG_PRINTK and SCTP_DEBUG_PRINTK_IPADDR to
use do { print } while (0) guards.
Add SCTP_DEBUG_PRINTK_CONT to fix errors in log when
lines were continued.
Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Add a missing newline in "Failed bind hash alloc"

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipvs: switch to GFP_KERNEL allocations
Simon Horman [Thu, 26 Aug 2010 02:54:31 +0000 (02:54 +0000)]
ipvs: switch to GFP_KERNEL allocations

Switch from GFP_ATOMIC allocations to GFP_KERNEL ones in
ip_vs_add_service() and ip_vs_new_dest(), as we hold a mutex and are
allowed to sleep in this context.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoIPVS: convert __ip_vs_securetcp_lock to a spinlock
Simon Horman [Thu, 26 Aug 2010 02:54:30 +0000 (02:54 +0000)]
IPVS: convert __ip_vs_securetcp_lock to a spinlock

Also rename __ip_vs_securetcp_lock to ip_vs_securetcp_lock.

Spinlock conversion was suggested by Eric Dumazet.

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoIPVS: convert __ip_vs_sched_lock to a spinlock
Simon Horman [Thu, 26 Aug 2010 02:54:29 +0000 (02:54 +0000)]
IPVS: convert __ip_vs_sched_lock to a spinlock

Also rename __ip_vs_sched_lock to ip_vs_sched_lock.

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoIPVS: ICMPv6 checksum calculation
Simon Horman [Thu, 26 Aug 2010 20:21:26 +0000 (13:21 -0700)]
IPVS: ICMPv6 checksum calculation

Cc: Xiaoyu Du <tingsrain@gmail.com>
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobna: Fixed build break for allyesconfig
Rasesh Mody [Thu, 26 Aug 2010 06:00:27 +0000 (23:00 -0700)]
bna: Fixed build break for allyesconfig

This is the patch to fix the build break caused by multiple
definitions of symbols between Brocade's FC/FCOE driver(BFA)
and 10G Networking Driver(BNA).

Changes are:

1. locally used functions are made static

2. unused functions are removed

3. using unique namespaces for the function names that must be
globally visible

Signed-off-by: Debashis Dutt <ddutt@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agor6040: Free irq line on error path
Denis Kirjanov [Tue, 24 Aug 2010 23:57:55 +0000 (23:57 +0000)]
r6040: Free irq line on error path

Free irq line on error path.

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agos2io: remove lro parameter
Amerigo Wang [Wed, 25 Aug 2010 00:23:39 +0000 (00:23 +0000)]
s2io: remove lro parameter

Remove "lro" parameter of s2io driver.

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: jon.mason@exar.com
Acked-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobe2net: stats for packets received due to internal switching in ASIC.
Ajit Khaparde [Wed, 25 Aug 2010 00:32:56 +0000 (00:32 +0000)]
be2net: stats for packets received due to internal switching in ASIC.

Counters for packets received due to internal switching are already available.
This change will start displaying them in ethtool -S

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobe2net: fix to dynamically generate MAC Address for VFs
Ajit Khaparde [Wed, 25 Aug 2010 00:32:33 +0000 (00:32 +0000)]
be2net: fix to dynamically generate MAC Address for VFs

The BE ASIC/firmware doesnot reserve and assign MAC address for VFs.
This results in the VF interfaces being created with MAC Address 0.
The code change proposed takes the MAC address of PF to generate a seed.
MAC Address for VFs are assigned incrementally starting from the seed.
These addresses are programmed in the ASIC by the PF and the VF driver
queries for the MAC address during its probe.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobridge: avoid ethtool on non running interface
stephen hemminger [Tue, 24 Aug 2010 13:12:56 +0000 (13:12 +0000)]
bridge: avoid ethtool on non running interface

If bridge port is offline, don't call ethtool to query speed.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlge: Fix a deadlock when the interface is going down
Breno Leitao [Tue, 24 Aug 2010 12:50:40 +0000 (12:50 +0000)]
qlge: Fix a deadlock when the interface is going down

Currently qlge can deadlock when the interface is going
down, and the mpi_port_cfg_work() is executing on another
processor. It happens because unregister_netdev() holds
the rtnl lock, and the mpi_port_cfg_work() also request
this lock.

Since unregiter_netdev() may wait mpi_port_cfg_work(), who
also request the holding lock, it can cause an deadlock,
displaying the following error:

 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
 rmmod         D 00000080c6c1d190     0  3993   2081 0x00008080
 Call Trace:
 [c000000975f56ee0] [c0000000000152a0] .__switch_to+0x100/0x1d0
 [c000000975f56f70] [c0000000005781b4] .schedule+0x3a4/0x8c0
 [c000000975f570c0] [c000000000578e8c] .schedule_timeout+0x24c/0x350
 [c000000975f571e0] [c000000000578a88] .wait_for_common+0x198/0x210
 [c000000975f572c0] [c0000000000abbb4] .__cancel_work_timer+0x2c4/0x2e0
 [c000000975f57400] [d0000000078e7a20] .ql_adapter_down+0x80/0x260 [qlge]
 [c000000975f574b0] [d0000000078e7d80] .qlge_close+0x70/0x130 [qlge]
 [c000000975f57540] [c000000000497ef8] .__dev_close+0x98/0xf0
 [c000000975f575d0] [c000000000497f74] .dev_close+0x24/0x60
 [c000000975f57650] [c000000000498080] .rollback_registered_many+0xd0/0x2b0
 [c000000975f576f0] [c000000000498338] .rollback_registered+0x38/0x50
 [c000000975f57780] [c0000000004983d8] .unregister_netdevice_queue+0x88/0xe0
 [c000000975f57810] [c000000000498574] .unregister_netdev+0x24/0x40
 [c000000975f57890] [d0000000078f6f38] .qlge_remove+0x3c/0x78 [qlge]
 [c000000975f57920] [c0000000002d9298] .pci_device_remove+0x48/0x90
 [c000000975f579a0] [c000000000372850] .__device_release_driver+0xa0/0x130
 [c000000975f57a30] [c000000000372a08] .driver_detach+0x128/0x150
 [c000000975f57ad0] [c000000000371134] .bus_remove_driver+0xc4/0x1a0
 [c000000975f57b70] [c00000000037357c] .driver_unregister+0x8c/0xd0
 [c000000975f57c00] [c0000000002d968c] .pci_unregister_driver+0x5c/0x110
 [c000000975f57ca0] [d0000000078f6ee4] .qlge_exit+0x1c/0x34 [qlge]

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobridge: fix locking comment
Stephen Hemminger [Tue, 24 Aug 2010 13:08:10 +0000 (13:08 +0000)]
bridge: fix locking comment

The carrier check is not called from work queue in current code.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet/netfilter/ipvs: Eliminate memory leak
Julia Lawall [Tue, 24 Aug 2010 04:39:49 +0000 (04:39 +0000)]
net/netfilter/ipvs: Eliminate memory leak

__ip_vs_service_get and __ip_vs_svc_fwm_get increment a reference count, so
that reference count should be decremented before leaving the function in an
error case.

A simplified version of the semantic match that finds this problem is:
(http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
local idexpression x;
expression E;
identifier f1;
iterator I;
@@

x = __ip_vs_service_get(...);
<... when != x
     when != true (x == NULL || ...)
     when != if (...) { <+...x...+> }
     when != I (...) { <+...x...+> }
(
 x == NULL
|
 x == E
|
 x->f1
)
...>
* return ...;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net/irda: Eliminate memory leak
Julia Lawall [Tue, 24 Aug 2010 04:38:33 +0000 (04:38 +0000)]
drivers/net/irda: Eliminate memory leak

dev_alloc_skb allocates some memory, so that memory should be freed before
leaving the function in an error case.

Corrected some typos in a nearby comment as well.

A simplified version of the semantic match that finds this problem is:
(http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
local idexpression x;
expression E;
identifier f1;
iterator I;
@@

x = dev_alloc_skb(...);
<... when != x
     when != true (x == NULL || ...)
     when != if (...) { <+...x...+> }
     when != I (...) { <+...x...+> }
(
 x == NULL
|
 x == E
|
 x->f1
)
...>
* return ...;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotyphoon: fix a race in typhoon_do_get_stats
Eric Dumazet [Tue, 24 Aug 2010 04:18:13 +0000 (04:18 +0000)]
typhoon: fix a race in typhoon_do_get_stats

Its important to store 'final' values in counters,
not using them as temporary variables,
or this might break some SNMP applications.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: David Dillow <dave@thedillows.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoplip: remove superflous return
Dan Carpenter [Tue, 24 Aug 2010 02:01:05 +0000 (02:01 +0000)]
plip: remove superflous return

This return isn't reachable and it obscures the goto on the line before.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agostmmac: make ioaddr 'void __iomem *' rather than unsigned long
Giuseppe CAVALLARO [Mon, 23 Aug 2010 20:40:42 +0000 (20:40 +0000)]
stmmac: make ioaddr 'void __iomem *' rather than unsigned long

This avoids unnecessary casting and adds the ioaddr in the
private structure.
This patch also removes many warning when compile the driver.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agostmmac: remove dead option in the driver's Kconfig
Giuseppe CAVALLARO [Mon, 23 Aug 2010 20:40:41 +0000 (20:40 +0000)]
stmmac: remove dead option in the driver's Kconfig

This patch removes the CPU_SUBTYPE_ST40 dependency in the
driver's Kconfig.
In fact, this option has been removed in the commit:
 f96691872439ab2071171d4531c4a95b5d493ae5
as reported by Christian Dietrich.

Note that the driver remains tested on STM platforms, only.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agostmmac: fix_mac_speed is called during 10/100<->1000 speed changes
Pawel Moll [Mon, 23 Aug 2010 20:40:40 +0000 (20:40 +0000)]
stmmac: fix_mac_speed is called during 10/100<->1000 speed changes

This patch modifies the stmmac_adjust_link() function so the
fix_mac_speed() is called not only when link speed is changing
between 10 and 100 Mbps (as required in RMII mode) but also
for 1000 Mbps.

Signed-off-by: Pawel Moll <pawel.moll@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>