GitHub/exynos8895/android_kernel_samsung_universal8895.git
15 years agomac80211: enable IEEE80211_CONF_PS only when associated
Kalle Valo [Thu, 18 Dec 2008 21:35:13 +0000 (23:35 +0200)]
mac80211: enable IEEE80211_CONF_PS only when associated

Also disable power save when disassociated. It makes no sense to have
power save enabled while disassociated.

iwlwifi seems to have this check in the driver, but it's better to do this
in mac80211 instead.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agob43: Fix some MAC locking
Michael Buesch [Thu, 18 Dec 2008 21:13:39 +0000 (22:13 +0100)]
b43: Fix some MAC locking

This fixes some locking w.r.t. the lower MAC (firmware).
It also removes a lot of ancient IRQ-locking that's not needed anymore.
We simply suspend the MAC. That's easier and causes less trouble.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: iwl-tx.c cleanup (remove unused parameter and unused local variable).
Rami Rosen [Thu, 18 Dec 2008 16:04:51 +0000 (18:04 +0200)]
iwlwifi: iwl-tx.c cleanup (remove unused parameter and unused local variable).

This patch removes unused parameter and unused local variable in
methods in iwl-tx.c:

- Remove a parameter (is_unicast) from iwl_tx_cmd_build_basic().

- Remove an unused variable name unicast from iwl_tx_skb().

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Fixed RX decryption status reporting
Jouni Malinen [Thu, 18 Dec 2008 12:33:00 +0000 (14:33 +0200)]
ath9k: Fixed RX decryption status reporting

The RX code in ath9k uses sc_keymap to figure out whether a default
key was used. However, the default key entries in sc_keymap were
always set and as such, frames could have been claimed to be decrypted
by hardware when they were not. This can cause problems especially
with TKIP since mac80211 is validating the Michael MIC in the frame
and this will result in MIC failure and potentially TKIP
countermeasures if the frame was not decrypted correctly.

Change key cache slot allocation to mark only the keys that really
have been used in sc_keymap to avoid the issue. The key cache slot
selection routines are now internally avoiding the slots that may be
needed for TKIP group keys.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Fix key cache slot selection for splitmic
Jouni Malinen [Thu, 18 Dec 2008 12:31:10 +0000 (14:31 +0200)]
ath9k: Fix key cache slot selection for splitmic

ath_reserve_key_cache_slot() was obviously supposed to return an index
to a free slot, not reserved one. This could have caused problems with
hardware revisions that use splitmic.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Protect config() callback with a mutex
Sujith [Thu, 18 Dec 2008 06:10:16 +0000 (11:40 +0530)]
ath9k: Protect config() callback with a mutex

This should fix the timeout issues seen when using wpa_supplicant.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: Print unknown packet type in tasklet_handler
Larry Finger [Wed, 17 Dec 2008 20:26:59 +0000 (14:26 -0600)]
mac80211: Print unknown packet type in tasklet_handler

In stress testing p54usb, the WARN_ON() in ieee80211_tasklet_handler() was
triggered; however, there is no logging of the received value for packet
type. Adding that feature will improve the warning.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54usb: bring first generation devices back to life
Christian Lamparter [Wed, 17 Dec 2008 11:04:43 +0000 (12:04 +0100)]
p54usb: bring first generation devices back to life

This patch fixes a serious regression (introduced by:
"p54: fix memory management")
that affected isl3886+net2280 usb devices operation.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Tested-by: Artur Skawina <art.08.09@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Key cache allocation for AP mode
Jouni Malinen [Wed, 17 Dec 2008 11:32:17 +0000 (13:32 +0200)]
ath9k: Key cache allocation for AP mode

Enhance allocation of key cache entries to support multiple pairwise
keys to fix AP mode with more than one associated STA.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Fix a NULL pointer dereference in ath_rate_get
Jouni Malinen [Wed, 17 Dec 2008 11:30:31 +0000 (13:30 +0200)]
ath9k: Fix a NULL pointer dereference in ath_rate_get

It looks like mac80211 may try to send unicast frames to a STA that
does not have a STA entry. We need to make sure that that is caught in
the rate control code before dereferencing STA data.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: indicate txpower is off in sysfs
Jay Sternberg [Wed, 17 Dec 2008 08:52:34 +0000 (16:52 +0800)]
iwlwifi: indicate txpower is off in sysfs

The patch checks if the radio is disabled before displaying the tx power
level. Previously when the txpower was set off show_tx_power still
returned the prior power level. Now it will indicate the power has been
turned off.

Signed-off-by: Jay Sternberg <jay.e.sternberg@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: use GFP_KERNEL to allocate Rx SKB memory
Zhu Yi [Wed, 17 Dec 2008 08:52:33 +0000 (16:52 +0800)]
iwlwifi: use GFP_KERNEL to allocate Rx SKB memory

Previously we allocate Rx SKB with GFP_ATOMIC flag. This is because we need
to hold a spinlock to protect the two rx_used and rx_free lists operation
in the rxq.

spin_lock();
...
element = rxq->rx_used.next;
element->skb = alloc_skb(..., GFP_ATOMIC);
list_del(element);
list_add_tail(&element->list, &rxq->rx_free);
...
spin_unlock();

After spliting the rx_used delete and rx_free insert into two operations,
we don't require the skb allocation in an atomic context any more (the
function itself is scheduled in a workqueue).

spin_lock();
...
element = rxq->rx_used.next;
list_del(element);
...
spin_unlock();
...
element->skb = alloc_skb(..., GFP_KERNEL);
...
spin_lock()
...
list_add_tail(&element->list, &rxq->rx_free);
...
spin_unlock();

