]> bbs.cooldavid.org Git - net-next-2.6.git/log
net-next-2.6.git
13 years agoMerge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville...
David S. Miller [Thu, 2 Sep 2010 19:45:44 +0000 (12:45 -0700)]
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6

13 years agobna: fix stats handling
Eric Dumazet [Thu, 2 Sep 2010 19:45:02 +0000 (12:45 -0700)]
bna: fix stats handling

get_stats() method incorrectly clears a global array before folding
various stats. This can break SNMP applications.

Switch to 64 bit flavor to work on a user supplied buffer, and provide
64bit counters even on 32bit arches.

Fix a bug in bnad_netdev_hwstats_fill(), for rx_fifo_errors, missing a
folding (only the last counter was taken into account)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Thu, 2 Sep 2010 17:30:07 +0000 (13:30 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem

13 years agonet: arp: code cleanup
Changli Gao [Thu, 2 Sep 2010 03:56:51 +0000 (03:56 +0000)]
net: arp: code cleanup

Clean the code up according to Documentation/CodingStyle.

Don't initialize the variable dont_send in arp_process().

Remove the temporary varialbe flags in arp_state_to_flags().

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: dev_add_pack() & __dev_remove_pack() changes
Eric Dumazet [Thu, 2 Sep 2010 03:53:46 +0000 (03:53 +0000)]
net: dev_add_pack() & __dev_remove_pack() changes

Add a small helper ptype_head() to get the head to manipulate

dev_add_pack() & __dev_remove_pack() can use a spinlock without
blocking BH, since softirq use RCU, and these functions are run from
process context only.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: Improve comments in include/linux/phy.h
Peter Meerwald [Thu, 2 Sep 2010 04:06:24 +0000 (04:06 +0000)]
net: Improve comments in include/linux/phy.h

Correct state range of PHY bus addresses (i.e. 0-31) in comment,
make spelling of PHY consistent in comments.

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipvs: use pkts for SCTP too
Julian Anastasov [Wed, 1 Sep 2010 22:19:14 +0000 (22:19 +0000)]
ipvs: use pkts for SCTP too

Use correctly the in_pkts packet counter also for SCTP

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 agonet: another last_rx round
Eric Dumazet [Thu, 2 Sep 2010 16:19:32 +0000 (09:19 -0700)]
net: another last_rx round

Kill last_rx use in l2tp and two net drivers

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agostarfire: Temporary kludge to fix powerpc build.
David S. Miller [Thu, 2 Sep 2010 01:35:59 +0000 (18:35 -0700)]
starfire: Temporary kludge to fix powerpc build.

Add a dma_addr_t 64-bit case for powerpc with 64-bit phys addresses.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotcp: update also tcp_output with regard to RFC 5681
Gerrit Renker [Wed, 1 Sep 2010 00:28:35 +0000 (00:28 +0000)]
tcp: update also tcp_output with regard to RFC 5681

Thanks to Ilpo Jarvinen, this updates also the initial window
setting for tcp_output with regard to RFC 5681.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: make rx_queue sysfs_ops const
stephen hemminger [Tue, 31 Aug 2010 12:14:13 +0000 (12:14 +0000)]
net: make rx_queue sysfs_ops const

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agopxa168_eth: remove duplicated #include
Huang Weiyi [Mon, 30 Aug 2010 13:06:20 +0000 (13:06 +0000)]
pxa168_eth: remove duplicated #include

Remove duplicated #include('s) in
  drivers/net/pxa168_eth.c

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agomac80211: only cancel software-based scans on suspend
John W. Linville [Wed, 1 Sep 2010 20:12:28 +0000 (16:12 -0400)]
mac80211: only cancel software-based scans on suspend

Otherwise the hardware scan handler could access an invalid scan request
structure.  The driver should cancel any pending hardware scans during
the suspend process anyway, so also add a warning if the hardware scan
is still pending when the device resumes.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonet: skbuff.c cleanup
Eric Dumazet [Wed, 1 Sep 2010 05:25:10 +0000 (05:25 +0000)]
net: skbuff.c cleanup

(skb->data - skb->head) can be changed by skb_headroom(skb)

Remove some uses of NET_SKBUFF_DATA_USES_OFFSET, using
(skb_end_pointer(skb) - skb->head) or
(skb_tail_pointer(skb) - skb->head) : compiler does the right thing,
and this is more readable for us ;)

