Remove unnecessary delay. I don't see any comments in data sheet
that requires 10ms delay after device reset.  Because that code was
there from day 1, I guess it was added to give enough settlement
time after updating BGE_MAC_MODE register.
The recommended delay time for BGE_MAC_MODE after updating is 40us
and it was already done in r241219.


git-svn-id: svn://svn.freebsd.org/base/head@241393 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revert previous commit...

Pointyhat to:	kevlo (myself)


git-svn-id: svn://svn.freebsd.org/base/head@241394 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Fix the error message when a dependency string is not provided to
  reference a missing dependency rather than a missing compile command.
- Don't append a newline to the auto-generated compile command.  The
  compile command has a newline appended when it is later output to the
  Makefile.

MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@241395 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
WITH_CTF is now a "normal" build option (WITHOUT_CTF is supported and
MK_CTF is used internally).

Reviewed by:	fjoe


git-svn-id: svn://svn.freebsd.org/base/head@241396 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove unused item.  cxgbe's rx queue's lock was removed a long time ago.

MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@241397 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
There is no need to report the same error twice.

MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@241398 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add a driver ioctl to read a byte from any device on a port's i2c bus.
This lets userspace read arbitrary information from the SFP+ modules
etc. on this bus.

Reading multiple bytes in the same transaction isn't possible right now.
I'll update the driver once the chip's firmware supports this.

MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@241399 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFi386 r241356
  Add several asserts.

MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@241400 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add an "i2c" subcommand to cxgbetool.  You can use this to read
information from the transceivers connected to the ports of a
cxgbe(4) based card.

# cxgbetool t4nex0 i2c <port_id> <dev_addr> <addr> [<count>]

For example:
# cxgbetool t4nex0 i2c 0 0xa0 3
0x10 [16]

(As per SFF-8472 the SFP+ module is at 0xa0 and bit 4 in the value at
address 3 indicates it's a 10Gbase-SR module, which it is.)


git-svn-id: svn://svn.freebsd.org/base/head@241401 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add checks for ata_sata_scr_read() return statuses. It is mostly to silence
Clang Static Analyzer warnings as errors there are usually unlikely.


git-svn-id: svn://svn.freebsd.org/base/head@241402 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add support for locate LED.

While here, change ISCI_LED to ISCI_PHY since conceptually the hardware
ties the LEDs to a phy and the LEDs for a given phy cannot be controlled
independently.

Submitted by: Paul Maulberger <Paul.Maulberger at gmx.de> (with modifications)


git-svn-id: svn://svn.freebsd.org/base/head@241403 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove 'periph == NULL' check from bunch of periph drivers.
This condition can never be true as functions are called from single place
and the checks just pollute the code and confuse Clang Static Analyzer.


git-svn-id: svn://svn.freebsd.org/base/head@241404 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Really handle xpt_compile_path() error in xpt_bus_register() instead of
print error message and probably crash just after it on NULL dereference.

Found by:	Clang Static Analyzer


git-svn-id: svn://svn.freebsd.org/base/head@241405 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Do not check if found IPv4 rte is dynamic if net.inet.icmp.drop_redirect is
enabled. This eliminates one mtx_lock() per each routing lookup thus improving
performance in several cases (routing to directly connected interface or routing
to default gateway).

Icmp redirects should not be used to provide routing direction nowadays, even
for end hosts. Routers should not use them too (and this is explicitly restricted
in IPv6, see RFC 4861, clause 8.2).

Current commit changes rnh_machaddr function to 'stock' rn_match (and back) for every
AF_INET routing table in given VNET instance on drop_redirect sysctl change.

This change is part of bigger patch eliminating rte locking.

Sponsored by:	Yandex LLC
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@241406 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add a driver ioctl to clear a port's MAC statistics.

Submitted by:	gnn@
MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@241409 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
There are SCSI conditions that are not an errors. In those cases cderror()
returns zero while request status is not CAM_REQ_CMP.  That could cause
partial device attach or other unexpected results.

Found by:	Clang Static Analyzer


git-svn-id: svn://svn.freebsd.org/base/head@241410 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
panic() with reasonable message instead of returning zero frequency causing
division by zero later if event timer's minimal period is above one second.
For now it is just a theoretical possibility.

Found by:	Clang Static Analyzer


git-svn-id: svn://svn.freebsd.org/base/head@241413 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Upgrade to 9.8.3-P4:

Prevents a lockup when queried a deliberately constructed combination
of records. [CVE-2012-5166]

For more information: https://kb.isc.org/article/AA-00801


git-svn-id: svn://svn.freebsd.org/base/head@241414 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add a "clearstats" subcommand to cxgbetool that lets you clear the
MAC statistics for any port.

For example:
# cxgbetool t4nex0 clearstats 0

Submitted by:	gnn@
MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@241416 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
NULL-ify last previously used pointer instead of last possible pointer.
This should be only a cosmetic change.

Found by:	Clang Static Analyzer


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