This patch should fix the "iwlagn: Can not allocate SKB buffers" warning
we see recently.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: use meaningful vars in _iwl_poll_bit()
Wu, Fengguang [Wed, 17 Dec 2008 08:52:32 +0000 (16:52 +0800)]
iwlwifi: use meaningful vars in _iwl_poll_bit()

Rename vars in _iwl_poll_bit() to better reflect the truth.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: remove useless goto
Wu Fengguang [Wed, 17 Dec 2008 08:52:31 +0000 (16:52 +0800)]
iwlwifi: remove useless goto

The patch removes some useless goto in code cleanup.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: use type uint for module param debug
Wu, Fengguang [Wed, 17 Dec 2008 08:52:30 +0000 (16:52 +0800)]
iwlwifi: use type uint for module param debug

This enables one to change the debug level at bit 31.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: update comments on the debug interface
Wu, Fengguang [Wed, 17 Dec 2008 08:52:29 +0000 (16:52 +0800)]
iwlwifi: update comments on the debug interface

Bring up-to-date some comments on the location of debug files.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: add line feed to printk
Wu, Fengguang [Wed, 17 Dec 2008 08:52:28 +0000 (16:52 +0800)]
iwlwifi: add line feed to printk

This adds line feed to printk.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: cleanup iwl-dev.h
Winkler, Tomas [Wed, 17 Dec 2008 08:52:27 +0000 (16:52 +0800)]
iwlwifi: cleanup iwl-dev.h

The patch removes unused definition and moves code to proper places.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: fix a typo in ieee80211_send_assoc() method.
Rami Rosen [Tue, 16 Dec 2008 20:38:29 +0000 (22:38 +0200)]
mac80211: fix a typo in ieee80211_send_assoc() method.

This patch fixes a typo in ieee80211_send_assoc(), net/mac80211/mlme.c.

The error is usage of a wrong member when building
the ie80211 management frame (it should be assoc_req, and not reassoc_req).

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: remove a parameter (dest) from *_fill_beacon_frame() methods.
Rami Rosen [Tue, 16 Dec 2008 07:37:07 +0000 (09:37 +0200)]
iwlwifi: remove a parameter (dest) from *_fill_beacon_frame() methods.

This patch removes a parameter (dest) from iwl_fill_beacon_frame() (iwl-agn.c)
 and from iwl3945_fill_beacon_frame(). (iwl-3945.c,iwl-3945.h)

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Move rate control alg register/unregister to appropriate place
Vasanthakumar Thiagarajan [Tue, 16 Dec 2008 07:07:38 +0000 (12:37 +0530)]
ath9k: Move rate control alg register/unregister to appropriate place

This patch makes sure the rate control alg is registered/unregistered
only once for this module.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Synchronize DMA transfer with CPU at right place
Vasanthakumar Thiagarajan [Mon, 15 Dec 2008 15:10:46 +0000 (20:40 +0530)]
ath9k: Synchronize DMA transfer with CPU at right place

This patch does pci_dma_sync_single_for_cpu() before accessing
the header of the frame and queueing the same buffer into h/w.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Remove MAC header pad before reporting TX status
Jouni Malinen [Mon, 15 Dec 2008 14:02:04 +0000 (16:02 +0200)]
ath9k: Remove MAC header pad before reporting TX status

Remove the possible MAC header pad before reporting TX status to
mac80211. This pad is hardware specific operation and should not be
exposed outside the driver. This fixes the frame body in monitor
interfaces that could be used to check on TX status for transmitted
frames.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Fix TX status reporting for retries and MCS index
Jouni Malinen [Mon, 15 Dec 2008 13:44:53 +0000 (15:44 +0200)]
ath9k: Fix TX status reporting for retries and MCS index

The count field in struct ieee80211_tx_rate does not include the final
successful attempt, so only report retries here.

Fix the struct ieee80211_tx_rate::idx field when MCS was used. It is
supposed to be the MCS index, not an internal index to the rate
control algorithm table.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: Remove radiotap rate-present flag for HT
Jouni Malinen [Mon, 15 Dec 2008 08:37:50 +0000 (10:37 +0200)]
mac80211: Remove radiotap rate-present flag for HT

Since we do not currently report HT rates (MCS index) in radiotap
header for HT rates, we should not claim the rate is present. The rate
octet itself is used as padding in this case, so only the it_present
flag needs to be removed in case of HT rates.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agortl8187: Fix crash on unload when using SLUB debug
Herton Ronaldo Krzesinski [Sun, 14 Dec 2008 18:18:09 +0000 (12:18 -0600)]
rtl8187: Fix crash on unload when using SLUB debug

