pandora-kernel.git
13 years agoipv6: RCU changes in ipv6_get_mtu() and ip6_dst_hoplimit()
Eric Dumazet [Mon, 14 Jun 2010 04:46:20 +0000 (04:46 +0000)]
ipv6: RCU changes in ipv6_get_mtu() and ip6_dst_hoplimit()

Use RCU to avoid atomic ops on idev refcnt in ipv6_get_mtu()
and ip6_dst_hoplimit()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv6: avoid two atomics in ipv6_rthdr_rcv()
Eric Dumazet [Mon, 14 Jun 2010 04:39:27 +0000 (04:39 +0000)]
ipv6: avoid two atomics in ipv6_rthdr_rcv()

Use __in6_dev_get() instead of in6_dev_get()/in6_dev_put()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool: Revert incorrect indentation changes
Ben Hutchings [Mon, 14 Jun 2010 08:53:26 +0000 (08:53 +0000)]
ethtool: Revert incorrect indentation changes

commit 97f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6 "net: fix ethtool
coding style errors and warnings" changed the indentation of several
macro definitions in ethtool.h.  These definitions line up in the diff
where there is an extra character at the start of each line, but not
in the resulting file.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Tue, 15 Jun 2010 05:59:34 +0000 (22:59 -0700)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

Conflicts:
drivers/net/ixgbe/ixgbe_ethtool.c

With merge conflict help from Stephen Rothwell.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agomac80211: Fix circular locking dependency in ARP filter handling
Juuso Oikarinen [Wed, 9 Jun 2010 10:43:26 +0000 (13:43 +0300)]
mac80211: Fix circular locking dependency in ARP filter handling

There is a circular locking dependency when configuring the
hardware ARP filters on association, occurring when flushing the mac80211
workqueue. This is what happens:

[   92.026800] =======================================================
[   92.030507] [ INFO: possible circular locking dependency detected ]
[   92.030507] 2.6.34-04781-g2b2c009 #85
[   92.030507] -------------------------------------------------------
[   92.030507] modprobe/5225 is trying to acquire lock:
[   92.030507]  ((wiphy_name(local->hw.wiphy))){+.+.+.}, at: [<ffffffff8105b5c0>] flush_workq
ueue+0x0/0xb0
[   92.030507]
[   92.030507] but task is already holding lock:
[   92.030507]  (rtnl_mutex){+.+.+.}, at: [<ffffffff812b9ce2>] rtnl_lock+0x12/0x20
[   92.030507]
[   92.030507] which lock already depends on the new lock.
[   92.030507]
[   92.030507]
[   92.030507] the existing dependency chain (in reverse order) is:
[   92.030507]
[   92.030507] -> #2 (rtnl_mutex){+.+.+.}:
[   92.030507]        [<ffffffff810761fb>] lock_acquire+0xdb/0x110
[   92.030507]        [<ffffffff81341754>] mutex_lock_nested+0x44/0x300
[   92.030507]        [<ffffffff812b9ce2>] rtnl_lock+0x12/0x20
[   92.030507]        [<ffffffffa022d47c>] ieee80211_assoc_done+0x6c/0xe0 [mac80211]
[   92.030507]        [<ffffffffa022f2ad>] ieee80211_work_work+0x31d/0x1280 [mac80211]

[   92.030507] -> #1 ((&local->work_work)){+.+.+.}:
[   92.030507]        [<ffffffff810761fb>] lock_acquire+0xdb/0x110
[   92.030507]        [<ffffffff8105a51a>] worker_thread+0x22a/0x370
[   92.030507]        [<ffffffff8105ecc6>] kthread+0x96/0xb0
[   92.030507]        [<ffffffff81003a94>] kernel_thread_helper+0x4/0x10
[   92.030507]
[   92.030507] -> #0 ((wiphy_name(local->hw.wiphy))){+.+.+.}:
[   92.030507]        [<ffffffff81075fdc>] __lock_acquire+0x1c0c/0x1d50
[   92.030507]        [<ffffffff810761fb>] lock_acquire+0xdb/0x110
[   92.030507]        [<ffffffff8105b60e>] flush_workqueue+0x4e/0xb0
[   92.030507]        [<ffffffffa023ff7b>] ieee80211_stop_device+0x2b/0xb0 [mac80211]
[   92.030507]        [<ffffffffa0231635>] ieee80211_stop+0x3e5/0x680 [mac80211]

The locking in this case is quite complex. Fix the problem by rewriting the
way the hardware ARP filter list is handled - i.e. make a copy of the address
list to the bss_conf struct, and provide that list to the hardware driver
when needed.

The current patch will enable filtering also in promiscuous mode. This may need
to be changed in the future.

Reported-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: remove BSS from cfg80211 list when leaving IBSS
Teemu Paasikivi [Mon, 14 Jun 2010 09:55:33 +0000 (12:55 +0300)]
mac80211: remove BSS from cfg80211 list when leaving IBSS

Remove BSS from cfg80211 BSS list if we are only member in IBSS when
leaving it.

Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Set changed basic rates flag
Teemu Paasikivi [Mon, 14 Jun 2010 09:55:32 +0000 (12:55 +0300)]
mac80211: Set changed basic rates flag

Add changed basic rates flag to bss_changed while joinig ibss network.

This patch is split from the patch containing support for setting basic
rates when creating ibss network. Original patch was posted by Johannes
Berg on the linux-wireless posting list.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Set basic rates while joining ibss network
Teemu Paasikivi [Mon, 14 Jun 2010 09:55:31 +0000 (12:55 +0300)]
mac80211: Set basic rates while joining ibss network

This patch adds support to nl80211 and mac80211 to set basic rates when
joining/creating ibss network.

Original patch was posted by Johannes Berg on the linux-wireless posting list.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: remove ATH9K_CAP_DS
Felix Fietkau [Sat, 12 Jun 2010 15:22:34 +0000 (17:22 +0200)]
ath9k_hw: remove ATH9K_CAP_DS

