]> git.kernelconcepts.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agob43: HT-PHY: tables: don't duplicate core-generic regs
Rafał Miłecki [Sat, 16 Mar 2013 22:40:01 +0000 (23:40 +0100)]
b43: HT-PHY: tables: don't duplicate core-generic regs

Now when we know many radio regs at 0x000 are core-generic, I've noticed
we duplicate some values in the tables.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: rename defines addressing cores on the 2059 radio
Rafał Miłecki [Sat, 16 Mar 2013 22:24:21 +0000 (23:24 +0100)]
b43: HT-PHY: rename defines addressing cores on the 2059 radio

After comparing writes to registers at 0x000, 0x400 and 0x800 it seems
there are many very similar writes. So 0x000 offset is not for accessing
something totally different, but probably just the first out of three
cores.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agoipvs: Use network byte order for sync message size
Simon Horman [Fri, 19 Apr 2013 01:43:44 +0000 (10:43 +0900)]
ipvs: Use network byte order for sync message size

struct ip_vs_sync_mesg and ip_vs_sync_mesg_v0 are both sent across the wire
and used internally to store IPVS synchronisation messages.

Up until now the scheme used has been to convert the size field
to network byte order before sending a message on the wire and
convert it to host byte order when sending a message.

This patch changes that scheme to always treat the field
as being network byte order. This seems appropriate as
the structure is sent across the wire. And by consistently
treating the field has network byte order it is now possible
to take advantage of sparse to flag any future miss-use.

Acked-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agoipvs: off by one in set_sctp_state()
Dan Carpenter [Sat, 20 Apr 2013 11:24:55 +0000 (14:24 +0300)]
ipvs: off by one in set_sctp_state()

The sctp_events[] come from sch->type in set_sctp_state().  They are
between 0-255 so that means we need 256 elements in the array.

I believe that because of how the code is aligned there is normally a
hole after sctp_events[] so this patch doesn't actually change anything.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agoipvs: Use min3() in ip_vs_dbg_callid()
Simon Horman [Fri, 19 Apr 2013 01:33:59 +0000 (10:33 +0900)]
ipvs: Use min3() in ip_vs_dbg_callid()

There are two motivations for this:

1. It improves readability to my eyes
2. Using nested min() calls results in a shadowed _min1 variable,
   which is a bit untidy. Sparse complained about this.

I have also replaced (size_t)64 with a variable of type size_t and value 64.
This also improves readability to my eyes.

Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agoipvs: Avoid shadowing net variable in ip_vs_leave()
Simon Horman [Fri, 19 Apr 2013 01:25:42 +0000 (10:25 +0900)]
ipvs: Avoid shadowing net variable in ip_vs_leave()

Flagged by sparse.
Compile and sparse tested only.

Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agoipvs: fix sparse warnings for some parameters
Julian Anastasov [Wed, 17 Apr 2013 20:50:49 +0000 (23:50 +0300)]
ipvs: fix sparse warnings for some parameters

Some service fields are in network order:

- netmask: used once in network order and also as prefix len for IPv6
- port

Other parameters are in host order:

- struct ip_vs_flags: flags and mask moved between user and kernel only
- sync state: moved between user and kernel only
- syncid: sent over network as single octet

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agoipvs: fix sparse warnings in lblc and lblcr
Julian Anastasov [Wed, 17 Apr 2013 20:50:47 +0000 (23:50 +0300)]
ipvs: fix sparse warnings in lblc and lblcr

kbuild test robot reports for sparse warnings in
commits c2a4ffb70eef39 ("ipvs: convert lblc scheduler to rcu")
and c5549571f975ab ("ipvs: convert lblcr scheduler to rcu").

Fix it by removing extra __rcu annotation.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agoipvs: fix the remaining sparse warnings in ip_vs_ctl.c
Julian Anastasov [Wed, 17 Apr 2013 20:50:50 +0000 (23:50 +0300)]
ipvs: fix the remaining sparse warnings in ip_vs_ctl.c

- RCU annotations for ip_vs_info_seq_start and _stop
- __percpu for cpustats
- properly dereference svc->pe in ip_vs_genl_fill_service

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agoipvs: fix sparse warnings for ip_vs_conn listing
Julian Anastasov [Wed, 17 Apr 2013 20:50:46 +0000 (23:50 +0300)]
ipvs: fix sparse warnings for ip_vs_conn listing

kbuild test robot reports for sparse warnings
in commit 088339a57d6042 ("ipvs: convert connection locking"):

net/netfilter/ipvs/ip_vs_conn.c:962:13: warning: context imbalance
in 'ip_vs_conn_array' - wrong count at exit
include/linux/rcupdate.h:326:30: warning: context imbalance in
'ip_vs_conn_seq_next' - unexpected unlock
include/linux/rcupdate.h:326:30: warning: context imbalance in
'ip_vs_conn_seq_stop' - unexpected unlock

Fix it by running ip_vs_conn_array under RCU lock
to avoid conditional locking and by adding proper RCU
annotations.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agoipvs: properly dereference dest_dst in ip_vs_forget_dev
Julian Anastasov [Wed, 17 Apr 2013 20:50:45 +0000 (23:50 +0300)]
ipvs: properly dereference dest_dst in ip_vs_forget_dev

Use rcu_dereference_protected to resolve
sparse warning, found by kbuild test robot:

net/netfilter/ipvs/ip_vs_ctl.c:1464:35: warning: dereference of
noderef expression

Problem from commit 026ace060dfe29
("ipvs: optimize dst usage for real server")

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
11 years agobatman-adv: fix global protection fault during soft_iface destruction
Antonio Quartulli [Fri, 19 Apr 2013 09:04:52 +0000 (11:04 +0200)]
batman-adv: fix global protection fault during soft_iface destruction