(struct skb_shared_info *) casts in pskb_expand_head() to help memcpy()
to use aligned moves.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoskge: add GRO support
Eric Dumazet [Tue, 31 Aug 2010 18:25:32 +0000 (18:25 +0000)]
skge: add GRO support

- napi_gro_flush() is exported from net/core/dev.c, to avoid
  an irq_save/irq_restore in the packet receive path.
- use napi_gro_receive() instead of netif_receive_skb()
- use napi_gro_flush() before calling __napi_complete()
- turn on NETIF_F_GRO by default
- Tested on a Marvell 88E8001 Gigabit NIC

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net/can/mscan/mpc5xxx_can.c: Add of_node_put to avoid memory leak
Julia Lawall [Tue, 31 Aug 2010 07:44:00 +0000 (07:44 +0000)]
drivers/net/can/mscan/mpc5xxx_can.c: Add of_node_put to avoid memory leak

Add a call to of_node_put in the error handling code following a call to
of_find_matching_node.

This patch also moves the existing call to of_node_put after the call to
iounmap in the error handling code, to make it possible to jump to
of_node_put without doing iounmap.  These appear to be disjoint operations,
so the ordering doesn't matter.

This patch furthermore changes the -ENODEV result in the error handling
code for of_find_matching_node to a return of 0, as found in the error
handling code for of_iomap, because the return type of the function is
unsigned.

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

// <smpl>
@r exists@
local idexpression x;
expression E,E1,E2;
statement S;
@@

