]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
10 years agoMerge branch 'fec-next'
David S. Miller [Tue, 8 Jul 2014 04:21:45 +0000 (21:21 -0700)]
Merge branch 'fec-next'

Russell King says:

====================
Freescale ethernet driver updates

Here's the first batch of patches for the Freescale FEC ethernet driver.
They require the previously applied "net: fec: Don't clear IPV6 header
checksum field when IP accelerator enable" patch.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: fec: fix missing kmalloc() failure check in fec_enet_alloc_buffers()
Russell King [Mon, 7 Jul 2014 23:23:30 +0000 (00:23 +0100)]
net: fec: fix missing kmalloc() failure check in fec_enet_alloc_buffers()

fec_enet_alloc_buffers() assumes that kmalloc() will never fail, which
is an invalid assumption.  Fix this by implementing a common error
cleanup path, and use it to also clean up after failed bounce buffer
allocation.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: fec: ensure fec_enet_free_buffers() properly cleans the rings
Russell King [Mon, 7 Jul 2014 23:23:25 +0000 (00:23 +0100)]
net: fec: ensure fec_enet_free_buffers() properly cleans the rings

Ensure that we do not double-free any allocations, and that any transmit
skbuffs are properly freed when we clean up the rings.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: fec: clean up transmit descriptor setup
Russell King [Mon, 7 Jul 2014 23:23:19 +0000 (00:23 +0100)]
net: fec: clean up transmit descriptor setup

Avoid writing any state until we're certain we can proceed with the
transmission: this avoids writing mapping error address values to the
descriptors, or setting the skbuff pointer until we have successfully
mapped the skb.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: fec: make rx skb handling more robust
Russell King [Mon, 7 Jul 2014 23:23:14 +0000 (00:23 +0100)]
net: fec: make rx skb handling more robust

Allocate, and then map the receive skb before writing any data to the
ring descriptor or storing the skb.  When freeing the receive ring
entries, unmap and free the skb, and then clear the stored skb pointer.

This means we have ring data and skb pointer in one of two states:
either both fully setup, or nothing setup.

This simplifies the cleanup, as we can use just the skb pointer to
indicate whether the descriptor is setup, and thus avoids potentially
calling dma_unmap_single() on a DMA error value.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: fec: remove useless fep->opened
Russell King [Mon, 7 Jul 2014 23:23:09 +0000 (00:23 +0100)]
net: fec: remove useless fep->opened

napi_disable() waits until the NAPI processing has completed, and then
prevents any further polls.  At this point, the driver then clears
fep->opened.  The NAPI poll function uses this to stop processing in
the receive path.  Hence, it will never see this variable cleared,
because the NAPI poll has to complete before it will be cleared.

Therefore, this variable serves no purpose, so let's remove it.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: fec: stop the phy before shutting down the MAC
Russell King [Mon, 7 Jul 2014 23:23:04 +0000 (00:23 +0100)]
net: fec: stop the phy before shutting down the MAC

When the network interface goes down, stop the phy to prevent further
link up status changes before taking the MAC or netif sections down.
This prevents further reception of link up events which could
potentially call fec_restart().

Since phy_stop() takes the mutex which adjust_link() runs under, we
also ensure that adjust_link() will not already be processing a link
up event.

We also need to do this when suspending as well - we don't want a
mis-timed phy state change to restart the MAC after we have stopped
it for suspend, and thus need to restart the phy when resuming.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: fec: ensure that a disconnected phy isn't configured
Russell King [Mon, 7 Jul 2014 23:22:59 +0000 (00:22 +0100)]
net: fec: ensure that a disconnected phy isn't configured

When we disconnect from a phy, we should forget our pointer to it so we
don't accidentally try to configure it.  We handle a NULL phy pointer
correctly in most places, except fec_enet_set_pauseparam().  Fix this
too.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: fec: remove checking for NULL phy_dev in fec_enet_close()
Russell King [Mon, 7 Jul 2014 23:22:54 +0000 (00:22 +0100)]
net: fec: remove checking for NULL phy_dev in fec_enet_close()

fep->phy_dev can not be NULL here for two reasons:
- fec_enet_open() will have successfully connected the phy, or will have
  failed.
- fec_enet_open() will have called phy_start(fep->phy_dev), which
  unconditionally dereferences this pointer.

If it were to be NULL here, then fec_enet_open() will have already
oopsed.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: fec: use netif_tx_disable() rather than netif_stop_queue()
Russell King [Mon, 7 Jul 2014 23:22:49 +0000 (00:22 +0100)]
net: fec: use netif_tx_disable() rather than netif_stop_queue()

We use netif_stop_queue() in several places where we want to ensure that
the start_xmit function is not running.  netif_stop_queue() is not
sufficient to achieve that - it merely sets a flag to indicate that the
transmit queue(s) should not be run.

netif_tx_disable() gives this guarantee, since it takes the transmit
queue lock while marking the queue stopped.  This will wait for the
transmit function to complete before returning.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: fec: fix interrupt handling races
Russell King [Mon, 7 Jul 2014 23:22:44 +0000 (00:22 +0100)]
net: fec: fix interrupt handling races

While running: while :; do iperf -c <HOST> -P 4; done, transmit timeouts
are regularly reported.  With the tx ring dumping in place, we can see
that all entries are in use, and the hardware has finished transmitting
these packets.  However, the driver has not reclaimed these ring
entries.

This can occur if the interrupt handler is invoked at the wrong moment -
eg:

CPU0 CPU1
fec_enet_tx()
interrupt, IEVENT = FEC_ENET_TXF
FEC_ENET_TXF cleared
napi_schedule_prep()
napi_complete()

