Commit Graph

95710 Commits

Author SHA1 Message Date
Ian Lepore
6495818590 Arrange for uart_cpu_fdt's probe() routine to use the same table of compat
strings as uart_bus_fdt's probe().

The bus code uses ofw_bus_search_compatible() and that's not an option in
cpu (console) code -- it runs way before the ofw routines are usable.  So
the console probe has its own loop to search the table, but now at least
there's only one table to be maintained when new devices are added.
2013-11-02 20:14:39 +00:00
Michael Tuexen
b54ddf225f Changes from upstream to improve compilation when INET or INET6
or none of them is defined.

MFC after: 3 days
2013-11-02 20:12:19 +00:00
Luigi Rizzo
3d819cb610 circumvent a couple of warnings:
- on line 2550 intentionally overriding a const qualifier
- on line 3219 intentionally converting uint64_t to a pointer
2013-11-02 18:03:21 +00:00
Alan Cox
b603e09555 Don't create a distinct free page pool for segregating allocations that are
accessed through the direct map unless the kernel configuration actually
includes a direct map.  Only a few configurations do, and for the rest the
unnecessary free page pool is a small pessimization.

Tested by:	zbb
MFC after:	6 weeks
2013-11-02 17:08:20 +00:00
Adrian Chadd
dd50b3107e Restore the entropy gathering from the m_data pointer value, not the
m_data payload.

After talking with markm/bde, this is what markm actually intended.
2013-11-02 15:13:02 +00:00
Alfred Perlstein
50903998f0 Add device ID for 'Sanoxy 802.11N' usb 2013-11-02 11:37:16 +00:00
Alfred Perlstein
df5f4d8202 Fix API mismatch exposed by lagg.
When destroying a lagg the driver tries to restore the old mac and
fails due to API mismatch
2013-11-02 10:49:47 +00:00
Konstantin Belousov
d480f5b820 Fix several issues with the busdma(9) KPI use in the e1000 drivers.
The problems do not affect bouncing busdma in a visible way, but are
critical for the dmar backend.

- The bus_dmamap_create(9) is not documented to take BUS_DMA_NOWAIT flag.
- Unload descriptor map after receive.
- Do not reset descriptor map to NULL, bus_dmamap_load(9) requires
  valid map, and also this leaks the map.

Reported and tested by:	pho
Approved by:	jfv
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2013-11-02 09:16:11 +00:00
Xin LI
7ac2e58818 When zero'ing out a buffer, make sure we are using right size.
Without this change, in the worst but unlikely case scenario, certain
administrative operations, including change of configuration, set or
delete key from a GEOM ELI provider, may leave potentially sensitive
information in buffer allocated from kernel memory.

We believe that it is not possible to actively exploit these issues, nor
does it impact the security of normal usage of GEOM ELI providers when
these operations are not performed after system boot.

Security:	possible sensitive information disclosure
Submitted by:	Clement Lecigne <clecigne google com>
MFC after:	3 days
2013-11-02 01:16:10 +00:00
Luigi Rizzo
ab1e286051 add missing file from previous netmap update... 2013-11-02 00:54:47 +00:00
Adrian Chadd
1f43ebd2b9 Teach the netgraph code to use a const char * pointer too.
Pointy hat to: adrian
2013-11-02 00:11:38 +00:00
Jim Harris
d603c3d73b Create a unique unit number for each controller and namespace cdev.
Sponsored by:	Intel
MFC after:	3 days
2013-11-01 23:30:54 +00:00
Luigi Rizzo
ce3ee1e7c4 update to the latest netmap snapshot.
This includes the following:
- use separate memory regions for VALE ports
- locking fixes
- some simplifications in the NIC-specific routines
- performance improvements for the VALE switch
- some new features in the pkt-gen test program
- documentation updates

There are small API changes that require programs to be recompiled
(NETMAP_API has been bumped so you will detect old binaries at runtime).

In particular:
- struct netmap_slot now is 16 bytes to support an extra pointer,
  which may save one data copy when using VALE ports or VMs;
- the struct netmap_if has two extra fields;

MFC after:	3 days
2013-11-01 21:21:14 +00:00
Adrian Chadd
a09968c479 Convert the random entropy harvesting code to use a const void * pointer
rather than just void *.

Then, as part of this, convert a couple of mbuf m->m_data accesses
to mtod(m, const void *).

Reviewed by:	markm
Approved by:	security-officer (delphij)
Sponsored by:	Netflix, Inc.
2013-11-01 20:53:49 +00:00
Ian Lepore
760eb697b4 The ability to do 8-bit implies 4-bit capability too. Rearrange the cases
and add a fallthrough comment to make that happen.
2013-11-01 19:29:59 +00:00
Ian Lepore
4a98e46950 TI sdhci driver improvements, mostly related to fdt data...
Use the published compatible strings (our own invention, "ti,mmchs" is
still accepted as well, for now).

Don't blindly turn on 8-bit bus mode, because even though the conroller
supports it, the board has to be wired appropriately as well.  Use the
published property (bus-width=<n>) and honor all the valid values (1,4,8).

The eMMC device on a Beaglebone Black is wired for 8-bit, update the dts.

The mmchs controller can inherently do both 1.8v and 3.0v on the first
device and 1.8v only on other devices, unless an external transceiver is
used.  Set the voltage automatically for the first device and honor
the published fdt property (ti,dualvolt) for other devices.

