safe/jmp/linux-2.6
14 years agoiwmc3200wifi: Handle UMAC stalls and UMAC assert properly
Samuel Ortiz [Tue, 1 Sep 2009 13:14:05 +0000 (15:14 +0200)]
iwmc3200wifi: Handle UMAC stalls and UMAC assert properly

When UMAC stalls or asserts, we want to reset the device. But when we're
associated, the current reset worker will end up calling
cfg80211_connect_result() with the cfg80211 sme layer knowing that we're
reassociating. That ends up with some ugly warnings.
With this patch we're telling the upper layer that we've roamed if
reassociation succeeds, and that we're disconnected if it fails.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwmc3200wifi: New initial LMAC calibration
Samuel Ortiz [Tue, 1 Sep 2009 13:14:04 +0000 (15:14 +0200)]
iwmc3200wifi: New initial LMAC calibration

The LMAC calibration API got broken mostly by having a configuration bitmap
being different than the result one.
This patch tries to address that issue by correctly running calibrations with
the newest firmwares, and keeping a backward compatibility fallback path for
older firmwares, where the configuration and result bitmaps were identical.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwmc3200wifi: fix misuse of le16_to_cpu
Zhu Yi [Tue, 1 Sep 2009 13:14:03 +0000 (15:14 +0200)]
iwmc3200wifi: fix misuse of le16_to_cpu

Also mark some functions static.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwmc3200wifi: add disconnect work
Zhu Yi [Tue, 1 Sep 2009 13:14:02 +0000 (15:14 +0200)]
iwmc3200wifi: add disconnect work

When the driver receives "connection terminated" event from device,
it could be caused by 2 reasons: the firmware is roaming or the
connection is lost (AP disappears). For the former, an association
complete event is supposed to come within 3 seconds. For the latter,
the driver won't receive any event except the connection terminated.
So we kick a delayed work (5*HZ) when we receive the connection
terminated event. It will be canceled if it turns out to be a roaming
event later. Otherwise we notify SME and userspace the disconnection.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwmc3200wifi: use cfg80211_roamed to send roam event
Zhu Yi [Tue, 1 Sep 2009 13:14:01 +0000 (15:14 +0200)]
iwmc3200wifi: use cfg80211_roamed to send roam event

The device sends connection terminated and [re]association success
(or failure) events when roaming occours. The patch uses
cfg80211_roamed instead of cfg80211_connect_result to notify SME
for roaming.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwmc3200wifi: Fix sparse warning
Samuel Ortiz [Tue, 1 Sep 2009 13:14:00 +0000 (15:14 +0200)]
iwmc3200wifi: Fix sparse warning

iwm_cfg80211_get_station() should be static.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwmc3200wifi: Set WEP key from connect
Samuel Ortiz [Tue, 1 Sep 2009 13:13:59 +0000 (15:13 +0200)]
iwmc3200wifi: Set WEP key from connect

When connect is called with the LEGACY_PSK authentication type set, and a
proper sme->key, we need to set the WEP key straight after setting the
profile otherwise the authentication will never start.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwmc3200wifi: invalidate profile when necessary before connect
Zhu Yi [Tue, 1 Sep 2009 13:13:58 +0000 (15:13 +0200)]
iwmc3200wifi: invalidate profile when necessary before connect

If cfg80211 requests to connect when we have already had an active
profile, invalidate the current profile first before sending a new
profile to UMAC.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agorndis_wlan: remove 'select WIRELESS_EXT' in Kconfig
Jussi Kivilinna [Tue, 1 Sep 2009 12:33:11 +0000 (15:33 +0300)]
rndis_wlan: remove 'select WIRELESS_EXT' in Kconfig

Since rndis_wlan is now converted to cfg80211, WIRELESS_EXT isn't
required anymore.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agorndis_wlan: fix sparse endianess warnings
Jussi Kivilinna [Tue, 1 Sep 2009 12:33:06 +0000 (15:33 +0300)]
rndis_wlan: fix sparse endianess warnings

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agorndis_wlan: cleanup
Jussi Kivilinna [Tue, 1 Sep 2009 12:33:00 +0000 (15:33 +0300)]
rndis_wlan: cleanup

- remove double newlines between functions
- remove commented out function (rndis_set_config_parameter_u32())
- coding style fix in rndis_set_config_parameter_str()
- add comment banners between function sections

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agorndis_wlan: use bool for on/off switches
Jussi Kivilinna [Tue, 1 Sep 2009 12:32:55 +0000 (15:32 +0300)]
rndis_wlan: use bool for on/off switches

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Call spin_lock_bh() on btcoex_lock
Vasanthakumar Thiagarajan [Tue, 1 Sep 2009 12:16:33 +0000 (17:46 +0530)]
ath9k: Call spin_lock_bh() on btcoex_lock

As generic hw timer interrupt handler is moved to tasklet,
we no more need to call spin_lock_irqsave().

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Move generic hw timer intr handler to bottom-half
Vasanthakumar Thiagarajan [Tue, 1 Sep 2009 12:16:32 +0000 (17:46 +0530)]
ath9k: Move generic hw timer intr handler to bottom-half

There is no point handling this in hard irq, move it to
tasklet.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agorfkill: relicense header file
Johannes Berg [Wed, 26 Aug 2009 16:13:17 +0000 (18:13 +0200)]
rfkill: relicense header file

This header file is copied into userspace tools that
need not be GPLv2 licensed, make that easier.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: Iñaky Pérez-González <inaky@linux.intel.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Acked-by: Michael Buesch <mb@bu3sch.de>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoRevert Backoff [v3]: Calculate TCP's connection close threshold as a time value.
Damian Lukowski [Wed, 26 Aug 2009 00:16:34 +0000 (00:16 +0000)]
Revert Backoff [v3]: Calculate TCP's connection close threshold as a time value.

