Commit Graph

26867 Commits

Author SHA1 Message Date
Alexander Motin
d46bdcabdb Handle case when ACPI reports HPET device, but does not provide memory
resource for it.  In such case take the address range from the HPET table.

This fixes hpet(4) driver attach on Asrock C2750D4I board.
2013-11-15 11:32:19 +00:00
Alexander Motin
eda36fb4f5 Add some more IDs for Intel ATA, AHCI and USB controllers. 2013-11-15 10:28:59 +00:00
David C Somayajulu
280c10eba5 Validate the buffer and its length passed to QLA_MPI_DUMP.
copyout dump only if qls_mpi_core_dump() is successful.
(like to credit x90c for pointing the issue)
Submitted by:David C Somayajulu
2013-11-15 01:44:58 +00:00
David C Somayajulu
c12c5bfbe1 ql_hw.[c,h]: set minimum thresholds on pkt size for lro path.
ql_ioctl.c: validate the length and address of buffer passed to QL_RD_FW_DUMP

Submitted by:David C Somayajulu
2013-11-15 01:26:24 +00:00
Xin LI
d8f7bfb8bd The previous code makes a memory allocation in size of
struct mbx_common_read_write_flashrom plus 32KB and caps the actual
transfer size at 32KB.  This is harmless as it is but may confuse
static code analyzer, so allocate a full 32KB instead.

Reported by:	Coverity via mjacob
Submitted by:	Venkata Duvvuru <VenkatKumar.Duvvuru Emulex Com>
Coverity CID:	1125820
2013-11-14 18:53:17 +00:00
Adrian Chadd
6171f42c9f Fix (I think!) the scan timeouts on the intel NICs.
This field needs to be (a) set, and (b) greater than the other timeouts
(passive, active, maxquiet, etc.)  It also is in microseconds, not
milliseconds.

I hope this will fix the scan hangs that people are seeing.

Obtained from:	Linux iwlwifi
2013-11-14 07:27:00 +00:00
Adrian Chadd
1650f039d0 This is "scan_flags" from Linux. 2013-11-14 07:21:09 +00:00
Adrian Chadd
48777c4c5a Leave a note that the 5300 is a 3x3 NIC. 2013-11-13 09:32:11 +00:00
Adrian Chadd
ade5fbb745 Correctly initialise the 2-chain antenna mask in the link quality table.
The previous code simply hard-coded IWN_ANT_AB which is only correct for
some of the NICs.

Now, if the NIC is a 1-stream TX, you need to set IWN_ANT_AB and _not_
just a single antenna.  The Intel 5100 firmware panics the moment the
link quality table is updated.

So!

* no secondary antenna? Set it to IWN_ANT_AB;
* two-stream device? Transmit on the full transmit antenna configuration.

Tested:

* Intel 5100, STA
* Intel 2200 (eadler)

Obtained from:	Linux iwlwifi
2013-11-13 07:09:00 +00:00
Kevin Lo
0f3728be20 Remove a couple of unused macros. 2013-11-13 05:22:39 +00:00
Kevin Lo
28dfd8415b - Use bit twiddling macro to set IEEE80211_MODE_11A
- On the RT3572 chipset, there's no need to configure BBP register 86
2013-11-13 05:21:41 +00:00
Ruslan Bukin
5c263f43ef Add support for Freescale Vybrid Family VF600 heterogeneous
ARM Cortex-A5/M4 SoC (M4 core is not used in this work).

Support includes device drivers for:
- NAND Flash Controller (NFC)
- USB Enhanced Host Controller Interface (EHCI)
- General-Purpose Input/Output (GPIO)
- Universal Asynchronous Receiver/Transmitter (UART)

Also supported:
- Generic Interrupt Controller (GIC)
- MPCore timer
- ffec ethernet driver

Reviewed by:	ray
Approved by:	cognet (mentor)
2013-11-12 18:02:56 +00:00
Luiz Otavio O Souza
ea5d5118ae Fix gpiobus to return BUS_PROBE_GENERIC insted of BUS_PROBE_SPECIFIC (0) so
it can be overriden by its OFW/FDT version.

Give a chance for GPIO devices that implement the device_identify method to
attach.

Approved by:	adrian (mentor)
2013-11-12 16:08:23 +00:00
Luiz Otavio O Souza
a1f621566e Move the KASSERT() check to the point before the increase of number of pins.
Approved by:	adrian (mentor)
2013-11-12 13:55:19 +00:00
Luiz Otavio O Souza
8ad579cac3 Fix a typo on a comment in ofw_bus_if.m, the default method will return -1
when a node doesn't exist.

Reviewed by:	nwhitehorn
Approved by:	adrian (mentor)
2013-11-12 13:44:50 +00:00
Mark Johnston
aae2e36cd5 Add IDs for the ASIX 88179 and 88178A USB to GigE adapters. 2013-11-12 06:14:12 +00:00
Adrian Chadd
a704cc7f5f Commit over some work to prepare the iwn(4) driver for further chipset
support.

* Extend the hardware base_params structure to include a bunch of hardware
  flags indicating what is and isn't supported.

* Convert a bunch of the initial hardware configuration conditionals to
  consult the base_params structure.

* Add new calibration code for temperature calibration for the Centrino 2xxx
  series NICs.

* Add new bluetooth coexistence code for Centrino 2xxx series NICs.

* For NICs that support PAN (personal area networking), use a different
  transmit queue and command queue setup, in preparation for said
  PAN support.

* Extend the calibration array in iwn_softc to include enough space for
  the new calibration types.

Tested (by myself, if not mentioned):

* Intel 4965
* Intel 5100
* Intel 6150
* Intel 2230
* Intel 2200 (eadler)
* Intel 1030
* Intel 6200
* Intel 6230
* Intel 6250
* Intel 6150
* Intel 100

What doesn't work:

* Intel 6235 - fails in calibration at startup

TODO:

* Testing on Intel 53xx series hardware