Thanks go to Ilya Bakulin for figuring out the voltage compatibility stuff.
2013-11-01 19:22:06 +00:00
Gleb Smirnoff
f909bbb4db Somehow fix LINT-NOIP. 2013-11-01 18:42:03 +00:00
Konstantin Belousov
68eeb96ab5 Add support for queued invalidation.
Right now, the semaphore write is scheduled after each batch, which is
not optimal and must be tuned.

Discussed with:	alc
Tested by:	pho
MFC after:	1 month
2013-11-01 17:38:52 +00:00
Konstantin Belousov
3100f7dfb7 Return BUS_PROBE_NOWILDCARD from the DMAR probe method.
Confirmed by:	nwhitehorn
MFC after:	1 month
2013-11-01 17:16:44 +00:00
Alexander Motin
915f2b7c89 Make getenv_*() functions and respectively TUNABLE_*_FETCH() macros not
allocate memory and so not require sleepable environment.  getenv() has
already used on-stack temporary storage, so just use it more rationally.
getenv_string() receives buffer as argument, so don't need another one.
2013-11-01 10:32:33 +00:00
Gleb Smirnoff
586904c22e in_ifadown() can be void. 2013-11-01 10:29:10 +00:00
Gleb Smirnoff
237bf7f773 Cleanup in_ifscrub(), which is just an entry to in_scrubprefix(). 2013-11-01 10:18:41 +00:00
Gleb Smirnoff
0d168b8d36 prison_check_ip4() can take const arguments. 2013-11-01 10:01:57 +00:00
Pyun YongHyeon
b52d3ddba3 Perform media change after setting IFF_DRV_RUNNING flag. Without it,
driver would ignore the first link state update if controller
already established a link.

Reported by:	bsam
Tested by:	bsam
2013-11-01 05:03:47 +00:00
Ian Lepore
bc5c7a1ad3 Kernel config for Wandboard. 2013-11-01 02:04:05 +00:00
Marcel Moolenaar
e3eb23c502 Use LOG2_ID_PAGE_SIZE again for the identity mapping in regions 6 & 7.
Make the default translation size the same as the PBVM page size to
avoid inserting overlapping translations in the TC. That generally is
very bad.
2013-11-01 01:32:01 +00:00
Ian Lepore
36aed22abd Add dts source for imx6 SoCs and for Wandboard boards.
The imx6.dtsi is incomplete, but has enough to support devices that work
right now.  Eventually it will need to be split into several files that
account for the differences between SoCs in the imx6 family.

The board config for Wandboard Dual is untested.  Solo and Quad work, but
one one core is turned on for the quad right now (baby steps).
2013-11-01 00:45:08 +00:00
Marcel Moolenaar
fde9169e11 The PAL_PTCE_INFO function returns the counts and strides of the
outer and inner loop as 32-bit integers mux'd in 64-bit return
values. Change our data types for the count and stride to match
and simplify/adjust accordingly.
Note that with this change the defaults of the ptc.e parameters
have changed. Since all hardware is supposed to support the PAL
call, there should be no impact. Even ski is unaffected, because
the TC is re-initialized without considering the virtual address.
So, as long as we call ptc.e at least once, we're good. That's
what the new defaults do.
Most processor implementations need but a single ptc.e to purge
the entire TC anyway...
2013-11-01 00:21:38 +00:00
Ian Lepore
034e9ed611 Add the Soc- / machine-dependent parts of imx6 support. 2013-11-01 00:21:09 +00:00
Alexander Motin
9813c936c4 Fix lock recursion, triggered by smartctl -a /dev/adaX. 2013-11-01 00:14:15 +00:00
Ian Lepore
8ef18b3b15 Convert the if/else list of compatible devices to the table-driven
ofw_bus_search_compatible() routine.  In addition to converting existing
strings to table entries, also add compat strings for the whole imx family.
2013-10-31 23:57:33 +00:00
Ian Lepore
3d9d5b4313 Add definitions for the register and data that describes the SoC type.
This isn't in the chip reference manuals, it was found in u-boot and
various old mailing list threads.
2013-10-31 23:08:30 +00:00
Marcel Moolenaar
3598d9555a Purge the translation cache of APs before we unleash them. To that
end, make pmap_invalidate_all() global and have it only handle the
local CPU -- i.e. no rendezvous. We do not use pmap_invalidate_all
other than during initialization.
Note that the BSP already purges its TC -- it was missing for APs
only. Nonetheless, this so far seems to eliminate random problems.
2013-10-31 23:06:04 +00:00
Ian Lepore
f955880f7b Revamp the SoC identity numbering scheme to be more in line with the way
Freescale numbers the chips in the ID registers.
2013-10-31 23:05:05 +00:00
Marcel Moolenaar
ec9b648ef8 Respect the kern.smp.disabled tunable. When we're scanning the MADT in
ia64_probe_sapics(), we also create PCPU structures for any Local SAPICs
we encounter. When SMP is disabled, this leaves us with partially setup
PCPU structures, which typically results in panics when we're iterating
over CPUs. When SMP is disabled, we now prevent the creation of the
PCPU structures.
2013-10-31 22:46:03 +00:00
Andreas Tobler
12e7de228a Ouch, do the shift properly. An uin64_t needs the right postfix when shifting. 2013-10-31 20:42:47 +00:00
Maksim Yevmenkin
f7a3a2a57c Rate limit (to once per minute) "Listen queue overflow" message in
sonewconn().

Reviewed by:	scottl, lstewart
Obtained from:	Netflix, Inc
MFC after:	2 weeks
2013-10-31 20:33:21 +00:00
Andre Oppermann
5b74cfe42f Make struct ifnet readable and comprehensible again by grouping
and ordering related variables, fields and locks next to each
other.  Add more comments to variables.

