]> bbs.cooldavid.org Git - net-next-2.6.git/log
net-next-2.6.git
13 years agoiwlwifi: more generic name for rssi calc in iwlagn
Wey-Yi Guy [Wed, 4 Aug 2010 15:42:17 +0000 (08:42 -0700)]
iwlwifi: more generic name for rssi calc in iwlagn

Change the define to more generic naming to match _agn devices
since the rssi calculation are common function for 5000 series and up

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: additional parameter in REPLY_RX_PHY_CMD
Wey-Yi Guy [Wed, 4 Aug 2010 15:05:33 +0000 (08:05 -0700)]
iwlwifi: additional parameter in REPLY_RX_PHY_CMD

Adding additional parameter in REPLY_RX_PHY_CMD, frame_time indicate the
frame's time on the air based on byte count and frame rate calculation

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: continue perform rate scale when error detected
Wey-Yi Guy [Tue, 3 Aug 2010 15:23:32 +0000 (08:23 -0700)]
iwlagn: continue perform rate scale when error detected

If for some reason, the actual link command not matching neither
active nor search table; instead of return and not performing rate
scale, by-pass the data collection and continue the rate scale process.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: adjust starting action for rate scale
Wey-Yi Guy [Sat, 31 Jul 2010 15:52:03 +0000 (08:52 -0700)]
iwlagn: adjust starting action for rate scale

During rate scale, reset starting action after making action adjustment
to avoid the possibility of break out of loop too early.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: refactor iwl_setup_rxon_timing
Johannes Berg [Thu, 29 Jul 2010 14:07:51 +0000 (07:07 -0700)]
iwlwifi: refactor iwl_setup_rxon_timing

All callers of iwl_setup_rxon_timing() also send
the command right away, so rename the function
to iwl_send_rxon_timing() and move the sending
into it. Also, some callers clear the data, this
can be done always and thus moved in as well.
Finally, there's no reason for the function to
acquire the spinlock, but it should be called
with the mutex held, so assert that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: cleanup iwl_set_rxon_channel()
Shanyu Zhao [Wed, 28 Jul 2010 03:45:15 +0000 (20:45 -0700)]
iwlwifi: cleanup iwl_set_rxon_channel()

Update outdated comments of iwl_set_rxon_channel() to reflect the
current signature. Also remove the unnecessary validation of the
channel. Those channel info are constructed in iwlwifi driver
and mac80211 will never modify the content of the struct. Also
everytime before this function is called the channel info has
been validated already (as a paranoid check).

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: avoid race condition in channel change
Shanyu Zhao [Wed, 28 Jul 2010 20:40:39 +0000 (13:40 -0700)]
iwlwifi: avoid race condition in channel change

When iwl_mac_config() is called by mac80211, the channel pointer
hw->conf->channel can potentially change, resulting in mismatch
band and channel number when configuring RXON command. To avoid
this situation, save the channel pointer in local variables
and validate the channel before using it. Note that priv->mutex
is locked during the whole function so the local variables are safe.

Same change is applied to iwl_mac_channel_switch() since basically
it copies code from iwl_mac_config().

Also removed an outdated comment in the flow.

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: do not call ieee80211_frequency_to_channel
Shanyu Zhao [Wed, 28 Jul 2010 20:40:27 +0000 (13:40 -0700)]
iwlwifi: do not call ieee80211_frequency_to_channel

A few cases in iwlwifi driver function ieee80211_frequency_to_channel()
is called to get channel number from center frequency. This is not needed
since the channel number is already saved in hw_value field of struct
ieee80211_channel in function iwlcore_init_geos(). So replace those function
calls with hw_value field of struct ieee80211_channel.

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: make aggregation time limit configurable
Wey-Yi Guy [Wed, 28 Jul 2010 16:18:54 +0000 (09:18 -0700)]
iwlwifi: make aggregation time limit configurable

By default, aggregation time limit is 4000 uSec, add the parameter to
.cfg
to allow this parameter can be configure per device base if needed.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: max/min aggregation time limit
Wey-Yi Guy [Wed, 28 Jul 2010 16:18:53 +0000 (09:18 -0700)]
iwlwifi: max/min aggregation time limit

Set the minimum and maximum for aggregation time limit in uSec.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: additional comments in iwl_cfg
Wey-Yi Guy [Fri, 23 Jul 2010 23:49:44 +0000 (16:49 -0700)]
iwlwifi: additional comments in iwl_cfg

No functional changes, just add additional comments to iwl_cfg structure

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: remove unused define
Wey-Yi Guy [Fri, 23 Jul 2010 20:42:39 +0000 (13:42 -0700)]
iwlwifi: remove unused define

IWL_SIXTY_SECS is not been used, remove it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoHostap: Fix "'ret' set but not used" warning message from GCC in hostap
Julian Calaby [Tue, 17 Aug 2010 18:52:41 +0000 (14:52 -0400)]
Hostap: Fix "'ret' set but not used" warning message from GCC in hostap

 CC [M]  drivers/net/wireless/hostap/hostap_ioctl.o
drivers/net/wireless/hostap/hostap_ioctl.c: In function 'prism2_request_scan':
drivers/net/wireless/hostap/hostap_ioctl.c:1666:6: warning: variable 'ret' set but not used

Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: fix thermal throttling related power management operation
Wey-Yi Guy [Fri, 6 Aug 2010 19:39:14 +0000 (12:39 -0700)]
iwlwifi: fix thermal throttling related power management operation

The current approach is very broken because it adds an
often-used code path that will not initialise "cmd" at all.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Shanyu Zhao <shanyu.zhao.intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211-hwsim: allow configuring IBSS
Johannes Berg [Tue, 17 Aug 2010 10:08:07 +0000 (12:08 +0200)]
mac80211-hwsim: allow configuring IBSS