RFC 1122 specifies two threshold values R1 and R2 for connection timeouts,
which may represent a number of allowed retransmissions or a timeout value.
Currently linux uses sysctl_tcp_retries{1,2} to specify the thresholds
in number of allowed retransmissions.

For any desired threshold R2 (by means of time) one can specify tcp_retries2
(by means of number of retransmissions) such that TCP will not time out
earlier than R2. This is the case, because the RTO schedule follows a fixed
pattern, namely exponential backoff.

However, the RTO behaviour is not predictable any more if RTO backoffs can be
reverted, as it is the case in the draft
"Make TCP more Robust to Long Connectivity Disruptions"
(http://tools.ietf.org/html/draft-zimmermann-tcp-lcd).

In the worst case TCP would time out a connection after 3.2 seconds, if the
initial RTO equaled MIN_RTO and each backoff has been reverted.

This patch introduces a function retransmits_timed_out(N),
which calculates the timeout of a TCP connection, assuming an initial
RTO of MIN_RTO and N unsuccessful, exponentially backed-off retransmissions.

Whenever timeout decisions are made by comparing the retransmission counter
to some value N, this function can be used, instead.

The meaning of tcp_retries2 will be changed, as many more RTO retransmissions
can occur than the value indicates. However, it yields a timeout which is
similar to the one of an unpatched, exponentially backing off TCP in the same
scenario. As no application could rely on an RTO greater than MIN_RTO, there
should be no risk of a regression.

Signed-off-by: Damian Lukowski <damian@tvk.rwth-aachen.de>
Acked-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRevert Backoff [v3]: Revert RTO on ICMP destination unreachable
Damian Lukowski [Wed, 26 Aug 2009 00:16:31 +0000 (00:16 +0000)]
Revert Backoff [v3]: Revert RTO on ICMP destination unreachable

Here, an ICMP host/network unreachable message, whose payload fits to
TCP's SND.UNA, is taken as an indication that the RTO retransmission has
not been lost due to congestion, but because of a route failure
somewhere along the path.
With true congestion, a router won't trigger such a message and the
patched TCP will operate as standard TCP.

This patch reverts one RTO backoff, if an ICMP host/network unreachable
message, whose payload fits to TCP's SND.UNA, arrives.
Based on the new RTO, the retransmission timer is reset to reflect the
remaining time, or - if the revert clocked out the timer - a retransmission
is sent out immediately.
Backoffs are only reverted, if TCP is in RTO loss recovery, i.e. if
there have been retransmissions and reversible backoffs, already.

Changes from v2:
1) Renaming of skb in tcp_v4_err() moved to another patch.
2) Reintroduced tcp_bound_rto() and __tcp_set_rto().
3) Fixed code comments.

Signed-off-by: Damian Lukowski <damian@tvk.rwth-aachen.de>
Acked-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRevert Backoff [v3]: Rename skb to icmp_skb in tcp_v4_err()
Damian Lukowski [Wed, 26 Aug 2009 00:16:27 +0000 (00:16 +0000)]
Revert Backoff [v3]: Rename skb to icmp_skb in tcp_v4_err()

This supplementary patch renames skb to icmp_skb in tcp_v4_err() in order to
disambiguate from another sk_buff variable, which will be introduced
in a separate patch.

Signed-off-by: Damian Lukowski <damian@tvk.rwth-aachen.de>
Acked-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Add support for dcbnl_rtnl_ops.setapp/getapp
Yi Zou [Mon, 31 Aug 2009 12:34:28 +0000 (12:34 +0000)]
ixgbe: Add support for dcbnl_rtnl_ops.setapp/getapp

Add support for dcbnl_rtnl_ops.setapp/getapp to set or get the current user
priority bitmap for the given application protocol. Currently, 82599 only
supports setapp/getapp for Fiber Channel over Ethernet (FCoE) protocol.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Acked-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>
14 years agodcbnl: Add implementations of dcbnl setapp/getapp commands
Yi Zou [Mon, 31 Aug 2009 12:33:40 +0000 (12:33 +0000)]
dcbnl: Add implementations of dcbnl setapp/getapp commands

Implements the dcbnl netlink setapp/getapp pair. When a setapp/getapp
is received, dcbnl would just pass on to dcbnl_rtnl_op.setapp/getapp
that are supposed to be implemented by the low level drivers.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Acked-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>
14 years agodcbnl: Add netlink attributes for setapp/getapp to dcbnl
Yi Zou [Mon, 31 Aug 2009 12:33:20 +0000 (12:33 +0000)]
dcbnl: Add netlink attributes for setapp/getapp to dcbnl

Add defines for dcbnl netlink attributes to support netlink message passing of
setapp/getapp in dcbnl.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Acked-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>
14 years agodcbnl: Add support for setapp/getapp to netdev dcbnl_rtnl_ops
Yi Zou [Mon, 31 Aug 2009 12:32:55 +0000 (12:32 +0000)]
dcbnl: Add support for setapp/getapp to netdev dcbnl_rtnl_ops

Adds support of dcbnl setapp/getapp to dcbnl_rtnl_ops in netdev to allow
LLDs to implement their corresponding dcbnl setapp/getapp ops to support
the IEEE 802.1Q DCBX setapp/getapp commands.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Acked-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>
14 years agodcbnl: Add support for setapp/getapp commands to dcbnl
Yi Zou [Mon, 31 Aug 2009 12:32:34 +0000 (12:32 +0000)]
dcbnl: Add support for setapp/getapp commands to dcbnl