Over time 'ifnet' has accumlated a lot of additional pointers and
functionality in an unstructured way making it quite hard to read
and understand while obfuscating relationships between fields and
variables.

Quantify the structure size and how bloated it has become.

This is only a mechanical change in preparation for upcoming
work to make ifnet opaque to drivers and to separate out the
interface queuing.

Sponsored by:	The FreeBSD Foundation
2013-10-31 15:46:10 +00:00
Ian Lepore
7352de58e8 Add sdhci driver glue for imx family SoCs. This should support both uSDHC
(newer SoCs) and eSDHC (older SoCs), but the eSDHC support is untested and
likely to need some tweaking.
2013-10-31 15:27:39 +00:00
Ian Lepore
9808ebfa39 Add stubbed-out imx6 support for clocks and power management. This
contains little more than a few stub functions required to keep the
linker happy, but it's enough to let early imx6 development proceed.
2013-10-31 15:04:23 +00:00
Ian Lepore
c8c16b3df2 Add support for the USB PHY on imx6 SoCs. Pretty minimal at this point,
but enough to get usb host mode working.
2013-10-31 14:52:06 +00:00
Adrian Chadd
c48efaecf6 Allow the Arduino Leonardo to work by supporting CDC=0 devices.
CDC=0 simply means "no command codes", CDC=1 means "AT command codes."
There's no driver change required!  It's purely to tell the application
layer whether to speak AT commands or not.  Things are all still serial.

PR:		usb/183505
Reviewed by:	hps
MFC after:	1 week
2013-10-31 13:54:51 +00:00
Hans Petter Selasky
645826bef4 Fix a potential memory leak.
MFC after:	1 week
2013-10-31 11:03:36 +00:00
Hans Petter Selasky
35a2489852 Fix some types. Compilation for external target complains that "u_int"
is not idential to "uint32_t" when defining set channel prototype
functions. The WLAN channel range should be from 0 to 65535
inclusivly, and u_int should be fine for this purpose.
2013-10-31 09:20:30 +00:00
Neel Natu
513c8d338d Rename the VMM_CTRx() family of macros to VCPU_CTRx() to highlight that these
tracepoints are vcpu-specific.

Add support for tracepoints that are global to the virtual machine - these
tracepoints are called VM_CTRx().
2013-10-31 05:20:11 +00:00
Gleb Smirnoff
a9b3c1bf05 Provide a crutch that prevents watchdog to interrupt dumping
on a box with IPMI enabled.

Okay from:	jhb
Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-31 05:13:53 +00:00
Mark Johnston
be09cd5706 Fix some lingering build failures caused by fixing implicit inclusion of
if_var.h. Also explicitly include lock.h and mutex.h in if_kr.c rather than
depending on if_var.h to bring them in.
2013-10-31 05:00:50 +00:00
Ian Lepore
425a5c7900 Do not EOI an interrupt until the point after the filter handlers / before
threaded handlers.

It's not easy to see from the diffs of this change exactly how it
accomplishes the above.  The arm_mask_irq() and arm_unmask_irq() functions
are, respectively, the pre_thread and post_thread hooks.  Not seen in
these diffs, the arm_post_filter() routine also EOIs.  The post_filter
routine runs after filter handlers if there will be no threaded handlers,
so it just EOIs.  The pre_thread routine masks the interrupt (at the
controller, not the source) and EOIs.  So one way or another, the EOI
happens at the point where filter handlers are done.
2013-10-31 03:23:25 +00:00
Ian Lepore
adcea15135 Don't iterate through the bits of the pending interrupt register if the
whole register is zero.  Most of the registers will be zero most of the time.
2013-10-31 03:12:48 +00:00
Mark Johnston
57170f49f2 Remove references to an unused fasttrap probe hook, and remove the
corresponding x86 trap type. Userland DTrace probes are currently handled
by the other fasttrap hooks (dtrace_pid_probe_ptr and
dtrace_return_probe_ptr).

Discussed with:	rpaulo
2013-10-31 02:35:00 +00:00
Mark Johnston
9f6f3311f4 Fix a typo introduced in r257338. 2013-10-31 02:27:16 +00:00
Adrian Chadd
cea884bf7d Don't base the rate table selection based on the channel mode;
it needs to check whether there are rate entries in there or not.

PR:		kern/183428
2013-10-31 02:21:48 +00:00
Rui Paulo
74678000dc Enable USB. 2013-10-31 02:14:28 +00:00
Ian Lepore
54fe60971c Reset the timer interrupt status register at the top rather than bottom of
the interrupt handler.  If the event callback starts a new short timeout,
the timer can fire before returning from the event callback, and clearing
the interrupt status after that loses the interrupt and hangs until the
counter wraps.  Fixing all of this removes the need for the do-nothing
loop at the top of the handler which really just waited for the counter to
roll over and reach the one-shot count again.

Also add a missing return(0) in the periodic timer start case.
2013-10-31 02:11:35 +00:00
Adrian Chadd
7f0660a04b Don't treat the node as an 11n node if 11n rates are disabled.
For now, the AMRR code only knows about _either_ MCS or non-MCS rates.
It doesn't know how to downgrade (ie, doing 11b CCK rates if MCS0 isn't
reliable.)

