safe/jmp/linux-2.6
14 years agonetlink: constify nlmsghdr arguments
Patrick McHardy [Tue, 25 Aug 2009 14:07:40 +0000 (16:07 +0200)]
netlink: constify nlmsghdr arguments

Consitfy nlmsghdr arguments to a couple of functions as preparation
for the next patch, which will constify the netlink message data in
all nfnetlink users.

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: nf_conntrack: log packets dropped by helpers
Patrick McHardy [Tue, 25 Aug 2009 13:33:08 +0000 (15:33 +0200)]
netfilter: nf_conntrack: log packets dropped by helpers

Log packets dropped by helpers using the netfilter logging API. This
is useful in combination with nfnetlink_log to analyze those packets
in userspace for debugging.

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: bridge: refcount fix
Eric Dumazet [Mon, 24 Aug 2009 17:35:38 +0000 (19:35 +0200)]
netfilter: bridge: refcount fix

commit f216f082b2b37c4943f1e7c393e2786648d48f6f
([NETFILTER]: bridge netfilter: deal with martians correctly)
added a refcount leak on in_dev.

Instead of using in_dev_get(), we can use __in_dev_get_rcu(),
as netfilter hooks are running under rcu_read_lock(), as pointed
by Patrick.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: nf_nat: fix inverted logic for persistent NAT mappings
Maximilian Engelhardt [Mon, 24 Aug 2009 17:24:54 +0000 (19:24 +0200)]
netfilter: nf_nat: fix inverted logic for persistent NAT mappings

Kernel 2.6.30 introduced a patch [1] for the persistent option in the
netfilter SNAT target. This is exactly what we need here so I had a quick look
at the code and noticed that the patch is wrong. The logic is simply inverted.
The patch below fixes this.

Also note that because of this the default behavior of the SNAT target has
changed since kernel 2.6.30 as it now ignores the destination IP in choosing
the source IP for nating (which should only be the case if the persistent
option is set).

[1] http://git.eu.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=98d500d66cb7940747b424b245fc6a51ecfbf005

Signed-off-by: Maximilian Engelhardt <maxi@daemonizer.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: xtables: mark initial tables constant
Jan Engelhardt [Mon, 24 Aug 2009 12:56:30 +0000 (14:56 +0200)]
netfilter: xtables: mark initial tables constant

The inputted table is never modified, so should be considered const.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoMerge branch 'master' of git://dev.medozas.de/linux
Patrick McHardy [Mon, 10 Aug 2009 15:14:59 +0000 (17:14 +0200)]
Merge branch 'master' of git://dev.medozas.de/linux

14 years agonetfilter: xtables: check for standard verdicts in policies
Jan Engelhardt [Sat, 18 Jul 2009 13:22:30 +0000 (15:22 +0200)]
netfilter: xtables: check for standard verdicts in policies

This adds the second check that Rusty wanted to have a long time ago. :-)

Base chain policies must have absolute verdicts that cease processing
in the table, otherwise rule execution may continue in an unexpected
spurious fashion (e.g. next chain that follows in memory).

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: xtables: check for unconditionality of policies
Jan Engelhardt [Thu, 9 Jul 2009 20:54:53 +0000 (22:54 +0200)]
netfilter: xtables: check for unconditionality of policies

This adds a check that iptables's original author Rusty set forth in
a FIXME comment.

Underflows in iptables are better known as chain policies, and are
required to be unconditional or there would be a stochastical chance
for the policy rule to be skipped if it does not match. If that were
to happen, rule execution would continue in an unexpected spurious
fashion.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: xtables: ignore unassigned hooks in check_entry_size_and_hooks
Jan Engelhardt [Sat, 18 Jul 2009 12:52:58 +0000 (14:52 +0200)]
netfilter: xtables: ignore unassigned hooks in check_entry_size_and_hooks

The "hook_entry" and "underflow" array contains values even for hooks
not provided, such as PREROUTING in conjunction with the "filter"
table. Usually, the values point to whatever the next rule is. For
the upcoming unconditionality and underflow checking patches however,
we must not inspect that arbitrary rule.

Skipping unassigned hooks seems like a good idea, also because
newinfo->hook_entry and newinfo->underflow will then continue to have
the poison value for detecting abnormalities.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: xtables: use memcmp in unconditional check
Jan Engelhardt [Thu, 9 Jul 2009 21:00:19 +0000 (23:00 +0200)]
netfilter: xtables: use memcmp in unconditional check

Instead of inspecting each u32/char open-coded, clean up and make use
of memcmp. On some arches, memcmp is implemented as assembly or GCC's
__builtin_memcmp which can possibly take advantages of known
alignment.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: iptables: remove unused datalen variable
Jan Engelhardt [Wed, 8 Jul 2009 10:33:10 +0000 (12:33 +0200)]
netfilter: iptables: remove unused datalen variable

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: xtables: realign struct xt_target_param
Jan Engelhardt [Sun, 5 Jul 2009 13:55:06 +0000 (15:55 +0200)]
netfilter: xtables: realign struct xt_target_param

