MFC: r249213 (partial)

- Remove unused headers from the SRCS of some modules.
- Use __FBSDID.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.


git-svn-id: svn://svn.freebsd.org/base/stable/9@251567 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC: r251115

- Remove pointless returns.
- Make cm_data a void pointer and cm_flags unsigned as appropriate.


git-svn-id: svn://svn.freebsd.org/base/stable/9@251568 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC: r251133

- Merge from r249476: Ensure that PCI bus BUS_GET_DMA_TAG() method sees
  the actual PCI device which makes the request for DMA tag, instead of
  some descendant of the PCI device, by creating a pass-through trampoline.
- Sprinkle const on tables.
- Use NULL instead of 0 for pointers.
- Take advantage of nitems().


git-svn-id: svn://svn.freebsd.org/base/stable/9@251569 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC: r251142

- As a follow-up to r247565 (MFC'ed to stable/9 in r248036), make firmware
  images that do not require patching at runtime actually const.
- Remove pointless softc members by employing the corresponding constants
  directly.
- Remove pointless returns.
- Remove unnecessary inclusion of opt_device_polling.h.
- Replace an outdated and now bogus comment in bce_tick() with the
  appropriate one.


git-svn-id: svn://svn.freebsd.org/base/stable/9@251570 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC: r251394

CAM_DEV_QFREEZE handling should only be done on request submission but
neither on completion nor by SIM drivers in the first place. This issue
has been revealed by r249466.


git-svn-id: svn://svn.freebsd.org/base/stable/9@251571 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC: r251402 (partial)

Handle/mark/nuke unused arguments.


git-svn-id: svn://svn.freebsd.org/base/stable/9@251572 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC: r251146 (partial)

- Do not supply arguments as pointers to bce_get_{pg,rx}_buf() that are not
  altered or actually needed there any longer.
- Honor errors passed to the DMA mapping callbacks.
- In bce_get_rx_buf(), do not reserve stack space for more DMA segments
  than actually necessary.
- In bce_rx_intr(), remove a pointless check for an empty mbuf pointer
  which can only happen in case of a severe programming error. Moreover,
  recovering from that situation would require way more actions with header
  splitting enabled (which it is by default).
- Fix VLAN tagging in the RX path; do not attach the VLAN tag twice if the
  firmware has been told to keep it. [1]

Obtained from:	OpenBSD [1]


git-svn-id: svn://svn.freebsd.org/base/stable/9@251573 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC: r251159

- Checking for spurious interrupts is only necessary when using INTx.
  Actually, this may be further optimized for controller variants
  supporting one-shot MSIs but I'm lacking the necessary hardware for
  testing.
- Add some missing synchronization of the statistics and status DMA
  maps.


git-svn-id: svn://svn.freebsd.org/base/stable/9@251574 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r247221:
Merge part of r1712 from elftoolchain, making it possible to resize ELF
sections and indirectly change the layout of an ELF file when
ELF_F_LAYOUT is not set.


git-svn-id: svn://svn.freebsd.org/base/stable/9@251582 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251591:
The vm_page lock is not needed around the call to vm_page_insert().


git-svn-id: svn://svn.freebsd.org/base/stable/9@251592 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251283:
MFamd64: when printing the trap information, show the %esp value.


git-svn-id: svn://svn.freebsd.org/base/stable/9@251593 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251324:
Assert that interrupts are enabled in the trap handlers on x86 before
calling generic code to deliver signals.


git-svn-id: svn://svn.freebsd.org/base/stable/9@251594 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge remote-tracking branch 'upstream/svn_stable_9' into svn_stable_9