PR:		kern/183428
2013-10-31 02:04:53 +00:00
Kevin Lo
30dfa97944 Add RT2860_BCN_OFFSET1 and RT2860_MAX_LEN_CFG register initialization to
match with the vendor driver.  While here, remove unused RT2860_DEF_MAC
definition.
2013-10-31 02:03:30 +00:00
Kevin Lo
1365315d41 Initialize BBP68 to improve rx sensitivity. 2013-10-31 02:02:14 +00:00
Kevin Lo
c513ecfd12 Enable DC filter in RT3071 Version E. 2013-10-31 02:00:58 +00:00
Ian Lepore
eb756ebd94 Expand the list of compatible devices this driver works with. Increase
the target frequency from 1 to 10 MHz because these SoCs are plenty fast
enough to benefit from the extra event timer resolution.
2013-10-31 01:45:55 +00:00
Ian Lepore
f26c810514 Rework the imx ehci driver so that it's four separate ehci units rather
than one unit with four busses attached to it.  This allows us to use
existing fdt data which describes separate devices with separate resources.
It also allows any combination of the units to be en/disabled in the
board dts files.

Adjust our dts code to match what's used by linux and u-boot now that
we're structured to do so.

Document lots of interesting stuff learned whiling doing this with a big
comment block in the driver, so I don't have to re-learn it for the next
round of changes.
2013-10-30 18:26:18 +00:00
Sergey Kandaurov
3860c4e618 Include the now missing headers after untangling if.h and if_var.h.
This fixes pc98 build.

Reviewed by:	andre
2013-10-30 17:55:31 +00:00
Andre Oppermann
a742d143c7 nclude missing net/if_var.h.
Due to header pollution it wasn't noticed before.
2013-10-30 16:56:46 +00:00
Ian Lepore
22aa1751eb Add a vendor entry for Freescale Semiconductor. 2013-10-30 16:34:26 +00:00
Ian Lepore
bc9a95c8c6 Add a "no-op" USB PHY driver for imx-family SoCs. This is used when the
phy clocks need to be enabled, but no other hardware setup is needed to
make the phy work.
2013-10-30 14:38:24 +00:00
Ian Lepore
baf7f63f9a Add some bare-bones support for enabling usb and usbphy clocks. This
is temporary code to keep imx development moving forward for now.  In
the long run we need a SoC-independant clock management API.
2013-10-30 14:33:15 +00:00
Nathan Whitehorn
abe8350519 printf() specifier updates to CAM to handle either 32-bit or 64-bit lun_id_t.
MFC after:	2 weeks
2013-10-30 14:13:15 +00:00
Nathan Whitehorn
123055f01f Adjust various SCSI drivers to handle either a 32-bit or 64-bit lun_id_t,
mostly by adjustments to debugging printf() format specifiers. For high
numbered LUNs, also switch to printing them in hex as per SAM-5.

MFC after: 2 weeks
2013-10-30 14:04:47 +00:00
Nathan Whitehorn
87cb964b92 Fix typo. Sorry! 2013-10-29 23:55:17 +00:00
Xin LI
49796c6f56 Don't reference pointer before testing whether it is
NULL.

Submitted by:	Clement Lecigne <clecigne google com>
Reviewed by:	grehan
MFC after:	3 days
2013-10-29 22:42:30 +00:00
Nathan Whitehorn
453319bf53 The ofw_bus() routines invoke the device's parent, not the device itself,
so cease iterating when the parent is NULL, not when the device is.

MFC after:	5 days
2013-10-29 21:08:20 +00:00
Nathan Whitehorn
a5c296c5c5 Panics about how things can't be attached should probably happen in the
attach method rather than probe.

Submitted by:	brooks
2013-10-29 20:38:58 +00:00
Michael Tuexen
6ed728108a Terminate a debug output with a \n. 2013-10-29 20:04:50 +00:00
Andre Oppermann
ded7d20fc5 Move all interface queue related structures, macros and definitions
from net/if_var to it own new net/ifq.h.

For now net/ifq.h is unconditionally included through net/if_var.h.

This is a mechanical change in preparation to make struct ifnet and
the individual interface queue mechanisms opaque.

Discussed with:	glebius
Sponsored by:	The FreeBSD Foundation
2013-10-29 17:48:08 +00:00
Luiz Otavio O Souza
3d02237c46 Fix the build of TP-WN1043ND kernel. Provide necessary includes and remove
unnecessary includes for rtl8366rb.

Approved by:	adrian (mentor)
2013-10-29 15:45:11 +00:00
Nathan Whitehorn
ef5758fa10 Implement extended LUN support. If PIM_EXTLUNS is set by a SIM, encode
the upper 32-bits of the LUN, if possible, into the target_lun field as
passed directly from the REPORT LUNs response. This allows extended LUN
support to work for all LUNs with zeros in the lower 32-bits, which covers
most addressing modes without breaking KBI. Behavior for drivers not
setting PIM_EXTLUNS is unchanged. No user-facing interfaces are modified.

Extended LUNs are stored with swizzled 16-bit word order so that, for
devices implementing LUN addressing (like SCSI-2), the numerical
representation of the LUN is identical with and without PIM_EXTLUNS. Thus
setting PIM_EXTLUNS keeps most behavior, and user-facing LUN IDs, unchanged.
This follows the strategy used in Solaris. A macro (CAM_EXTLUN_BYTE_SWIZZLE)
is provided to transform a lun_id_t into a uint64_t ordered for the wire.

This is the second part of work for full 64-bit extended LUN support and is
designed to a bridge for stable/10 to the final 64-bit LUN code. The
third and final part will involve widening lun_id_t to 64 bits and will
not be MFCed. This third part will break the KBI but will keep the KPI
unchanged so that all drivers that will care about this can be updated now
and not require code changes between HEAD and stable/10.