This commit gets rid of a padding hole as reported by pahole(1).
Saves 8 bytes on x86_64.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: xtables: switch table AFs to nfproto
Jan Engelhardt [Sat, 13 Jun 2009 04:25:44 +0000 (06:25 +0200)]
netfilter: xtables: switch table AFs to nfproto

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: xtables: switch hook PFs to nfproto
Jan Engelhardt [Sat, 13 Jun 2009 04:20:29 +0000 (06:20 +0200)]
netfilter: xtables: switch hook PFs to nfproto

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: conntrack: switch hook PFs to nfproto
Jan Engelhardt [Sat, 13 Jun 2009 04:22:18 +0000 (06:22 +0200)]
netfilter: conntrack: switch hook PFs to nfproto

Simple substitution to indicate that the fields indeed use the
NFPROTO_ space.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: xtables: remove redirecting header files
Jan Engelhardt [Fri, 12 Jun 2009 17:47:21 +0000 (19:47 +0200)]
netfilter: xtables: remove redirecting header files

When IPv4 and IPv6 matches were unified approx. 3.5 years ago, they
received new header filenames (e.g. xt_CLASSIFY.h). Let's remove the
old ones now.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: xtables: remove xt_owner v0
Jan Engelhardt [Fri, 12 Jun 2009 17:46:26 +0000 (19:46 +0200)]
netfilter: xtables: remove xt_owner v0

Superseded by xt_owner v1 (v2.6.24-2388-g0265ab4).

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: xtables: remove xt_mark v0
Jan Engelhardt [Fri, 12 Jun 2009 17:02:27 +0000 (19:02 +0200)]
netfilter: xtables: remove xt_mark v0

Superseded by xt_mark v1 (v2.6.24-2922-g17b0d7e).

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: xtables: remove xt_iprange v0
Jan Engelhardt [Fri, 12 Jun 2009 16:58:19 +0000 (18:58 +0200)]
netfilter: xtables: remove xt_iprange v0

Superseded by xt_iprange v1 (v2.6.24-2928-g1a50c5a1).

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: xtables: remove xt_conntrack v0
Jan Engelhardt [Fri, 12 Jun 2009 16:56:14 +0000 (18:56 +0200)]
netfilter: xtables: remove xt_conntrack v0

Superseded by xt_conntrack v1 (v2.6.24-2921-g64eb12f).

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: xtables: remove xt_connmark v0
Jan Engelhardt [Fri, 12 Jun 2009 16:50:33 +0000 (18:50 +0200)]
netfilter: xtables: remove xt_connmark v0

Superseded by xt_connmark v1 (v2.6.24-2919-g96e3227).

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: xtables: remove xt_MARK v0, v1
Jan Engelhardt [Fri, 12 Jun 2009 16:47:32 +0000 (18:47 +0200)]
netfilter: xtables: remove xt_MARK v0, v1

Superseded by xt_MARK v2 (v2.6.24-2918-ge0a812a).

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: xtables: remove xt_CONNMARK v0
Jan Engelhardt [Fri, 12 Jun 2009 16:42:12 +0000 (18:42 +0200)]
netfilter: xtables: remove xt_CONNMARK v0

Superseded by xt_CONNMARK v1 (v2.6.24-2917-g0dc8c76).

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: xtables: remove xt_TOS v0
Jan Engelhardt [Fri, 12 Jun 2009 16:36:33 +0000 (18:36 +0200)]
netfilter: xtables: remove xt_TOS v0

Superseded by xt_TOS v1 (v2.6.24-2396-g5c350e5).

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: ebtables: Use %pM conversion specifier
Tobias Klauser [Mon, 10 Aug 2009 08:10:55 +0000 (10:10 +0200)]
netfilter: ebtables: Use %pM conversion specifier

ebt_log uses its own implementation of print_mac to print MAC addresses.
This patch converts it to use the %pM conversion specifier for printk.

Signed-off-by: Tobias Klauser <klto@zhaw.ch>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: nf_conntrack: add SCTP support for SO_ORIGINAL_DST
Rafael Laufer [Mon, 10 Aug 2009 08:08:27 +0000 (10:08 +0200)]
netfilter: nf_conntrack: add SCTP support for SO_ORIGINAL_DST

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonet: Avoid enqueuing skb for default qdiscs
Krishna Kumar [Thu, 6 Aug 2009 01:44:21 +0000 (01:44 +0000)]
net: Avoid enqueuing skb for default qdiscs

dev_queue_xmit enqueue's a skb and calls qdisc_run which
dequeue's the skb and xmits it. In most cases, the skb that
is enqueue'd is the same one that is dequeue'd (unless the
queue gets stopped or multiple cpu's write to the same queue
and ends in a race with qdisc_run). For default qdiscs, we
can remove the redundant enqueue/dequeue and simply xmit the
skb since the default qdisc is work-conserving.

The patch uses a new flag - TCQ_F_CAN_BYPASS to identify the
default fast queue. The controversial part of the patch is
incrementing qlen when a skb is requeued - this is to avoid
checks like the second line below:

