Commit Graph

210850 Commits

Author SHA1 Message Date
Marcelo Araujo
67210fb3b8 Use MAX() from sys/param.h.
MFC after:	2 weeks.
2016-04-21 06:21:33 +00:00
Andriy Voskoboinyk
8a9508c046 net80211: refresh comments for ieee80211_scan_next() and
ieee80211_scan_done().

Refresh comments that reference scan_next() method
(does not exist since r191746) + fix spelling of 'current'.

Differential Revision:	https://reviews.freebsd.org/D5137
2016-04-21 06:19:33 +00:00
Marcelo Araujo
6a25181bba Fix a missing blank space. 2016-04-21 06:14:30 +00:00
Marcelo Araujo
2d123458af Simplify the get_type() function.
Submitted by:	bde
Discussed with:	bde, jhb and pfg
MFC after:	2 weeks.
2016-04-21 06:11:24 +00:00
Andriy Voskoboinyk
6459bd2843 net80211: enable promiscuous mode state change for non-monitor/ahdemo modes
- Allow to enable/disable promiscuous mode when:
  * interface is not a member of bridge, or;
  * request was issued by user (ifconfig wlan0 promisc), or;
  * interface is in MONITOR or AHDEMO mode.
- Drop local workarounds in mwl(4) and malo(4).

Tested with:
- Intel 3945BG, STA mode;
- RTL8188CUS, MONITOR mode;

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5472
2016-04-21 05:47:47 +00:00
Eitan Adler
c706c470e4 Bring a little more compability with GNU units 2.12
- notionally support a 'history file' flag. This doesn't do much now,
  but is there to prevent scripts written against GNU units from
  breaking
- correctly gracefully quit rather than exit (this will make it easier
  to support a history file in the future)
- remove the "t" flag from fopen which was there to support windows. We
  have not supported windows since at the latest, the introduction of
  capsicum.
2016-04-21 05:24:47 +00:00
Eitan Adler
0bae19ba15 Remove project.name which is a product of a bygone era. 2016-04-21 04:33:07 +00:00
George V. Neville-Neil
a5ff72cb0e Add the address at which the routine returned.
MFC after:	1 week
Sponsored by:	Rubicon Communications (Netgate)
2016-04-21 03:17:53 +00:00
Sepherosa Ziehau
dd09ce3930 dhclient: Log a warning instead of bailing upon "illegal" options
In Azure, the DHCP servers add private option (id 0xf5), which contains
binary form of an IPv4 address. Once this option is converted to string
form, it could contain '$', e.g.

IPv4 address: 100.72.36.54
binary form: 0x64 0x48 0x24 0x36
string form: "dH$6"

dhclient bails upon "illegal" options like the above example, thus the
VM bring-up will fail.

Also as a side note, this "illegal" option detection was added in
OpenBSD ~11years ago:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sbin/dhclient/dhclient.c?rev=1.50&content-type=text/x-cvsweb-markup

And it was removed along with the removal of script support in OpenBSD
~3years ago:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sbin/dhclient/dhclient.c?rev=1.159&content-type=text/x-cvsweb-markup

Reported by:	Hongxiong Xian <v-hoxian microsoft com>
Reviewed by:	jhb, Dexuan Cui <decui microsoft com>
Tested by:	Hongxiong Xian <v-hoxian microsoft com>
Analyzed by:	Dong Liu <doliu microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5853
2016-04-20 23:56:25 +00:00
Wojciech Macek
1782ba0c1f Revert r298357
Revert workaround fixed by r298361
2016-04-20 22:41:19 +00:00
Oleksandr Tymoshenko
65c2672f67 Force framebuffer virtual viewport to be the same as physical
VideoCore reports garbage in viewport geometry fields unless
viewport was set previously by earlier stage boot loader. So
when booting FreeBSD kernel directly from VideoCore's start.elf
framebuffer intialization fails due to invalid vxres, vyres
values. Make sure we request viewport to be equal to physical
resolution