Reviewed by:	scottl
MFC after:	2 weeks
2013-10-29 15:36:58 +00:00
Nathan Whitehorn
cd43f427f6 A last BUS_PROBE_NOWILDCARD. Move setting the postfilter function into the
attach function probe shouldn't actually set anything up but just bid
on the device.
2013-10-29 14:44:36 +00:00
Nathan Whitehorn
e5bcdd7960 A few last BUS_PROBE_NOWILDCARDs are in order. 2013-10-29 14:32:33 +00:00
Nathan Whitehorn
feeec74df7 More BUS_PROBE_NOWILDCARD sweeping. Some devices here (if_ath_ahb and siba)
resist easy conversion since they implement a great deal of their attach
logic inside probe(). Some of this could be fixed by moving it to attach(),
but some requires something more subtle than BUS_PROBE_NOWILDCARD.
2013-10-29 14:19:42 +00:00
Nathan Whitehorn
5543a1b98e Devices that rely on hints or identify routines for discovery need to
return BUS_PROBE_NOWILDCARD from their probe routines to avoid claiming
wildcard devices on their parent bus. Do a sweep through the MIPS tree.

MFC after: 2 weeks
2013-10-29 14:07:31 +00:00
Nathan Whitehorn
f0919d9edf Hints-only devices should return BUS_PROBE_NOWILDCARD from their probe
methods.
2013-10-29 13:52:05 +00:00
Nathan Whitehorn
ccc1cefe83 These nexus attachments do not execute a real probe and so need
BUS_PROBE_NOWILDCARD set.
2013-10-29 13:48:41 +00:00
Nathan Whitehorn
b665cfc0f5 Hints-only devices should have BUS_PROBE_NOWILDCARD set. We probably need
a better flag for this (in the driver metadata, for example).
2013-10-29 13:43:09 +00:00
Zbigniew Bodek
bd422cef88 Add missing ARMv6 CPU functions to ARM Makefile
Will fix RPI-B kernel build failure since it adds missing
armv6_idcache_wbinv_all which was previously taken from cpufunc_asm_pj4b.S.

Reviewed by:	gber
2013-10-29 13:16:05 +00:00
Randall Stewart
6f1dba186e Opps, my kirkwood fix for the dreamplug missed this. 2013-10-29 11:28:11 +00:00
Gleb Smirnoff
8d7cf9b5d4 Uninline inm_lookup_locked(). Now in_var.h doesn't dereference
fields of struct ifnet.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-29 11:21:31 +00:00
Gleb Smirnoff
66e01d73cd - Provide necessary includes.
- Remove unnecessary includes.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-29 11:17:49 +00:00
Konstantin Belousov
4ad0991f6a Remove redundand declaration, fixing the build with gcc.
Reported and tested by:	Michael Butler <imb@protected-networks.net>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
2013-10-29 07:25:54 +00:00
Pyun YongHyeon
5aefcb0b42 Fix regression introduced in r235816.
r235816 triggered kernel panic or hang after warm boot.
Don't blindly restore BCE_EMAC_MODE media configuration in
bce_reset().  If driver is about to shutdown it will invoke
bce_reset() which in turn results in restoring BCE_EMAC_MODE
media configuration.  This operation seems to confuse controller
firmware.

Reported by:	Paul Herman (herman <> cleverbridge dot com)
Tested by:	sbruno, Paul Herman (herman <> cleverbridge dot com)
2013-10-29 06:37:27 +00:00
Pyun YongHyeon
c3767eab77 Add preliminary support for RTL8168EP.
Submitted by:	Edward O'Callaghan (eocallaghan <> alterapraxis dot com)
2013-10-29 05:37:05 +00:00
Pyun YongHyeon
ab9f923ebf Add preliminary support for RTL8168G, RTL8168GU and RTL8411B.
RTL8168GU has two variants(GMII and MII) but it uses the same chip
revision id.  Driver checks PCI device id of controller and
sets internal capability flag(i.e. jumbo frame and link speed down
in WOL).

H/W donated by:	RealTek Semiconductor Corp.
2013-10-29 05:30:21 +00:00
Pyun YongHyeon
cd10b400a6 Add support for new Gigabit PHY of RealTek.
I don't have a copy of data sheet so I'm not sure exact PHY model
name. Vendor's web page indicates RTL8251 is latest PHY so I used
the name. This PHY is used with RTL8168G, RTL8168GU and RTL8411B.
2013-10-29 05:14:38 +00:00
Adrian Chadd
e15cc8dca6 Fix the PLCP lookup code in iwn(4) to base the 11n decision on whether
the rate is 11n, rather than whether the channel is 11n.

This correctly allows the PLCP lookup code to return the legacy rates
even on an 11n channel.

PR:		kern/183430
2013-10-29 04:03:00 +00:00
Rui Paulo
4219857759 Digi-CCWMX53: enable ffec and uart. 2013-10-29 03:42:43 +00:00
Neel Natu
e2f5d9a129 Remove unnecessary includes of <machine/pmap.h>
Requested by:	alc@
2013-10-29 02:25:18 +00:00
Nathan Whitehorn
f7d6cb2081 Return NOKEY instead of 0 if there are no more key presses queued. This
worked by accident if and only if akbd was part of a kbdmux (which it
always was in practice).

MFC after:	1 week
2013-10-29 00:53:17 +00:00
Zbigniew Bodek
0efe42a2e3 Fix condition that determines PMAP_NEEDS_PTE_SYNC value for ARM
Use values of the correct defines to determine statement's result.
ARM_ARCH_ symbols are always defined, hence only values are relevant.