Submitted by:	Cedric Gross <cg@cgross.info>
2013-11-12 05:58:23 +00:00
Adrian Chadd
1c4ec1b709 Fix up the link quality lookup and re-enable multi-rate retry.
This is a terrible solution that at least behaves mostly correctly.

It walks the currently active rate table looking for rates to match.
It assumes that the code matches the setup path in the link quality
setup code (much like the previous, much simpler but even more hackish
math did.)

It's O(n), but n<15, so we're okay for the time being.

Tested:

* Intel 5100, STA - 11a, 11n, 11bg modes.
2013-11-12 05:49:01 +00:00
Adrian Chadd
f1705377c5 Grr. For some odd reason, setting this to a single antenna on my 5100
(which is a 1x2 device) panics the firmware.

But, for some 6xxx devices that require IWN_ANT_BC for the TX chainmask,
the link quality entries need to represent _that_.

So, revert this for now until I can figure out what is supposed to be
going on.
2013-11-12 05:08:24 +00:00
Adrian Chadd
a67bb1257f Use the negotiated HT rate set when generating the link quality table. 2013-11-12 05:00:18 +00:00
Adrian Chadd
47b078db0b Comment what 'mimo' does in the link quality table. 2013-11-12 04:57:31 +00:00
Adrian Chadd
42e0f858ad Don't default to antennas A+B; some NICs use Antennas B+C to transmit. 2013-11-12 04:56:00 +00:00
Kevin Lo
bf124fcf1e Use the real product name for Edimax rsu(4) id. 2013-11-12 02:34:48 +00:00
Nathan Whitehorn
629aa519d6 Make tsec work with the device tree present on the RB800. The previous code
assumed that the MDIO bus was a direct child of the Ethernet interface. It
may not be and indeed on many device trees is not. While here, add proper
locking for MII transactions, which may be on a bus shared by several MACs.

Hardware donated by:	Benjamin Perrault
2013-11-11 15:43:21 +00:00
Kevin Lo
67e73b2b2d Remove r257748 by accident. 2013-11-11 10:00:19 +00:00
Kevin Lo
64891211ca Add support for the MediaTek/Ralink RT5370/RT5372 chipset.
Tested with the TP-Link TL-WN727N (RT5370) and the D-Link DWA-140 (RT5372)
on i386/amd64/arm with WPA.
2013-11-11 09:47:33 +00:00
Adrian Chadd
825e355d1d If A-MPDU transmission fails entirely, then no BA is received from the
NIC and pushed up to the driver.  Unfortunately this means there's
no rate control notification done.  Thus, if the rate control code
makes a decision that hits a crappy rate that can't succeed, the
rate code would never lower the rate and packet loss would continue.

So, fake some rate control notification in this case.
2013-11-11 09:08:22 +00:00
Adrian Chadd
559abc28c0 Replace the hard-coded RX queue value check with IWN_UNSOLICITED_RX_NOTIF. 2013-11-11 08:56:40 +00:00
Adrian Chadd
6abfec88c3 Fix off-by-one. Sorry! 2013-11-11 08:55:38 +00:00
Adrian Chadd
8ea24d528f Use IWN_NBANDS rather than a hard-coded limit.
Tested:

* Intel 5100, STA
2013-11-11 08:54:45 +00:00
Adrian Chadd
7c1c3741c3 Send EAPOL frames at the management rate, not the data rate.
Without this, a far away station with low signal strength would
associate using the management rate (by default the lowest rate)
and then the EAPOL frames would go out at the current AMRR best
guess.  This would result in association failing authentication.

Tested:

* Intel 5100, STA
* Intel 2230, STA
2013-11-11 08:53:20 +00:00
Alexander Motin
07d925fa2f Use relaxed (write-only) memory barriers when writing some of queue index
registers (for now on ISP2400+).  We never read those registers back and
AFAIK their semantics does not require any immediate reaction on write.
2013-11-10 23:48:16 +00:00
Alexander Motin
748d188e18 Some more registers access optimizations:
- Process ATIO queue only if interrupt status tells so;
 - Do not update queue out pointers after each processed command, do it
only once at the end of the loop.
2013-11-10 23:34:32 +00:00
Alexander Motin
d00fd0a920 Save one more register read per command by not reading rqstoutrp register
every time.  The purpose of that register is unlikely output queue overflow
detection, so read it only when its last known (and probably stale now)
value signals overflow.

This reduces CPU load and lock congestion and rises bottleneck in CTL
while doing target mode via two 8Gbps ports from 100K to 120K IOPS.
2013-11-10 13:37:44 +00:00
Gleb Smirnoff
c6b15dd50d Fix typo in r257515.
Submitted by:	az
2013-11-10 09:36:51 +00:00
Ruslan Bukin
8a57d93d59 o Add ONFI signature check.
o Add Micron chip found in Freescale Vybrid Family
  Phytec COSMIC board.

Approved by:	cognet (mentor)
2013-11-09 18:46:11 +00:00
Eitan Adler
2b400c83f2 Add support for SIIG x1 pci-e single parallel port card (JJ-E01211-S1)
PR:		kern/182217
Submitted by:	Craig Leres <leres@ee.lbl.gov>
MFC After:	1 week
2013-11-09 08:27:55 +00:00
Adrian Chadd
4cfb1a088d Add some new driver definitions as part of the chip support updates:
This is a no-op for now!

* Add a new flag value for "there are no extra bits" for some random
  field;

* Add a definition for the maximum number of calibration entries in
  the calibration data cache in iwn_softc.  It's not yet used.

* Add regulatory bands for the 2030 NIC.

Submitted by:	Cedric Gross <cg@cgross.info>
2013-11-09 06:30:09 +00:00
Justin T. Gibbs
4c85fcfa37 On XenServer the "halt" message is used instead of "poweroff", which
makes FreeBSD halt but not poweroff (as expected when issuing a
shutdown from the VM manager). Fix this by using the same handler
for both "halt" and "poweroff".

NB: The "halt" signal seems to be used on XenServer only.  The OSS
    Xen toolstack (xl) uses "poweroff" instead.