batadv_mesh_free() schedules some RCU callbacks which need the bat_priv struct
to do their jobs, while free_netdev(), which is called immediately after, is
destroying the private data.

Put an rcu_barrier() in the middle so that free_netdev() is invoked only after
all the callbacks returned.

This bug has been introduced by ab8f433dd39be94e8617cff2dfe9f7eca162eb15
("batman-adv: Move deinitialization of soft-interface to destructor")

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
David S. Miller [Tue, 23 Apr 2013 00:32:51 +0000 (20:32 -0400)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Conflicts:
drivers/net/ethernet/emulex/benet/be_main.c
drivers/net/ethernet/intel/igb/igb_main.c
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
include/net/scm.h
net/batman-adv/routing.c
net/ipv4/tcp_input.c

The e{uid,gid} --> {uid,gid} credentials fix conflicted with the
cleanup in net-next to now pass cred structs around.

The be2net driver had a bug fix in 'net' that overlapped with the VLAN
interface changes by Patrick McHardy in net-next.

An IGB conflict existed because in 'net' the build_skb() support was
reverted, and in 'net-next' there was a comment style fix within that
code.

Several batman-adv conflicts were resolved by making sure that all
calls to batadv_is_my_mac() are changed to have a new bat_priv first
argument.

Eric Dumazet's TS ECR fix in TCP in 'net' conflicted with the F-RTO
rewrite in 'net-next', mostly overlapping changes.

Thanks to Stephen Rothwell and Antonio Quartulli for help with several
of these merge resolutions.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: Fix vlan bitmask changes in EHEA driver.
David S. Miller [Mon, 22 Apr 2013 23:34:34 +0000 (19:34 -0400)]
net: Fix vlan bitmask changes in EHEA driver.

This driver uses the crummy "| foo" style, putting the
logical operation at the beginning of lines.  Then
when the VLAN tag flag bits got changed the operator
ended up at both the end and the beginning of some lines.

Fix the build error by having it uniformly use the operator
at the end of the line.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: Fix some __vlan_hwaccel_put_tag() callers.
David S. Miller [Mon, 22 Apr 2013 23:24:19 +0000 (19:24 -0400)]
net: Fix some __vlan_hwaccel_put_tag() callers.

Several call sites were missed when the protocol argument was added to
__vlan_hwaccel_put_tag() in commit
86a9bad3ab6b6f858fd4443b48738cabbb6d094c ("net: vlan: add protocol
argument to packet tagging functions").

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: sctp: minor: remove dead code from sctp_packet
Daniel Borkmann [Thu, 18 Apr 2013 21:59:37 +0000 (21:59 +0000)]
net: sctp: minor: remove dead code from sctp_packet

struct sctp_packet is currently embedded into sctp_transport or
sits on the stack as 'singleton' in sctp_outq_flush(). Therefore,
its member 'malloced' is always 0, thus a kfree() is never called.
Because of that, we can just remove this code.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoVXLAN: Allow L2 redirection with L3 switching
David Stevens [Fri, 19 Apr 2013 00:36:26 +0000 (00:36 +0000)]
VXLAN: Allow L2 redirection with L3 switching

Allow L2 redirection when VXLAN L3 switching is enabled

This patch restricts L3 switching to destination MAC addresses that are
marked as routers in order to allow virtual IP appliances that do L2
redirection to function with VXLAN L3 switching enabled.

We use L3 switching on VXLAN networks to avoid extra hops when the nominal
router for cross-subnet traffic for a VM is remote and the ultimate
destination may be local, or closer to the local node. Currently, the
destination IP address takes precedence over the MAC address in all cases.
Some network appliances receive packets for a virtualized IP address and
redirect by changing the destination MAC address (only) to be the final
destination for packet processing. VXLAN tunnel endpoints with L3 switching
enabled may then overwrite this destination MAC address based on the packet IP
address, resulting in potential loops and, at least, breaking L2 redirections
that travel through tunnel endpoints.

This patch limits L3 switching to the intended case where the original
destination MAC address is a next-hop router and relies on the destination
MAC address for all other cases, thus allowing L2 redirection and L3 switching
to coexist peacefully.

Signed-Off-By: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: Remove return value from list_netdevice()
dingtianhong [Wed, 17 Apr 2013 22:17:50 +0000 (22:17 +0000)]
net: Remove return value from list_netdevice()

The return value from list_netdevice() is not used and no need, so remove it.

Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: remove a stale comment for dl_next
Eric Dumazet [Fri, 19 Apr 2013 21:29:25 +0000 (14:29 -0700)]
net: remove a stale comment for dl_next

dl_next member in struct request_sock doesn't need to be first.

We expect to insert a "struct common_sock" or a subset of it,
so this claim had to be verified.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqeth: Fix missing pointer update
Stefan Raspl [Mon, 22 Apr 2013 01:12:29 +0000 (01:12 +0000)]
qeth: Fix missing pointer update

qeth_hdr_chk_and_bounce() can possibly shift the skb->data
pointer. However, the existing code didn't update the hdr pointer,
which should point to skb->data, accordingly.
Symptoms of this issue are sporadic recoveries.

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqeth: remove unused variable
Stefan Raspl [Mon, 22 Apr 2013 01:12:28 +0000 (01:12 +0000)]
qeth: remove unused variable

remove unused variable

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqeth: remove cast for kzalloc return value
Zhang Yanfei [Mon, 22 Apr 2013 01:12:27 +0000 (01:12 +0000)]
qeth: remove cast for kzalloc return value

remove cast for kzalloc return value.

Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agomwifiex: remove redundant initialization for bss_descriptor
Bing Zhao [Fri, 12 Apr 2013 17:34:18 +0000 (10:34 -0700)]
mwifiex: remove redundant initialization for bss_descriptor

Initialization of bss_descriptor is unnecessary as the entire
structure will be overwritten by a memcpy followed by.

Initialize disable_11ac flag properly by setting it to true in
mwifiex_fill_new_bss_desc().

Reported-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: fix use-after-free in beacon_ie processing
Bing Zhao [Fri, 12 Apr 2013 17:34:17 +0000 (10:34 -0700)]
mwifiex: fix use-after-free in beacon_ie processing

beacon_ie buffer is allocated in mwifiex_fill_new_bss_desc()
and the buffer pointer is saved in bss_desc->beacon_buf.
beacon_ie is freed before the function returns. However,
bss_desc->beacon_buf is still being accessed afterwards.

Fix it by freeing beacon_ie (bss_desc->beacon_buf) in
caller's scope.

Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoxen-netback: don't disconnect frontend when seeing oversize packet
Wei Liu [Mon, 22 Apr 2013 02:20:43 +0000 (02:20 +0000)]
xen-netback: don't disconnect frontend when seeing oversize packet

Some frontend drivers are sending packets > 64 KiB in length. This length
overflows the length field in the first slot making the following slots have
an invalid length.

Turn this error back into a non-fatal error by dropping the packet. To avoid
having the following slots having fatal errors, consume all slots in the
packet.

This does not reopen the security hole in XSA-39 as if the packet as an
invalid number of slots it will still hit fatal error case.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoxen-netback: coalesce slots in TX path and fix regressions
Wei Liu [Mon, 22 Apr 2013 02:20:42 +0000 (02:20 +0000)]
xen-netback: coalesce slots in TX path and fix regressions

This patch tries to coalesce tx requests when constructing grant copy
structures. It enables netback to deal with situation when frontend's
MAX_SKB_FRAGS is larger than backend's MAX_SKB_FRAGS.

With the help of coalescing, this patch tries to address two regressions
avoid reopening the security hole in XSA-39.

Regression 1. The reduction of the number of supported ring entries (slots)
per packet (from 18 to 17). This regression has been around for some time but
remains unnoticed until XSA-39 security fix. This is fixed by coalescing
slots.

Regression 2. The XSA-39 security fix turning "too many frags" errors from
just dropping the packet to a fatal error and disabling the VIF. This is fixed
by coalescing slots (handling 18 slots when backend's MAX_SKB_FRAGS is 17)
which rules out false positive (using 18 slots is legit) and dropping packets
using 19 to `max_skb_slots` slots.

To avoid reopening security hole in XSA-39, frontend sending packet using more
than max_skb_slots is considered malicious.

The behavior of netback for packet is thus:

    1-18            slots: valid
   19-max_skb_slots slots: drop and respond with an error
   max_skb_slots+   slots: fatal error

max_skb_slots is configurable by admin, default value is 20.

Also change variable name from "frags" to "slots" in netbk_count_requests.

Please note that RX path still has dependency on MAX_SKB_FRAGS. This will be
fixed with separate patch.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoxen-netfront: reduce gso_max_size to account for max TCP header
Wei Liu [Mon, 22 Apr 2013 02:20:41 +0000 (02:20 +0000)]
xen-netfront: reduce gso_max_size to account for max TCP header

The maximum packet including header that can be handled by netfront / netback
wire format is 65535. Reduce gso_max_size accordingly.

Drop skb and print warning when skb->len > 65535. This can 1) save the effort
to send malformed packet to netback, 2) help spotting misconfiguration of
netfront in the future.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoxen-netfront: frags -> slots in log message
Wei Liu [Mon, 22 Apr 2013 02:20:40 +0000 (02:20 +0000)]
xen-netfront: frags -> slots in log message

Also fix a typo in comment.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: enable IOMMU pass through for be2net
Craig Hada [Sun, 21 Apr 2013 23:28:18 +0000 (23:28 +0000)]
be2net: enable IOMMU pass through for be2net

This patch sets the coherent DMA mask to 64-bit after the be2net driver has
been acknowledged that the system is 64-bit DMA capable. The coherent DMA
mask is examined by the Intel IOMMU driver to determine whether to allow
pass through context mapping for all devices. With this patch, the be2net
driver combined with be2net compatible hardware provides comparable
performance to the case where vt-d is disabled. The main use-case for this
change is to decrease the time necessary to copy virtual machine memory
during KVM live migration instantiations.

This patch was tested on a system that enables the IOMMU in non-coherent
mode. Two DMA remapper issues were encountered in the previous version and
both patches have been committed.
    commit ea2447f700cab264019b52e2b417d689e052dcfd
    commit 2e12bc29fc5a12242d68e11875db3dd58efad9ff

Signed-off-by: Craig Hada <craig.hada@hp.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: Use GET_PROFILE_CONFIG V1 cmd for BE3-R
Vasundhara Volam [Sun, 21 Apr 2013 23:28:17 +0000 (23:28 +0000)]
be2net: Use GET_PROFILE_CONFIG V1 cmd for BE3-R

Use GET_PROFILE_CONFIG_V1 cmd for BE3-R, to query the maximum number of
TX rings available per function. On SH-R the same is queried via the
GET_FUNCTION_CONFIG cmd.

Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: Avoid flashing BE3 UFI on BE3-R chip.
Vasundhara Volam [Sun, 21 Apr 2013 23:28:16 +0000 (23:28 +0000)]
be2net: Avoid flashing BE3 UFI on BE3-R chip.

Avoid flashing BE3 UFI on BE3-R chip by verifying asic_revision
number of the chip.

Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: Don't log "Out of MCCQ wrbs" error
Vasundhara Volam [Sun, 21 Apr 2013 23:28:15 +0000 (23:28 +0000)]
be2net: Don't log "Out of MCCQ wrbs" error

Don't log "Out of MCCQ wrbs" msg. When the driver doesn't receive any
response from the FW it already logs a "FW not responding" message.
The driver runs out of MCCQ wrbs much later. Also, this message can
swamp the kernel log in HW/FW error scenarios.

Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: Use TXQ_CREATE_V2 cmd
Vasundhara Volam [Sun, 21 Apr 2013 23:28:14 +0000 (23:28 +0000)]
be2net: Use TXQ_CREATE_V2 cmd

Skyhawk-R and BE3-R (SuperNIC profile) require V2 version
of TXQ_CREATE cmd to be used.

Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2x: update version to 1.78.17-0
Dmitry Kravkov [Mon, 22 Apr 2013 03:48:11 +0000 (03:48 +0000)]
bnx2x: update version to 1.78.17-0

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2x: allow nvram test to run when device is down
Dmitry Kravkov [Mon, 22 Apr 2013 03:48:10 +0000 (03:48 +0000)]
bnx2x: allow nvram test to run when device is down

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2x: add additional regions for CRC memory test
Dmitry Kravkov [Mon, 22 Apr 2013 03:48:09 +0000 (03:48 +0000)]
bnx2x: add additional regions for CRC memory test

a. Common tree of `dir` structures.
b. Multi-port devices structures.

CC: Francious Romieu <romieu@fz.zoreil.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2x: remove non-necessary assignment
Dmitry Kravkov [Mon, 22 Apr 2013 03:48:08 +0000 (03:48 +0000)]
bnx2x: remove non-necessary assignment

CC: Francious Romieu <romieu@fz.zoreil.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2x: fix byte-by-byte nvram write for BE machines
Dmitry Kravkov [Mon, 22 Apr 2013 03:48:07 +0000 (03:48 +0000)]
bnx2x: fix byte-by-byte nvram write for BE machines

CC: Francious Romieu <romieu@fz.zoreil.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2x: refactor nvram read procedure
Dmitry Kravkov [Mon, 22 Apr 2013 03:48:06 +0000 (03:48 +0000)]
bnx2x: refactor nvram read procedure

introduce a procedure to read in u32 granularity.

CC: Francious Romieu <romieu@fz.zoreil.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agomwifiex: don't try to associate when bss_mode is not STA
Bing Zhao [Sat, 20 Apr 2013 04:00:44 +0000 (21:00 -0700)]
mwifiex: don't try to associate when bss_mode is not STA

We have blocked association attempts on interfaces configured in
AP and AD-HOC modes. P2P mode should be blocked too.

Furthermore, an error code must be returned if we are unable to
associate.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: make use of msecs_to_jiffies()
Bing Zhao [Sat, 20 Apr 2013 00:44:44 +0000 (17:44 -0700)]
mwifiex: make use of msecs_to_jiffies()

Use msecs_to_jiffies() wherever possible.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: correct bss_mode check while appending vht operation IE
Bing Zhao [Sat, 20 Apr 2013 00:44:43 +0000 (17:44 -0700)]
mwifiex: correct bss_mode check while appending vht operation IE

priv->bss_mode uses NL80211_IFTYPE_* definitions.
HostCmd_BSS_MODE_IBSS is used in ad-hoc start/join command between
driver and firmware.

Coincidentally both HostCmd_BSS_MODE_IBSS and NL80211_IFTYPE_STATION
are defined as 2. That explains why nobody complained.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: use PCI_DMA_FROMDEVICE for RX queue de-init
Avinash Patil [Sat, 20 Apr 2013 00:44:42 +0000 (17:44 -0700)]
mwifiex: use PCI_DMA_FROMDEVICE for RX queue de-init

There is a typo in mwifiex_cleanup_rxq_ring() which uses
PCI_DMA_TODEVICE while unmapping PCI memory.
We should actually use PCI_DMA_FROMDEVICE.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: configure p2p interface during initialization
Bing Zhao [Sat, 20 Apr 2013 00:44:41 +0000 (17:44 -0700)]
mwifiex: configure p2p interface during initialization

Send P2P_MODE_CFG cmd to firmware when p2p interface is created.
Without proper p2p configuration firmware may behave incorrectly
while handling commands sent through this interface.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Stone Piao <piaoyun@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: Start P2P devices in P2P mode
Paul Stewart [Fri, 19 Apr 2013 15:37:46 +0000 (08:37 -0700)]
mwifiex: Start P2P devices in P2P mode

p2p devices should identify themselves as such to userspace at
startup, so the connection manager can decide which interface
to start wpa_supplicant instances on.

Signed-off-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2x00: Use more current logging styles, shrink object size
Joe Perches [Fri, 19 Apr 2013 15:33:40 +0000 (08:33 -0700)]
rt2x00: Use more current logging styles, shrink object size

Reduce object space ~2% using more current logging styles.

Neaten and simplify logging macros.
Use wiphy_<level> where appropriate.
Coalesce formats.

Convert ERROR/WARNING/INFO macros to rt2x00_<level>
Convert EEPROM to rt2x00_eeprom_dbg
Convert PROBE_ERROR to rt2x00_probe_err
Convert DEBUG to rt2x00_dbg
Convert EEPROM to rt2x00_eeprom_dbg

$ size drivers/net/wireless/rt2x00/built-in.o*
   text    data     bss     dec     hex filename
 245639   71696   69584  386919   5e767 drivers/net/wireless/rt2x00/built-in.o.new
 240609   70096   68944  379649   5cb01 drivers/net/wireless/rt2x00/built-in.o.new.nodyndbg
 240609   70096   68944  379649   5cb01 drivers/net/wireless/rt2x00/built-in.o.new.no_rt2x00_debug
 249198   70096   70352  389646   5f20e drivers/net/wireless/rt2x00/built-in.o.old
 249198   70096   70352  389646   5f20e drivers/net/wireless/rt2x00/built-in.o.old.nodyndbg
 244222   70096   69712  384030   5dc1e drivers/net/wireless/rt2x00/built-in.o.old.no_rt2x00_debug

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2x00: rt2800lib: rename rt2800_init_bbb_early to rt2800_init_bbp_early
Gabor Juhos [Fri, 19 Apr 2013 08:13:52 +0000 (10:13 +0200)]
rt2x00: rt2800lib: rename rt2800_init_bbb_early to rt2800_init_bbp_early

The function is used for BBP register initialization,
fix the typo in the function name to reflect that.

The patch contains no functional changes.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: fix potential NULL pointer dereference in brcmf_fws_flow_control_check()
Wei Yongjun [Fri, 19 Apr 2013 02:14:31 +0000 (10:14 +0800)]
brcmfmac: fix potential NULL pointer dereference in brcmf_fws_flow_control_check()

The dereference to 'ifp' in debug code should be moved below the NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: more Rx descriptor accessor functions
Vladimir Kondratiev [Thu, 18 Apr 2013 11:33:53 +0000 (14:33 +0300)]
wil6210: more Rx descriptor accessor functions

Helpers to fetch various fields from the Rx descriptor

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: Use cached copy of Tx descriptor
Vladimir Kondratiev [Thu, 18 Apr 2013 11:33:52 +0000 (14:33 +0300)]
wil6210: Use cached copy of Tx descriptor

Original Tx descriptor stored is in non-cached area for DMA;
copy it to the cached memory to speed-up access

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: Tx init optimization
Vladimir Kondratiev [Thu, 18 Apr 2013 11:33:51 +0000 (14:33 +0300)]
wil6210: Tx init optimization

vring size is known from the beginning, fill it immediately
in the struct initializer
This is minor optimization that reduces code size.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: Use cached copy of Rx descriptor
Vladimir Kondratiev [Thu, 18 Apr 2013 11:33:50 +0000 (14:33 +0300)]
wil6210: Use cached copy of Rx descriptor

Rx descriptors stored in non-cacheable memory area for DMA.
Non-cacheable memory causes long access time from CPU.

Copy rx descriptor to the skb->cb, and use this copy.
It provides faster memory access, and will be usefull to keep
Rx information for later processing (BACK reorder)

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: stop dequeue upon sk_buff commit failure
Arend van Spriel [Wed, 17 Apr 2013 19:25:58 +0000 (21:25 +0200)]
brcmfmac: stop dequeue upon sk_buff commit failure

In the dequeue worker the function brcmf_commit_skb() is called.
However, instead of increment the credit count upon success it
should break the for loop upon failure. Otherwise, it will result
in an endless loop.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: change return type for brcmf_rollback_toq() to void
Arend van Spriel [Wed, 17 Apr 2013 19:25:57 +0000 (21:25 +0200)]
brcmfmac: change return type for brcmf_rollback_toq() to void

The function brcmf_rollback_toq() is already called in error path
and its result should not override the initial error value. As the
function releases the sk_buff there is no need to return anything
so change return type to void.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: finalize transmit upon any rollback failure
Arend van Spriel [Wed, 17 Apr 2013 19:25:56 +0000 (21:25 +0200)]
brcmfmac: finalize transmit upon any rollback failure

All rollback failures should result in freeing of the sk_buff
by calling brcmf_txfinalize().

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: use lock in brcmf_fws_del_interface()
Arend van Spriel [Wed, 17 Apr 2013 19:25:55 +0000 (21:25 +0200)]
brcmfmac: use lock in brcmf_fws_del_interface()

When deleting an interface in firmware-signalling module it will
clear any destination descriptors. To avoid concurrency issues it
should take the lock using brcmf_fws_lock().

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: schedule dequeue upon firmware-signal reception
Arend van Spriel [Wed, 17 Apr 2013 19:25:54 +0000 (21:25 +0200)]
brcmfmac: schedule dequeue upon firmware-signal reception

Several firmware signals should be considered as opportunity to
send packets to the firmware. This patch adds conditional scheduling
of the dequeue worker thread while handling those signals.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: destination mac closed when interface is closed
Arend van Spriel [Wed, 17 Apr 2013 19:25:53 +0000 (21:25 +0200)]
brcmfmac: destination mac closed when interface is closed

Firmware signals a destination is closed as well as an interface. A
destination is associated with an interface. When an interface is
closed consequently the destination should be considered closed as
well.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmutil: simplify brcmu_pkt_free_skb()
Arend van Spriel [Wed, 17 Apr 2013 19:25:52 +0000 (21:25 +0200)]
brcmutil: simplify brcmu_pkt_free_skb()

The function brcmu_pkt_free_skb() use skb->destructor to decide
how the sk_buff should be freed. However, when running AP mode
with iptables configured this results in a kernel warning.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: remove error message upon allocation failure
Arend van Spriel [Wed, 17 Apr 2013 19:25:51 +0000 (21:25 +0200)]
brcmfmac: remove error message upon allocation failure

In function brcmf_add_if() an error message is printed
upon alloc_netdev() failure. The allocation failure itself
spews enough info in the log so remove the error message.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: check memory allocation in brcmf_add_if()
Arend van Spriel [Wed, 17 Apr 2013 19:25:50 +0000 (21:25 +0200)]
brcmfmac: check memory allocation in brcmf_add_if()

For P2P_DEVICE interface the struct brcmf_if instance is
allocated using kzalloc() which can fail. Add pointer
check and return -ENOMEM if it failed. Fixes the following
smatch error:

"drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c:770
brcmf_add_if()
  error: potential null dereference 'ifp'. (kzalloc returns null)"

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: reinitialize dequeue mask per node
Arend van Spriel [Wed, 17 Apr 2013 19:25:49 +0000 (21:25 +0200)]
brcmfmac: reinitialize dequeue mask per node

The mask was only initialized for the first node, but it should be
done for each node that is handled in the loop.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: nulify all last words of TXWI
Stanislaw Gruszka [Wed, 17 Apr 2013 12:30:48 +0000 (14:30 +0200)]
rt2800: nulify all last words of TXWI

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2x00: provide separate information about TXWI & RXWI sizes
Stanislaw Gruszka [Wed, 17 Apr 2013 12:30:47 +0000 (14:30 +0200)]
rt2x00: provide separate information about TXWI & RXWI sizes

On new 2800 hardware sizes of TXWI & RXIW can be different than TXD
& RXD sizes, so we need to difference between them. Let's define
winfo_size as size of in buffer descriptor (TXWI & RXWI), and desc_size
of as size of additional descriptor - in separate DMA coherent buffer
for PCI hardware (TXD & RXD) and yet another in buffer descriptor for
USB hardware (TXINFO & RXINFO).

Change is rt2x00 wild, but should affect only 2800 driver.

Patch also fix beaconing for 5592usb AP mode.

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: cleanup rt2800_init_rfcsr
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:20 +0000 (14:08 +0200)]
rt2800: cleanup rt2800_init_rfcsr