It will not look standard-compliant in a sniffer
because because it doesn't
 * sync TSF
 * adjust the TSF in beacons
 * send beacons at TBTT
 * cancel beacons when another phy sends

However, it does allow testing the configuration
and parts of the mac80211 code for IBSS and as
such is still useful.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowireless: move documentation books
Johannes Berg [Tue, 17 Aug 2010 10:04:34 +0000 (12:04 +0200)]
wireless: move documentation books

This moves mac80211 documentation into a new
802.11 bookset and also adds a cfg80211 book
to the set. All of this is rather incomplete,
but it's easier to work with big code moving
as a separate patch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agop54: improve eeprom parser
Christian Lamparter [Mon, 16 Aug 2010 23:16:58 +0000 (01:16 +0200)]
p54: improve eeprom parser

Like other vendors, p54* devices have a checksum for
the EEPROM descriptor data. This patch enhances the
parser code to generate and verify the data fields,
before initializing the radio-chip on the card.

Note:
If you have to bootstrap an alternative EEPROM image
for your device and you don't know how to generate a
valid crc ccitt checksum, you should take a look at:
http://git.kernel.org/?p=linux/kernel/git/chr/p54tools.git

The "checksum" utility loads a binary p54 EEPROM blob
(use the -f switch, to skip the check) and applies
the correct crc automatically.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agop54spi: fix eeprom checksum
Christian Lamparter [Mon, 16 Aug 2010 23:16:05 +0000 (01:16 +0200)]
p54spi: fix eeprom checksum

This patch corrects the bogus descriptor checksum of our
Nokia N8XX EEPROM blob.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43: N-PHY: Implement RX core state setting for rev.2 and earlier PHYs
Gábor Stefanik [Mon, 16 Aug 2010 20:39:17 +0000 (22:39 +0200)]
b43: N-PHY: Implement RX core state setting for rev.2 and earlier PHYs

Rev.3+ support coming in a later patch.

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43: N-PHY: Implement MAC PHY clock set
Gábor Stefanik [Mon, 16 Aug 2010 20:39:16 +0000 (22:39 +0200)]
b43: N-PHY: Implement MAC PHY clock set

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43: N-PHY: Fix typo in function name (gain_crtl -> gain_ctrl)
Gábor Stefanik [Mon, 16 Aug 2010 20:39:15 +0000 (22:39 +0200)]
b43: N-PHY: Fix typo in function name (gain_crtl -> gain_ctrl)

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43: N-PHY: Implement Host Flags write during device init
Gábor Stefanik [Mon, 16 Aug 2010 20:39:14 +0000 (22:39 +0200)]
b43: N-PHY: Implement Host Flags write during device init

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: separate thermal throttling function
Wey-Yi Guy [Sat, 31 Jul 2010 15:34:07 +0000 (08:34 -0700)]
iwlwifi: separate thermal throttling function

"Thermal Throttling" is an advance feature which only available for
newer _agn devices. Move from iwl-core to iwl-agn for better code
organization.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agodrivers/net/wireless/wl12xx: Use available error codes
Julia Lawall [Mon, 16 Aug 2010 16:27:30 +0000 (18:27 +0200)]
drivers/net/wireless/wl12xx: Use available error codes

Error codes are stored in ret, but the return value is always 0.  Return
ret instead.

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

// <smpl>
@r@
local idexpression x;
constant C;
@@

if (...) { ...
  x = -C
  ... when != x
(
  return <+...x...+>;
|
  return NULL;
|
  return;
|
* return ...;
)
}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agodrivers/net/wireless/wl12xx: Use available error codes
Julia Lawall [Mon, 16 Aug 2010 16:25:21 +0000 (18:25 +0200)]
drivers/net/wireless/wl12xx: Use available error codes

In each case, error codes are stored in ret, but the return value is always
0.  Return ret instead.

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

// <smpl>
@r@
local idexpression x;
constant C;
@@

if (...) { ...
  x = -C
  ... when != x
(
  return <+...x...+>;
|
  return NULL;
|
  return;
|
* return ...;
)
}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Kalle Valo <kvalo@adurom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: don't enable probe request rx for STAs
Bob Copeland [Sun, 15 Aug 2010 17:03:15 +0000 (13:03 -0400)]
ath5k: don't enable probe request rx for STAs

AR5K_RX_FILTER_PROBEREQ enables reception of probe requests,
but the filter flag FIF_BCN_PRBRESP_PROMISC is actually about
receiving beacons and probe _responses_, so we shouldn't
turn on the filter when scanning.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: remove all mention of monitor iftype
Bob Copeland [Sun, 15 Aug 2010 17:03:14 +0000 (13:03 -0400)]
ath5k: remove all mention of monitor iftype

Monitor interfaces are never seen by the driver so these
cases are never reached.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: remove monitor check in receive_frame_ok filter
Bob Copeland [Sun, 15 Aug 2010 17:03:13 +0000 (13:03 -0400)]
ath5k: remove monitor check in receive_frame_ok filter

Monitor interfaces are never seen by the driver, so tests based on
that opmode don't make sense.  Also, we already pass all mic
failure packets.

Consequently this code is actually accepting any frames with just
crypto errors and rejecting those with CRC, FIFO, and PHY errors for
all interface types.  Adjust the code and comment accordingly.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: clean up some comments
Bob Copeland [Sun, 15 Aug 2010 17:03:12 +0000 (13:03 -0400)]
ath5k: clean up some comments

