Try harder to make mxge safe for all combinations of INET and INET6

- Re-fix build by restoring local removed in r247151, but protected
  by #if defined(INET) || defined(INET6) so that the compile
  succeeds in the !(INET||INET6) case.

- Protect call to in_pseudo() with an #ifdef INET, to allow
  a kernel to link with mxge when INET is not compiled in.

- Also remove an errant (improperly commented) obsolete debugging printf

Thanks to Glebius for pointing out the !(INET||INET6) build issue.

Sponsored by: Myricom

MFC After: 7 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247152 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Eliminate an unused #define.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247153 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add DA_Q_NO_PREVENT quirk for Kingston DataTraveler G3 1.00 USB flash.

PREVENT ALLOW MEDIUM REMOVAL commands return errors on these devices
without returning sense data. In some cases unrelated following commands
start to return errors too, that makes device to be dropped by CAM.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247154 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Improvements for newer mxge nics:

- Some mxge nics may store the serial number in the SN2 field of the
  EEPROM.  These will also have an SN=0 field, so parse the SN2 field,
  and give it precedence.

- Skip MXGEFW_CMD_UNALIGNED_TEST on mxge nics which do not require it.
  This saves roughly 10ms per port at device attach time.

Sponsored by: Myricom

MFC After: 7 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247159 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Bump mxge copyright.

Sponsored by: Myricom

MFC After: 7 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247160 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Hide SEMB port of the SiI3826 Port Multiplier by default to avoid extra
errors while it tries to talk via I2C to usually missing external SEP.
There is tunable to enable it back when needed.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247161 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Back out prev. change preventing /sys/sys symlink. It appears my install
was not very recent and not acts like 'ln -h'


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247162 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Don't print an empty line for files with no attributes when -q is given for
lsextattr(8).


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247164 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix command timeout caused by data underrun during fetching ATAPI sense
data, introduced by r246713.  There are two places where ata_request is
filled in ATA_CAM: ata_cam_begin_transaction() and ata_cam_request_sense().
In the first case DMA should be done for addresses from the CCB. In second
case, DMA should be done to the different address, the address of the sense
buffer inside the CCB structure itself.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247165 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Pull in r172354 from upstream clang trunk:

  Refactor the x86 CPU name logic in the driver and pass -march and -mcpu
  flag information down from the Clang driver into the Gold linker plugin
  for LTO. This allows specifying -march on the linker commandline and
  should hopefully have it pass all the way through to the LTO optimizer.

  Fixes PR14697.

Pull in r175919 from upstream clang trunk:

  Driver: Pass down the -march setting down to -cc1as on x86 too.

  The assembler historically didn't make use of any target features, but this has
  changed when support for old CPUs that don't support long nops was added.

This should fix the long nops that still occurred in crt*.o, and
possibly other object files, if the system was compiled for a CPU that
does not support those, such as Geode.

Note that gcc on i386 also does not pass through any -march, -mcpu or
-mtune setting to gas, but this has not caused any trouble yet, because
gas defaults to i386.

Reported by:	lev
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247166 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFV r246653:
Import vendor change to avoid "unitialized variable" warnings.

Illumos ZFS issues:
  3522 zfs module should not allow uninitialized variables

References:
  https://www.illumos.org/issues/3522


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247187 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Now that qsort(3) has a sample comparison function, point to that
example from bsearch(3) too, so that we don't have to duplicate
the example code in both places.

PR:		docs/176197
Reviewed by:	stefanf
Approved by:	remko (mentor), gjb (mentor)
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247189 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sh: Test that the exit status is 1 if read encounters EOF.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247190 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add basic and not very reliable protection against going to sleep with
thread scheduled by interrupt fired after we entered critical section.
None of cpu_sleep() implementations on ARM check sched_runnable() now, so
put the first line of defence here.  This mostly fixes unexpectedly long
sleeps in synthetic tests of calloutng code and probably other situations.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247195 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Enable PREEMPTION by default now that PR 147501 has been fixed.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247197 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Print kernel args as late as possible before jumping into kernel.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247200 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
"fdt addr" gets run from loader.rc before the kernel is loaded.
This was broken by r247045 which tried to copy the FDT into the
module directory immediately.
Instead, store the address and arrange for the FDT to get
copied into the module directory later when the usual
FDT initialization runs.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247201 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add macroses to properly map IO peripherals memory window from
    ARM physical memory address space to VideoCore address space


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247204 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Pull in r175962 from upstream llvm trunk:

  X86: Disable cmov-memory patterns on subtargets without cmov.

  Fixes PR15115.

For the i386 arch, this should enable cmov instructions only on
-march=pentiumpro and higher.  Since our default CPU is i486, cmov
instructions will now be disabled by default.

MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247205 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sh: If a SIGINT or SIGQUIT interrupts "wait", return status 128+sig.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@247206 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f