This patch adds dcbnl command definitions to support setapp/getapp
functionality from the IEEE 802.1Qaz Data Center Bridging Capability
Exchange protocol (DCBX) specification. Section 3.3 defines the
application protocol and its 802.1p user priority in DCBX, which is
implemented here as a pair of setapp/getapp commands in the kernel
dcbnl for setting and retrieving the user priority for an given
application protocol. The protocol is identified by the combination of
an id and an idtype. Currently, when idtype is 0, the corresponding
id gives the ether type of this protocol, e.g., for FCoE, it will be
0x8906; when idtype is 1, then the corresponding id gives the TCP or
UDP port number.

For more information regarding DCBX spec., please refer to the following:
http://www.ieee802.org/1/files/public/docs2008/
az-wadekar-dcbx-capability-exchange-discovery-protocol-1108-v1.01.pdf

Signed-off-by: Yi Zou <yi.zou@intel.com>
Acked-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>
14 years agoixgbe: Add support for the net_device_ops.ndo_fcoe_enable/disable to 82599
Yi Zou [Mon, 31 Aug 2009 12:32:14 +0000 (12:32 +0000)]
ixgbe: Add support for the net_device_ops.ndo_fcoe_enable/disable to 82599

This adds support to the net_device_ops.ndo_fcoe_enable/disable for 82599. This
consequently allows us to dynamically turn FCoE offload feature on or off
upon incoming calls to ndo_fcoe_enable/disable. When this happens, FCoE offload
features are enabled/disabled accordingly, and this is regardless of whether
DCB being turned on or not.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Acked-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>
14 years agovlan: Add support for net_devices_ops.ndo_fcoe_enable/_disable to VLAN
Yi Zou [Mon, 31 Aug 2009 12:31:55 +0000 (12:31 +0000)]
vlan: Add support for net_devices_ops.ndo_fcoe_enable/_disable to VLAN

This adds implementation of the net_devices_ops.ndo_fcoe_enable/_disable to
the VLAN driver. It checks if the real_dev has support for ndo_fcoe_enable/
ndo_fcoe_disable and if so, passes on to call the associated real_dev.

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>
14 years agonet: Add ndo_fcoe_enable/ndo_fcoe_disable to net_device_ops
Yi Zou [Mon, 31 Aug 2009 12:31:36 +0000 (12:31 +0000)]
net: Add ndo_fcoe_enable/ndo_fcoe_disable to net_device_ops

Add ndo_fcoe_enable/_disable to net_device_ops so the corresponding
HW can initialize itself for FCoE traffic or clean up after FCoE traffic is
done. This is expected to be called by the kernel FCoE stack upon receiving
a request for creating an FCoE instance on the corresponding netdev interface.
When implemented by the actual HW, the HW driver check the op code to perform
corresponding initialization or clean up for FCoE. The initialization normally
includes allocating extra queues for FCoE, setting corresponding HW registers
for FCoE, indicating FCoE offload features via netdev, etc. The clean-up would
include releasing the resources allocated 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>
14 years agonetdev: convert bulk of drivers to netdev_tx_t
Stephen Hemminger [Mon, 31 Aug 2009 19:50:58 +0000 (19:50 +0000)]
netdev: convert bulk of drivers to netdev_tx_t

In a couple of cases collapse some extra code like:
   int retval = NETDEV_TX_OK;
   ...
   return retval;
into
   return NETDEV_TX_OK;

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agowireless: convert drivers to netdev_tx_t
Stephen Hemminger [Mon, 31 Aug 2009 19:50:57 +0000 (19:50 +0000)]
wireless: convert drivers to netdev_tx_t

Mostly just simple conversions:
  * ray_cs had bogus return of NET_TX_LOCKED but driver
    was not using NETIF_F_LLTX
  * hostap and ipw2x00 had some code that returned value
    from a called function that also had to change to return netdev_tx_t

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoappletalk: convert drivers to netdev_tx_t
Stephen Hemminger [Mon, 31 Aug 2009 19:50:56 +0000 (19:50 +0000)]
appletalk: convert drivers to netdev_tx_t

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agointel: convert drivers to netdev_tx_t
Stephen Hemminger [Mon, 31 Aug 2009 19:50:55 +0000 (19:50 +0000)]
intel: convert drivers to netdev_tx_t

Get rid of some bogus return wrapping as well.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years ago3com: convert drivers to netdev_tx_t
Stephen Hemminger [Mon, 31 Aug 2009 19:50:54 +0000 (19:50 +0000)]
3com: convert drivers to netdev_tx_t

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotulip: convert drivers to netdev_tx_t
Stephen Hemminger [Mon, 31 Aug 2009 19:50:53 +0000 (19:50 +0000)]
tulip: convert drivers to netdev_tx_t

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agouwb: convert to netdev_tx_t
Stephen Hemminger [Mon, 31 Aug 2009 19:50:52 +0000 (19:50 +0000)]
uwb: convert to netdev_tx_t

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetdev: convert pseudo drivers to netdev_tx_t
Stephen Hemminger [Mon, 31 Aug 2009 19:50:51 +0000 (19:50 +0000)]
netdev: convert pseudo drivers to netdev_tx_t

These are all drivers that don't touch real hardware.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoirda: convert to netdev_tx_t
Stephen Hemminger [Mon, 31 Aug 2009 19:50:50 +0000 (19:50 +0000)]
irda: convert to netdev_tx_t

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetdev: convert pcmcia drivers to netdev_tx_t
Stephen Hemminger [Mon, 31 Aug 2009 19:50:49 +0000 (19:50 +0000)]
netdev: convert pcmcia drivers to netdev_tx_t

