Commit Graph

219443 Commits

Author SHA1 Message Date
Ian Lepore
d5b937680c Correct the comments about how much buffer is allocated. 2017-01-13 17:03:23 +00:00
Gleb Smirnoff
0f7ddf91e9 Use getsock_cap() instead of deprecated fgetsock().
Reviewed by:	tuexen
2017-01-13 16:54:44 +00:00
Conrad Meyer
b632b00087 fstyp.8: Move initial exFAT blurb to the -u section
Didn't notice the second list in r312003.

Reported by:	trasz@
2017-01-13 16:46:01 +00:00
Ian Lepore
a6f63533a7 Check tty_gone() after allocating IO buffers. The tty lock has to be
dropped then reacquired due to using M_WAITOK, which opens a window in
which the tty device can disappear.  Check for this and return ENXIO
back up the call chain so that callers can cope.

This closes a race where TF_GONE would get set while buffers were being
allocated as part of ttydev_open(), causing a subsequent call to
ttydevsw_modem() later in ttydev_open() to assert.

Reported by:	pho
Reviewed by:	kib
2017-01-13 16:37:38 +00:00
Ed Maste
2f21ec0129 libgcc_s: add libc DT_NEEDED to fix underlinking
PR:		216012
Reported by:	jbeich
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2017-01-13 15:17:25 +00:00
Michael Tuexen
24209f0122 Ensure that the buffer length and the length provided in the IPv4
header match when using a raw socket to send IPv4 packets and
providing the header. If they don't match, let send return -1
and set errno to EINVAL.

Before this patch is was only enforced that the length in the header
is not larger then the buffer length.

PR:			212283
Reviewed by:		ae, gnn
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D9161
2017-01-13 10:55:26 +00:00
Alexander Motin
4902e14dc8 Improve CAM_CDB_POINTER support.
MFC after:	2 weeks
2017-01-13 08:31:55 +00:00
Hiroki Sato
373eea194d Purge varargs.h in favor of stdarg.h. 2017-01-13 08:01:27 +00:00
Adrian Chadd
da6ee937ae [net80211] add a macro to check this configuration option. 2017-01-13 07:24:58 +00:00
Adrian Chadd
321eb9ffbe [net80211] begin laying the groundwork for drivers to do their own sequence number management.
I added IEEE80211_TX_LOCK() a few years ago because there were races between
seqno allocation, driver queuing and crypto IV allocation.  This meant that
they'd appear out of sequence and the receiver would drop them, leading to
terrible performance or flat out traffic hangs.

This flag should be set by drivers that do their own sequence number
allocation for all frames it needs to happen for, including beacon frames.

Eventually this should lead to the driver taking care of locking for
allocating seqno and other traffic-triggered events (eg addba setup.)
2017-01-13 07:08:14 +00:00
Adrian Chadd
51172f62a7 [net80211] Initial VHT node upgrade/downgrade support and initial IE parsing.
This is the bulk of the magic to start enabling VHT channel negotiation.
It is absolutely, positively not yet even a complete VHT wave-1 implementation.

* parse IEs in scan, assoc req/resp, probe req/resp;
* break apart the channel upgrade from the HT IE parsing - do it after the
  VHT IEs are parsed;
* (dirty! sigh) add channel width decision making in ieee80211_ht.c htinfo_update_chw().
  This is the main bit where negotiated channel promotion through IEs occur.
* Shoehorn in VHT node init ,teardown, rate control, etc calls like the HT
  versions;
* Do VHT channel adjustment where appropriate

Tested:

* monitor mode, ath10k port
* STA mode, ath10k port - VHT20, VHT40, VHT80 modes

TODO:

* IBSS;
* hostap;
* (ignore mesh, wds for now);
* finish 11n state engine - channel width change, opmode notifications, SMPS, etc;
* VHT basic rate negotiation and acceptance criteria when scanning, associating, etc;
* VHT control/management frame handling (group managment and operating mode being
  the two big ones);
* Verify TX/RX VHT rate negotiation is actually working correctly.

Whilst here, add some comments about seqno allocation and locking.  To achieve
the full VHT rates I need to push seqno allocation into the drivers and
finally remove the IEEE80211_TX_LOCK() I added years ago to fix issues. :/
2017-01-13 07:02:04 +00:00
Adrian Chadd
67f4aa3878 [net80211] initial, somewhat incomplete VHT channel setup code and attach path.
This sets up:

* vht capabilities in vaps;
* calls vht_announce to announce VHT capabilities if any;
* sets up vht20, vht40 and vht80 channels, assuming the regulatory code
  does the right thing with 80MHz available ranges;
* adds support to the ieee80211_add_channel_list_5ghz() code to populate
  VHT channels, as this is the API my ath10k driver is using;
* add support for the freq1/freq2 field population and lookup that
  VHT channels require.

The VHT80 code assumes that the regulatory domain already has limited VHT80
bands to, well, 80MHz wide chunks.
2017-01-13 06:53:56 +00:00
Hiroki Sato
1296e1b0b7 - Add static for functions and variables with internal linkage.
- Quiet down -Wcast-align warnings.
- Remove dead code.

