GitHub/LineageOS/G12/android_kernel_amlogic_linux-4.9.git
9 years agocfg80211: pass name_assign_type to rdev_add_virtual_intf()
Tom Gundersen [Wed, 18 Mar 2015 10:13:39 +0000 (11:13 +0100)]
cfg80211: pass name_assign_type to rdev_add_virtual_intf()

This will expose in /sys whether the ifname of a device is set by
userspace or generated by the kernel. The latter kind (wlanX, etc)
is not deterministic, so userspace needs to rename these devices
to names that are guaranteed to stay the same between reboots. The
former, however should never be renamed, so userspace needs to be
able to reliably tell the difference.

Similar functionality was introduced for the rtnetlink core in
commit 5517750f058e ("net: rtnetlink - make create_link take name_assign_type")

Signed-off-by: Tom Gundersen <teg@jklm.no>
Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: Brett Rudley <brudley@broadcom.com>
Cc: Arend van Spriel <arend@broadcom.com>
Cc: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Cc: Hante Meuleman <meuleman@broadcom.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
[reformat changelog to fit 72 cols]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: fix typo in debug output
Michael Braun [Wed, 18 Mar 2015 06:17:37 +0000 (07:17 +0100)]
mac80211: fix typo in debug output

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: reject aggregation sessions with non-HT peers
Johannes Berg [Mon, 9 Mar 2015 10:13:04 +0000 (11:13 +0100)]
mac80211: reject aggregation sessions with non-HT peers

If a peer or some local agent (rate control, ...) decides to start
an aggregation session but doesn't support HT (which also implies
QoS), reject it.

This is mostly a corner case as such peers normally won't try to
use block-ack sessions and rate control wouldn't start them, but
technically QoS stations could request it according to the spec.

However, since drivers don't really support such non-HT sessions
it's better to reject them.

Also, while at it, move the tracing for TX sessions earlier so it
captures the error cases as well.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg/mac80211: add regulatory classes IE during TDLS setup
Arik Nemtsov [Wed, 18 Mar 2015 06:46:08 +0000 (08:46 +0200)]
cfg/mac80211: add regulatory classes IE during TDLS setup

Seems Broadcom TDLS peers (Nexus 5, Xperia Z3) refuse to allow TDLS
connection when channel-switching is supported but the regulatory
classes IE is missing from the setup request.
Add a chandef to reg-class translation function to cfg80211 and use it
to add the required IE during setup. For now add only the current
regulatory class as supported - it is enough to resolve the
compatibility issue.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agonl80211: small clarification of the sched_scan delay attribute
Luciano Coelho [Wed, 18 Mar 2015 08:47:02 +0000 (10:47 +0200)]
nl80211: small clarification of the sched_scan delay attribute

Just clarify that the delay is only before the first cycle.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: stop scan before connection
David Spinadel [Tue, 17 Mar 2015 17:58:38 +0000 (19:58 +0200)]
mac80211: stop scan before connection

Stop scan before authentication or association to make sure
that nothing interferes with connection flow.

Currently mac80211 defers RX auth and assoc packets (among other ones)
until after the scan is complete, so auth during scan is likely to fail
if scan took too much time.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agonl80211: add net-detect delay to wowlan info
Luciano Coelho [Tue, 17 Mar 2015 14:36:01 +0000 (16:36 +0200)]
nl80211: add net-detect delay to wowlan info

Pass the initial net-detect delay (NL80211_ATTR_SCHED_SCAN_DELAY)
attribute in the WoWLAN info response.

Additionally, remove a bogus TODO comment.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: notify the driver about deauth
Emmanuel Grumbach [Mon, 16 Mar 2015 21:23:37 +0000 (23:23 +0200)]
mac80211: notify the driver about deauth

This can allow the driver to take action based on the reason
of the deauth.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: notify the driver about association status
Emmanuel Grumbach [Mon, 16 Mar 2015 21:23:36 +0000 (23:23 +0200)]
mac80211: notify the driver about association status

This can allow the driver to take action based on the
success / failure of the association.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: notify the driver about authentication status
Emmanuel Grumbach [Mon, 16 Mar 2015 21:23:35 +0000 (23:23 +0200)]
mac80211: notify the driver about authentication status

This can allow the driver to take action based on the
success / failure of the authentication.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: convert rssi_callback() to event_callback()
Emmanuel Grumbach [Mon, 16 Mar 2015 21:23:34 +0000 (23:23 +0200)]
mac80211: convert rssi_callback() to event_callback()

We will be able to add more events, such as MLME events and
others. The low level driver may be interested in knowing
about these events to dump firmware data upon failures, or
to change parameters in case connection attempts fail etc...

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: agg-tx: avoid sending DelBA with sta->lock held
Johannes Berg [Thu, 12 Mar 2015 18:28:31 +0000 (19:28 +0100)]
mac80211: agg-tx: avoid sending DelBA with sta->lock held

The rate control locking caused a potential deadlock here due to the
locks being acquired in different orders, so that change cannot yet
be applied. However, there's no fundamental reason for this code to
hold the sta->lock while transmitting frames.

Clearly it's better not to hold the lock for longer periods of time,
which can happen here since we call all the way down to the driver.
Change the code a bit to not hold it while doing that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: add vlan to station add/change tracing
Johannes Berg [Fri, 20 Mar 2015 18:56:41 +0000 (19:56 +0100)]
cfg80211: add vlan to station add/change tracing

This helps debug issues with VLAN modifications that are otherwise
not really visible in any tracing/debugging.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: avoid duplicate TX path station lookup
Johannes Berg [Fri, 20 Mar 2015 13:18:27 +0000 (14:18 +0100)]
mac80211: avoid duplicate TX path station lookup

Instead of looking up the destination station twice in the TX path
(first to build the header, and then for control processing), save
it when building the header and use it later in the TX path.

To avoid having to look up the station in the many callers, allow
those to pass %NULL which keeps the existing lookup.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: mesh: avoid pointless station lookup
Johannes Berg [Fri, 20 Mar 2015 15:01:52 +0000 (16:01 +0100)]
mac80211: mesh: avoid pointless station lookup