This procedure is simple switch now and return no error any longer.

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: add rt2800_normal_mode_setup_3xxx subroutine
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:19 +0000 (14:08 +0200)]
rt2800: add rt2800_normal_mode_setup_3xxx subroutine

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: add rt2800_led_open_drain_enable subroutine
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:18 +0000 (14:08 +0200)]
rt2800: add rt2800_led_open_drain_enable subroutine

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: move RF_R27 setup to individual rfcsr init subroutines
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:17 +0000 (14:08 +0200)]
rt2800: move RF_R27 setup to individual rfcsr init subroutines

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: add rt2800_rx_filter_calibration procedure
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:16 +0000 (14:08 +0200)]
rt2800: add rt2800_rx_filter_calibration procedure

Add procedure for both bands filter calibration and use it on individual
chipset init rfcsr subroutines.

Remove "Set back to initial state" code for 3290 since vendor driver
DPO_RT3290_LinuxSTA_V2600_20120508 does not include it.

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: move RFCSR6_R2 & LDO_CFG0 setup to 3572 specific rfcsr init
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:15 +0000 (14:08 +0200)]
rt2800: move RFCSR6_R2 & LDO_CFG0 setup to 3572 specific rfcsr init

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: move GPIO_SWITCH setup to 3390 specific rfcsr init
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:14 +0000 (14:08 +0200)]
rt2800: move GPIO_SWITCH setup to 3390 specific rfcsr init

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: move 30xx common rf init code
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:13 +0000 (14:08 +0200)]
rt2800: move 30xx common rf init code

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: move RFCSR29_RSSI_GAIN to 3290 specific rfcsr init
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:12 +0000 (14:08 +0200)]
rt2800: move RFCSR29_RSSI_GAIN to 3290 specific rfcsr init

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: move rf init calibration code
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:11 +0000 (14:08 +0200)]
rt2800: move rf init calibration code