This capability check is no longer used, so it can be removed along with
the now-obsolete ath9k_hw_getcapability function.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k/ath9k_htc: remove redundand checks for dual-stream tx support
Felix Fietkau [Sat, 12 Jun 2010 15:22:33 +0000 (17:22 +0200)]
ath9k/ath9k_htc: remove redundand checks for dual-stream tx support

mac80211 already masks the HT sta capabilities based on hardware support

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: remove ATH9K_CAP_MCAST_KEYSRCH
Felix Fietkau [Sat, 12 Jun 2010 15:22:32 +0000 (17:22 +0200)]
ath9k_hw: remove ATH9K_CAP_MCAST_KEYSRCH

The driver always sets this to enabled, but this can be simplified with
a small change to ah->sta_id1_defaults instead.
This change also removes the now-obsolete ath9k_hw_setcapability function.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: remove ATH9K_CAP_TKIP_SPLIT
Felix Fietkau [Sat, 12 Jun 2010 15:22:31 +0000 (17:22 +0200)]
ath9k_hw: remove ATH9K_CAP_TKIP_SPLIT

This is only used as a workaround for an issue in one specific hw revision.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: remove ATH9K_CAP_TKIP_MIC
Felix Fietkau [Sat, 12 Jun 2010 15:22:30 +0000 (17:22 +0200)]
ath9k_hw: remove ATH9K_CAP_TKIP_MIC

TKIP MIC support is always enabled anyway.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: remove ATH9K_CAP_TXPOW
Felix Fietkau [Sat, 12 Jun 2010 15:22:29 +0000 (17:22 +0200)]
ath9k_hw: remove ATH9K_CAP_TXPOW

replace calls that read this capability with accesses to ath9k_hw's
regulatory data.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: remove ATH9K_CAP_CIPHER
Felix Fietkau [Sat, 12 Jun 2010 15:22:28 +0000 (17:22 +0200)]
ath9k_hw: remove ATH9K_CAP_CIPHER

All of the ciphers that are tested for are always supported

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: enable AR9003 PCI IDs
Luis R. Rodriguez [Sat, 12 Jun 2010 04:34:02 +0000 (00:34 -0400)]
ath9k: enable AR9003 PCI IDs

All AR9003 features are now complete so enable AR9003
support.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: implement PA predistortion support
Felix Fietkau [Sat, 12 Jun 2010 04:34:01 +0000 (00:34 -0400)]
ath9k: implement PA predistortion support

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: add functions for controlling PA predistortion calibration
Felix Fietkau [Sat, 12 Jun 2010 04:34:00 +0000 (00:34 -0400)]
ath9k_hw: add functions for controlling PA predistortion calibration

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: add support for parsing PA predistortion related EEPROM fields
Felix Fietkau [Sat, 12 Jun 2010 04:33:59 +0000 (00:33 -0400)]
ath9k_hw: add support for parsing PA predistortion related EEPROM fields

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: add register definitions related to PA predistortion
Felix Fietkau [Sat, 12 Jun 2010 04:33:58 +0000 (00:33 -0400)]
ath9k_hw: add register definitions related to PA predistortion

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: remove a useless function for setting the mac address
Felix Fietkau [Sat, 12 Jun 2010 04:33:57 +0000 (00:33 -0400)]
ath9k_hw: remove a useless function for setting the mac address

ath9k_hw_setmac() only copies the mac address it is called with into
common->macaddr, yet in all call sites, the supplied mac address pointer
is already common->macaddr.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: add a debugfs entry for ignoring CCA on the extension channel in HT40
Felix Fietkau [Sat, 12 Jun 2010 04:33:56 +0000 (00:33 -0400)]
ath9k: add a debugfs entry for ignoring CCA on the extension channel in HT40

Debugfs requires a u32 for bool knobs though so we turn the
ath9k_hw knob into a u32 as well.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix queue stopping threshold
Felix Fietkau [Sat, 12 Jun 2010 04:33:55 +0000 (00:33 -0400)]
ath9k: fix queue stopping threshold

ath9k tries to prevent WMM queue tx buffer starvation caused by
traffic on different queues by limiting the number of pending frames
in a tx queue (tracked in the ath_buf structure). This had a leak
issue, because the a skb can be reassigned to a different ath_buf
in the tx path, causing the pending frame counter to become inaccurate.

To fix this, track the number of frames in an array in the softc,
using the mac80211 queue mapping as index.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix extending the rx timestamp with the hardware TSF
Felix Fietkau [Sat, 12 Jun 2010 04:33:54 +0000 (00:33 -0400)]
ath9k: fix extending the rx timestamp with the hardware TSF

AR5416 and all newer chipsets use a 32 bit rx timestamp, so there
is no need to keep the 15 bit timestamp extending logic around.

This patch removes ath9k_hw_extend_tsf (replaced by a call to
ath9k_hw_gettsf64), and reduces the frequency of TSF reads, which
can improve performance in some cases.

This change also has the side effect of making rx timestamps
more accurate.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: make ath_get_hal_qnum static
Felix Fietkau [Sat, 12 Jun 2010 04:33:53 +0000 (00:33 -0400)]
ath9k: make ath_get_hal_qnum static

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: remove declarations of some nonexistant functions
Felix Fietkau [Sat, 12 Jun 2010 04:33:52 +0000 (00:33 -0400)]
ath9k: remove declarations of some nonexistant functions

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: remove duplicate WMM AC definitions
Felix Fietkau [Sat, 12 Jun 2010 04:33:51 +0000 (00:33 -0400)]
ath9k: remove duplicate WMM AC definitions

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: use common WMM AC definitions instead of ath9k ones
Felix Fietkau [Sat, 12 Jun 2010 04:33:50 +0000 (00:33 -0400)]
ath9k_htc: use common WMM AC definitions instead of ath9k ones

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix mac80211 queue lookup for waking up queues
Felix Fietkau [Sat, 12 Jun 2010 04:33:49 +0000 (00:33 -0400)]
ath9k: fix mac80211 queue lookup for waking up queues