Submitted by:	Roger Pau Monné
Sponsored by:	Citrix Systems R&D
Reviewed by:	gibbs
MFC after:	2 days
2013-11-09 03:07:48 +00:00
Jean-Sébastien Pédron
b0d83b17d6 drm/radeon: Wake up userland after page flip
For instance, this caused issues in KDE, such as stuttered animations
(with desktop effects enabled).
2013-11-08 22:47:43 +00:00
Jean-Sébastien Pédron
f79c35617c drm: Initialize "handle" to 0 before calling drm_gem_handle_create()
This is variable is being checked in drm_gem_name_create() before being
set.
2013-11-08 22:44:46 +00:00
Achim Leubner
3fea9c0d26 Update aacraid to version 3.2.5.
Full MSI-X interrupt support added.
Timeout and reset handling reworked, firmware flash update test added.
Support for drives with 4KB block size added.
Changes made to avoid exposure of phys. array components by default.

Approved by:	scottl (mentor), emaste (co-mentor)
2013-11-08 13:23:26 +00:00
Sean Bruno
f478527d75 Add new AMT serial port PCI ID on Intel Lynx Point chipset
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	2 weeks
2013-11-07 19:38:19 +00:00
Navdeep Parhar
1192eeb8a3 cxgbe(4): Tidy up the display for payload memory statistics (pm_stats).
# sysctl -n dev.t4nex.0.misc.pm_stats
# sysctl -n dev.t5nex.0.misc.pm_stats

MFC after:	1 week
2013-11-07 00:25:49 +00:00
Luigi Rizzo
5864b3a586 remove a debugging message 2013-11-06 19:18:39 +00:00
Nathan Whitehorn
f26725de09 Add definition for the Atheros 8021 gigabit PHY.
MFC after:	1 week
2013-11-06 16:28:26 +00:00
Hans Petter Selasky
415fd8a3dc Implement a working write region function to speed up loading of the
firmware. You can test this change by switching the "#if 1" statement
right above in the patched code to "#if 0" !

MFC after:	1 week
2013-11-06 15:32:37 +00:00
Nathan Whitehorn
c67919895d An addendum: it is possible, though of questionable utility, for a node
to have no properties at all. Do the right thing in such cases.
2013-11-06 14:38:53 +00:00
Nathan Whitehorn
1b12f87dbb Make OF_nextprop() work correctly for FDT by using the libfdt
fdt_next_property_offset() API. The old code would sometimes (e.g. on
the device tree supplied by the RB800 boot loader) get confused and stop
partway through listing properties.

MFC after:	1 week
2013-11-06 14:33:37 +00:00
Hans Petter Selasky
bb2f69e83f Check for "ieee80211_vap_setup()" failure in all USB WLAN drivers.
MFC after:	1 week
2013-11-06 12:57:01 +00:00
Kevin Lo
ae7d66f220 Reading the RT2860_ASIC_VER_ID register is not needed and returns
completely bogus value.
2013-11-06 02:49:16 +00:00
Hans Petter Selasky
2764a2784f Protect the "ratectl_ch" callout in the "run" driver by the "run"
softc's "sc->sc_mtx" mutex. Currently the callout was marked
multi-processor safe, which is fine, but it is better to
start/stop/reset callouts while holding the "run" drivers own
mutex. While at it add a missing "ULL" at end of the 64-bit unsigned
integer constant.

MFC after:	1 week
2013-11-05 18:27:25 +00:00
Nathan Whitehorn
5cd2b97cd0 Teach nexus(4) about Open Firmware (e.g. FDT) on ARM and MIPS, retiring
fdtbus in most cases. This brings ARM and MIPS more in line with existing
Open Firmware platforms like sparc64 and powerpc, as well as preventing
double-enumeration of the OF tree on embedded PowerPC (first through nexus,
then through fdtbus).

This change is also designed to simplify resource management on FDT platforms
by letting there exist a platform-defined root bus resource_activate() call
instead of replying on fdtbus to do the right thing through fdt_bs_tag.
The OFW_BUS_MAP_INTR() and OFW_BUS_CONFIG_INTR() kobj methods are also
available to implement for similar purposes.

Discussed on:	-arm, -mips
Tested by:	zbb, brooks, imp, and others
MFC after:	6 weeks
2013-11-05 13:48:34 +00:00
Oleg Bulyzhin
ba36d317f6 - Fix link loss on vlan reconfiguration.
- Fix issues with 'vlanhwfilter'.

MFC after:	1 week
Silence from:	jfv 5 weeks
2013-11-05 09:46:01 +00:00
Luigi Rizzo
bc4c07d8e6 remove some test code. 2013-11-05 01:06:22 +00:00
Luigi Rizzo
954dca4c99 fix a bug when a device has 1 tx (or rx) queue and more than
one queue of a different type.

Submitted by:	Vincenzo Maffione
MFC after:	3 days
2013-11-05 00:56:07 +00:00
Luigi Rizzo
5ab0d24d48 check errors on return from netmap_attach()
Submitted by:	Giuseppe Lettieri
MFC after:	3 days
2013-11-05 00:50:59 +00:00
Ian Lepore
3110e7eed8 Move remaining code and data related to static device mapping into the
new devmap.[ch] files.  Emphasize the MD nature of these things by using
the prefix arm_devmap_ on the function and type names (already a few of
these things found their way into MI code, hopefully it will be harder to
do by accident in the future).
2013-11-04 22:45:26 +00:00
Navdeep Parhar
be2c01211c cxgbe(4): Exclude MPS_RPLC_MAP_CTL (0x11114) from the register dump. Turns
out it's a write-only register with strange side effects on read.

Submitted by:	gnn
MFC after:	3 days
2013-11-04 21:06:21 +00:00
Ian Lepore
2bd843b4da This files should have been included in r257648. 2013-11-04 20:00:21 +00:00
Ian Lepore
f827d58e4d Rework the aicasm build machinery so that it gets built along with toolchain
components instead of with the kernel and/or modules.  This ensures that it
gets built with the host compiler, not the compiler in obj/... used to build
the target components (which may be a cross-compiler outputting code for a
different architecture and using header files with types and options set up
for the wrong architecture).