Update all the pcmcia network drivers for netdev_tx_t.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agohdlc: convert to netdev_tx_t
Stephen Hemminger [Mon, 31 Aug 2009 19:50:48 +0000 (19:50 +0000)]
hdlc: convert to netdev_tx_t

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agowan: convert drivers to netdev_tx_t
Stephen Hemminger [Mon, 31 Aug 2009 19:50:47 +0000 (19:50 +0000)]
wan: convert drivers to netdev_tx_t

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotokenring: convert to netdev_tx_t
Stephen Hemminger [Mon, 31 Aug 2009 19:50:46 +0000 (19:50 +0000)]
tokenring: convert to netdev_tx_t

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agousbnet: convert to netdev_tx_t
Stephen Hemminger [Mon, 31 Aug 2009 19:50:45 +0000 (19:50 +0000)]
usbnet: convert to netdev_tx_t

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoisdn: convert to netdev_tx_t
Stephen Hemminger [Mon, 31 Aug 2009 19:50:44 +0000 (19:50 +0000)]
isdn: convert to netdev_tx_t

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoconvert hamradio drivers to netdev_txreturnt_t
Stephen Hemminger [Mon, 31 Aug 2009 19:50:43 +0000 (19:50 +0000)]
convert hamradio drivers to netdev_txreturnt_t

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoconvert ATM drivers to netdev_tx_t
Stephen Hemminger [Mon, 31 Aug 2009 19:50:42 +0000 (19:50 +0000)]
convert ATM drivers to netdev_tx_t

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetdev: convert pseudo-devices to netdev_tx_t
Stephen Hemminger [Mon, 31 Aug 2009 19:50:41 +0000 (19:50 +0000)]
netdev: convert pseudo-devices to netdev_tx_t

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetdev: change transmit to limited range type
Stephen Hemminger [Mon, 31 Aug 2009 19:50:40 +0000 (19:50 +0000)]
netdev: change transmit to limited range type

The transmit function should only return one of three possible values,
some drivers got confused and returned errno's or other values.
This changes the definition so that this can be caught at compile time.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoath9k: Do an AHB reset before doing RTC reset
Vasanthakumar Thiagarajan [Mon, 31 Aug 2009 12:18:36 +0000 (17:48 +0530)]
ath9k: Do an AHB reset before doing RTC reset

Doing an RTC reset when DMA is active may corrupt memory,
make sure no DMA is active at this moment by doing an
AHB reset.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoipw2200: fix kconfig dependencies
Randy Dunlap [Sun, 30 Aug 2009 20:22:57 +0000 (13:22 -0700)]
ipw2200: fix kconfig dependencies

Fix kconfig dependencies for ipw2x00 drivers, fixes build errors:

ERROR: "wiphy_free" [drivers/net/wireless/ipw2x00/libipw.ko] undefined!
ERROR: "wiphy_unregister" [drivers/net/wireless/ipw2x00/libipw.ko] undefined!
ERROR: "wiphy_new" [drivers/net/wireless/ipw2x00/libipw.ko] undefined!
ERROR: "cfg80211_wext_giwname" [drivers/net/wireless/ipw2x00/ipw2200.ko] undefined!
ERROR: "wiphy_register" [drivers/net/wireless/ipw2x00/ipw2200.ko] undefined!

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: Reorganize padding & L2 padding
Ivo van Doorn [Sat, 29 Aug 2009 18:30:45 +0000 (20:30 +0200)]
rt2x00: Reorganize padding & L2 padding

The old function rt2x00queue_payload_align() handled
both adding and removing L2 padding and some basic
frame alignment. The entire function was being abused
because it had multiple functions and the header length
argument was somtimes used to align the header instead
of the payload.

Additionally there was a bug when inserting L2 padding
that only the payload was aligned but not the header. This
happens when the header wasn't aligned properly by mac80211,
but rt2x00lib only moves the payload.

A secondary problem was that when removing L2 padding during
TXdone or RX the skb wasn't resized to the proper size.

Split the function into seperate functions each handling
its task as it should.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: Fix TX status reporting
Ivo van Doorn [Sat, 29 Aug 2009 17:10:14 +0000 (19:10 +0200)]
rt2x00: Fix TX status reporting

Not all values of the TX status enumeration were
covered during updating of the TX statistics. This
could lead to wrong bitrate tuning but also wrong
behavior in tools like hostapd.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43: LP-PHY: Fix TX gain tables
Gábor Stefanik [Fri, 28 Aug 2009 20:36:02 +0000 (22:36 +0200)]
b43: LP-PHY: Fix TX gain tables

The rev1 2GHz and rev2 5GHz gain tables were incorrectly documented
on the specs originally. Update these gaintables to match the cor-
rected specs.

Signed-off-by: Gábor Stefanik <netroller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43: Fix typo in modparam_btcoex description
Gábor Stefanik [Fri, 28 Aug 2009 20:34:21 +0000 (22:34 +0200)]
b43: Fix typo in modparam_btcoex description

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43: Add myself to module authors & to LP-PHY file copyright notices
Gábor Stefanik [Fri, 28 Aug 2009 20:32:17 +0000 (22:32 +0200)]
b43: Add myself to module authors & to LP-PHY file copyright notices

Also mark the LP-PHY driver "802.11a/g" instead of "802.11g",
as LP-PHY is capable of both 2GHz and 5GHz operation.

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43: Refactor and update antenna diversity for A/G-PHY
Gábor Stefanik [Fri, 28 Aug 2009 19:37:00 +0000 (21:37 +0200)]
b43: Refactor and update antenna diversity for A/G-PHY

-Make use of the b43_phy_set/mask/maskset helpers.
-Fix a few errors in the code.
-Make the code more readable.

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwl3945: reduce debug noise when default debug flags used
Reinette Chatre [Fri, 28 Aug 2009 16:58:50 +0000 (09:58 -0700)]
iwl3945: reduce debug noise when default debug flags used