+  } else if ((q->flags & TCQ_F_CAN_BYPASS) && !qdisc_qlen(q) &&
>>         !q->gso_skb &&
+          !test_and_set_bit(__QDISC_STATE_RUNNING, &q->state)) {

Results of a 2 hour testing for multiple netperf sessions (1,
2, 4, 8, 12 sessions on a 4 cpu system-X). The BW numbers are
aggregate Mb/s across iterations tested with this version on
System-X boxes with Chelsio 10gbps cards:

----------------------------------
Size |  ORG BW          NEW BW   |
----------------------------------
128K |  156964          159381   |
256K |  158650          162042   |
----------------------------------

Changes from ver1:

1. Move sch_direct_xmit declaration from sch_generic.h to
   pkt_sched.h
2. Update qdisc basic statistics for direct xmit path.
3. Set qlen to zero in qdisc_reset.
4. Changed some function names to more meaningful ones.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agomlx4_en: Not using Shared Receive Queues
Yevgeny Petrilin [Fri, 7 Aug 2009 02:28:18 +0000 (19:28 -0700)]
mlx4_en: Not using Shared Receive Queues

We use 1:1 mapping between QPs and SRQs on receive side,
so additional indirection level not required. Allocated the receive
buffers for the RSS QPs.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agomlx4_en: Using real number of rings as RSS map size
Yevgeny Petrilin [Fri, 7 Aug 2009 02:27:51 +0000 (19:27 -0700)]
mlx4_en: Using real number of rings as RSS map size

There is no point in using more QPs then actual number of receive rings.
If the RSS function for two streams gives the same result modulo number
of rings, they will arrive to the same RX ring anyway.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agomlx4_en: Adaptive moderation policy change
Yevgeny Petrilin [Fri, 7 Aug 2009 02:27:28 +0000 (19:27 -0700)]
mlx4_en: Adaptive moderation policy change

If the net device is identified as "sender" (number of sent packets
is higher then the number of received packets and the incoming packets are
small), set the moderation time to its low limit.
We do it because the incoming packets are acks, and we don't want to delay them

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: smsc911x: switch to new dev_pm_ops
Daniel Mack [Wed, 5 Aug 2009 08:29:31 +0000 (08:29 +0000)]
net: smsc911x: switch to new dev_pm_ops

Hibernation is unsupported for now, which meets the actual
implementation in the driver. For free/thaw, the chip's D2 state should
be entered.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Acked-by: <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotc35815: Use 0 RxFragSize.MinFrag value for non-packing mode
Atsushi Nemoto [Thu, 6 Aug 2009 04:41:49 +0000 (04:41 +0000)]
tc35815: Use 0 RxFragSize.MinFrag value for non-packing mode

The datasheet say "When not enabling packing, the MinFrag value must
remain at 0".  Do not set value to RxFragSize register if
TC35815_USE_PACKEDBUFFER disabled.

This is not a bugfix.  No real problem reported on this.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotc35815: Fix rx_missed_errors count
Atsushi Nemoto [Thu, 6 Aug 2009 04:41:48 +0000 (04:41 +0000)]
tc35815: Fix rx_missed_errors count

The Miss_Cnt register is cleared by reading.  Accumulate its value to
rx_missed_errors count.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotc35815: Increase timeout for mdio
Atsushi Nemoto [Thu, 6 Aug 2009 04:41:47 +0000 (04:41 +0000)]
tc35815: Increase timeout for mdio

The current timeout value is too short for very high-load condition
which jiffies might jump up in busy-loop.
Also add minimum delay before checking completion of MDIO.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotc35815: Improve BLEx / FDAEx handling
Atsushi Nemoto [Thu, 6 Aug 2009 04:41:46 +0000 (04:41 +0000)]
tc35815: Improve BLEx / FDAEx handling

Clear Int_BLEx / Int_FDAEx after (not before) processing Rx interrupt.
This will reduce number of unnecessary interrupts.
Also print rx error messages only if netif_msg_rx_err() enabled.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotc35815: Disable StripCRC
Atsushi Nemoto [Thu, 6 Aug 2009 04:41:45 +0000 (04:41 +0000)]
tc35815: Disable StripCRC

It seems Rx_StripCRC cause trouble on recovering from the BLEx (Buffer
List Exhaust) or FDAEx (Free Descriptor Area Exhaust) condition.
Do not use it.

Also bump version number up.

Reported-by: Ralf Roesch <ralf.roesch@rw-gmbh.de>
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Thu, 6 Aug 2009 19:57:18 +0000 (12:57 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-next-2.6

14 years agonet/rds: Use AF_INET for sin_family field
Julia Lawall [Thu, 6 Aug 2009 03:30:13 +0000 (20:30 -0700)]
net/rds: Use AF_INET for sin_family field

Elsewhere the sin_family field holds a value with a name of the form
AF_..., so it seems reasonable to do so here as well.  Also the values of
PF_INET and AF_INET are the same.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
struct sockaddr_in sip;
@@

(
sip.sin_family ==
- PF_INET
+ AF_INET
|
sip.sin_family !=
- PF_INET
+ AF_INET
|
sip.sin_family =
- PF_INET
+ AF_INET
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocxgb3: fix 2 ports 1G regression
Divy Le Ray [Thu, 6 Aug 2009 03:28:27 +0000 (20:28 -0700)]
cxgb3: fix 2 ports 1G regression

commit 88045b3cf0f8981129cb489c7b6bc36c21dd33a7
cxgb3: fix mac index mapping

Override the mac index computation for the gen2 adapter,
as each port is expected to use index 0.

introduces a regression on 2 port 1G adapter
as its xauicfg vpd value is null.
Add a check on the device id.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovxge: Version update
Benjamin LaHaise [Tue, 4 Aug 2009 10:22:19 +0000 (10:22 +0000)]
vxge: Version update

Update the driver version number for any bug reports from end users.

Signed-off-by: Benjamin LaHaise <ben.lahaise@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovxge: prefetch skb->data
Benjamin LaHaise [Tue, 4 Aug 2009 10:21:57 +0000 (10:21 +0000)]
vxge: prefetch skb->data

This patch implements prefetching of skb->data from a copy of the pointer
in the descriptor (which is already in the L1 cache at this point).  This
improves netperf rx performance (netperf -L 0,0 -c -H 192.168.254.2 -- -M
131072 -m 131072) by 4.9% on a P4 Xeon host.

Signed-off-by: Benjamin LaHaise <ben.lahaise@neterion.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovxge: prefetch RxD descriptors
Benjamin LaHaise [Tue, 4 Aug 2009 10:21:39 +0000 (10:21 +0000)]
vxge: prefetch RxD descriptors

This patch prefetches RxD descriptors which helps to lower the latency of a
cache miss in vxge_hw_ring_rxd_next_completed.  This lowers the % of CPU
time used by vxge_hw_ring_rxd_next_completed() where the descriptor is
accessed in profiling netperf on a P4 Xeon from 1.5% to 1.0%.

Signed-off-by: Benjamin LaHaise <ben.lahaise@neterion.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovxge: improve tx performance by using mmiowb() instead of wmb()
Benjamin LaHaise [Tue, 4 Aug 2009 10:21:21 +0000 (10:21 +0000)]
vxge: improve tx performance by using mmiowb() instead of wmb()

wmb() is extremely heavy on x86.  The semantics required in the driver are
provided by mmiowb(), so use that and improve tx performance on P4 Xeons by
5-10%.

Signed-off-by: Benjamin LaHaise <ben.lahaise@neterion.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovxge: fix pktgen hangs (don't abuse skb->cb[])
Benjamin LaHaise [Tue, 4 Aug 2009 10:21:03 +0000 (10:21 +0000)]
vxge: fix pktgen hangs (don't abuse skb->cb[])

This patch fixes a case in the transmit completion code which was resulting
in pktgen hanging at the end of a run.  The cause is due to the fact that
the ->cb[] area of an skb cannot be used in a network driver's transmit
path, as that area belongs to the network protocol.  Pktgen hangs, as it
sends out the same packet multiple times, and vxge's use of this area of
the skb for a temporary list can only add the packet to the temporary list
once (while it may be on the queue many times).  The fix is to remove this
abuse of skb->cb[].  Instead, skb pointers are placed into a temporary
stack array, and then free outside of the tx lock.  This retains the smp
optimization of doing dev_kfree_skb() outside of the tx lock.

Signed-off-by: Benjamin LaHaise <ben.lahaise@neterion.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovxge: don't drop frame on tx queue full
Benjamin LaHaise [Tue, 4 Aug 2009 10:20:44 +0000 (10:20 +0000)]
vxge: don't drop frame on tx queue full

The vxge driver will drop a packet in its transmit function if the number
of TxDs available hits 0.  Instead of doing that, simply stop the transmit
queue when transmitting a packet with the last available TxD.

Signed-off-by: Benjamin LaHaise <ben.lahaise@neterion.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: allow vlan egress priority mapping in DCB mode
Lucy Liu [Wed, 5 Aug 2009 20:06:34 +0000 (13:06 -0700)]
ixgbe: allow vlan egress priority mapping in DCB mode

The skb priority to vlan-qos egress mapping that can be configured using
set_egress_map with vconfig is overriden by the DCB code in the driver.

This patch allows this existing mechanism to work and will increase the
configuration flexibility of DCB mode on Linux.

A hierarchy of configuration is:

1. Modifies the ixgbe_select_queue() routine for DCB mode to return the
priority value from the VLAN tag. It will normally be zero, unless the egress
priority map has modified it. This will get packets into the correct queue and
result in the queue_mapping field being set correctly.

2. Any tc filter which modifies queue_mapping will be honored, as the filters
are handled after the vlan egress map is handled.

Signed-off-by: Lucy Liu <lucy.liu@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: Patch to perform function reset at initialization
sarveshwarb [Wed, 5 Aug 2009 20:05:24 +0000 (13:05 -0700)]
be2net: Patch to perform function reset at initialization

This patch is a bug fix to avoid system going into a bad state when
driver is loaded in context of kdump kernel. The patch fixes the issue
by performing a soft reset of pci function at probe time.

Signed-off-by: sarveshwarb <sarveshwarb@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: implement a SO_DOMAIN getsockoption
Jan Engelhardt [Tue, 4 Aug 2009 07:28:29 +0000 (07:28 +0000)]
net: implement a SO_DOMAIN getsockoption

This sockopt goes in line with SO_TYPE and SO_PROTOCOL. It makes it
possible for userspace programs to pass around file descriptors — I
am referring to arguments-to-functions, but it may even work for the
fd passing over UNIX sockets — without needing to also pass the
auxiliary information (PF_INET6/IPPROTO_TCP).

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: implement a SO_PROTOCOL getsockoption
Jan Engelhardt [Tue, 4 Aug 2009 07:28:28 +0000 (07:28 +0000)]
net: implement a SO_PROTOCOL getsockoption

Similar to SO_TYPE returning the socket type, SO_PROTOCOL allows to
retrieve the protocol used with a given socket.

I am not quite sure why we have that-many copies of socket.h, and why
the values are not the same on all arches either, but for where hex
numbers dominate, I use 0x1029 for SO_PROTOCOL as that seems to be
the next free unused number across a bunch of operating systems, or
so Google results make me want to believe. SO_PROTOCOL for others
just uses the next free Linux number, 38.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: add hardware LRO support
Dhananjay Phadke [Wed, 5 Aug 2009 07:34:09 +0000 (07:34 +0000)]
netxen: add hardware LRO support

Add support to handle aggregate packets from firmware.
Local TCP flows are automatically identified by firmware
based on the dest IP hash added by driver for local IP
addresses.

The packets are sent down on the jumbo rx ring.

Signed-off-by: Narender Kumar <narender.kumar@qlogic.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: remove unnecessary structures
Dhananjay Phadke [Wed, 5 Aug 2009 07:34:08 +0000 (07:34 +0000)]
netxen: remove unnecessary structures

Remove unnecessary offsetof calulations on these structures:
netxen_board_info, netxen_user_old_info, netxen_new_user_info.

The offsets into the flash are fixed, don't need to be calculated.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: fix vlan tso case
Dhananjay Phadke [Wed, 5 Aug 2009 07:34:07 +0000 (07:34 +0000)]
netxen: fix vlan tso case

Fix the calculation of remaining header length in TSO
over vlan device case. This was inadvertently missed
out in patch 028afe719855a157e32450c ("netxen: add vlan
tx acceleration support").

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocpmac: unmark as broken
Florian Fainelli [Tue, 4 Aug 2009 11:17:49 +0000 (11:17 +0000)]
cpmac: unmark as broken

Starting with version 0.5.1, cpmac is no longer broken.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocpmac: bump version to 0.5.1
Florian Fainelli [Tue, 4 Aug 2009 10:53:00 +0000 (10:53 +0000)]
cpmac: bump version to 0.5.1

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocpmac: wait longer after MDIO reset
Florian Fainelli [Tue, 4 Aug 2009 10:52:57 +0000 (10:52 +0000)]
cpmac: wait longer after MDIO reset

This patch slows down the MDIO_ALIVE busy waiting to let
switches and PHY come up after reset. Previous loop was
too quick for IC+175C and ADM6996C/L switches to come up.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocpmac: add support for fixed PHY
Florian Fainelli [Tue, 4 Aug 2009 10:52:52 +0000 (10:52 +0000)]
cpmac: add support for fixed PHY

This patch adds support for fixed PHY connected in MII mode
to cpmac. We allow external and dumb_switch module parameters
to override the PHY detection process since they are always connected
with MDIO bus identifier 0. This lets fixed PHYs to be detected
correctly and be connected to the their corresponding MDIO
bus identifier.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoar7: add fixed PHY support for the two on-board cpmac
Florian Fainelli [Tue, 4 Aug 2009 10:52:47 +0000 (10:52 +0000)]
ar7: add fixed PHY support for the two on-board cpmac

This patch adds fixed PHY support for the two on-chip
cpmac Ethernet adapters.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocpmac: fix wrong MDIO bus identifier
Florian Fainelli [Tue, 4 Aug 2009 10:52:41 +0000 (10:52 +0000)]
cpmac: fix wrong MDIO bus identifier

This patch fixes the wrong MDIO bus identifier which was
set to 0 unconditionaly, suitable for external switches while
it is actually 1 for PHYs different than external switches
which are autodetected.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: mark read-only arrays as const
Jan Engelhardt [Wed, 5 Aug 2009 17:42:58 +0000 (10:42 -0700)]
net: mark read-only arrays as const

String literals are constant, and usually, we can also tag the array
of pointers const too, moving it to the .rodata section.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoxfrm6: Fix xfrm6_policy.c build when SYSCTL disabled.
David S. Miller [Wed, 5 Aug 2009 03:32:16 +0000 (20:32 -0700)]
xfrm6: Fix xfrm6_policy.c build when SYSCTL disabled.

Same as how Randy Dunlap fixed the ipv4 side of things.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoxfrm4: fix build when SYSCTLs are disabled
Randy Dunlap [Wed, 5 Aug 2009 03:18:33 +0000 (20:18 -0700)]
xfrm4: fix build when SYSCTLs are disabled

Fix build errors when SYSCTLs are not enabled:
(.init.text+0x5154): undefined reference to `net_ipv4_ctl_path'
(.init.text+0x5176): undefined reference to `register_net_sysctl_table'
xfrm4_policy.c:(.exit.text+0x573): undefined reference to `unregister_net_sysctl_table

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoath9k: fix compile warning on ath9k_hw_AR9287_check_eeprom()
Luis R. Rodriguez [Mon, 3 Aug 2009 20:51:49 +0000 (13:51 -0700)]
ath9k: fix compile warning on ath9k_hw_AR9287_check_eeprom()

CC [M]  drivers/net/wireless/ath/ath9k/eeprom.o
drivers/net/wireless/ath/ath9k/eeprom.c: In function ‘ath9k_hw_AR9287_check_eeprom’:
drivers/net/wireless/ath/ath9k/eeprom.c:2866: warning: comparison of distinct pointer types lacks a cast

Cc: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: FIF_PSPOLL filter flag
Igor Perminov [Tue, 4 Aug 2009 12:48:51 +0000 (16:48 +0400)]
mac80211: FIF_PSPOLL filter flag

When an interface is configured in the AP mode, the mac80211
implementation doesn't inform the driver to receive PS Poll frames.
It leads to inability to communicate with power-saving stations
reliably.
The FIF_CONTROL flag isn't passed by mac80211 to
ieee80211_ops.configure_filter when an interface is in the AP mode.
And it's ok, because we don't want to receive ACK frames and other
control ones, but only PS Poll ones.

This patch introduces the FIF_PSPOLL filter flag in addition to
FIF_CONTROL, which means for the driver "pass PS Poll frames".

This flag is passed to the driver:
A) When an interface is configured in the AP mode.
B) In all cases, when the FIF_CONTROL flag was passed earlier (in
addition to it).

Signed-off-by: Igor Perminov <igor.perminov@inbox.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: cancel xmit poll work at stop() callback
Luis R. Rodriguez [Sat, 25 Jul 2009 00:47:33 +0000 (20:47 -0400)]
ath9k: cancel xmit poll work at stop() callback

We forgot to cancel this work at the stop() callback.

------------[ cut here ]------------
WARNING: at net/mac80211/util.c:511 ieee80211_queue_delayed_work+0x3a/0x40 [mac80211]()
Hardware name: 6460DWU
queueing ieee80211 work while going to suspend
Modules linked in: <-- snip -->
Pid: 5124, comm: phy0 Tainted: G        W  2.6.31-rc3-wl #4
Call Trace:
 [<ffffffffa03adcda>] ? ieee80211_queue_delayed_work+0x3a/0x40 [mac80211]
 [<ffffffff810552b8>] warn_slowpath_common+0x78/0xd0
 [<ffffffff81055394>] warn_slowpath_fmt+0x64/0x70
 [<ffffffff814ed2c9>] ? thread_return+0x3e/0x635
 [<ffffffffa03adcda>] ieee80211_queue_delayed_work+0x3a/0x40 [mac80211]
 [<ffffffffa0297690>] ath_tx_complete_poll_work+0xc0/0x100 [ath9k]
 [<ffffffffa02975d0>] ? ath_tx_complete_poll_work+0x0/0x100 [ath9k]
 [<ffffffff81069b68>] worker_thread+0x178/0x260
 [<ffffffff8106ecc0>] ? autoremove_wake_function+0x0/0x40
 [<ffffffff810699f0>] ? worker_thread+0x0/0x260
 [<ffffffff8106e89e>] kthread+0x9e/0xb0
 [<ffffffff8101302a>] child_rip+0xa/0x20
 [<ffffffff8106e800>] ? kthread+0x0/0xb0
 [<ffffffff81013020>] ? child_rip+0x0/0x20

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: add initial hardware support for ar9271
Luis R. Rodriguez [Tue, 4 Aug 2009 03:14:12 +0000 (23:14 -0400)]
ath9k: add initial hardware support for ar9271

We will finalize this after some driver core changes, for now
we leave this unsupported.

Cc: Stephen Chen <stephen.chen@atheros.com>
Cc: Zhifeng Cai <zhifeng.cai@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: add initvals and registry definitions for AR9271
Luis R. Rodriguez [Tue, 4 Aug 2009 03:14:11 +0000 (23:14 -0400)]
ath9k: add initvals and registry definitions for AR9271

Cc: Stephen Chen <stephen.chen@atheros.com>
Cc: Zhifeng Cai <zhifeng.cai@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: add ar9271 revision and subrevision ID helpers
Luis R. Rodriguez [Tue, 4 Aug 2009 03:14:10 +0000 (23:14 -0400)]
ath9k: add ar9271 revision and subrevision ID helpers

These will be used later to add support for ar9271.

Cc: Stephen Chen <stephen.chen@atheros.com>
Cc: Zhifeng Cai <zhifeng.cai@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Remove _t postfix for ar9287_eeprom structure
Luis R. Rodriguez [Mon, 3 Aug 2009 21:31:25 +0000 (17:31 -0400)]
ath9k: Remove _t postfix for ar9287_eeprom structure

We don't use typdefs on ath9k, remove that _t.

Cc: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove spurious check for channel on keycache reset
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:56 +0000 (12:24 -0700)]
ath9k: remove spurious check for channel on keycache reset

ath9k_hw_keyreset() has a spurious check for ah->curchan..
remove it.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove dangling error check on keycache reset on hw init
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:55 +0000 (12:24 -0700)]
ath9k: remove dangling error check on keycache reset on hw init

The keycache reset will not fail as right above we ensure
to set the sc->keymax to be <= ah->caps.keycache_size. Just remove
this dangling check.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: call ath9k_hw_detach() once upon hw init failure
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:54 +0000 (12:24 -0700)]
ath9k: call ath9k_hw_detach() once upon hw init failure

If hw initialization fails (ath9k_hw_init()) on ath_init_softc()
we bail out and call ath9k_hw_detach(). The call ath9k_hw_detach()
is conditional though as ath9k_hw_init() could itself have called
ath9k_hw_detach(). Just describing this is itself a brain twister.
Avoid this nonsense by removing ath9k_hw_detach() from ath9k_hw_init().

Upon hw initialization failure we expect the callers to take care of
the cleanup.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: set sc->sc_ah to NULL after freeing it
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:53 +0000 (12:24 -0700)]
ath9k: set sc->sc_ah to NULL after freeing it

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: set ah to null after freeing
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:52 +0000 (12:24 -0700)]
ath9k: set ah to null after freeing

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: rename ath9k_hw_ani_detach() to ath9k_hw_ani_disable()
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:51 +0000 (12:24 -0700)]
ath9k: rename ath9k_hw_ani_detach() to ath9k_hw_ani_disable()

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: rename ath9k_hw_rfdetach() to ath9k_hw_rf_free()
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:50 +0000 (12:24 -0700)]
ath9k: rename ath9k_hw_rfdetach() to ath9k_hw_rf_free()

This makes it clear what this does.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: use helper macro to kfree and nullify on ath9k_hw_rfdetach()
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:49 +0000 (12:24 -0700)]
ath9k: use helper macro to kfree and nullify on ath9k_hw_rfdetach()

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove !NULL check before kfree()
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:48 +0000 (12:24 -0700)]
ath9k: remove !NULL check before kfree()

kfree(NULL) works so remove all those branches which check
for it before kfree()'ing on ath9k_hw_rfdetach().

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: distinguish between device initialization and ath_softc init
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:47 +0000 (12:24 -0700)]
ath9k: distinguish between device initialization and ath_softc init

We re-label the device driver initialization routines from the
ath_softc, the "Software Carrier" fillers. This should make it
clearer what each of these do.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: describe hw initialization better
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:46 +0000 (12:24 -0700)]
ath9k: describe hw initialization better

During initialization ath9k tends to use "attach" to when we
initialize hardware due to the fact we used to attach a "HAL".
The notion of a HAL is long gone, so lets just be clear on what
we are doing.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: break up hw initialization into a few more helpers
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:45 +0000 (12:24 -0700)]
ath9k: break up hw initialization into a few more helpers

This makes reading the hardware initialization process
easier to understand. The new helpers added are:

ath9k_hw_init_cal_settings()
ath9k_hw_init_mode_regs()
ath9k_hw_init_mode_gain_regs()
ath9k_hw_init_11a_eeprom_fix()

This patch has no functional changes.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove debug message for no memoery on ath_init()
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:44 +0000 (12:24 -0700)]
ath9k: remove debug message for no memoery on ath_init()

We're now propagating the -ENOMEM error so there is no need to
keep a debug message there now.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: rename ath9k_hw_set_defaults() to ath9k_hw_init_config()
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:43 +0000 (12:24 -0700)]
ath9k: rename ath9k_hw_set_defaults() to ath9k_hw_init_config()

This reflects better what we are actually doing there.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: rename ath9k_hw_newstate() to ath9k_hw_init_defaults()
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:42 +0000 (12:24 -0700)]
ath9k: rename ath9k_hw_newstate() to ath9k_hw_init_defaults()

This reflects better what we are actually doing there.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: move hw macrevision checker to helper
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:41 +0000 (12:24 -0700)]
ath9k: move hw macrevision checker to helper

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: pass only one argument to hw attach
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:40 +0000 (12:24 -0700)]
ath9k: pass only one argument to hw attach

The softc is cached and set within the ath_hw struct.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: call hw initializer directly
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:39 +0000 (12:24 -0700)]
ath9k: call hw initializer directly

ath9k_hw_attach() was going first through some device id verifier,
and then calling some other helper which was doing the real hardware
initialization. Lets just do the devid checks within the real worker
by calling a helper ath9k_hw_devid_supported().

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: move cache setting of softc ah prior to attach
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:38 +0000 (12:24 -0700)]
ath9k: move cache setting of softc ah prior to attach

We do this in case attach and friends try to get back to
ah from the softc somehow.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: move devid cache setting to ath_init()
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:37 +0000 (12:24 -0700)]
ath9k: move devid cache setting to ath_init()

This lets us trim one argument off of hw initializer routines.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: move memory allocation of ath_hw to ath_init()
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:36 +0000 (12:24 -0700)]
ath9k: move memory allocation of ath_hw to ath_init()

This lets us simplify attach code and arguments passed.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: propagate hw initialization errors
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:35 +0000 (12:24 -0700)]
ath9k: propagate hw initialization errors

We were never propagating hw initialization errors, lets
do that now and also use -EOPNOTSUPP when device revision is
not supported yet.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: use a switch for revising supported hw mac revisions
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:34 +0000 (12:24 -0700)]
ath9k: use a switch for revising supported hw mac revisions

This makes adding new hw revisions a one line change here.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove usage of AR_SREV_*() wrapper to detect supported hw
Luis R. Rodriguez [Mon, 3 Aug 2009 19:24:33 +0000 (12:24 -0700)]
ath9k: remove usage of AR_SREV_*() wrapper to detect supported hw

We will clean this up next to just use a switch.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agocfg80211: clear SSID on disconnect/no connection
Johannes Berg [Tue, 4 Aug 2009 07:32:23 +0000 (09:32 +0200)]
cfg80211: clear SSID on disconnect/no connection

The SME state machine in cfg80211 uses the SSID stored
in struct wireless_dev internally, but fails to clear
it in multiple places (when giving up on a connection
attempt and when disconnecting). This doesn't matter to
the SME state machine, but does matter for IBSS. Thus,
in those cases, clear the SSID to avoid messing up the
IBSS state machine.

Reported-by: Joerg Albert <jal2@gmx.de>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwmc3200wifi: avoid setting default key for 802.1X and RSNA
Zhu Yi [Mon, 3 Aug 2009 06:37:03 +0000 (14:37 +0800)]
iwmc3200wifi: avoid setting default key for 802.1X and RSNA

UMAC only allows us to set default key for WEP and auth type is
not 802.1X or RSNA. This patch fixes iwmc3200wifi for 802.1X with
WEP104.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwmc3200wifi: set WEP key static flag correctly
Zhu Yi [Mon, 3 Aug 2009 06:37:02 +0000 (14:37 +0800)]
iwmc3200wifi: set WEP key static flag correctly

We should only set the static_key flag for open and legacy
authentication types. It should not be set for 802.1X and TKIP.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwmc3200wifi: fix set_wpa_version and set_auth_type order
Zhu Yi [Mon, 3 Aug 2009 06:37:01 +0000 (14:37 +0800)]
iwmc3200wifi: fix set_wpa_version and set_auth_type order

iwm->umac_profile->sec.flags is set by iwm_set_wpa_version and
checked by iwm_set_auth_type. The patch changes the order to
make the flag used correctly.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43: implement baseband init for LP-PHY <= rev1
Gábor Stefanik [Sun, 2 Aug 2009 23:28:12 +0000 (01:28 +0200)]
b43: implement baseband init for LP-PHY <= rev1

Implement baseband init for rev.0 and rev.1 LP PHYs. Convert boardflags_hi values to defines.
Implement b43_phy_copy for easier copying between registers, as needed by LP-PHY init.

Signed-off-by: Gábor Stefanik<netrolller.3d@gmail.com>
Cc: Michael Buesch<mb@bu3sch.de>
Cc: Larry Finger<larry.finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: cancel all work on disconnect
Pavel Roskin [Sun, 2 Aug 2009 18:30:15 +0000 (14:30 -0400)]
rt2x00: cancel all work on disconnect

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort61pci: fix module reloading
Pavel Roskin [Sun, 2 Aug 2009 18:30:02 +0000 (14:30 -0400)]
rt61pci: fix module reloading

Unloading rt61pci can leave the device in such state that reloading
rt61pci would fail to reinitialize it.  Bogus data would be read from
the EEPROM and the RF version won't be recognized.

It appears that unloading rt61pci with power saving enabled would have
such effect.  To initialize the device properly, SOFT_RESET_CSR should
be set to the same value as rt61pci_config_ps() uses to wake up the
device.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agob43legacy: Work around mac80211 race condition
Larry Finger [Sun, 2 Aug 2009 03:32:48 +0000 (22:32 -0500)]
b43legacy: Work around mac80211 race condition

As shown in http://thread.gmane.org/gmane.linux.kernel.wireless.general/36497,
mac80211 has a bug that allows a call to the TX routine after the queues have
been stopped. This situation will only occur under extreme stress. Although
b43legacy does not crash when this condition occurs, it does generate a WARN_ON
and also logs a queue overrun message. This patch recognizes b43legacy is not
at fault and logs a message only when the most verbose debugging mode is
enabled. In the unlikely event that the queue is not stopped when the DMA
queue becomes full, then a warning is issued.

This patch is based on the one used by b43.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>