ath_get_mac80211_qnum() expects the queue 'subtype'
(internal ID for the WMM AC) as argument when looking up
the mac80211 queue, however ath_wake_mac80211_queue provides
txq->axq_qnum instead, which contains the hardware queue
number. Fix this by keeping track of the WMM class ID in
the txq data structure.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: update 5 GHz tx gain tables for femless and high power PA
Luis R. Rodriguez [Sat, 12 Jun 2010 04:33:48 +0000 (00:33 -0400)]
ath9k_hw: update 5 GHz tx gain tables for femless and high power PA

This updates the initvals for AR9003 to adjust the 5 GHz tx gain
tables for femless and high power PA.

References:

Osprey 2.0 header file ver 72
Osprey 2.2 header file ver 20

Checksums:

$ ./initvals -f ar9003-2p0
0x00000000c2bfa7d5        ar9300_2p0_radio_postamble
0x00000000ada2b114        ar9300Modes_lowest_ob_db_tx_gain_table_2p0
0x00000000e0bc2c84        ar9300Modes_fast_clock_2p0
0x00000000056eaf74        ar9300_2p0_radio_core
0x0000000000000000        ar9300Common_rx_gain_table_merlin_2p0
0x0000000078658fb5        ar9300_2p0_mac_postamble
0x0000000023235333        ar9300_2p0_soc_postamble
0x0000000054d41904        ar9200_merlin_2p0_radio_core
0x00000000748572cf        ar9300_2p0_baseband_postamble
0x000000009aa5a0a4        ar9300_2p0_baseband_core
0x000000003dffa526        ar9300Modes_high_power_tx_gain_table_2p0
0x000000001cfda724        ar9300Modes_high_ob_db_tx_gain_table_2p0
0x0000000011302700        ar9300Common_rx_gain_table_2p0
0x00000000e3eab114        ar9300Modes_low_ob_db_tx_gain_table_2p0
0x00000000c9d66d40        ar9300_2p0_mac_core
0x000000001e1d0800        ar9300Common_wo_xlna_rx_gain_table_2p0
0x00000000a0c54980        ar9300_2p0_soc_preamble
0x00000000292e2544        ar9300PciePhy_pll_on_clkreq_disable_L1_2p0
0x000000002d3e2544        ar9300PciePhy_clkreq_enable_L1_2p0
0x00000000293e2544        ar9300PciePhy_clkreq_disable_L1_2p0

$ ./initvals -f ar9003-2p2
0x00000000c2bfa7d5        ar9300_2p2_radio_postamble
0x00000000ada2b114        ar9300Modes_lowest_ob_db_tx_gain_table_2p2
0x00000000e0bc2c84        ar9300Modes_fast_clock_2p2
0x00000000056eaf74        ar9300_2p2_radio_core
0x0000000000000000        ar9300Common_rx_gain_table_merlin_2p2
0x0000000078658fb5        ar9300_2p2_mac_postamble
0x0000000023235333        ar9300_2p2_soc_postamble
0x0000000054d41904        ar9200_merlin_2p2_radio_core
0x000000008475a084        ar9300_2p2_baseband_postamble
0x000000009aaafd90        ar9300_2p2_baseband_core
0x000000003dffa526        ar9300Modes_high_power_tx_gain_table_2p2
0x000000001cfda724        ar9300Modes_high_ob_db_tx_gain_table_2p2
0x0000000011302700        ar9300Common_rx_gain_table_2p2
0x00000000a9a2b114        ar9300Modes_low_ob_db_tx_gain_table_2p2
0x00000000a9d66d40        ar9300_2p2_mac_core
0x000000001e1d0800        ar9300Common_wo_xlna_rx_gain_table_2p2
0x00000000a0c531c8        ar9300_2p2_soc_preamble
0x00000000292e2544        ar9300PciePhy_pll_on_clkreq_disable_L1_2p2
0x000000002d3e2544        ar9300PciePhy_clkreq_enable_L1_2p2
0x00000000293e2544        ar9300PciePhy_clkreq_disable_L1_2p2

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: reduce delay on programming INI on AR9003
Luis R. Rodriguez [Sat, 12 Jun 2010 04:33:47 +0000 (00:33 -0400)]
ath9k_hw: reduce delay on programming INI on AR9003

All AR9003 devices are PCI-E only, the extra delay here
is not required and only reduces the delay for loading
the initial register values by at least 14ms.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: enable ANI for AR9003
Luis R. Rodriguez [Sat, 12 Jun 2010 04:33:46 +0000 (00:33 -0400)]
ath9k_hw: enable ANI for AR9003

AR9003 has been tested with the new ANI implementation
and so ANI can now be enabled for that family.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: add new ANI implementation for AR9003
Luis R. Rodriguez [Sat, 12 Jun 2010 04:33:45 +0000 (00:33 -0400)]
ath9k: add new ANI implementation for AR9003

This adds support for ANI for AR9003. The implementation for
ANI for AR9003 is slightly different than the one used for
the older chipset families. It can technically be used for
the older families as well but this is not yet fully tested
so we only enable the new ANI for the AR5008, AR9001 and AR9002
families with a module parameter, force_new_ani.

The old ANI implementation is left intact.