*x =
(of_find_node_by_path
|of_find_node_by_name
|of_find_node_by_phandle
|of_get_parent
|of_get_next_parent
|of_get_next_child
|of_find_compatible_node
|of_match_node
|of_find_node_by_type
|of_find_node_with_property
|of_find_matching_node
|of_parse_phandle
)(...);
...
if (x == NULL) S
<... when != x = E
*if (...) {
  ... when != of_node_put(x)
      when != if (...) { ... of_node_put(x); ... }
(
  return <+...x...+>;
|
*  return ...;
)
}
...>
(
E2 = x;
|
of_node_put(x);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agons83820: Use helper to disable chip interrupts
Denis Kirjanov [Mon, 30 Aug 2010 21:19:15 +0000 (21:19 +0000)]
ns83820: Use helper to disable chip interrupts

Use helper routine to disable chip interrupts.

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: tunnels should use rcu_dereference
Eric Dumazet [Mon, 30 Aug 2010 11:07:25 +0000 (11:07 +0000)]
net: tunnels should use rcu_dereference

tunnel4_handlers, tunnel64_handlers, tunnel6_handlers and
tunnel46_handlers are protected by RCU, but we dont use appropriate rcu
primitives to scan them. rcu_lock() is already held by caller.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Update version to 1.52.53-5
Yaniv Rosner [Wed, 1 Sep 2010 09:51:37 +0000 (09:51 +0000)]
bnx2x: Update version to 1.52.53-5

Update version to 1.52.53-5

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Add BCM84823 to the supported PHYs
Yaniv Rosner [Wed, 1 Sep 2010 09:51:35 +0000 (09:51 +0000)]
bnx2x: Add BCM84823 to the supported PHYs

Add BCM84823 to the supported PHYs

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Change BCM848xx LED configuration
Yaniv Rosner [Wed, 1 Sep 2010 09:51:33 +0000 (09:51 +0000)]
bnx2x: Change BCM848xx LED configuration

Change 848xx LED configuration according to the new microcode (Boards
were shipped with only with the new microcode)

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Remove unneeded setting of XAUI low power to BCM8727
Yaniv Rosner [Wed, 1 Sep 2010 09:51:30 +0000 (09:51 +0000)]
bnx2x: Remove unneeded setting of XAUI low power to BCM8727

Remove unneeded setting of XAUI low power to BCM8727. This was required
only in older microcode which is not in the field.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Change BCM848xx configuration according to IEEE
Yaniv Rosner [Wed, 1 Sep 2010 09:51:25 +0000 (09:51 +0000)]
bnx2x: Change BCM848xx configuration according to IEEE

Change BCM848xx behavior to fit IEEE such that setting 10Mb/100Mb will
use force speed, and setting 1Gb/10Gb will use auto-negotiation with the
specific speed advertised

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Reset link before any new link settings
Yaniv Rosner [Wed, 1 Sep 2010 09:51:23 +0000 (09:51 +0000)]
bnx2x: Reset link before any new link settings

Reset link before any new link settings to avoid potential link issue
caused by previous link settings

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Fix potential link issue In BCM8727 based boards
Yaniv Rosner [Wed, 1 Sep 2010 09:51:20 +0000 (09:51 +0000)]
bnx2x: Fix potential link issue In BCM8727 based boards

In BCM8727 based boards, setting default 10G link speed after link was
set to 1G may lead to link down issue. The problem was setting the right
value, but to the wrong registers

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Fix potential link issue of BCM8073/BCM8727
Yaniv Rosner [Wed, 1 Sep 2010 09:51:17 +0000 (09:51 +0000)]
bnx2x: Fix potential link issue of BCM8073/BCM8727

Fix potential link issue caused by insufficient delay time during SPIROM
load of BCM8073/BCM8727

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: add cksum flag
Amit Kumar Salecha [Tue, 31 Aug 2010 17:17:53 +0000 (17:17 +0000)]
qlcnic: add cksum flag

o New CKSUM flag added by fw to notify cksum is verified.
o Update version to 5.0.9

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: mac vlan learning support
Amit Kumar Salecha [Tue, 31 Aug 2010 17:17:52 +0000 (17:17 +0000)]
qlcnic: mac vlan learning support

Hypervisor allows, two VM's interfaces to have same mac address.
These VM's interfaces get differentiate with Vlan tag.
This patch add support to learn and configure mac+vlan filter on device.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: support mac learning
Amit Kumar Salecha [Tue, 31 Aug 2010 17:17:51 +0000 (17:17 +0000)]
qlcnic: support mac learning

Device eswitch need to configure with VM's mac address.
Hypervisor doesn't provide any utility/callbacks to get VM's mac address.
Unicast mac address filter improves performance and also provide
packet loopback capability i.e communication between VM.

Above features is by default off, can be turned on with module parameter
'mac_learn'.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: fix mac override capability
Rajesh Borundia [Tue, 31 Aug 2010 17:17:50 +0000 (17:17 +0000)]
qlcnic: fix mac override capability

o Rename mac_learning to mac_override
o Added check in set_mac to return error if mac override is disabled.
o Disabling mac_override only supported for Non priviledged functions.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: fix panic while using eth_hdr
Rajesh Borundia [Tue, 31 Aug 2010 17:17:49 +0000 (17:17 +0000)]
qlcnic: fix panic while using eth_hdr

o skb->mac_header is not set, so machine panics while using function eth_hdr.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: fix mac anti spoof policy
Rajesh Borundia [Tue, 31 Aug 2010 17:17:48 +0000 (17:17 +0000)]
qlcnic: fix mac anti spoof policy

o Allow enabling/disabling mac anti spoof policy only for
  Non privilege functions.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: fix for setting default eswitch config
Rajesh Borundia [Tue, 31 Aug 2010 17:17:47 +0000 (17:17 +0000)]
qlcnic: fix for setting default eswitch config

o Default eswitch config was set, even before eswitch capabilty get detected.
As a result setting default config was getting fail.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: fix mac addr read
Rajesh Borundia [Tue, 31 Aug 2010 17:17:46 +0000 (17:17 +0000)]
qlcnic: fix mac addr read

o Mac addr was read from flash for every fw reset
for Non-priviledge function.It should be read only once.
o Remove unnecessary get_mac_addr callback

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: add api version in reg dump
Rajesh Borundia [Tue, 31 Aug 2010 17:17:45 +0000 (17:17 +0000)]
qlcnic: add api version in reg dump

o ethtool reg version bumped to 2

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: backout firmware initialization update
Sony Chacko [Tue, 31 Aug 2010 17:17:44 +0000 (17:17 +0000)]
qlcnic: backout firmware initialization update

o Backing out "firmware initialization update" changes, commit-id
  "d4066833bb1b35fefb1dd45eb2b10659d46bf151".
o fix heartbit spelling, it should be heartbeat

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agostmmac: Fix another build warning.
David S. Miller [Wed, 1 Sep 2010 03:56:48 +0000 (20:56 -0700)]
stmmac: Fix another build warning.

drivers/net/stmmac/dwmac100_core.c: In function 'dwmac100_dump_mac_regs':
drivers/net/stmmac/dwmac100_core.c:47: 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 agogro: unexport tcp4_gro_receive and tcp4_gro_complete
Eric Dumazet [Tue, 31 Aug 2010 10:23:47 +0000 (10:23 +0000)]
gro: unexport tcp4_gro_receive and tcp4_gro_complete

tcp4_gro_receive() and tcp4_gro_complete() dont need to be exported.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: add a comment on netdev->last_rx
Eric Dumazet [Tue, 31 Aug 2010 07:40:16 +0000 (07:40 +0000)]
net: add a comment on netdev->last_rx

As some driver authors seem to reintroduce dev->last_rx use,
add a comment to strongly discourage this.

Since commit 6cf3f41e6c0 (bonding, net: Move last_rx update into bonding
recv logic), network drivers dont need to update last_rx themselves,
unless they use this field to implement a timeout.

Not updating last_rx helps not dirtying a cache line, improving
performance in SMP.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agopktgen: remove non used variable
Eric Dumazet [Tue, 31 Aug 2010 01:57:35 +0000 (01:57 +0000)]
pktgen: remove non used variable

remove non used variable "queue" in pg_cleanup

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agovlan: Use vlan_dev_real_dev in vlan_hwaccel_do_receive
Jiri Pirko [Tue, 31 Aug 2010 04:58:18 +0000 (04:58 +0000)]
vlan: Use vlan_dev_real_dev in vlan_hwaccel_do_receive

[patch net-next-2.6] vlan: Use vlan_dev_real_dev in vlan_hwaccel_do_receive

Use helper as in other places.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoPhonet: do not set POLLOUT in case of send buffer overflow
Rémi Denis-Courmont [Mon, 30 Aug 2010 12:57:05 +0000 (12:57 +0000)]
Phonet: do not set POLLOUT in case of send buffer overflow

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoPhonet: correct sendmsg() error code from sock_alloc_send_skb()
Rémi Denis-Courmont [Mon, 30 Aug 2010 12:57:04 +0000 (12:57 +0000)]
Phonet: correct sendmsg() error code from sock_alloc_send_skb()

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoPhonet: restore flow control credits when sending fails
Rémi Denis-Courmont [Mon, 30 Aug 2010 12:57:03 +0000 (12:57 +0000)]
Phonet: restore flow control credits when sending fails

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agomac80211: cancel scan in ieee80211_restart_hw if software scan pending
John W. Linville [Mon, 30 Aug 2010 19:12:02 +0000 (15:12 -0400)]
mac80211: cancel scan in ieee80211_restart_hw if software scan pending

This function exists to clean-up after a hardware error or something
similar.  The restart is accomplished using the same infrastructure used
to resume after a suspend.  The suspend path cancels running scans, so
it seems appropriate to do that here as well for software-based scans.
If a hardware-based scan is pending, issue a warning message since this
indicates that the drivers has failed to clean-up after itself.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Cleanup rt2x00usb_watchdog_reset_tx
Ivo van Doorn [Mon, 30 Aug 2010 19:15:51 +0000 (21:15 +0200)]
rt2x00: Cleanup rt2x00usb_watchdog_reset_tx

rt2x00usb_watchdog_reset_tx performs the same task
as rt2x00usb_kill_tx_queue, with the only difference
is that it waits for all entries to be returned to
the driver and for all frames the status has been
reported to mac80211.

We can easily split this task by calling rt2x00usb_kill_tx_queue,
sleep for a short period and invoke the TX status reporting
function. By adding the sleep() to the kill_entry we make sure
that even during shutdown we guarentee the entry has been killed when
the function returns. To make this work correctly the interrupt
handlers have to be updated to prevent checking for the RADIO_ENABLED
flag too early which prevents the ownership of the entry to be reset.
Additionally a check for the DEVICE_PRESENT flag is not required but
is nice to prevent race conditions when the device was unplugged.

Additionally rather then calling rt2x00usb_work_txdone() for
status reporting we let the driver perform the TX status reporting
first. If this is not sufficient then rt2x00usb_work_txdone() will
still be used to cleanup the mess.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Split watchdog check into a DMA and STATUS timeout
Ivo van Doorn [Mon, 30 Aug 2010 19:15:19 +0000 (21:15 +0200)]
rt2x00: Split watchdog check into a DMA and STATUS timeout

The watchdog for rt2800usb triggers frequently causing all URB's
to be canceled often enough to interrupt the normal TX flow.
More research indicated that not the URB upload to the USB host
were hanging, but instead the TX status reports.

To correctly detect what is going on, we introduce Q_INDEX_DMA_DONE
which is an index counter between Q_INDEX_DONE and Q_INDEX and indicates
if the frame has been transfered to the device.

This also requires the rt2x00queue timeout functions to be updated
to differentiate between a DMA timeout (time between Q_INDEX and
Q_INDEX_DMA_DONE timeout) and a STATUS timeout (time between
Q_INDEX_DMA_DONE and Q_INDEX_DONE timeout)

All Q_INDEX_DMA_DONE code was taken from the RFC from
Helmut Schaa <helmut.schaa@googlemail.com> for the implementation
for watchdog for rt2800pci.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Correctly kill beacon queue
Ivo van Doorn [Mon, 30 Aug 2010 19:14:56 +0000 (21:14 +0200)]
rt2x00: Correctly kill beacon queue

USB devices upload their beacon and then automatically send
it out every beacon interval. However when killing a TX queue
we only kill the URB and not the actual transmission of the beacon.

This will reset the Beacon register to prevent any beacons from
being transmitted.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Set PWR_PIN_CFG during initialization
Ivo van Doorn [Mon, 30 Aug 2010 19:14:38 +0000 (21:14 +0200)]
rt2x00: Set PWR_PIN_CFG during initialization

Add PWR_PIN_CFG initialization for rt2800usb at the same point
as rt2800pci.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Don't set unicast/BSSID masks when clearning MAC or BSSID
Ivo van Doorn [Mon, 30 Aug 2010 19:14:15 +0000 (21:14 +0200)]
rt2x00: Don't set unicast/BSSID masks when clearning MAC or BSSID

When configuring the MAC_ADDR or MAC_BSSID with an empty address,
the UNICAST_TO_ME_MASK and BSS_ID_MASK must also be reset to prevent
invalid interpretation of the addresses.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Wakeup hardware before loading firmware
Ivo van Doorn [Mon, 30 Aug 2010 19:13:54 +0000 (21:13 +0200)]
rt2x00: Wakeup hardware before loading firmware

According to the legacy drivers the AUTOWAKEUP_CFG
register must be reset to 0 before loading the firmware.

Instead of during rt2800{pci,usb}_write_firmware it
must actually be done in rt2800_load_firmware() before
resetting the WPDMA_GLO_CFG and PWR_PIN_CFG registers.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Validate TX status results with current data entry
Ivo van Doorn [Mon, 30 Aug 2010 19:13:30 +0000 (21:13 +0200)]
rt2x00: Validate TX status results with current data entry

Instead of printing a warning when the PID, ACK, or WCID of
an entry don't match the TX status report, we should skip the
entry to search for the entry which actually does match
the TX status data.

This reduces the number of watchdog errors on the TX queues
for rt2800usb, and seems to improve the reliability of the
TX flow a bit.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Add rt2800_wait_csr_ready
Ivo van Doorn [Mon, 30 Aug 2010 19:13:08 +0000 (21:13 +0200)]
rt2x00: Add rt2800_wait_csr_ready

Similar to rt2800_wait_wpdma_ready() we can add a
function to waiting until the CSR is ready. This
centralizes some additional code into rt2800lib.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Update rt2800 comments regarding AMPDU and PACKET_ID in TXWI
Helmut Schaa [Mon, 30 Aug 2010 19:12:47 +0000 (21:12 +0200)]
rt2x00: Update rt2800 comments regarding AMPDU and PACKET_ID in TXWI

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Rename txentry_desc.queue -> txentry_desc.qid
Helmut Schaa [Mon, 30 Aug 2010 19:12:24 +0000 (21:12 +0200)]
rt2x00: Rename txentry_desc.queue -> txentry_desc.qid

Variables containing queue ids are called qid everywhere else, hence
rename the queue field in txentry_desc to qid as well.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
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.kernel.org/pub/scm/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>