Reviewed by:	cognet
2013-10-28 23:42:44 +00:00
Gleb Smirnoff
d6a773db08 Provide necessary includes. 2013-10-28 23:34:05 +00:00
Gleb Smirnoff
578dab364e Provide necessary includes that before came via if.h. 2013-10-28 23:17:41 +00:00
Gleb Smirnoff
104dc21415 - Provide necessary includes, that before came via if.h pollution.
- Remove unnecessary ones.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-28 22:26:03 +00:00
Zbigniew Bodek
2923b75ea3 Switch off explicit broadcasting of the TLB flush operations for PJ4B CPU
Since CPU_MV_PJ4B describes ARMv7 compliant CPU there is no need for
sending an IPI each time when TLB is flushed in any way.

Tested by:	kevlo
2013-10-28 21:41:44 +00:00
Zbigniew Bodek
e0b4b3a74f Remove not working and deprecated PJ4Bv6 support
Sheeva PJ4Bv6 - based chips were only prototypes for V7 class Armada
SoC family. Current in-tree support for PJ4Bv6 will not work and also
there should be no platforms in active use that would incorporate that
CPU revision.
2013-10-28 21:39:54 +00:00
Zbigniew Bodek
d7b0107591 Change Armada XP kernel load address to the u-boot's end address
Loading kernel to 0xf00000 has no practical reason.
Starting it from the u-boot's highest possible end address
(2MB counting from 0x0) makes more sense.

Tested by:	kevlo
2013-10-28 21:37:45 +00:00
Zbigniew Bodek
67c3c19d0a Fix-up DTB for Armada XP registers' base according to the actual settings
Depending on u-boot's flavor some boards have their SoC registers
base address configured to 0xD0000000 and other to 0xF1000000.
U-boot is passing currently set value via CP15 register.
In order to create proper mapping for SoC registers and allow further
successful initialization it is necessary to replace fdt_immr_pa with
the real value and eventually fix-up device tree blob.

Tested by:	kevlo
2013-10-28 21:34:32 +00:00
Zbigniew Bodek
77f3266653 Remove hard-coded mappings related to Armada XP support
Armada XP initialization flow requires SoC registers to be
mapped very early in order to configure Snoop Filter for SMP.
Additional mapping in locore.S is redundant as proper mapping is
made in pmap_devmap_bootstrap() prior to calling cpu_setup() which
configures the Snoop Filter.
For secondaru CPUs it is better to pass VA of the SoC
registers defined in MV_BASE and PA consistent with the value
in the Device Tree.

Tested by:	kevlo
2013-10-28 21:31:12 +00:00
Gleb Smirnoff
69eb2b176c Include XEN and HyperV into amd64 LINT. 2013-10-28 21:11:28 +00:00
Gleb Smirnoff
6483a98b43 Remove dead function show_device(). It isn't buildable if DEBUG is
defined, due to unknown field "xn_ifno".  The field wasn't known
since beginning of history of this file.
2013-10-28 21:09:59 +00:00
Gleb Smirnoff
77374386a2 Include if_var.h. 2013-10-28 21:08:04 +00:00
Michael Tuexen
92dfa76cbc Fis the value of *optlen when calling getsockopt() for
SCTP_REMOTE_UDP_ENCAPS_PORT.
This issue was reported by Andrew Galante.
MFC after: 3 days
2013-10-28 20:45:19 +00:00
Sergey Kandaurov
d5814e82fa G/c unused mountrootfsname.
It was replaced with rootdevnames in r52778.
2013-10-28 20:38:17 +00:00
Michael Tuexen
daac3e7db6 Fix compilation if SCTP_DONT_DO_PRIVADDR_SCOPE is defined.
The issue was reported by Andrew Galante.

MFC after: 3 days
2013-10-28 20:32:37 +00:00
Gleb Smirnoff
eaeb0c139a Style: s/SYS_EVENTHANDLER_H/_SYS_EVENTHANDLER_H_/g
Submitted by:	bde
2013-10-28 20:32:05 +00:00
Olivier Houchard
f431664c05 Include <sys/ktr.h>, since we need it if ATH_DEBUG is defined. 2013-10-28 20:26:34 +00:00
Brooks Davis
0a529e9cde Add a couple includes if net/if_var.h that were missed in r257176. 2013-10-28 20:15:59 +00:00
Konstantin Belousov
06d513424a Remove redundand assignment to error variable and check for its value [1].
Do CTR logging in the case of error as well.

Noted by:	rdivacky [1]
Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
2013-10-28 19:30:09 +00:00
Ian Lepore
5dc7c6b4c1 Follow r257244; it's now necessary to include if_var.h. 2013-10-28 18:43:00 +00:00
Sean Bruno
da276a9179 repair build for dev/cs.
Reported by: Outback Dingo <outbackdingo@gmail.com>
2013-10-28 16:27:01 +00:00
Gleb Smirnoff
a7a36fea40 Remove more remnants of ng_fec(4).
The ng_create_one() and ng_mkpeer() functions in network.subr are
now not used anywhere, but I left them, since they can be useful
in future in netgraph scripting.