Details of the new ANI implemention:

  * ANI adjustment logic is now table driven so that each ANI level
    setting is parameterized. This makes adjustments much more
    deterministic than the old procedure based logic and allows
    adjustments to be made incrementally to several parameters per
    level.

  * ANI register settings are now relative to INI values; so ANI
    param zero level == INI value. Appropriate floor and ceiling
    values are obeyed when adjustments are combined with INI values.

  * ANI processing is done once per second rather that every 100ms.
    The poll interval is now a set upon hardware initialization and
    can be picked up by the core driver.

  * OFDM error and CCK error processing are made in a round robin
    fashion rather than allowing all OFDM adjustments to be made
    before CCK adjustments.

  * ANI adjusts MRC CCK off in the presence of high CCK errors

  * When adjusting spur immunity (SI) and OFDM weak signal detection,
    ANI now sets register values for the extension channel too

  * When adjusting FIR step (ST), ANI now sets register for FIR step
    low too

  * FIR step adjustments now allow for an extra level of immunity for
    extremely noisy environments

  * The old Noise immunity setting (NI), which changes coarse low, size
    desired, etc have been removed. Changing these settings could affect
    up RIFS RX as well.

  * CCK weak signal adjustment is no longer used

  * ANI no longer enables phy error interrupts; in all cases phy hw
    counting registers are used instead

  * The phy error count (overflow) interrupts are also no longer used
    for ANI adjustments. All ANI adjustments are made via the polling
    routine and no adjustments are possible in the ISR context anymore

  * A history settings buffer is now correctly used for each channel;
    channel settings are initialized with the defaults but later
    changes are restored when returning back to that channel

  * When scanning, ANI is disabled settings are returned to (INI) defaults.

  * OFDM phy error thresholds are now 400 & 1000 (errors/second units) for
    low/high water marks, providing increased stability/hysteresis when
    changing levels.

  * Similarly CCK phy error thresholds are now 300 & 600 (errors/second)

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: inform ANI calibration when scanning
Luis R. Rodriguez [Sat, 12 Jun 2010 04:33:44 +0000 (00:33 -0400)]
ath9k_hw: inform ANI calibration when scanning

The new ANI implementation will use this to skip ANI
calibration upon a scan. This cannot be ported to the
older ANI implementation unless default ANI values from
the ANI are also used upon a scan. This is essentially
what one of the things thenew ANI does.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: add register definitions for the new ANI
Luis R. Rodriguez [Sat, 12 Jun 2010 04:33:43 +0000 (00:33 -0400)]
ath9k_hw: add register definitions for the new ANI

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: allow for spliting up ANI operations by family
Luis R. Rodriguez [Sat, 12 Jun 2010 04:33:42 +0000 (00:33 -0400)]
ath9k_hw: allow for spliting up ANI operations by family

The AR9003 hardware family will use a slightly modified ANI
implementation which has not yet been tested on the other hardware
families. To allow for this new ANI implementation a few ANI
calls need to be abstracted away. This patch just allows for
each hardware family to declare their own ANI ops and annotates
the current ANI implementation as old.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: clear MIB interrupt causes when skipping ANI adjustments
Luis R. Rodriguez [Sat, 12 Jun 2010 04:33:41 +0000 (00:33 -0400)]
ath9k_hw: clear MIB interrupt causes when skipping ANI adjustments

We get an MIB interrupt when we hit certain PHY error counter
thresholds. If ANI is disabled but the MIB interrupt is enabled
we'll keep around the old MIB interrupt causes.

Since ath9k disables the MIB interrupt when ANI is disabled
this is not a fix, but more of a sanity fix in case we ever
need the MIB interrupt enabled but disabling ANI.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: fix clock rate calculations for ANI
Luis R. Rodriguez [Sat, 12 Jun 2010 04:33:40 +0000 (00:33 -0400)]
ath9k_hw: fix clock rate calculations for ANI

The clock rate was assumed to be static but it actually
changes depending on the mode of operation, correct this
to help improve the calcuation of the listenTime for ANI.
This change will help adjust ANI more accurately on different
PHY thresholds.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: move clock definitions from hw.c to hw.h
Luis R. Rodriguez [Sat, 12 Jun 2010 04:33:39 +0000 (00:33 -0400)]
ath9k_hw: move clock definitions from hw.c to hw.h

These will be used by the ANI code next.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: bracket driver tracing
Johannes Berg [Thu, 10 Jun 2010 08:56:20 +0000 (10:56 +0200)]
mac80211: bracket driver tracing

Currently, driver tracing is sometimes invoked
after and sometimes before the actual driver
callback. This is fine as long as the driver
has no tracing itself, but as soon as it does
it gets confusing.

To make traces containing such information
easier to read, introduce a return tracer in
mac80211 that essentially brackets any driver
tracing, and invoke the real trace before the
driver's callback, only showing the return
value, if any, afterwards.

Since tracing records the process, there's no
problem with overlapping calls if that should
happen.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: fix mgmt frame accounting
Johannes Berg [Thu, 10 Jun 2010 08:21:51 +0000 (10:21 +0200)]
mac80211: fix mgmt frame accounting

The recent change to processing action frames from
the management frame queue had already broken action
frame accounting, and my rework didn't help either.
So add back accounting and simplify the code with a
label rather than duplicating it, and also add
accounting for management frames.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: update aggregation documentation
Johannes Berg [Thu, 10 Jun 2010 08:21:50 +0000 (10:21 +0200)]
mac80211: update aggregation documentation

Even before the recent changes, the documentation
for TX aggregation was somewhat out of date. Update
it and also add documentation for the RX side.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: allow drivers to sleep in ampdu_action
Johannes Berg [Thu, 10 Jun 2010 08:21:49 +0000 (10:21 +0200)]
mac80211: allow drivers to sleep in ampdu_action

Allow drivers to sleep, and indicate this in
the documentation. ath9k has some locking I
don't understand, so keep it safe and disable
BHs in it, all other drivers look fine with
the context change.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: change TX aggregation locking
Johannes Berg [Thu, 10 Jun 2010 08:21:48 +0000 (10:21 +0200)]
mac80211: change TX aggregation locking

To prepare for allowing drivers to sleep in
ampdu_action, change the locking in the TX
aggregation code to use the mutex the RX part
already uses. The spinlock is still necessary
around some code to avoid races with TX, but
now we can also synchronize_net() to avoid
getting an inconsistent sequence number.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: defer TX agg session teardown to work
Johannes Berg [Thu, 10 Jun 2010 08:21:47 +0000 (10:21 +0200)]
mac80211: defer TX agg session teardown to work

Since we want the code to be able to sleep
in the future, it must not be called from
the timer directly. To achieve that, simply
call the function drivers would call, and
also use RCU in the timer to get the struct
so we don't need to rely on the spinlock in
the future.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: change RX aggregation locking
Johannes Berg [Thu, 10 Jun 2010 08:21:46 +0000 (10:21 +0200)]
mac80211: change RX aggregation locking