Submitted by:	Sylvain Garrigues <sylvain@sylvaingarrigues.com>
2016-04-20 22:38:00 +00:00
Baptiste Daroussin
f734685ea4 Plug memory leak
Reported by:	coverity
CID:		1331664, 1331665
2016-04-20 21:37:32 +00:00
Baptiste Daroussin
0ce8c4a33c Plug various resources leak
While here fix a test logic

Reported by:	coverity
CID:		1332096, 1332097, 1332098, 1332099, 1332100, 1332101, 1332102
MFC after:	1 week
2016-04-20 21:32:34 +00:00
Jung-uk Kim
e5f7701025 Prefer sizeof(*pointer) over sizeof(type). No funtional change. 2016-04-20 21:30:56 +00:00
Jung-uk Kim
87f0a4bf1f There is no need to use array any more. No functional change. 2016-04-20 21:26:59 +00:00
Baptiste Daroussin
e6d8c0e2dd Plug memory leaks
Reported by:	Coverity
CID=		1338535, 1338536, 1338542, 1338569, 1338570
2016-04-20 21:23:42 +00:00
Jung-uk Kim
cad6d22280 Remove query flag from acpi_EvaluateOSC(). This function does not support
return buffer (yet).
2016-04-20 21:21:47 +00:00
Andriy Voskoboinyk
4357a5d1ef net80211: hide subtype mask & shift in function call.
Hide subtype mask/shift (which is used for index calculation
in ieee80211_mgt_subtype_name[] array) in function call.

Tested with RTL8188CUS, STA mode.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5369
2016-04-20 21:15:55 +00:00
Pedro F. Giffuni
a9a25801e8 Remove unused SMB_DIALECT_MAX macro.
Found by:	jhb
2016-04-20 21:13:24 +00:00
Baptiste Daroussin
4ecb514126 Plug leaks
Reported by:	Coverity
CID:		1340155 and 1340156
MFC after:	1 week
2016-04-20 21:11:49 +00:00
Bjoern A. Zeeb
29bda43fa4 Add more fields from struct ifnet needed during debugging a kernel panic.
Move if_fib into the right place.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2016-04-20 21:04:39 +00:00
John Baldwin
508c21b669 Invoke _OSC on Host-PCI bridges.
Tell the firmware that we support PCI-express config space access
and MSI.

Reviewed by:	jkim
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D6023
2016-04-20 20:58:30 +00:00
Baptiste Daroussin
c1eac826c2 Fix bad checking of the return of realloc(3)
Reported by:	Coverity
CID:		1007335
MFC after:	3 days
2016-04-20 20:56:06 +00:00
John Baldwin
5f3dd91a8f Add a wrapper for evaluating _OSC methods.
This wrapper does not translate errors in the first word to ACPI
error status returns.  Use this wrapper in the acpi_cpu(4) driver in
place of the existing _OSC code.  While here, fix a bug where the wrong
count of words was passed when invoking _OSC.

Reviewed by:	jkim
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D6022
2016-04-20 20:55:58 +00:00
Baptiste Daroussin
89afcfedb6 Fix typo: actually test the return of strchr(3)
Reported by:	Coverity
CID:		1007335
MFC after:	3 days
2016-04-20 20:54:47 +00:00
Enji Cooper
c935e51525 Fix coverity issue with contrib/netbsd-tests/lib/libc/ssp/h_read.c
Ensure opening /dev/zero succeeds. Abort the test if it doesn't.

Also, use _PATH_DEVZERO instead of hardcoding "/dev/zero"