Reviewed by:	imp
2013-11-04 15:55:04 +00:00
Adrian Chadd
2a6433bc56 Add Bluetooth/PAN (personal area networking) commands.
Submitted by:	Cedric Gross <cg@cgross.info>
2013-11-04 05:52:42 +00:00
Adrian Chadd
fd070dd18f Add device ids for the Centrino 2x00 devices.
Submitted by:	Cedric Gross <cg@cgross.info>
2013-11-04 05:40:19 +00:00
Adrian Chadd
fbab6d4db3 Remove trailing whitespace.
Submitted by:	Cedric Gross <cg@cgross.info>
2013-11-04 04:10:36 +00:00
Hans Petter Selasky
7815365774 Add description of two EHCI PCI IDs.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2013-11-03 21:33:42 +00:00
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
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
Alfred Perlstein
50903998f0 Add device ID for 'Sanoxy 802.11N' usb 2013-11-02 11:37:16 +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
Luigi Rizzo
ab1e286051 add missing file from previous netmap update... 2013-11-02 00:54:47 +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
Gleb Smirnoff
f909bbb4db Somehow fix LINT-NOIP. 2013-11-01 18:42:03 +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
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
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
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
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
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
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
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
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
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
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
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
Randall Stewart
6f1dba186e Opps, my kirkwood fix for the dreamplug missed this. 2013-10-29 11:28:11 +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
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
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
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
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
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
Sean Bruno
da276a9179 repair build for dev/cs.
Reported by: Outback Dingo <outbackdingo@gmail.com>
2013-10-28 16:27:01 +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
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
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
Nathan Whitehorn
94f33b0ab6 Try even harder to find a console before giving up. 2013-10-26 20:06:50 +00:00
Gleb Smirnoff
61a3ac6e27 The MII layer shouldn't care about administrative status of an
interface. Make MII drivers forget about 'struct ifnet'.

Later plan is to provide an administrative downcall from ifnet
layer into drivers, to inform them about administrative status
change. If someone thinks that processing MII events for an
administratively down interface is a big problem, then drivers
would turn MII processing off.

The following MII drivers do evil things, like strcmp() on
driver name, so they still need knowledge of ifnet and thus
include if_var.h. They all need to be fixed:

sys/dev/mii/brgphy.c
sys/dev/mii/e1000phy.c
sys/dev/mii/ip1000phy.c
sys/dev/mii/jmphy.c
sys/dev/mii/nsphy.c
sys/dev/mii/rgephy.c
sys/dev/mii/truephy.c

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-26 18:40:17 +00:00
Nathan Whitehorn
dce533f390 Be a bit more flexible in how we find the console from the properties on
/chosen, following the list of allowed console properties in ePAPR. Also
do not require that stdin be defined and equal to stdout: stdin is
nonstandard (for ePAPR) and console in an unexpected place is after all
better than no console.
2013-10-26 18:25:55 +00:00
Gleb Smirnoff
eedc7fd9e8 Provide includes that are needed in these files, and before were read
in implicitly via if.h -> if_var.h pollution.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-26 18:18:50 +00:00
Gleb Smirnoff
76039bc84f The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare
to this event, adding if_var.h to files that do need it. Also, include
all includes that now are included due to implicit pollution via if_var.h

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-26 17:58:36 +00:00
Gleb Smirnoff
f706f92681 Move includes from if_bcereg.h to .c files. 2013-10-26 17:40:38 +00:00
Zbigniew Bodek
49e368ac48 Wait for DesignWare UART transfers completion before accessing line control
When using DW UART with BUSY detection it is necessary to wait
until all serial transfers are finished before manipulating the
line control. LCR will not be affected when UART is busy.
In addition, if Divisor Latch Access Bit is being set in order to
modify UART divisors:
1. We will get BUSY interrupt if interrupts are enabled.
2. Because LCR will not be affected the THR and (even worse) IER
   contents will be corrupted. This will lead to console hang.

Approved by:	cognet (mentor)
2013-10-26 17:24:59 +00:00
Ian Lepore
21104c7028 Switch to using ofw_bus_search_compatible() table-driven compat lookup.
Add compat strings for Freescale Vybrid family SoCs.
2013-10-26 15:15:31 +00:00
Nathan Whitehorn
e889db8841 machine/pmap.h is included by vm/pmap.h, so is redundant here. Thanks to
Alan Cox for pointing this out.
2013-10-26 13:18:39 +00:00
Nathan Whitehorn
c20809e143 Fix build after r257111 by including headers with definition of pmap_kextract(). 2013-10-26 03:22:57 +00:00
Adrian Chadd
494571986b add 0x8b, lifted from Linux iwlegacy/commands.h
This is "STA invalid". I saw it during some 4965 testing (kern/183260)
and I still have no idea what is causing it.

Obtained from:	Linux drivers/net/wireless/iwlegacy
2013-10-26 01:17:54 +00:00
Adrian Chadd
8cf53c1244 Begin fleshing out a knob to enable/disable bluetooth coexistence.
Some firmware versions seem to get very unhappy if they're sent btcoex
commands when they don't actually have bluetooth hardware in them.
So, disable sending them those commands.

Tested:

* 5100 (which has bluetooth, no problems)
* 4965 (which doesn't have bluetooth, but didn't seem to crash)
* 6200 (no bluetooth, seems to get unhappy being sent bluetooth commands.)
2013-10-25 19:46:52 +00:00
Adrian Chadd
2e6fe9b630 Temporarily disable multi-rate retry (link quality) and eliminate rate
index lookups.

* My recent(ish) change to iwn(4) and the net80211 rate control API to
  support 11n rates broke the link quality table use.  So, until I or
  someone else decides to fix it, let's just disable it for now.

* Teach iwn_tx_data_raw() to use the iwn_rate_to_plcp() function.

* Eliminate two uses of the net80211 rate index lookup functions - they
  are only for legacy rates and they're not needed here.