To prepare for allowing drivers to sleep in
ampdu_action, change the locking in the RX
aggregation code to use a mutex, so that it
would already allow drivers to sleep. But
explicitly disable BHs around the callback
for now since the TX part cannot yet sleep,
and drivers' locking might require it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: fix RX aggregation timer
Johannes Berg [Thu, 10 Jun 2010 08:21:45 +0000 (10:21 +0200)]
mac80211: fix RX aggregation timer

I noticed that when there was _no_ traffic at
all on a given aggregation session, it would
never time out. This won't happen unless you
forced creating a session, but fix it anyway.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: defer RX agg session teardown to work
Johannes Berg [Thu, 10 Jun 2010 08:21:44 +0000 (10:21 +0200)]
mac80211: defer RX agg session teardown to work

Since we want the code to be able to sleep
in the future, it must not be called from
the timer directly. To prepare, move it out
into the aggregation work.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: move BA session work
Johannes Berg [Thu, 10 Jun 2010 08:21:43 +0000 (10:21 +0200)]
mac80211: move BA session work

Move the block-ack session works into common
code, since it will be needed for RX agg too
in the next patches.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: make TX aggregation start/stop request async
Johannes Berg [Thu, 10 Jun 2010 08:21:42 +0000 (10:21 +0200)]
mac80211: make TX aggregation start/stop request async

When the driver or rate control requests starting
or stopping an aggregation session, that currently
causes a direct callback into the driver, which
could potentially cause locking problems. Also,
the functions need to be callable from contexts
that cannot sleep, and thus will interfere with
making the ampdu_action callback sleeping.

To address these issues, add a new work item for
each station that will process any start or stop
requests out of line.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: refcount aggregation queue stop
Johannes Berg [Thu, 10 Jun 2010 08:21:41 +0000 (10:21 +0200)]
mac80211: refcount aggregation queue stop

mac80211 currently maintains the ampdu_lock to
avoid starting a queue due to one aggregation
session while another aggregation session needs
the queue stopped.

We can do better, however, and instead refcount
the queue stops for this particular purpose,
thus removing the need for the lock. This will
help making ampdu_action able to sleep.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: remove non-irqsafe aggregation callbacks
Johannes Berg [Thu, 10 Jun 2010 08:21:40 +0000 (10:21 +0200)]
mac80211: remove non-irqsafe aggregation callbacks

The non-irqsafe aggregation start/stop done
callbacks are currently only used by ath9k_htc,
and can cause callbacks into the driver again.
This might lead to locking issues, which will
only get worse as we modify locking. To avoid
trouble, remove the non-irqsafe versions and
change ath9k_htc to use those instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: use RCU for TX aggregation
Johannes Berg [Thu, 10 Jun 2010 08:21:39 +0000 (10:21 +0200)]
mac80211: use RCU for TX aggregation

Currently we allocate some memory for each TX
aggregation session and additionally keep a
state bitmap indicating the state it is in.
By using RCU to protect the pointer, moving
the state into the structure and some locking
trickery we can avoid locking when the TX agg
session is fully operational.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: use RCU for RX aggregation
Johannes Berg [Thu, 10 Jun 2010 08:21:38 +0000 (10:21 +0200)]
mac80211: use RCU for RX aggregation

Currently we allocate some memory for each RX
aggregation session and additionally keep a
flag indicating whether or not it is valid.
By using RCU to protect the pointer and making
sure that the memory is fully set up before it
becomes visible to the RX path, we can remove
the need for the bool that indicates validity,
as well as for locking on the RX path since it
is always synchronised against itself, and we
can guarantee that all other modifications are
done when the structure is not visible to the
RX path.

The net result is that since we remove locking
requirements from the RX path, we can in the
future use any kind of lock for the setup and
teardown code paths.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: move aggregation callback processing
Johannes Berg [Thu, 10 Jun 2010 08:21:37 +0000 (10:21 +0200)]
mac80211: move aggregation callback processing

This moves the aggregation callback processing
to the per-sdata skb queue and a work function
rather than the tasklet.

Unfortunately, this means that it extends the
pkt_type hack to that skb queue. However, it
will enable making ampdu_action API changes
gradually, my current plan is to get rid of
this again by forcing drivers to only return
from ampdu_action() when everything is done,
thus removing the callbacks completely.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: move blockack stop due to fragmentation
Johannes Berg [Thu, 10 Jun 2010 08:21:36 +0000 (10:21 +0200)]
mac80211: move blockack stop due to fragmentation

There's a corner case where we receive a fragmented
frame during a blockack session, in which case we
will terminate that session. To simplify future work
in this area that will culminate in allowing the
driver callbacks for aggregation to sleep, move the
processing of this case out of the RX path into the
interface work.

This will simplify future work because the new place
for this code doesn't require that the function will
always be atomic, which the RX path needs.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: always process blockack action from workqueue
Johannes Berg [Thu, 10 Jun 2010 08:21:35 +0000 (10:21 +0200)]
mac80211: always process blockack action from workqueue

To prepare for making the ampdu_action callback
sleep, make mac80211 always process blockack
action frames from the skb queue. This gets rid
of the current special case for managed mode
interfaces as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: pull mgmt frame rx into rx handler
Johannes Berg [Thu, 10 Jun 2010 08:21:34 +0000 (10:21 +0200)]
mac80211: pull mgmt frame rx into rx handler

Some code is duplicated between ibss, mesh and
managed mode regarding the queueing of management
frames. Since all modes now use a common skb
queue and a common work function, we can pull
the queueing code into the rx handler directly
and remove the duplicated length checks etc.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: common work skb freeing
Johannes Berg [Thu, 10 Jun 2010 08:21:33 +0000 (10:21 +0200)]
mac80211: common work skb freeing

All the management processing functions free the
skb after they are done, so this can be done in
the new common code instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: use common work function
Johannes Berg [Thu, 10 Jun 2010 08:21:32 +0000 (10:21 +0200)]
mac80211: use common work function

Even with the previous patch, IBSS, managed
and mesh modes all attach their own work
function to the shared work struct, which
means some duplicated code. Change that to
only have a frame processing function and a
further work function for each of them and
share some common code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: use common work struct
Johannes Berg [Thu, 10 Jun 2010 08:21:31 +0000 (10:21 +0200)]
mac80211: use common work struct

