openbsd
6 years agoTIOCUCNTL is now allowed by promise "tty".
mpi [Mon, 8 Jan 2018 12:02:42 +0000 (12:02 +0000)]
TIOCUCNTL is now allowed by promise "tty".

Reminded by jmc@

6 years agoEnable TIOCUCNTL to be able to set ns8250's break detected condition.
mpi [Mon, 8 Jan 2018 11:58:27 +0000 (11:58 +0000)]
Enable TIOCUCNTL to be able to set ns8250's break detected condition.

It is now possible to send BREAK commands to vmd(8) independently of
the serial terminal emulator.

Happy virtual ddb(4) hacking!

No objection from mlarkin@, ok nicm@, ccardenas@, deraadt@

6 years agoAllow TIOCUCNTL issued on a pty(4) master in promise "tty".
mpi [Mon, 8 Jan 2018 11:54:28 +0000 (11:54 +0000)]
Allow TIOCUCNTL issued on a pty(4) master in promise "tty".

This will be soon be used to emulate BREAK commands in vmd(8).

ok nicm@, ccardenas@, deraadt@

6 years agoTranslate the TIOCSBRK & TIOCCBRK ioctl(2)s issued on a pty(4) slave to
mpi [Mon, 8 Jan 2018 11:52:14 +0000 (11:52 +0000)]
Translate the TIOCSBRK & TIOCCBRK ioctl(2)s issued on a pty(4) slave to
corresponding user mode ioctls.

If the master part of the pseudo terminal previously enabled TIOCUCNTL,
it will now receive the TIOCUCNTL_{S,C}BRK commands.  This allows to
send BREAKS commands over a pty(4) independently of the serial terminal
emulator used.

Guidance and ok nicm@, ok ccardenas@, looks ok to deraadt@

6 years agoAttach dwiic_pci on Dell Precision 7520. Also restrict ihidev reports
mlarkin [Mon, 8 Jan 2018 08:14:00 +0000 (08:14 +0000)]
Attach dwiic_pci on Dell Precision 7520. Also restrict ihidev reports
to those of 3 bytes or more (as per the hid-over-i2c spec).

discussed with jcs, kettenis

6 years agoMark up command strings with Cm, and variables with Va.
bentley [Mon, 8 Jan 2018 05:42:48 +0000 (05:42 +0000)]
Mark up command strings with Cm, and variables with Va.

ok jmc@

6 years agoDelete flowrings when we take the interface down or change its
patrick [Mon, 8 Jan 2018 00:46:15 +0000 (00:46 +0000)]
Delete flowrings when we take the interface down or change its
settings.

6 years agoAdd regression tests for cdrom keyword
ccardenas [Sun, 7 Jan 2018 22:59:57 +0000 (22:59 +0000)]
Add regression tests for cdrom keyword

ok mlarkin@

6 years agoCreate multiple transmit flowrings in station mode, four in total, based
patrick [Sun, 7 Jan 2018 22:08:04 +0000 (22:08 +0000)]
Create multiple transmit flowrings in station mode, four in total, based
on TOS values.  In AP mode create multiple flowrings per connected node.

6 years agodelete a wrong comment
mlarkin [Sun, 7 Jan 2018 21:43:25 +0000 (21:43 +0000)]
delete a wrong comment

6 years agoremove all PG_G global page mappings from the kernel when running on
mlarkin [Sun, 7 Jan 2018 19:56:19 +0000 (19:56 +0000)]
remove all PG_G global page mappings from the kernel when running on
Intel CPUs. Part of an ongoing set of commits to mitigate the Intel
"meltdown" CVE. This diff does not confer any immunity to that
vulnerability - subsequent commits are still needed and are being
worked on presently.

ok guenther, deraadt

6 years agoAdd proper bounds checking to kb_add(). OK anton@
millert [Sun, 7 Jan 2018 19:18:56 +0000 (19:18 +0000)]
Add proper bounds checking to kb_add().  OK anton@