The result is that we clear the transmit interrupt, but we don't trigger
any cleaning of the transmit ring.  Instead, use a different strategy:

- When receiving a transmit or receive interrupt, disable both tx and rx
  interrupts, but do not acknowledge them.  Schedule a napi poll.  Don't
  loop.

- When we are polled, read IEVENT, acknowledging the pending transmit
  and receive interrupts, before then going on to process the
  appropriate rings.

This allows us to avoid the race, and has a number of other advantages:
- we cut down on the number of transmit interrupts we have to process.
- we only look at the rings which have pending events.
- we gain additional throughput: the iperf total bandwidth increases
  from about 180Mbps to 240Mbps:

[  3]  0.0-10.0 sec  68.1 MBytes  57.0 Mbits/sec
[  5]  0.0-10.0 sec  72.4 MBytes  60.5 Mbits/sec
[  4]  0.0-10.1 sec  76.1 MBytes  63.5 Mbits/sec
[  6]  0.0-10.1 sec  71.9 MBytes  59.9 Mbits/sec
[SUM]  0.0-10.1 sec   288 MBytes   241 Mbits/sec

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: fec: fix ethtool set_pauseparam duplex bug
Russell King [Mon, 7 Jul 2014 23:22:39 +0000 (00:22 +0100)]
net: fec: fix ethtool set_pauseparam duplex bug

Setting the pause parameters causes a running network interface to be
restarted.  However, the restart forces the FEC into half-duplex mode,
whether or not the remote end is in half-duplex mode.  Misconfigured
duplex mode is a known source of problems on a link.

Fix this by always preserving the duplex mode on configuration changes.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: fec: iMX6 FEC does not support half-duplex gigabit
Russell King [Mon, 7 Jul 2014 23:22:34 +0000 (00:22 +0100)]
net: fec: iMX6 FEC does not support half-duplex gigabit

The iMX6 gigabit FEC does not support half-duplex gigabit operation.
Phys attacked to the FEC may support this, and we currently do nothing
to disable this feature.  This may result in an invalid configuration.
Mask out phy support for gigabit half-duplex operation.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'net-hash-tx'
David S. Miller [Tue, 8 Jul 2014 04:14:29 +0000 (21:14 -0700)]
Merge branch 'net-hash-tx'

Tom Herbert says:

====================
net: Improvements and applications of packet flow hash in transmit path

This patch series includes some patches which improve and make use
of skb->hash in the transmit path.

What is included:

- Infrastructure to save a precomputed hash in the sock structure.
  For connected TCP and UDP sockets we only need to compute the
  flow hash once and not once for every packet.
- Call skb_get_hash in get_xps_queue and __skb_tx_hash. This eliminates
  the awkward access to skb->sk->sk_hash in the lower transmit path.
- Move UDP source port generation into a common function in udp.h This
  implementation is mostly based on vxlan_src_port.
- Use non-zero IPv6 flow labels in flow_dissector as port information
  for flow hash calculation.
- Implement automatic flow label generation on transmit (per RFC 6438).
- Don't repeatedly try to compute an L4 hash in skb_get_hash if we've
  already tried to find one in software stack calculation.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: Only do flow_dissector hash computation once per packet
Tom Herbert [Wed, 2 Jul 2014 04:33:17 +0000 (21:33 -0700)]
net: Only do flow_dissector hash computation once per packet

Add sw_hash flag to skbuff to indicate that skb->hash was computed
from flow_dissector. This flag is checked in skb_get_hash to avoid
repeatedly trying to compute the hash (ie. in the case that no L4 hash
can be computed).

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoipv6: Implement automatic flow label generation on transmit
Tom Herbert [Wed, 2 Jul 2014 04:33:10 +0000 (21:33 -0700)]
ipv6: Implement automatic flow label generation on transmit