IBSS, managed and mesh modes all have their
own work struct, and in the future we want
to also use it in other modes to process
frames from the now common skb queue.

This also makes the skb queue and work safe
to use from other interface types.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: use common skb queue
Johannes Berg [Thu, 10 Jun 2010 08:21:30 +0000 (10:21 +0200)]
mac80211: use common skb queue

IBSS, managed and mesh modes all have an
skb queue, and in the future we want to
also use it in other modes, so make them
all use a common skb queue already.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: simplify station/aggregation code
Johannes Berg [Thu, 10 Jun 2010 08:21:29 +0000 (10:21 +0200)]
mac80211: simplify station/aggregation code

A number of places use RCU locking for accessing
the station list, even though they do not need
to. Use mutex locking instead to prepare for the
locking changes I want to make. The mlme code is
also using a WLAN_STA_DISASSOC flag that has the
same meaning as WLAN_STA_BLOCK_BA, so use that.

While doing so, combine places where we loop
over stations twice, and optimise away some of
the loops by checking if the hardware supports
aggregation at all first.

Also fix a more theoretical race condition: right
now we could resume, set up an aggregation session,
and right after tear it down again due to the code
that is needed for hardware reconfiguration here.
Also mark add a comment to that code marking it as
a workaround.

Finally, remove a pointless aggregation disabling
loop when an interface is stopped, directly after
that we remove all stations from it which will also
disable all aggregation sessions that may still be
active, and does so in a race-free way unlike the
current loop that doesn't block new sessions.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211/mac80211: allow action frame TX/RX in IBSS
Johannes Berg [Wed, 9 Jun 2010 15:20:33 +0000 (17:20 +0200)]
cfg80211/mac80211: allow action frame TX/RX in IBSS

When in IBSS mode, currently action frame TX and RX
cannot be used. Allow using it to talk to any peer,
or for public action frames. Also, while at it,
restructure the code in mac80211 to make it easier
to add this for other interface types in the future.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowireless: orphan ipw2x00 drivers
Zhu Yi [Thu, 10 Jun 2010 01:44:29 +0000 (09:44 +0800)]
wireless: orphan ipw2x00 drivers

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agop54pci: add Symbol AP-300 minipci adapters pciid
Joerg Albert [Sun, 13 Jun 2010 12:22:23 +0000 (14:22 +0200)]
p54pci: add Symbol AP-300 minipci adapters pciid

Cc: stable@kernel.org
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agolibertas_tf: Fix warning in lbtf_rx for stats struct
Prarit Bhargava [Thu, 10 Jun 2010 12:08:42 +0000 (08:08 -0400)]
libertas_tf: Fix warning in lbtf_rx for stats struct

Fixes linux-2.6 warning:

drivers/net/wireless/libertas_tf/main.c: In function 'lbtf_rx':
drivers/net/wireless/libertas_tf/main.c:578: warning: 'stats.antenna' is used uninitialized in this function
drivers/net/wireless/libertas_tf/main.c:578: warning: 'stats.mactime' is used uninitialized in this function

stats struct needs to be set to 0 before use.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: print warning about disconnected antennas
Johannes Berg [Wed, 9 Jun 2010 08:46:32 +0000 (01:46 -0700)]
iwlwifi: print warning about disconnected antennas

When we detect that not all antennas are
properly connected, we simply disable the
associated chains, but never notify the
user at all. Print out a warning so it is
obvious that happened and we know where
to start looking for related issues.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: rename iwl4965_rx_mpdu_res_start
Emmanuel Grumbach [Mon, 7 Jun 2010 20:21:47 +0000 (13:21 -0700)]
iwlwifi: rename iwl4965_rx_mpdu_res_start

iwl4965_rx_mpdu_res_start is not 4695 specific, so rename it to more
general name iwl_rx_mpdu_res_start.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: rename rxq->dma_addr
Emmanuel Grumbach [Mon, 7 Jun 2010 20:21:46 +0000 (13:21 -0700)]
iwlwifi: rename rxq->dma_addr

Rename rxq->dma_addr to rxq->bd_dma to better emphasize that the
physical address stands for the receive buffer descriptor's address.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: cancel run time calibration work when going down
Wey-Yi Guy [Thu, 3 Jun 2010 17:14:01 +0000 (10:14 -0700)]
iwlwifi: cancel run time calibration work when going down

Cancel scheduled run time calibration work when interface is going
down.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: Fix null pointer referencing in iwl_dbgfs_rx_queue_read.
Dor Shaish [Tue, 1 Jun 2010 07:04:08 +0000 (00:04 -0700)]
iwlwifi: Fix null pointer referencing in iwl_dbgfs_rx_queue_read.

Test for null pointer prior to access.
Print "Not Allocated" if null pointer.

Signed-off-by: Dor Shaish <dor.shaish@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: trace full RX
Johannes Berg [Fri, 28 May 2010 11:08:30 +0000 (04:08 -0700)]
iwlwifi: trace full RX

The length contained in the status word doesn't
include the status word's length itself, so we
need to account for that for tracing.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlagn: verify flow id in compressed BA packet
Shanyu Zhao [Wed, 2 Jun 2010 00:13:58 +0000 (17:13 -0700)]
iwlagn: verify flow id in compressed BA packet

The flow id (scd_flow) in a compressed BA packet should match the txq_id
of the queue from which the aggregated packets were sent. However, in
some hardware like the 1000 series, sometimes the flow id is 0 for the
txq_id (10 to 19). This can cause the annoying message:
[ 2213.306191] iwlagn 0000:01:00.0: Received BA when not expected
[ 2213.310178] iwlagn 0000:01:00.0: Read index for DMA queue txq id (0),
index 5, is out of range [0-256] 7 7.

And even worse, if agg->wait_for_ba is true when the bad BA is arriving,
this can cause system hang due to NULL pointer dereference because the
code is operating in a wrong tx queue!

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Pradeep Kulkarni <pradeepx.kulkarni@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: serialize station management actions
Reinette Chatre [Fri, 28 May 2010 16:28:39 +0000 (09:28 -0700)]
iwlwifi: serialize station management actions

