freebsd.git
8 years agoChange a rounding operation that had missing braces into a roundup2()
peter [Tue, 3 May 2016 00:09:13 +0000 (00:09 +0000)]
Change a rounding operation that had missing braces into a roundup2()
macro.  Adjust the buffer clipping code to work as expected.

This prevented a number of machines in the FreeBSD.org cluster from
booting due to "ZFS: i/o error - all block copies unavailable"
after an unclean shutdown.

8 years ago[bwn] break out the 'g' phy code into a separate source file.
adrian [Mon, 2 May 2016 22:58:11 +0000 (22:58 +0000)]
[bwn] break out the 'g' phy code into a separate source file.

* Break out the 'g' phy code;
* Break out the debugging bits into a separate source file, since
  some debugging prints are done in the phy code;
* Make some more chip methods in if_bwn.c public.

This brings the size of if_bwn.c down to 6,805 lines which is now
approaching managable.

8 years ago[bhnd] fix more module dependencies.
adrian [Mon, 2 May 2016 22:30:46 +0000 (22:30 +0000)]
[bhnd] fix more module dependencies.

Submitted by: Landon Fuller <landonf@landonf.org>
Differential Revision: https://reviews.freebsd.org/D6180

8 years agobsdinstall: fix static address assignment for protected wireless networks.
avos [Mon, 2 May 2016 21:40:34 +0000 (21:40 +0000)]
bsdinstall: fix static address assignment for protected wireless networks.

Filter out IFCONFIG_PREFIX variable (which may contain WPA keyword)
from ifconfig parameters.

PR: 169199

8 years agoUndo a spell fix introduced in r298942, which breaks compilation.
tuexen [Mon, 2 May 2016 21:23:05 +0000 (21:23 +0000)]
Undo a spell fix introduced in r298942, which breaks compilation.

8 years ago[bwn] break out the LP PHY code into a separate file.
adrian [Mon, 2 May 2016 21:06:02 +0000 (21:06 +0000)]
[bwn] break out the LP PHY code into a separate file.

This (and eventually migrating the other PHY code out) is in preparation
for adding the 11n PHY.  No, the 11ac PHY (for the BCM4260 softmac part) isn't
yet open source, so we can't grow that.  Yet.

This trims ~3,700 lines of code from if_bwn.c, bringing it down to a slightly
less crazy sounding 10,446 lines of code.

8 years ago[bhnd] add module dependencies.
adrian [Mon, 2 May 2016 21:01:08 +0000 (21:01 +0000)]
[bhnd] add module dependencies.

Submitted by: Landon Fuller <landonf@landonf.org>
Differential Revision: https://reviews.freebsd.org/D6179

8 years agonetinet/sctp*: minor spelling fixes in comments.
pfg [Mon, 2 May 2016 20:56:11 +0000 (20:56 +0000)]
netinet/sctp*: minor spelling fixes in comments.

No functional change.

Reviewed by: tuexen

8 years agonet80211: fix MAC address change via SIOCSIFLLADDR ioctl.
avos [Mon, 2 May 2016 20:46:05 +0000 (20:46 +0000)]
net80211: fix MAC address change via SIOCSIFLLADDR ioctl.

Recheck MAC address on SIOCSIFFLAGS; as a result,
'ifconfig wlan0 ether <addr>' can be used after interface startup.

PR: 208933

8 years agosys/vm: minor spelling fixes in comments.
pfg [Mon, 2 May 2016 20:16:29 +0000 (20:16 +0000)]
sys/vm: minor spelling fixes in comments.

No functional change.

8 years agodev/ath: minor spelling fixes in comments.
pfg [Mon, 2 May 2016 19:56:48 +0000 (19:56 +0000)]
dev/ath: minor spelling fixes in comments.

No functional change.

Reviewed by: adrian

8 years agoEnhance the ddb examine (x) command.
pfg [Mon, 2 May 2016 19:32:06 +0000 (19:32 +0000)]
Enhance the ddb examine (x) command.

* Change x/a to work similar to gdb.  The content of the memory is
  treated as an address, printed symbolically and the address is advanced.
  This way you can x/a <stack_address> and then just hit return a bunch
  of times to locate useful data on the stack.

* Add x/p.  The content of the memory is treated as an address and
  printed as hex.

This is based on the similar commit from DragonFlyBSD without the
cosmetic changes.

Relnotes: yes
Obtained from: DragonflyBSD (Matthew Dillon)
Reference: 0624d20e86affcd708609cbf9014207537537a72