Add separate function for rf init calibration code and use it
on all init rf subroutines.

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: merge 5xxx normal mode setup
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:10 +0000 (14:08 +0200)]
rt2800: merge 5xxx normal mode setup

Merge code which program the same registes at the end of rfcsr
initialization for 5592, 5392 and 5390 chips.

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: always set common->macaddr to the MAC adress of a virtual interface
Felix Fietkau [Tue, 16 Apr 2013 10:51:57 +0000 (12:51 +0200)]
ath9k: always set common->macaddr to the MAC adress of a virtual interface

In some cases it can be useful to change the MAC address of a virtual
interface to something that's completely different from the EEPROM
stored MAC address. In this case it is a bad idea to use the EEPROM MAC
address for calculating the BSSID mask, as that would make it too wide.

In one case a few devices have been observed to send ACKs for many
packets on the channel not directed at them, which results in a neat
Denial of Service attack on the channel.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath: update hardware mac address with bssid mask
Felix Fietkau [Tue, 16 Apr 2013 10:51:56 +0000 (12:51 +0200)]
ath: update hardware mac address with bssid mask

Preparation for updating common->macaddr along with virtual interface
MAC address changes.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: use GFP_ATOMIC under spinlock
Dan Carpenter [Tue, 16 Apr 2013 07:51:28 +0000 (10:51 +0300)]
ath9k: use GFP_ATOMIC under spinlock