Significant literature suggests users use debug flags 0x43fff - this causes
the debug flags to be set that causes information to be printed for every
received frame - including beacons. In the best case it fills up the logs,
at worst it slows driver down and causes failures due to timeouts.

In the RX handler, print debugging only if user requested RX debugging.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: fix situation in which debug message is printed
Reinette Chatre [Fri, 28 Aug 2009 16:44:49 +0000 (09:44 -0700)]
iwlwifi: fix situation in which debug message is printed

3945 does not have update_chain_flags defined and because if this we always
see the debug message that does not apply to it. Add a check to be specific
about what is actually happening.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: use sleep interval succession
Johannes Berg [Fri, 28 Aug 2009 16:44:48 +0000 (09:44 -0700)]
iwlwifi: use sleep interval succession

Some concerns were raised about the automatic adjustment
of sleep intervals to all the same, potentially high,
value, and I can imagine the hardware behaving better
when we don't ask too much of it.

So let's convert to use a succession of sleep levels
when requesting to go to deeper sleeps (which can only
happen with large DTIM intervals), using the succession
values from power level three, which have the benefit of
also having been tested extensively already.

As a result, the automatic sleep level adjustment will
now be mostly equivalent to power level three, except
for the RX/TX timeouts and possibly using smaller sleep
vectors to account for networking latency.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: use iwl_hwrate_get_mac80211_idx where appropriate
Daniel C Halperin [Fri, 28 Aug 2009 16:44:47 +0000 (09:44 -0700)]
iwlwifi: use iwl_hwrate_get_mac80211_idx where appropriate

For HT packets, mac80211 expects the rate_idx to be an MCS number, which is the
lower byte of rate_n_flags.  However, iwl_hwrate_to_plcp_idx takes the MCS
number and reduces it down to the range 0-8 (6 to 60 Mbps), removing the bits
that signify multiply streams, HT40 Duplicate mode, or unequal modulation.
This version is used for various internal purposes through the driver.

Add the function iwl_hwrate_get_mac80211_idx, an alternate version which takes
the rate and the band and returns the mac80211 index (MCS, for HT packets, and
PLCP rate, for legacy packets).

Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: remove incorrect uses of ieee80211_get_tx_rate to prevent TX stall
Daniel C Halperin [Fri, 28 Aug 2009 16:44:46 +0000 (09:44 -0700)]
iwlwifi: remove incorrect uses of ieee80211_get_tx_rate to prevent TX stall

Refactor and correct rate selection for outgoing transmitted
packets.

First, note that HT rates in the mac80211 rate table do not provide valid
indices when ieee80211_get_tx_rate is called; the check to see if we could to
abort a transmission early in iwl_tx_skb() would thus occasionally read invalid
memory and occasionally stall transmission (if the erroneous byte was 0xff).
We remove that code; the check wasn't valid anyway.

Second, iwl_tx_cmd_build_rate() also called ieee80211_get_tx_rate to be used
for sending management packets, which do not use the uCode station table.  This
patch refactors that function and adds comments to enhance legibility, replaces
the call to ieee80211_get_tx_rate() with a direct lookup, and adds error
handling in case the table entry is invalid.

Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: remove 60 Mbps from sband bitrates table
Daniel C Halperin [Fri, 28 Aug 2009 16:44:45 +0000 (09:44 -0700)]
iwlwifi: remove 60 Mbps from sband bitrates table

ieee80211_supported_band is supposed to only contain legacy rates in the
bitrates table (HT rates go in the ieee80211_sta_ht_cap substruct).  Make
iwlwifi driver obey this restriction by removing the 60 Mbps rate. Also, clean
up a few pieces of other code that formerly relied on 60 Mbps being in
sband->bitrates.

Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agos2io: Generate complete messages using single line DBG_PRINTs
Joe Perches [Tue, 25 Aug 2009 08:52:00 +0000 (08:52 +0000)]
s2io: Generate complete messages using single line DBG_PRINTs

Single line log messages should be emitted by a single call
where possible.

Converted multiple calls to DBG_PRINT to single call form.
Removed "s2io:" preface from DBG_PRINTs.

The DBG_PRINT macro now emits a log level and is surrounded by
a do {...} while (0)

All s2io log output is now prefaced with KBUILD_MODNAME ": "
via pr_fmt.

The DBG_PRINT macro should probably be converted to use the
dev_<level> form eventually.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agos2io.c: Convert skipped nic->config.tx_cfg[i]. to tx_cfg->
Joe Perches [Mon, 24 Aug 2009 17:29:48 +0000 (17:29 +0000)]
s2io.c: Convert skipped nic->config.tx_cfg[i]. to tx_cfg->

Missed doing the conversion in earlier patch.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agos2io.c: Standardize statistics accessors
Joe Perches [Mon, 24 Aug 2009 17:29:47 +0000 (17:29 +0000)]
s2io.c: Standardize statistics accessors

Regularize the declaration and uses of
struct config_param *config = &sp->config;
struct mac_info *mac_control = &sp->mac_control;
and use
struct stat_block *stats = mac_control->stats_info;
struct swStat *swstats = &stats->sw_stat;
struct xpakStat *xstats = &stats->xpak_stat;
and convert the longish uses like
nic->mac_control.stats_info->sw_stat.<foo>
to
swstats-><foo>
etc.

This also makes the statistics code marginally smaller
and presumably faster.

Old:
$ size s2io.o
   text    data     bss     dec     hex filename
 114289     516   33360  148165   242c5 s2io.o