There is no functionality change.
2017-01-13 06:22:49 +00:00
Enji Cooper
ee5d5813c0 fmaxmin_test still fails with clang 3.9.x.. bypass the test
MFC after:	3 days
PR:		208703
Sponsored by:	Dell EMC Isilon
2017-01-13 04:21:09 +00:00
Enji Cooper
ef7ff3e308 Use dfr-01-xfat.img.bz2, not dfr-01-xfat.dd.bz2 (the latter
case was the full disk image from the website, which was never
checked in to svn)

Regardless, the testcase still fails

PR:		214908
Sponsored by:	Dell EMC Isilon
2017-01-13 04:04:48 +00:00
Enji Cooper
6f81c4d9bb Add testcase for exFAT that currently fails
Disk image obtained from:
http://www.cfreds.nist.gov/dfr-images/dfr-01-xfat.dd.bz2 -- was ripped off the
first GPT partition and verified to be a FAT-like partition with file(1)/hexdump.

This testcase currently fails

PR:		214908
Sponsored by:	Dell EMC Isilon
2017-01-13 04:02:09 +00:00
Enji Cooper
cebf8a2ca7 Add license preamble for r286964; credit to asomers
While here, clean up trailing whitespace

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-01-13 03:42:51 +00:00
Enji Cooper
cdebaff820 Upgrade NetBSD tests to 01.11.2017_23.20 snapshot
This contains some new testcases in /usr/tests/...:

- .../lib/libc
- .../lib/libthr
- .../lib/msun
- .../sys/kern

Tested on:	amd64, i386
MFC after:	1 month
2017-01-13 03:33:57 +00:00
Conrad Meyer
e266075649 fstyp(8): Detect exFAT filesystems
Simply detect the exFAT filesystem name in the Volume Boot Record
(superblock).

PR:		214908
Reported by:	<vermaden at interia.pl>
2017-01-13 02:12:58 +00:00
Kevin Lo
68c3c0258d Increase retry count to 100 in r88e_fw_cmd() and r92c_fw_cmd(). 2017-01-13 02:11:16 +00:00
Pedro F. Giffuni
be04edbb4f Remove __nonnull() attributes from x86 machine check architecture.
These are of the few cases where we use the GCC non-null attributes in
non-header code. As part of a review [1] of our use of such attributes we
are replacing such uses of the overly aggressive GCC attribute with clang's
_Nonnull attribute.

In this case the attributes serve little purpose as they just don't
enforce run time checks, If anything the attributes would cause NULL pointer
checks to be ignored but there are no such checks so only effect is
cosmetic.

The references appear to be left over from code development and likely
already fulfilled their purpose.

Reference [1]:
https://reviews.freebsd.org/D9004

Reviewed by:	jhb
MFC after:	3 weeks
2017-01-13 01:39:19 +00:00
Ian Lepore
e046e8e680 Restructure the tty_drain loop so that device-busy is checked one more time
after tty_timedwait() returns an error only if the error is EWOULDBLOCK;
other errors cause an immediate return.  This fixes the case of the tty
disappearing while in tty_drain().

Reported by:	pho
2017-01-12 21:18:43 +00:00
Gleb Smirnoff
4f56243aad Fix the contiguity once more. 2017-01-12 20:26:02 +00:00
Hiroki Sato
c10340d440 - Fix dereference of NULL pointer which could cause a crash [1]
- Fix memory leak due to lack of freeaddrinfo() [2]

CID:	1018281 [1]
CID:	1225057 [2]
MFC after:	3 days
2017-01-12 18:44:58 +00:00
Alexander Kabaev
eae0fba453 Fix typo in r311971.
Reported by:	ohartmann at walstatt.org
2017-01-12 18:05:12 +00:00
Sean Bruno
245c5ebbce Purge surprise change to sys/conf/files for ixgbe(4).
Reported by:	imp
2017-01-12 17:18:25 +00:00
Conrad Meyer
484820d442 libkern: Remove obsolete 'register' keyword
Sponsored by:	Dell EMC Isilon
2017-01-12 17:02:29 +00:00
Sean Bruno
9acdec7132 Purge EM_MULTIQUEUE references from the man page for em(4). 2017-01-12 16:44:40 +00:00
Bruce M Simpson
fb1d9b7f41 Allow uart(4) to use MSI interrupts on single-port PCI instances.
Do this here as puc(4) disallows single-port instances; at least
one multi-port PCIe UART chip (in this case, the ASIX MCS9922)
present separate PCI configuration space (functions) for each UART.

Tested using lrzsz and a null-modem cable. The ExpressCard/34
variants containing the MCS9922 should also use MSI with this change.

Reviewed by:		jhb, imp, rpokala
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D9123
2017-01-12 16:30:27 +00:00
Sean Bruno
25a3341048 Fix panic on mb_free_ext() due to NULL destructor.
This used to happen because of the SET_MBUF_DESTRUCTOR() called
on unregif.