This is called with spinlocks held so we have to use GFP_ATOMIC.  It's
the sc_pcu_lock in ath9k_stop() that's the issue.  The call tree looks
like this:

ath9k_stop()
ath_prepare_reset()
ath_stoprecv()
ath_flushrecv()
ath_rx_tasklet()
ath9k_dfs_process_phyerr()
pd->add_pulse() => dpd_add_pulse()
channel_detector_get()
channel_detector_create()
pri_detector_init()

channel_detector_create() uses GFP_ATOMIC as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Tested-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Acked-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: change DFS logging to use ath_dbg()
Zefir Kurtisi [Mon, 15 Apr 2013 09:29:06 +0000 (11:29 +0200)]
ath9k: change DFS logging to use ath_dbg()

The DFS pattern detector was initially planned to reside on
a higher layer and used generic pr_*() logging functions.

Being part of ath9k, use ath_dbg() instead and make DFS log
ouput selectable via ATH_DBG_DFS (0x20000) at runtime.

This patch does not contain functional modifications.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2x00: Fix transmit power troubles on some Ralink RT30xx cards
Alex A. Mihaylov [Mon, 15 Apr 2013 03:29:35 +0000 (07:29 +0400)]
rt2x00: Fix transmit power troubles on some Ralink RT30xx cards