Automatically generate flow labels for IPv6 packets on transmit.
The flow label is computed based on skb_get_hash. The flow label will
only automatically be set when it is zero otherwise (i.e. flow label
manager hasn't set one). This supports the transmit side functionality
of RFC 6438.

Added an IPv6 sysctl auto_flowlabels to enable/disable this behavior
system wide, and added IPV6_AUTOFLOWLABEL socket option to enable this
functionality per socket.

By default, auto flowlabels are disabled to avoid possible conflicts
with flow label manager, however if this feature proves useful we
may want to enable it by default.

It should also be noted that FreeBSD has already implemented automatic
flow labels (including the sysctl and socket option). In FreeBSD,
automatic flow labels default to enabled.

Performance impact:

Running super_netperf with 200 flows for TCP_RR and UDP_RR for
IPv6. Note that in UDP case, __skb_get_hash will be called for
every packet with explains slight regression. In the TCP case
the hash is saved in the socket so there is no regression.

Automatic flow labels disabled:

  TCP_RR:
    86.53% CPU utilization
    127/195/322 90/95/99% latencies
    1.40498e+06 tps

  UDP_RR:
    90.70% CPU utilization
    118/168/243 90/95/99% latencies
    1.50309e+06 tps

Automatic flow labels enabled:

  TCP_RR:
    85.90% CPU utilization
    128/199/337 90/95/99% latencies
    1.40051e+06

  UDP_RR
    92.61% CPU utilization
    115/164/236 90/95/99% latencies
    1.4687e+06

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoflow_dissector: Use IPv6 flow label in flow_dissector
Tom Herbert [Wed, 2 Jul 2014 04:33:01 +0000 (21:33 -0700)]
flow_dissector: Use IPv6 flow label in flow_dissector

This patch implements the receive side to support RFC 6438 which is to
use the flow label as an ECMP hash. If an IPv6 flow label is set
in a packet we can use this as input for computing an L4-hash. There
should be no need to parse any transport headers in this case.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agovxlan: Call udp_flow_src_port
Tom Herbert [Wed, 2 Jul 2014 04:32:49 +0000 (21:32 -0700)]
vxlan: Call udp_flow_src_port

In vxlan and OVS vport-vxlan call common function to get source port
for a UDP tunnel. Removed vxlan_src_port since the functionality is
now in udp_flow_src_port.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoudp: Add function to make source port for UDP tunnels
Tom Herbert [Wed, 2 Jul 2014 04:32:39 +0000 (21:32 -0700)]
udp: Add function to make source port for UDP tunnels

This patch adds udp_flow_src_port function which is intended to be
a common function that UDP tunnel implementations call to set the source
port. The source port is chosen so that a hash over the outer headers
(IP addresses and UDP ports) acts as suitable hash for the flow of the
encapsulated packet. In this manner, UDP encapsulation works with RSS
and ECMP based wrt the inner flow.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: Call skb_get_hash in get_xps_queue and __skb_tx_hash
Tom Herbert [Wed, 2 Jul 2014 04:32:27 +0000 (21:32 -0700)]
net: Call skb_get_hash in get_xps_queue and __skb_tx_hash

Call standard function to get a packet hash instead of taking this from
skb->sk->sk_hash or only using skb->protocol.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: Save TX flow hash in sock and set in skbuf on xmit
Tom Herbert [Wed, 2 Jul 2014 04:32:17 +0000 (21:32 -0700)]
net: Save TX flow hash in sock and set in skbuf on xmit

For a connected socket we can precompute the flow hash for setting
in skb->hash on output. This is a performance advantage over
calculating the skb->hash for every packet on the connection. The
computation is done using the common hash algorithm to be consistent
with computations done for packets of the connection in other states
where thers is no socket (e.g. time-wait, syn-recv, syn-cookies).

This patch adds sk_txhash to the sock structure. inet_set_txhash and
ip6_set_txhash functions are added which are called from points in
TCP and UDP where socket moves to established state.

skb_set_hash_from_sk is a function which sets skb->hash from the
sock txhash value. This is called in UDP and TCP transmit path when
transmitting within the context of a socket.

Tested: ran super_netperf with 200 TCP_RR streams over a vxlan
interface (in this case skb_get_hash called on every TX packet to
create a UDP source port).

Before fix:

  95.02% CPU utilization
  154/256/505 90/95/99% latencies
  1.13042e+06 tps

  Time in functions:
    0.28% skb_flow_dissect
    0.21% __skb_get_hash

After fix:

  94.95% CPU utilization
  156/254/485 90/95/99% latencies
  1.15447e+06

  Neither __skb_get_hash nor skb_flow_dissect appear in perf

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoflow_dissector: Abstract out hash computation
Tom Herbert [Wed, 2 Jul 2014 04:32:05 +0000 (21:32 -0700)]
flow_dissector: Abstract out hash computation

Move the hash computation located in __skb_get_hash to be a separate
function which takes flow_keys as input. This will allow flow hash
computation in other contexts where we only have addresses and ports.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'systemport-next'
David S. Miller [Tue, 8 Jul 2014 03:56:55 +0000 (20:56 -0700)]
Merge branch 'systemport-next'

Florian Fainelli says:

====================
net: systemport: PM and Wake-on-LAN support

This patchset brings Power Management and Wake-on-LAN support to the
Broadcom SYSTEM PORT driver.

S2 and S3 modes are supported, while we only support Wake-on-LAN using
MagicPackets for now
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: systemport: add Wake-on-LAN support
Florian Fainelli [Wed, 2 Jul 2014 04:08:40 +0000 (21:08 -0700)]
net: systemport: add Wake-on-LAN support

Support for Wake-on-LAN using Magic Packet with or without SecureOn
password is implemented doing the following:

- setting the password to the relevant UniMAC registers
- flagging the device as a wakeup source for the system, as well as
  its Wake-on-LAN interrupt
- prepare the hardware for entering WoL mode
- enabling the MPD interrupt to wake us

The Device Tree binding documentation is also reflected to specify the
third optional Wake-on-LAN interrupt line.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: systemport: rename rx_csum_en to rx_chk_en
Florian Fainelli [Wed, 2 Jul 2014 04:08:39 +0000 (21:08 -0700)]
net: systemport: rename rx_csum_en to rx_chk_en

This boolean tells us whether we are using the RXCHK hardware block,
so use a variable name that reflects that. RXCHK might be used in the
future to implement Wake-on-LAN using ARP or unicast packets.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: systemport: add suspend and resume support
Florian Fainelli [Wed, 2 Jul 2014 04:08:38 +0000 (21:08 -0700)]
net: systemport: add suspend and resume support

Implement the hardware recommended suspend/resume procedure for
SYSTEMPORT. We leverage the previous factoring work such that we can
logically break all suspend/resume operations into disctint RX and TX
code paths.

When the system enters S3, we will loose all register contents, so
make sure that we correctly re-program all the hardware and software
views of the RX & TX rings as well.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: systemport: add bcm_sysport_netif_{enable,stop}
Florian Fainelli [Wed, 2 Jul 2014 04:08:37 +0000 (21:08 -0700)]
net: systemport: add bcm_sysport_netif_{enable,stop}

Factor common code that either enables or disables the network
interface with the networking stack. We are going to reuse these
functions for suspend/resume callbacks.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: systemport: update umac_enable_set to take a bitmask
Florian Fainelli [Wed, 2 Jul 2014 04:08:36 +0000 (21:08 -0700)]
net: systemport: update umac_enable_set to take a bitmask

Quite often we need to enable either the transmitter or the receiver
bits in UMAC_CMD, use umac_enable_set() to do that for us.

This is a preliminary change to introduce suspend/resume support in the
driver.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years ago6lowpan: mac802154: fix coding style issues
Varka Bhadram [Wed, 2 Jul 2014 03:31:09 +0000 (09:01 +0530)]
6lowpan: mac802154: fix coding style issues

This patch fixed the coding style issues reported by checkpatch.pl

following issues fixed:
CHECK: Alignment should match open parenthesis
WARNING: line over 80 characters
CHECK: Blank lines aren't necessary before a close brace '}'
WARNING: networking block comments don't use an empty /* line, use /* Comment...
WARNING: Missing a blank line after declarations
WARNING: networking block comments start with * on subsequent lines
CHECK: braces {} should be used on all arms of this statement

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Tested-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonetlink: Fix do_one_broadcast() prototype.
Rami Rosen [Tue, 1 Jul 2014 18:17:35 +0000 (21:17 +0300)]
netlink: Fix do_one_broadcast() prototype.