This fixes some invalid looking rate control TX issues that showed up
on my 4965 but it doesn't fix the two TX hangs I've noticed. Those look
like DMA related issues.

Tested:

* 4965, STA mode
* 5100, STA mode
2013-10-25 19:44:53 +00:00
Nick Hibma
d884c4ddaa Add id for GTM661W. 2013-10-25 19:39:22 +00:00
Ian Lepore
498fa7c1f9 Add a helper routine to search for a compat string in a table that
associates compat strings with arbitrary values that mean something to
the driver.  This is handy for drivers that support several variations
of similar hardware and need to know which one matched.

Reviewed by:	imp, jmg, nwhitehorn
2013-10-25 19:15:21 +00:00
Luiz Otavio O Souza
09b2544b71 Remove all the instances of '#undef DEBUG' from kernel.
Suggested by:	rpaulo
Approved by:	adrian (mentor)
2013-10-25 18:38:44 +00:00
Nathan Whitehorn
6ad36cf2c8 Make sure to get the right node when looking up #interrupt-cells. 2013-10-25 15:37:58 +00:00
Nathan Whitehorn
6751474523 Use common OFW root code to set up fdtbus. This is an almost purely
negative diff that should improve reliability somewhat. There should be
no differences in behavior -- please report any that crop up. This has been
tested on ARM and PPC systems.

Tested by:	ray
2013-10-25 13:29:07 +00:00
Aleksandr Rybalko
4162dff98a Test UARTs physical address instead of virtual. 2013-10-25 11:44:39 +00:00
Nathan Whitehorn
e3f4d74e21 Remove some of the code required for supporting ssm(4) on SPARC in favor
of a more PowerPC/FDT-focused design. Whenever SPARC64 is integrated
into this rework, this should be (trivially) revisited.
2013-10-24 21:49:23 +00:00
Konstantin Belousov
c54a713f6a Make pci_get_dma_tag() non-static. Since the function is only
referenced by pointer, making it non-static should not have even the
negligible impact on the existing code.

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-10-24 20:29:29 +00:00
Konstantin Belousov
83cc1cfaea Add some definitions for the bits in root control and status PCIe cap
registers.

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-10-24 20:25:29 +00:00
Konstantin Belousov
feb96b46a2 Move the PCI_DMA_BOUNDARY definition into the pcivar.h.
Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-10-24 20:21:37 +00:00
Luiz Otavio O Souza
585300e937 Add an OFW SPI compatible bus. Fix the spibus probe to return
BUS_PROBE_GENERIC and not BUS_PROBE_SPECIFIC (0) so the OFW SPI bus can
attach when enabled.  Export the spibus devclass_t and driver_t
declarations.

Submitted by:	ray
Approved by:	adrian (mentor)
2013-10-24 16:56:38 +00:00
Edward Tomasz Napierala
84fb32a371 Don't spin with mutex hold when there is not enough room in the send socket
buffer.  While here, make the code flow somewhat nicer.

Thanks to mav@ for tracking it down.

Tested by:	mav
MFC after:	3 days
Sponsored by:	FreeBSD Foundation
2013-10-24 15:54:06 +00:00
Nathan Whitehorn
238b0483a7 Do not map IRQs twice. This fixes PowerPC/FDT systems with multiple PICs,
which would try to treat the previously-mapped interrupts from
fdt_decode_intr() as interrupt line numbers on the same parent PIC.
2013-10-24 15:44:29 +00:00
Nathan Whitehorn
863527800c interrupt-parent and #interrupt-cells are written to the tree using
encode-int.
2013-10-24 14:15:05 +00:00
Aleksandr Rybalko
3a1f3e0d0c Fix crossed fingers output. Only comment changed. 2013-10-24 09:27:06 +00:00
Adrian Chadd
8a5e5a978d Break out the debug code into a new include file in preparation for
some more iwn work.
2013-10-24 01:03:42 +00:00
Adrian Chadd
b876a4a384 Add #ifdef wrapper around definitions so they aren't included multiple
times.
2013-10-24 01:02:54 +00:00
Nathan Whitehorn
a8126ae500 Factor out MI portions of the PowerPC nexus device into /sys/dev/ofw. The
sparc64 driver will be modified to use this shortly.
2013-10-23 20:00:14 +00:00
Xin LI
5fbb683079 Update driver to version 10.0.664.0.
Many thanks to Emulex for their continued support of FreeBSD.

Submitted by:	Venkata Duvvuru <VenkatKumar.Duvvuru Emulex Com>
MFC after:	3 day
2013-10-23 18:58:38 +00:00
Nathan Whitehorn
f214848258 Add two new interfaces to ofw_bus:
- ofw_bus_map_intr()
  Maps an (iparent, IRQ) tuple to a system-global interrupt number in some
  platform dependent way. This is meant to be implemented as a replacement
  for [FDT_]MAP_IRQ() that is an MI interface that knows about the bus
  hierarchy.
- ofw_bus_config_intr()
  Configures an interrupt (previously mapped) based on firmware sense flags.
  This replaces manual interpretation of the sense field in bus drivers and
  will, in a follow-up, allow that interpretation to be redirected to the PIC
  drivers where it belongs. This will eventually replace the tables in
  /sys/dev/fdt/fdt_ARCH.c

The PowerPC/AIM code has been converted to use these globally, with an
implementation in terms of MAP_IRQ() and powerpc_config_intr(), assuming
OpenPIC, at the bus root in nexus(4). The ofw_bus_config_intr() will shortly
be integrated into pic_if.m and bounced through nexus into the PIC tree.