Some cards on Ralink RT30xx chipset not have correctly TX_MIXER_GAIN
value in them EEPROM/EFUSE. In this case, we must use default value,
but always used EEPROM/EFUSE value. As result we have tranmitt power
range from -10dBm to +6dBm instead 0dBm to +16dBm.

Correctly value in EEPROM/EFUSE is one or more for RT3070 and two or
more for other RT30xx chips.

Tested on Canyon CNP-WF518N1 usb Wi-Fi dongle and Jorjin WN8020 usb
embedded Wi-Fi module.

Signed-off-by: Alex A. Mihaylov <minimumlaw@rambler.ru>
Cc: stable@vger.kernel.org
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwl8k: remove nonstandard rate 72 Mbps
Jonas Gorski [Sun, 14 Apr 2013 12:11:58 +0000 (14:11 +0200)]
mwl8k: remove nonstandard rate 72 Mbps

This rate causes an overflow in the extended rates IE's data rate field,
with the overflowing bit setting the Basic Rate Set membership. This
results in a bogus 8 Mpbs basic rate, making clients checking them refuse
association.

Since the rate is likely unused anyway (HT will yield better rates between
supporting chips), we can just remove it.

This fixes association from wpa_supplicant and Android 4.x and newer.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
John W. Linville [Mon, 22 Apr 2013 18:58:14 +0000 (14:58 -0400)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next

11 years agoMerge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetoot...
John W. Linville [Mon, 22 Apr 2013 18:56:41 +0000 (14:56 -0400)]
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next

11 years agoMerge tag 'nfc-next-3.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo...
John W. Linville [Mon, 22 Apr 2013 18:54:31 +0000 (14:54 -0400)]
Merge tag 'nfc-next-3.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next

Samuel Ortiz <sameo@linux.intel.com> says:

"This is the 2nd NFC pull request for 3.10.

With this one we have:

- A major pn533 update. The pn533 framing support has been changed in order to
  easily support all pn533 derivatives. For example we now support the ACR122
  USB dongle.

- An NFC MEI physical layer code factorization through the mei_phy NFC API.
  Both the microread and the pn544 drivers now use it.

- LLCP aggregation support. This allows NFC p2p devices to send aggregated
  frames containing all sort of LLCP frames except SYMM and aggregation
  frames.

- More LLCP socket options for getting the remote device link parameters.

- Fixes for the LLCP socket option code added with the first pull request for
  3.10.

- Some support for LLCP corner cases like 0 length SDUs and general DISC
  (tagged with a 0,0 dsap ssap couple) handling.

- RFKILL support for NFC."

Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomac80211_hwsim: handle IEEE80211_HW_SUPPORTS_RC_TABLE
Karl Beldan [Fri, 19 Apr 2013 12:44:52 +0000 (14:44 +0200)]
mac80211_hwsim: handle IEEE80211_HW_SUPPORTS_RC_TABLE

Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211/minstrel: use the new rate control API
Felix Fietkau [Mon, 22 Apr 2013 14:14:43 +0000 (16:14 +0200)]
mac80211/minstrel: use the new rate control API

Pass the rate selection table to mac80211 from minstrel_update_stats.
Only rates for sample attempts are set in info->control.rates, with deferred
sampling, only the second slot gets changed.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211/minstrel_ht: use the new rate control API
Felix Fietkau [Mon, 22 Apr 2013 14:14:42 +0000 (16:14 +0200)]
mac80211/minstrel_ht: use the new rate control API

Pass the rate selection table to mac80211 from minstrel_ht_update_stats.
Only rates for sample attempts are set in info->control.rates.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: improve the rate control API
Felix Fietkau [Mon, 22 Apr 2013 14:14:41 +0000 (16:14 +0200)]
mac80211: improve the rate control API

Allow rate control modules to pass a rate selection table to mac80211
and the driver. This allows drivers to fetch the most recent rate
selection from the sta pointer for already buffered frames. This allows
rate control to respond faster to sudden link changes and it is also a
step towards adding minstrel_ht support to drivers like iwlwifi.

When a driver sets IEEE80211_HW_SUPPORTS_RC_TABLE, mac80211 will not
fill info->control.rates with rates from the rate table (to preserve
explicit overrides by the rate control module). The driver then
explicitly calls ieee80211_get_tx_rates to merge overrides from
info->control.rates with defaults from the sta rate table.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: introduce critical protocol indication from user-space
Arend van Spriel [Thu, 18 Apr 2013 13:49:00 +0000 (15:49 +0200)]
cfg80211: introduce critical protocol indication from user-space

Some protocols need a more reliable connection to complete
successful in reasonable time. This patch adds a user-space
API to indicate the wireless driver that a critical protocol
is about to commence and when it is done, using nl80211 primitives
NL80211_CMD_CRIT_PROTOCOL_START and NL80211_CRIT_PROTOCOL_STOP.

There can be only on critical protocol session started per
registered cfg80211 device.

The driver can support this by implementing the cfg80211 callbacks
.crit_proto_start() and .crit_proto_stop(). Examples of protocols
that can benefit from this are DHCP, EAPOL, APIPA. Exactly how the
link can/should be made more reliable is up to the driver. Things
to consider are avoid scanning, no multi-channel operations, and
alter coexistence schemes.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: minstrel_ht: initialize rates selection
Karl Beldan [Thu, 18 Apr 2013 12:26:21 +0000 (14:26 +0200)]
mac80211: minstrel_ht: initialize rates selection

Initialize {mp,mi}->{max_tp_rate,max_tp_rate2,max_prob_rate} in
minstrel_ht's rate_init and rate_update.

Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: minstrel_ht: pick only supported rates for sta and group max*rates
Karl Beldan [Thu, 18 Apr 2013 12:26:20 +0000 (14:26 +0200)]
mac80211: minstrel_ht: pick only supported rates for sta and group max*rates

minstrel_ht initializes max_tp_rate max_tp_rate2 and max_prob_rate to
zero both for minstrel_ht_sta and minstrel_mcs_group_data.
This is wrong since there is no guarantee that the 1st rate of any
group is supported.

Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agorfkill: fix error return code in rfkill_gpio_probe()
Wei Yongjun [Thu, 18 Apr 2013 02:31:16 +0000 (10:31 +0800)]
rfkill: fix error return code in rfkill_gpio_probe()

Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
[fix some indentation on the way]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: use synchronize_rcu() with rcu_barrier()
Bob Copeland [Thu, 18 Apr 2013 22:26:49 +0000 (18:26 -0400)]
mac80211: use synchronize_rcu() with rcu_barrier()

The RCU docs used to state that rcu_barrier() included a wait
for an RCU grace period; however the comments for rcu_barrier()
as of commit f0a0e6f... "rcu: Clarify memory-ordering properties
of grace-period primitives" contradict this.

So add back synchronize_{rcu,net}() to where they once were,
but keep the rcu_barrier()s for the call_rcu() callbacks.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Bob Copeland <bob@cozybit.com>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: indicate admission control in TX queue parameters
Alexander Bondar [Sun, 7 Apr 2013 06:53:30 +0000 (09:53 +0300)]
mac80211: indicate admission control in TX queue parameters

Some driver implementations need to know whether mandatory
admission control is required by the AP for some ACs. Add
a parameter to the TX queue parameters indicating this.

As there's currently no support for admission control in
mac80211's AP implementation, it's only ever set for the
client implementation.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: invert P2P-Device vs. netdev check ordering
Johannes Berg [Fri, 19 Apr 2013 10:19:39 +0000 (12:19 +0200)]
cfg80211: invert P2P-Device vs. netdev check ordering

In cfg80211_can_use_iftype_chan(), check for P2P Device
first, and then for netdevs. This doesn't really change
anything but makes the code a bit easier to read since
it may not be obvious for everyone at first that a P2P
device has no netdev.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: fix P2P-Device stop locking
Johannes Berg [Fri, 19 Apr 2013 10:18:19 +0000 (12:18 +0200)]
cfg80211: fix P2P-Device stop locking

cfg80211_stop_p2p_device() requires the devlist_mtx to
be held, but nl80211_stop_p2p_device() doesn't acquire
it which is a locking error and causes a warning (when
lockdep is enabled). Fix this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoMerge remote-tracking branch 'wireless-next/master' into mac80211-next
Johannes Berg [Mon, 22 Apr 2013 13:31:43 +0000 (15:31 +0200)]
Merge remote-tracking branch 'wireless-next/master' into mac80211-next

11 years agoLinux 3.9-rc8 v3.9-rc8
Linus Torvalds [Sun, 21 Apr 2013 21:38:45 +0000 (14:38 -0700)]
Linux 3.9-rc8

11 years agoqeth: fix VLAN related compilation errors
Patrick McHardy [Sun, 21 Apr 2013 00:09:34 +0000 (00:09 +0000)]
qeth: fix VLAN related compilation errors

drivers/s390/net/qeth_l3_main.c: In function 'qeth_l3_add_vlan_mc':
>> drivers/s390/net/qeth_l3_main.c:1662:3: error: too few arguments to function '__vlan_find_dev_deep'
   include/linux/if_vlan.h:88:27: note: declared here
   drivers/s390/net/qeth_l3_main.c: In function 'qeth_l3_add_vlan_mc6':
>> drivers/s390/net/qeth_l3_main.c:1723:3: error: too few arguments to function '__vlan_find_dev_deep'
   include/linux/if_vlan.h:88:27: note: declared here
   drivers/s390/net/qeth_l3_main.c: In function 'qeth_l3_free_vlan_addresses4':
>> drivers/s390/net/qeth_l3_main.c:1767:2: error: too few arguments to function '__vlan_find_dev_deep'
   include/linux/if_vlan.h:88:27: note: declared here
   drivers/s390/net/qeth_l3_main.c: In function 'qeth_l3_free_vlan_addresses6':
>> drivers/s390/net/qeth_l3_main.c:1797:2: error: too few arguments to function '__vlan_find_dev_deep'
   include/linux/if_vlan.h:88:27: note: declared here
   drivers/s390/net/qeth_l3_main.c: In function 'qeth_l3_process_inbound_buffer':
>> drivers/s390/net/qeth_l3_main.c:1980:6: error: too few arguments to function '__vlan_hwaccel_put_tag'
   include/linux/if_vlan.h:234:31: note: declared here
   drivers/s390/net/qeth_l3_main.c: In function 'qeth_l3_verify_vlan_dev':
>> drivers/s390/net/qeth_l3_main.c:2089:3: error: too few arguments to function '__vlan_find_dev_deep'
   include/linux/if_vlan.h:88:27: note: declared here

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: vlan: fix up vlan_proto_idx() for CONFIG_BUG=n
Patrick McHardy [Sun, 21 Apr 2013 00:09:32 +0000 (00:09 +0000)]
net: vlan: fix up vlan_proto_idx() for CONFIG_BUG=n

Add missing return statement for CONFIG_BUG=n.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>