safe/jmp/linux-2.6
15 years agocfg80211: return immediately if num reg rules > NL80211_MAX_SUPP_REG_RULES
Luis R. Rodriguez [Wed, 13 May 2009 21:04:39 +0000 (17:04 -0400)]
cfg80211: return immediately if num reg rules > NL80211_MAX_SUPP_REG_RULES

This has no functional change except we save a kfree(rd) and
allows us to clean this code up a bit after this. We do
avoid an unnecessary kfree(NULL) but calling that was OK too.

Cc: stable@kernel.org
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agowireless: fix to set dev->broadcast correctly
Wei Yongjun [Wed, 13 May 2009 01:47:38 +0000 (09:47 +0800)]
wireless: fix to set dev->broadcast correctly

This patch fix to set dev->broadcast correctly, since
dev->broadcast is defined as:
  unsigned char broadcast[MAX_ADDR_LEN];

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoStaging: agnx: switch config_interface to bss_info_changed
Alexander Beregalov [Tue, 12 May 2009 11:23:13 +0000 (15:23 +0400)]
Staging: agnx: switch config_interface to bss_info_changed

Fix this build error:
drivers/staging/agnx/pci.c: In function 'agnx_config_interface':
drivers/staging/agnx/pci.c:315: error: dereferencing pointer to incomplete type
..
drivers/staging/agnx/pci.c:424: error: unknown field 'config_interface' specified in initializer

config_interface was removed in 2d0ddec5b2b
("mac80211: unify config_interface and bss_info_changed")

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Move PS wakeup/restore calls from isr to tasklet
Vasanthakumar Thiagarajan [Fri, 15 May 2009 06:47:16 +0000 (02:47 -0400)]
ath9k: Move PS wakeup/restore calls from isr to tasklet

We do not need to do this in ath_isr() and it looks like the modified
version ends up being more stable as far as being able receive beacon
frames is concerned. Furthermore, this reduces need to move between
AWAKE and NETWORK SLEEP states when processing some unrelated
interrupts.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: allow wext to remove keys that don't exist
Johannes Berg [Mon, 18 May 2009 17:56:36 +0000 (19:56 +0200)]
cfg80211: allow wext to remove keys that don't exist

Some applications using wireless extensions expect to be able to
remove a key that doesn't exist. One example is wpa_supplicant
which doesn't actually change behaviour when running into an
error while trying to do that, but it prints an error message
which users interpret as wpa_supplicant having problems.

The safe thing to do is not change the behaviour of wireless
extensions any more, so when the driver reports -ENOENT let
the wext bridge code return success to userspace. To guarantee
this, also document that drivers should return -ENOENT when the
key doesn't exist.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211_hwsim: Group radios
Daniel Wagner [Mon, 18 May 2009 17:49:25 +0000 (19:49 +0200)]
mac80211_hwsim: Group radios

Currently all radios receive all traffic on the simulated air
if they are tuned to the same channel. This patch introduces
the concept of grouping, which allows to assign a radio to
certain group. Only radios in the same group can 'see' each other.

Each bit in /debug/ieee80211/phy*/hwsim/group
represents one group. By default all radios belong to the same group "1",
e.g. bit 1 is set. Additionally a radio can belong to several groups.

Signed-off-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: update beacons in AP mode
Bob Copeland [Mon, 18 May 2009 14:59:52 +0000 (10:59 -0400)]
ath5k: update beacons in AP mode

ath5k only generated the beacon when bss_info_changed() was called,
but for AP mode this is not enough, because the TIM IE would never
get updated and consequently PS mode clients wouldn't know about
buffered frames.  Instead, get a new beacon on every SWBA interrupt.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54spi: drop test for FW_STATE_RESET in p54spi_work
Max Filippov [Mon, 18 May 2009 17:28:55 +0000 (21:28 +0400)]
p54spi: drop test for FW_STATE_RESET in p54spi_work

Drop test for FW_STATE_RESET in p54spi_work as fw_state
is never assigned this value.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agob43/legacy: fix beacon change processing
Johannes Berg [Mon, 18 May 2009 08:53:18 +0000 (10:53 +0200)]
b43/legacy: fix beacon change processing

Process beacon change even if the BSSID doesn't
change at the same time. Also fix what I think
is a small locking error in b43legacy, there's
a spin_unlock_irqrestore that looks out of place.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54spi: use firmware/DMA bug workaround that work under hight load in p54spi_rx
Max Filippov [Sun, 17 May 2009 23:02:35 +0000 (03:02 +0400)]
p54spi: use firmware/DMA bug workaround that work under hight load in p54spi_rx

Under high load first data word, read after available data size
is sometimes lost in p54spi_rx. It seems to depend on frequency
of interrupts and latency of data read request relatively to
'data available' interrupt. The worst consequence of this bug
is loss of packet transmission acknowledgement, which in turn
causes overflow of tx queues and permanent link loss.

Read data size and first data word in one SPI transaction.
No packets from LMAC should have length less than 1 word,
so this shouldn't interfere with the next read transaction.

Also call p54spi_sleep if p54spi_wake succeeded.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54spi: always call p54spi_sleep in p54spi_tx_frame if p54spi_wakeup succeeded
Max Filippov [Sun, 17 May 2009 23:02:34 +0000 (03:02 +0400)]
p54spi: always call p54spi_sleep in p54spi_tx_frame if p54spi_wakeup succeeded

Put chip into sleep state, once it's been awaken.
Also, propagate error code to the caller.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54spi: return status of p54spi_wakeup
Max Filippov [Sun, 17 May 2009 23:02:33 +0000 (03:02 +0400)]
p54spi: return status of p54spi_wakeup

Return whether wakeup operation succeeded.
Make use of this return value.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54spi: cosmetic fixes: use even byte count in SPI write; drop unused interrupt statu...
Max Filippov [Sun, 17 May 2009 23:02:32 +0000 (03:02 +0400)]
p54spi: cosmetic fixes: use even byte count in SPI write; drop unused interrupt status read

When SPI write of odd length is requested, p54spi_write splits it
into two parts: one for all data, except the last byte, and one
for last byte and padding byte. Unfortunately, the length of
first part is not amended. It works because all meaningful bytes
have proper value and the last byte of odd length SPI write
transaction is ignored.

p54spi_work has dummy HOST_INTERRUPTS register read at the end.
Drop it, as its result is not used and it has no side effects.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54spi: fix incorrect access sequence to DMA_WRITE_CTRL in p54spi_spi_write_dma
Max Filippov [Sun, 17 May 2009 23:02:31 +0000 (03:02 +0400)]
p54spi: fix incorrect access sequence to DMA_WRITE_CTRL in p54spi_spi_write_dma

Host is not allowed to modify DMA_WRITE_CTRL register
if bit HOST_ALLOWED in it is not set. Wait for HOST_ALLOWED first.

Also get rid of timeout in p54spi_wait_bit as it's been playing
a role of workaround for such an incorrect register access.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agodrivers/net: use dev_get_drvdata
Julia Lawall [Sun, 17 May 2009 09:28:42 +0000 (11:28 +0200)]
drivers/net: use dev_get_drvdata

Eliminate direct accesses to the driver_data field.
cf 82ab13b26f15f49be45f15ccc96bfa0b81dfd015

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
struct device *dev;
expression E;
type T;
@@