In ieee80211_build_hdr(), the station is looked up to build the
header correctly (QoS field) and to check for authorization. For
mesh, authorization isn't checked here, and QoS capability is
mandatory, so the station lookup can be avoided.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: drop 4-addr VLAN frames earlier if not connected
Johannes Berg [Fri, 20 Mar 2015 13:05:02 +0000 (14:05 +0100)]
mac80211: drop 4-addr VLAN frames earlier if not connected

If there's no station on the 4-addr VLAN interface, then frames
cannot be transmitted. Drop such frames earlier, before setting
up all the information for them.

We should keep the old check though since that code might be used
for other internally-generated frames.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: don't look up destination station twice
Johannes Berg [Fri, 20 Mar 2015 12:29:29 +0000 (13:29 +0100)]
mac80211: don't look up destination station twice

There's no need to look up the destination station twice while
building the 802.11 header for a given frame if the frame will
actually be transmitted to the station we initially looked up.

This happens for 4-addr VLAN interfaces and TDLS connections, which
both directly send the frame to the station they looked up, though
in the case of TDLS some station conditions need to be checked.

To avoid that, add a variable indicating that we've looked up the
station that the frame is going to be transmitted to, and avoid the
lookup/flag checking if it already has been done.

In the TDLS case, also move the authorized/wme_sta flag assignment
to the correct place, i.e. only when that station is really used.
Before this change, the new lookup should always have succeeded so
that the potentially erroneous data would be overwritten.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: remove drop_unencrypted code
Johannes Berg [Fri, 20 Mar 2015 10:37:36 +0000 (11:37 +0100)]
mac80211: remove drop_unencrypted code

This mechanism was historic, and only ever used by IBSS, which
also doesn't need to have it as it properly manages station's
802.1X PAE state (or, with WEP, always has a key.)

Remove the mechanism to clean up the code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: Get IV len from key conf and not cipher scheme
Cedric Izoard [Tue, 17 Mar 2015 10:47:33 +0000 (10:47 +0000)]
mac80211: Get IV len from key conf and not cipher scheme

When a key is installed using a cipher scheme, set a new
internal key flag (KEY_FLAG_CIPHER_SCHEME) on it, to allow
distinguishing such keys more easily.

In particular, use this flag on the TX path instead of
testing the sta->cipher_scheme pointer, as the station is
NULL for broad-/multicast message, and use the key's iv_len
instead of the cipher scheme information.