FDT integration will happen significantly later due to larger testing
requirements. This patch in general also lays the groundwork for the removal
of /sys/dev/fdt/fdt_ARCH.c and machine/fdt.h.
2013-10-23 17:24:21 +00:00
Nathan Whitehorn
755c959170 Remove OF_instance_to_package() hack for FDT and replace with use of the
generic OF_xref_phandle() API universally. Also replace some related
explicit uses of fdt32_to_cpu() with OF_getencprop() calls.
2013-10-23 14:04:09 +00:00
Nathan Whitehorn
d3a0a0f37e Make all Open Firmware internal interfaces endian-safe by using the new
OF_getencprop() API. This removes one explicit endianness conversion in
ofw_iicbus.c.
2013-10-23 13:55:41 +00:00
Kevin Lo
d4d0412bc9 Fix the RT2860_TX_SW_CFG2 init value on older revisions of RT3070 chip. 2013-10-23 09:53:37 +00:00
Andreas Tobler
5e40646cc3 Fix build. 2013-10-23 03:59:51 +00:00
Nathan Whitehorn
4231c48fa1 A few other common cases for encode-int decoding: OF_getencprop_alloc()
and OF_searchencprop(). I thought about using the element size parameter
to OF_getprop_alloc() to do endian-switching automatically, but it breaks
use with structs and a *lot* of FDT code (which can hopefully be moved to
these new APIs).

MFC after:	2 weeks
2013-10-22 21:20:05 +00:00
Nathan Whitehorn
29fdf9ef00 Add a new function (OF_getencprop()) that undoes the transformation applied
by encode-int. Specifically, it takes a set of 32-bit cell values and
changes them to host byte order. Most non-string instances of OF_getprop()
should be using this function, which is a no-op on big-endian platforms.
2013-10-22 20:57:24 +00:00
Ian Lepore
d6454cbdb5 Mask out non-address bits in the mac address register, for proper
detection of an all-zeroes address.  Also remove a misplaced return.

Reviewed by:	br@
2013-10-22 18:14:06 +00:00
Brooks Davis
fdd228fcd6 MFP4: 223121 (PIC portion), 225861, 227822, 229692 (PIC only), 229693,
230523, 1123614

Implement a driver for Robert Norton's PIC as an FDT interrupt
controller. Devices whose interrupt-parent property points to a beripic
device will have their interrupt allocation, activation , and setup
operations routed through the IC rather than down the traditional bus
hierarchy.

This driver largely abstracts the underlying CPU away allowing the
PIC to be implemented on CPU's other than BERI. Due to insufficient
abstractions a small amount of MIPS specific code is currently required
in fdt_mips.c and to implement counters.

MFC after:	3 days
Sponsored by:	DARPA/AFRL
2013-10-22 15:29:59 +00:00
Nathan Whitehorn
11dc3f01ec Set BUS_PROBE_NOWILDCARD on this attachment as a stopgap. Unconditionally
poking at registers in unknown devices is not the best probe mechanism.
This should be reverted and a better solution found later.
2013-10-22 14:10:00 +00:00
Nathan Whitehorn
7f5392e292 Allow lots of interrupts (useful on multi-domain platforms) and do not
set device_quiet() on all devices attached under nexus(4).
2013-10-22 14:08:57 +00:00
Nathan Whitehorn
17593f8612 Standards-conformance and code deduplication:
- Use bus reference phandles in place of FDT offsets as IRQ domain keys
- Unify the identical macio/fdt/mambo OpenPIC drivers into one
- Be more forgiving (following ePAPR) about what we need from the device
  tree to identify an OpenPIC
- Correctly map all IRQs into an interrupt domain
- Set IRQ_*_CONFORM for interrupts on an unknown PIC type instead of
  failing attachment for that device.
2013-10-22 14:07:57 +00:00
Alexander Motin
c310901142 Fix memory and references leak due to unfreed path.
Coverity CID:	1109815
2013-10-22 13:52:20 +00:00
Alexander Motin
7ef4b2a5de Fix memory and references leak due to unfreed path.
Coverity CID:	1109817
2013-10-22 12:42:49 +00:00
Alexander Motin
40ea77a036 Merge GEOM direct dispatch changes from the projects/camlock branch.
When safety requirements are met, it allows to avoid passing I/O requests
to GEOM g_up/g_down thread, executing them directly in the caller context.
That allows to avoid CPU bottlenecks in g_up/g_down threads, plus avoid
several context switches per I/O.

The defined now safety requirements are:
 - caller should not hold any locks and should be reenterable;
 - callee should not depend on GEOM dual-threaded concurency semantics;
 - on the way down, if request is unmapped while callee doesn't support it,
   the context should be sleepable;
 - kernel thread stack usage should be below 50%.

To keep compatibility with GEOM classes not meeting above requirements
new provider and consumer flags added:
 - G_CF_DIRECT_SEND -- consumer code meets caller requirements (request);
 - G_CF_DIRECT_RECEIVE -- consumer code meets callee requirements (done);
 - G_PF_DIRECT_SEND -- provider code meets caller requirements (done);
 - G_PF_DIRECT_RECEIVE -- provider code meets callee requirements (request).
Capable GEOM class can set them, allowing direct dispatch in cases where
it is safe.  If any of requirements are not met, request is queued to
g_up or g_down thread same as before.

Such GEOM classes were reviewed and updated to support direct dispatch:
CONCAT, DEV, DISK, GATE, MD, MIRROR, MULTIPATH, NOP, PART, RAID, STRIPE,
VFS, ZERO, ZFS::VDEV, ZFS::ZVOL, all classes based on g_slice KPI (LABEL,
MAP, FLASHMAP, etc).

To declare direct completion capability disk(9) KPI got new flag equivalent
to G_PF_DIRECT_SEND -- DISKFLAG_DIRECT_COMPLETION.  da(4) and ada(4) disk
drivers got it set now thanks to earlier CAM locking work.

This change more then twice increases peak block storage performance on
systems with manu CPUs, together with earlier CAM locking changes reaching
more then 1 million IOPS (512 byte raw reads from 16 SATA SSDs on 4 HBAs to
256 user-level threads).

Sponsored by:	iXsystems, Inc.
MFC after:	2 months
2013-10-22 08:22:19 +00:00
Nathan Whitehorn
bb512af9ec Return standards-compliant code from OF_nextprop() with FDT when no
properties remain on this node.
2013-10-22 02:39:56 +00:00
Bjoern A. Zeeb
5f8dfdce49 Make netback compile without INET support in the kernel.
This shuld have been a problem since r230587.  Not exactly sure why it
was not detected the last weeks with the tinderbox.  I would assume
r255744 is what started to cause it.