We are seeing some race conditions between incoming station management
requests (station add/remove) and the internal unassoc RXON command that
modifies station table. Modify these flows to require the mutex to be held
and thus serializing them.

This fixes http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2207

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agonetfilter: defrag: kill unused work parameter of frag_kfree_skb()
Shan Wei [Mon, 14 Jun 2010 14:30:47 +0000 (16:30 +0200)]
netfilter: defrag: kill unused work parameter of frag_kfree_skb()

The parameter (work) is unused, remove it.
Reported from Eric Dumazet.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: defrag: remove one redundant atomic ops
Shan Wei [Mon, 14 Jun 2010 14:28:23 +0000 (16:28 +0200)]
netfilter: defrag: remove one redundant atomic ops

Instead of doing one atomic operation per frag, we can factorize them.
Reported from Eric Dumazet.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: kill redundant check code in which setting ip_summed value
Shan Wei [Mon, 14 Jun 2010 14:20:02 +0000 (16:20 +0200)]
netfilter: kill redundant check code in which setting ip_summed value

If the returned csum value is 0, We has set ip_summed with
CHECKSUM_UNNECESSARY flag in __skb_checksum_complete_head().

So this patch kills the check and changes to return to upper
caller directly.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: nfnetlink_log: RCU conversion, part 2
Eric Dumazet [Mon, 14 Jun 2010 14:15:23 +0000 (16:15 +0200)]
netfilter: nfnetlink_log: RCU conversion, part 2

- must use atomic_inc_not_zero() in instance_lookup_get()

- must use hlist_add_head_rcu() instead of hlist_add_head()

- must use hlist_del_rcu() instead of hlist_del()

- Introduce NFULNL_COPY_DISABLED to stop lockless reader from using an
instance, before we do final instance_put() on it.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agoixgbe: fix automatic LRO/RSC settings for low latency
Andy Gospodarek [Fri, 11 Jun 2010 12:47:03 +0000 (12:47 +0000)]
ixgbe: fix automatic LRO/RSC settings for low latency

This patch added to 2.6.34:

commit f8d1dcaf88bddc7f282722ec1fdddbcb06a72f18
Author: Jesse Brandeburg <jesse.brandeburg@intel.com>
Date:   Tue Apr 27 01:37:20 2010 +0000

    ixgbe: enable extremely low latency

introduced a feature where LRO (called RSC on the hardware) was disabled
automatically when setting rx-usecs to 0 via ethtool.  Some might not
like the fact that LRO was disabled automatically, but I'm fine with
that.  What I don't like is that LRO/RSC is automatically enabled when
rx-usecs is set >0 via ethtool.

This would certainly be a problem if the device was used for forwarding
and it was determined that the low latency wasn't needed after the
device was already forwarding.  I played around with saving the state of
LRO in the driver, but it just didn't seem worthwhile and would require
a small change to dev_disable_lro() that I did not like.

This patch simply leaves LRO disabled when setting rx-usecs >0 and
requires that the user enable it again.  An extra informational message
will also now appear in the log so users can understand why LRO isn't
being enabled as they expect.

Inconsistency of LRO setting first noticed by Stanislaw Gruszka.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
CC: Stanislaw Gruszka <sgruszka@redhat.com>
CC: stable@kernel.org
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoe1000: Fix message logging defect
Joe Perches [Fri, 11 Jun 2010 12:51:49 +0000 (12:51 +0000)]
e1000: Fix message logging defect

commit 675ad47375c76a7c3be4ace9554d92cd55518ced
removed the capability to use ethtool.set_msglevel to
control the types of messages emitted by the driver.

That commit should probably be reverted.

If not, then this patch fixes a message logging defect
introduced by converting a printk without KERN_<level>
to e_info.

This also reduces text by about 200 bytes.

Signed-off-by: Joe Perches <joe@perches.com>
Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoixgbe: fix for race with 8259(8|9) during shutdown
Don Skidmore [Fri, 11 Jun 2010 13:20:29 +0000 (13:20 +0000)]
ixgbe: fix for race with 8259(8|9) during shutdown

There is a small window where the watchdog could be running as the
interface is brought down on a NIC with two ports wired back to back.
If ixgbe_update_status is then called can lead to a panic.  This patch
allows the update to bail if we are in that condition.

This issue was orignally reported and fix proposed by Akihiko Saitou.

CC: Akihiko Saitou <asaitou@users.sourceforge.net>
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: rxhash already set in __copy_skb_header
Eric Dumazet [Sun, 13 Jun 2010 10:50:46 +0000 (10:50 +0000)]
net: rxhash already set in __copy_skb_header

No need to copy rxhash again in __skb_clone()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: fix deliver_no_wcard regression on loopback device
John Fastabend [Sun, 13 Jun 2010 10:36:30 +0000 (10:36 +0000)]
net: fix deliver_no_wcard regression on loopback device

deliver_no_wcard is not being set in skb_copy_header.
In the skb_cloned case it is not being cleared and
may cause the skb to be dropped when the loopback device
pushes it back up the stack.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoirttp: Print device parameters and statistics as unsigned
Ben Hutchings [Tue, 8 Jun 2010 08:23:01 +0000 (08:23 +0000)]
irttp: Print device parameters and statistics as unsigned

Device statistics have type unsigned long and several of the
device-specific parameters printed here have type __u32.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agousbnet: Print device statistics as unsigned
Ben Hutchings [Tue, 8 Jun 2010 08:20:59 +0000 (08:20 +0000)]
usbnet: Print device statistics as unsigned

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosfc: Implement 64-bit net device statistics on all architectures
Ben Hutchings [Tue, 8 Jun 2010 07:21:12 +0000 (07:21 +0000)]
sfc: Implement 64-bit net device statistics on all architectures

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: Enable 64-bit net device statistics on 32-bit architectures
Ben Hutchings [Tue, 8 Jun 2010 07:19:54 +0000 (07:19 +0000)]
net: Enable 64-bit net device statistics on 32-bit architectures