Signed-off-by: Cedric Izoard <cedric.izoard@ceva-dsp.com>
[add missing documentation, rewrite commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: IBSS: refactor ieee80211_rx_bss_info
Janusz.Dziedzic@tieto.com [Mon, 9 Mar 2015 06:58:15 +0000 (07:58 +0100)]
mac80211: IBSS: refactor ieee80211_rx_bss_info

Put station specific code in ieee80211_update_sta_info
function.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: minstrel_ht: fix rounding issue in MCS duration calculation
Felix Fietkau [Fri, 13 Mar 2015 09:54:44 +0000 (10:54 +0100)]
mac80211: minstrel_ht: fix rounding issue in MCS duration calculation

On very high MCS bitrates, the calculated duration of rates that are
next to each other can be very imprecise, due to the small packet size
used as reference (1200 bytes).
This is most visible in VHT80 nss=2 MCS8/9, for which minstrel shows the
same throughput when the probability is also the same. This leads to a
bad rate selection for such rates.

Fix this issue by introducing an average A-MPDU size factor into the
calculation.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: Process all pending regulatory requests/hints
Ben [Thu, 12 Mar 2015 13:37:34 +0000 (09:37 -0400)]
cfg80211: Process all pending regulatory requests/hints

It is possible that there are several regulatory requests
pending, but the processing of the last one does not call
CRDA, and thus the other requests are not handled.

Fix this by rescheduling the work until all requests have
been processed.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: initialize rate control earlier for tdls station
Marek Puzyniak [Sun, 8 Mar 2015 16:04:22 +0000 (18:04 +0200)]
mac80211: initialize rate control earlier for tdls station

Currently when TDLS station in driver goes from authenticated
to associated state it can not use rate control parameters
because rate control is not initialized yet. Some drivers
require parameters already initialized by rate control when
entering associated state. It can be done by initializing
rate control after station transition to associated state but
before notifying driver about that.

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
[fix comment to say 'associated' instead of 'authorized']
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: refactor drop connection/unlock in CSA processing
Johannes Berg [Thu, 12 Mar 2015 06:53:25 +0000 (08:53 +0200)]
mac80211: refactor drop connection/unlock in CSA processing

The schedule_work()/mutex unlocking code is duplicated many times,
refactor that to a common place in the function.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: allow to get wireless_dev structure from ieee80211_vif
Emmanuel Grumbach [Thu, 12 Mar 2015 06:53:24 +0000 (08:53 +0200)]
mac80211: allow to get wireless_dev structure from ieee80211_vif

This will allow mac80211 drivers to call cfg80211 APIs with
the right handle.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: add comment for rx_path_lock
Johannes Berg [Mon, 16 Mar 2015 08:08:20 +0000 (09:08 +0100)]
mac80211: add comment for rx_path_lock

Add a comment explaining how the RX path lock is used.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: move netdev stats to common function
Johannes Berg [Mon, 16 Mar 2015 08:05:23 +0000 (09:05 +0100)]
mac80211: move netdev stats to common function

Move the netdev stats accounting into the common function
ieee80211_deliver_skb() that is called in both places.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: Schedule timeout for all CRDA calls
Ilan peer [Wed, 4 Mar 2015 05:32:07 +0000 (00:32 -0500)]
cfg80211: Schedule timeout for all CRDA calls

Timeout was scheduled only in case CRDA was called due to user hints,
but was not scheduled for other cases. This can result in regulatory
hint processing getting stuck in case that there is no CRDA configured.

Change this by scheduling a timeout every time CRDA is called. In
addition, in restore_regulatory_settings() all pending requests are
restored (and not only the user ones).

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Acked-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: Add API to change the indoor regulatory setting
Ilan peer [Wed, 4 Mar 2015 05:32:06 +0000 (00:32 -0500)]
cfg80211: Add API to change the indoor regulatory setting

Previously, the indoor setting configuration assumed that as
long as a station interface is connected, the indoor environment
setting does not change. However, this assumption is problematic
as:

- It is possible that a station interface is connected to a mobile
  AP, e.g., softAP or a P2P GO, where it is possible that both the
  station and the mobile AP move out of the indoor environment making
  the indoor setting invalid. In such a case, user space has no way to
  invalidate the setting.
- A station interface disconnection does not necessarily imply that
  the device is no longer operating in an indoor environment, e.g.,
  it is possible that the station interface is roaming but is still
  stays indoor.

To handle the above, extend the indoor configuration API to allow
user space to indicate a change of indoor settings, and allow it to
indicate weather it controls the indoor setting, such that:

1. If the user space process explicitly indicates that it is going
   to control the indoor setting, do not clear the indoor setting
   internally, unless the socket is released. The user space process
   should use the NL80211_ATTR_SOCKET_OWNER attribute in the command
   to state that it is going to control the indoor setting.
2. Reset the indoor setting when restoring the regulatory settings in
   case it is not owned by a user space process.

Based on the above, a user space tool that continuously monitors the
indoor settings, i.e., tracking power setting, location etc., can
indicate environment changes to the regulatory core.

It should be noted that currently user space is the only provided mechanism
used to hint to the regulatory core over the indoor/outdoor environment --
while the country IEs do have an environment setting this has been completely
ignored by the regulatory core by design for a while now since country IEs
typically can contain bogus data.

Acked-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: ArikX Nemtsov <arik@wizery.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: Simplify the handling of regulatory indoor setting
Ilan peer [Wed, 4 Mar 2015 05:32:05 +0000 (00:32 -0500)]
cfg80211: Simplify the handling of regulatory indoor setting

Directly update the indoor setting without wrapping it as
a regulatory request, to simplify the processing.

Acked-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211_hwsim: fix beacon timers
Johannes Berg [Tue, 3 Mar 2015 21:09:05 +0000 (22:09 +0100)]
mac80211_hwsim: fix beacon timers

Jouni reported that certain combinations of hwsim test cases failed,
and we found that beaconing was erroneously enabled too early on any
channel switch, which lead to the BI of 2000 TU from the first test
case to leak into the second one, which then didn't beacon properly.

To fix this, set data->beacon_int to zero when all stop beaconing so
that beaconing cannot be started (which was intended as 'restarted')
elsewhere.

Additionally, Jouni found that due to this 'restart' and the beacon
interval handling station interfaces would also have a needlessly
running beacon timer all the time, of course not doing anything.

To also fix the latter case only use the beacon interval when it's
actually needed, i.e. when beaconing gets enabled.

Reported-by: Jouni Malinen <j@w1.fi>
Tested-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomesh_plink: fixup type of timeout to match usage
Nicholas Mc Guire [Mon, 2 Mar 2015 09:54:14 +0000 (04:54 -0500)]
mesh_plink: fixup type of timeout to match usage

timeout was being passed as int but assigned from u32/u16 values and used
as unsigned type. This is really only for better readability.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomesh_plink: use msecs_to_jiffies for proper time conversion
Nicholas Mc Guire [Mon, 2 Mar 2015 09:54:13 +0000 (04:54 -0500)]
mesh_plink: use msecs_to_jiffies for proper time conversion

This is primarily an API consolidation and should make things more readable
it replaces var * HZ / 1000 by msecs_to_jiffies(var) which also handles
corner cases correctly.

There is a change of behavior as e.g. for HZ 100, t * HZ / 1000 will
return 0 for t < 10 but msecs_to_jiffies will return at least 1 always.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: provide station PMF configuration to driver
SenthilKumar Jegadeesan [Mon, 2 Mar 2015 07:59:40 +0000 (13:29 +0530)]
mac80211: provide station PMF configuration to driver

Some device drivers offload part of aggregation including AddBA/DelBA
negotiations to firmware. In such scenario, the PMF configuration of
the station needs to be provided to driver to enable encryption of
AddBA/DelBA action frames.

Signed-off-by: SenthilKumar Jegadeesan <sjegadee@qti.qualcomm.com>
[fix commit log, documentation]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: allow iterating inactive interfaces
Arik Nemtsov [Sun, 1 Mar 2015 07:10:15 +0000 (09:10 +0200)]
mac80211: allow iterating inactive interfaces

Sometimes the driver might want to modify private data in interfaces
that are down. One possible use-case is cleaning up interface state
after HW recovery. Some interfaces that were up before the recovery took
place might be down now, but they might still be "dirty".

Introduce a new iterate_interfaces() API and a new ACTIVE iterator flag.
This way the internal implementation of the both active and inactive
APIs remains the same.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agonl80211: prohibit mixing 'any' and regular wowlan triggers
Johannes Berg [Sun, 1 Mar 2015 07:10:13 +0000 (09:10 +0200)]
nl80211: prohibit mixing 'any' and regular wowlan triggers

If the device supports waking up on 'any' signal - i.e. it continues
operating as usual and wakes up the host on pretty much anything that
happens, then it makes no sense to also configure the more restricted
WoWLAN mode where the device operates more autonomously but also in a
more restricted fashion.

Currently only cw2100 supports both 'any' and other triggers, but it
seems to be broken as it doesn't configure anything to the device, so
we can't currently get into a situation where both even can correctly
be configured. This is about to change (Intel devices are going to
support both and have different behaviour depending on configuration)
so make sure the conflicting modes cannot be configured.

(It seems that cw2100 advertises 'any' and 'disconnect' as a means of
saying that's what it will always do, but that isn't really the way
this API was meant to be used nor does it actually mean anything as
'any' always implies 'disconnect' already, and the driver doesn't
change device configuration in any way depending on the settings.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: check and dequeue skb in ieee80211_tx_prepare_skb()
Johannes Berg [Sun, 1 Mar 2015 07:10:12 +0000 (09:10 +0200)]
mac80211: check and dequeue skb in ieee80211_tx_prepare_skb()

The ieee80211_tx_prepare_skb() function currently entirely ignores
the fact that the SKB that is passed in might be split into more
than one due to fragmentation and doesn't check the list of skbs
that the TX handlers may create. In case this happens, it would
leak them.

Fix this and also don't leave the skb next/prev pointers dangling
pointing to the on-stack sk_buff_head.

Reported-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: remove duplicate check for quiescing when queueing work
Luciano Coelho [Sun, 1 Mar 2015 07:10:10 +0000 (09:10 +0200)]
mac80211: remove duplicate check for quiescing when queueing work

In ieee80211_queue_work() we check if we're quiescing or suspended, so
it's not necessary to check for quiescing before calling this
function.  Remove duplicate checks.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: allow TDLS setup code to take wdev lock
Arik Nemtsov [Sun, 1 Mar 2015 07:10:09 +0000 (09:10 +0200)]
mac80211: allow TDLS setup code to take wdev lock

TDLS off-channel can be allowed in channels marked with GO_CONCURRENT,
provided the device is connected to an AP on the same UNII.
When relaxing the NO-IR requirements for TDLS, we might hit flows in
cfg80211_reg_can_beacon that acquire the wdev lock. Take some measures
to allow this during TDLS setup.
Acquire the RCU read lock later in the flow that invokes
cfg80211_reg_can_beacon.
Avoid taking local->mtx when preparing the setup packet to avoid
circular deadlocks with mac80211 code that is invoked with wdev-mtx
held.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: start queues if driver rejected wowlan
Johannes Berg [Sun, 1 Mar 2015 07:10:08 +0000 (09:10 +0200)]
mac80211: start queues if driver rejected wowlan

If the driver rejects WoWLAN, restart the queues before returning
to cfg80211. cfg80211 will return to mac80211, but not before it
disconnects all interfaces. If we don't start the queues, any of
the packets needed for disconnecting won't be transmitted, which
is strange. Fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: remove useless double check for open_count in __ieee80211_suspend()
Luciano Coelho [Sun, 1 Mar 2015 07:10:07 +0000 (09:10 +0200)]
mac80211: remove useless double check for open_count in __ieee80211_suspend()

We check local->open_count at the top of the __ieee80211_suspend(), so
there's no need to check for it again.  open_count is protected by the
rtnl, so there's no chance for it to have change between the two
calls.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: don't do driver suspend with auth/assoc in progress
Johannes Berg [Sun, 1 Mar 2015 07:10:06 +0000 (09:10 +0200)]
mac80211: don't do driver suspend with auth/assoc in progress

Drivers can't really be expected to suspend properly while auth
or assoc is in progress since then they don't have any state
they could keep with WoWLAN, nor can they actually finish the
authentication or association. In fact, keeping this can cause
subtle issues with drivers like iwlwifi that refuse WoWLAN if
not associated, but have trouble figuring out what's going on
in the middle of association.

In any case, regardless of possible driver issues in this area,
it doesn't make sense for mac80211 to try to WoWLAN-suspend in
the middle of such operations, so stop them before.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: handle drv_add_interface failures properly during reconfig
Luciano Coelho [Sun, 1 Mar 2015 07:10:04 +0000 (09:10 +0200)]
mac80211: handle drv_add_interface failures properly during reconfig

If any interface fails to be added to the driver in during reconfig,
we should remove all the successfully added interfaces and report
reconfig failure, so things can be cleaned up properly.  Failing to do
so can lead to subsequent failures and leave the drivers in a messed
up state.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: fix another suspend vs. association race
Johannes Berg [Sun, 1 Mar 2015 07:10:03 +0000 (09:10 +0200)]
mac80211: fix another suspend vs. association race

Since cfg80211 disconnects, but has no insight into the association
process, it can happen that it disconnects while association is in
progress. We then try to abort association in mac80211, but this is
only later so the association can complete between the two.

This results in removing an interface from the driver while bound
to the channel context, obviously causing confusion and issues.

Solve this by also checking if we're associated during quiesce and
if so deauthenticating. The frame will no longer go out to the AP
which is a bit unfortunate, but it'll resolve the crash (and before
we would have suspended without telling the AP as well.)

I'm working on a better, but more complex solution as well, which
should avoid that problem.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: TDLS: support VHT between peers
Arik Nemtsov [Sun, 1 Mar 2015 07:10:02 +0000 (09:10 +0200)]
mac80211: TDLS: support VHT between peers

Add the AID and VHT-cap/operation IEs during TDLS setup. Remove the
block of TDLS peers when setting HT-caps of the peer station.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: add operating classes 128-130
Eliad Peller [Sun, 1 Mar 2015 07:10:01 +0000 (09:10 +0200)]
cfg80211: add operating classes 128-130

Operating classes 128-130 are defined in the 11ac
spec for the 5GHz band.

Update ieee80211_operating_class_to_band() to support them.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: Update beacon's timing and DTIM count on every beacon
Alexander Bondar [Sun, 1 Mar 2015 07:10:00 +0000 (09:10 +0200)]
mac80211: Update beacon's timing and DTIM count on every beacon

Beacon's timestamp, device system time associated with this beacon and
DTIM count parameters are not updated in the associated vif context
if the latest beacon's content is identical to the previously received.
It make sense to update these changing parameters on every beacon so the
driver can get most updated values. This may be necessary, for example,
to avoid either beacons' drift effect or device time stamp overrun.
IMPORTANT: Three sync_* parameters - sync_ts, sync_device_ts and
sync_dtim_count would possibly be out of sync by the time the driver will
use them. The synchronized view is currently guaranteed only in certain
callbacks.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agonl80211: add notes about userspace API/ABI modifications
Johannes Berg [Fri, 27 Feb 2015 14:32:43 +0000 (15:32 +0100)]
nl80211: add notes about userspace API/ABI modifications

Add notes about userspace ABI/API modifications, including the
fact that we decided that API submissions should come with a
driver implementation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211_hwsim: Add minimal capability for vendor command/event testing
Jouni Malinen [Thu, 26 Feb 2015 13:26:54 +0000 (15:26 +0200)]
mac80211_hwsim: Add minimal capability for vendor command/event testing

This allows wpa_supplicant/hostapd to send a vendor command and verify
response to that command and a vendor event.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: Allow NL80211_ATTR_IFINDEX to be added to vendor events
Ahmad Kholaif [Thu, 26 Feb 2015 13:26:53 +0000 (15:26 +0200)]
cfg80211: Allow NL80211_ATTR_IFINDEX to be added to vendor events

This modifies cfg80211_vendor_event_alloc() with an additional argument
struct wireless_dev *wdev. __cfg80211_alloc_event_skb() is modified to
take in *wdev argument, if wdev != NULL, both the NL80211_ATTR_IFINDEX
and wdev identifier are added to the vendor event.

These changes make it easier for drivers to add ifindex indication in
vendor events cleanly.

This also updates all existing users of cfg80211_vendor_event_alloc()
and __cfg80211_alloc_event_skb() in the kernel tree.

Signed-off-by: Ahmad Kholaif <akholaif@qca.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: add VHT support for IBSS
Janusz.Dziedzic@tieto.com [Sat, 21 Feb 2015 15:52:39 +0000 (16:52 +0100)]
cfg80211: add VHT support for IBSS

Add NL80211_EXT_FEATURE_VHT_IBSS flag and VHT
support for IBSS.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: add bss_type and privacy arguments in cfg80211_get_bss()
Dedy Lansky [Sun, 8 Feb 2015 13:52:03 +0000 (15:52 +0200)]
cfg80211: add bss_type and privacy arguments in cfg80211_get_bss()

802.11ad adds new a network type (PBSS) and changes the capability
field interpretation for the DMG (60G) band.
The same 2 bits that were interpreted as "ESS" and "IBSS" before are
re-used as a 2-bit field with 3 valid values (and 1 reserved). Valid
values are: "IBSS", "PBSS" (new) and "AP".

In order to get the BSS struct for the new PBSS networks, change the
cfg80211_get_bss() function to take a new enum ieee80211_bss_type
argument with the valid network types, as "capa_mask" and "capa_val"
no longer work correctly (the search must be band-aware now.)

The remaining bits in "capa_mask" and "capa_val" are used only for
privacy matching so replace those two with a privacy enum as well.

Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
[rewrite commit log, tiny fixes]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211-wext: return -E2BIG when buffer can't hold full BSS entry
James Minor [Tue, 24 Feb 2015 18:58:20 +0000 (12:58 -0600)]
cfg80211-wext: return -E2BIG when buffer can't hold full BSS entry

When using the wext compatibility code in cfg80211, part of the IEs
can be truncated if the passed user buffer is large enough for part
of the BSS but not large enough for all of the IEs.  This can cause
an EAP network to show up as a PSK network.

Always return -E2BIG in this case to avoid truncating data.

Since this changes the control flow, use an on-stack variable for
a small buffer instead of allocating it.

Signed-off-by: James Minor <james.minor@ni.com>
[rework patch to error out immediately, use _check wrappers]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agowext: add checked wrappers for adding events/points to streams
Johannes Berg [Wed, 25 Feb 2015 09:54:33 +0000 (10:54 +0100)]
wext: add checked wrappers for adding events/points to streams

These checked wrappers are necessary for the next patch, which
will use them to avoid sending out partial scan results.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: remove TX latency measurement code
Johannes Berg [Wed, 25 Feb 2015 09:03:25 +0000 (10:03 +0100)]
mac80211: remove TX latency measurement code

Revert commit ad38bfc916da ("mac80211: Tx frame latency statistics")
(along with some follow-up fixes).

This code turned out not to be as useful in the current form as we
thought, and we've internally hacked it up more, but that's not
very suitable for upstream (for now), and we might just do that
with tracing instead.

Therefore, for now at least, remove this code. We might also need
to use the skb->tstamp field for the TCP performance issue, which
is more important than the debugging.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agonl/mac80211: allow zero plink timeout to disable STA expiration
Masashi Honma [Tue, 24 Feb 2015 13:42:16 +0000 (22:42 +0900)]
nl/mac80211: allow zero plink timeout to disable STA expiration

Both wpa_supplicant and mac80211 have and inactivity timer. By default
wpa_supplicant will be timed out in 5 minutes and mac80211's it is 30
minutes. If wpa_supplicant uses a longer timer than mac80211, it will
get unexpected disconnection by mac80211.

Using 0xffffffff instead as the configured value could solve this w/o
changing the code, but due to integer overflow in the expression used
this doesn't work. The expression is:

(current jiffies) > (frame Rx jiffies + NL80211_MESHCONF_PLINK_TIMEOUT * 250)

On 32bit system, the right side would overflow and be a very small
value if NL80211_MESHCONF_PLINK_TIMEOUT is sufficiently large,
causing unexpectedly early disconnections.

Instead allow disabling the inactivity timer to avoid this situation,
by passing the (previously invalid and useless) value 0.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
[reword/rewrap commit log]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211_hwsim: support any address in userspace
Bob Copeland [Tue, 24 Feb 2015 13:39:44 +0000 (08:39 -0500)]
mac80211_hwsim: support any address in userspace

Due to the checks in get_hwsim_data_ref_from_addr, wmediumd
was only able to use the second mac address (those starting with
0x42).  This is confusing and needlessly limiting, so allow any
configured address.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211-wext: export symbols only when needed
Johannes Berg [Tue, 6 Jan 2015 13:00:53 +0000 (14:00 +0100)]
cfg80211-wext: export symbols only when needed

When a fully converted cfg80211 driver needs cfg80211-wext for
userspace API purposes, the symbols need not be exported. When
other drivers (orinoco/hermes or ipw2200) are enabled, they do
need the symbols exported as they use them directly.

Make those drivers select a new CFG80211_WEXT_EXPORT Kconfig
symbol (instead of just CFG80211_WEXT) and export the functions
only if requested - this saves about 1/2k due to the size of
EXPORT_SYMBOL() itself.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: iterate using station list in AP SMPS
Johannes Berg [Fri, 13 Feb 2015 20:31:07 +0000 (21:31 +0100)]
mac80211: iterate using station list in AP SMPS

When changing AP SMPS, we need to look up all the stations
for this interface, so there's no reason to iterate over
hash chains rather than doing the simpler iteration over
the station list.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: don't look up stations for multicast addresses
Johannes Berg [Mon, 23 Feb 2015 23:28:18 +0000 (00:28 +0100)]
mac80211: don't look up stations for multicast addresses

Since multicast addresses don't exist as stations, don't attempt
to look them up in the hashtable on TX.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agobridge: add vlan info to bridge setlink and dellink notification messages
Roopa Prabhu [Sun, 22 Feb 2015 04:21:51 +0000 (20:21 -0800)]
bridge: add vlan info to bridge setlink and dellink notification messages

vlan add/deletes are not notified to userspace today. This patch adds
vlan info to bridge newlink/dellink notifications generated from the
bridge driver. Notifications use the RTEXT_FILTER_BRVLAN_COMPRESSED
flag to compress vlans into ranges whereever applicable.

The size calculations does not take ranges into account for
simplicity.  This has the potential for allocating a larger skb than
required.

There is an existing inconsistency with bridge NEWLINK and DELLINK
change notifications. Both generate NEWLINK notifications.  Since its
always a NEWLINK notification, this patch includes all vlans the port
belongs to in the notification. The NEWLINK and DELLINK request
messages however only include the vlans to be added and deleted.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: __aligned(size) is preferred over __attribute__((aligned(size)))
Ameen Ali [Sun, 22 Feb 2015 21:40:36 +0000 (23:40 +0200)]
net: __aligned(size) is preferred over __attribute__((aligned(size)))

Signed-off-by: Ameen Ali <AmeenAli023@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobatman-adv: Fix use of seq_has_overflowed()
Joe Perches [Sun, 22 Feb 2015 21:47:56 +0000 (13:47 -0800)]
batman-adv: Fix use of seq_has_overflowed()

net-next commit 6d91147d183c ("batman-adv: Remove uses of return value
of seq_printf") incorrectly changed the overflow occurred return from
-1 to 1.  Change it back so that the test of batadv_write_buffer_text's
return value in batadv_gw_client_seq_print_text works properly.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: Remove state argument from skb_find_text()
Bojan Prtvar [Sun, 22 Feb 2015 10:46:35 +0000 (11:46 +0100)]
net: Remove state argument from skb_find_text()

Although it is clear that textsearch state is intentionally passed to
skb_find_text() as uninitialized argument, it was never used by the
callers. Therefore, we can simplify skb_find_text() by making it
local variable.

Signed-off-by: Bojan Prtvar <prtvar.b@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoethtool: use "ops" name consistenty in ethtool_set_rxfh()
Dan Carpenter [Fri, 20 Feb 2015 10:54:05 +0000 (13:54 +0300)]
ethtool: use "ops" name consistenty in ethtool_set_rxfh()

"dev->ethtool_ops" and "ops" are the same, but we should use "ops"
everywhere to be consistent.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoipv6: Replace "#include <asm/uaccess>" with "#include <linux/uaccess>"
Alex W Slater [Thu, 19 Feb 2015 21:58:07 +0000 (21:58 +0000)]
ipv6: Replace "#include <asm/uaccess>" with "#include <linux/uaccess>"

Fix checkpatch.pl warning "Use #include <linux/uaccess.h> instead of <asm/uaccess.h>"

Signed-off-by: Alex W Slater <alex.slater.dev@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'bna-next'
David S. Miller [Sun, 22 Feb 2015 03:05:30 +0000 (22:05 -0500)]
Merge branch 'bna-next'

Rasesh Mody says:

====================
bna: Update the Driver and Firmware Version

These patches re-brands the BNA driver to QLogic. The patches update the BNA
driver version to 3.2.25.1 and firmware version to 3.2.5.1.

The patches are tested against 3.19.0.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobna: Update the Driver and Firmware Version
Rasesh Mody [Thu, 19 Feb 2015 21:02:32 +0000 (16:02 -0500)]
bna: Update the Driver and Firmware Version

This patch updates the BNA driver version to 3.2.25.1 and the firmware version
to 3.2.5.1

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobna: QLogic BR-series Adapters Driver Rebranding
Rasesh Mody [Thu, 19 Feb 2015 21:02:31 +0000 (16:02 -0500)]
bna: QLogic BR-series Adapters Driver Rebranding

Re-brand the BNA driver to QLogic.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agosunvnet: failed trigger should not cause BUG_ON()
David L Stevens [Thu, 19 Feb 2015 18:15:49 +0000 (13:15 -0500)]
sunvnet: failed trigger should not cause BUG_ON()

An error return from __vnet_tx_trigger() sets the TX descriptor to
VIO_DESC_FREE while leaving port->tx_bufs[txi].skb set. This leads
to a BUG_ON() the next time this descriptor is used.

This patch frees the pending skb when getting a trigger error to
match the VIO_DESC_FREE state.

Signed-off-by: David L Stevens <david.stevens@oracle.com>
Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobonding: simple code refactor
Mahesh Bandewar [Thu, 19 Feb 2015 18:13:25 +0000 (10:13 -0800)]
bonding: simple code refactor

Remove duplicate code.

Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: macb: Add big endian CPU support
Arun Chandran [Wed, 18 Feb 2015 11:29:35 +0000 (16:59 +0530)]
net: macb: Add big endian CPU support

This patch converts all __raw_readl and __raw_writel function calls
to their corresponding readl_relaxed and writel_relaxed variants.

It also tells the driver to set ahb_endian_swp_mgmt_en bit in dma_cfg
when the CPU is configured in big endian mode.

Signed-off-by: Arun Chandran <achandran@mvista.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'bnx2x-next'
David S. Miller [Fri, 20 Feb 2015 20:46:55 +0000 (15:46 -0500)]
Merge branch 'bnx2x-next'

Rasesh Mody says:

====================
bnx2-cnic: Driver Version Upgrades

This patch set includes bnx2 and cnic drivers' re-branding changes, fix for a
chip initialization issue and updates the bnx2 driver version to 2.2.6 and
cnic driver version to 2.5.21.

Please apply these patches to net-next.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobnx2-cnic: Driver Version Update
Rasesh Mody [Wed, 18 Feb 2015 00:26:20 +0000 (19:26 -0500)]
bnx2-cnic: Driver Version Update

This patch updates BNX2 driver version to 2.2.6 and CNIC driver version
to 2.5.21.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobnx2: Fix for Chip Initialization
Rasesh Mody [Wed, 18 Feb 2015 00:26:19 +0000 (19:26 -0500)]
bnx2: Fix for Chip Initialization

Do not enable filter SORT MODE in chip init routine. This patch addresses an
issue where BCM5716 sporadically drops packets when changing multicast list.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobnx2-cnic: Driver Rebranding Changes
Rasesh Mody [Wed, 18 Feb 2015 00:26:18 +0000 (19:26 -0500)]
bnx2-cnic: Driver Rebranding Changes

This patch provides additional changes as a part of BNX2 and CNIC driver
re-branding effort.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoigmp: add __ip_mc_{join|leave}_group()
Eric Dumazet [Tue, 17 Feb 2015 11:19:24 +0000 (03:19 -0800)]
igmp: add __ip_mc_{join|leave}_group()

There is a need to perform igmp join/leave operations while RTNL is
held.

Make ip_mc_{join|leave}_group() wrappers around
__ip_mc_{join|leave}_group() to avoid the proliferation of work queues.

For example, vxlan_igmp_join() could possibly be removed.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agohso: always read interface number from the current altsetting
Aleksander Morgado [Tue, 17 Feb 2015 10:31:29 +0000 (11:31 +0100)]
hso: always read interface number from the current altsetting

Always read bInterfaceNumber from the current altsetting, not from the first one
available in the altsetting array. This is coming from code review, not related
to any specific bug.

Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'ppc_bpf'
David S. Miller [Fri, 20 Feb 2015 20:19:56 +0000 (15:19 -0500)]
Merge branch 'ppc_bpf'

Denis Kirjanov says:

====================
bpf: Enable BPF JIT on ppc32

This patch series enables BPF JIT on ppc32. There are relatevily
few chnages in the code to make it work.

All test_bpf tests passed both on 7447a and P2041-based machines.

Changelog:
v1 - > v2: Reordered Kconfig patch in the series
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoppc: Kconfig: Enable BPF JIT on ppc32
Denis Kirjanov [Tue, 17 Feb 2015 07:04:43 +0000 (10:04 +0300)]
ppc: Kconfig: Enable BPF JIT on ppc32

Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoppc: bpf: Add SKF_AD_CPU for ppc32
Denis Kirjanov [Tue, 17 Feb 2015 07:04:42 +0000 (10:04 +0300)]
ppc: bpf: Add SKF_AD_CPU for ppc32

Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoppc: bpf: rename bpf_jit_64.S to bpf_jit_asm.S
Denis Kirjanov [Tue, 17 Feb 2015 07:04:41 +0000 (10:04 +0300)]
ppc: bpf: rename bpf_jit_64.S to bpf_jit_asm.S

Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoppc: bpf: update jit to use compatibility macros
Denis Kirjanov [Tue, 17 Feb 2015 07:04:40 +0000 (10:04 +0300)]
ppc: bpf: update jit to use compatibility macros

Use helpers from the asm-compat.h to wrap up assembly mnemonics

Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoppc: bpf: add reqired opcodes for ppc32
Denis Kirjanov [Tue, 17 Feb 2015 07:04:39 +0000 (10:04 +0300)]
ppc: bpf: add reqired opcodes for ppc32

Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoppc: bpf: add required compatibility macros for jit
Denis Kirjanov [Tue, 17 Feb 2015 07:04:38 +0000 (10:04 +0300)]
ppc: bpf: add required compatibility macros for jit

Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobatman-adv: Remove uses of return value of seq_printf
Joe Perches [Tue, 17 Feb 2015 01:31:39 +0000 (17:31 -0800)]
batman-adv: Remove uses of return value of seq_printf

This function is soon going to return void so remove the
return value use.

Convert the return value to test seq_has_overflowed() instead.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Antonio Quartulli <antonio@meshcoding.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotcp: silence registration message
stephen hemminger [Mon, 16 Feb 2015 14:38:13 +0000 (09:38 -0500)]
tcp: silence registration message

This message isn't really needed it justs waits time/space.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'be2net-next'
David S. Miller [Fri, 20 Feb 2015 19:07:02 +0000 (14:07 -0500)]
Merge branch 'be2net-next'

Sriharsha Basavapatna says:

====================
be2net patch-set

This patch set contains a few code refactoring changes to make it easy to
support new TX WRB formats in future ASICs. Please consider applying it to
net-next tree.

Patch 1: Refactors chip specific code to setup tx wrb into a separate routine.
Patch 2: Refactors tx enqueue function to remove a bit of duplicate code and
 improves wrb setup steps.
Patch 3: Minor refactoring in tx compl to limit CQE accesses to 1 routine.
Patch 4: Adds a few inline functions.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobe2net: Add a few inline functions to test TXQ conditions
Sriharsha Basavapatna [Mon, 16 Feb 2015 02:33:48 +0000 (08:03 +0530)]
be2net: Add a few inline functions to test TXQ conditions

- Check qfull condition
- Check qwake condition
- Check pkts pending completion

Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobe2net: Minor code cleanup in tx completion process
Sriharsha Basavapatna [Mon, 16 Feb 2015 02:33:47 +0000 (08:03 +0530)]
be2net: Minor code cleanup in tx completion process

- To avoid multiple accesses to CQE, extract compl_status and end_idx from
  be_tx_compl_get().

Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobe2net: Refactor be_xmit_enqueue() routine
Sriharsha Basavapatna [Mon, 16 Feb 2015 02:33:46 +0000 (08:03 +0530)]
be2net: Refactor be_xmit_enqueue() routine

- Reduce code duplication by moving WRB-frags setup into a function.
- Do not setup WRB-header before frags are setup, which is unncessary if
  there's errors while setting up frags. We should only grab an entry for
  the header, setup the frags and if everything is fine setup the header.
- The error cleanup can be moved into a small function.

Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobe2net: Refactor wrb_fill_hdr() routine
Sriharsha Basavapatna [Mon, 16 Feb 2015 02:33:45 +0000 (08:03 +0530)]
be2net: Refactor wrb_fill_hdr() routine

The WRB header is setup by wrb_fill_hdr() routine. This routine currently
gets some of the WRB params as args and figures out rest of the WRB params
by looking at various fields in skb (like gso, checksum, vlan-tag etc).
All these params could instead be retrieved from the skb into a structure
and passed to this routine. This separates wrb_fill_hdr() to only provide
chip-specific code to fill the WRB. This also makes it simple to support
chips with different WRB formats.

Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'mv88e6171_indirect_phy'
David S. Miller [Thu, 19 Feb 2015 20:52:33 +0000 (15:52 -0500)]
Merge branch 'mv88e6171_indirect_phy'

Andrew Lunn says:

====================
Indirect phy access for mv88e6171

These two patches allow the mv88e6171 driver to access the port phys
using indirect addressing. Depending on pin strapping, the switch
either uses a single address on the host MDIO bus, requiring the port
phys are accessed indirectly, or the switch uses a number of addresses
on the host bus and the phys can be directly accessed.

The 370RD, the first supported platform to use the 6171 uses multiple
addresses, so this indirect mode was not required. However the
WRT1900AC has the switch configured to use a single address, and so
indirect access is needed.

The mv88e6352 already has all the needed code. Refactor it into the
shared mv88e6xxx and then use it in the mv88e6171 driver.

Tested on the 370RD and WRT1900AC.

It would be good if Guenter Roeck could test on his platform to ensure
i've not broken anything for the mv88e6352.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: dsa: mv88e6171: Enable access to phys via internal mdio bus
Andrew Lunn [Sat, 14 Feb 2015 18:17:51 +0000 (19:17 +0100)]
net: dsa: mv88e6171: Enable access to phys via internal mdio bus

When the device is configured to use single chip addressing mode, the
phy devices of the port are not accessible on the host MDIO
bus. Instead the switch internal MDIO bus must be used. For this to
work, the phy polling unit must be enabled.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: dsa: mv88e6352: Refactor shareable code
Andrew Lunn [Sat, 14 Feb 2015 18:17:50 +0000 (19:17 +0100)]
net: dsa: mv88e6352: Refactor shareable code

The mv88e6352 allows access to the port phys via an internal mdio bus
which is accessed using registers in the GLOBAL 2 range. The mv88e6171
and probably other devices use the same mechanism. Move this code into
the shared mv88e6xxx.c library.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: eth: altera: Change reset_mac failure message masks from err to dbg
Vince Bridgers [Thu, 12 Feb 2015 16:47:45 +0000 (10:47 -0600)]
net: eth: altera: Change reset_mac failure message masks from err to dbg

This debug output is not really an error message since mac reset can fail
if the phy clocks are gated, specifically when the phy has been placed in
a powered down or isolation mode. The netdev output masks were changed from
err to dbg, and comments added in the code.

Signed-off-by: Vince Bridgers <vbridger@opensource.altera.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: eth: altera: Change access ports to mdio for all xMII applications
Vince Bridgers [Thu, 12 Feb 2015 16:47:33 +0000 (10:47 -0600)]
net: eth: altera: Change access ports to mdio for all xMII applications

Change use of Altera TSE's MDIO access from phy 0 registers to phy 1
registers. This allows support for GMII, MII, RGMII, and SGMII
designs where the external PHY is always accesible through
Altera TSE's MDIO phy 1 registers and Altera's PCS is accessible
through MDIO phy 0 registers for SGMII applications.

Signed-off-by: Vince Bridgers <vbridger@opensource.altera.com>
Tested-by: Kai Lin Ng <kailng@altera.com>
Tested-by: Dalon Westergreen <dwesterg@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'r8152-next'
David S. Miller [Thu, 19 Feb 2015 20:08:47 +0000 (15:08 -0500)]
Merge branch 'r8152-next'

Hayes Wang says:

====================
Adjust the settings about USB_RX_EARLY_AGG

v2:
For patch #1, replace

u32 ocp_data;
ocp_data = tp->coalesce / 8;

with

u32 ocp_data = tp->coalesce / 8;

And replace

struct net_device *dev = tp->netdev;
u32 ocp_data;
ocp_data = (agg_buf_sz - dev->mtu - VLAN_ETH_HLEN - VLAN_HLEN) / 4;

with

u32 mtu = tp->netdev->mtu;
u32 ocp_data = (agg_buf_sz - mtu - VLAN_ETH_HLEN - VLAN_HLEN) / 4;

Use *switch* statement to replace the checking of *if*.

v1:
The USB_RX_EARLY_AGG contains timeout and size. Separate them, and
they could be set independently. Then, the ethtool could be used to
change the timeout according to situation of the platform.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agor8152: support setting rx coalesce
hayeswang [Thu, 12 Feb 2015 06:33:48 +0000 (14:33 +0800)]
r8152: support setting rx coalesce

Support setting the rx coalesce. Then someone could change the rx
agg timeout value through ethtool.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agor8152: change rx early size when the mtu is changed
hayeswang [Thu, 12 Feb 2015 06:33:47 +0000 (14:33 +0800)]
r8152: change rx early size when the mtu is changed

The rx early size is calculated with the mtu, so it has to be
re-calculated when the mtu is changed.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>