Submitted by:	pluknet
2013-10-28 16:21:31 +00:00
Ian Lepore
99895358c0 Sweep up a bit of arm-land fallout after r257244; include necessary
headers directly that are no longer available via accidental include.
2013-10-28 15:20:17 +00:00
Gleb Smirnoff
79e0ca6491 Remove ng_fec(4). 2013-10-28 15:17:41 +00:00
Gleb Smirnoff
f8ba95a1a8 Fix build. We need to include systm.h before if_var.h.
Pointy hat to:	glebius
2013-10-28 15:11:37 +00:00
Gleb Smirnoff
e9c347cd8c Remove ng_fec(4). 2013-10-28 14:52:08 +00:00
Konstantin Belousov
86be9f0dd5 Import the driver for VT-d DMAR hardware, as specified in the revision
1.3 of Intelб╝ Virtualization Technology for Directed I/O Architecture
Specification.  The Extended Context and PASIDs from the rev. 2.2 are
not supported, but I am not aware of any released hardware which
implements them.  Code does not use queued invalidation, see comments
for the reason, and does not provide interrupt remapping services.

Code implements the management of the guest address space per domain
and allows to establish and tear down arbitrary mappings, but not
partial unmapping.  The superpages are created as needed, but not
promoted.  Faults are recorded, fault records could be obtained
programmatically, and printed on the console.

Implement the busdma(9) using DMARs.  This busdma backend avoids
bouncing and provides security against misbehaving hardware and driver
bad programming, preventing leaks and corruption of the memory by wild
DMA accesses.

By default, the implementation is compiled into amd64 GENERIC kernel
but disabled; to enable, set hw.dmar.enable=1 loader tunable.  Code is
written to work on i386, but testing there was low priority, and
driver is not enabled in GENERIC.  Even with the DMAR turned on,
individual devices could be directed to use the bounce busdma with the
hw.busdma.pci<domain>:<bus>:<device>:<function>.bounce=1 tunable.  If
DMARs are capable of the pass-through translations, it is used,
otherwise, an identity-mapping page table is constructed.

The driver was tested on Xeon 5400/5500 chipset legacy machine,
Haswell desktop and E5 SandyBridge dual-socket boxes, with ahci(4),
ata(4), bce(4), ehci(4), mfi(4), uhci(4), xhci(4) devices.  It also
works with em(4) and igb(4), but there some fixes are needed for
drivers, which are not committed yet.  Intel GPUs do not work with
DMAR (yet).

Many thanks to John Baldwin, who explained me the newbus integration;
Peter Holm, who did all testing and helped me to discover and
understand several incredible bugs; and to Jim Harris for the access
to the EDS and BWG and for listening when I have to explain my
findings to somebody.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
2013-10-28 13:33:29 +00:00
Gleb Smirnoff
506658cc1e Axe ng_fec(4). It has never been a real netgraph(4) module, since
it had no hooks. It has abused ifnet's if_afdata slot and actually
abused every subsystem it touched.

lagg(4) is a proper trunking solution at ifnet(9) layer.

ng_one2many(4) is a proper trunking solution in netgraph(4).
2013-10-28 12:47:05 +00:00
Gleb Smirnoff
1ce5620d32 - Fix VIMAGE build.
- Fix build with gcc.
2013-10-28 10:12:19 +00:00
Gleb Smirnoff
c29e1ad930 - Make the prophecy from 1997 happen and remove if_var.h inclusion
from if.h.
- Remove unnecessary includes and declarations from if.h
- Remove unnecessary includes and declarations from if_var.h [1]
- Mark some declarations that are about to be removed in near
  future with comments, explaning why this declaration is still
  necessary.
- Protect eventhandler declarations with #ifdef SYS_EVENTHANDLER_H.

Obtained from:	bdeBSD [1]
Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-28 08:03:40 +00:00
Gleb Smirnoff
7ced9c2f66 Instead of putting ifnet declaration into eventhandler.h, move
bpf(4) and vlan(4) related event declarations to bpf.h and
if_vlan_var.h. To avoid dependency on eventhandler.h, protect
these declarations with ifdef SYS_EVENTHANDLER_H.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-28 07:45:03 +00:00
Gleb Smirnoff
c3322cb91c Include necessary headers that now are available due to pollution
via if_var.h.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-28 07:29:16 +00:00
Zbigniew Bodek
be445686da Run mvs SATA driver on Armada XP instead of old mv_sata
The mvs driver seems to be more functional than mv_sata and is not
causing random interrupt storms during boot.
2013-10-28 07:18:24 +00:00
Sean Bruno
c8f59c7b93 Quiesce warning -Wmissing-variable-declarations from buildworld, which is
slightly unnerving.

In file included from ioctl.c:48:
/var/tmp/home/sbruno/bsd/head/tmp/usr/include/dev/lmc/if_lmc.h:939:13:
warning: no previous extern declaration for non-static variable 'ssi_cables'
[-Wmissing-variable-declarations]
const char *ssi_cables[] =
2013-10-28 02:36:34 +00:00
Olivier Houchard
3acd1dbcd3 Make sure the PCB is aligned on 8 bytes, we may use ldrd/strd to access it,
which may have strong alignment requirements.
2013-10-27 22:15:50 +00:00
Konstantin Belousov
3f9d41ed10 Add a virtual table for the busdma methods on x86, to allow different
busdma implementations to coexist.  Copy busdma_machdep.c to
busdma_bounce.c, which is still a single implementation of the busdma
interface on x86 for now.  The busdma_machdep.c only contains common
and dispatch code.

Tested by:	pho (as part of the larger patch)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
2013-10-27 22:05:10 +00:00
Konstantin Belousov
80938e75f0 Add bus_dmamap_load_ma() function to load map with the array of
vm_pages.  Provide trivial implementation which forwards the load to
_bus_dmamap_load_phys() page by page.  Right now all architectures use
bus_dmamap_load_ma_triv().