MFC after:	1 week
2013-10-22 00:50:53 +00:00
Brooks Davis
a33ce322b6 Remove the isf(4) driver. It was created by accident and is subset of
the cfi(4) driver.  It remained in the tree longer than would be ideal
due to the time required to bring cfi(4) to feature parity.

Sponsored by:	DARPA/AFRL
MFC after:	3 days
2013-10-21 22:43:38 +00:00
Brooks Davis
1f40dbc854 MFP4: 223121 (FDT infrastructure portion)
Implement support for interrupt-parent nodes in simplebus.  The current
implementation requires that device declarations have an interrupt-parent
node and that it point to a device that has registered itself as a
interrupt controller in fdt_ic_list_head and implements the fdt_ic
interface.

Sponsored by:   DARPA/AFRL
2013-10-21 21:13:01 +00:00
Konstantin Belousov
ce95d2f922 Reset function on SandyBridge holds the gt_lock for the whole duration
already.  Also, according to the specs, GDRST register is not in the
power well, so the forcewake for reset status read is excessive for
this reason.

Use plain register read for waiting of the reset completion
notification, to avoid gt_lock recursion.  Linux upstream did the
similar change, but their code was already restructured.

Reported by:	ray
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-10-21 16:22:51 +00:00
Alexander Motin
227d67aa54 Merge CAM locking changes from the projects/camlock branch to radically
reduce lock congestion and improve SMP scalability of the SCSI/ATA stack,
preparing the ground for the coming next GEOM direct dispatch support.

Replace big per-SIM locks with bunch of smaller ones:
 - per-LUN locks to protect device and peripheral drivers state;
 - per-target locks to protect list of LUNs on target;
 - per-bus locks to protect reference counting;
 - per-send queue locks to protect queue of CCBs to be sent;
 - per-done queue locks to protect queue of completed CCBs;
 - remaining per-SIM locks now protect only HBA driver internals.

While holding LUN lock it is allowed (while not recommended for performance
reasons) to take SIM lock.  The opposite acquisition order is forbidden.
All the other locks are leaf locks, that can be taken anywhere, but should
not be cascaded.  Many functions, such as: xpt_action(), xpt_done(),
xpt_async(), xpt_create_path(), etc. are no longer require (but allow) SIM
lock to be held.

To keep compatibility and solve cases where SIM lock can't be dropped, all
xpt_async() calls in addition to xpt_done() calls are queued to completion
threads for async processing in clean environment without SIM lock held.

Instead of single CAM SWI thread, used for commands completion processing
before, use multiple (depending on number of CPUs) threads.  Load balanced
between them using "hash" of the device B:T:L address.

HBA drivers that can drop SIM lock during completion processing and have
sufficient number of completion threads to efficiently scale to multiple
CPUs can use new function xpt_done_direct() to avoid extra context switch.
Make ahci(4) driver to use this mechanism depending on hardware setup.

Sponsored by:	iXsystems, Inc.
MFC after:	2 months
2013-10-21 12:00:26 +00:00
Ganbold Tsagaankhuu
8f011d4075 Move and rename dwc otg driver to more
generic one as it appears to work
for rk3188 SoC based board too.

No objections from: hselasky@
Reviewed by: ray@
2013-10-21 09:34:04 +00:00
Pyun YongHyeon
214c71f64d Add preliminary support for RTL8106E PCIe FastEthernet.
H/W donated by:	RealTek Semiconductor Corp.
2013-10-21 06:27:20 +00:00
Pyun YongHyeon
fd3ae0f5be Correct MAC revision bits. Previously it always cleared bit 20 and
bit 21.
2013-10-21 06:22:20 +00:00
Alexander Motin
5e63cdb457 Partial MFproject/camlock r256671:
Fix several target mode SIMs to not blindly clear ccb_h.flags field of
ATIO CCBs.  Not all CCB flags there belong to them.
2013-10-21 06:04:39 +00:00
Nathan Whitehorn
6064b6ac48 Allow the OFW interrupt mapping code to work with PCI devices not enumerated
by Open Firmware, as in the case of FDT.
2013-10-21 00:04:26 +00:00
Ian Lepore
6dd028d8f8 Calculate the baud rate divisor rather than using a hard-coded value.
Submitted by:	Steven Lawrance <stl@koffein.net>
2013-10-20 23:40:16 +00:00
Ian Lepore
dc82313758 Add a driver for the Freescale Fast Ethernet Controller found on various
Freescale SoCs including the i.MX series.  This also works for the newer
SoCs with the ENET gigabit controller, but doesn't use any of the new
hardware features other than enabling gigabit speed.
2013-10-20 21:07:38 +00:00
Nathan Whitehorn
457639351b Some nexus devices add wildcard children. Since fdtbus_probe returned
BUS_PROBE_DEFAULT, it would attach to them all, producing both many
fdtbus instances and preventing other devices from attaching. Instead
return BUS_PROBE_NOWILDCARD, which exists for exactly this purpose.
2013-10-20 18:38:19 +00:00
Gavin Atkinson
ee0d8611db Add 26 new device IDs to uslcom(4). This brings us in sync with Linux
v3.12 rc5.

MFC after:	3 days
2013-10-20 11:19:37 +00:00
Jean-Sébastien Pédron
ea92d5372d drm/radeon: radeonkms depends on firmware(9)
Submitted by:	tijl@
2013-10-19 17:11:58 +00:00
Brooks Davis
1a440eb2c0 MFP4: 1136252
Add an option ATSE_CFI_HACK to allow memory mapped CFI devices to have
their address range allocated sharable so that atse(4) can find it's
Ethernet address in the expected location.

We intend to remove this hack once the BERI platform has a loader.
2013-10-18 20:52:42 +00:00
Brooks Davis
f570e9e145 MFP4: 221483, 221567, 221568, 221670, 221677, 221678, 221800, 221801,
221804, 221805, 222004, 222006, 222055, 222820, 1135077, 1135118, 1136259

