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>
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>
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>
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>
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>
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>
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>
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.
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>
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>
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>
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>
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>
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.
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>
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.
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.
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>
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>
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.
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.
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>
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.
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>
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.
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>
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>
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>
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.
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>
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>
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:
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
1) Missing netlink attribute validation in nft_lookup, from Patrick
McHardy.
2) Restrict ipv6 partial checksum handling to UDP, since that's the
only case it works for. From Vlad Yasevich.
3) Clear out silly device table sentinal macros used by SSB and BCMA
drivers. From Joe Perches.
4) Make sure the remote checksum code never creates a situation where
the remote checksum is applied yet the tunneling metadata describing
the remote checksum transformation is still present. Otherwise an
external entity might see this and apply the checksum again. From
Tom Herbert.
5) Use msecs_to_jiffies() where applicable, from Nicholas Mc Guire.
6) Don't explicitly initialize timer struct fields, use setup_timer()
and mod_timer() instead. From Vaishali Thakkar.
7) Don't invoke tg3_halt() without the tp->lock held, from Jun'ichi
Nomura.
8) Missing __percpu annotation in ipvlan driver, from Eric Dumazet.
9) Don't potentially perform skb_get() on shared skbs, also from Eric
Dumazet.
10) Fix COW'ing of metrics for non-DST_HOST routes in ipv6, from Martin
KaFai Lau.
11) Fix merge resolution error between the iov_iter changes in vhost and
some bug fixes that occurred at the same time. From Jason Wang.
12) If rtnl_configure_link() fails we have to perform a call to
->dellink() before unregistering the device. From WANG Cong.
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (39 commits)
net: dsa: Set valid phy interface type
rtnetlink: call ->dellink on failure when ->newlink exists
com20020-pci: add support for eae single card
vhost_net: fix wrong iter offset when setting number of buffers
net: spelling fixes
net/core: Fix warning while make xmldocs caused by dev.c
net: phy: micrel: disable NAND-tree for KSZ8021, KSZ8031, KSZ8051, KSZ8081
ipv6: fix ipv6_cow_metrics for non DST_HOST case
openvswitch: Fix key serialization.
r8152: restore hw settings
hso: fix rx parsing logic when skb allocation fails
tcp: make sure skb is not shared before using skb_get()
bridge: netfilter: Move sysctl-specific error code inside #ifdef
ipv6: fix possible deadlock in ip6_fl_purge / ip6_fl_gc
ipvlan: add a missing __percpu pcpu_stats
tg3: Hold tp->lock before calling tg3_halt() from tg3_init_one()
bgmac: fix device initialization on Northstar SoCs (condition typo)
qlcnic: Delete existing multicast MAC list before adding new
net/mlx5_core: Fix configuration of log_uar_page_sz
sunvnet: don't change gso data on clones
...
Linus Torvalds [Wed, 18 Feb 2015 01:34:21 +0000 (17:34 -0800)]
Merge tag 'md/3.20-fixes' of git://neil.brown.name/md
Pull md bugfixes from Neil Brown:
"Three bug md fixes for 3.20
yet-another-livelock in raid5, and a problem with write errors to
4K-block devices"
* tag 'md/3.20-fixes' of git://neil.brown.name/md:
md/raid5: Fix livelock when array is both resyncing and degraded.
md/raid10: round up to bdev_logical_block_size in narrow_write_error.
md/raid1: round up to bdev_logical_block_size in narrow_write_error
Linus Torvalds [Wed, 18 Feb 2015 01:03:07 +0000 (17:03 -0800)]
Merge tag 'please-pull-fixmcelog' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras
Pull mcelog regression fix from Tony Luck:
"Fix regression - functions on the mce notifier chain should not be
able to decide that an event should not be logged"
* tag 'please-pull-fixmcelog' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
x86/mce: Fix regression. All error records should report via /dev/mcelog