New:
$ size s2io.o
   text    data     bss     dec     hex filename
 114097     516   33360  147973   24205 s2io.o

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agos2io.c: fix spelling explaination
Joe Perches [Mon, 24 Aug 2009 17:29:46 +0000 (17:29 +0000)]
s2io.c: fix spelling explaination

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agos2io.c: convert printks to pr_<level>
Joe Perches [Mon, 24 Aug 2009 17:29:45 +0000 (17:29 +0000)]
s2io.c: convert printks to pr_<level>

Fixed trivial typo as well

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agos2io.c: Make more conforming to normal kernel style
Joe Perches [Mon, 24 Aug 2009 17:29:44 +0000 (17:29 +0000)]
s2io.c: Make more conforming to normal kernel style

Still has a few long lines.

checkpatch was:
total: 263 errors, 53 warnings, 8751 lines checked
is:
total: 4 errors, 35 warnings, 8767 lines checked

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agos2io.c: use kzalloc
Joe Perches [Mon, 24 Aug 2009 17:29:43 +0000 (17:29 +0000)]
s2io.c: use kzalloc

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agos2io.c: Use calculated size in kmallocs
Joe Perches [Mon, 24 Aug 2009 17:29:42 +0000 (17:29 +0000)]
s2io.c: Use calculated size in kmallocs

Use consistent style.  Don't calculate the kmalloc size multiple times

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agos2io.c: Shorten code line length by using intermediate pointers
Joe Perches [Mon, 24 Aug 2009 17:29:41 +0000 (17:29 +0000)]
s2io.c: Shorten code line length by using intermediate pointers

Repeated variable use and line wrapping is hard to read.
Use temp variables instead of direct references.

struct fifo_info *fifo = &mac_control->fifos[i];
struct ring_info *ring = &mac_control->rings[i];
struct tx_fifo_config *tx_cfg = &config->tx_cfg[i];
struct rx_ring_config *rx_cfg = &config->rx_cfg[i];

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agos2io.c: Use const for strings
Joe Perches [Mon, 24 Aug 2009 17:29:40 +0000 (17:29 +0000)]
s2io.c: Use const for strings

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agopkt_sched: Fix resource limiting in pfifo_fast
Krishna Kumar [Mon, 31 Aug 2009 05:20:28 +0000 (22:20 -0700)]
pkt_sched: Fix resource limiting in pfifo_fast