This patch changes the prototype of the do_one_broadcast() method so that it will return void.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'tipc-next'
David S. Miller [Tue, 8 Jul 2014 02:55:49 +0000 (19:55 -0700)]
Merge branch 'tipc-next'

Erik Hugne says:

====================
tipc: link state processing improvements

Message delivery is separated from the link state processing, and
we fix a bug in receive-path triggered acks.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotipc: fix link acknowledge logic in receive path
Erik Hugne [Tue, 1 Jul 2014 08:22:41 +0000 (10:22 +0200)]
tipc: fix link acknowledge logic in receive path

Link state acks triggered from the receive path is done before
the last received packet have been processed by the link layer.
The effect of this is that the last received packet will not be
included in the ack. This causes problems if the link window is
set to TIPC_MIN_LINK_WIN, where the ack interval will be equal to
the link tolerance, and the link enters a stop-and-go behavior.
We move the ack logic to after link state processing, just before
the packet is delivered to higher layers.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: Carl Sigurjonsson <carl.sigurjonsson@ericsson.com>
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotipc: refactor message delivery out of tipc_rcv
Erik Hugne [Tue, 1 Jul 2014 08:22:40 +0000 (10:22 +0200)]
tipc: refactor message delivery out of tipc_rcv

This is a cosmetic change, separating message delivery from the
link state processing.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotcp: switch snt_synack back to measuring transmit time of first SYNACK
Neal Cardwell [Mon, 30 Jun 2014 19:09:49 +0000 (15:09 -0400)]
tcp: switch snt_synack back to measuring transmit time of first SYNACK

Always store in snt_synack the time at which the server received the
first client SYN and attempted to send the first SYNACK.