8 years ago[asmc] add support for more models and restore keyboard backlight after resume.
adrian [Mon, 2 May 2016 19:15:16 +0000 (19:15 +0000)]
[asmc] add support for more models and restore keyboard backlight after resume.

This patch adds support for restoring backlight after resume and adds models
Macbook3,1
MacbookAir5,1
MacbookAir5,2

It also incorporates fixes for bug #175260, bug #203610 and bug #203512
so those can be closed if this patch is applied.

PR: kern/209156
PR: kern/175260
PR: kern/203610
PR: kern/203512
Submitted by: Johannes Lundberg <johannes@brilliantservice.co.jp>

8 years agoiwm: fix parameters for iwm_add_channel_band()
avos [Mon, 2 May 2016 19:07:44 +0000 (19:07 +0000)]
iwm: fix parameters for iwm_add_channel_band()

It accepts <first index, max index + 1>, not
<first index, number of entries>.

Reported by: adrian

8 years ago[bhnd] add missing bus interface SRC bits, required after the last source import.
adrian [Mon, 2 May 2016 18:48:37 +0000 (18:48 +0000)]
[bhnd] add missing bus interface SRC bits, required after the last source import.

8 years agoxen/control: improve suspend/resume
royger [Mon, 2 May 2016 18:23:48 +0000 (18:23 +0000)]
xen/control: improve suspend/resume

Implement several small improvements to the suspend/resume Xen sequence:

 - Call the power_suspend_early event before stopping all processes.
 - Stop all processes. This was done implicitly previously by putting all
   the CPUs in a known IPI handler.
 - Warm up the timecounter.
 - Re-initialize the time of day register.

Sponsored by: Citrix Systems R&D

8 years agoAdd a new bus method to fetch device-specific CPU sets.
jhb [Mon, 2 May 2016 18:00:38 +0000 (18:00 +0000)]
Add a new bus method to fetch device-specific CPU sets.

bus_get_cpus() returns a specified set of CPUs for a device.  It accepts
an enum for the second parameter that indicates the type of cpuset to
request.  Currently two valus are supported:

 - LOCAL_CPUS (on x86 this returns all the CPUs in the package closest to
   the device when DEVICE_NUMA is enabled)
 - INTR_CPUS (like LOCAL_CPUS but only returns 1 SMT thread for each core)

For systems that do not support NUMA (or if it is not enabled in the kernel
config), LOCAL_CPUS fails with EINVAL.  INTR_CPUS is mapped to 'all_cpus'
by default.  The idea is that INTR_CPUS should always return a valid set.

Device drivers which want to use per-CPU interrupts should start using
INTR_CPUS instead of simply assigning interrupts to all available CPUs.
In the future we may wish to add tunables to control the policy of
INTR_CPUS (e.g. should it be local-only or global, should it ignore
SMT threads or not).

The x86 nexus driver exposes the internal set of interrupt CPUs from the
the x86 interrupt code via INTR_CPUS.

The ACPI bus driver and PCI bridge drivers use _PXM to return a suitable
LOCAL_CPUS set when _PXM exists and DEVICE_NUMA is enabled.  They also and
the global INTR_CPUS set from the nexus driver with the per-domain set from
_PXM to generate a local INTR_CPUS set for child devices.

Reviewed by: wblock (manpage)
Differential Revision: https://reviews.freebsd.org/D5519

8 years agodev/usb: minor spelling fixes in comments.
pfg [Mon, 2 May 2016 17:44:03 +0000 (17:44 +0000)]
dev/usb: minor spelling fixes in comments.

No functional change.

Reviewed by: hselasky

8 years agoetc: minor spelling fixes.
pfg [Mon, 2 May 2016 16:47:28 +0000 (16:47 +0000)]
etc: minor spelling fixes.

Mostly comments but also some user-visible strings.

MFC after: 2 weeks

8 years agoxen/time: fix PV clock resolution
royger [Mon, 2 May 2016 16:16:08 +0000 (16:16 +0000)]
xen/time: fix PV clock resolution

The current resolution of the Xen PV clock is too high, which causes an
adjustment of 5s to be applied to it. Reduce the resolution to be the same
as the RTC plus one, so it's always selected as the best source when
available on x86.

Also don't reset the clock on resume, it's pointless and discards any
previous adjustments.

Sponsoted by: Citrix Systems R&D

8 years agoxen/time: allow Dom0 to set the host time
royger [Mon, 2 May 2016 16:15:28 +0000 (16:15 +0000)]
xen/time: allow Dom0 to set the host time