6 years agoamd64_{get,set}_fsbase() are superfluous and unused; delete them.
guenther [Sun, 7 Jan 2018 18:54:44 +0000 (18:54 +0000)]
amd64_{get,set}_fsbase() are superfluous and unused; delete them.
Delete unused/never-implemented sysarch defines and structs while here.

ports check and ok naddy@
ok deraadt@ mlarkin@

6 years agoUse __inline instead of inline as this header file might be included in a
kettenis [Sun, 7 Jan 2018 15:17:42 +0000 (15:17 +0000)]
Use __inline instead of inline as this header file might be included in a
"strict ansi" environment (even though it shouldn't be).  Found out the hard
way by phessler@ with a port that uses gcc -ansi.

ok millert@, phessler@

6 years agoadd arch to Dt;
jmc [Sun, 7 Jan 2018 13:56:30 +0000 (13:56 +0000)]
add arch to Dt;

6 years agoOn OpenBSD/armv7 we deliberately trap unaligned access. Unfortunately
kettenis [Sun, 7 Jan 2018 12:35:52 +0000 (12:35 +0000)]
On OpenBSD/armv7 we deliberately trap unaligned access.  Unfortunately
the assembly code in libcrypto assumes unaligned access is allowed for
ARMv7.  Make these paths conditional on __STRICT_ALIGNMENT not being
defined and define __STRICT_ALIGNMENT in arm_arch.h for OpenBSD.

ok tom@

6 years agoRemove unused extern variable in openssl(1) s_time
inoguchi [Sun, 7 Jan 2018 08:43:26 +0000 (08:43 +0000)]
Remove unused extern variable in openssl(1) s_time

This extern variable appears not to be used.
And it is overridden by local variable in doConnection().
This causes MSVC warning C4459 "declaration of 'verify_error'
hides global declaration".

OK millert@

6 years agoDelete obsolete/untrue comments
guenther [Sun, 7 Jan 2018 05:36:47 +0000 (05:36 +0000)]
Delete obsolete/untrue comments

6 years agoremove a ridiculous comment and move another comment to the line it was
mlarkin [Sun, 7 Jan 2018 05:35:10 +0000 (05:35 +0000)]
remove a ridiculous comment and move another comment to the line it was
really intended to describe. no functional change

6 years agoAssume that direct-mapped addresses come from the xkphys segment.
visa [Sun, 7 Jan 2018 05:30:03 +0000 (05:30 +0000)]
Assume that direct-mapped addresses come from the xkphys segment.

6 years agoAdd references to errata.
visa [Sun, 7 Jan 2018 05:19:41 +0000 (05:19 +0000)]
Add references to errata.

6 years agoAdd identcpu.c and specialreg.h definitions for the new Intel/AMD MSRs
mlarkin [Sun, 7 Jan 2018 01:08:20 +0000 (01:08 +0000)]
Add identcpu.c and specialreg.h definitions for the new Intel/AMD MSRs
that should help mitigate spectre. This is just the detection piece, these
features are not yet used.

Part of a larger ongoing effort to mitigate meltdown/spectre. i386 will
come later; it needs some machdep.c cleanup first.

ok kettenis@

6 years agoAdd fs to the application/octet-stream extensions, mostly for installXX.fs,
sthen [Sat, 6 Jan 2018 22:05:03 +0000 (22:05 +0000)]
Add fs to the application/octet-stream extensions, mostly for installXX.fs,
to help with a problem noticed by tj@ and diagnosed by job@, ok phessler

For OpenBSD distfile mirrors running httpd who want to do this before
getting the updated mime.types, you can set:

.  types {
.          application/octet-stream    fs
.  }

6 years agoHandle %gs like %[def]s and reset set it in cpu_switchto() instead of on
guenther [Sat, 6 Jan 2018 22:03:12 +0000 (22:03 +0000)]
Handle %gs like %[def]s and reset set it in cpu_switchto() instead of on
every return to userspace.

ok kettenis@ mlarkin@

6 years agoFix an interrupt storm condition in vldcp(8) (sparc64).
stsp [Sat, 6 Jan 2018 21:35:45 +0000 (21:35 +0000)]
Fix an interrupt storm condition in vldcp(8) (sparc64).

If the Rx channel goes down with pending data on the ring, toss the pending
data to ensure that the firmware's rx ring head index matches the rx ring
tail index. Otherwise we trigger an interrupt storm since vldcpread() never
consumes pending data while the channel is down, and the firmware keeps
triggering the interrupt until all data on the ring is consumed.

Interrupt storm observed and fix tested on a T5220 (which can now run
ldom guests; without this fix starting ldomd would trigger the problem).

ok kettenis@

6 years agoDon't advertise L0s if the "aspm-no-l0s" property is present. Base available
kettenis [Sat, 6 Jan 2018 20:31:03 +0000 (20:31 +0000)]
Don't advertise L0s if the "aspm-no-l0s" property is present.  Base available
bus numbers on the "bus-range" property.  Create outbound translations based
on the "ranges" property.

6 years agoregen
kettenis [Sat, 6 Jan 2018 20:14:30 +0000 (20:14 +0000)]
regen

6 years agoAdd Silicon Motion SM2260 NVMe.
kettenis [Sat, 6 Jan 2018 20:14:01 +0000 (20:14 +0000)]
Add Silicon Motion SM2260 NVMe.

6 years agosync
deraadt [Sat, 6 Jan 2018 19:36:18 +0000 (19:36 +0000)]
sync

6 years agopckbd: don't change translation mode if controller is in table 2
jcs [Sat, 6 Jan 2018 18:51:20 +0000 (18:51 +0000)]
pckbd: don't change translation mode if controller is in table 2

This was changed a decade ago to forcibly try table 3 first in order
to make some now-long-gone hardware work.

Newer Lenovo machines seem to have trouble being asked to change
modes which manifests as a long boot delay as it waits for each
request to timeout, or by causing the keyboard to generate junk when
typing.

Assume table 2 by default and just leave it alone if it's already
there.  This is how Linux has operated for quite a while and seems
to help on these Lenovo machines.

Tested by a few with these machines and has been in snaps for a bit.

6 years agoBring back the sign compare changes, this time with a fix from otto@
millert [Sat, 6 Jan 2018 16:28:58 +0000 (16:28 +0000)]
Bring back the sign compare changes, this time with a fix from otto@
that fixes the issues seen on hppa.  OK deraadt@ otto@

6 years agounifdef LOGIN_CAP, we always want to use login.conf
millert [Sat, 6 Jan 2018 16:26:12 +0000 (16:26 +0000)]
unifdef LOGIN_CAP, we always want to use login.conf
OK jca@, no objection deraadt@

6 years agoRemove dead gettimeofday calls and timevals.
cheloha [Sat, 6 Jan 2018 15:37:36 +0000 (15:37 +0000)]
Remove dead gettimeofday calls and timevals.

ok jca@

6 years agosxits(4)
kettenis [Sat, 6 Jan 2018 13:09:05 +0000 (13:09 +0000)]
sxits(4)

6 years agoEnable sxits(4).
kettenis [Sat, 6 Jan 2018 13:05:20 +0000 (13:05 +0000)]
Enable sxits(4).

6 years agoAdd sxits(4), a driver for the temperature sensor on the Allwinner A10/A20
kettenis [Sat, 6 Jan 2018 13:04:47 +0000 (13:04 +0000)]
Add sxits(4), a driver for the temperature sensor on the Allwinner A10/A20
touchpad controller.

6 years agoEnable sxitemp(4).
kettenis [Sat, 6 Jan 2018 11:48:06 +0000 (11:48 +0000)]
Enable sxitemp(4).

6 years agoSet the proper bus clock rate based on the "clock-frequency" property and
kettenis [Sat, 6 Jan 2018 11:23:14 +0000 (11:23 +0000)]
Set the proper bus clock rate based on the "clock-frequency" property and
the rate of the parent clock.  If the "clock-frequency" property isn't
present, use the default standard mode clock of 100kHz.

6 years agotweak previous;
jmc [Sat, 6 Jan 2018 09:16:37 +0000 (09:16 +0000)]
tweak previous;

6 years agoImport gilles@'s standalone spfwalk utility into smtpctl(8) as
sunil [Sat, 6 Jan 2018 07:59:27 +0000 (07:59 +0000)]
Import gilles@'s standalone spfwalk utility into smtpctl(8) as
'spf walk' command.

Ok gilles@

6 years agoMove unpack functions into a seperate file.
sunil [Sat, 6 Jan 2018 07:57:53 +0000 (07:57 +0000)]
Move unpack functions into a seperate file.

Required for upcoming 'smtpctl spf walk'.
Ok eric@ gilles@ millert@

6 years agoRemove redundant zeroing and dead code.
visa [Sat, 6 Jan 2018 06:30:11 +0000 (06:30 +0000)]
Remove redundant zeroing and dead code.

6 years agorework the transmit and receive paths to address reliability issues.
dlg [Sat, 6 Jan 2018 03:11:04 +0000 (03:11 +0000)]
rework the transmit and receive paths to address reliability issues.

phessler@ has been having trouble with msk on overdrive 1000s. some
of the issues relate to the driver not coping with exhaustion of
mbufs for the rx ring, the other issues are corruption of the mcl9k
pool that msk uses.

this diff adds a timeout that the rx refill code uses when the rx
ring is empty and cannot be filled. it'll periodically retry the
ring refill until it can get some mbufs in the air again.

the current code made hunting for the mcl9k issue too hard, so this
rewrites it to be simpler and more like other drivers. there's now
just arrays of mbuf pointers and dmamaps to shadow the hardware
ring entries, and producer and consumer indexes. what was there
before had linkes lists of something to hold mbuf pointers and
dmamaps, and some way to go from the ring to go back to that. i
think, it was hard to tell what was happening.

this also copies the ADDR64 handling on the tx ring to the rx ring.
this potentially makes more rx descriptors available, but that can
happen later.

in hindsight the mcl9k problem could have been from letting if_rxr
allocate the entier ring. if every descriptor was filled, the chip
may have run around the ring when it shouldnt have. giving rxr one
less descriptor than there is on the ring may have fixed the problem
too.

this work also makes it easier to make msk mpsafe.

tested by an ok phessler@
ok kettenis@ deraadt@

6 years agoTo send out packets we need to create a flowring. Acting as station,
patrick [Fri, 5 Jan 2018 23:30:16 +0000 (23:30 +0000)]
To send out packets we need to create a flowring.  Acting as station,
we typically have about four flowrings per priority.  As access point
we apparently need one, or four considering the priorities, flowrings
per client.  For now let's start with a single TX flowring.  To setup
a flowring we need to send a create request and can only start sending
packets as soon as we are told that the ring is created.  With this we
can now do actual network traffic.

6 years agoDrop incoming network packets as long as we are not in RUN state. This
patrick [Fri, 5 Jan 2018 23:13:04 +0000 (23:13 +0000)]
Drop incoming network packets as long as we are not in RUN state.  This
happens when we successfully associate and the AP tries to initiate the
WPA2 handshake but we haven't received the asynchronous ASSOC event yet.
Dropping the packet will make the AP retry, and at that point we should
have successfully associated.  While there, don't feed the event packets
to our network stack.  It's been helpful for debugging but now it's time
to let go.

6 years agosome minor fixes;
jmc [Fri, 5 Jan 2018 22:25:05 +0000 (22:25 +0000)]
some minor fixes;

6 years agoHandle resets; needed on Allwinner R40/V40.
kettenis [Fri, 5 Jan 2018 22:19:36 +0000 (22:19 +0000)]
Handle resets; needed on Allwinner R40/V40.

6 years agoImplement R40/V40 SATA clock.
kettenis [Fri, 5 Jan 2018 22:18:46 +0000 (22:18 +0000)]
Implement R40/V40 SATA clock.

6 years agoAdd support for AXP221/223.
kettenis [Fri, 5 Jan 2018 22:04:35 +0000 (22:04 +0000)]
Add support for AXP221/223.

6 years agoWhen we receive an AUTH or ASSOC event even though we have already
patrick [Fri, 5 Jan 2018 19:06:37 +0000 (19:06 +0000)]
When we receive an AUTH or ASSOC event even though we have already
reached the RUN state, this probably means that we have roamed to
a different AP.  In that case throw us back into SCAN mode and let
the stack look for a new AP to connect to.  In the future it might
be worthwhile to use the ROAM event information to read the new AP
information to adjust our stack, but that is further down the road.

6 years agoSync with the code in libc
mikeb [Fri, 5 Jan 2018 19:05:09 +0000 (19:05 +0000)]
Sync with the code in libc

OK millert; original commit message by tedu@:

memcpy from the right place. at this point, the used variable is not
relevant. from Mark Karpilovskij.
ok millert

6 years agoMake arm64 use the MI mplock implementation. Avoid <sys/mplock.h> being
kettenis [Fri, 5 Jan 2018 17:42:35 +0000 (17:42 +0000)]
Make arm64 use the MI mplock implementation.  Avoid <sys/mplock.h> being
pulled in for assembly files by bringing <machine/cpu.h> and
<machine/param.h> in line with other architectures.  Some minor cleanup of
those files is included.

ok patrick@

6 years agounifdef JOBS support
jca [Fri, 5 Jan 2018 15:44:31 +0000 (15:44 +0000)]
unifdef JOBS support

Prompted by a mail from Klemens Nanni, who also had the same diff.
ok deraadt@ millert@

6 years agoComplete and fix grammar in comments and bring grammar terms,
krw [Fri, 5 Jan 2018 15:03:09 +0000 (15:03 +0000)]
Complete and fix grammar in comments and bring grammar terms,
function names and function code into sync.

6 years agosome 11n bits; help/ok stsp
jmc [Fri, 5 Jan 2018 14:34:43 +0000 (14:34 +0000)]
some 11n bits; help/ok stsp

6 years ago@libset is going to be part of the dependency information.
espie [Fri, 5 Jan 2018 13:39:55 +0000 (13:39 +0000)]
@libset is going to be part of the dependency information.

6 years agoUse log_warnx() in places where errno is irrelevant.
jca [Fri, 5 Jan 2018 13:34:52 +0000 (13:34 +0000)]
Use log_warnx() in places where errno is irrelevant.

ok mlarkin@ ccardenas@

6 years agoTypos in comments: 'it' -> 'if' and 'noityf' -> 'notify'.
tb [Fri, 5 Jan 2018 13:21:52 +0000 (13:21 +0000)]
Typos in comments: 'it' -> 'if' and 'noityf' -> 'notify'.

from Klemens Nanni

6 years agoRemove unnecessary delays. There is no reason to wait after each and every
kettenis [Fri, 5 Jan 2018 12:46:13 +0000 (12:46 +0000)]
Remove unnecessary delays.  There is no reason to wait after each and every
read or write to aregister.  There is also no reason to wait after
transmitting a STOP since the controller will wait until the bus is free
when transmitting the next START.  Based on a diff by Stephen Graf.

Also remove the interrupt code; it doesn't work on the newer variants of
the device.  The functionality will be put back in a future commit.

ok patrick@

6 years agoShow uvm_fault and trace when typing show panic on a page fault'd kernel
pirofti [Fri, 5 Jan 2018 11:10:25 +0000 (11:10 +0000)]
Show uvm_fault and trace when typing show panic on a page fault'd kernel

Currently there is only support for amd64, if this change settles
I will add support for the rest of the architectures.

OK kettenis@.

6 years agoNo need for <sys/socketvar.h>
mpi [Fri, 5 Jan 2018 10:41:24 +0000 (10:41 +0000)]
No need for <sys/socketvar.h>

6 years agoFix DRM_DEBUG builds.
pirofti [Fri, 5 Jan 2018 09:52:34 +0000 (09:52 +0000)]
Fix DRM_DEBUG builds.

OK jsg@.

6 years agothe value of bflag is a blockno, so use the proper type, avoids
otto [Fri, 5 Jan 2018 09:33:47 +0000 (09:33 +0000)]
the value of bflag is a blockno, so use the proper type, avoids
an overflow seen with scanning for alternate superblocks; ok deraadt@

6 years agoRemove useless <sys/socketvar.h> includes.
mpi [Fri, 5 Jan 2018 08:13:31 +0000 (08:13 +0000)]
Remove useless <sys/socketvar.h> includes.

ok kettenis@, visa@, claudio@, deraadt@

6 years agoaccidental commit
deraadt [Fri, 5 Jan 2018 05:54:36 +0000 (05:54 +0000)]
accidental commit

6 years agobackout, because it breaks builds in dev/microcode.
deraadt [Fri, 5 Jan 2018 05:53:56 +0000 (05:53 +0000)]
backout, because it breaks builds in dev/microcode.
Always build the parts of the tree that use a file.

6 years agocast the result of the ternary ops in __swapXX to the relevant types.
dlg [Fri, 5 Jan 2018 05:08:53 +0000 (05:08 +0000)]
cast the result of the ternary ops in __swapXX to the relevant types.

it appears clang and guenther@ have a different way of interpreting
the c standards around type promotion and ternary operators compared
to gcc and me.

"no you do it" guenther@

6 years agoReceiving an AUTH event means that we successfully authenticated, thus
patrick [Thu, 4 Jan 2018 23:34:06 +0000 (23:34 +0000)]
Receiving an AUTH event means that we successfully authenticated, thus
we have to move to the "trying to" ASSOC state.  When association has
finished we will receive an ASSOC event, so that we can move into the
RUN state.  After that point we will receive ethernet packets and the
WPA2 handshake can occur.  The SET_SSID event will now only be used to
bring us back into SCAN when it notes an error, as it often completes
after we have already done the WPA2 handshake and can not be used to
switch between the different states.

6 years agoAdd more tests that check the timeout behavior of relayd.
bluhm [Thu, 4 Jan 2018 22:58:25 +0000 (22:58 +0000)]
Add more tests that check the timeout behavior of relayd.

6 years agofrom paul de weerd: provide a more helpful Xr to ocspcheck, and note
jmc [Thu, 4 Jan 2018 20:38:12 +0000 (20:38 +0000)]
from paul de weerd: provide a more helpful Xr to ocspcheck, and note
that the path to "file" is not relative to the chroot;

6 years agoadd HISTORY; requested by jiri navratil
jmc [Thu, 4 Jan 2018 20:09:56 +0000 (20:09 +0000)]
add HISTORY; requested by jiri navratil

6 years agoCompact some whitespace, unsplit now shorter lines.
krw [Thu, 4 Jan 2018 19:52:30 +0000 (19:52 +0000)]
Compact some whitespace, unsplit now shorter lines.

6 years agoAdd ARM EABI aliases and remove functions that are also provided by our libc.
kettenis [Thu, 4 Jan 2018 19:46:31 +0000 (19:46 +0000)]
Add ARM EABI aliases and remove functions that are also provided by our libc.
This allows linking code compiled by clang with the gcc compiler driver
and makes sure we always use the softfloat implementation in libc.  The
libc softfloat implementation is preferred over the one in libgcc as it
implements rounding modes and floating point exceptions.

ok patrick@

6 years agoBack out sign compare changes that appear to cause problems on hppa.
millert [Thu, 4 Jan 2018 19:06:16 +0000 (19:06 +0000)]
Back out sign compare changes that appear to cause problems on hppa.
Requested by deraadt@

6 years agoComments and grammar use '_decl' so use _decl instead of _declaration
krw [Thu, 4 Jan 2018 18:26:04 +0000 (18:26 +0000)]
Comments and grammar use '_decl' so use _decl instead of _declaration
in the names of the respective parsing functions.

6 years agoglaring KNF violation
deraadt [Thu, 4 Jan 2018 17:44:20 +0000 (17:44 +0000)]
glaring KNF violation

6 years agoAddress TOCTOU issue with checking to ensure disks are regular files.
ccardenas [Thu, 4 Jan 2018 15:19:56 +0000 (15:19 +0000)]
Address TOCTOU issue with checking to ensure disks are regular files.

Reported by jca@.

Ok mlarkin@ and deraadt@

6 years agoImplement support for calling EFI runtime services and use it to implement
kettenis [Thu, 4 Jan 2018 14:30:08 +0000 (14:30 +0000)]
Implement support for calling EFI runtime services and use it to implement
a time-of-day clock device based on the GetTime() and SetTime() services.
The virtual memory mappings for the runtime services calls are implemented
through a separate pmap that is only activated when we make a runtime services
call.

ok tom@, visa@
tested by naddy@

6 years agospace -> tab
mpi [Thu, 4 Jan 2018 14:21:00 +0000 (14:21 +0000)]
space -> tab

No object change.

6 years agoUnify <machine/mutex.h> a bit further.
mpi [Thu, 4 Jan 2018 11:03:48 +0000 (11:03 +0000)]
Unify <machine/mutex.h> a bit further.

Remove `mtx_lock' from i386, add volatile before `mtx_owner' where it
was missing.

Inputs from kettenis@, ok visa@

6 years agoBack out tx mitigation again because it breaks suspend and resume at
tb [Thu, 4 Jan 2018 11:02:57 +0000 (11:02 +0000)]
Back out tx mitigation again because it breaks suspend and resume at
least on x230 and x240. Problem noted by claudio on icb.

ok dlg

6 years agoDo a FREF/FRELE dance after calling fd_getfile().
mpi [Thu, 4 Jan 2018 10:51:11 +0000 (10:51 +0000)]
Do a FREF/FRELE dance after calling fd_getfile().

This should be enought to prevent `fp' to disapear while sleeping in
malloc(9).

ok helg@

6 years agoInclude timeout & tasks in 'struct ifnet' instead of always allocating
mpi [Thu, 4 Jan 2018 10:48:02 +0000 (10:48 +0000)]
Include timeout & tasks in 'struct ifnet' instead of always allocating
them as M_TEMP.

ok visa@

6 years agoUnifdef snd/rcv.
mpi [Thu, 4 Jan 2018 10:45:30 +0000 (10:45 +0000)]
Unifdef snd/rcv.

ok visa@, claudio@

6 years agoparse_lease_time() is an unnecessary abstraction. Just use
krw [Thu, 4 Jan 2018 03:02:05 +0000 (03:02 +0000)]
parse_lease_time() is an unnecessary abstraction. Just use
parse_number('L') since it is parsing unsigned 32bit integers.

6 years agoWe only parse decimal numbers, so parse_decimal() -> parse_number() to
krw [Thu, 4 Jan 2018 02:27:55 +0000 (02:27 +0000)]
We only parse decimal numbers, so parse_decimal() -> parse_number() to
match grammar comments and improve euphony.

6 years agoremove support for decapsulating LLC/SNAP frames.
dlg [Thu, 4 Jan 2018 00:33:54 +0000 (00:33 +0000)]
remove support for decapsulating LLC/SNAP frames.

the code was broken and noone noticed. this argues that we don't
need it.

ok mpi@

6 years agosync
deraadt [Wed, 3 Jan 2018 23:39:02 +0000 (23:39 +0000)]
sync

6 years agorework __swapXX to avoid the use of __statement.
dlg [Wed, 3 Jan 2018 23:20:10 +0000 (23:20 +0000)]
rework __swapXX to avoid the use of __statement.

the primary motivation of this was to allow the use of things like
htons() and htole16() as case labels. previously gcc would vomit
with "expression is not an integer constant expression" if you tried
that.

ok guenther@

6 years agoassign 1 instead of the result of htole16(1) to a uint8_t.
dlg [Wed, 3 Jan 2018 23:11:06 +0000 (23:11 +0000)]
assign 1 instead of the result of htole16(1) to a uint8_t.

on big endian archs the 1 is shifted to the high byte, which then
gets lost when it's assigned to the uint8_t. at worst we lose the
value, at best the compiler has a teary and fixes it.

this is the fix for a compiler teary.

ok claudio@

6 years agoSince the PCI attachment code already uses mbufs for RX packets, we can
patrick [Wed, 3 Jan 2018 21:01:16 +0000 (21:01 +0000)]
Since the PCI attachment code already uses mbufs for RX packets, we can
push the mbuf allocation down into the USB attachment code and now pass
an mbuf to the bwfm(4) receive function.

6 years agoInstead of adding each and every clock to the list of clocks that are enabled
kettenis [Wed, 3 Jan 2018 20:41:31 +0000 (20:41 +0000)]
Instead of adding each and every clock to the list of clocks that are enabled
by default, simply assume they are.  But do check for this when we attach.

6 years agoAdd ASMedia ASM1061 SATA to the list of devices as it is an AHCI controller
kettenis [Wed, 3 Jan 2018 20:10:40 +0000 (20:10 +0000)]
Add ASMedia ASM1061 SATA to the list of devices as it is an AHCI controller
but doesn't advertise itself as such.

ok dlg@, jmatthew@

6 years agoAdd support for IPv6 over MPLS pseudowire aka mpw(4)
denis [Wed, 3 Jan 2018 19:39:36 +0000 (19:39 +0000)]
Add support for IPv6 over MPLS pseudowire aka mpw(4)

OK claudio@ jca@

6 years agoAdd support for IPv6 over MPLS pseudowire aka mpw(4)
denis [Wed, 3 Jan 2018 19:39:07 +0000 (19:39 +0000)]
Add support for IPv6 over MPLS pseudowire aka mpw(4)

OK claudio@ jca@

6 years agoStop "dd if=/dev/zero of=/dev/null bs=1 count=2 skip=0x7fffffffffffffff"
schwarze [Wed, 3 Jan 2018 19:12:20 +0000 (19:12 +0000)]
Stop "dd if=/dev/zero of=/dev/null bs=1 count=2 skip=0x7fffffffffffffff"
from erroring out with "dd: skip: Undefined error: 0", mostly for
consistency and to avoid the unidiomatic, wrong looking code.
Patch from Bulat Musin <mbulatka at yandex dot ru>.
OK guenther@ millert@

6 years agoUse crypt_checkpass(3) instead of crypt(3).
sunil [Wed, 3 Jan 2018 11:12:21 +0000 (11:12 +0000)]
Use crypt_checkpass(3) instead of crypt(3).

Based on a diff from Edgar Pettijohn.
Ok gilles@ eric@

6 years agoAlways present the same question at the end of installs or upgrades.
rpe [Wed, 3 Jan 2018 10:22:38 +0000 (10:22 +0000)]
Always present the same question at the end of installs or upgrades.
Offer to exit to shell, halt or reboot the system, where 'reboot' is
the default answer. Change default answer to 'halt' for installs if
MDHALT is set to 'y'.

suggested by landry@
OK halex@

6 years agoAdd size for free(9) in the bwfm(4) PCI attachment code.
patrick [Wed, 3 Jan 2018 08:43:10 +0000 (08:43 +0000)]
Add size for free(9) in the bwfm(4) PCI attachment code.

From Michael W. Bombardieri

6 years agoInclude https:// in links, so HTML output doesn't assume they're relative.
bentley [Wed, 3 Jan 2018 08:43:09 +0000 (08:43 +0000)]
Include https:// in links, so HTML output doesn't assume they're relative.

ok jmc@ schwarze@