- dev->driver_data = (T)E
+ dev_set_drvdata(dev, E)

@@
struct device *dev;
type T;
@@

- (T)dev->driver_data
+ dev_get_drvdata(dev)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: mark wiphy->privid as pointer to const
David Kilroy [Sat, 16 May 2009 22:13:47 +0000 (23:13 +0100)]
cfg80211: mark wiphy->privid as pointer to const

This allows drivers to use a const pointer as the privid without a cast.

Signed-off-by: David Kilroy <kilroyd@gmail.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: mark ops as pointer to const
David Kilroy [Sat, 16 May 2009 22:13:46 +0000 (23:13 +0100)]
cfg80211: mark ops as pointer to const

This allows drivers to mark their cfg80211_ops tables const.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: drop iwl3945_tid_data
Tomas Winkler [Fri, 15 May 2009 23:13:44 +0000 (16:13 -0700)]
iwlwifi: drop iwl3945_tid_data

This patch is one of the incremental steps for unifying iwl_station_entry
for all HWs, i.e. removing of iwl3945_station_entry
This patch drops iwl3945_tid_data and use iwl_tid_data instead.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: drop struct iwl3945_hw_key
Tomas Winkler [Fri, 15 May 2009 23:13:43 +0000 (16:13 -0700)]
iwlwifi: drop struct iwl3945_hw_key

This patch replaces struct iwl3945_hw_key by struct iwl_hw_key.
It's not used directly with any host command therefore removal is trivial

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agob43legacy: Remove unnecessary MMIO in interrupt hotpath
Stefano Brivio [Fri, 15 May 2009 20:39:20 +0000 (15:39 -0500)]
b43legacy: Remove unnecessary MMIO in interrupt hotpath

This removes unnecessary MMIO accesses in the interrupt hotpath. The
patch by Michael Buesch for b43 has been ported to b43legacy.

Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: cleanup beacon parameters configuration
Vasanthakumar Thiagarajan [Fri, 15 May 2009 13:29:22 +0000 (18:59 +0530)]
ath9k: cleanup beacon parameters configuration

This patch configures the beacon timers with beacon interval
and beacon period passed through vif.bss_conf. Also cache the
currecnt beacon configuration which will be used to configure
the beacon timers when the driver triggers it after reset.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Remove unused parameters which are passed to ath_beacon_config_X()
Vasanthakumar Thiagarajan [Fri, 15 May 2009 13:29:21 +0000 (18:59 +0530)]
ath9k: Remove unused parameters which are passed to ath_beacon_config_X()

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Print hw reset failure status as signed int
Vasanthakumar Thiagarajan [Fri, 15 May 2009 13:29:20 +0000 (18:59 +0530)]
ath9k: Print hw reset failure status as signed int

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: cancel/restart all timers across suspend/resume
Johannes Berg [Sun, 17 May 2009 09:40:42 +0000 (11:40 +0200)]
mac80211: cancel/restart all timers across suspend/resume

We forgot to cancel all timers in mac80211 when suspending.
In particular we forgot to deal with some things that can
cause hardware reconfiguration -- while it is down.

While at it we go ahead and add a warning in ieee80211_sta_work()
if its run while the suspend->resume cycle is in effect. This
should not happen and if it does it would indicate there is
a bug lurking in either mac80211 or mac80211 drivers.

With this now wpa_supplicant doesn't blink when I go to suspend
and resume where as before there where issues with some timers
running during the suspend->resume cycle. This caused a lot of
incorrect assumptions and would at times bring back the device
in an incoherent, but mostly recoverable, state.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: move channel switch code
Johannes Berg [Fri, 15 May 2009 09:52:31 +0000 (11:52 +0200)]
mac80211: move channel switch code

The channel switch code is currently in the spectrum
management file, where arguably it belongs. However,
it is for managed mode only and uses the structures
for that mode only so having it in a more generic
file can be confusing. Additionally, my next patch
gets simpler with the code here.

When/if we ever implement this for IBSS or mesh then
we will need to rework the structures it uses anyway
at which point we could move the code back.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agonl80211: Validate NL80211_ATTR_KEY_SEQ length
Jouni Malinen [Fri, 15 May 2009 09:38:32 +0000 (12:38 +0300)]
nl80211: Validate NL80211_ATTR_KEY_SEQ length

Validate RSC (NL80211_ATTR_KEY_SEQ) length in nl80211/cfg80211 instead
of having to do this in all the drivers.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Fix PS mode operation to receive buffered broadcast/multicast frames
Jouni Malinen [Thu, 14 May 2009 18:28:48 +0000 (21:28 +0300)]
ath9k: Fix PS mode operation to receive buffered broadcast/multicast frames

The previous implementation was moving back to NETWORK SLEEP state
immediately after receiving a Beacon frame. This means that we are
unlikely to receive all the buffered broadcast/multicast frames that
would be sent after DTIM Beacon frames. Fix this by parsing the Beacon
frame and remaining awake, if needed, to receive the buffered
broadcast/multicast frames. The last buffered frame will trigger the
move back into NETWORK SLEEP state.

If the last broadcast/multicast frame is not received properly (or if
the AP fails to send it), the next Beacon frame will work as a backup
trigger for returning into NETWORK SLEEP.

A new debug type, PS (debug=0x800 module parameter), is added to make
it easier to debug potential power save issues in the
future. Currently, this is only used for the Beacon frame and buffered
broadcast/multicast receiving.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Clean up RX processing a bit
Jouni Malinen [Thu, 14 May 2009 18:28:47 +0000 (21:28 +0300)]
ath9k: Clean up RX processing a bit

This makes use of the local fc variable in bit more places and uses a
common helper macro. The part of RX process that delivers skb's to
mac80211 is moved to a separate function in preparation for future
changes that will need to do this from two places. The modifications
here should not result in any functional changes.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Fix a check for multicast address for virtual wiphy
Jouni Malinen [Thu, 14 May 2009 18:28:46 +0000 (21:28 +0300)]
ath9k: Fix a check for multicast address for virtual wiphy

The broadcast bit is in the first, not the last octet..

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: Cancel pending probereq poll on beacon RX
Jouni Malinen [Thu, 14 May 2009 18:15:36 +0000 (21:15 +0300)]
mac80211: Cancel pending probereq poll on beacon RX

While the probe request poll is expected to work, it looks like it
does not always result in getting a response. The exact reason for
this is unclear, but anyway, if we do receive a Beacon frame from our
AP, there is no need to disconnect based on the probereq poll. This
seems to help keep the connection bit more stable in cases where
beacon loss is occurring semi-frequently.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agozd1211rw: Replace ZD_CS_MULTICAST with ZD_CS_NO_ACK
Gábor Stefanik [Thu, 14 May 2009 17:34:59 +0000 (17:34 +0000)]
zd1211rw: Replace ZD_CS_MULTICAST with ZD_CS_NO_ACK

According to my tests, all that ZD_CS_MULTICAST does is to
disable retrying/waiting for an ACK. Reflect this by renaming
the bit to ZD_CS_NO_ACK and setting it based on
IEEE80211_TX_CTL_NO_ACK, instead of is_multicast_ether_addr.

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: Initialize RX's last received sequence number
Senthil Balasubramanian [Thu, 14 May 2009 13:12:08 +0000 (18:42 +0530)]
mac80211: Initialize RX's last received sequence number

