Commit Graph

218005 Commits

Author SHA1 Message Date
Andrew Turner
a70475ca42 Fix ISS_DATA_DFSC_MASK, it should include all bits in the field. 2016-11-28 14:24:07 +00:00
Adrian Chadd
908341abeb [ath] wake up the hardware from power-save before doing transmit completion checking.
This was being done in the pre-AR9380 case, but not for AR9380 and later.
When powersave in STA mode is enabled, this may have lead to the transmit
completion code doing this:

* call the task, which doesn't wake up the hardware
* complete the frames, which doesn't touch the hardware
* schedule pending frames on the hardware queue, which DOES touch the
  hardware, and this will be ignored

This would show up in the logs like this:

(with debugging enabled):
Nov 27 23:03:56 lovelace kernel: Q1[  0] (nseg=1) (DS.V:0xfffffe011bd57300 DS.P:0x49b57300) I: 168cc117 L:00000000 F:0005
...
(in general, doesn't require debugging enabled):
Nov 27 23:03:56 lovelace kernel: ath_hal_reg_write: reg=0x00000804, val=0x49b57300, pm=2

That register is a EDMA TX FIFO register (queue 1), and the val is the descriptor
being written.

Whilst here, make sure the software queue gets kicked here.

Tested;

* AR9485, STA mode + powersave
2016-11-28 08:13:20 +00:00
Sepherosa Ziehau
5e61edf60e hyperv/vmbus: Use poll/cancel APIs to wait for the CHOPEN response.
Since hypervisor does not respond CHOPEN to a revoked channel.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8636
2016-11-28 07:56:03 +00:00
Sepherosa Ziehau
2ee4e46fe6 hyperv/vmbus: Add exec cancel support for message Hypercall API.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8635
2016-11-28 07:44:50 +00:00
Xin LI
9a913ec291 Plug another leak with malformed IPv6 address.
MFC after:	2 weeks
2016-11-28 07:41:01 +00:00
Sepherosa Ziehau
2fb45c54a1 hyperv/vmbus: Add result polling support for message Hypercall API.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8634
2016-11-28 07:36:51 +00:00
Xin LI
203632f263 Don't leak 'str' when we see a malformed IPv6 address.
MFC after:	2 weeks
2016-11-28 07:33:26 +00:00
Sepherosa Ziehau
1b34e69534 hyperv/vmbus: Add result polling support for xact API.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8633
2016-11-28 07:27:08 +00:00
Xin LI
4dceaf94fa style(9).
MFC after:	2 weeks
2016-11-28 07:21:09 +00:00
Xin LI
305de00ec4 Plug a potential memory leak.
MFC after:	2 weeks
2016-11-28 07:19:45 +00:00
Sepherosa Ziehau
6555f01eec hyperv/vmbus: Stringent GPADL parameter assertion.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8632
2016-11-28 07:04:32 +00:00
Sepherosa Ziehau
fa643a5d0a hyperv/vmbus: Make sure that the allocated GPADL is not zero.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8631
2016-11-28 06:53:00 +00:00
Sepherosa Ziehau
afd4971b7b hyperv/hn: Simplify RSS indirect table fixup API
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8630
2016-11-28 06:40:26 +00:00
Xin LI
3611de44ef pages and psize are always assigned, so there is no need to initialize
them as zero.

MFC after:	2 weeks
2016-11-28 06:38:41 +00:00
Xin LI
c514c3ed4f Eliminate variables that are computed, assigned but never
used.

MFC after:	2 weeks
2016-11-28 06:36:10 +00:00
Xin LI
665d2db378 Fix an obvious typo.
MFC after:	2 weeks
2016-11-28 06:32:05 +00:00
Sepherosa Ziehau
aa1a2adc92 hyperv/hn: Fix vmbus_chan_subidx usage.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8629
2016-11-28 06:10:41 +00:00
Sepherosa Ziehau
fa915c4d20 hyperv/hn: Enable multi-packet RNDIS message support by default.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8621
2016-11-28 05:54:20 +00:00
Sepherosa Ziehau
71e8ac5696 hyperv/hn: Fix attach error handling
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8620
2016-11-28 05:46:00 +00:00
Sepherosa Ziehau
a4364cfea9 hyperv/hn: Fix multi-packet RNDIS message aggregation size setting.
Just in case that no chimney sending buffer can be used.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8619
2016-11-28 05:31:36 +00:00
Sepherosa Ziehau
2494d735e2 hyperv/hn: Fix detach error handling.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8613
2016-11-28 05:23:57 +00:00
Sepherosa Ziehau
f6f2e0ce38 hyperv/hn: Utilize vmbus_chan_xact_wait
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8612
2016-11-28 05:15:28 +00:00
Sepherosa Ziehau
a54152eaa5 hyperv/vmbus: Add supportive transaction wait function.
This function supports channel revocation properly.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8611
2016-11-28 05:07:48 +00:00
Sepherosa Ziehau
faaba341e5 hyperv/vmbus: Zero out GPADL if error happens.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8601
2016-11-28 04:53:36 +00:00
Adrian Chadd
0ffc652e9e [ath] fix target beacon interval programming for STA mode when in powersave.
This bug has been bugging me for quite some time.  I finally sat down
with enough coffee to figure it out.

The short of it - rounding up to the next intval multiple of the TSF value
only works if the AP is transmitting all its beacons on an interval of
the TSF.  If it isn't - for example, doing staggered beacons on a multi-VAP
setup with a single hardware TSF - then weird things occur.

The long of it -

When powersave is enabled, the MAC and PHY are partially powered off.
They can't receive any packets (or transmit, for that matter.)
The target beacon timer programming will wake up the MAC/PHY just before
the beacon is supposed to be received (well, strictly speaking, at DTIM
so it can see the TIM - traffic information map - telling the STA whether
any traffic is there for it) and it happens automatically.

However, this relies on the target beacon time being programmed correctly.
If it isn't then the hardware will wake up and not hear any beacons -
and then it'll be asleep for said beacons.  After enough of this, net80211
will give up and assume the AP went away.

This should fix both TSFOOR interrupts and disconnects from APs with powersave
enabled.

The annoying bit is that it only happens if APs stagger things or start
on a non-zero TSF.  So, this would sometimes be fine and sometimes not be
fine.

What:

* I don't know (yet) why the code rounds up to the next intval.
  For now, just disable rounding it and trust the value we get.

TODO:

* If we do see a beacon miss in STA mode then we should transition
  out of sleep for a while so we can hear beacons to resync against.
  I'd love a patch from someone to enable that particular behaviour.
  Note - that doesn't require that net80211 brings the chip out of
  sleep state - only that we wake the chip up through to full-on and
  then let it go to sleep again when we've seen a beacon.  The wifi
  stack and AP can still completely just stay believing we're in sleep
  mode.

Tested:

* AR9485, STA mode, powersave enabled

MFC after:	1 week
Relnotes:	Yes
2016-11-28 02:59:33 +00:00
Adrian Chadd
dc87d07103 [ath] include logging of TU versions of the TSF values.
The beacon programming side of things deals in TUs and 1/8th TUs, so
it's good to se the TU value here when debugging beaconing issues.
2016-11-28 02:51:55 +00:00
Pedro F. Giffuni
350fcdd5df indent(1): Properly handle the wide string literal and wide char constant L.
indent(1) treated the "L" in "L'a'" as if it were an identifier and forced
a space character after it, breaking valid code.

PR:		143090
MFC after:	2 weeks
2016-11-27 20:38:14 +00:00
Pedro F. Giffuni
6daffe6ebf indent(1): fix regression introduced in r303596.
Multi-line comments are always block comments in KNF. Restore properly,
handling the case when a long one-liner gets wrapped and becomes a
multi-line comment.

Obtained from:	Piotr Stefaniak
2016-11-27 20:30:09 +00:00
Pedro F. Giffuni
743210efd6 indent(1): minor off-by-one error.
This was introduced in r303571.

Obtianed from:	Piotr Stefaniak
2016-11-27 20:11:55 +00:00
Baptiste Daroussin
8ecd7189a4 Properly initialize nextp
MFC after:	1 day
2016-11-27 19:27:13 +00:00
Adrian Chadd
5566fb10ee [ath] Begin to lay the groundwork for btcoex related ioctl controls. 2016-11-27 18:34:29 +00:00
Andriy Voskoboinyk
935b4fcccd rsu: add support for hardware multicast filter setup.
The algorithm is the same as in rtwn(4).

Tested with Asus USB-N10 (STA) + RTL8188CUS (AP).
2016-11-27 18:06:03 +00:00
Dimitry Andric
6908adc31d Add a few missed clang 3.9.0 files to OptionalObsoleteFiles.
X-MFC-With:	309149
2016-11-27 14:19:19 +00:00
Hans Petter Selasky
c0f71e317b Fix spelling. 2016-11-27 12:04:54 +00:00
Andriy Voskoboinyk
5dbbb84e42 rsu: various scanning fixes.
- Set IEEE80211_FEXT_SCAN_OFFLOAD flag; firmware can send null data
frames when associated.
- Check IEEE80211_SCAN_ACTIVE scan flag instead of IEEE80211_F_ASCAN
ic flag; the last is never set since r170530.
- Eliminate software scan (net80211) <-> site_survey (driver) race:
 * override ic_scan_curchan and ic_scan_mindwell pointers so net80211
will not try to finish scanning automatically;
 * inform net80211 about current status via ieee80211_cancel_scan()
and ieee80211_scan_done();
 * remove corresponding workaround from rsu_join_bss().

Now the driver can associate to an AP with hidden SSID.

Tested with Asus USB-N10.
2016-11-27 12:03:34 +00:00
Konstantin Belousov
abc1515601 NFSv4 client tracks opens, and the track records are only dropped when
the vnode is inactivated.  This contradicts with the nullfs caching
which keeps upper vnode around, as consequence keeping the use
reference to lower vnode.

Add a filesystem flag to request nullfs to not cache when mounted over
that filesystem, and set the flag for nfs v4 mounts.

Reported by:	asomers
Reviewed by:	rmacklem
Tested by:	asomers, rmacklem
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-11-27 09:20:58 +00:00
Alan Cox
590cb3c761 The function vm_page_cache() no longer exists. Remove its man page. 2016-11-27 01:44:31 +00:00
Alan Cox
ba67369628 Recursion on the free page queue mutex occurred when UMA needed to allocate
a new page of radix trie nodes to complete a vm_radix_insert() operation
that was requested by vm_page_cache().  Specifically, vm_page_cache()
already held the free page queue lock when UMA tried to acquire it through
a call to vm_page_alloc().  This code path no longer exists, so there is no
longer any reason to allow recursion on the free page queue mutex.

Improve nearby comments.

Reviewed by:	kib, markj
Tested by:	pho
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D8628
2016-11-27 01:42:53 +00:00
Landon J. Fuller
77cb4d3e50 bhnd(4): Unify NVRAM/SPROM parsing, implement compact SPROM layout encoding.
- Defined an abstract NVRAM I/O API (bhnd_nvram_io), decoupling NVRAM/SPROM
  parsing from the actual underlying NVRAM data provider (e.g. CFE firmware
  devices).
- Defined an abstract NVRAM data API (bhnd_nvram_data), decoupling
  higher-level NVRAM operations (indexed lookup, data conversion, etc) from
  the underlying NVRAM file format parsing/serialization.
- Implemented a new high-level bhnd_nvram_store API, providing indexed
  variable lookup, pending write tracking, etc on top of an arbitrary
  bhnd_nvram_data instance.
- Migrated all bhnd(4) NVRAM device drivers to the common bhnd_nvram_store
  API.
- Implemented a common bhnd_nvram_val API for parsing/encoding NVRAM
  variable values, including applying format-specific behavior when
  converting to/from the NVRAM string representations.
- Dropped the now unnecessary bhnd_nvram driver, and moved the
  broadcom/mips-specific CFE NVRAM driver out into sys/mips/broadcom.
- Implemented a new nvram_map file format:
        - Variable definitions are now defined separately from the SPROM
          layout. This will also allow us to define CIS tuple NVRAM
          mappings referencing the common NVRAM variable definitions.
        - Variables can now be defined within arbitrary named groups.
        - Textual descriptions and help information can be defined inline
          for both variables and variable groups.
        - Implemented a new, compact encoding of SPROM image layout
          offsets.
- Source-level (but not build system) support for building the NVRAM file
  format APIs (bhnd_nvram_io, bhnd_nvram_data, bhnd_nvram_store) as a
  userspace library.

The new compact SPROM image layout encoding is loosely modeled on Apple
dyld compressed LINKEDIT symbol binding opcodes; it provides a compact
state-machine encoding of the mapping between NVRAM variables and the SPROM
image offset, mask, and shift instructions necessary to decode or encode
the SPROM variable data.

The compact encoding reduces the size of the generated SPROM layout data
from roughly 60KB to 3KB. The sequential nature SPROM layout opcode tables
also simplify iteration of the SPROM variables, as it's no longer
neccessary to iterate the full NVRAM variable definition table, but
instead simply scan the SPROM revision's layout opcode table.

Approved by:    adrian (mentor)
Differential Revision:  https://reviews.freebsd.org/D8645
2016-11-26 23:22:32 +00:00
Scott Long
b84ef73179 Add a missing header 2016-11-26 23:15:11 +00:00
Mark Johnston
64910ddbff Launder VPO_NOSYNC pages upon vnode deactivation.
As of r234483, vnode deactivation causes non-VPO_NOSYNC pages to be
laundered. This behaviour has two problems:

1. Dirty VPO_NOSYNC pages must be laundered before the vnode can be
   reclaimed, and this work may be unfairly deferred to the vnlru process
   or an unrelated application when the system is under vnode pressure.
2. Deactivation of a vnode with dirty VPO_NOSYNC pages requires a scan of
   the corresponding VM object's memq for non-VPO_NOSYNC dirty pages; if
   the laundry thread needs to launder pages from an unreferenced such
   vnode, it will reactivate and deactivate the vnode with each laundering,
   potentially resulting in a large number of expensive scans.

Therefore, ensure that all dirty pages are laundered upon deactivation,
i.e., when all maps of the vnode are removed and all references are
released.

Reviewed by:	alc, kib
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D8641
2016-11-26 21:00:27 +00:00
Rick Macklem
1616a51df4 Use November instead of the abbreviation.
Requested by:	Ed Shouten
MFC after:	2 weeks
2016-11-26 20:58:05 +00:00
Rick Macklem
332b7722bc Document the -E flag for nfsstat.
This is a content change.

Reviewed by:	bcr
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D8626
2016-11-26 20:53:22 +00:00
Rick Macklem
0744a2b00e Add a -E flag to nfsstat.c so that it prints out the NFSv4.1
procedure/operation counts.
It also avoids clipping the counts at 9 digits.

Reviewed by:	bcr (doc parts)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D8626
2016-11-26 20:47:11 +00:00
Andriy Voskoboinyk
babfcab670 rsu: fix R92S_TXDW1_QSEL_H2C definition (0x1f -> 0x13).
Without this fix firmware ignores all but first 32 commands
(= almost everything (except plain Tx / Rx) stops working).

Tested with ASUS USB-N10.
2016-11-26 20:26:29 +00:00
Ian Lepore
2e3bf68492 Add an ethernet0 alias pointing to the /aix/usb/hub/ethernet node. This
is required for u-boot to locate the ethernet node when it's doing fixup
of the mac-address property when the user has overridden the default addr.
2016-11-26 17:55:46 +00:00
Baptiste Daroussin
dd83a7df85 initialize *nextp which could be left uninitialized in case the configuration
file cannot be open/read

Reported by:	Coverity via cem
MFC after:	2 days
CID:		1365665
2016-11-26 15:49:59 +00:00
Sevan Janiyan
a7b3f36393 Fix null dereference when running out of nodes during rename.
PR:		212370
Submitted by:	Sascha Wildner <swildner AT gmail>
Reviewed by:	bcr (mentor)
Approved by:	bapt
Obtained from:	NetBSD
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D8643
2016-11-26 13:26:29 +00:00
Raphael Kubo da Costa
be5d5a33e6 fdt: Expect strchr() to return a const char*
In C, strchr(3) returns a char*, whereas C++ defines two overloads:
* const char *strchr(const char*, int)
* char *strchr(char*, int)

Building fdt.cc (with the WITHOUT_GPL_DTC knob set) with libc++ 3.9.0 (imported
in r309124) was failing because libc++ r260377 added the first overload to
string.h, leading to failures such as:

    fdt.cc:1638:8: error: cannot initialize a variable of type 'char *' with an
    rvalue of type 'const char *'

Just define val as a const char* to fix it.

Upstreamed in https://github.com/davidchisnall/dtc/pull/14

Reviewed by:	emaste
Approved by:	emaste
2016-11-26 12:36:11 +00:00
Emmanuel Vadot
def44246f2 PLL3 have a fractional mode where an explicit frequency (297Mhz or 270)
can be selected for it. If the desired frequency is one of those two, use
this mode instead of the integer one.
When calculating the PLL3 freq for the dotclock, check if it is a multiple
of the fracional frequencies.

MFC after:	2 weeks
2016-11-26 10:36:48 +00:00