Dom0 should be able to set the host time. This is implemented by first
writing to the RTC (as would be done on bare metal), and then using the
XENPF_settime64 hypercall in order to force Xen to update the wallclock
shared page of all domains.

Sponsored by: Citrix Systems R&D

8 years agoatrtc: export function to set RTC
royger [Mon, 2 May 2016 16:14:55 +0000 (16:14 +0000)]
atrtc: export function to set RTC

This is going to be used by the Xen clock on Dom0 in order to set the RTC of
the host. The current logic in atrtc_settime is moved to atrtc_set and the
unused device_t parameter is removed from the atrtc_set function call so it
can be safely used by other callers.

Sponsored by: Citrix Systems R&D
Reviewed by: kib, jhb
Differential revision: https://reviews.freebsd.org/D6067

8 years agoxen/timer: remove the timer setup loop
royger [Mon, 2 May 2016 16:13:55 +0000 (16:13 +0000)]
xen/timer: remove the timer setup loop

With the removal of the usage of the VCPU_SSHOTTMR_future flag, now
all errors from xentimer_vcpu_start_timer should be considered fatal, and
the loop is no longer needed since in case of setting the timer in the past
we will get an event interrupt right away (instead of returning ETIME).

Sponsored by: Citrix Systems R&D
MFC after : 2 weeks

8 years agoxen/x86: don't lose event interrupts
royger [Mon, 2 May 2016 16:13:11 +0000 (16:13 +0000)]
xen/x86: don't lose event interrupts

On slow platforms with unreliable TSC, such as QEMU emulated machines,
it is possible for the FreeBSD kernel to request the next event in the
past. In that case, in the current implementation of
xentimer_vcpu_start_timer, we simply return -ETIME. To be precise Xen
returns -ETIME and we pass it on. As a consequence we need to loop
around to function to make sure that the timer is properly set.

Instead it is better to always ask the hypervisor for a timer event,
even if the timeout is past. To do that, remove the VCPU_SSHOTTMR_future
flag.

Submitted by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed by: royger
MFC after: 2 weeks