The STA may drop the very first frame if it happens to be a retried
frame. This is because we maintian the last received sequence number
per TID for QoS frames and it is initialized to zero through kzalloc
during sta_info_alloc and the sequence number of the very first date
frame received would be ZERO (as per IEEE 802.11-2007, 7.1.3.4.1).

If the frame dropped happens to be an EAP Request Identity(very first
frame from the AP), then wpa_supplicnat disconnects the STA and the
whole procedure starts again.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: add debugfs HT40 allow map
Luis R. Rodriguez [Sat, 2 May 2009 04:39:30 +0000 (00:39 -0400)]
cfg80211: add debugfs HT40 allow map

Here's a screenshot of what this looks like with ath9k:

mcgrof@pogo /debug/ieee80211/phy0 $ cat ht40allow_map
2412 HT40  +
2417 HT40  +
2422 HT40  +
2427 HT40  +
2432 HT40 -+
2437 HT40 -+
2442 HT40 -+
2447 HT40 -
2452 HT40 -
2457 HT40 -
2462 HT40 -
2467 Disabled
2472 Disabled
2484 Disabled
5180 HT40  +
5200 HT40 -+
5220 HT40 -+
5240 HT40 -+
5260 HT40 -+
5280 HT40 -+
5300 HT40 -+
5320 HT40 -
5500 HT40  +
5520 HT40 -+
5540 HT40 -+
5560 HT40 -+
5580 HT40 -+
5600 HT40 -+
5620 HT40 -+
5640 HT40 -+
5660 HT40 -+
5680 HT40 -+
5700 HT40 -
5745 HT40  +
5765 HT40 -+
5785 HT40 -+
5805 HT40 -+
5825 HT40 -

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211/cfg80211: move wiphy specific debugfs entries to cfg80211
Luis R. Rodriguez [Sat, 2 May 2009 04:37:21 +0000 (00:37 -0400)]
mac80211/cfg80211: move wiphy specific debugfs entries to cfg80211

This moves the cfg80211 specific stuff to new cfg80211 debugfs
entries. Non-mac80211 will also get these entries now. There were
only 4 which we take:

rts_threshold
fragmentation_threshold
short_retry_limit
long_retry_limit

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: check allowed channel type upon userspace requests
Luis R. Rodriguez [Sat, 2 May 2009 04:37:20 +0000 (00:37 -0400)]
cfg80211: check allowed channel type upon userspace requests

Thanks to nl80211 userspace can be very specific upon device
configuration. Before processing the request for the new HT40
channel types (HT40- or HT40+) we need to ensure we can use them
regulatory-wise. This wasn't required with wireless extensions as
specifying the channel type wasn't not available and configuration
was done towards the end implicitly upon association or reception
of beacons from the AP. For the new nl80211 we have to check this
when configuring the interfaces explicitly.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: check if HT40+/- is allowed before sending assoc
Luis R. Rodriguez [Sat, 2 May 2009 04:37:19 +0000 (00:37 -0400)]
mac80211: check if HT40+/- is allowed before sending assoc

We weren't checking this at all.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agowireless: rename IEEE80211_CHAN_NO_FAT_* to HT40-/+
Luis R. Rodriguez [Sat, 2 May 2009 04:37:18 +0000 (00:37 -0400)]
wireless: rename IEEE80211_CHAN_NO_FAT_* to HT40-/+

This is more consistent with our nl80211 naming convention
for HT40-/+.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: Process regulatory max bandwidth checks for HT40
Luis R. Rodriguez [Sat, 2 May 2009 04:37:17 +0000 (00:37 -0400)]
cfg80211: Process regulatory max bandwidth checks for HT40

We are not correctly listening to the regulatory max bandwidth
settings. To actually make use of it we need to redesign things
a bit. This patch does the work for that. We do this to so we
can obey to regulatory rules accordingly for use of HT40.

We end up dealing with HT40 by having two passes for each channel.

The first check will see if a 20 MHz channel fits into the channel's
center freq on a given frequency range. We check for a 20 MHz
banwidth channel as that is the maximum an individual channel
will use, at least for now. The first pass will go ahead and
check if the regulatory rule for that given center of frequency
allows 40 MHz bandwidths and we use this to determine whether
or not the channel supports HT40 or not. So to support HT40 you'll
need at a regulatory rule that allows you to use 40 MHz channels
but you're channel must also be enabled and support 20 MHz by itself.

The second pass is done after we do the regulatory checks over
an device's supported channel list. On each channel we'll check
if the control channel and the extension both:

 o exist
 o are enabled
 o regulatory allows 40 MHz bandwidth on its frequency range

This work allows allows us to idependently check for HT40- and
HT40+.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agosfc: Remove lro module parameter
Ben Hutchings [Tue, 19 May 2009 23:19:08 +0000 (16:19 -0700)]
sfc: Remove lro module parameter

GRO/LRO can be controlled through ethtool so this is unnecessary.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosit: stateless autoconf for isatap
Sascha Hlusiak [Tue, 19 May 2009 12:56:52 +0000 (12:56 +0000)]
sit: stateless autoconf for isatap

be sent periodically. The rs_delay can be speficied when adding the
PRL entry and defaults to 15 minutes.

The RS is sent from every link local adress that's assigned to the
tunnel interface. It's directed to the (guessed) linklocal address
of the router and is sent through the tunnel.

Better: send to ff02::2 encapsuled in unicast directed to router-v4.

Signed-off-by: Sascha Hlusiak <contact@saschahlusiak.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoaddrconf: refuse isatap eui64 for INADDR_ANY
Sascha Hlusiak [Tue, 19 May 2009 12:56:51 +0000 (12:56 +0000)]
addrconf: refuse isatap eui64 for INADDR_ANY

A tunnel with no local ipv4 endpoint would otherwise use the
ISATAP linklocal address fe80::5efe:0:0, which is invalid. Rather not
add a linklocal address at all.

Signed-off-by: Sascha Hlusiak <contact@saschahlusiak.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosit: ipip6_tunnel_del_prl: return err
Sascha Hlusiak [Tue, 19 May 2009 12:56:50 +0000 (12:56 +0000)]
sit: ipip6_tunnel_del_prl: return err

Typo. When deleting a PRL entry, return status to userspace
instead of success.

Signed-off-by: Sascha Hlusiak <contact@saschahlusiak.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosit: strictly restrict incoming traffic to tunnel link device
Sascha Hlusiak [Tue, 19 May 2009 12:56:49 +0000 (12:56 +0000)]
sit: strictly restrict incoming traffic to tunnel link device

Check link device when looking up a tunnel. When a tunnel is
linked to a interface, traffic from a different interface must not
reach the tunnel.

This also allows creating of multiple tunnels with the same
endpoints, if the link device differs.

Signed-off-by: Sascha Hlusiak <contact@saschahlusiak.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosit: Fail to create tunnel, if it already exists
Sascha Hlusiak [Tue, 19 May 2009 12:56:48 +0000 (12:56 +0000)]
sit: Fail to create tunnel, if it already exists