MFC after: 2 weeks
CID: 1251410
Reported by: Coverity
Sponsored by: EMC / Isilon Storage Division"
2016-04-20 20:48:54 +00:00
Baptiste Daroussin
d3591d68a9 Check the returned value of memchr(3) before using it
Reported by:	Coverity
CID:		1338530
2016-04-20 20:44:30 +00:00
Enji Cooper
4dd13092b5 Fix coverity issues with contrib/netbsd-tests/lib/libc/sys/t_connect.c
- Ensure socket(2) calls succeed
- Don't leak slist allocated by earlier socket(2) call

MFC after: 2 weeks
CID: 976773, 1251405
Reported by: Coverity
Sponsored by: EMC / Isilon Storage Division
2016-04-20 20:43:05 +00:00
Pedro F. Giffuni
198e7845ee Remove unused e500_event_codes_size.
Found by:	jhb
2016-04-20 20:37:58 +00:00
Andriy Voskoboinyk
d72d72d381 net80211: provide descriptions for reason codes
Add text description for deauth/disassoc/etc reason codes
in addition to 'reason: <number>' string.

Reviewed by:	adrian
Obtained from:	IEEE Std 802.11-2012, 8.4.1.7 "Reason Code field"
Differential Revision:	https://reviews.freebsd.org/D5367
2016-04-20 20:30:18 +00:00
Wojciech Macek
4cde1dac8a Add missing function prototypes in KGDB
This fixes the build broken by r298358
2016-04-20 20:22:48 +00:00
Ed Maste
7ffae6f2b2 Update comment added in r298357
The additional regex replacements are actully required due to an
elfcopy bug which is now fixed (by r298361), not a Clang/GCC issue.

Sponsored by:	The FreeBSD Foundation
2016-04-20 19:21:26 +00:00
Ed Maste
e5c4075f6b elfcopy: map all !alnum characters to '_' in binary input symbol names
This matches bfd and gold.

Obtained from:	ELF Tool Chain r3445
Sponsored by:	The FreeBSD Foundation
2016-04-20 19:13:00 +00:00
Andriy Voskoboinyk
4ba33fd1dc net80211 (trivial, noop): remove duplicate check from hostap_recv_mgmt()
Differential Revision:	https://reviews.freebsd.org/D5483
2016-04-20 18:48:39 +00:00
Andriy Voskoboinyk
31021a2b4e net80211: replace internal LE_READ_*/LE_WRITE_* macro with system
le*dec / le*enc functions.

Replace net80211 specific macros with system-wide bytestream
encoding/decoding functions:
- LE_READ_2 ->  le16dec
- LE_READ_4 ->  le32dec
- LE_WRITE_2 -> le16enc
- LE_WRITE_4 -> le32enc

+ drop ieee80211_input.h include, where it was included for these
operations only.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D6030
2016-04-20 18:29:30 +00:00
Wojciech Macek
d4015ddc57 Fix KGDB backtrace on ARM
Modify trapframe decoding to properly analyze trapframe.

Provide method for fixup_pc. It happens, that in some kernel
functions, the GDB stack frame decoder cannot determine both
func name and frame size. This is because these functions
either contain invalid instruction, or their format does
not match standard schema. Detect that scenarios and move
PC accordingly to jump into known function schema, which
GDB is able to parse.

Obtained from:         Semihalf
Sponsored by:          Juniper Networks
Reviewed by:           kib, zbb
Differential Revision: https://reviews.freebsd.org/D5976
2016-04-20 17:58:13 +00:00
Wojciech Macek
fb9c3478a1 Fix MFS symbol redefinition with clang 3.8.0
Newest CLANG objcpy uses different name parsing.
Modify regexp to match (i.e. avoid substitution
of "/" or "-" with "_").

Obtained from:         Semihalf
Sponsored by:          Juniper Networks
Reviewed by:           hselasky, zbb
Differential Revision: https://reviews.freebsd.org/D5873
2016-04-20 17:54:53 +00:00
Konstantin Belousov
3e937c3a77 Arm and arm64 both have fueword() implemented for some time. Correct
the comment.