Submitted by:	Vincenzo Maffione <v.maffione@gmail.com>
2017-01-12 16:24:10 +00:00
Alan Somers
c6e3715fbc Fix uninitialized variable CIDs in route6d
The variables in question are actually return arguments, but it's still good
form to initialize them.

Reported by:	Coverity
CID:		979679 979680
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
2017-01-12 16:22:28 +00:00
Konstantin Belousov
f8adf1a784 For the main binary, postpone enforcing relro read-only protection
until copy relocations are done.

Newer binutils and lld seems to output copy into relro-protected range.

Reported by: Rafael Espц╜ndola via emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-01-12 15:54:03 +00:00
Andrew Rybchenko
a0e88689f0 sfxge(4): add sysctl to change MAC stats update period
The sysctl controls the period per interface.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D9153
2017-01-12 15:26:23 +00:00
Sean Bruno
653e35e69f Restore fixup for newer em(4) devices WOL capabilities post iflib integration.
PR:	208343
2017-01-12 14:47:44 +00:00
Pedro F. Giffuni
f5ab496e62 rpcgen(1): Check getrlimit() return for generated code.
Obtained from:	NetBSD (CVS rev 1.27, 1.28)
MFC after:	1 week
2017-01-12 14:44:41 +00:00
Sean Bruno
062a4b8c68 Deprecate kernel configuration option EM_MULTIQUEUE now that the em(4)
driver conforms to iflib.
2017-01-12 14:38:18 +00:00
Sean Bruno
0aa7d3ff9e Reset the EIAC register to include the LINK status bit and restore
link up/down notifications.

Submitted by:	Franco Fichtner <franco@opnsense.org>
2017-01-12 14:28:32 +00:00
Sean Bruno
8bc3dfc424 Attempt to use the "new" BAR address for newer igb(4) devices. This code
was dropped during the IFLIB migration.

Reported by:	olivier
Reviewed by:	mmacy@nextbsd.org
2017-01-12 14:18:52 +00:00
Andrew Rybchenko
58223d5b7a sfxge(4): add tunable to configure MAC stats update period
Reviewed by:    philip
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D9151
2017-01-12 13:00:17 +00:00
Maxim Sobolev
5e946c03c7 Fix slight type mismatch between so_options defined in sys/socketvar.h
and tw_so_options defined here which is supposed to be a copy of the
former (short vs u_short respectively).

Switch tw_so_options to be "signed short" to match the type of the field
it's inherited from.
2017-01-12 10:14:54 +00:00
Enji Cooper
7ad417dff8 Add __BIT and __BITS macros from NetBSD to help support new testcases
MFC after:	1 week
2017-01-12 09:01:14 +00:00
Alexander Motin
17160457b4 Report random flash storage as non-rotating to GEOM_DISK.
While doing it, introduce respective constants in geom_disk.h.

MFC after:	1 week
2017-01-12 08:53:10 +00:00
Enji Cooper
b6bd3eb5f3 Add additional testcases missed in r311966 2017-01-12 08:46:19 +00:00
Enji Cooper
9527fa4f66 Remove __HAVE_LONG_DOUBLE #define from t_strtod.c and place it in Makefile
This is to enable support in other testcases

Inspired by lib/msun/tests/Makefile .

MFC after:	1 week
2017-01-12 08:40:52 +00:00
Enji Cooper
35cfc322f1 Fix lib/libc/sys/access_test after r311925
sys/param.h needs to be #included in order for __FreeBSD_version to be checked

MFC after:	13 days
2017-01-12 08:31:42 +00:00
Enji Cooper
20d24fbb93 Sync ^/vendor/NetBSD/tests/dist with upstream 2017-01-12 07:26:39 +00:00
Enji Cooper
2254eda87e Commit updates accepted upstream (NetBSD) 2017-01-12 07:21:56 +00:00
Conrad Meyer
b28ea2c250 g_raid: Prevent tasters from attempting excessively large reads
Some g_raid tasters attempt metadata reads in multiples of the provider
sectorsize.  Reads larger than MAXPHYS are invalid, so detect and abort
in such situations.

Spiritually similar to r217305 / PR 147851.

PR:		214721
Sponsored by:	Dell EMC Isilon
2017-01-12 06:58:31 +00:00
Ravi Pokala
8e712af70b Remove writability requirement for single-mbuf, contiguous-range
m_pulldown()

m_pulldown() only needs to determine if a mbuf is writable if it is going to
copy data into the data region of an existing mbuf. It does this to create a
contiguous data region in a single mbuf from multiple mbufs in the chain. If
the requested memory region is already contiguous and nothing needs to
change, the mbuf does not need to be writeable.

Submitted by:	Brian Mueller <bmueller@panasas.com>
Reviewed by:	bz
MFC after:	1 week
Sponsored by:	Panasas
Differential Revision:	https://reviews.freebsd.org/D9053
2017-01-12 06:38:03 +00:00
Andrew Rybchenko
62f5c49637 sfxge(4): stats refresh in SW should depend on HW update period
The period should be taken into account by the function which
refreshes driver stats.

Reviewed by:    philip
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D9130
2017-01-12 06:30:44 +00:00