Recent commit aa27fc501 ("tcp: tcp_v[46]_conn_request: fix snt_synack
initialization") resolved an inconsistency between IPv4 and IPv6 in
the initialization of snt_synack. This commit brings back the idea
from 843f4a55e (tcp: use tcp_v4_send_synack on first SYN-ACK), which
was going for the original behavior of snt_synack from the commit
where it was added in 9ad7c049f0f79 ("tcp: RFC2988bis + taking RTT
sample from 3WHS for the passive open side") in v3.1.

In addition to being simpler (and probably a tiny bit faster),
unconditionally storing the time of the first SYNACK attempt has been
useful because it allows calculating a performance metric quantifying
how long it took to establish a passive TCP connection.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Cc: Octavian Purdila <octavian.purdila@intel.com>
Cc: Jerry Chu <hkchu@google.com>
Acked-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'tlan-next'
David S. Miller [Tue, 8 Jul 2014 00:07:05 +0000 (17:07 -0700)]
Merge branch 'tlan-next'

Ondrej Zary says:

====================
tlan: Link handling improvements and Olicom fixes

This patch series improves link handling in tlan driver, allowing the
cable to be (un)plugged anytime and NetworkManager to work properly.

Also there are some bugfixes related to Olicom OC-2326 card.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotlan: Isolate external PHY when using internal PHY
Ondrej Zary [Mon, 30 Jun 2014 16:38:37 +0000 (18:38 +0200)]
tlan: Isolate external PHY when using internal PHY

When using internal 10 Mbps PHY, isolate the external PHY from MII bus.
External PHY must be kept powered up because it passes TX from tlan chip to
network.

This fixes weird link-loss problems under load with OC-2326 card at 10 Mbps.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotlan: Enable device at resume
Ondrej Zary [Mon, 30 Jun 2014 16:38:36 +0000 (18:38 +0200)]
tlan: Enable device at resume

pci_disable_device() is called in _suspend but there's no corresponding
pci_enable_device() in _resume.
This causes "disabling already-disabled device" warning on 2nd suspend.

Add pci_enable_device() call to _resume to fix this problem.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotlan: Don't disable internal PHY on cards that use it in 10 Mbps mode
Ondrej Zary [Mon, 30 Jun 2014 16:38:35 +0000 (18:38 +0200)]
tlan: Don't disable internal PHY on cards that use it in 10 Mbps mode

In tlan_reset_adapter, we disable internal PHY when an external one is used.
On cards which use internal PHY in 10 Mbps mode, we enable it later when
setting 10 Mbps mode but it does not really work (PHY fails to reset).
Leave it enabled instead.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotlan: Add PHY reset timeout
Ondrej Zary [Mon, 30 Jun 2014 16:38:34 +0000 (18:38 +0200)]
tlan: Add PHY reset timeout

Add a timeout to prevent infinite loop waiting for PHY to reset.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotlan: Make autonegotiation faster
Ondrej Zary [Mon, 30 Jun 2014 16:38:33 +0000 (18:38 +0200)]
tlan: Make autonegotiation faster

Reduce the autonegotiation poll interval from 8 seconds to 2.
This greatly reduces the time needed to detect link presence,
especially on Olicom cards at 10 Mbps (two autonegoatiations required).

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotlan: Don't scream if no link
Ondrej Zary [Mon, 30 Jun 2014 16:38:32 +0000 (18:38 +0200)]
tlan: Don't scream if no link

Remove excess printks when the link is down.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotlan: Restart autonegotiation on link loss
Ondrej Zary [Mon, 30 Jun 2014 16:38:31 +0000 (18:38 +0200)]
tlan: Restart autonegotiation on link loss

When link is lost on a card which uses internal PHY for 10 Mbit speeds,
restart autonegotiation to allow switching between 10 and 100 Mbps speeds.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotlan: Fix MAC address byte order on OC-2325/OC-2326
Ondrej Zary [Mon, 30 Jun 2014 16:38:30 +0000 (18:38 +0200)]
tlan: Fix MAC address byte order on OC-2325/OC-2326

Olicom OC-2325 and OC-2326 cards have the MAC address byte-swapped in EEPROM.
Byte-swap the MAC address if it's located at offset 0xF8.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotlan: Add ethtool support
Ondrej Zary [Mon, 30 Jun 2014 16:38:29 +0000 (18:38 +0200)]
tlan: Add ethtool support

Add basic ethtool support to tlan driver:
 - driver info  - link detect (this allows NetworkManager to detect carrier)
 - EEPROM read

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotlan: Enable link monitoring
Ondrej Zary [Mon, 30 Jun 2014 16:38:28 +0000 (18:38 +0200)]
tlan: Enable link monitoring

Enable old link monitoring code and modify it:
 - control LINK LED
 - use separate timer so it does not interfere with ACT LED

Tested with Olicom OC-2326.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotlan: Enable activity LED on Olicom OC-2325 and OC-2326
Ondrej Zary [Mon, 30 Jun 2014 16:38:27 +0000 (18:38 +0200)]
tlan: Enable activity LED on Olicom OC-2325 and OC-2326

Olicom OC-2325 and OC-2326 ethernet cards have an activity LED but it does not
work with tlan driver as it's not enabled. Enable it.
Tested with OC-2326.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobatman-adv: Use kasprintf
Himangi Saraogi [Sat, 28 Jun 2014 18:36:29 +0000 (00:06 +0530)]
batman-adv: Use kasprintf

kasprintf combines kmalloc and sprintf, and takes care of the size
calculation itself.

The semantic patch that makes this change is as follows:

// <smpl>
@@
expression a,flag;
expression list args;
statement S;
@@

  a =
-  \(kmalloc\|kzalloc\)(...,flag)
+  kasprintf(flag,args)
  <... when != a
  if (a == NULL || ...) S
  ...>
- sprintf(a,args);
// </smpl>

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'ptp-vlan'
David S. Miller [Mon, 7 Jul 2014 23:57:32 +0000 (16:57 -0700)]
Merge branch 'ptp-vlan'

Stefan Sørensen says:

====================
Add ptp vlan support

This patch series adds functionality for running ptp/ieee1588 over vlan.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agovlan: Pass SIOC[SG]HWTSTAMP ioctls to real device
Stefan Sørensen [Fri, 27 Jun 2014 09:59:11 +0000 (11:59 +0200)]
vlan: Pass SIOC[SG]HWTSTAMP ioctls to real device

This allows applications to enable hardware timestamping without being aware
of it being a vlan device and figuring out the real device.

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoptp: Classify ptp over ip over vlan packets
Stefan Sørensen [Fri, 27 Jun 2014 09:59:10 +0000 (11:59 +0200)]
ptp: Classify ptp over ip over vlan packets

This extends the ptp bpf to also match ptp over ip over vlan packets. The ptp
classes are changed to orthogonal bitfields representing version, transport
and vlan values to simplify matching.

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: Simplify ptp class checks
Stefan Sørensen [Fri, 27 Jun 2014 09:59:09 +0000 (11:59 +0200)]
net: Simplify ptp class checks

Replace two switch statements enumerating all valid ptp classes with an if
statement matching for not PTP_CLASS_NONE.

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobcma: add driver for PCIe Gen 2 core
Rafał Miłecki [Fri, 4 Jul 2014 23:10:41 +0000 (01:10 +0200)]
bcma: add driver for PCIe Gen 2 core

New Broadcom PCIe devices (802.11ac ones?) use Gen2 and have to be
initialized differently.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agob43: fix reading info about radio for new devices (cores 40 & 42)
Rafał Miłecki [Fri, 4 Jul 2014 07:21:56 +0000 (09:21 +0200)]
b43: fix reading info about radio for new devices (cores 40 & 42)

This changes
b43-phy0: Found Radio: Manuf 0x17F, Version 0x7769, Revision 4
to the
b43-phy0: Found Radio: Manuf 0x17F, Version 0x2069, Revision 4
which matches what closed source driver reports:
$ wl revinfo
radiorev 0x42069000

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agob43: N-PHY: add TX gains tables for radio 0x2057 rev 9
Rafał Miłecki [Wed, 2 Jul 2014 20:42:46 +0000 (22:42 +0200)]
b43: N-PHY: add TX gains tables for radio 0x2057 rev 9

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agob43: N-PHY: rework names & picking of TX gain tables
Rafał Miłecki [Wed, 2 Jul 2014 20:42:45 +0000 (22:42 +0200)]
b43: N-PHY: rework names & picking of TX gain tables

This allows adding more revisions support, spotting lacking tables and
unifies naming schema.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agob43: N-PHY: initialize hardware tables on new devices
Rafał Miłecki [Wed, 2 Jul 2014 15:05:35 +0000 (17:05 +0200)]
b43: N-PHY: initialize hardware tables on new devices

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoiwlwifi: mvm: minor fix in comment
Emmanuel Grumbach [Thu, 5 Jun 2014 08:32:41 +0000 (11:32 +0300)]
iwlwifi: mvm: minor fix in comment

The comment was not accurate, we are talking about the frames
*for* the station and not from the station.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: remove 8000 HW family setting of adc sampling on nic config
Liad Kaufman [Thu, 8 May 2014 13:30:24 +0000 (16:30 +0300)]
iwlwifi: mvm: remove 8000 HW family setting of adc sampling on nic config

This patch removes the setting of the ADC sampling bits in
the mvm nic configuration. This setting is not required by
the firmware, and furthermore - it interferes with the DBGC
when it is running in DRAM mode on PCIe.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Dor Shaish <dor.shaish@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: teardown TDLS peers when initiating DCM
Arik Nemtsov [Tue, 10 Jun 2014 16:56:27 +0000 (19:56 +0300)]
iwlwifi: mvm: teardown TDLS peers when initiating DCM

The FW currently doesn't optimally support TDLS in DCM mode. Teardown
all TDLS peers when we have more than a single phy context.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: disable PSM on vifs with associated TDLS peers
Arik Nemtsov [Thu, 15 May 2014 15:59:32 +0000 (18:59 +0300)]
iwlwifi: disable PSM on vifs with associated TDLS peers

The FW does not support PSM on a vif with associated TDLS peers. Disable
PSM when the first peer joins and re-enable it when the last leaves.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: protect TDLS discovery session
Arik Nemtsov [Tue, 20 May 2014 15:16:42 +0000 (18:16 +0300)]
iwlwifi: mvm: protect TDLS discovery session

Use the new mac80211 callback to protect a TDLS discovery session so we
can hear the discovery-response packet.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: disallow new TDLS stations when appropriate
Arik Nemtsov [Thu, 15 May 2014 08:44:40 +0000 (11:44 +0300)]
iwlwifi: mvm: disallow new TDLS stations when appropriate

HW/FW constraints dictate that TDLS should only be used when a single
phy ctx is active. We also support at most 4 TDLS peers. We don't
support TDLS on a P2P vif.

Unify and move a phy-ctx counting implementation from the power-mgmt code
in order to simplify implementation.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: Use CS tx block bit for AP/GO
Andrei Otcheretianski [Sun, 25 May 2014 14:24:22 +0000 (17:24 +0300)]
iwlwifi: mvm: Use CS tx block bit for AP/GO

An AP/GO may perform the channel switch slightly before its stations.
This scenario may result in packet loss, since the transmission may start
before the client is actually on a new channel. In order to prevent
potential packet loss disable tx to all the stations when the channel
switch flow starts. Clear the disable_tx bit when a station is seen on a
target channel, or after IWL_MVM_CS_UNBLOCK_TX_TIMEOUT beacons on a new
channel. In addition call ieee80211_sta_block_awake in order to inform
mac80211 that the frames for this station should be buffered.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: Reflect GO channel switch in NoA
Andrei Otcheretianski [Sun, 4 May 2014 08:48:12 +0000 (11:48 +0300)]
iwlwifi: mvm: Reflect GO channel switch in NoA

According to the spec, GO/AP should perform the channel switch just
before "beacon 0". However, since the exact timing isn't defined,
it may result in a sudden GO disappearance from the channel.
Prevent potential packet loss when performing the CS by scheduling
NoA time event and executing the channel switch flow when a notification
from fw is received.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: Protect mvm->csa_vif with RCU
Andrei Otcheretianski [Thu, 5 Jun 2014 13:40:36 +0000 (16:40 +0300)]
iwlwifi: mvm: Protect mvm->csa_vif with RCU

Currently mvm->csa_vif is protected with mvm mutex. The RCU protection
is required for "iwlwifi: mvm: Reflect GO channel switch in NoA" patch.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: Use beacon_get_template instead of beacon_get
Andrei Otcheretianski [Thu, 10 Apr 2014 18:46:16 +0000 (21:46 +0300)]
iwlwifi: mvm: Use beacon_get_template instead of beacon_get

Call ieee80211_beacon_get_template instead of ieee80211_beacon_get and sync the
CSA counters with mac80211 after each beacon transmission.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: CSA unbind-bind flow support for client
Luciano Coelho [Wed, 5 Mar 2014 13:41:48 +0000 (15:41 +0200)]
iwlwifi: mvm: CSA unbind-bind flow support for client

Implement support for unbind-bind flow for the client roles.  This
includes telling the firmware that we are not associated, removing
time-events, removing quotas and updating power management during the
actual switch, and redoing everything in the new channel.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: add switch_vif_chanctx operation
Luciano Coelho [Tue, 20 May 2014 20:31:05 +0000 (23:31 +0300)]
iwlwifi: mvm: add switch_vif_chanctx operation

Implement the switch_vif_chanctx operation with support for a
single-vif and SWAP mode.  The REASSIGN mode and multi-vifs are not
supported yet.

This operation needs to implement 4 steps, namely unassign, remove,
add and assign the chanctx.  In order to do this, split out these
operations into locked and non-locked parts, thus allowing us to call
them while locked.

Additionally, in order to allow us to restart the hardware when
something fails, add a boolean to the iwl_mvm_nic_restart() function
that tells whether the restart was triggered by a FW error or
something else.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: remove update type argument from quota update
Johannes Berg [Fri, 6 Jun 2014 13:18:45 +0000 (15:18 +0200)]
iwlwifi: mvm: remove update type argument from quota update

It turns out that adding the update type argument was pointless as
quota update is never called from the add_interface() callback.
Therefore, IWL_MVM_QUOTA_UPDATE_TYPE_NEW isn't actually needed and
then only a "disabled_vif" argument is needed for the upcoming CSA
work.

Remove the whole enum iwl_mvm_quota_update_type and pass the right
arguments (always NULL for disabled vif right now) to the function
in all current call sites.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: don't pass update type to quota iterator
Johannes Berg [Fri, 23 May 2014 14:17:13 +0000 (16:17 +0200)]
iwlwifi: mvm: don't pass update type to quota iterator

Simplify the quota iterator by not passing the update type,
it only needs to know whether or not to skip an interface.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: validate that we don't send zero quota
Johannes Berg [Fri, 23 May 2014 14:13:57 +0000 (16:13 +0200)]
iwlwifi: mvm: validate that we don't send zero quota

The firmware currently deals with zero quota for a given
binding, but it seems odd to send that down. Make sure
that we don't do that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: don't send zero quota to the firmware
Johannes Berg [Fri, 23 May 2014 14:15:11 +0000 (16:15 +0200)]
iwlwifi: mvm: don't send zero quota to the firmware

There are some cases where we can currently send zero quota
for a valid binding, e.g. if we update while an interface is
bound to a channel context but not yet acting as an AP.

Avoid this by reordering the checks.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: let iwl_mvm_update_quotas disregard a disabled vif
Luciano Coelho [Tue, 13 May 2014 19:28:35 +0000 (22:28 +0300)]
iwlwifi: mvm: let iwl_mvm_update_quotas disregard a disabled vif

In some cases (e.g. when we're doing a channel switch), we may need to
disable the quota of a vif temporarily.  In order to do so, add an
argument to the iwl_mvm_update_quotas() function to tell if the passed
vif is a new one or if it should be disregarded.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: 8000: drop a print when the address is invalid
Eran Harary [Sun, 29 Jun 2014 08:53:06 +0000 (11:53 +0300)]
iwlwifi: 8000: drop a print when the address is invalid

when driver takes the MAC address from the HW section and
it isn't valid - print an error.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix endianity in scan command
David Spinadel [Wed, 25 Jun 2014 10:17:53 +0000 (13:17 +0300)]
iwlwifi: mvm: fix endianity in scan command

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: init lmac scan command
David Spinadel [Thu, 12 Jun 2014 16:29:40 +0000 (19:29 +0300)]
iwlwifi: mvm: init lmac scan command

Initialize LMAC scan command.
Fix EBS flag to be dependant on TLV flg and fix other bugs.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: add unified LMAC scan API
David Spinadel [Sun, 4 May 2014 09:51:10 +0000 (12:51 +0300)]
iwlwifi: mvm: add unified LMAC scan API

Add new scan API that uses the same command 0x51 for both regular and
sched scan.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: don't save debugfs files
Eliad Peller [Sun, 15 Jun 2014 09:02:20 +0000 (12:02 +0300)]
iwlwifi: mvm: rs: don't save debugfs files

These file are removed recursively anyway, so there's no
point saving them just to redundantly remove them later.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: don't clear persistent fields
Eliad Peller [Wed, 11 Jun 2014 12:51:33 +0000 (15:51 +0300)]
iwlwifi: mvm: rs: don't clear persistent fields

iwl_mvm_rs_rate_init() is called multiple times to re-init
the rate scaling statistics (e.g. after some idle time).

It clears all the lq_sta sta, including some fields that
shouldn't be cleared (e.g. debugfs pointers). Fix it
by adding a new 'persistent' sub-struct, and
avoid clearing it on (re-)init.

Move the initialization of the persistent fields to
rs_alloc_sta instead.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: warn about empty OTP
Eran Harary [Tue, 1 Jul 2014 14:31:38 +0000 (17:31 +0300)]
iwlwifi: mvm: warn about empty OTP

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - relax constraints when TTC / RRC is active
Emmanuel Grumbach [Mon, 30 Jun 2014 07:26:02 +0000 (10:26 +0300)]
iwlwifi: mvm: BT Coex - relax constraints when TTC / RRC is active

When TxTxCo-Running is active, we can relax the constraints
on the rate control.
When RxRxCo-Running is active, we can relax the constrains
on SMPS.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - fix debugfs with old API
Emmanuel Grumbach [Wed, 2 Jul 2014 14:33:52 +0000 (17:33 +0300)]
iwlwifi: mvm: BT Coex - fix debugfs with old API

Fix the debugfs hook to make it able to display the data
with the old firmware API.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - add High Band retention
Emmanuel Grumbach [Wed, 11 Jun 2014 12:37:25 +0000 (15:37 +0300)]
iwlwifi: mvm: BT Coex - add High Band retention

Tell the firmware if TTC should be enabled when switching
to High Band.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - convert reduced Tx power to new API
Emmanuel Grumbach [Thu, 22 May 2014 09:48:27 +0000 (12:48 +0300)]
iwlwifi: mvm: BT Coex - convert reduced Tx power to new API

No need to send the big BT_COEX_CMD command, we have now
a much thiner command that updates only what is needed.
Adapt the code to that.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - convert the co-running update to new API
Emmanuel Grumbach [Wed, 2 Apr 2014 09:23:09 +0000 (12:23 +0300)]
iwlwifi: mvm: BT Coex - convert the co-running update to new API

No need to send the big BT_COEX_CMD command, we have now
a much thiner command that updates only what is needed.
Adapt the code to that.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - convert the sw boost update to new API
Emmanuel Grumbach [Wed, 2 Apr 2014 09:23:09 +0000 (12:23 +0300)]
iwlwifi: mvm: BT Coex - convert the sw boost update to new API

No need to send the big BT_COEX_CMD command, we have now
a much thiner command that updates only what is needed.
Adapt the code to that, and open the patch to the updates.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - new API
Emmanuel Grumbach [Wed, 2 Apr 2014 06:55:16 +0000 (09:55 +0300)]
iwlwifi: mvm: BT Coex - new API

Start the new BT Coex implementation.
Don't react to notifications for now - only the initial
configuration is implemented. The rest will happen in next
patches.
Since coex.c now uses the new the new structures in all
functions, we need to adapt the code to compile, even if it
doesn't run yet.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - prepare towards new API
Emmanuel Grumbach [Wed, 2 Apr 2014 06:31:36 +0000 (09:31 +0300)]
iwlwifi: mvm: BT Coex - prepare towards new API

A new API is coming. This new API is not backward
compatible. So we need to keep the old commands to be able
to work with the former API.
Move all the current code into a new file: coex_legacy.
If a firmware with the new API is detected, we currently
just bail out since the implementation of the new API will
come in future patches.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: remove unused flags from TX command
Emmanuel Grumbach [Wed, 2 Jul 2014 09:00:51 +0000 (12:00 +0300)]
iwlwifi: mvm: remove unused flags from TX command

These flags are not used by the firmware anyway.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: rename iwl_fw_error_fw_mon to iwl_fw_error_dump_fw_mon
Emmanuel Grumbach [Thu, 26 Jun 2014 06:54:23 +0000 (09:54 +0300)]
iwlwifi: rename iwl_fw_error_fw_mon to iwl_fw_error_dump_fw_mon

This is matches the convention of the other structures.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: read the mac address in family 8000
Eran Harary [Wed, 11 Jun 2014 08:37:09 +0000 (11:37 +0300)]
iwlwifi: mvm: read the mac address in family 8000

In family 8000 products the MAC address in the OTP could be in either:
- WFPM address
- PCIE address
In sdio product we should read it from the WFPM, in pcie product we
should read it from the PCIe location.
This is relevant only from otp version 0xE08 and above.
While at it, fix the bytes order in version 0xE08.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Reviewed-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: wait for d0i3 exit in add interface flow
Gregory Greenman [Wed, 25 Jun 2014 12:08:50 +0000 (14:08 +0200)]
iwlwifi: mvm: wait for d0i3 exit in add interface flow

This patch makes sure there're no target accesses in the add
interface flow before d0i3 exit completes.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: update layout of firmware error dump
Emmanuel Grumbach [Wed, 25 Jun 2014 13:21:43 +0000 (16:21 +0300)]
iwlwifi: mvm: update layout of firmware error dump

The memory was not zeroed - fix that. Also update the
iwl_fw_error_dump_info structure.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: kill iwl_mvm_fw_error_rxf_dump
Emmanuel Grumbach [Wed, 25 Jun 2014 11:08:58 +0000 (14:08 +0300)]
iwlwifi: mvm: kill iwl_mvm_fw_error_rxf_dump

Its content can move to the caller.
While at it, move iwl_mvm_fw_error_rxf_dump to caller.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: don't collect logs in the interrupt thread
Emmanuel Grumbach [Wed, 25 Jun 2014 10:46:10 +0000 (13:46 +0300)]
iwlwifi: mvm: don't collect logs in the interrupt thread

Instead of reading all the data in the context of the
interrupt thread, collect the data in the restart flow
before the actual restart takes place so that the device
still has all the information.
Remove iwl_mvm_fw_error_sram_dump and move its content to
iwl_mvm_fw_error_dump.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: remove wrong comment about alignment in iwl-fw-error-dump.h
Emmanuel Grumbach [Tue, 24 Jun 2014 11:34:28 +0000 (14:34 +0300)]
iwlwifi: remove wrong comment about alignment in iwl-fw-error-dump.h

The chunks of data do not need to be multipliers of 4 nor
4-bytes aligned.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: fix naming mistake for the fw_monitor module parameter
Emmanuel Grumbach [Thu, 26 Jun 2014 06:13:26 +0000 (09:13 +0300)]
iwlwifi: fix naming mistake for the fw_monitor module parameter

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoMerge remote-tracking branch 'wireless-next/master' into iwlwifi-next
Emmanuel Grumbach [Sun, 6 Jul 2014 08:15:30 +0000 (11:15 +0300)]
Merge remote-tracking branch 'wireless-next/master' into iwlwifi-next

10 years agoMerge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-next
Emmanuel Grumbach [Sun, 6 Jul 2014 08:15:23 +0000 (11:15 +0300)]
Merge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-next

10 years agoiwlwifi: mvm: disable CTS to Self
Emmanuel Grumbach [Thu, 3 Jul 2014 17:46:35 +0000 (20:46 +0300)]
iwlwifi: mvm: disable CTS to Self

Firmware folks seem say that this flag can make trouble.
Drop it. The advantage of CTS to self is that it slightly
reduces the cost of the protection, but make the protection
less reliable.

Cc: <stable@vger.kernel.org> [3.13+]
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>