Tested by:	pho (as part of the functional patch)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
2013-10-27 21:39:16 +00:00
Baptiste Daroussin
0664b03c16 Import pf.c 1.638 from OpenBSD
Original log:
Some ICMP types that also have icmp_id, pointed out by markus@

Obtained from:	OpenBSD
2013-10-27 20:56:23 +00:00
Baptiste Daroussin
5fff3f1010 Improt pf.c 1.636 from OpenBSD
Original log:
Make sure pd2 has a pointer to the icmp header in the payload; fixes
panic seen with some some icmp types in icmp error message payloads.

Obtained from:	OpenBSD
2013-10-27 20:52:09 +00:00
Baptiste Daroussin
44df0d9356 Import pf.c 1.635 and pf_lb.c 1.4 from OpenBSD
Stricter state checking for ICMP and ICMPv6 packets: include the ICMP type

in one port of the state key, using the type to determine which
side should be the id, and which should be the type. Also:
- Handle ICMP6 messages which are typically sent to multicast
  addresses but recieve unicast replies, by doing fallthrough lookups
  against the correct multicast address.  - Clear up some mistaken
  assumptions in the PF code:
- Not all ICMP packets have an icmp_id, so simulate
  one based on other data if we can, otherwise set it to 0.
  - Don't modify the icmp id field in NAT unless it's echo
  - Use the full range of possible id's when NATing icmp6 echoy

Difference with OpenBSD version:
- C99ify the new code
- WITHOUT_INET6 safe

Reviewed by:	glebius
Obtained from:	OpenBSD
2013-10-27 20:44:42 +00:00
Konstantin Belousov
46038d7fa1 Fix typo.
MFC after:	3 days
2013-10-27 18:52:09 +00:00
Gleb Smirnoff
628c030f77 Provide forward declaration for struct ifnet. Consumers
of this header don't need contents of struct.
2013-10-27 17:27:06 +00:00
Gleb Smirnoff
47bb65deb8 Almost all if_clone consumers do not care about if_clone_event.
Do not force them to include sys/eventhandler.h. Those who
utilize EVENTHANDLER(9), will see the declaration.
2013-10-27 17:14:33 +00:00
Gleb Smirnoff
3122bb3880 Include lock.h before mutex.h. 2013-10-27 17:12:31 +00:00
Ian Lepore
123fe3962d Remove the last dregs of trapframe_t. It turns out only arm was using
this type, so remove it to make arm code more consistant with other
platforms.  Thanks to bde@ for pointing out only arm used trapframe_t.
2013-10-27 17:09:23 +00:00
Konstantin Belousov
e20f049b87 Several small fixes for the amd64 minidump code.
In report_progress(), use nitems(progress_track) instead of manually
hard-coding array size.  Wrap long line.

In blk_write(), code verifies that ptr and pa cannot be non-zero
simultaneously.  The later check for the page-alignment of the ptr
argument never triggers due to pa != 0 always implying ptr == NULL.  I
believe that the intent was to ensure that physicall address passed is
page-aligned, since the address is (temporary) mapped for the duration
of the page write.

Clear the progress_track.visited fields when starting minidump.  If
minidump is restarted or taken second time during the system lifetime,
progress is not printed otherwise, making operator suspectible to the
dump status.

Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-10-27 16:31:12 +00:00
Gleb Smirnoff
75bf2db380 Move new pf includes to the pf directory. The pfvar.h remain
in net, to avoid compatibility breakage for no sake.

The future plan is to split most of non-kernel parts of
pfvar.h into pf.h, and then make pfvar.h a kernel only
include breaking compatibility.

Discussed with:		bz
2013-10-27 16:25:57 +00:00
Konstantin Belousov
c2a445910d When reentering kdb, typically due to a bug causing trap or assert in
the code executed in the context of debugger, do not be ashamed to
inform loudly about the re-entry.  Also, print the backtrace before
obliterating current stack with longjmp, allowing the operator to see
a place which caused the bug.

The change should make it less mysterious debugging the ddb itself.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-10-27 16:20:52 +00:00
Andrew Turner
81f305d283 Always build ubldr as a soft-float binary as there is no support for VFP
this early on in the boot process.
2013-10-27 14:27:11 +00:00
Nathan Whitehorn
a7bb5efa45 Turn on VM_KMEM_SIZE_SCALE on 32-bit as well as 64-bit PowerPC.
Requested by:	alc
MFC after:	1 month
2013-10-27 14:03:51 +00:00
Hans Petter Selasky
d6f4a9f9f6 Fix a deadlock when trying to power off a USB device. The deadlock
happens because the code in question is trying to modify the parent
USB port registers outside the USB explore thread.

MFC after:	3 days
2013-10-27 10:09:53 +00:00
Ian Lepore
2d1bca2d2f Eliminate a compiler warning about extraneous parens. 2013-10-27 03:29:38 +00:00
Ian Lepore
ae7accbc18 Oops, one more instance of ARM_NOCACHE_KVA_SIZE was hiding under the couch.
This should have been cleaned up along with r257201.
2013-10-27 03:24:46 +00:00
Ian Lepore
99af02e3b6 Retire arm_remap_nocache() and the data and constants associated with it.
The only remaining user was the code that allocates bounce pages for armv4
busdma.  It's not clear why bounce pages would need uncached memory, but
if that ever changes, kmem_alloc_attr() would be the way to get it.
2013-10-27 03:13:26 +00:00
Ian Lepore
6489412064 Remove #include <machine/frame.h> from all the arm code that doesn't
really need it.  That would be almost everywhere it was included.  Add
it in a couple files that really do need it and were previously getting
it by accident via another header.
2013-10-27 01:34:10 +00:00