This fixes a few misspellings, word repetitions, and some grammar
nits in ath5k comments.  No code changes.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: remove own (wrong) IEEE80211_MAX_LEN
Nick Kossifidis [Sun, 15 Aug 2010 17:03:11 +0000 (13:03 -0400)]
ath5k: remove own (wrong) IEEE80211_MAX_LEN

Use the version already supplied in include/linux/ieee80211.h.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: rename ath5k_hw_set_associd to _set_bssid
Nick Kossifidis [Sun, 15 Aug 2010 17:03:10 +0000 (13:03 -0400)]
ath5k: rename ath5k_hw_set_associd to _set_bssid

Although the named function also sets the aid, its main
purpose is configuring the bssid and we use that
everywhere else.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211/mac80211: extensible frame processing
Johannes Berg [Thu, 12 Aug 2010 13:38:38 +0000 (15:38 +0200)]
cfg80211/mac80211: extensible frame processing

Allow userspace to register for more than just
action frames by giving the frame subtype, and
make it possible to use this in various modes
as well.

With some tweaks and some added functionality
this will, in the future, also be usable in AP
mode and be able to replace the cooked monitor
interface currently used in that case.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: remove unused don't-encrypt flag
Johannes Berg [Thu, 12 Aug 2010 13:37:29 +0000 (15:37 +0200)]
mac80211: remove unused don't-encrypt flag

When MFP is disabled, action frames will not
be encrypted since they are management frames
and the only management frames that can then
be encrypted are authentication frames.

Therefore, setting the don't-encrypt flag on
action frames is unnecessary.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: mark ieee80211_hdrlen const
Johannes Berg [Thu, 12 Aug 2010 12:49:58 +0000 (14:49 +0200)]
cfg80211: mark ieee80211_hdrlen const

This function analyses only its single, value-passed
argument, and has no side effects. Thus it can be
const, which makes mac80211 smaller, for example:

   text    data     bss     dec     hex filename
 362518   16720     884  380122   5ccda mac80211.ko (before)
 362358   16720     884  379962   5cc3a mac80211.ko (after)

a 160 byte saving in text size, and an optimisation
because the function won't be called as often.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agobcm63xx_enet: use netdev stats
Eric Dumazet [Tue, 24 Aug 2010 19:24:07 +0000 (12:24 -0700)]
bcm63xx_enet: use netdev stats

Use integrated net_device stats instead of a private one

Get rid of bcm_enet_get_stats()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethoc: get rid of ethoc_stats()
Eric Dumazet [Tue, 24 Aug 2010 19:23:01 +0000 (12:23 -0700)]
ethoc: get rid of ethoc_stats()

drivers can avoid implementing ndo_get_stats method if using netdevice
stats structure.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobe2net: get rid of be_get_stats()
Eric Dumazet [Tue, 24 Aug 2010 19:22:13 +0000 (12:22 -0700)]
be2net: get rid of be_get_stats()

drivers can avoid implementing ndo_get_stats method if using netdevice
stats structure.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: increase the size of priv_flags and add IFF_OVS_DATAPATH
Simon Horman [Mon, 23 Aug 2010 16:26:41 +0000 (16:26 +0000)]
net: increase the size of priv_flags and add IFF_OVS_DATAPATH

IFF_OVS_DATAPATH is a place-holder for the Open vSwitch datapath
which I am preparing to submit for merging.

As all 16 bits of priv_flags are already assigned flags, also increase
the size of priv_flags to 32 bits.

Unfortunately, by my calculations this increases the size of
struct net_device by 4 bytes on 32bit architectures and
8 bytes on 64 bit architectures. I couldn't see an obvious
way to avoid that.

Cc: Jesse Gross <jesse@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool: allow non-netadmin to query settings
stephen hemminger [Mon, 23 Aug 2010 10:24:18 +0000 (10:24 +0000)]
ethtool: allow non-netadmin to query settings

The SNMP daemon uses ethtool to determine the speed of
network interfaces. This fails on Debian (and probably elsewhere)
because for security SNMP daemon runs as non-root user (snmp).

Note: A similar patch was rejected previously because of a concern about
the possibility that on some hardware querying the ethtool settings
requires access to the PHY and could slow the machine down.  But the
security risk of requiring SNMP daemon (and related services)
to run as root far out weighs the risk of denial-of-service.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: copy_rtnl_link_stats64() simplification
Eric Dumazet [Mon, 23 Aug 2010 07:14:36 +0000 (07:14 +0000)]
net: copy_rtnl_link_stats64() simplification

No need to use a temporary struct rtnl_link_stats64 variable,
just copy the source to skb buffer.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet_sched: act_csum: coding style cleanup
Changli Gao [Mon, 23 Aug 2010 03:27:58 +0000 (03:27 +0000)]
net_sched: act_csum: coding style cleanup

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agopkt_sched: Make act_csum depend upon INET.
David S. Miller [Tue, 24 Aug 2010 03:42:11 +0000 (20:42 -0700)]
pkt_sched: Make act_csum depend upon INET.

It uses ip_send_check() and stuff like that.

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocxgb4: update PCI ids
Dimitris Michailidis [Mon, 23 Aug 2010 17:21:01 +0000 (17:21 +0000)]
cxgb4: update PCI ids

Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocxgb4: fix setting of the function number in transmit descriptors
Dimitris Michailidis [Mon, 23 Aug 2010 17:21:00 +0000 (17:21 +0000)]
cxgb4: fix setting of the function number in transmit descriptors

Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocxgb4: support eeprom read/write on functions other than 0
Dimitris Michailidis [Mon, 23 Aug 2010 17:20:59 +0000 (17:20 +0000)]
cxgb4: support eeprom read/write on functions other than 0