Reported-by: Hin-Tak Leung <htl10@users.sourceforge.net>
After the code was modified to use urb anchors ("rtl8187: Use usb anchor
facilities to manage urbs"), rtl8187 began generating an intermittent GPF
on shutdown when using SLUB with debugging enabled. Furthermore, rebooting
the system with a ping running caused a GPF every time. There are two problems:
(1) incorrect locking in the rtl8187_rx_cb() routine, a pre-existing bug that
apparently had not been triggered before, and (2) duplicate freeing of receive
skbs that was probably introduced with the change to anchors.

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Tested-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54: remove free_on_tx parameter
Christian Lamparter [Sun, 14 Dec 2008 14:05:42 +0000 (15:05 +0100)]
p54: remove free_on_tx parameter

This patch simplifies the tx code a bit and will be necessary for
the upcoming stlc45xx<->p54 port.

In detail: we no longer have to tell all back-end drivers directly,
if we want to free a frame right after it was send to the firmware,
or if we do it in the library callback later.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54: more accurate rssi to dBm conversion
Christian Lamparter [Sun, 14 Dec 2008 13:45:30 +0000 (14:45 +0100)]
p54: more accurate rssi to dBm conversion

This patch replaces the static rssi auto calibration data
with more precise values out of the device's eeprom.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agortl8187: Fix error returns
Larry Finger [Sun, 14 Dec 2008 00:09:56 +0000 (18:09 -0600)]
rtl8187: Fix error returns

There are two places in the rtl8187 code where a routine was returning zero
(OK) when it should have been returning an error.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Acked-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agolibertas: use roundup instead of opencoding
Ilpo Järvinen [Sat, 13 Dec 2008 19:33:13 +0000 (21:33 +0200)]
libertas: use roundup instead of opencoding

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54: update ACK failure statistic counter in real-time
Christian Lamparter [Sat, 13 Dec 2008 15:45:38 +0000 (16:45 +0100)]
p54: update ACK failure statistic counter in real-time

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54: move statistic timer update routine into a workqueue
Christian Lamparter [Sat, 13 Dec 2008 13:14:20 +0000 (14:14 +0100)]
p54: move statistic timer update routine into a workqueue

This patch moves a good chunk of code from the former statistic update
timer routine into a workqueue, which is kindly provided by mac80211.

Also as a nice side-effect we can lay the foundation for other
essential housekeeping features we want to do in the future.
e.g:
 - drain the (clogged) tx_queue.
 - initiate bursts.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlagn: fix agn rate scaling
Mohamed Abbas [Fri, 12 Dec 2008 16:22:15 +0000 (08:22 -0800)]
iwlagn: fix agn rate scaling

    Rate scaling in agn can be broken because of these two problems
    1- the LQ command could not sent, we try to call LQ command before
       post association will be rejected, this will cause the driver to
       break in rs_tx_status reporting initial rate does not match.
    2- In rs_rate_init we can get a value of 12, rate 60, for
       last_txrate_idx, this rate only valid in SISO/MIMO mode only

Signed-off-by: Mohamed Abbas <mohamed.abbas@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: Send Layer 2 Update frame on reassociation
Jouni Malinen [Fri, 12 Dec 2008 15:08:31 +0000 (17:08 +0200)]
mac80211: Send Layer 2 Update frame on reassociation

When a STA roams back to the same AP before the previous STA entry has
expired, a new STA entry is not added in mac80211. However, a Layer 2
Update frame still needs to be transmitted to update layer 2 devices
about the new location for the STA. Without this, switches may
continue to forward frames to the previous (now incorrect) port when
STA roams between APs.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: fix 802.11 header padding on RX, unpadding on TX
Benoit PAPILLAULT [Fri, 12 Dec 2008 14:29:58 +0000 (15:29 +0100)]
ath5k: fix 802.11 header padding on RX, unpadding on TX

Padding the 802.11 header to a multiple of 4 bytes needs to be done only for
frames with a body. This fixes a bug where 2 bytes were missing in monitor
mode for ACK frames. Inspired by a patch from Jouni Malinen on ath9k.

Ref: http://bugzilla.kernel.org/show_bug.cgi?id=12101 :
Signed-off-by: Benoit Papillault <benoit.papillault@free.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Report HT rates in RX status
Jouni Malinen [Fri, 12 Dec 2008 12:38:34 +0000 (14:38 +0200)]
ath9k: Report HT rates in RX status

Fix and clean up the RX status reporting by getting rid of code that
used internal rate tables and ratekbps calculation. The correct value
is now reported with MCS index instead of the old mechanism that
defaulted to using the highest legacy rate.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: Add HT rates into RX status reporting
Jouni Malinen [Fri, 12 Dec 2008 12:38:33 +0000 (14:38 +0200)]
mac80211: Add HT rates into RX status reporting

This patch adds option for HT-enabled drivers to report HT rates
(HT20/HT40, short GI, MCS index) to mac80211. These rates are
currently not in the rate table, so the rate_idx is used to indicate
MCS index.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Do not use association state to update rate table
Sujith [Fri, 12 Dec 2008 06:29:07 +0000 (11:59 +0530)]
ath9k: Do not use association state to update rate table

Now that HT information is made available to the driver through
config() callback, the channel type can be calculated whenever
setting the channel. Update the rate table accordingly with the new
channel type.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: Fix HT channel selection
Sujith [Fri, 12 Dec 2008 06:27:43 +0000 (11:57 +0530)]
mac80211: Fix HT channel selection

HT management is done differently for AP and STA modes, unify
to just the ->config() callback since HT is fundamentally a
PHY property and cannot be per-BSS.

Rename enum nl80211_sec_chan_offset as nl80211_channel_type to denote
the channel type ( NO_HT, HT20, HT40+, HT40- ).

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agonl80211: Add signal strength and bandwith to nl80211station info
Henning Rogge [Thu, 11 Dec 2008 21:04:19 +0000 (22:04 +0100)]
nl80211: Add signal strength and bandwith to nl80211station info

This patch adds signal strength and transmission bitrate
to the station_info of nl80211.

Signed-off-by: Henning Rogge <rogge@fgan.de>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoucc_geth: Remove UGETH_FILTERING dead code
Anton Vorontsov [Thu, 18 Dec 2008 08:23:35 +0000 (08:23 +0000)]
ucc_geth: Remove UGETH_FILTERING dead code

The code appears to be dead: nobody call these functions, plus build
breaks when UGETH_FILTERING is enabled:

ucc_geth.c:1848: warning: 'struct enet_addr' declared inside parameter list
ucc_geth.c:1848: warning: its scope is only this definition or declaration, which is probably not what you want
ucc_geth.c: In function 'ugeth_82xx_filtering_get_match_addr_in_hash':
ucc_geth.c:1856: error: dereferencing pointer to incomplete type
ucc_geth.c:1874: error: dereferencing pointer to incomplete type
ucc_geth.c:1877: warning: return from incompatible pointer type
ucc_geth.c: At top level:
ucc_geth.c:1885: warning: 'struct enet_addr' declared inside parameter list
ucc_geth.c: In function 'ugeth_82xx_filtering_add_addr_in_hash':
ucc_geth.c:1894: error: dereferencing pointer to incomplete type
ucc_geth.c:1909: warning: passing argument 2 of 'ugeth_82xx_filtering_get_match_addr_in_hash' from incompatible pointer type
ucc_geth.c:1909: warning: assignment from incompatible pointer type
ucc_geth.c:1918: error: dereferencing pointer to incomplete type
ucc_geth.c: At top level:
ucc_geth.c:1928: warning: 'struct enet_addr' declared inside parameter list
ucc_geth.c: In function 'ugeth_82xx_filtering_clear_addr_in_hash':
ucc_geth.c:1947: warning: passing argument 2 of 'ugeth_82xx_filtering_get_match_addr_in_hash' from incompatible pointer type
ucc_geth.c:1947: warning: assignment from incompatible pointer type
ucc_geth.c:1954: error: dereferencing pointer to incomplete type
ucc_geth.c: At top level:
ucc_geth.c:2060: warning: 'struct enet_addr' declared inside parameter list
ucc_geth.c: In function 'ugeth_82xx_filtering_add_addr_in_paddr':
ucc_geth.c:2064: error: dereferencing pointer to incomplete type
ucc_geth.c:2073: error: dereferencing pointer to incomplete type
ucc_geth.c:2075: warning: passing argument 2 of 'hw_add_addr_in_paddr' from incompatible pointer type
make[2]: *** [ucc_geth.o] Error 1

The code is there since the driver was merged, and nobody seem to be
interested in fixing or actually using it. If we ever want the
filtering support, we can always revert the patch and fix it, but so
far it just draws reader's attention.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoucc_geth: Fix IO memory (un)mapping code
Anton Vorontsov [Thu, 18 Dec 2008 08:23:33 +0000 (08:23 +0000)]
ucc_geth: Fix IO memory (un)mapping code

The driver doesn't check ioremap() return value, and doesn't free the
remapped memory.

This patch fixes it.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoucc_geth: Cleanup repetitive ucc_geth_memclean() calls
Anton Vorontsov [Thu, 18 Dec 2008 08:23:31 +0000 (08:23 +0000)]
ucc_geth: Cleanup repetitive ucc_geth_memclean() calls

No need to call ucc_geth_memclean() so many times, just check for
errors in ucc_geth_open(), and call ucc_geth_stop() in case of errors.

The ucc_geth_stop() may be called anytime and will do the right thing.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoucc_geth: Fix IRQ freeing code in ucc_geth_open()
Anton Vorontsov [Thu, 18 Dec 2008 08:23:29 +0000 (08:23 +0000)]
ucc_geth: Fix IRQ freeing code in ucc_geth_open()

open() routine calls stop() in case of errors, the function will try
to free the requested IRQ. But we don't know if it was actually
requested, so the code might issue bogus free_irq(0, dev) call.

Fix this by rearranging the code so that now request_irq() is the last
call in the open() routine, and move free_irq() into the close().

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoucc_geth: Fix TX watchdog timeout handling
Anton Vorontsov [Thu, 18 Dec 2008 08:23:26 +0000 (08:23 +0000)]
ucc_geth: Fix TX watchdog timeout handling

The timeout handling code is currently broken in several ways:

- It calls stop() (which frees all the memory and IRQ), and then
  calls startup() (which won't re-request IRQ, neither it will
  re-init the Fast UCC structure).
- It calls these routines from the softirq context, which is wrong,
  since stop() calls free_irq() (which might sleep) and startup()
  allocates things with GFP_KERNEL.
- It won't soft-reset the PHY. We need the PHY reset for at least
  MPC8360E-MDS boards with Marvell 88E1111 PHY, the PHY won't recover
  from timeouts w/o the reset.

So the patch fixes these problems by implementing the workqueue for the
timeout handling, and there we fully re-open the device via close() and
open() calls. The close/open paths do the right things, and I can see
that the driver actually survive the timeouts.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoucc_geth: Fix endless loop in stop_{tx,rx} routines
Anton Vorontsov [Thu, 18 Dec 2008 08:23:22 +0000 (08:23 +0000)]
ucc_geth: Fix endless loop in stop_{tx,rx} routines

Currently the routines wait for the various bits w/o an assumption that
bits may never get set. When timeouts happen I see that these bits never
get set and so the routines hang the kernel.

With this patch we'll wait the graceful stop for 100 ms, and then will
simply exit. There is nothing* we can do about that, but it's OK since
we'll do full reset later.

* Well, actually, there is also not-graceful variant for the TX stop,
  but specs says that we never should use it.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotcp: Stop scaring users with "treason uncloaked!"
Matt Mackall [Fri, 19 Dec 2008 03:54:22 +0000 (19:54 -0800)]
tcp: Stop scaring users with "treason uncloaked!"

The original message was unhelpful and extremely alarming to our poor
users, despite its charm. Make it less frightening.

Signed-off-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoNIU: Implement discard counters, optimize
Jesper Dangaard Brouer [Fri, 19 Dec 2008 03:51:56 +0000 (19:51 -0800)]
NIU: Implement discard counters, optimize

Optimize the lightly loaded case, by only synchronizing discards stats
when qlen > 10 indicate potential for drops.

Notice Robert Olsson might disagree with this patch.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoNIU: Implement discard counters, info/debug statements.
Jesper Dangaard Brouer [Fri, 19 Dec 2008 03:51:26 +0000 (19:51 -0800)]
NIU: Implement discard counters, info/debug statements.

Discard packet counter debug statements that can be turned on
at runtime by users to assist debugging of the driver code.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoNIU: Implement discard counters
Jesper Dangaard Brouer [Fri, 19 Dec 2008 03:50:49 +0000 (19:50 -0800)]
NIU: Implement discard counters

Implementing discard counters for the NIU driver turned out to be more
complicated than first assumed.

The discard counters for the NIU neptune chip are only 16-bit (even
though this is a 64-bit chip).  These 16-bit counters can overflow
quickly, especially considering this is a 10Gbit/s ethernet card.

The overflow indication bit is, unfortunatly, not usable as the
counter value does not wrap, but remains at max value 0xFFFF.
Resulting in lost counts until the counter is reset.

The read and reset scheme also poses a problem. Both in theory and in
practice counters can be lost in between reading nr64() and clearing
the counter nw64().  For this reason, the number of counter clearings
nw64() is limited/reduced.  On the fast-path the counters are only
syncronized once it exceeds 0x7FFF.  When read by userspace, its
syncronized fully.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoenc28j60: reduce the number of spi transfers in enc28j60_set_bank()
Baruch Siach [Fri, 19 Dec 2008 03:39:14 +0000 (19:39 -0800)]
enc28j60: reduce the number of spi transfers in enc28j60_set_bank()

A major source of overhead in the enc28j60 driver is the SPI transfers. Each
SPI transfer entails two kernel thread context switches. One major source of
SPI transfers is the enc28j60_set_bank() functions which runs before every
register access. This patch reduces the number of SPI transfers that
enc28j60_set_bank() performs in two ways:

  1. removes unnecessary bank switch for the registers that are present in all
 banks

  2. when switching from banks 0 or 3 to banks 1 or 2 (i.e. only one bit
 changes) enc28j60_set_bank() does only one SPI transfer instead of two

According to my tests these changes reduce the number of SPI transfers in
about 25%.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetdevice zd1201: Use after free
Wang Chen [Fri, 19 Dec 2008 03:36:46 +0000 (19:36 -0800)]
netdevice zd1201: Use after free

| commit 3d29b0c33d431ecc69ec778f8c236d382f59a85f
| Author: John W. Linville <linville@tuxdriver.com>
| Date:   Fri Oct 31 14:13:12 2008 -0400
|
|     netdevice zd1201: Convert directly reference of netdev->priv to netdev_priv()
|
|     We have some reasons to kill netdev->priv:
|     1. netdev->priv is equal to netdev_priv().
|     2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously
|        netdev_priv() is more flexible than netdev->priv.
|     But we cann't kill netdev->priv, because so many drivers reference to it
|     directly.
|
|     OK, becasue Dave S. Miller said, "every direct netdev->priv usage is a bug",
|     and I want to kill netdev->priv later, I decided to convert all the direct
|     reference of netdev->priv first.
|
|     (Original patch posted by Wang Chen <wangchen@cn.fujitsu.com> w/ above
|     changelog but using dev->ml_priv.  That doesn't seem appropriate
|     to me for this driver, so I've revamped it to use netdev_priv()
|     instead. -- JWL)

This commit changed the allocation of netdev, but didn't change
the free method of it.
This causes "zd" be used after the memory, which is pointed by "zd", being
freed by free_netdev().

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoRevert "xfrm: Accept ESP packets regardless of UDP encapsulation mode"
David S. Miller [Fri, 19 Dec 2008 03:23:56 +0000 (19:23 -0800)]
Revert "xfrm: Accept ESP packets regardless of UDP encapsulation mode"

This reverts commit e061b165c7f4ec5e2e160d990b49011b5b6e5c6a.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoRevert "net: release skb->dst in sock_queue_rcv_skb()"
David S. Miller [Thu, 18 Dec 2008 06:11:38 +0000 (22:11 -0800)]
Revert "net: release skb->dst in sock_queue_rcv_skb()"

This reverts commit 70355602879229c6f8bd694ec9c0814222bc4936.

As pointed out by Mark McLoughlin IP_PKTINFO cmsg data is one
post-queueing user, so this optimization is not valid right
now.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: use port_params in __update_lacpdu_from_port
Holger Eitzenberger [Thu, 18 Dec 2008 03:13:53 +0000 (19:13 -0800)]
bonding: use port_params in __update_lacpdu_from_port

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: use port_params in __update_default_selected()
Holger Eitzenberger [Thu, 18 Dec 2008 03:13:27 +0000 (19:13 -0800)]
bonding: use port_params in __update_default_selected()

I also removed some of the unneeded braces in the if condition to
improve readability and a little bit of reformatting.

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: use port_params in __update_selected()
Holger Eitzenberger [Thu, 18 Dec 2008 03:13:07 +0000 (19:13 -0800)]
bonding: use port_params in __update_selected()

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: remove various function declarations
Holger Eitzenberger [Thu, 18 Dec 2008 03:12:40 +0000 (19:12 -0800)]
bonding: remove various function declarations

They are all defined before used, it's therefore ok to remove
them.

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: init port_params from template
Holger Eitzenberger [Thu, 18 Dec 2008 03:12:07 +0000 (19:12 -0800)]
bonding: init port_params from template

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: use plain memcpy in __record_default()
Holger Eitzenberger [Thu, 18 Dec 2008 03:08:46 +0000 (19:08 -0800)]
bonding: use plain memcpy in __record_default()

Also remove the pointless comment at the top.

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: use port_params in __record_pdu()
Holger Eitzenberger [Thu, 18 Dec 2008 03:08:14 +0000 (19:08 -0800)]
bonding: use port_params in __record_pdu()

It helps in maintaining the various partner information values from
the LACPDU.  It also removes the pointless comment at the top.

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: introduce and use port_params structure
Holger Eitzenberger [Thu, 18 Dec 2008 03:07:38 +0000 (19:07 -0800)]
bonding: introduce and use port_params structure

It generally helps to handle those values in various places, using it
might make the code more readable and gives room for other improvements.

The IEEE standard talks about them as "parameter values".

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: improve elaborate port_state assignment
Holger Eitzenberger [Thu, 18 Dec 2008 03:07:16 +0000 (19:07 -0800)]
bonding: improve elaborate port_state assignment

The previous code was just a funny way of assigning both values (they
are both of type u8).

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogianfar: Continue polling until both tx and rx are empty
Andy Fleming [Thu, 18 Dec 2008 00:52:30 +0000 (16:52 -0800)]
gianfar: Continue polling until both tx and rx are empty

gfar_poll would declare polling done once the rx queue was empty,
but the tx queue could still have packets left.

Stolen mostly from the e1000 driver.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogianfar: Merge Tx and Rx interrupt for scheduling clean up ring
Dai Haruki [Thu, 18 Dec 2008 00:52:00 +0000 (16:52 -0800)]
gianfar: Merge Tx and Rx interrupt for scheduling clean up ring

No clean up function is executed in the interrupt context by this patch.

Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogianfar: Use interface name in interrupt name to distinguish the source.
Dai Haruki [Thu, 18 Dec 2008 00:51:32 +0000 (16:51 -0800)]
gianfar: Use interface name in interrupt name to distinguish the source.

Interface name (ex. eth0) is used as the prefix for the interrupt name,
with _rx, _tx, and _er appended to distinguish multiple interrupts on
the same interface.

Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogianfar: Add Scatter Gather support
Dai Haruki [Thu, 18 Dec 2008 00:51:04 +0000 (16:51 -0800)]
gianfar: Add Scatter Gather support

Scatter Gather support in gianfar driver to handle fragmented frames on
the transmit side.

Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogianfar: Fix packet drop when out of memory
Andy Fleming [Thu, 18 Dec 2008 00:50:22 +0000 (16:50 -0800)]
gianfar: Fix packet drop when out of memory

The patch which fixed gianfar so it drops packets when it runs out
of memory left in the code which frees the skb when it drops packets.
Change the code so that we only free the skb if the new skb was successfully
created.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodccp_diag: LISTEN sockets don't have CCIDs
Arnaldo Carvalho de Melo [Thu, 18 Dec 2008 00:08:01 +0000 (16:08 -0800)]
dccp_diag: LISTEN sockets don't have CCIDs

And thus when we try to use 'ss -danemi' on these sockets that have no
ccid blocks (data collected using systemtap after I fixed the problem):

dccp_diag_get_info sk=0xffff8801220a3100, dp->dccps_hc_rx_ccid=0x0000000000000000, dp->dccps_hc_tx_ccid=0x0000000000000000

We get an OOPS:

mica.ghostprotocols.net login: BUG: unable to handle kernel NULL pointer
dereferenc0
IP: [<ffffffffa0136082>] dccp_diag_get_info+0x82/0xc0 [dccp_diag]
PGD 12106f067 PUD 122488067 PMD 0
Oops: 0000 [#1] PREEMPT

Fix is trivial, and 'ss -d' is working again:

[root@mica ~]# ss -danemi
State   Recv-Q Send-Q   Local Address:Port   Peer Address:Port
LISTEN  0      0                    *:5001              *:*
ino:7288 sk:220a3100ffff8801
 mem:(r0,w0,f0,t0) cwnd:0 ssthresh:0
[root@mica ~]#

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoPhonet: USB CDC Phonet function for gadget framework
Rémi Denis-Courmont [Wed, 17 Dec 2008 23:49:09 +0000 (15:49 -0800)]
Phonet: USB CDC Phonet function for gadget framework

This implements the Nokia vendor-specific communication device class
function to exchange Phonet messages over USB. This function is already
found in the "PC suite" USB profile of (non-Linux) Nokia handsets.

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoPhonet: get rid of deferred work on the transmission path
Rémi Denis-Courmont [Wed, 17 Dec 2008 23:48:50 +0000 (15:48 -0800)]
Phonet: get rid of deferred work on the transmission path

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoPhonet: use atomic for packet TX window
Rémi Denis-Courmont [Wed, 17 Dec 2008 23:48:31 +0000 (15:48 -0800)]
Phonet: use atomic for packet TX window

GPRS TX flow control won't need to lock the underlying socket anymore.

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoPhonet: allocate separate ARP type for GPRS over a Phonet pipe
Rémi Denis-Courmont [Wed, 17 Dec 2008 23:47:48 +0000 (15:47 -0800)]
Phonet: allocate separate ARP type for GPRS over a Phonet pipe

A separate xmit lock class supports GPRS over a Phonet pipe over a TUN
device (type ARPHRD_NONE).

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoPhonet: allocate a non-Ethernet ARP type
Rémi Denis-Courmont [Wed, 17 Dec 2008 23:47:29 +0000 (15:47 -0800)]
Phonet: allocate a non-Ethernet ARP type

Also leave some room for more 802.11 types.

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agovcan: whitespace fixes
Oliver Hartkopp [Wed, 17 Dec 2008 23:37:55 +0000 (15:37 -0800)]
vcan: whitespace fixes

Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: ppp_generic - use idr technique instead of cardmaps
Cyrill Gorcunov [Wed, 17 Dec 2008 08:34:06 +0000 (00:34 -0800)]
net: ppp_generic - use idr technique instead of cardmaps

Use idr technique instead of own implemented cardmaps.
It saves us a number of lines and gives an ability
to use library functions.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2x: Fix namespace collision with FLOW_CTRL_{TX,RX}
David S. Miller [Wed, 17 Dec 2008 07:53:20 +0000 (23:53 -0800)]
bnx2x: Fix namespace collision with FLOW_CTRL_{TX,RX}

These are now defined in linux/mii.h and the bnx2x driver
defines different values which are shared with hardware
data structures.

So add a "BNX2X_" prefix to these macro names.

Based upon a report from Stephen Rothwell.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2: Don't redefine FLOW_CTRL_{RX,TX}.
David S. Miller [Wed, 17 Dec 2008 07:45:02 +0000 (23:45 -0800)]
bnx2: Don't redefine FLOW_CTRL_{RX,TX}.

They are provided generically by linux/mii.h now.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2: Update version to 1.9.0.
Michael Chan [Wed, 17 Dec 2008 04:28:13 +0000 (20:28 -0800)]
bnx2: Update version to 1.9.0.

And fix the 5716S pci_device_id entry to point to the proper string.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2: Rename MSI-X vectors.
Michael Chan [Wed, 17 Dec 2008 04:27:45 +0000 (20:27 -0800)]
bnx2: Rename MSI-X vectors.

Change MSI-X vector names to "ethx-%d".

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>
15 years agodrivers/net/hamradio: Move a dereference below a NULL test
Julia Lawall [Tue, 16 Dec 2008 23:43:29 +0000 (15:43 -0800)]
drivers/net/hamradio: Move a dereference below a NULL test

In each case, if the NULL test is necessary, then the dereference should be
moved below the NULL test.

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

// <smpl>
@@
type T;
expression E;
identifier i,fld;
statement S;
@@

- T i = E->fld;
+ T i;
  ... when != E
      when != i
  if (E == NULL) S
+ i = E->fld;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agophylib: Remove unnecessary "reset" fixups in genphy_setup_forced
Andy Fleming [Tue, 16 Dec 2008 23:39:48 +0000 (15:39 -0800)]
phylib: Remove unnecessary "reset" fixups in genphy_setup_forced

genphy_setup_forced hasn't actually reset the PHY for a long time,
but a comment to that effect remained in the code, so code continued
to act as if it *had* reset the PHY, and called the necessary fixup
functions to respond to a PHY reset.  With no reset, those functions
are no longer needed, so we remove them.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogianfar: Make all BD status writes 32-bit
Dai Haruki [Tue, 16 Dec 2008 23:34:50 +0000 (15:34 -0800)]
gianfar: Make all BD status writes 32-bit

Whenever we want to update the status field in a BD, we usually want to
update the length field, too.  By combining them into one 32-bit field, we
reduce the number of stores to memory shared with the controller, and we
eliminate the need for order-enforcement, as the length and "READY" bit are
now updated atomically at the same time.

Signed-off-by: Dai Haruki <Dai.Haruki@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogianfar: Add macros for stepping through BDs
Andy Fleming [Tue, 16 Dec 2008 23:33:40 +0000 (15:33 -0800)]
gianfar: Add macros for stepping through BDs

This code is based strongly on code from Dai Haruki <Dai.Haruki@freescale.com>.

The gianfar Buffer Descriptors are arranged in a circular array, the end of
which is denoted by setting the "WRAP" bit in the descriptor.  However, the
software knows the end of the ring because it knows how many descriptors are
there.  Rather than check each descriptor for whether the WRAP bit is set,
use pointer math to determine where the next BD is.  This is also useful for
when we want to look at BDs other than the very next one (for Scatter-Gather).

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogianfar: Remove unused gfar_add_fcb() function parameter
Dai Haruki [Tue, 16 Dec 2008 23:32:11 +0000 (15:32 -0800)]
gianfar: Remove unused gfar_add_fcb() function parameter

- Also, use cacheable_memzero instead of memset for performance reasons.

Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogianfar: Enable padding and Optimize the frame prepended bytes handling
Dai Haruki [Tue, 16 Dec 2008 23:31:15 +0000 (15:31 -0800)]
gianfar: Enable padding and Optimize the frame prepended bytes handling

The eTSEC can prepend up to 32 bytes to a received frame, usually for the
purpose of aligning the IP address to a word boundary, so this turns it on.

While we're in there, make the handling of the pre-frame bytes (padding and
Frame Control Block) cleaner.

Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogianfar: Fix VLAN HW feature related frame/buffer size calculation.
Dai Haruki [Tue, 16 Dec 2008 23:30:48 +0000 (15:30 -0800)]
gianfar: Fix VLAN HW feature related frame/buffer size calculation.

Optimize the VLAN checking logic as well.

Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogianfar: Fix eTSEC configuration procedure
Dai Haruki [Tue, 16 Dec 2008 23:30:20 +0000 (15:30 -0800)]
gianfar: Fix eTSEC configuration procedure

Fix some bugs in the ethtool configuration functions:
* gfar_clean_rx_ring should not be called with interrupts disabled.
* Update last transmission time to avoid tx timeout.
* Delete redundant NETIF_F_IP_CSUM check in gfar_start_xmit
* Use netif_tx_lock_bh when reconfiguring the tx csum

Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogianfar: Optimize interrupt coalescing configuration
Dai Haruki [Tue, 16 Dec 2008 23:29:52 +0000 (15:29 -0800)]
gianfar: Optimize interrupt coalescing configuration

Store the interrupt coalescing values in the form in which they will be
written to the interrupt coalescing registers.  This puts a little overhead
into the ethtool configuration, and takes it out of the interrupt handler

Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogianfar: Convert gianfar to an of_platform_driver
Andy Fleming [Tue, 16 Dec 2008 23:29:15 +0000 (15:29 -0800)]
gianfar: Convert gianfar to an of_platform_driver

Does the same for the accompanying MDIO driver, and then modifies the TBI
configuration method.  The old way used fields in einfo, which no longer
exists.  The new way is to create an MDIO device-tree node for each instance
of gianfar, and create a tbi-handle property to associate ethernet controllers
with the TBI PHYs they are connected to.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogianfar: Use gfar_halt to stop DMA in gfar_probe
Andy Fleming [Tue, 16 Dec 2008 23:25:45 +0000 (15:25 -0800)]
gianfar: Use gfar_halt to stop DMA in gfar_probe

gfar_halt does everything we want to do there, including disabling
TX/RX.  It also doesn't unnecessarily enable DMA if it's already
stopped.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotlan: Remove broken support for big buffers
Sakari Ailus [Tue, 16 Dec 2008 23:24:05 +0000 (15:24 -0800)]
tlan: Remove broken support for big buffers

The big rx/tx buffer support is broken and unlikely to be very useful
as such. Remove it.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
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, 16 Dec 2008 23:23:54 +0000 (15:23 -0800)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

Conflicts:

drivers/net/enc28j60.c

15 years agotlan: Fix pci memory unmapping
Sakari Ailus [Tue, 16 Dec 2008 23:22:41 +0000 (15:22 -0800)]
tlan: Fix pci memory unmapping

Fix pci unmapping problem introduced by commit id
8953f1282793882a5444924f7a273dc72a43d0a3 "tlan: Fix small (< 64 bytes)
datagram transmissions".

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoipv6: fix the outgoing interface selection order in udpv6_sendmsg()
Yang Hongyang [Tue, 16 Dec 2008 10:08:29 +0000 (02:08 -0800)]
ipv6: fix the outgoing interface selection order in udpv6_sendmsg()

1.When no interface is specified in an IPV6_PKTINFO ancillary data
  item, the interface specified in an IPV6_PKTINFO sticky optionis
  is used.

RFC3542:
6.7.  Summary of Outgoing Interface Selection

   This document and [RFC-3493] specify various methods that affect the
   selection of the packet's outgoing interface.  This subsection
   summarizes the ordering among those in order to ensure deterministic
   behavior.

   For a given outgoing packet on a given socket, the outgoing interface
   is determined in the following order:

   1. if an interface is specified in an IPV6_PKTINFO ancillary data
      item, the interface is used.

   2. otherwise, if an interface is specified in an IPV6_PKTINFO sticky
      option, the interface is used.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoipv6: fix the return interface index when get it while no message is received
Yang Hongyang [Tue, 16 Dec 2008 10:07:45 +0000 (02:07 -0800)]
ipv6: fix the return interface index when get it while no message is received

When get receiving interface index while no message is received,
the the value seted with setsockopt() should be returned.

RFC 3542:
   Issuing getsockopt() for the above options will return the sticky
   option value i.e., the value set with setsockopt().  If no sticky
   option value has been set getsockopt() will return the following
   values:

   -  For the IPV6_PKTINFO option, it will return an in6_pktinfo
      structure with ipi6_addr being in6addr_any and ipi6_ifindex being
      zero.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoipv6: Add IPV6_PKTINFO sticky option support to setsockopt()
Yang Hongyang [Tue, 16 Dec 2008 10:06:23 +0000 (02:06 -0800)]
ipv6: Add IPV6_PKTINFO sticky option support to setsockopt()

There are three reasons for me to add this support:
1.When no interface is specified in an IPV6_PKTINFO ancillary data
  item, the interface specified in an IPV6_PKTINFO sticky optionis
  is used.

RFC3542:
6.7.  Summary of Outgoing Interface Selection

   This document and [RFC-3493] specify various methods that affect the
   selection of the packet's outgoing interface.  This subsection
   summarizes the ordering among those in order to ensure deterministic
   behavior.

   For a given outgoing packet on a given socket, the outgoing interface
   is determined in the following order:

   1. if an interface is specified in an IPV6_PKTINFO ancillary data
      item, the interface is used.

   2. otherwise, if an interface is specified in an IPV6_PKTINFO sticky
      option, the interface is used.

2.When no IPV6_PKTINFO ancillary data is received,getsockopt() should
  return the sticky option value which set with setsockopt().

RFC 3542:
   Issuing getsockopt() for the above options will return the sticky
   option value i.e., the value set with setsockopt().  If no sticky
   option value has been set getsockopt() will return the following
   values:

3.Make the setsockopt implementation POSIX compliant.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet: Refactor full duplex flow control resolution
Steve Glendinning [Tue, 16 Dec 2008 10:00:48 +0000 (02:00 -0800)]
net: Refactor full duplex flow control resolution

These 4 drivers have identical full duplex flow control resolution
functions.  This patch changes them all to use one common function.

The function in question decides whether a device should enable TX and
RX flow control in a standard way (IEEE 802.3-2005 table 28B-3), so this
should also be useful for other drivers.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet: Move flow control definitions to mii.h
Steve Glendinning [Tue, 16 Dec 2008 10:00:00 +0000 (02:00 -0800)]
net: Move flow control definitions to mii.h

flags used within drivers for indicating tx and rx flow control are
defined in 4 drivers (and probably more), move these constants to mii.h.

The 3 SMSC drivers use the same constants (FLOW_CTRL_TX), but TG3 uses
TG3_FLOW_CTRL_TX, so this patch also renames the constants within TG3.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agosimeth: convert to net_device_ops
Alexey Dobriyan [Tue, 16 Dec 2008 09:55:38 +0000 (01:55 -0800)]
simeth: convert to net_device_ops

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>