When locating the tunnel, do not continue if it is found. Otherwise
a different tunnel with similar configuration would be returned and
parts could be overwritten.

Signed-off-by: Sascha Hlusiak <contact@saschahlusiak.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipv4: teach ipconfig about the MTU option in DHCP
Chris Friesen [Tue, 19 May 2009 22:31:50 +0000 (15:31 -0700)]
ipv4: teach ipconfig about the MTU option in DHCP

The DHCP spec allows the server to specify the MTU.  This can be useful
for netbooting with UDP-based NFS-root on a network using jumbo frames.
This patch allows the kernel IP autoconfiguration to handle this option
correctly.

It would be possible to use initramfs and add a script to set the MTU,
but that seems like a complicated solution if no initramfs is otherwise
necessary, and would bloat the kernel image more than this code would.

This patch was originally submitted to LKML in 2003 by Hans-Peter Jansen.

Signed-off-by: Chris Friesen <cfriesen@nortel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: use NLMSG_DEFAULT_SIZE in nlmsg_new() allocations
Pablo Neira Ayuso [Tue, 19 May 2009 22:27:55 +0000 (15:27 -0700)]
net: use NLMSG_DEFAULT_SIZE in nlmsg_new() allocations

nlmsg_new() adds the size of the netlink header to the value
that has been passed as parameter. If NLMSG_GOODSIZE is selected,
we request an allocation of one memory page plus the size of the
header. Instead, NLMSG_DEFAULT_SIZE should be used since it
already substracts the size of the Netlink header.

I have the impression that the similar naming in both constant
is error prone when using it with nlmsg_new(). This is already
documented in include/net/netlink.h

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomyri10ge: update version to 1.5.0-1.415
Brice Goglin [Tue, 19 May 2009 10:16:11 +0000 (10:16 +0000)]
myri10ge: update version to 1.5.0-1.415

Update myri10ge driver version to 1.5.0-1.415.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomyri10ge: allow LRO to be enabled via ethtool
Brice Goglin [Tue, 19 May 2009 10:15:32 +0000 (10:15 +0000)]
myri10ge: allow LRO to be enabled via ethtool

Allow myri10ge LRO to be enabled/disabled via ethtool
(and by the stack for packet forwarding).

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosch_teql: Use net_device internal stats
Eric Dumazet [Tue, 19 May 2009 22:16:34 +0000 (15:16 -0700)]
sch_teql: Use net_device internal stats

We can slightly reduce size of teqlN structure, not duplicating stats
structure in teql_master but using stats field from net_device.stats
for tx_errors and from netdev_queue for tx_bytes/tx_packets/tx_dropped
values.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Cleanup feature setup code to make the code more readable
Jesse Brandeburg [Tue, 19 May 2009 09:19:11 +0000 (09:19 +0000)]
ixgbe: Cleanup feature setup code to make the code more readable

This is purely a cleanup patch.  This collapses some of the code required
when we configure our Tx and Rx feature sets, and makes the code more
readable and maintainable.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Change Direct Attach Twinax cable detection for SFP+ NICs
Peter P Waskiewicz Jr [Tue, 19 May 2009 09:18:51 +0000 (09:18 +0000)]
ixgbe: Change Direct Attach Twinax cable detection for SFP+ NICs

The SFF specification for Direct Attach cable detection has now been
ratified.  Previously, DA cable detect was looking at the Twinaxial bit in
byte 9 of the SFP+ EEPROM.  The spec now defines active and passive DA
cables in byte 8 of the SFP+ EEPROM.  This patch changes the cable
detection for both 82598 and 82599 SFP+ adapters to conform to the new
spec.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Add semaphore access for PHY initialization for 82599
Peter P Waskiewicz Jr [Tue, 19 May 2009 09:18:34 +0000 (09:18 +0000)]
ixgbe: Add semaphore access for PHY initialization for 82599

The SFP+ NIC (device id 0x10fb) needs a semaphore to serialize
PHY access, so our PHY init code must honor that same semaphore.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agor8169: allow true forced mode setting
françois romieu [Tue, 19 May 2009 10:46:48 +0000 (10:46 +0000)]
r8169: allow true forced mode setting

Due to mostly historic reasons, including a lack of reliability
of the link handling (especially with the older 8169), the
current r8169 driver emulates forced mode setting by limiting
the advertised modes.

With this change the driver allows real 10/100 forced mode
settings on the 8169 and 8101/8102.

Original idea by Vincent Steenhoute. The RTL_GIGA_MAC_VER_03
tweak was extracted from Realtek's r8169 v6.010.00 driver.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Tested-by: Jean Delvare <jdelvare@suse.de>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agor8169: remove useless struct member
françois romieu [Thu, 14 May 2009 11:45:04 +0000 (11:45 +0000)]
r8169: remove useless struct member

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoppp: unset IFF_XMIT_DST_RELEASE in ppp_setup()
Eric Dumazet [Tue, 19 May 2009 21:24:37 +0000 (14:24 -0700)]
ppp: unset IFF_XMIT_DST_RELEASE in ppp_setup()

Jarek pointed pppoe can call back dev_queue_xmit(), and might need
skb->dst, so its safer to unset IFF_XMIT_DST_RELEASE on ppp devices.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: release dst entry in dev_hard_start_xmit()
Eric Dumazet [Tue, 19 May 2009 05:19:19 +0000 (22:19 -0700)]
net: release dst entry in dev_hard_start_xmit()

One point of contention in high network loads is the dst_release() performed
when a transmited skb is freed. This is because NIC tx completion calls
dev_kree_skb() long after original call to dev_queue_xmit(skb).

CPU cache is cold and the atomic op in dst_release() stalls. On SMP, this is
quite visible if one CPU is 100% handling softirqs for a network device,
since dst_clone() is done by other cpus, involving cache line ping pongs.

It seems right place to release dst is in dev_hard_start_xmit(), for most
devices but ones that are virtual, and some exceptions.

David Miller suggested to define a new device flag, set in alloc_netdev_mq()
(so that most devices set it at init time), and carefuly unset in devices
which dont want a NULL skb->dst in their ndo_start_xmit().

List of devices that must clear this flag is :

- loopback device, because it calls netif_rx() and quoting Patrick :
    "ip_route_input() doesn't accept loopback addresses, so loopback packets
     already need to have a dst_entry attached."
- appletalk/ipddp.c : needs skb->dst in its xmit function

- And all devices that call again dev_queue_xmit() from their xmit function
(as some classifiers need skb->dst) : bonding, vlan, macvlan, eql, ifb, hdlc_fr

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: FIX bonding sysfs rtnl_lock deadlock
Eric W. Biederman [Wed, 13 May 2009 17:02:50 +0000 (17:02 +0000)]
net: FIX bonding sysfs rtnl_lock deadlock

Sysfs files for a network device can not unconditionally take the
rtnl_lock as the bonding sysfs files do.  If someone accesses those
sysfs files while the network device is being unregistered with the
rtnl_lock held we will deadlock.

So use trylock and restart_syscall to avoid this problem.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Fix ipoib rtnl_lock sysfs deadlock.
Eric W. Biederman [Wed, 13 May 2009 17:01:51 +0000 (17:01 +0000)]
net: Fix ipoib rtnl_lock sysfs deadlock.