Extend the address translation for eeprom read/write (code used by
ethtool -[eE]) to functions other than 0.

Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocxgb4: handle Rx/Tx queue ranges not starting at 0
Dimitris Michailidis [Mon, 23 Aug 2010 17:20:58 +0000 (17:20 +0000)]
cxgb4: handle Rx/Tx queue ranges not starting at 0

Currently the driver assumes that queue IDs start at 0 but that's true
only for function 0.  To support operation on other functions get the
start of the queue ranges from FW and offset accordingly.

Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobna: Delete get_flags and set_flags ethtool methods.
David S. Miller [Tue, 24 Aug 2010 03:34:51 +0000 (20:34 -0700)]
bna: Delete get_flags and set_flags ethtool methods.

This driver doesn't support LRO, NTUPLE, or the RXHASH
features.  So it should not set these ethtool operations.

This also fixes the warning:

drivers/net/bna/bnad_ethtool.c:1272: warning: initialization from incompatible pointer type

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobna: Brocade 10Gb Ethernet device driver
Rasesh Mody [Tue, 24 Aug 2010 03:24:12 +0000 (20:24 -0700)]
bna: Brocade 10Gb Ethernet device driver

This is patch 1/6 which contains linux driver source for
Brocade's BR1010/BR1020 10Gb CEE capable ethernet adapter.

Signed-off-by: Debashis Dutt <ddutt@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodccp ccid-2: Replace broken RTT estimator with better algorithm
Gerrit Renker [Sun, 22 Aug 2010 19:41:40 +0000 (19:41 +0000)]
dccp ccid-2: Replace broken RTT estimator with better algorithm

The current CCID-2 RTT estimator code is in parts broken and lags behind the
suggestions in RFC2988 of using scaled variants for SRTT/RTTVAR.

That code is replaced by the present patch, which reuses the Linux TCP RTT
estimator code.

Further details:
----------------
 1. The minimum RTO of previously one second has been replaced with TCP's, since
    RFC4341, sec. 5 says that the minimum of 1 sec. (suggested in RFC2988, 2.4)
    is not necessary. Instead, the TCP_RTO_MIN is used, which agrees with DCCP's
    concept of a default RTT (RFC 4340, 3.4).
 2. The maximum RTO has been set to DCCP_RTO_MAX (64 sec), which agrees with
    RFC2988, (2.5).
 3. De-inlined the function ccid2_new_ack().
 4. Added a FIXME: the RTT is sampled several times per Ack Vector, which will
    give the wrong estimate. It should be replaced with one sample per Ack.
    However, at the moment this can not be resolved easily, since
    - it depends on TX history code (which also needs some work),
    - the cleanest solution is not to use the `sent' time at all (saves 4 bytes
      per entry) and use DCCP timestamps / elapsed time to estimated the RTT,
      which however is non-trivial to get right (but needs to be done).

Reasons for reusing the Linux TCP estimator algorithm:
------------------------------------------------------
Some time was spent to find a better alternative, using basic RFC2988 as a first
step. Further analysis and experimentation showed that the Linux TCP RTO
estimator is superior to a basic RFC2988 implementation. A summary is on
http://www.erg.abdn.ac.uk/users/gerrit/dccp/notes/ccid2/rto_estimator/

In addition, this estimator fared well in a recent empirical evaluation:

    Rewaskar, Sushant, Jasleen Kaur and F. Donelson Smith.
    A Performance Study of Loss Detection/Recovery in Real-world TCP
    Implementations. Proceedings of 15th IEEE International
    Conference on Network Protocols (ICNP-07), 2007.

Thus there is significant benefit in reusing the existing TCP code.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodccp ccid-2: Simplify dec_pipe and rearming of RTO timer
Gerrit Renker [Sun, 22 Aug 2010 19:41:39 +0000 (19:41 +0000)]
dccp ccid-2: Simplify dec_pipe and rearming of RTO timer

This removes the dec_pipe function and improves the way the RTO timer is rearmed
when a new acknowledgment comes in.

Details and justification for removal:
--------------------------------------
 1) The BUG_ON in dec_pipe is never triggered: pipe is only decremented for TX
    history entries between tail and head, for which it had previously been
    incremented in tx_packet_sent; and it is not decremented twice for the same
    entry, since it is
    - either decremented when a corresponding Ack Vector cell in state 0 or 1
      was received (and then ccid2s_acked==1),
    - or it is decremented when ccid2s_acked==0, as part of the loss detection
      in tx_packet_recv (and hence it can not have been decremented earlier).

 2) Restarting the RTO timer happens for every single entry in each Ack Vector
    parsed by tx_packet_recv (according to RFC 4340, 11.4 this can happen up to
    16192 times per Ack Vector).

 3) The RTO timer should not be restarted when all outstanding data has been
    acknowledged. This is currently done similar to (2), in dec_pipe, when
    pipe has reached 0.

The patch onsolidates the code which rearms the RTO timer, combining the
segments from new_ack and dec_pipe. As a result, the code becomes clearer
(compare with tcp_rearm_rto()).

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 redundant sanity tests
Gerrit Renker [Sun, 22 Aug 2010 19:41:38 +0000 (19:41 +0000)]
dccp ccid-2: Remove redundant sanity tests

This removes the ccid2_hc_tx_check_sanity function: it is redundant.

Details:

The tx_check_sanity function performs three tests:
 1) it checks that the circular TX list is sorted
    - in ascending order of sequence number (ccid2s_seq)
    - and time (ccid2s_sent),
    - in the direction from `tail' (hctx_seqt) to `head' (hctx_seqh);
 2) it ensures that the entire list has the length seqbufc * CCID2_SEQBUF_LEN;
 3) it ensures that pipe equals the number of packets that were not
    marked `acked' (ccid2s_acked) between `tail' and `head'.