Add atse(4), a driver for the Altera Triple Speed Ethernet MegaCore.

The current driver support gigabit Ethernet speeds only and works with
the MegaCore only in the internal FIFO configuration in the soon to be
open sourced BERI CPU configuration.

Submitted by:	bz
MFC after:	3 days
Sponsored by:	DARPA/AFRL
2013-10-18 20:44:19 +00:00
Hans Petter Selasky
2c452d7400 Improve XHCI stability. When a command timeout happens, the command
should be aborted else the command queue can stop. Refer to section
"4.6.1.2" of the XHCI specification.

MFC after:	1 week
2013-10-18 17:38:57 +00:00
Brooks Davis
e908804339 MFP4 (driver change only):
Change 231100 by brooks@brooks_zenith on 2013/07/12 21:01:31

	Add a new option ALTERA_SDCARD_FAST_SIM which checks immediatly
	for success of I/O operations rather than queuing a task.

MFC after:	3 days
Sponsored by:	DARPA/AFRL
2013-10-18 15:27:11 +00:00
Brooks Davis
1818891c93 MFP4:
Change 227594 by brooks@brooks_zenith on 2013/04/11 17:10:14

	When we fail, print the error that occured if we are giving
	up or if bootverbose is set.

MFC after:	3 days
Sponsored by:	DARPA/AFRL
2013-10-18 15:24:18 +00:00
Kevin Lo
d48971d0d2 Correct tx mixer gain value for RT3070 and RT3071.
Correctly value in EEPROM/EFUSE is one or more for RT3070 and
two or more for other RT3071 chips.
2013-10-18 07:48:20 +00:00
Kevin Lo
6bf8d884ad Since the DAC issue has been fixed in RT3070(F), the voltage raising fix
is no longer needed.
2013-10-18 07:46:28 +00:00
Kevin Lo
5d534170af Fix lower bits of RF_R3 for RT3370 and newer. This change doesn't affect
older chipsets.
2013-10-18 07:43:49 +00:00
Kevin Lo
9648d6ae84 Fix rf registers for RT3070. 2013-10-18 07:42:16 +00:00
Navdeep Parhar
87f804e879 Fix typo in previous commit. 2013-10-18 00:00:08 +00:00
Navdeep Parhar
02318fcf86 iw_cxgbe should have a dependency on t4nex.
Reported by:	trasz@
2013-10-17 23:57:17 +00:00
Alexander Motin
523ea374b6 Optimize isp(4) to reduce CPU usage, especially in target mode:
- Remove two excessive and slow register reads from isp_intr().  Instead
of rereading value every time, assume that registers contain what we have
written there.
 - Avoid sequential search through 4096 array elements when looking for
command tag.  Use hash of lists to store active tags separately from free
ones and so greatly speedup the searches.

Reviewed by:	mjacob
2013-10-17 20:19:15 +00:00
Navdeep Parhar
fb93f5c47f iw_cxgbe: iWARP driver for Chelsio T4/T5 chips. This is a straight port
of the iw_cxgb4 found in OFED distributions.

Obtained from:	Chelsio
2013-10-17 18:37:25 +00:00
Konstantin Belousov
7c3547bacd Utilize the stronger guarantees on the call arguments from the
harvester, which now always calls hwrngs with the buffer length
multiple of the word size.  This allows to remove the excessive memory
accesses to temporary buffer when saving the entropy word.

Streamline the assembly and unify it between i386 and amd64.

Reviewed by:	markm, des
Approved by:	so (des)
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2013-10-17 07:57:58 +00:00
Rui Paulo
b372f122ab Add a missing comma. 2013-10-17 05:51:54 +00:00
Rui Paulo
83bbd5ebf9 Move a lot of debugging printf's to DPRINTF.
Approved by:	adrian
MFC after:	2 weeks
2013-10-17 01:53:07 +00:00
Adrian Chadd
db4ff7db8c Add a big, big note to the vlan code that it needs to be taught
about the new VLAN options for the AR9340 and AR8327 chips.
2013-10-16 04:15:35 +00:00
Adrian Chadd
b215216171 Add support for the AR9340 switch to the switch framework.
* Do the hardware setup in the right order!
* Modify/improve the chip probe check so it can actually
  probe the 7240/9340 directly (although it's not yet used..)
* Initialise and fetch the is_mii option
* Fix some debugging whilst I'm here.

This is enough to get things off the ground.

Tested:

* AR9344 SoC
2013-10-16 04:15:03 +00:00
Adrian Chadd
657b84792c Prepare to link in the AR934x SoC switch support.
* Add an AR9340 switch version entry;
* Support the switch being connected via MII;
* Add a flag to note that a switch is actually an internal
  switch rather than an external switch.

Now:

* The ar9340 switch can interconnect via MII;
* Since some slightly different phy/switch register access methods
  and quirks appear for the internal versus external switch,
  we will need a flag to mark it as an "internal" switch.

Tested:

* AR9344 (internal switch)
* AR9331 (internal switch)

TODO:

* Test the AR8316 switch!
2013-10-16 03:19:05 +00:00
Adrian Chadd
fc80af8857 Initial commit of AR9340 switch SoC support.
This is just the chip initialisation code (for now.)

It's not linked into the main build as it requires a bunch of other code
to be tidied up and committed.  But it indeed does function as advertised.

Tested:

* AR9344 SoC
2013-10-16 03:15:52 +00:00
Hans Petter Selasky
5c767719b0 Correct programming of XXX_MAXP register. This register is 16-bit wide
and not 8-bit. Fix support for isochronous transfers in USB host mode.
Fix a whitespace while at it.

MFC after:	1 week
Reported by:	SAITOU Toshihide <toshi@ruby.ocn.ne.jp>
PR:		usb/181987
2013-10-15 17:11:13 +00:00
Hans Petter Selasky
57733723fe Add new USB ID.
PR:		usb/182936
Submitted by:	Keith White <kwhite@site.uottawa.ca>
MFC after:	1 week
2013-10-15 06:23:54 +00:00