8 years agoiwn: do not buffer frames for non-passive channels (it's not needed).
avos [Mon, 2 May 2016 15:14:16 +0000 (15:14 +0000)]
iwn: do not buffer frames for non-passive channels (it's not needed).

8 years agofgetc returns an int not a char.
bz [Mon, 2 May 2016 15:07:43 +0000 (15:07 +0000)]
fgetc returns an int not a char.

Found by:   powerpc builds failing due to comparing with EOF raised:
"comparison is always false due to limited range of data type"

8 years agodev/random: minor spelling fixes in comments.
pfg [Mon, 2 May 2016 14:35:57 +0000 (14:35 +0000)]
dev/random: minor spelling fixes in comments.

No functional change.

Reviewed by: markm
Approved by: so

8 years agoIssue NOTE_EXTEND when a directory entry is added to or removed from
kib [Mon, 2 May 2016 13:18:17 +0000 (13:18 +0000)]
Issue NOTE_EXTEND when a directory entry is added to or removed from
the monitored directory as the result of rename(2) operation.  The
renames staying in the directory are not reported.

Submitted by: Vladimir Kondratyev <wulf@cicgroup.ru>
MFC after: 2 weeks

8 years agoFix reporting of NOTE_LINK when directory link count changes due to
kib [Mon, 2 May 2016 13:13:32 +0000 (13:13 +0000)]
Fix reporting of NOTE_LINK when directory link count changes due to
rename removing or adding subdirectory entry.

Discussed with and tested by: Vladimir Kondratyev <wulf@cicgroup.ru>
NetBSD PR: 48958 (http://gnats.netbsd.org/48958)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

8 years ago[otus] implement monitor mode.
adrian [Mon, 2 May 2016 05:43:46 +0000 (05:43 +0000)]
[otus] implement monitor mode.

* break out the operating mode and rx filter into new functions, rather
  than them being hard-coded
* if we're in sniffer mode or not associated, set the BSS MAC to all zero,
  rather than relying on a chip reset to do it for us
* add comments about .. how interestingly buggy the chip is.

Tested:

* AR9170 + AR9102, STA+monitor mode

Obtained from: linux carl9170 (general chip workings, constant definitions)

8 years agos/struct device */device_t/
adrian [Mon, 2 May 2016 05:37:25 +0000 (05:37 +0000)]
s/struct device */device_t/

Submitted by: kmacy

8 years ago[mwl] s/struct device/device_t/
adrian [Mon, 2 May 2016 04:15:15 +0000 (04:15 +0000)]
[mwl] s/struct device/device_t/

Submitted by: kmacy

8 years agorpcbind: use our roundup() macro when available through <sys/param.h>.
pfg [Mon, 2 May 2016 02:15:05 +0000 (02:15 +0000)]
rpcbind: use our roundup() macro when available through <sys/param.h>.

No functional change.

8 years agoquot: make use of our rounddown() macro when <sys/param.h> is available.
pfg [Mon, 2 May 2016 02:13:22 +0000 (02:13 +0000)]
quot: make use of our rounddown() macro when <sys/param.h> is available.

No functional change.

8 years agoUse MIN macro from sys/param.h.
araujo [Mon, 2 May 2016 01:49:42 +0000 (01:49 +0000)]
Use MIN macro from sys/param.h.

MFC after: 2 weeks.

8 years agoUse MIN/MAX macros from sys/param.h.
araujo [Mon, 2 May 2016 01:47:13 +0000 (01:47 +0000)]
Use MIN/MAX macros from sys/param.h.

MFC after: 2 weeks.

8 years agoUse MIN macro from sys/param.h.
araujo [Mon, 2 May 2016 01:45:52 +0000 (01:45 +0000)]
Use MIN macro from sys/param.h.

MFC after: 2 weeks.

8 years agoUse MAX macro from sys/param.h.
araujo [Mon, 2 May 2016 01:43:22 +0000 (01:43 +0000)]
Use MAX macro from sys/param.h.

MFC after: 2 weeks.

8 years agoUse MIN macro from sys/param.h.
araujo [Mon, 2 May 2016 01:40:31 +0000 (01:40 +0000)]
Use MIN macro from sys/param.h.

MFC after: 2 weeks

8 years agoUse MIN/MAX macros from sys/param.h.
araujo [Mon, 2 May 2016 01:28:21 +0000 (01:28 +0000)]
Use MIN/MAX macros from sys/param.h.

MFC after: 2 weeks.

8 years agoUse MIN()/MAX() macros from sys/param.h.
araujo [Mon, 2 May 2016 00:45:46 +0000 (00:45 +0000)]
Use MIN()/MAX() macros from sys/param.h.

Reviewed by: trasz
MFC after: 2 weeks.
Differential Revision: https://reviews.freebsd.org/D6118

8 years agoUse MIN() macro from sys/param.h.
araujo [Mon, 2 May 2016 00:44:19 +0000 (00:44 +0000)]
Use MIN() macro from sys/param.h.

Reviewed by: trasz
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6119

8 years agoSpelling fixes supplied by pfg@, detected with codespell, plus
wblock [Sun, 1 May 2016 22:00:41 +0000 (22:00 +0000)]
Spelling fixes supplied by pfg@, detected with codespell, plus
additional misspellings detected by igor.

MFC after: 1 week

8 years agoiwn: switch to ieee80211_add_channel*()
avos [Sun, 1 May 2016 22:00:40 +0000 (22:00 +0000)]
iwn: switch to ieee80211_add_channel*()

Switch to add_channel / add_channel_ht40 + pass channel's TX power
for the last.

Tested by: dhw
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D6141

8 years agoWhen a client uses UDP encapsulation and lists IP addresses in the INIT
tuexen [Sun, 1 May 2016 21:48:55 +0000 (21:48 +0000)]
When a client uses UDP encapsulation and lists IP addresses in the INIT
chunk, enable UDP encapsulation for all those addresses.
This helps clients using a userland stack to support multihoming if
they are not behind a NAT.

MFC after: 1 week

8 years agorestore: promote some getfiles() parameters to size_t.
pfg [Sun, 1 May 2016 21:17:30 +0000 (21:17 +0000)]
restore: promote some getfiles() parameters to size_t.

This is based on a change from OpenBSD:

"Fix restore so that it can actually restore files larger than 4GB by
changing the type of "size" to off_t in getfiles() plus little dependent
type cleanup, from Daniel Lucq."

It is an important for machines with 32 bit longs.
While here unsign the flags, also from OpenBSD.

Obtained from: OpenBSD (through bitrig, I hate CVS)
MFC after: 2 weeks

8 years agobcache read ahead may attempt to read past end of disk
allanjude [Sun, 1 May 2016 21:06:59 +0000 (21:06 +0000)]
bcache read ahead may attempt to read past end of disk

The new bcache code does not know the size of the disk, and therefore may attempt to read past the end of the disk while trying to fill its read-ahead cache.

This is usually not an issue, it fails gracefully on all of my machines, but some BIOSes seem to retry the reads for up to 30 seconds each, resulting in a long stall during boot

Submitted by: Toomas Soome <tsoome@me.com>
Reviewed by: jhb, np
Differential Revision: https://reviews.freebsd.org/D6109

8 years agonet80211: calculate IEEE80211_MODE_BYTES / IEEE80211_CHAN_BYTES
avos [Sun, 1 May 2016 20:57:10 +0000 (20:57 +0000)]
net80211: calculate IEEE80211_MODE_BYTES / IEEE80211_CHAN_BYTES
instead of hardcoding it.

Suggested by: adrian

8 years agoAs a reader service, explain NOTE_LINK reporting for the directories.
kib [Sun, 1 May 2016 20:54:29 +0000 (20:54 +0000)]
As a reader service, explain NOTE_LINK reporting for the directories.

Submitted by: Vladimir Kondratyev <wulf@cicgroup.ru>
MFC after: 1 week

8 years agolibexec: minor spelling fixes in comments.
pfg [Sun, 1 May 2016 19:39:23 +0000 (19:39 +0000)]
libexec: minor spelling fixes in comments.

No functional change.

8 years agolib: minor spelling fixes in comments.
pfg [Sun, 1 May 2016 19:37:33 +0000 (19:37 +0000)]
lib: minor spelling fixes in comments.

No functional change.

8 years agorum: switch to ieee80211_add_channel_list_*()
avos [Sun, 1 May 2016 18:53:12 +0000 (18:53 +0000)]
rum: switch to ieee80211_add_channel_list_*()

- Use device's channel list instead of default one
(from ieee80211_init_channels()).
- Add ic_getradiocaps() method.

Added channels:
2GHz band: 12, 13 and 14.
5Ghz band: 34, 38, 42, 46 and 165.

Tested with WUSB54GC, STA / MONITOR modes.

Differential Revision: https://reviews.freebsd.org/D6125

8 years agootus: switch to ieee80211_add_channel_list_*()
avos [Sun, 1 May 2016 18:15:40 +0000 (18:15 +0000)]
otus: switch to ieee80211_add_channel_list_*()

- Use device's channel list instead of default one
(from ieee80211_init_channels()).
- Sort channels (ieee80211_add_channel_list_* requirement).
- Add ic_getradiocaps() method.

Added channels:
2GHz band: 12, 13 and 14.
5GHz band: 34, 38, 42, 46 and 165.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D6145

8 years agoProvide an example to the kqueue man page, showing
bcr [Sun, 1 May 2016 18:09:34 +0000 (18:09 +0000)]
Provide an example to the kqueue man page, showing
a basic usage example.  Although it is an
untypical example for the use of kqueue, it is
better than nothing and should get people started.

PR: 196844
Submitted by: fernando.apesteguia@gmail.com
Reviewed by: kib
Approved by: kib
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D6082

8 years agoAdd a manual page for pkt-gen.
gnn [Sun, 1 May 2016 17:55:45 +0000 (17:55 +0000)]
Add a manual page for pkt-gen.

Sponsored by: EMC / Isilon Storage Division

8 years agoAvoid duplicated calls to pmap_page_get_memattr().
kib [Sun, 1 May 2016 17:48:43 +0000 (17:48 +0000)]
Avoid duplicated calls to pmap_page_get_memattr().

Avoid logging inconsistency for the /dev/mem device at all. The driver
leaves memattr intact, and the corrective action in the device pager
handles it right.

In the logged warning, name the driver we blame, and show memory
attributes values.

Reported and tested by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D6149

8 years agoMake it explicit that D_MEM cdevsw d_flag is to signify that the
kib [Sun, 1 May 2016 17:46:56 +0000 (17:46 +0000)]
Make it explicit that D_MEM cdevsw d_flag is to signify that the
driver is (or behaves identically to) /dev/mem.  Remove the D_MEM flag
from random drivers.

Note that currently the D_MEM flag does not affect any behaviour, but
this going to change in the next commit.

Noted and reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-Differential revision: https://reviews.freebsd.org/D6149

8 years agotypo
jamie [Sun, 1 May 2016 16:48:03 +0000 (16:48 +0000)]
typo

Submitted by: Jimmy Olgeni

8 years agoetc: minor spelling fixes.
pfg [Sun, 1 May 2016 16:43:22 +0000 (16:43 +0000)]
etc: minor spelling fixes.

Mostly comments but these tend to be user-visible.

MFC after: 2 weeks

8 years agousr.sbin: minor spelling fixes on comments.
pfg [Sun, 1 May 2016 16:41:25 +0000 (16:41 +0000)]
usr.sbin: minor spelling fixes on comments.

No functional change.

8 years agopmcstat: minor spelling fixes.
pfg [Sun, 1 May 2016 16:40:56 +0000 (16:40 +0000)]
pmcstat: minor spelling fixes.

Mostly comments bur also a user-visible string.

MFC after: 2 weeks

8 years agousr.sbin/bsdconfig: minor spelling fixes on comments.
pfg [Sun, 1 May 2016 16:38:12 +0000 (16:38 +0000)]
usr.sbin/bsdconfig: minor spelling fixes on comments.

No functional change.

8 years agobluetooth: minor spelling fixes.
pfg [Sun, 1 May 2016 16:36:14 +0000 (16:36 +0000)]
bluetooth: minor spelling fixes.

User-visible strings.

MFC after: 2 weeks

8 years agoshare: minor spelling fixes.
pfg [Sun, 1 May 2016 16:29:02 +0000 (16:29 +0000)]
share: minor spelling fixes.

Mostly comments but these tend to be user-visible.

MFC after: 2 weeks

8 years agotools: minor spelling fixes.
pfg [Sun, 1 May 2016 16:20:14 +0000 (16:20 +0000)]
tools: minor spelling fixes.

Mostly comments but also some user-visible strings.

MFC after: 2 weeks

8 years agopicobsd: minor spelling fixes.
pfg [Sun, 1 May 2016 16:16:11 +0000 (16:16 +0000)]
picobsd: minor spelling fixes.

8 years agousr.bin: minor spelling fixes on comments.
pfg [Sun, 1 May 2016 16:13:05 +0000 (16:13 +0000)]
usr.bin: minor spelling fixes on comments.

No functional change.

8 years agolocaledef(1): minor spelling fixes on comments.
pfg [Sun, 1 May 2016 16:10:56 +0000 (16:10 +0000)]
localedef(1): minor spelling fixes on comments.

No functional change.

8 years agoiwm: switch to ieee80211_add_channel()
avos [Sun, 1 May 2016 14:27:27 +0000 (14:27 +0000)]
iwm: switch to ieee80211_add_channel()

- Switch to ieee80211_add_channel().
- Parse/set more channel flags (DFS, NOADHOC).
- Add ic_getradiocaps() method.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D6150

8 years agoRemove useless calls to basename().
ed [Sun, 1 May 2016 08:22:11 +0000 (08:22 +0000)]
Remove useless calls to basename().

There are a couple of places in the source three where we call
basename() on constant strings. This is bad, because the prototype
standardized by POSIX allows the implementation to use its argument as a
storage buffer.

This change eliminates some of these unportable calls to basename() in
cases where it was only added for cosmetical reasons, namely to trim
argv[0]. There's nothing wrong with setting argv[0] to the full path.

Reviewed by: jilles
Differential Revision: https://reviews.freebsd.org/D6093

8 years ago[iwn] fill in the TX command rate info flags consistently.
adrian [Sun, 1 May 2016 05:01:10 +0000 (05:01 +0000)]
[iwn] fill in the TX command rate info flags consistently.

The Linux driver sets the rate_n_flags regardless of whether it's being
sent using firmware rate control or local rate control.  This includes
the antenna configuration.

Thanks to Kyle Evans <kevans91@ksu.edu> for pointing this out to me
and doing some investigation/testing on his end.

Tested:

* Intel 7260 STA, 2G and 5G networks

8 years agorestore: fix resource handle leak.
pfg [Sun, 1 May 2016 02:39:39 +0000 (02:39 +0000)]
restore: fix resource handle leak.

CID: 1007784
MFC after: 5 days

8 years agorestore: drop casts for calloc().
pfg [Sun, 1 May 2016 02:31:22 +0000 (02:31 +0000)]
restore: drop casts for calloc().

8 years agosbin: ake use of our rounddown() macro when sys/param.h is available.
pfg [Sun, 1 May 2016 02:24:05 +0000 (02:24 +0000)]
sbin: ake use of our rounddown() macro when sys/param.h is available.

No functional change.

8 years agosbin: use our howmany() macro when available through <sys/param.h>.
pfg [Sun, 1 May 2016 02:19:49 +0000 (02:19 +0000)]
sbin: use our howmany() macro when available through <sys/param.h>.

8 years agorestore: fix memory leak.
pfg [Sat, 30 Apr 2016 22:51:09 +0000 (22:51 +0000)]
restore: fix memory leak.

CID: 272297
MFC after: 5 days

8 years agoAllow FILESGROUPS to be specified more than once by pruning out duplicates
ngie [Sat, 30 Apr 2016 21:32:29 +0000 (21:32 +0000)]
Allow FILESGROUPS to be specified more than once by pruning out duplicates

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoClarify when happens when there is a "depend" parameter in jail.conf,
jamie [Sat, 30 Apr 2016 21:27:41 +0000 (21:27 +0000)]
Clarify when happens when there is a "depend" parameter in jail.conf,
and how this affects the "jail_list" option in rc.conf.

8 years agorestore: use our howmany() instead of reinventing the macro.
pfg [Sat, 30 Apr 2016 20:05:23 +0000 (20:05 +0000)]
restore: use our howmany() instead of reinventing the macro.

8 years agofdisk: drop unused macro and make use of roundup()/rounddown().
pfg [Sat, 30 Apr 2016 19:58:54 +0000 (19:58 +0000)]
fdisk: drop unused macro and make use of roundup()/rounddown().

8 years agopowerpc: Replace rounddown() from r298856 with roundup().
pfg [Sat, 30 Apr 2016 19:50:59 +0000 (19:50 +0000)]
powerpc: Replace rounddown() from r298856 with roundup().

Both are equivalent but roundup is more logical for this case.
Catch another case while here.

Pointed out by: jhibbits

8 years agoWhen attempting to satisfy mmap() requests for superpage alignment on
rwatson [Sat, 30 Apr 2016 19:29:03 +0000 (19:29 +0000)]
When attempting to satisfy mmap() requests for superpage alignment on
64-bit MIPS, use superpage rather than physical-segment constants, or
we may improperly fail to apply suitable alignment -- yet still allow
mmap() to appear to succeed.

Reviewed by: sson
MFC after: 1 week
Sponsored by: DARPA, AFRL

8 years agosbin: minor spelling fixes.
pfg [Sat, 30 Apr 2016 19:04:59 +0000 (19:04 +0000)]
sbin: minor spelling fixes.

No functional change.

8 years agoFix incorrect permissions for /etc/rc.d/sendmail in fallout from
peter [Sat, 30 Apr 2016 19:01:51 +0000 (19:01 +0000)]
Fix incorrect permissions for /etc/rc.d/sendmail in fallout from
release-pkg merge.

8 years agopowerpc: Make use of our rounddown() macro when sys/param.h is available.
pfg [Sat, 30 Apr 2016 18:56:35 +0000 (18:56 +0000)]
powerpc: Make use of our rounddown() macro when sys/param.h is available.

No functional change.

8 years agoACK the interrupt after disabling it, this avoid an interrupt storm.
manu [Sat, 30 Apr 2016 18:07:13 +0000 (18:07 +0000)]
ACK the interrupt after disabling it, this avoid an interrupt storm.

Approved by: andrew (mentor)

8 years agoAdd a MULTIDELAY option to allow the ARM kernel to have multiple DELAY
andrew [Sat, 30 Apr 2016 17:27:33 +0000 (17:27 +0000)]
Add a MULTIDELAY option to allow the ARM kernel to have multiple DELAY
implementations. Early in the boot the kernel will use an approximate,
however after the timer has been probed it will switch to a more accurate
implementation.

Reviewed by: manu
Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D5762

8 years agoRationalize license numbering in fdescfs(5)
emaste [Sat, 30 Apr 2016 16:01:37 +0000 (16:01 +0000)]
Rationalize license numbering in fdescfs(5)

8 years agoWhen checking for binary file, check if ch is not EOF only ch actually got
bapt [Sat, 30 Apr 2016 14:48:30 +0000 (14:48 +0000)]
When checking for binary file, check if ch is not EOF only ch actually got
a value assigned

Reported by: pfg

8 years agoinclude: minor spelling fixes.
pfg [Sat, 30 Apr 2016 14:43:42 +0000 (14:43 +0000)]
include: minor spelling fixes.

No functional change.

8 years agosys: Make use of our rounddown() macro when sys/param.h is available.
pfg [Sat, 30 Apr 2016 14:41:18 +0000 (14:41 +0000)]
sys: Make use of our rounddown() macro when sys/param.h is available.

No functional change.

8 years agoAdd the UDP encaps port as a parameter to sctp_add_remote_addr().
tuexen [Sat, 30 Apr 2016 14:25:00 +0000 (14:25 +0000)]
Add the UDP encaps port as a parameter to sctp_add_remote_addr().

This is currently only a code change without any functional
change. But this allows to set the remote encapsulation port
in a more detailed way, which will be provided in a follow-up
commit.

MFC after: 1 week

8 years agoANSIfy fdescfs(5)
emaste [Sat, 30 Apr 2016 12:44:03 +0000 (12:44 +0000)]
ANSIfy fdescfs(5)

8 years agoUpdate from subversion 1.9.2 to 1.9.4.
dim [Sat, 30 Apr 2016 10:35:42 +0000 (10:35 +0000)]
Update from subversion 1.9.2 to 1.9.4.

This contains only bug fixes, no new features.  The repository format is
also unchanged from 1.9.2.  Full list of changes between 1.9.4 and
earlier versions:

  https://svn.apache.org/repos/asf/subversion/tags/1.9.4/CHANGES

Note that the two security issues fixed in 1.9.4 (CVE-2016-2167 and
CVE-2016-2168) do not affect the version of Subversion in the FreeBSD
base system, since neither SASL nor Apache modules are enabled.

Relnotes: yes
MFC after: 2 weeks

8 years agoMake SERVERS REQUIRE clean when MK_KERBEROS==no
ngie [Sat, 30 Apr 2016 09:50:08 +0000 (09:50 +0000)]
Make SERVERS REQUIRE clean when MK_KERBEROS==no

Make kdc run BEFORE SERVERS instead of being REQUIREd by SERVERS,
so systems that pedantically check REQUIREs function after r270782

MFC after: 1 week
X-MFC with: r270782
Sponsored by: EMC / Isilon Storage Division

8 years agoDon't leak PML4 in _amd64_initvtop(..) if kvm_read2(..) fails
ngie [Sat, 30 Apr 2016 09:32:19 +0000 (09:32 +0000)]
Don't leak PML4 in _amd64_initvtop(..) if kvm_read2(..) fails

MFC after: 1 week
Reported by: Coverity
CID: 1341474
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove a -Wunused-but-set-variable variable -- `pa`
ngie [Sat, 30 Apr 2016 09:31:01 +0000 (09:31 +0000)]
Remove a -Wunused-but-set-variable variable -- `pa`

Reported by: gcc 5.x
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove kvm_getfiles(3)
ngie [Sat, 30 Apr 2016 09:21:13 +0000 (09:21 +0000)]
Remove kvm_getfiles(3)

This libcall has been broken since (at least) r174989/8.0-RELEASE.

Bump SHLIB_MAJOR for the change

Differential Revision: https://reviews.freebsd.org/D6052
Relnotes: yes
Reviewed by: jhb, markj
Sponsored by: EMC / Isilon Storage Division

8 years agoFix memory allocation edgecases in kvm_argv(..)
ngie [Sat, 30 Apr 2016 09:13:26 +0000 (09:13 +0000)]
Fix memory allocation edgecases in kvm_argv(..)

- Don't leak nbufp on realloc failure in kvm_argv
- Catch malloc errors with bufp
- Set buflen last in the "buflen == 0" case to ensure that
  bufp/nbufp is properly reallocated on the next go around

Differential Revision: https://reviews.freebsd.org/D6051
MFC after: 1 week
Reviewed by: jhb, markj
Reported by: cppcheck
Sponsored by: EMC / Isilon Storage Division

8 years agoRevert AccessWidth/BitOffset support for AcpiHwWrite() and AcpiHwRead() for
jkim [Sat, 30 Apr 2016 06:48:48 +0000 (06:48 +0000)]
Revert AccessWidth/BitOffset support for AcpiHwWrite() and AcpiHwRead() for
now.  The following upstream commits are reverted from hwregs.c:

https://github.com/acpica/acpica/commit/96ece05
https://github.com/acpica/acpica/commit/3d8583a
https://github.com/acpica/acpica/commit/48eea5e
https://github.com/acpica/acpica/commit/0a212c3
https://github.com/acpica/acpica/commit/41f6aef
https://github.com/acpica/acpica/commit/26434b9
https://github.com/acpica/acpica/commit/c23034a
https://github.com/acpica/acpica/commit/c49a751

Note this commit will be reverted when the upstream fixes the code properly.