The following argues that each of these tests is redundant, this can be verified
by going through the code.

(1) is not necessary, since both time and GSS increase from one packet to the
next, so that subsequent insertions in tx_packet_sent (which advance the `head'
pointer) will be in ascending order of time and sequence number.

In (2), the length of the list is always equal to seqbufc times CCID2_SEQBUF_LEN
(set to 1024) unless allocation caused an earlier failure, because:
 * at initialisation (tx_init), there is one chunk of size 1024 and seqbufc=1;
 * subsequent calls to tx_alloc_seq take place whenever head->next == tail in
   tx_packet_sent; then a new chunk of size 1024 is inserted between head and
   tail, and seqbufc is incremented by one.

To show that (3) is redundant requires looking at two cases.

The `pipe' variable of the TX socket is incremented only in tx_packet_sent, and
decremented in tx_packet_recv.  When head == tail (TX history empty) then pipe
should be 0, which is the case directly after initialisation and after a
retransmission timeout has occurred (ccid2_hc_tx_rto_expire).

The first case involves parsing Ack Vectors for packets recorded in the live
portion of the buffer, between tail and head. For each packet marked by the
receiver as received (state 0) or ECN-marked (state 1), pipe is decremented by
one, so for all such packets the BUG_ON in tx_check_sanity will not trigger.

The second case is the loss detection in the second half of tx_packet_recv,
below the comment "Check for NUMDUPACK".

The first while-loop here ensures that the sequence number of `seqp' is either
above or equal to `high_ack', or otherwise equal to the highest sequence number
sent so far (of the entry head->prev, as head points to the next unsent entry).
The next while-loop ("while (1)") counts the number of acked packets starting
from that position of seqp, going backwards in the direction from head->prev to
tail. If NUMDUPACK=3 such packets were counted within this loop, `seqp' points
to the last acknowledged packet of these, and the "if (done == NUMDUPACK)" block
is entered next.
The while-loop contained within that block in turn traverses the list backwards,
from head to tail; the position of `seqp' is saved in the variable `last_acked'.
For each packet not marked as `acked', a congestion event is triggered within
the loop, and pipe is decremented. The loop terminates when `seqp' has reached
`tail', whereupon tail is set to the position previously stored in `last_acked'.
Thus, between `last_acked' and the previous position of `tail',
 - pipe has been decremented earlier if the packet was marked as state 0 or 1;
 - pipe was decremented if the packet was not marked as acked.
That is, pipe has been decremented by the number of packets between `last_acked'
and the previous position of `tail'. As a consequence, pipe now again reflects
the number of packets which have not (yet) been acked between the new position
of tail (at `last_acked') and head->prev, or 0 if head==tail. The result is that
the BUG_ON condition in check_sanity will also not be triggered, hence the test
(3) is also redundant.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodccp ccid-3: No more CCID control blocks in LISTEN state
Gerrit Renker [Sun, 22 Aug 2010 19:41:37 +0000 (19:41 +0000)]
dccp ccid-3: No more CCID control blocks in LISTEN state

The CCIDs are activated as last of the features, at the end of the handshake,
were the LISTEN state of the master socket is inherited into the server
state of the child socket. Thus, the only states visible to CCIDs now are
OPEN/PARTOPEN, and the closing states.

This allows to remove tests which were previously necessary to protect
against referencing a socket in the listening state (in CCID-3), but which
now have become redundant.

As a further byproduct of enabling the CCIDs only after the connection has been
fully established, several typecast-initialisations of ccid3_hc_{rx,tx}_sock
can now be eliminated:
 * the CCID is loaded, so it is not necessary to test if it is NULL,
 * if it is possible to load a CCID and leave the private area NULL, then this
    is a bug, which should crash loudly - and earlier,
 * the test for state==OPEN || state==PARTOPEN now reduces only to the closing
   phase (e.g. when the node has received an unexpected Reset).

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoccid: ccid-2/3 code cosmetics
Gerrit Renker [Sun, 22 Aug 2010 19:41:36 +0000 (19:41 +0000)]
ccid: ccid-2/3 code cosmetics

This patch collects cosmetics-only changes to separate these from
code changes:
 * update with regard to CodingStyle and whitespace changes,
 * documentation:
   - adding/revising comments,
   - remove CCID-3 RX socket documentation which is either
     duplicate or refers to fields that no longer exist,
 * expand embedded tfrc_tx_info struct inline for consistency,
   removing indirections via #define.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: Rename skb_has_frags to skb_has_frag_list
David S. Miller [Mon, 23 Aug 2010 07:13:46 +0000 (00:13 -0700)]
net: Rename skb_has_frags to skb_has_frag_list

SKBs can be "fragmented" in two ways, via a page array (called
skb_shinfo(skb)->frags[]) and via a list of SKBs (called
skb_shinfo(skb)->frag_list).

Since skb_has_frags() tests the latter, it's name is confusing
since it sounds more like it's testing the former.

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 [Mon, 23 Aug 2010 05:37:04 +0000 (22:37 -0700)]
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

Conflicts:
include/linux/if_pppox.h

Fix conflict between Changli's __packed header file fixes and
the new PPTP driver.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agomlx4: remove num_lro parameter
Amerigo Wang [Tue, 17 Aug 2010 21:51:18 +0000 (21:51 +0000)]
mlx4: remove num_lro parameter

As suggested by David, this parameter can die, we can use ethtool
to turn LRO on/off. Compile tests only.

Signed-off-by: WANG Cong <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoxen: use less generic names in netfront driver.
Ian Campbell [Wed, 18 Aug 2010 23:27:49 +0000 (23:27 +0000)]
xen: use less generic names in netfront driver.

All Xen frontend drivers have a couple of identically named functions which
makes figuring out which device went wrong from a stacktrace harder than it
needs to be. Rename them to something specificto the device type.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotcp: allow effective reduction of TCP's rcv-buffer via setsockopt
Hagen Paul Pfeifer [Thu, 19 Aug 2010 06:33:05 +0000 (06:33 +0000)]
tcp: allow effective reduction of TCP's rcv-buffer via setsockopt

Via setsockopt it is possible to reduce the socket RX buffer
(SO_RCVBUF). TCP method to select the initial window and window scaling
option in tcp_select_initial_window() currently misbehaves and do not
consider a reduced RX socket buffer via setsockopt.

Even though the server's RX buffer is reduced via setsockopt() to 256
byte (Initial Window 384 byte => 256 * 2 - (256 * 2 / 4)) the window
scale option is still 7:

192.168.1.38.40676 > 78.47.222.210.5001: Flags [S], seq 2577214362, win 5840, options [mss 1460,sackOK,TS val 338417 ecr 0,nop,wscale 0], length 0
78.47.222.210.5001 > 192.168.1.38.40676: Flags [S.], seq 1570631029, ack 2577214363, win 384, options [mss 1452,sackOK,TS val 2435248895 ecr 338417,nop,wscale 7], length 0
192.168.1.38.40676 > 78.47.222.210.5001: Flags [.], ack 1, win 5840, options [nop,nop,TS val 338421 ecr 2435248895], length 0

Within tcp_select_initial_window() the original space argument - a
representation of the rx buffer size - is expanded during
tcp_select_initial_window(). Only sysctl_tcp_rmem[2], sysctl_rmem_max
and window_clamp are considered to calculate the initial window.

This patch adjust the window_clamp argument if the user explicitly
reduce the receive buffer.

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
Cc: David S. Miller <davem@davemloft.net>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoisdn/avm: fix build when PCMCIA is not enabled
Randy Dunlap [Thu, 19 Aug 2010 07:07:23 +0000 (07:07 +0000)]
isdn/avm: fix build when PCMCIA is not enabled

Why wouldn't kconfig symbol ISDN_DRV_AVMB1_B1PCMCIA also depend on
PCMCIA?

Fix build for PCMCIA not enabled:

ERROR: "b1_free_card" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
ERROR: "b1ctl_proc_fops" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
ERROR: "b1_reset_ctr" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
ERROR: "b1_load_firmware" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
ERROR: "b1_send_message" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
ERROR: "b1_release_appl" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
ERROR: "b1_register_appl" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
ERROR: "b1_getrevision" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
ERROR: "b1_detect" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
ERROR: "b1_interrupt" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
ERROR: "b1_alloc_card" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Carsten Paeth <calle@calle.de>
Cc: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoheader: fix broken headers for user space
Changli Gao [Sun, 22 Aug 2010 17:25:05 +0000 (17:25 +0000)]
header: fix broken headers for user space

__packed is only defined in kernel space, so we should use
__attribute__((packed)) for the code shared between kernel and user space.

Two __attribute() annotations are replaced with __attribute__() too.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobridge: is PACKET_LOOPBACK unlikely()?
Simon Horman [Sun, 22 Aug 2010 17:35:32 +0000 (17:35 +0000)]
bridge: is PACKET_LOOPBACK unlikely()?

While looking at using netdev_rx_handler_register for openvswitch Jesse
Gross suggested that an unlikely() might be worthwhile in that code.
I'm interested to see if its appropriate for the bridge code.

Cc: Jesse Gross <jesse@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: rds: remove duplication type definitions
Changli Gao [Sun, 22 Aug 2010 16:41:59 +0000 (16:41 +0000)]
net: rds: remove duplication type definitions

__be* are defined in linux/types.h now, and in fact, rds.h isn't exported
to user space even.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2: Add PCI Advanced Error Reporting support.
John Feeney [Sun, 22 Aug 2010 17:45:53 +0000 (17:45 +0000)]
bnx2: Add PCI Advanced Error Reporting support.

Signed-off-by: John Feeney <jfeeney@redhat.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: 802.1q: make vlan_hwaccel_do_receive() return void
Changli Gao [Mon, 23 Aug 2010 04:03:33 +0000 (21:03 -0700)]
net: 802.1q: make vlan_hwaccel_do_receive() return void

vlan_hwaccel_do_receive() always returns 0, so make it return void.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet/sched: need to include net/ip6_checksum.h
Stephen Rothwell [Mon, 23 Aug 2010 03:31:14 +0000 (20:31 -0700)]
net/sched: need to include net/ip6_checksum.h

for the declararion of csum_ipv6_magic.

Fixes this build error on PowerPC (at least):

net/sched/act_csum.c: In function 'tcf_csum_ipv6_icmp':
net/sched/act_csum.c:178: error: implicit declaration of function 'csum_ipv6_magic'

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: use __be16 instead of u16 for the userspace code
Changli Gao [Mon, 23 Aug 2010 01:37:27 +0000 (18:37 -0700)]
net: use __be16 instead of u16 for the userspace code

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotokenring: remove unneeded NULL checks
Dan Carpenter [Sun, 22 Aug 2010 07:54:30 +0000 (00:54 -0700)]
tokenring: remove unneeded NULL checks

"fw_entry" is always non-NULL at this point and anyway
release_firmware() handles NULL parameters.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet_sched: cls_flow: add key rxhash
Changli Gao [Sat, 21 Aug 2010 06:23:15 +0000 (06:23 +0000)]
net_sched: cls_flow: add key rxhash

We can use rxhash to classify the traffic into flows. As rxhash maybe
supplied by NIC or RPS, it is cheaper.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Acked-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoirda: use net_device_stats from struct net_device
Eric Dumazet [Thu, 19 Aug 2010 23:51:33 +0000 (23:51 +0000)]
irda: use net_device_stats from struct net_device

struct net_device has its own struct net_device_stats member, so use
this one instead of a private copy in the irlan_cb struct.

Signed-off-by: Eric Dumazet <eric.dumazet@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 [Sun, 22 Aug 2010 06:32:24 +0000 (23:32 -0700)]
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

13 years agoamd8111e: use net_device_stats from struct net_device
Eric Dumazet [Fri, 20 Aug 2010 03:08:23 +0000 (03:08 +0000)]
amd8111e: use net_device_stats from struct net_device

struct net_device has its own struct net_device_stats member, so use
this one instead of a private copy in the amd8111e_priv struct.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoatl1c: use net_device_stats from struct net_device
Eric Dumazet [Fri, 20 Aug 2010 02:55:16 +0000 (02:55 +0000)]
atl1c: use net_device_stats from struct net_device

struct net_device has its own struct net_device_stats member, so use
this one instead of a private copy in the atl1c_adapter struct.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoPPTP: PPP over IPv4 (Point-to-Point Tunneling Protocol)
Dmitry Kozlov [Sun, 22 Aug 2010 06:05:39 +0000 (23:05 -0700)]
PPTP: PPP over IPv4 (Point-to-Point Tunneling Protocol)

PPP: introduce "pptp" module which implements point-to-point tunneling protocol using pppox framework
NET: introduce the "gre" module for demultiplexing GRE packets on version criteria
     (required to pptp and ip_gre may coexists)
NET: ip_gre: update to use the "gre" module

This patch introduces then pptp support to the linux kernel which
dramatically speeds up pptp vpn connections and decreases cpu usage in
comparison of existing user-space implementation
(poptop/pptpclient). There is accel-pptp project
(https://sourceforge.net/projects/accel-pptp/) to utilize this module,
it contains plugin for pppd to use pptp in client-mode and modified
pptpd (poptop) to build high-performance pptp NAS.

There was many changes from initial submitted patch, most important are:
1. using rcu instead of read-write locks
2. using static bitmap instead of dynamically allocated
3. using vmalloc for memory allocation instead of BITS_PER_LONG + __get_free_pages
4. fixed many coding style issues
Thanks to Eric Dumazet.

Signed-off-by: Dmitry Kozlov <xeb@mail.ru>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: rps: fix the wrong network header pointer
Changli Gao [Sat, 21 Aug 2010 06:13:28 +0000 (06:13 +0000)]
net: rps: fix the wrong network header pointer

__skb_get_rxhash() was broken after the commit:

 commit bfb564e7391340638afe4ad67744a8f3858e7566
 Author: Krishna Kumar <krkumar2@in.ibm.com>
 Date:   Wed Aug 4 06:15:52 2010 +0000

 core: Factor out flow calculation from get_rps_cpu

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet/sched: add ACT_CSUM action to update packets checksums
Grégoire Baron [Wed, 18 Aug 2010 13:10:35 +0000 (13:10 +0000)]
net/sched: add ACT_CSUM action to update packets checksums

net/sched: add ACT_CSUM action to update packets checksums

ACT_CSUM can be called just after ACT_PEDIT in order to re-compute some
altered checksums in IPv4 and IPv6 packets. The following checksums are
supported by this patch:
 - IPv4: IPv4 header, ICMP, IGMP, TCP, UDP & UDPLite
 - IPv6: ICMPv6, TCP, UDP & UDPLite
It's possible to request in the same action to update different kind of
checksums, if the packets flow mix TCP, UDP and UDPLite, ...

An example of usage is done in the associated iproute2 patch.

Version 3 changes:
 - remove useless goto instructions
 - improve IPv6 hop options decoding

Version 2 changes:
 - coding style correction
 - remove useless arguments of some functions
 - use stack in tcf_csum_dump()
 - add tcf_csum_skb_nextlayer() to factor code

Signed-off-by: Gregoire Baron <baronchon@n7mm.org>
Acked-by: jamal <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: build_ehash_secret() and rt_bind_peer() cleanups
Eric Dumazet [Thu, 19 Aug 2010 06:10:45 +0000 (06:10 +0000)]
net: build_ehash_secret() and rt_bind_peer() cleanups

Now cmpxchg() is available on all arches, we can use it in
build_ehash_secret() and rt_bind_peer() instead of using spinlocks.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlge: pull NULL check ahead of dereference
Dan Carpenter [Thu, 19 Aug 2010 08:52:44 +0000 (08:52 +0000)]
qlge: pull NULL check ahead of dereference

There was a dereference before NULL check issue introduced in 1e213303d
"qlge: Add tx multiqueue support."  I've pulled the NULL check of
"net_rsp" forward a couple lines to avoid that.

Also Ron Mercer says that the early exit should be above the index
write.  ql_write_cq_idx(rx_ring);

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotehuti: Use net_device_stats from struct net_device
Tobias Klauser [Wed, 18 Aug 2010 22:11:25 +0000 (22:11 +0000)]
tehuti: Use net_device_stats from struct net_device

struct net_device has its own struct net_device_stats member, so use
this one instead of a private copy in the bdx_priv struct.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoep93xx_eth: Use net_device_stats from struct net_device
Tobias Klauser [Wed, 18 Aug 2010 22:10:34 +0000 (22:10 +0000)]
ep93xx_eth: Use net_device_stats from struct net_device

struct net_device has its own struct net_device_stats member, so use
this one instead of a private copy in the ep93xx_priv struct. As the new
ndo_get_stats function would just return dev->stats we can omit it.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet_sched: sch_sfq: use proto_ports_offset() to support AH message
Changli Gao [Tue, 17 Aug 2010 19:07:35 +0000 (19:07 +0000)]
net_sched: sch_sfq: use proto_ports_offset() to support AH message

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetfilter: xt_hashlimit: use proto_ports_offset() to support AH message
Changli Gao [Tue, 17 Aug 2010 19:06:39 +0000 (19:06 +0000)]
netfilter: xt_hashlimit: use proto_ports_offset() to support AH message

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetfilter: ipt_CLUSTERIP: use proto_ports_offset() to support AH message
Changli Gao [Tue, 17 Aug 2010 20:34:40 +0000 (20:34 +0000)]
netfilter: ipt_CLUSTERIP: use proto_ports_offset() to support AH message

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet_sched: cls_flow: use proto_ports_offset() to support AH message
Changli Gao [Tue, 17 Aug 2010 19:05:08 +0000 (19:05 +0000)]
net_sched: cls_flow: use proto_ports_offset() to support AH message

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: rps: use proto_ports_offset() to handle the AH message correctly
Changli Gao [Tue, 17 Aug 2010 19:04:32 +0000 (19:04 +0000)]
net: rps: use proto_ports_offset() to handle the AH message correctly

The SPI isn't at the beginning of an AH message.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: introduce proto_ports_offset()
Changli Gao [Tue, 17 Aug 2010 19:03:44 +0000 (19:03 +0000)]
net: introduce proto_ports_offset()

Introduce proto_ports_offset() for getting the position of the ports or
SPI in the message of a protocol.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: rps: skip fragment when computing rxhash
Changli Gao [Tue, 17 Aug 2010 19:01:38 +0000 (19:01 +0000)]
net: rps: skip fragment when computing rxhash

Fragmented IP packets may have no transfer header, so when computing
rxhash, we should skip them.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: rps: reset network header before calling skb_get_rxhash()
Changli Gao [Tue, 17 Aug 2010 19:00:56 +0000 (19:00 +0000)]
net: rps: reset network header before calling skb_get_rxhash()

skb_get_rxhash() assumes the network header pointer of the skb is set
properly after the commit:

commit bfb564e7391340638afe4ad67744a8f3858e7566
Author: Krishna Kumar <krkumar2@in.ibm.com>
Date:   Wed Aug 4 06:15:52 2010 +0000

    core: Factor out flow calculation from get_rps_cpu

Signed-off-by: Changli Gao <xiaosuo@gmail.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...
David S. Miller [Thu, 19 Aug 2010 23:54:13 +0000 (16:54 -0700)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6

13 years agoqlcnic: update version 5.0.8
Amit Kumar Salecha [Thu, 19 Aug 2010 05:08:33 +0000 (05:08 +0000)]
qlcnic: update version 5.0.8

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: rom lock recovery
Sucheta Chakraborty [Thu, 19 Aug 2010 05:08:32 +0000 (05:08 +0000)]
qlcnic: rom lock recovery

Fw can get stuck while holding pci semaphore. Driver will not
be able to perform fw initialization, without this lock.
Release semaphore forcefully in that case.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: firmware initialization update
Sony Chacko [Thu, 19 Aug 2010 05:08:31 +0000 (05:08 +0000)]
qlcnic: firmware initialization update

Cleanup legacy code which is not valid for Qlogic
CNA adapters.

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 agoqlcnic: fix endiness in eswitch statistics
Amit Kumar Salecha [Thu, 19 Aug 2010 05:08:30 +0000 (05:08 +0000)]
qlcnic: fix endiness in eswitch statistics

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: mark device state as failed
Amit Kumar Salecha [Thu, 19 Aug 2010 05:08:29 +0000 (05:08 +0000)]
qlcnic: mark device state as failed

Mark device state failed in error path.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: fix npar state
Amit Kumar Salecha [Thu, 19 Aug 2010 05:08:28 +0000 (05:08 +0000)]
qlcnic: fix npar state

Privilege functions should wait for npar state to be operational.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: support anti mac spoofing
Sony Chacko [Thu, 19 Aug 2010 05:08:27 +0000 (05:08 +0000)]
qlcnic: support anti mac spoofing

Administrator can configure to drop packet in transmit,
if it doesn't match interface mac address, in case of virtual function.

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 agoqlcnic: configure offload setting on eswitch
Rajesh Borundia [Thu, 19 Aug 2010 05:08:26 +0000 (05:08 +0000)]
qlcnic: configure offload setting on eswitch

Device is not capable of enabling/disabling offload setting per
port in case of Nic Partition.So offload settings needs to be
enabled/disabled per eswitch and it will affect all the function
on that eswitch.

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: configure port on eswitch
Rajesh Borundia [Thu, 19 Aug 2010 05:08:25 +0000 (05:08 +0000)]
qlcnic: configure port on eswitch

o Nic partition capable devices has embedded switch, this needs to support
various features like external switch.

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: replace magic numbers with defines
Sony Chacko [Thu, 19 Aug 2010 05:08:24 +0000 (05:08 +0000)]
qlcnic: replace magic numbers with defines

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: remove unused code
Sony Chacko [Thu, 19 Aug 2010 05:08:23 +0000 (05:08 +0000)]
qlcnic: remove unused code

Serial number references are not used in driver.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: fix inconsistent lock state
Amit Kumar Salecha [Thu, 19 Aug 2010 05:08:22 +0000 (05:08 +0000)]
qlcnic: fix inconsistent lock state

Spin_lock(rds_ring->lock) is not required while posting buffers
from qlcnic_open and freeing buffers from qlcnic_down.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>