Sponsored by:	The FreeBSD Foundation
2016-04-20 17:28:21 +00:00
Peter Grehan
e37bf586eb Don't use SYSDIR to avoid conflicts with existing usage.
Also, use SRCTOP to locate the top of the source tree
instead of a relative path.

PR:	208856
2016-04-20 17:05:32 +00:00
Pedro F. Giffuni
63b6b7a74a Indentation issues.
Contract some lines leftover from r298310.

Mea culpa.
2016-04-20 16:19:44 +00:00
Pedro F. Giffuni
422fa64be3 Minor indentation issue. 2016-04-20 16:03:53 +00:00
Pedro F. Giffuni
33495e5daf Use our nitems() macro when param.h is available.
Replacements specific to arm, mips, pc98, powerpc and sparc64.

Discussed in:	freebsd-current
2016-04-20 15:45:55 +00:00
Sean Bruno
2f7a2b9d79 Avoid a possible heap overflow in our nlm code by limiting the number
of service to the arbitrary value of 256.  Log an appropriate message
that indicates the hard limit.

PR:		208808
Submitted by:	cturt@hardenedbsd.org
Reviewed by:	dfr
Obtained from:	HardenedBSD
MFC after:	2 weeks
2016-04-20 15:31:03 +00:00
Stanislav Galabov
d478c9fe53 Add compat strings used by OpenWRT to some Mediatek/Ralink drivers
Approved by:	adrian (mentor)
Sponsored by:	Smartcom - Bulgaria AD
Differential Revision:	https://reviews.freebsd.org/D5995
2016-04-20 14:47:16 +00:00
Stanislav Galabov
680354a7a4 Rework mtk_gpio_v1 driver
This revision makes the mtk_gpio_v1 driver read its register map property
from the OpenWRT dts files.

Approved by:	adrian (mentor)
Sponsored by:	Smartcom - Bulgaria AD
Differential Revision:	https://reviews.freebsd.org/D6029
2016-04-20 14:36:45 +00:00
Stanislav Galabov
f2880faaf0 Introduce OpenWRT compatible pinctrl driver for Mediatek/Ralink SoCs
The driver can read and parse the OpenWRT pinctrl dts entries.

Approved by:	adrian (mentor)
Sponsored by:	Smartcom - Bulgaria AD
Differential Revision:	https://reviews.freebsd.org/D5999
2016-04-20 14:35:00 +00:00
Stanislav Galabov
009e872ef7 Modify mx25l FDT compatible device handling
If we cannot establish compatibility by only looking at the compat_data we
also check the flash_devices structure's names for a compatible device.

Approved by:	adrian (mentor)
Sponsored by:	Smartcom - Bulgaria AD
Differential Revision:	https://reviews.freebsd.org/D6026
2016-04-20 14:33:00 +00:00
Stanislav Galabov
e3a1a618a3 Include resets and clocks properties for PCI in FreeBSD RT3883 dtsi file
This change is required so that RT3662/RT3883 PCI can function correctly

Approved by:	adrian (mentor)
Sponsored by:	Smartcom - Bulgaria AD
Differential Revision:	https://reviews.freebsd.org/D6028
2016-04-20 14:31:01 +00:00
Stanislav Galabov
f3baf36388 Change OpenWRT imported dtsi files
Change '#include <fbsd-*>' to '/include/ "fbsd-*"' in [rm]t*.dtsi

Basically the pre-import work on OpenWRT's dts/dtsi files boils down to:

for f in `ls [mr]t*.dtsi`; do
printf '\n/include/ "fbsd-$f"\n' >> $f
done

Approved by:	adrian (mentor)
Sponsored by:	Smartcom - Bulgaria AD
Differential Revision:	https://reviews.freebsd.org/D5993
2016-04-20 14:29:03 +00:00
Andrew Turner
be95c24986 Group the ThunderX PCIe PEM newbus methods to help find them.
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2016-04-20 14:12:40 +00:00