pfifo_fast_enqueue has this check:
        if (skb_queue_len(list) < qdisc_dev(qdisc)->tx_queue_len) {

which allows each band to enqueue upto tx_queue_len skbs for a
total of 3*tx_queue_len skbs. I am not sure if this was the
intention of limiting in qdisc.

Patch compiled and 32 simultaneous netperf testing ran fine. Also:
# tc -s qdisc show dev eth2
qdisc pfifo_fast 0: root bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 16835026752 bytes 373116 pkt (dropped 0, overlimits 0 requeues 25)
 rate 0bit 0pps backlog 0b 0p requeues 25

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: convert remaining non-symbolic return values in dev_queue_xmit
Krishna Kumar [Sat, 29 Aug 2009 20:21:36 +0000 (20:21 +0000)]
net: convert remaining non-symbolic return values in dev_queue_xmit

Patch compiled and 32 simultaneous netperf testing ran fine.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetdevice: Consolidate to use existing macros where available.
Krishna Kumar [Sat, 29 Aug 2009 20:21:21 +0000 (20:21 +0000)]
netdevice: Consolidate to use existing macros where available.

Patch compiled and 32 simultaneous netperf testing ran fine.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocan: use correct NET_RX_ return values
Oliver Hartkopp [Sat, 29 Aug 2009 06:45:09 +0000 (06:45 +0000)]
can: use correct NET_RX_ return values

Dropped skb's should be documented by an appropriate return value.
Use the correct NET_RX_DROP and NET_RX_SUCCESS values for that reason.

Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogianfar: gfar_remove needs to call unregister_netdev()
Toru UCHIYAMA [Mon, 31 Aug 2009 05:04:07 +0000 (22:04 -0700)]
gianfar: gfar_remove needs to call unregister_netdev()

This patch solves the problem that the Oops(BUG_ON) occurs by rmmod.

# rmmod gianfar_driver
------------[ cut here ]------------
Kernel BUG at c01fec48 [verbose debug info unavailable]
Oops: Exception in kernel mode, sig: 5 [#1]
MPC837x MDS
Modules linked in: gianfar_driver(-) usb_storage scsi_wait_scan
NIP: c01fec48 LR: c01febf4 CTR: c01feba8
REGS: dec5bd60 TRAP: 0700   Tainted: G        W   (2.6.31-rc2)
MSR: 00029032 <EE,ME,CE,IR,DR>  CR: 22000424  XER: 20000000
TASK = dec4cac0[1135] 'rmmod' THREAD: dec5a000
GPR00: 00000002 dec5be10 dec4cac0 dfba1820 c035d444 c035d478 ffffffff 00000000
GPR08: 0000002b 00000001 dfba193c 00000001 22000424 10019b34 1ffcb000 00000000
GPR16: 10012008 00000000 bf82ebe0 100017ec bf82ebec bf82ebe8 bf82ebd0 00000880
GPR24: 00000000 bf82ebf0 c03532f0 c03532e4 c036b594 dfba183c dfba1800 dfba1820
NIP [c01fec48] free_netdev+0xa0/0xb8
LR [c01febf4] free_netdev+0x4c/0xb8
Call Trace:
[dec5be10] [c01febf4] free_netdev+0x4c/0xb8 (unreliable)
[dec5be30] [e105f290] gfar_remove+0x50/0x68 [gianfar_driver]
[dec5be40] [c01ec534] of_platform_device_remove+0x30/0x44
[dec5be50] [c0181760] __device_release_driver+0x68/0xc8
[dec5be60] [c0181868] driver_detach+0xa8/0xac
[dec5be80] [c0180814] bus_remove_driver+0x9c/0xd8
[dec5bea0] [c0181efc] driver_unregister+0x60/0x98
[dec5beb0] [c01ec650] of_unregister_driver+0x14/0x24
[dec5bec0] [e10631bc] gfar_exit+0x18/0x4bc [gianfar_driver]
[dec5bed0] [c0047584] sys_delete_module+0x16c/0x228
[dec5bf40] [c00116bc] ret_from_syscall+0x0/0x38
--- Exception: c01 at 0xff3669c
    LR = 0x10000f34
Instruction dump:
409e0024 a07e00c0 7c63f050 4be74429 80010024 bba10014 38210020 7c0803a6
4e800020 68000003 3160ffff 7d2b0110 <0f09000038000004 387e01f0 901e01d4
---[ end trace 8c595bcd37230a0f ]---
 localhost kernel: ------------[ cut here ]------------

Signed-off-by: Toru UCHIYAMA uchiyama.toru@jp.fujitsu.com
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoWAN: bit and/or confusion
roel kluin [Thu, 20 Aug 2009 04:04:40 +0000 (04:04 +0000)]
WAN: bit and/or confusion

Fix the tests that check whether Frame* bits are not set

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoucc_geth: Implement suspend/resume and Wake-On-LAN support
Anton Vorontsov [Thu, 27 Aug 2009 07:35:57 +0000 (07:35 +0000)]
ucc_geth: Implement suspend/resume and Wake-On-LAN support

This patch implements suspend/resume and WOL support for UCC Ethernet
driver.

We support two wake up events: wake on PHY/link changes and wake
on magic packet.

In some CPUs (like MPC8569) QE shuts down during sleep, so magic packet
detection is unusable, and also on resume we should fully reinitialize
UCC structures.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoucc_geth: Remove UGETH_MAGIC_PACKET Kconfig symbol and code
Anton Vorontsov [Thu, 27 Aug 2009 07:35:56 +0000 (07:35 +0000)]
ucc_geth: Remove UGETH_MAGIC_PACKET Kconfig symbol and code

This patch removes currently unused UGETH_MAGIC_PACKET Kconfig symbol
and code, i.e. magic_packet_detection_{enable,disable} functions.

The two functions each contain just two steps that we'll place into
suspend/resume code path under CONFIG_PM.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoucc_geth: Factor out MAC initialization steps into a call
Anton Vorontsov [Thu, 27 Aug 2009 07:35:54 +0000 (07:35 +0000)]
ucc_geth: Factor out MAC initialization steps into a call

This patch factors out MAC initialization into ucc_geth_init_mac()
function that we'll use for suspend/resume.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agopowerpc/qe: Implement qe_alive_during_sleep() helper function
Anton Vorontsov [Thu, 27 Aug 2009 07:35:50 +0000 (07:35 +0000)]
powerpc/qe: Implement qe_alive_during_sleep() helper function

In some CPUs (i.e. MPC8569) QE shuts down completely during sleep,
drivers may want to know that to reinitialize registers and buffer
descriptors.

This patch implements qe_alive_during_sleep() helper function, so far
it just checks if MPC8569-compatible power management controller is
present, which is a sign that QE turns off during sleep.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoucc_geth: Fix NULL pointer dereference in uec_get_ethtool_stats()
Anton Vorontsov [Thu, 27 Aug 2009 07:35:47 +0000 (07:35 +0000)]
ucc_geth: Fix NULL pointer dereference in uec_get_ethtool_stats()

In commit 3e73fc9a12679a546284d597c1f19165792d0b83 ("ucc_geth: Fix IO
memory (un)mapping code") I fixed ug_regs IO memory leak by properly
freeing the allocated memory. But ethtool_stats() callback doesn't
check for ug_regs being NULL, and that causes following oops if
'ethtool -S' is executed on a closed eth device:

  Unable to handle kernel paging request for data at address 0x00000180
  Faulting instruction address: 0xc0208228
  Oops: Kernel access of bad area, sig: 11 [#1]
  ...
  NIP [c0208228] uec_get_ethtool_stats+0x38/0x140
  LR [c02559a0] ethtool_get_stats+0xf8/0x23c
  Call Trace:
  [ef87bcd0] [c025597c] ethtool_get_stats+0xd4/0x23c (unreliable)
  [ef87bd00] [c025706c] dev_ethtool+0xfe8/0x11bc
  [ef87be00] [c0252b5c] dev_ioctl+0x454/0x6a8
  ...
  ---[ end trace 77fff1162a9586b0 ]---
  Segmentation fault

This patch fixes the issue.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluet...
David S. Miller [Mon, 31 Aug 2009 04:30:39 +0000 (21:30 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/holtmann/bluetooth-next-2.6

14 years agotg3: Update version to 3.101
Matt Carlson [Fri, 28 Aug 2009 14:03:44 +0000 (14:03 +0000)]
tg3: Update version to 3.101

This patch updates the tg3 version to 3.101.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Move per-int tx members to a per-int struct
Matt Carlson [Fri, 28 Aug 2009 14:03:21 +0000 (14:03 +0000)]
tg3: Move per-int tx members to a per-int struct

This patch moves the tx_prod, tx_cons, tx_pending, tx_ring, and
tx_buffers transmit ring device members to a per-interrupt structure.
It also adds a new transmit producer mailbox member (prodmbox) and
converts the code to use it rather than a preprocessor constant.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Move per-int rx members to per-int struct
Matt Carlson [Fri, 28 Aug 2009 14:03:01 +0000 (14:03 +0000)]
tg3: Move per-int rx members to per-int struct

This patch moves the rx_rcb, rx_rcb_mapping, and rx_rcb_ptr return ring
device members to a per-interrupt structure.  It also adds a new return
ring consumer mailbox register member (consmbox) and converts the code
to use it rather than a preprocessor constant.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Move general int members to a per-int struct
Matt Carlson [Fri, 28 Aug 2009 14:02:40 +0000 (14:02 +0000)]
tg3: Move general int members to a per-int struct

This patch moves the last_tag, last_tag_irq, and hw_status device
members to a per-interrupt structure.  It also adds a new interrupt
mailbox member (int_mbox) and converts the code to use it rather than a
direct preprocessor constant.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Convert napi handlers to use tnapi
Matt Carlson [Fri, 28 Aug 2009 14:02:18 +0000 (14:02 +0000)]
tg3: Convert napi handlers to use tnapi

This patch converts the napi interrupt handler functions to accept and
use tg3_napi structures.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Convert ISR parameter to tnapi
Matt Carlson [Fri, 28 Aug 2009 14:01:57 +0000 (14:01 +0000)]
tg3: Convert ISR parameter to tnapi

This patch migrates the ISR parameter from struct net_device to struct
tg3_napi.  Checkpatch complains about the existence of the preexisting
IRQF_SAMPLE_RANDOM flag.  I've opted to keep this patch conservative and
let it continue to exist until the flag gets officially purged from the
kernel.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Move napi to per-int struct
Matt Carlson [Fri, 28 Aug 2009 14:01:37 +0000 (14:01 +0000)]
tg3: Move napi to per-int struct

This patch creates a per-interrupt data structure, moves the napi
member over, and creates a tg3 pointer back to the device structure.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Cleanup interrupt setup / teardown
Matt Carlson [Fri, 28 Aug 2009 14:01:15 +0000 (14:01 +0000)]
tg3: Cleanup interrupt setup / teardown

Later patches will be adding MSIX support, which will complicate
interrupt initialization.  This patch prepares for the integration by
breaking out the interrupt setup and teardown code into separate
functions and cleaning up the error return paths.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Use ext rx bds
Matt Carlson [Fri, 28 Aug 2009 14:00:55 +0000 (14:00 +0000)]
tg3: Use ext rx bds

The 5717 only uses extended buffer descriptors for the jumbo producer
ring.  Extended buffer descriptors are available on all devices that
support a separate jumbo producer ring so make the change universal.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Create a new prodring_set structure
Matt Carlson [Fri, 28 Aug 2009 14:00:25 +0000 (14:00 +0000)]
tg3: Create a new prodring_set structure

This patch migrates most of the rx producer ring variables to a new
tg3_rx_prodring_set structure and modifies the code accordingly.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Create rx producer ring setup routines
Matt Carlson [Fri, 28 Aug 2009 13:59:57 +0000 (13:59 +0000)]
tg3: Create rx producer ring setup routines

Later patches are going to complicate the ring initialization routines.
This patch breaks out the setup and teardown of the rx producer rings
into separate functions to make the code more readable.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Clarify rx buffer relationships
Matt Carlson [Fri, 28 Aug 2009 13:58:46 +0000 (13:58 +0000)]
tg3: Clarify rx buffer relationships

This patch attempts to document the various rx buffer sizes used by the
driver and how they relate to each other.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Move the JUMBO_CAPABLE and SUPPORT_MSI flags
Matt Carlson [Fri, 28 Aug 2009 13:58:24 +0000 (13:58 +0000)]
tg3: Move the JUMBO_CAPABLE and SUPPORT_MSI flags

This patch moves where the jumbo capable and msi support flags are
located.  This is prep work for the addition of msix support flags.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Break out mini producer ring handling
Matt Carlson [Fri, 28 Aug 2009 13:57:12 +0000 (13:57 +0000)]
tg3: Break out mini producer ring handling

This patch separates the code that sets up the mini producer ring from
the code that sets up the jumbo producer rings.  The 5717 asic rev
devices do not have a mini ring, but do have a jumbo frame
implementation similar to the 5704 and previous devices.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Reformat NVRAM case statements
Matt Carlson [Fri, 28 Aug 2009 12:29:16 +0000 (12:29 +0000)]
tg3: Reformat NVRAM case statements

This patch fixes up the NVRAM detection switch statements to conform
to the kernel coding style.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Add new 5785 10/100 only device ID
Matt Carlson [Fri, 28 Aug 2009 12:28:45 +0000 (12:28 +0000)]
tg3: Add new 5785 10/100 only device ID

This patch adds a new device ID for those 5785 devices that will only
use 10/100 phys.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Delay mdio bus init until fw finishes
Matt Carlson [Fri, 28 Aug 2009 12:27:50 +0000 (12:27 +0000)]
tg3: Delay mdio bus init until fw finishes

The device firmware uses the MDIO bus during early setup.  If the driver
modifies the MDIO bus configuration while it is in use by the firmware,
any number of bad things can happen.  This patch delays MDIO setup until
after the firmware posts its magic signature, signifying initialization
is complete.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotipc: fix test of bearer_priority range in tipc_register_media()
roel kluin [Thu, 27 Aug 2009 02:03:15 +0000 (02:03 +0000)]
tipc: fix test of bearer_priority range in tipc_register_media()

For the bearer_priority to be less than TIPC_MIN_LINK_PRI and greater than
TIPC_MAX_LINK_PRI is logically impossible.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocan: switch to seq_file
Alexey Dobriyan [Fri, 28 Aug 2009 09:57:21 +0000 (09:57 +0000)]
can: switch to seq_file

create_proc_read_entry() is going to be removed soon.

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