Network device sysfs files that grab the rtnl_lock unconditionally
will deadlock if accessed when the network device is being
unregistered.  So use trylock and syscall_restart to avoid this
deadlock.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Fix bridgeing sysfs handling of rtnl_lock
Eric W. Biederman [Wed, 13 May 2009 17:00:41 +0000 (17:00 +0000)]
net: Fix bridgeing sysfs handling of rtnl_lock

Holding rtnl_lock when we are unregistering the sysfs files can
deadlock if we unconditionally take rtnl_lock in a sysfs file.  So fix
it with the now familiar patter of: rtnl_trylock and syscall_restart()

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Fix devinet_sysctl_forward
Eric W. Biederman [Wed, 13 May 2009 16:59:21 +0000 (16:59 +0000)]
net: Fix devinet_sysctl_forward

sysctls are unregistered with the rntl_lock held making
it unsafe to unconditionally grab the the rtnl_lock.  Instead
we need to call rtnl_trylock and restart the system call
if we can not grab it.  Otherwise we could deadlock at unregistration
time.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: FIX ipv6_forward sysctl restart
Eric W. Biederman [Wed, 13 May 2009 16:58:17 +0000 (16:58 +0000)]
net: FIX ipv6_forward sysctl restart

Just returning -ERESTARTSYS without a signal pending is not
good that will just leak it to userspace.  We need return
-ERESTARTNOINTR so we always restart and set signal pending
so that we fall of the fast path of syscall return and setup
the system call restart.

So use restart_syscall() which does all of this for us.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet-sysfs: Use rtnl_trylock in sysfs methods.
Eric W. Biederman [Wed, 13 May 2009 16:57:25 +0000 (16:57 +0000)]
net-sysfs: Use rtnl_trylock in sysfs methods.

The earlier patch to fix the deadlock between a network device going
away and writing to sysfs attributes was incomplete.
- It did not set signal_pending so we would leak ERSTARTSYS to user space.
- It used ERESTARTSYS which only restarts if sigaction configures it to.
- It did not cover store and show for ifalias.

So fix all of these up and use the new helper restart_syscall so we get
the details correct on what it takes.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosyscall: Implement a convinience function restart_syscall
Eric W. Biederman [Wed, 13 May 2009 16:55:10 +0000 (16:55 +0000)]
syscall: Implement a convinience function restart_syscall

Currently when we have a signal pending we have the functionality
to restart that the current system call.  There are other cases
such as nasty lock ordering issues where it makes sense to have
a simple fix that uses try lock and restarts the system call.
Buying time to figure out how to rework the locking strategy.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: TX_RING and packet mmap
Johann Baudy [Tue, 19 May 2009 05:11:22 +0000 (22:11 -0700)]
net: TX_RING and packet mmap

New packet socket feature that makes packet socket more efficient for
transmission.

- It reduces number of system call through a PACKET_TX_RING mechanism,
  based on PACKET_RX_RING (Circular buffer allocated in kernel space
  which is mmapped from user space).

- It minimizes CPU copy using fragmented SKB (almost zero copy).

Signed-off-by: Johann Baudy <johann.baudy@gnu-log.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: fix msi irq setup
Dhananjay Phadke [Tue, 19 May 2009 04:46:40 +0000 (21:46 -0700)]
netxen: fix msi irq setup

The pdev->irq was not saved in netxen_adapter, causing request_irq()
with invalid irq number.

This was broken in commit be339aee634d5cb98a8df8d6febe04002ec497f3
("netxen: fix irq tear down and msix leak.").

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Tue, 19 May 2009 04:08:20 +0000 (21:08 -0700)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

Conflicts:
drivers/scsi/fcoe/fcoe.c

15 years agopkt_sched: gen_estimator: use 64 bit intermediate counters for bps
Eric Dumazet [Tue, 19 May 2009 02:26:37 +0000 (19:26 -0700)]
pkt_sched: gen_estimator: use 64 bit intermediate counters for bps

gen_estimator can overflow bps (bytes per second) with Gb links, while
it was designed with a u32 API, with a theorical limit of 34360Mbit
(2^32 bytes)

Using 64 bit intermediate avbps/brate counters can allow us to reach
this theorical limit.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoThe patch adds support for the PCI cards: PCIcan and PCIcanx (1, 2 or 4 channel)...
Wolfgang Grandegger [Fri, 15 May 2009 23:39:33 +0000 (23:39 +0000)]
The patch adds support for the PCI cards: PCIcan and PCIcanx (1, 2 or 4 channel) from Kvaser (kvaser.com).

Signed-off-by: Per Dalen <per.dalen@cnw.se>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocan: SJA1000 driver for EMS PCI cards
Wolfgang Grandegger [Fri, 15 May 2009 23:39:32 +0000 (23:39 +0000)]
can: SJA1000 driver for EMS PCI cards

