MFC r251600:
  Avoid unnecessary controller reinitialization by checking driver
  running state.  fxp(4) requires controller reinitialization for the
  following cases.
   o RX lockup condition on i82557
   o promiscuous mode change
   o multicast filter change
   o WOL configuration
   o TSO/VLAN hardware tagging/checksum offloading configuration
   o MAC reprogramming after speed/duplex/flow-control resolution
   o Any events that result in MAC reprogramming(link UP/DOWN,
     remote link partner's restart of auto-negotiation etc)
   o Microcode loading/unloading
  Apart from above cases which come from hardware limitation, upper
  stack also blindly reinitializes controller whenever an IP address
  is assigned. After r194573, fxp(4) no longer needs to reinitialize
  the controller to program multicast filter after upping the
  interface. So keeping track of driver running state should remove
  all unnecessary controller reinitializations.

  This change will also address endless controller reinitialization
  triggered by dhclient(8).


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@251830 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251661:
Replicate r242422 from ata(4) to mvs(4):
Only four specific ATA PIO commands transfer several sectors per DRQ block
(interrupt).  All other ATA PIO commands transfer one sector or 512 bytes
at one time.  Hardcode these exceptions in mvs(4).
This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`.
Also it fixes timeout of DOWNLOAD_MICROCODE on `camcontrol fwdownload`.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@251851 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251659:
Use CAM_DIR_NONE for requests without data.
Wrong values there confuse some drivers.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@251853 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r249252:
  Remove reference to the nonexistent sysctl node net.inet6.mld.stats.
  Also add cross reference to the icmp6(4).

  PR:	177696


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@251865 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251187:

Explicitly use a pair of parentheses to ensure correct evaluation
ordering for bitwise operation.

Submitted by:	swildner (DragonFly)


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@251890 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251349:

Fix a typo: XPORT_SPI should be tested against transport, nor protocol.

Submitted by:	Sascha Wildner <swildner dragonflybsd org>
Reviewed by:	mjacob


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@251892 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r248720:
Remove extra bio_data and bio_length copying to child request after calling
g_clone_bio(), that already copied them.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@251923 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251616:
Don't update provider properties and don't set DISKFLAG_OPEN if d_open()
disk method call returned error.  GEOM considers devices in such case as
still closed, and won't call symmetric d_close() for them.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@251932 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251485:

Revert r238399.

The "failok" option doesn't have any effect at all unless specified in
fstab(5) and combined with the -a flag. The "failok" option is already
documented in fstab(5).

PR:		177630


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@251999 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC: r249406

- Do not bail out if stat(2) fails with ENOENT in the spool directory. This
  happens if another atrm process removes a job while we're scanning through
  the directory.
- While at it, optimize a bit the directory scanning, so that we quit
  looping as soon as all jobs specified in argv have been dealt with.

Approved by:	cognet


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@252034 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC 250333: Don't pad disk partition sizes with leading zeros.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@252058 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC 251637:
Borrow the algorithm from kvm_getprocs() to fix procstat(1) to handle the
case where the process tables grows in between the calls to fetch the size
and fetch the table.

Note that this is not a true MFC as the libprocstat library doesn't exist
in 8.x and the relevant code is in the procstat binary instead.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@252066 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFS9->8 r249822:
Update error messages when processing the INDEX file to display the given
path rather than a static string. This makes the error messages consistent
with the rest of the functions which already do the same thing (assumed to
be an oversight of r47055, 13+ years ago). A direct commit to stable/9.

This is a direct commit to stable/8.

Reviewed by:	eadler


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@252071 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
share/mk: merge: r241298,243393,249057,251506 from head for bmake support.
	  merge: r252048 from stable/9

Makefile: merge: r252048 from stable/9 for bmake support.

Reviewed by: obrien


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@252073 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251723:
The functions are called pci_{msi,msix}_count(), not pci_count_{msi,msix}().


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@252088 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251166:
Add macros which allow one to define SDT probes with six or seven arguments;
they are needed when porting some of the Solaris providers (ip, iscsi, and
tcp in particular).

dtrace_probe() only takes five arguments from the probe site, so we need to
add the appropriate cast to allow for more than five arguments. The extra
arguments are later copied out of dtrace_probe()'s stack frame by
dtrace_getarg() (or the provider-specific getarg method) as needed.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@252090 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r246951:
Mark the coretemp(4) sysctls as MPSAFE, ensuring that Giant won't be held
unnecessarily by a user thread waiting to run on a specific CPU after
calling sched_bind().


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@252092 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r250599:
Add a remark to the effect that a manually started relearn will always
result in the battery being completely drained, even in transparent learning
mode.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@252094 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFi386: revision 245847

  Add special loader environment variables 'comconsole_port' and
  'comconsole_pcidev'.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/8@252107 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFi386: revision 251332

  Use slightly more idiomatic expression to get the address of array.


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