Use struct rtnl_link_stats64 as the statistics structure.

On 32-bit architectures, insert 32 bits of padding after/before each
field of struct net_device_stats to make its layout compatible with
struct rtnl_link_stats64.  Add an anonymous union in net_device; move
stats into the union and add struct rtnl_link_stats64 stats64.

Add net_device_ops::ndo_get_stats64, implementations of which will
return a pointer to struct rtnl_link_stats64.  Drivers that implement
this operation must not update the structure asynchronously.

Change dev_get_stats() to call ndo_get_stats64 if available, and to
return a pointer to struct rtnl_link_stats64.  Change callers of
dev_get_stats() accordingly.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoucc_geth driver: add ioctl
Sergey Matyukevich [Mon, 7 Jun 2010 08:38:13 +0000 (08:38 +0000)]
ucc_geth driver: add ioctl

ioctl operation (ndo_do_ioctl) is added to make mii-tools work

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoenic: fix pci_alloc_consistent argument
Randy Dunlap [Tue, 8 Jun 2010 07:00:20 +0000 (07:00 +0000)]
enic: fix pci_alloc_consistent argument

Fix build warning on i386 (32-bit) with 32-bit dma_addr_t:

drivers/net/enic/vnic_dev.c: In function 'vnic_dev_init_prov':
drivers/net/enic/vnic_dev.c:716: warning: passing argument 3 of 'pci_alloc_consistent' from incompatible pointer type
include/asm-generic/pci-dma-compat.h:16: note: expected 'dma_addr_t *' but argument is of type 'u64 *'

Now builds without warnings on i386 and on x86_64.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Scott Feldman <scofeldm@cisco.com>
Cc: Vasanthy Kolluri <vkolluri@cisco.com>
Cc: Roopa Prabhu <roprabhu@cisco.com>
Acked-by: Scott Feldman <scofeldm@cisco.com>
13 years agopktgen: increasing transmission granularity
Daniel Turull [Wed, 9 Jun 2010 22:49:57 +0000 (22:49 +0000)]
pktgen: increasing transmission granularity

This patch increases the granularity of the rate generated by pktgen.
The previous version of pktgen uses micro seconds (udelay) resolution when it
was delayed causing gaps in the rates. It is changed to nanosecond (ndelay).
Now any rate is possible.

Also it allows to set, the desired rate in Mb/s or packets per second.

The documentation has been updated.

Signed-off-by: Daniel Turull <daniel.turull@gmail.com>
Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoeconet: fix locking
Eric Dumazet [Wed, 9 Jun 2010 16:33:05 +0000 (16:33 +0000)]
econet: fix locking

econet lacks proper locking. It holds econet_lock only when inserting or
deleting an entry in econet_sklist, not during lookups.

- convert econet_lock from rwlock to spinlock

- use econet_lock in ec_listening_socket() lookup

- use appropriate sock_hold() / sock_put() to avoid corruptions.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agopkt_sched: gen_kill_estimator() rcu fixes
Eric Dumazet [Wed, 9 Jun 2010 02:09:23 +0000 (02:09 +0000)]
pkt_sched: gen_kill_estimator() rcu fixes

gen_kill_estimator() API is incomplete or not well documented, since
caller should make sure an RCU grace period is respected before
freeing stats_lock.

This was partially addressed in commit 5d944c640b4
(gen_estimator: deadlock fix), but same problem exist for all
gen_kill_estimator() users, if lock they use is not already RCU
protected.

A code review shows xt_RATEEST.c, act_api.c, act_police.c have this
problem. Other are ok because they use qdisc lock, already RCU
protected.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2: Fix compiler warning in bnx2_disable_forced_2g5().
Michael Chan [Tue, 8 Jun 2010 07:21:30 +0000 (07:21 +0000)]
bnx2: Fix compiler warning in bnx2_disable_forced_2g5().

drivers/net/bnx2.c: In function 'bnx2_disable_forced_2g5':
drivers/net/bnx2.c:1489: warning: 'bmcr' may be used uninitialized in this function

We fix it by checking return values from all bnx2_read_phy() and proceeding
to do read-modify-write only if the read operation is successful.

The related bnx2_enable_forced_2g5() is also fixed the same way.

Reported-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoenic: cleanup vic_provinfo_alloc()
Dan Carpenter [Wed, 9 Jun 2010 21:59:03 +0000 (21:59 +0000)]
enic: cleanup vic_provinfo_alloc()

If oui were a null variable then vic_provinfo_alloc() would leak memory.
But this function is only called from one place and oui is not null so
I removed the check.

I also moved the memory allocation down a line so it was easier to spot.
(No one ever reads variable declarations).

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Fri, 11 Jun 2010 20:32:31 +0000 (13:32 -0700)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

13 years agoethoc: use devres resource management
Jonas Bonn [Fri, 11 Jun 2010 02:47:40 +0000 (02:47 +0000)]
ethoc: use devres resource management

The point of using the devres resource management routines is that they
simplify the driver by taking care of releasing resources on failure and
release.  A recent commit added a bunch of error handling that is unnecessary
in this context.

This patch removes this redundant error handling, as well as using
dmam_alloc_coherent in place of dma_alloc_coherent in order to use this
framework consistenly throughout the driver.

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethoc: Clear command buffer after write
Jonas Bonn [Fri, 11 Jun 2010 02:47:39 +0000 (02:47 +0000)]
ethoc: Clear command buffer after write

This matches what ethoc_mdio_read does and makes the functions
symmetric.

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoRemove unused variable
Jonas Bonn [Fri, 11 Jun 2010 02:47:38 +0000 (02:47 +0000)]
Remove unused variable

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethoc: Clean up PHY probing
Jonas Bonn [Fri, 11 Jun 2010 02:47:37 +0000 (02:47 +0000)]
ethoc: Clean up PHY probing

- No need to iterate over all possible addresses on bus
- Use helper function phy_find_first
- Use phy_connect_direct as we already have the relevant structure

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: David S. Miller <davem@davemloft.net>