The patch adds support for the one or two channel CPC-PCI and CPC-PCIe
cards from EMS Dr. Thomas Wuensche (http://www.ems-wuensche.de).

Signed-off-by: Sebastian Haas <haas@ems-wuensche.com>
Signed-off-by: Markus Plessing <plessing@ems-wuensche.com>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocan: SJA1000 generic platform bus driver
Wolfgang Grandegger [Fri, 15 May 2009 23:39:31 +0000 (23:39 +0000)]
can: SJA1000 generic platform bus driver

This driver adds support for the SJA1000 chips connected to the
"platform bus", which can be found on various embedded systems.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocan: Driver for the SJA1000 CAN controller
Wolfgang Grandegger [Fri, 15 May 2009 23:39:30 +0000 (23:39 +0000)]
can: Driver for the SJA1000 CAN controller

This patch adds the generic Socket-CAN driver for the Philips SJA1000
full CAN controller.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocan: CAN Network device driver and Netlink interface
Wolfgang Grandegger [Fri, 15 May 2009 23:39:29 +0000 (23:39 +0000)]
can: CAN Network device driver and Netlink interface

The CAN network device driver interface provides a generic interface to
setup, configure and monitor CAN network devices. It exports a set of
common data structures and functions, which all real CAN network device
drivers should use. Please have a look to the SJA1000 or MSCAN driver
to understand how to use them. The name of the module is can-dev.ko.

Furthermore, it adds a Netlink interface allowing to configure the CAN
device using the program "ip" from the iproute2 utility suite.

For further information please check "Documentation/networking/can.txt"

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocan: Update MAINTAINERS and CREDITS file
Wolfgang Grandegger [Fri, 15 May 2009 23:39:28 +0000 (23:39 +0000)]
can: Update MAINTAINERS and CREDITS file

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocan: Documentation for the CAN device driver interface
Wolfgang Grandegger [Fri, 15 May 2009 23:39:27 +0000 (23:39 +0000)]
can: Documentation for the CAN device driver interface

This patch documents the CAN netowrk device drivers interface, removes
obsolete documentation and adds some useful links to CAN resources.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobe2net: add two new pci device ids to pci device table
Ajit Khaparde [Mon, 18 May 2009 22:38:55 +0000 (15:38 -0700)]
be2net: add two new pci device ids to pci device table

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Add TI DaVinci EMAC driver
Anant Gole [Mon, 18 May 2009 22:19:01 +0000 (15:19 -0700)]
net: Add TI DaVinci EMAC driver

Add support for TI DaVinci EMAC driver.

TI DaVinci Ethernet Media Access Controller module is based upon
TI CPPI 3.0 DMA engine and supports 10/100 Mbps on all and Gigabit modes on
some TI devices. It supports MII/RMII and has up to 8Kbytes of internal
descriptor memory. This driver has been working on several TI devices including
DM644x, DM646x and DA830 platforms. The specs of this device are available at:
http://www.ti.com/litv/pdf/sprue24a

Signed-off-by: Anant Gole <anantgole@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipv4: cleanup: remove unnecessary include.
Rami Rosen [Mon, 18 May 2009 01:47:52 +0000 (01:47 +0000)]
ipv4: cleanup: remove unnecessary include.

There is no need for net/icmp.h header in net/ipv4/fib_frontend.c.
This patch removes the #include net/icmp.h from it.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipv4: cleanup - remove two unused parameters from fib_semantic_match().
Rami Rosen [Mon, 18 May 2009 01:19:12 +0000 (01:19 +0000)]
ipv4: cleanup - remove two unused parameters from fib_semantic_match().

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agovlan: use struct netdev_queue counters instead of dev->stats
Eric Dumazet [Mon, 18 May 2009 00:35:38 +0000 (00:35 +0000)]
vlan: use struct netdev_queue counters instead of dev->stats

We can update netdev_queue tx_bytes/tx_packets/tx_dropped counters instead
of dev->stats ones, to reduce number of cache lines dirtied in xmit path.

This fixes a performance problem on SMP when many different cpus take
vlan tx path.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: add tx_packets/tx_bytes/tx_dropped counters in struct netdev_queue
Eric Dumazet [Mon, 18 May 2009 00:34:33 +0000 (00:34 +0000)]
net: add tx_packets/tx_bytes/tx_dropped counters in struct netdev_queue

offsetof(struct net_device, features)=0x44
offsetof(struct net_device, stats.tx_packets)=0x54
offsetof(struct net_device, stats.tx_bytes)=0x5c
offsetof(struct net_device, stats.tx_dropped)=0x6c

Network drivers that touch dev->stats.tx_packets/stats.tx_bytes in their
tx path can slow down SMP operations, since they dirty a cache line
that should stay shared (dev->features is needed in rx and tx paths)

We could move away stats field in net_device but it wont help that much.
(Two cache lines dirtied in tx path, we can do one only)

Better solution is to add tx_packets/tx_bytes/tx_dropped in struct
netdev_queue because this structure is already touched in tx path and
counters updates will then be free (no increase in size)

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosch_teql: should not dereference skb after ndo_start_xmit()
Eric Dumazet [Mon, 18 May 2009 22:12:31 +0000 (15:12 -0700)]
sch_teql: should not dereference skb after ndo_start_xmit()

It is illegal to dereference a skb after a successful ndo_start_xmit()
call. We must store skb length in a local variable instead.

Bug was introduced in 2.6.27 by commit 0abf77e55a2459aa9905be4b226e4729d5b4f0cb
(net_sched: Add accessor function for packet length for qdiscs)

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Increase the driver version number
Peter P Waskiewicz Jr [Sun, 17 May 2009 20:58:21 +0000 (20:58 +0000)]
ixgbe: Increase the driver version number

Marching along, let's bump the version number to indicate things actually
have happened to the driver.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Add generic XAUI support to 82599
Peter P Waskiewicz Jr [Sun, 17 May 2009 20:58:04 +0000 (20:58 +0000)]
ixgbe: Add generic XAUI support to 82599

This patch adds the generic XAUI device support for 82599 controllers.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: set max desc to prevent total RSC packet size of 64K
Alexander Duyck [Sun, 17 May 2009 20:57:47 +0000 (20:57 +0000)]
ixgbe: set max desc to prevent total RSC packet size of 64K

The performance of hardware RSC is greatly reduced if the total for max rsc
descriptors multiplied by the buffer size is greater than 65535.  To
prevent this we need to adjust the max rsc descriptors appropriately.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotcp: fix MSG_PEEK race check
Ilpo Järvinen [Sun, 10 May 2009 20:32:34 +0000 (20:32 +0000)]
tcp: fix MSG_PEEK race check

Commit 518a09ef11 (tcp: Fix recvmsg MSG_PEEK influence of
blocking behavior) lets the loop run longer than the race check
did previously expect, so we need to be more careful with this
check and consider the work we have been doing.

I tried my best to deal with urg hole madness too which happens
here:
if (!sock_flag(sk, SOCK_URGINLINE)) {
++*seq;
...
by using additional offset by one but I certainly have very
little interest in testing that part.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Tested-by: Frans Pop <elendil@planet.nl>
Tested-by: Ian Zimmermann <itz@buug.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Mon, 18 May 2009 21:48:30 +0000 (14:48 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-next-2.6

15 years agoDoc: fixed descriptions on /proc/sys/net/core/* and /proc/sys/net/unix/*
Wang Tinggong [Thu, 14 May 2009 22:49:36 +0000 (22:49 +0000)]
Doc: fixed descriptions on /proc/sys/net/core/* and /proc/sys/net/unix/*

Signed-off-by: Wang Tinggong <wangtinggong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoNeterion: *FIFO1_DMA_ERR set twice, should 2nd be *FIFO2_DMA_ERR?
roel kluin [Fri, 15 May 2009 10:19:51 +0000 (10:19 +0000)]
Neterion: *FIFO1_DMA_ERR set twice, should 2nd be *FIFO2_DMA_ERR?

FIFO1_DMA_ERR is set twice, the second should be FIFO2_DMA_ERR.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Ram Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomv643xx_eth: fix PPC DMA breakage
Gabriel Paubert [Mon, 18 May 2009 04:16:47 +0000 (21:16 -0700)]
mv643xx_eth: fix PPC DMA breakage

After 2.6.29, PPC no more admits passing NULL to the dev parameter of
the DMA API. The result is a BUG followed by solid lock-up when the
mv643xx_eth driver brings an interface up. The following patch makes
the driver work on my Pegasos again; it is mostly a search and replace
of NULL by mp->dev->dev.parent in dma allocation/freeing/mapping/unmapping
functions.

Signed-off-by: Gabriel Paubert <paubert@iram.es>
Acked-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: fix link down handling in 802.3ad mode
Stephen Hemminger [Fri, 15 May 2009 08:44:32 +0000 (08:44 +0000)]
bonding: fix link down handling in 802.3ad mode

One of the purposes of bonding is to allow for redundant links, and failover
correctly if the cable is pulled. If all the members of a bonded device have
no carrier present, the bonded device itself needs to report no carrier present
to user space so management tools (like routing daemons) can respond.

Bonding in 802.3ad mode does not work correctly for this because it incorrectly
chooses a link that is down as a possible aggregator.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'linux-2.6.30.y' of git://git.kernel.org/pub/scm/linux/kernel/git/inaky...
David S. Miller [Mon, 18 May 2009 04:14:33 +0000 (21:14 -0700)]
Merge branch 'linux-2.6.30.y' of git://git./linux/kernel/git/inaky/wimax

15 years agobridge: fix initial packet flood if !STP
Stephen Hemminger [Fri, 15 May 2009 06:11:58 +0000 (06:11 +0000)]
bridge: fix initial packet flood if !STP

If bridge is configured with no STP and forwarding delay of 0 (which
is typical for virtualization) then when link starts it will flood all
packets for the first 20 seconds.

This bug was introduced by a combination of earlier changes:
  * forwarding database uses hold time of zero to indicate
    user wants to always flood packets
  * optimzation of the case of forwarding delay of 0 avoids the initial
    timer tick

The fix is to just skip all the topology change detection code if
kernel STP is not being used.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobridge: relay bridge multicast pkgs if !STP
Stephen Hemminger [Fri, 15 May 2009 06:10:13 +0000 (06:10 +0000)]
bridge: relay bridge multicast pkgs if !STP

Currently the bridge catches all STP packets; even if STP is turned
off.  This prevents other systems (which do have STP turned on)
from being able to detect loops in the network.

With this patch, if STP is off, then any packet sent to the STP
multicast group address is forwarded to all ports.

Based on earlier patch by Joakim Tjernlund with changes
to go through forwarding (not local chain), and optimization
that only last octet needs to be checked.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoNET: Meth: Fix unsafe mix of irq and non-irq spinlocks.
Ralf Baechle [Sat, 16 May 2009 01:21:58 +0000 (01:21 +0000)]
NET: Meth: Fix unsafe mix of irq and non-irq spinlocks.

Mixing of normal and irq spinlocks results in the following lockdep messages
on bootup on IP32:

[...]
Sending DHCP requests .
======================================================
[ INFO: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected ]
2.6.30-rc5-00164-g41baeef #30
------------------------------------------------------
swapper/1 [HC0[0]:SC0[1]:HE0:SE0] is trying to acquire:
 (&priv->meth_lock){+.+...}, at: [<ffffffff8026388c>] meth_tx+0x48/0x43c

and this task is already holding:
 (_xmit_ETHER#2){+.-...}, at: [<ffffffff802d3a00>] __qdisc_run+0x118/0x30c
which would create a new lock dependency:
 (_xmit_ETHER#2){+.-...} -> (&priv->meth_lock){+.+...}

but this new dependency connects a SOFTIRQ-irq-safe lock:
 (_xmit_ETHER#2){+.-...}
... which became SOFTIRQ-irq-safe at:
  [<ffffffff80061458>] __lock_acquire+0x784/0x1a14
  [<ffffffff800627e0>] lock_acquire+0xf8/0x150
  [<ffffffff800128d0>] _spin_lock+0x30/0x44
  [<ffffffff802d2b88>] dev_watchdog+0x70/0x398
  [<ffffffff800433b8>] run_timer_softirq+0x1a8/0x248
  [<ffffffff8003da5c>] __do_softirq+0xec/0x208
  [<ffffffff8003dbd8>] do_softirq+0x60/0xe4
  [<ffffffff8003dda0>] irq_exit+0x54/0x9c
  [<ffffffff80004420>] ret_from_irq+0x0/0x4
  [<ffffffff80004720>] r4k_wait+0x20/0x40
  [<ffffffff80015418>] cpu_idle+0x30/0x60
  [<ffffffff804cd934>] start_kernel+0x3ec/0x404

to a SOFTIRQ-irq-unsafe lock:
 (&priv->meth_lock){+.+...}
... which became SOFTIRQ-irq-unsafe at:
...  [<ffffffff800614f8>] __lock_acquire+0x824/0x1a14
  [<ffffffff800627e0>] lock_acquire+0xf8/0x150
  [<ffffffff800128d0>] _spin_lock+0x30/0x44
  [<ffffffff80263f20>] meth_reset+0x118/0x2d8
  [<ffffffff8026424c>] meth_open+0x28/0x140
  [<ffffffff802c1ae8>] dev_open+0xe0/0x18c
  [<ffffffff802c1268>] dev_change_flags+0xd8/0x1d4
  [<ffffffff804e7770>] ip_auto_config+0x1d4/0xf28
  [<ffffffff80012e68>] do_one_initcall+0x58/0x170
  [<ffffffff804cd190>] kernel_init+0x98/0x104
  [<ffffffff8001520c>] kernel_thread_helper+0x10/0x18

other info that might help us debug this:

2 locks held by swapper/1:
 #0:  (rcu_read_lock){.+.+..}, at: [<ffffffff802c0954>] dev_queue_xmit+0x1e0/0x4b0
 #1:  (_xmit_ETHER#2){+.-...}, at: [<ffffffff802d3a00>] __qdisc_run+0x118/0x30c

the SOFTIRQ-irq-safe lock's dependencies:
-> (_xmit_ETHER#2){+.-...} ops: 0 {
   HARDIRQ-ON-W at:
                        [<ffffffff800614d0>] __lock_acquire+0x7fc/0x1a14
                        [<ffffffff800627e0>] lock_acquire+0xf8/0x150
                        [<ffffffff800128d0>] _spin_lock+0x30/0x44
                        [<ffffffff802d2b88>] dev_watchdog+0x70/0x398
                        [<ffffffff800433b8>] run_timer_softirq+0x1a8/0x248
                        [<ffffffff8003da5c>] __do_softirq+0xec/0x208
                        [<ffffffff8003dbd8>] do_softirq+0x60/0xe4
                        [<ffffffff8003dda0>] irq_exit+0x54/0x9c
                        [<ffffffff80004420>] ret_from_irq+0x0/0x4
                        [<ffffffff80004720>] r4k_wait+0x20/0x40
                        [<ffffffff80015418>] cpu_idle+0x30/0x60
                        [<ffffffff804cd934>] start_kernel+0x3ec/0x404
   IN-SOFTIRQ-W at:
                        [<ffffffff80061458>] __lock_acquire+0x784/0x1a14
                        [<ffffffff800627e0>] lock_acquire+0xf8/0x150
                        [<ffffffff800128d0>] _spin_lock+0x30/0x44
                        [<ffffffff802d2b88>] dev_watchdog+0x70/0x398
                        [<ffffffff800433b8>] run_timer_softirq+0x1a8/0x248
                        [<ffffffff8003da5c>] __do_softirq+0xec/0x208
                        [<ffffffff8003dbd8>] do_softirq+0x60/0xe4
                        [<ffffffff8003dda0>] irq_exit+0x54/0x9c
                        [<ffffffff80004420>] ret_from_irq+0x0/0x4
                        [<ffffffff80004720>] r4k_wait+0x20/0x40
                        [<ffffffff80015418>] cpu_idle+0x30/0x60
                        [<ffffffff804cd934>] start_kernel+0x3ec/0x404
   INITIAL USE at:
                       [<ffffffff80061570>] __lock_acquire+0x89c/0x1a14
                       [<ffffffff800627e0>] lock_acquire+0xf8/0x150
                       [<ffffffff800128d0>] _spin_lock+0x30/0x44
                       [<ffffffff802d2b88>] dev_watchdog+0x70/0x398
                       [<ffffffff800433b8>] run_timer_softirq+0x1a8/0x248
                       [<ffffffff8003da5c>] __do_softirq+0xec/0x208
                       [<ffffffff8003dbd8>] do_softirq+0x60/0xe4
                       [<ffffffff8003dda0>] irq_exit+0x54/0x9c
                       [<ffffffff80004420>] ret_from_irq+0x0/0x4
                       [<ffffffff80004720>] r4k_wait+0x20/0x40
                       [<ffffffff80015418>] cpu_idle+0x30/0x60
                       [<ffffffff804cd934>] start_kernel+0x3ec/0x404
 }
 ... key      at: [<ffffffff80cf93f0>] netdev_xmit_lock_key+0x8/0x1c8

the SOFTIRQ-irq-unsafe lock's dependencies:
-> (&priv->meth_lock){+.+...} ops: 0 {
   HARDIRQ-ON-W at:
                        [<ffffffff800614d0>] __lock_acquire+0x7fc/0x1a14
                        [<ffffffff800627e0>] lock_acquire+0xf8/0x150
                        [<ffffffff800128d0>] _spin_lock+0x30/0x44
                        [<ffffffff80263f20>] meth_reset+0x118/0x2d8
                        [<ffffffff8026424c>] meth_open+0x28/0x140
                        [<ffffffff802c1ae8>] dev_open+0xe0/0x18c
                        [<ffffffff802c1268>] dev_change_flags+0xd8/0x1d4
                        [<ffffffff804e7770>] ip_auto_config+0x1d4/0xf28
                        [<ffffffff80012e68>] do_one_initcall+0x58/0x170
                        [<ffffffff804cd190>] kernel_init+0x98/0x104
                        [<ffffffff8001520c>] kernel_thread_helper+0x10/0x18
   SOFTIRQ-ON-W at:
                        [<ffffffff800614f8>] __lock_acquire+0x824/0x1a14
                        [<ffffffff800627e0>] lock_acquire+0xf8/0x150
                        [<ffffffff800128d0>] _spin_lock+0x30/0x44
                        [<ffffffff80263f20>] meth_reset+0x118/0x2d8
                        [<ffffffff8026424c>] meth_open+0x28/0x140
                        [<ffffffff802c1ae8>] dev_open+0xe0/0x18c
                        [<ffffffff802c1268>] dev_change_flags+0xd8/0x1d4
                        [<ffffffff804e7770>] ip_auto_config+0x1d4/0xf28
                        [<ffffffff80012e68>] do_one_initcall+0x58/0x170
                        [<ffffffff804cd190>] kernel_init+0x98/0x104
                        [<ffffffff8001520c>] kernel_thread_helper+0x10/0x18
   INITIAL USE at:
                       [<ffffffff80061570>] __lock_acquire+0x89c/0x1a14
                       [<ffffffff800627e0>] lock_acquire+0xf8/0x150
                       [<ffffffff800128d0>] _spin_lock+0x30/0x44
                       [<ffffffff80263f20>] meth_reset+0x118/0x2d8
                       [<ffffffff8026424c>] meth_open+0x28/0x140
                       [<ffffffff802c1ae8>] dev_open+0xe0/0x18c
                       [<ffffffff802c1268>] dev_change_flags+0xd8/0x1d4
                       [<ffffffff804e7770>] ip_auto_config+0x1d4/0xf28
                       [<ffffffff80012e68>] do_one_initcall+0x58/0x170
                       [<ffffffff804cd190>] kernel_init+0x98/0x104
                       [<ffffffff8001520c>] kernel_thread_helper+0x10/0x18
 }
 ... key      at: [<ffffffff80cf6ce8>] __key.32424+0x0/0x8

stack backtrace:
Call Trace:
[<ffffffff8000ed0c>] dump_stack+0x8/0x34
[<ffffffff80060b74>] check_usage+0x470/0x4a0
[<ffffffff80060c34>] check_irq_usage+0x90/0x130
[<ffffffff80061f78>] __lock_acquire+0x12a4/0x1a14
[<ffffffff800627e0>] lock_acquire+0xf8/0x150
[<ffffffff80012a0c>] _spin_lock_irqsave+0x60/0x84
[<ffffffff8026388c>] meth_tx+0x48/0x43c
[<ffffffff802d3a38>] __qdisc_run+0x150/0x30c
[<ffffffff802c0aa8>] dev_queue_xmit+0x334/0x4b0
[<ffffffff804e7e6c>] ip_auto_config+0x8d0/0xf28
[<ffffffff80012e68>] do_one_initcall+0x58/0x170
[<ffffffff804cd190>] kernel_init+0x98/0x104
[<ffffffff8001520c>] kernel_thread_helper+0x10/0x18

..... timed out!
IP-Config: Retrying forever (NFS root)...
Sending DHCP requests ., OK
[...]

Fixed by converting all locks to irq locks.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Tested-by: Andrew Randrianasulu <randrik_a@yahoo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Don't reset the hardware when switching between LFC and PFC
Peter P Waskiewicz Jr [Sun, 17 May 2009 12:35:57 +0000 (12:35 +0000)]
ixgbe: Don't reset the hardware when switching between LFC and PFC

When running in DCB mode, switching between link flow control and priority
flow control shouldn't need to reset the hardware.  This removes that
reset.

This also extends the set_all() dcbnl callback to return a value indicating
that the HW config changed, however a reset was not required.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: When in DCB mode with PFC enabled, show LFC is disabled
Peter P Waskiewicz Jr [Sun, 17 May 2009 12:35:36 +0000 (12:35 +0000)]
ixgbe: When in DCB mode with PFC enabled, show LFC is disabled

Ethtool should report that link flow control is disabled when in priority
flow control mode.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Allow link flow control in DCB mode for 82599 adapters
Peter P Waskiewicz Jr [Sun, 17 May 2009 12:35:16 +0000 (12:35 +0000)]
ixgbe: Allow link flow control in DCB mode for 82599 adapters

82599 supports using either link flow control or priority flow control when
in DCB mode.  The dcbnl interface already supports sending down
configurations through rtnetlink that can enable LFC when DCB is enabled,
so the driver should take advantage of this.

82598 does not support using LFC when DCB is enabled, so explicitly disable
it when we're in DCB mode.  This means we always run in PFC mode when DCB
is enabled.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Set Priority Flow Control low water threshhold for DCB
Peter P Waskiewicz Jr [Sun, 17 May 2009 12:34:55 +0000 (12:34 +0000)]
ixgbe: Set Priority Flow Control low water threshhold for DCB

This sets the low water threshhold for priority flow control for 82598
and 82599 controllers in DCB mode.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Enable jumbo frame for FCoE feature in 82599
Yi Zou [Sun, 17 May 2009 12:34:35 +0000 (12:34 +0000)]
ixgbe: Enable jumbo frame for FCoE feature in 82599

Enable jumbo frame when FCoE feature is enabled in 82599. Use 3K
as the receive queue buffer size for receive queues used by FCoE
to address for max Fiber Channel frame size as 2148 bytes (with
max 2112 bytes of payload).

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Enable FCoE redirection table feature in 82599
Yi Zou [Sun, 17 May 2009 12:34:14 +0000 (12:34 +0000)]
ixgbe: Enable FCoE redirection table feature in 82599

Enable using FCoE redirection table feature in 82599. The FCoE
redirection table has maximum of eight entries, corresponding
to maximum of eight receive queues to be used for distributing
incoming FCoE packets. This patch sets up the FCoE redirection
table when multiple receive queues are available for FCoE.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>