Commit Graph

27059 Commits

Author SHA1 Message Date
Sean Bruno
457b3426b1 Wrap this debug statement in debug defines. Else, this driver
will refuse to load.

MFC after:	2 weeks
Sponsored by:	Yahoo! Inc.
2014-01-03 20:45:56 +00:00
Kevin Lo
7a7e01caa4 Add support for the MediaTek/Ralink RT3593 chipset.
Committed over the ZyXEL NWD2705 on amd64 with WPA.
2014-01-03 06:01:05 +00:00
Warner Losh
8b96ccd4b5 Fill in some more info about the (somewhat old) Samsung parts I have
here...
2014-01-03 00:26:56 +00:00
Warner Losh
de74da330d The HOT-E HL201 has 128MB Samsung SLC NAND, ID it properly. 2014-01-03 00:17:52 +00:00
Adrian Chadd
3af0f449ae Add an option to enable or disable the small RX packet copying that
is done to improve performance of small frames.

When doing RX packing, the RX copying isn't necessarily required.

Reviewed by:	np
2014-01-02 23:23:33 +00:00
Zbigniew Bodek
b1c5afbb2f Revert r260165: Proper configuration of unmapped_buf_allowed should be used
To avoid failures in bus_dmamap_sync() on ARM unmapped_buf_allowed should
be set to 0. Hence, ARM-specific changes in AHCI should not be applied.
2014-01-02 11:24:04 +00:00
Hans Petter Selasky
682d7ab884 Minor correction for the XHCI reset logic.
MFC after:	1 week
Found by:	Horse Ma <HMa@wyse.com>
2014-01-02 08:02:57 +00:00
Warner Losh
e6ffadc39f Make the comment match the code. Not sure why we calculate it this
weird way, but didn't change that...
2014-01-02 02:20:10 +00:00
Zbigniew Bodek
49390e758d Use only mapped BIOs on ARM
Using unmapped BIOs causes failure inside bus_dmamap_sync, since
this function requires valid MVA address, which is not present
if mapping is not set up.

Submitted by:	Wojciech Macek <wma@semihalf.com>
Obtained from:	Semihalf
2014-01-01 20:26:08 +00:00
Zbigniew Bodek
df2ec2e4fb Do not attach to PCI bridges in AHCI driver
Some vendors use the same VID:PID combination in AHCI and PCI bridge cards

Submitted by:	Wojciech Macek <wma@semihalf.com>
Obtained from:	Semihalf
2014-01-01 20:18:03 +00:00
Ed Maste
98457e0bb5 Increase vt(9) max glyph data to 1MB for CJK fonts with many glyphs
Sponsored by:	The FreeBSD Foundation
2014-01-01 19:38:15 +00:00
Warner Losh
380ff59ab1 Add support for Samsung K9F2G08U0A (256MiB SLC) NAND found on some old
Atmel boards I have.

# All Samsung, Toshiba and SanDisk parts will need to be in this table
# since they don't conform to the ONFI specification (they are all Toggle
# parts). There's some standards for the additional bytes so there's some hope
# to decode them automatically on a per-vendor basis, but even that has
# problems (and is what motivated the ONFI parameter page).
2013-12-31 07:36:39 +00:00
Eric Davis
ae02949d11 For TSO, when the first mbuf contains both the packet header and data, the
header is split out into its own BD for processing by the firmware. When
this split occurred the data length in the BD was not being set correctly
resulting in packet corruption.

Approved by:	davidcd (mentor)
2013-12-30 23:02:26 +00:00
Dimitry Andric
bff60cf827 In sys/dev/sound/pci/maestro.c, #if 0 two unused static functions.
MFC after:	3 days
2013-12-30 22:17:33 +00:00
Xin LI
198f573526 Eliminate unused drbr_stats_update implementation in oce(4) driver.
Noticed by:	dim
MFC after:	2 weeks
2013-12-30 21:30:49 +00:00
Marius Strobl
e0c758686c - Probe with BUS_PROBE_DEFAULT instead of 0.
- Remove clearing PCIM_CMD_INTxDIS; pci(4) will do that as appropriate since
  r189367.

MFC after:	1 week
2013-12-30 16:46:50 +00:00
Edward Tomasz Napierala
68ca2e2ebb Fix extremely slow operation with data digests enabled. This was caused
by receive code waiting for data digest even when the data segment was
empty.  It didn't actually read it, but it waited until those four bytes
become available in the socket buffer, i.e. until any other PDU (such as NOP)
came in.

PR:		kern/185240
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2013-12-30 12:18:06 +00:00
Marius Strobl
da67681dd3 - Probe with BUS_PROBE_DEFAULT instead of 0.
- Nuke code setting PCI_POWERSTATE_D0; pci(4) already does that for type 0
  devices.
- There's no need to keep track of resource IDs.
- Quiesce the interrupt before actually detaching.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.

MFC after:	1 week
2013-12-29 23:46:59 +00:00
Marius Strobl
0a9d883977 - Probe with BUS_PROBE_DEFAULT instead of 0.
- Nuke code setting PCI_POWERSTATE_D0; pci(4) already does that for type 0
  devices.
- Use PCIR_BAR instead of a homegrown macro.
- There's no need to keep track of resource IDs.
- Quiesce the interrupt before actually detaching.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.

MFC after:	1 week
2013-12-29 23:05:01 +00:00
Marius Strobl
66168a0428 - Probe with BUS_PROBE_DEFAULT instead of 0.
- Nuke code setting PCI_POWERSTATE_D0; pci(4) already does that for type 0
  devices.
- Use PCIR_BAR instead of a homegrown macro.
- There's no need to keep track of resource IDs.
- Quiesce the interrupt before actually detaching.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.
- Nuke dupe $FreeBSD$.

MFC after:	1 week
2013-12-29 22:56:05 +00:00
Marius Strobl
97db2528ed - Add support for using MSI instead of INTx, controllable via the tunable
hw.ral.msi_disable (defaulting to using MSI).
- Probe with BUS_PROBE_DEFAULT instead of 0.
- Nuke code setting PCI_POWERSTATE_D0; pci(4) already does that for type 0
  devices.
- Use PCIR_BAR instead of a homegrown macro.
- There's no need to keep track of resource IDs.
- Release resources again in case attaching fails.
- Quiesce the interrupt before detaching.
- Sprinkle const.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.
- Trim headers.
- Nuke dupe $FreeBSD$.

MFC after:	1 week
2013-12-29 22:43:14 +00:00
Marius Strobl
e6ebfc7ca9 - Remove a redundant variable in mpt_pci_attach().
- #if 0 the currently unused paired port linking and unlinking of dual
  adapters.
- Simplify MSI/MSI-X allocation and release. For a single one, we don't need
  to fiddle with the MSI/MSI-X count and pci_release_msi(9) is smart enough
  to just do nothing in case of INTx.
- Canonicalize actions taken on attach failure and detach.
- Remove the remainder of incomplete support for older FreeBSD versions.

MFC after:	1 week
2013-12-29 20:41:32 +00:00
Dimitry Andric
6ba26efcb5 In sys/dev/scc, remove unused static function scc_setmreg(). While
here, invoke scc_getmreg() in two more places where it can be used.

Reviewed by:	marcel
MFC after:	3 days
2013-12-29 20:23:08 +00:00
Dimitry Andric
d421cae017 In sys/dev/vxge/vxgehal/vxgehal-ring.c, #if 0 an unused static function.
MFC after:	3 days
2013-12-29 20:16:12 +00:00
Dimitry Andric
96106c9665 In sys/dev/usb/wlan/if_urtw.c, #if 0 a static const variable, which has
been unused since r198194.

MFC after:	3 days
2013-12-29 20:05:48 +00:00
Dimitry Andric
29deb2257c In sys/dev/tpm/tpm.c, #if 0 an unused static function.
MFC after:	3 days
2013-12-29 19:55:06 +00:00
Marius Strobl
7b23a8b2c0 - There's no need to keep track of resource IDs.
- Simplify MSI allocation and release. For a single one, we don't need to
  fiddle with the MSI count and pci_release_msi(9) is smart enough to just
  do nothing in case of INTx.
- Don't allocate MSI as RF_SHAREABLE.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.

MFC after:	1 week
2013-12-29 19:32:27 +00:00
Marius Strobl
f6030d6ac1 - Switch to using the common MII bitbang'ing code instead of duplicating it.
- Based on lessons learnt with dc(4) (see r185750), add bus space barriers to
  the MII bitbang read and write functions as well as to instances of page
  switching.
- Add missing locking to ed_ifmedia_{upd,sts}().
- Canonicalize some messages.
- Based on actual functionality, ED_TC5299J_MII_DIROUT should be rather named
  ED_TC5299J_MII_DIRIN.
- Remove unused headers.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.

MFC after:	1 week
2013-12-29 19:21:59 +00:00
Ed Maste
e279f478f2 Clean up license text
- Renumber Regents clauses
- Remove clause 3 and 4 from TNF license, following upstream change
2013-12-29 18:44:12 +00:00
Marius Strobl
ad4328bac8 - Simplify MSI allocation and release. For a single one, we don't need to
fiddle with the MSI count and pci_release_msi(9) is smart enough to just
  do nothing in case of INTx.
- Don't allocate MSI as RF_SHAREABLE.

MFC after:	1 week
2013-12-29 17:43:37 +00:00
Marius Strobl
bbc03f1bc5 Free the MSI again on detach if allocated. Arguably, this code would be
better off living in aac_pci.c, but it doesn't seem worth creating a
aac_pci_detach() and it's also not the first PCI-specific bit in aac.c

MFC after:	3 days
2013-12-29 17:37:32 +00:00
Dimitry Andric
3236d72b84 Remove superfluous old-style rcsid[] from if_my.c. There is already an
__FBSDID() at the top of the file.

MFC after:	3 days
2013-12-29 17:03:45 +00:00
Dimitry Andric
2f01b471a8 In sys/dev/mcd/mcd.c, mark the static const COPYRIGHT string as __used,
so it ends up in the object file, and no warnings are emitted about it
being actually unused.

MFC after:	3 days
2013-12-29 16:28:37 +00:00
Dimitry Andric
2c8ef6bc83 In sys/dev/en/midway.c, #if 0 an unused static function.
MFC after:	3 days
2013-12-29 14:19:15 +00:00
Dimitry Andric
5ddae1557d Remove superfluous old-style rcsid[] from if_sk.c. There is already an
__FBSDID() at the top of the file.

MFC after:	3 days
2013-12-28 21:04:17 +00:00
Adrian Chadd
13b535ff9c Fix the Intel 6150 support.
This chip doesn't require the temperature sensor offset, either v1 or
v2.  Doing so causes the initial calibration test to fail.

Tested:

* Intel Centrino 6150
2013-12-28 05:50:53 +00:00
Kevin Lo
959af34776 Add D-Link DWA-140 rev D1, another RT5372/run(4).
From Anton Mazunin.
2013-12-27 08:03:53 +00:00
Dimitry Andric
7d1af5ca62 In sys/dev/bxe/bxe.c, remove static function bxe_has_tx_work_unload(),
which has never been used.

Reviewed by:	edavis
MFC after:	3 days
2013-12-26 22:42:11 +00:00
Aleksandr Rybalko
19e314e7c3 Fix AltGr, we should not only skip RAlt key release if enable_altgr is set, but
also process RAlt key press same way.

Sponsored by:	The FreeBSD Foundation
2013-12-26 14:25:37 +00:00
Luigi Rizzo
7091cd69d0 use the correct netmap <-> nic slot mapping on the transmit ring for 'lem'.
This bug would manifest only in netmap mode and on packets transmitted after
a NIC reset while netmap mode is active.

MFC after:	3 days
2013-12-26 05:22:38 +00:00
Dimitry Andric
45ec8ddc5a In sys/dev/drm/mach64_dma.c, remove static function mach64_set_dma_eol(),
which has never been used, even by upstream, since its initial upstream
commit (see http://cgit.freedesktop.org/mesa/drm/commit/?id=873e1c4d )

MFC after:	3 days
2013-12-26 00:11:19 +00:00
Dimitry Andric
1e431cf636 In sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c, remove static functions
mk_cpl_barrier_ulp(), mk_get_tcb_ulp() and mk_set_tcb_field_ulp(), which
are all unused since r237263.

MFC after:	3 days
2013-12-25 22:49:54 +00:00
Dimitry Andric
24f55f3f5e In sys/dev/cxgb/common/cxgb_mc5.c, remove static function
dbgi_wr_addr3(), which is unused since r167514.

MFC after:	3 days
2013-12-25 22:45:33 +00:00
Bjoern A. Zeeb
06c1d08d55 Bite the bullet and start removing the first compile time warnings
by removing unsued file local functions and then unused callees.
A lot more warnings to resolve but someone had to break the ice.

MFC after:	10 days
X-Comment:	I am not the new maintainer; chime in, it's ours.
2013-12-25 20:15:48 +00:00
Aleksandr Rybalko
650c134f19 Use statndard (syscons) way to disable bell.
Testesd by:	markj

Sponsored by:	The FreeBSD Foundation
2013-12-25 19:07:14 +00:00
Dimitry Andric
ee87c85479 In sys/dev/sym/sym_hipd.c, remove static functions sym_que_first(),
sym_que_last() and sym_remque_tail(), which are all unused since r53790.

MFC after:	3 days
2013-12-25 17:28:18 +00:00
Dimitry Andric
d4bd7d166a In sys/dev/mwl/if_mwl.c, put the static RD4() function under #ifdef
MWL_DEBUG guards, since it only used in DPRINTF statements.

MFC after:	3 days
2013-12-25 14:48:27 +00:00
Matt Jacob
c3167cabe6 Harvest one no longer used constant string.
Remove another and place it into play in the
normally ifdef protected zone it would be used
int.

Noticed by:	dim
2013-12-25 04:51:56 +00:00
Marcel Moolenaar
b1a64a96d0 Add another HP iLO serial (console) port, found on Itanium servers.
Derived from information provided by: felip.nadal@hob.de
2013-12-24 19:58:27 +00:00
Dimitry Andric
35e1ba0a3b Remove another unused static const variable num_chip_names, from
aic7xxx.c this time.

Noticed by:	pluknet
MFC after:	3 days
2013-12-24 18:52:36 +00:00
Dimitry Andric
7d9393a28c Remove unused static const variable num_chip_names from aic79xx.c.
Reviewed by:	gibbs
MFC after:	3 days
2013-12-24 16:46:06 +00:00
Dimitry Andric
3c6aaa556d Remove unused static function adwccbstatus() from adw(4).
Reviewed by:	gibbs
MFC after:	3 days
2013-12-24 15:56:16 +00:00
Kevin Lo
7dc4b90e74 Some devices have a dual mode such as Tenda W326U and ZyXEL NWD2705,
add the product id and use a standard scsi eject.

Tested on the ZyXEL NWD2705 wlan dongle.
2013-12-24 07:02:05 +00:00
Aleksandr Rybalko
7a1a32c4ef o Add virtual terminal mmap request handler.
o Forward termianl framebuffer ioctl to fbd.
o Forward terminal mmap request to fbd.
o Move inclusion of sys/conf.h to vt.h.

Sponsored by:	The FreeBSD Foundation
2013-12-23 18:09:10 +00:00
Ed Maste
ddc31191a4 Update whitespace to match mkkfont output
Sponsored by:	The FreeBSD Foundation
2013-12-23 17:49:12 +00:00
Aleksandr Rybalko
a01571e0a7 Update names from newcons to vt(9).
Sponsored by:	The FreeBSD Foundation
2013-12-22 15:33:15 +00:00
Jean-Sébastien Pédron
ca91bb30f4 drm: Lower priority of "EDID checksum is invalid" message
The priority goes from "error" to "debug".

Connectors are polled every 10 seconds. Reading EDID is part of this
polling. However, when an invalid EDID is returned, this error message
is logged. When using Newcons for instance, having a kernel message
every 10 seconds is getting annoying.

Now that it's a debug message, it'll be logged only if hw.dri.debug is
enabled. This fix console spamming for some users.

Tested by:	Larry Rosenman <ler@lerctr.org>
2013-12-22 11:11:23 +00:00
Warner Losh
f83ed22cb6 Plumb the cn_grab and cn_ungrab routines down into the uart
clients. Mask RX interrupts while grabbed on the atmel serial
driver. This UART interrupts every character. When interrupts are
enabled at the mountroot> prompt, this means the ISR eats the
characters. Rather than try to create a cooperative buffering system
for the low level kernel console, instead just mask out the ISR. For
NS8250 and decsendents this isn't needed, since interrupts only happen
after 14 or more characters (depending on the fifo settings). Plumb
such that these are optional so there's no change in behavior for all
the other UART clients. ddb worked on this platform because all
interrupts were disabled while it was running, so this problem wasn't
noticed. The mountroot> issue has been around for a very very long
time.

MFC after:	3 days
2013-12-21 16:23:31 +00:00
Jean-Sébastien Pédron
a883f5eadb drm/ttm, drm/radeon: Replace EINTR/ERESTART by ERESTARTSYS...
... for msleep/cv_*wait() return values, where wait_event*() is used
on Linux. ERESTARTSYS is the return code expected by callers when the
operation was interrupted.

For instance, this is the case of radeon_cs_ioctl() (radeon_cs.c): if
an error occurs, and the code isn't ERESTARTSYS (eg. EINTR), it logs an
error.

Note that ERESTARTSYS is defined as ERESTART, but this keeps callers'
code close to Linux.

Submitted by:	avg@ (previous version)
2013-12-21 15:40:36 +00:00
Ed Maste
41fb066511 Support double-width characters in vt(9)
Normal and bold fonts each have a glyph map for single or left half-
glyphs, and right half glyphs.  The flag TF_CJK_RIGHT in term_char_t
requests the right half-glyph.

Reviewed by:	ed@
Sponsored by:	The FreeBSD Foundation
2013-12-21 13:58:55 +00:00
Jean-Sébastien Pédron
2b22d5cc07 vga_pci: Improve boot display detection
The previous code was checking the "VGA Enable" bit on the video card's
parent PCI-to-PCI bridge only. This didn't work for the case where the
video card is attached to the root PCI bus (ie. the card has no parent
PCI-to-PCI bridge).

Now, the new code:
    1. checks the "VGA Enable" bit on the parent bridge only if it's a
       PCI-to-PCI bridge;
    2. always checks the "I/O" and "Memory address space decoding" bits
       on the video card itself.

However, vendor-specific bits are not used.

This fixes the use of many integrated Radeon cards: without this patch,
we fail to detect them as the boot display and, when radeonkms looks for
the Video BIOS, it skips the shadow copy made by the System BIOS. It
then fails to fully initialize the card, because the shadow copy is the
only way to read the Video BIOS in these situations. A workaround was to
force the boot display selection using the "hw.pci.default_vgapci_unit"
tunable.

A previous version of this patch added a new function doing the checks.
Now, the vga_pci_is_boot_display() function is used to perform the
checks (only until the boot display is found) and return if the given
device is the boot display or not.

Furthermore, vga_pci_attach() logs "Boot video device" if the card being
attached it the Chosen One:
    vgapci0: <VGA-compatible display> [...]
    vgapci0: Boot video device

Reviewed by:	kib@, jhb@ (both a previous version)
Tested by:	lunatic_ (#freebsd-xorg, integrated Radeon card,
		xmj (#freebsd-xorg, i915+NVIDIA cards)
2013-12-21 12:55:42 +00:00
Don Lewis
ccdfa3b5f1 Add quirks to make my old SanDisk Cruzer Mini 128MB happy.
MFC after:	1 week
2013-12-21 03:05:13 +00:00
Ed Schouten
a6c26592f1 Extend libteken to support CJK fullwidth characters.
Introduce a new formatting bit (TF_CJK_RIGHT) that is set when putting a
cell that is the right part of a CJK fullwidth character. This will
allow drivers like vt(9) to support fullwidth characters properly.

emaste@ has a patch to extend vt(9)'s font handling to increase the
number of Unicode -> glyph maps from 2 ({normal,bold)} to 4
({normal,bold} x {left,right}). This will need to use this formatting
bit to determine whether to draw the left or right glyph.

Reviewed by:	emaste
2013-12-20 21:31:50 +00:00
George V. Neville-Neil
ac4030b7e1 Add another Haswell model (0x45) to the set of supported chips.
Model 0x45 appears, for example, in late 2013 Mac Book Pro models
and is properly emulated by VMware.
2013-12-20 20:22:10 +00:00
Aleksandr Rybalko
008f5a254f Enable AltGr key by default.
Asked by:	many
Sponsored by:	The FreeBSD Foundation
2013-12-20 15:45:22 +00:00
Aleksandr Rybalko
d454a052df Set mouse level per window, instead of global.
Sponsored by:	The FreeBSD Foundation
2013-12-20 15:37:57 +00:00
Attilio Rao
026346c8f1 o Remove assertions on ipa_version as sometimes the version detection
using cpuid can be quirky (this is the case of VMWare without the
  vPMC support) but fail to probe hwpmc.
o Apply the fix for XEON family of processors as established by
  315338-020 document (bug AJ85).

Sponsored by:	EMC / Isilon storage division
Reviewed by:	fabient
2013-12-20 14:03:56 +00:00
Gleb Smirnoff
f56831a217 Fix build broken in r259644.
Submitted by:	tuexen
Pointy hat to:	glebius
2013-12-20 13:18:50 +00:00
Gleb Smirnoff
46bf53de69 ixgbe(4) takes packet counters from hardware in ixgbe_update_stats_counters(),
so we don't need to do a per packet increment, which trashes cache line.

Submitted by:	oleg
2013-12-20 10:57:47 +00:00
Aleksandr Rybalko
0a036e525d Enable mouse support for terminal clients (like dialog(1)).
Sponsored by:	The FreeBSD Foundation
2013-12-19 15:31:20 +00:00
Andriy Gapon
ea2705e8bf ttm_bo_vm_lookup_rb: actually make use of the red-black tree
Previously the code would just iterate over the whole tree as if it were
just a list.

Without this change I would observe X server becoming more and more
jerky over time.

MFC after:	5 days
2013-12-19 12:00:48 +00:00
Xin LI
47e52731cc Commit 2/2: vendor whitespace changes to the driver.
Many thanks to Areca for continuing to support FreeBSD.

Submitted by:	黃清隆 <ching2048 areca com tw>
2013-12-18 19:25:40 +00:00
Xin LI
224a78aeed Commit 1/2: update arcmsr(4) to 1.20.00.29 in order to add
support of ARC-1883 SAS 12Gb/s RAID controllers.

Many thanks to Areca for continuing to support FreeBSD.

Submitted by:	黃清隆 <ching2048 areca com tw>
2013-12-18 19:23:05 +00:00
Gleb Smirnoff
a95ecdf0cf Make nmdm(4) destroy devices when both sides of a pair are disconnected.
This makes it possible to kldunload nmdm.ko when there are no users of it.

Reviewed by:	kib
Sponsored by:	Nginx, Inc.
2013-12-18 12:53:48 +00:00
Kevin Lo
9df3ee0758 Use 'val' instead of 'val & 0xff' since the last argument of run_bbp_write()
is uint8_t.

Spotted by:	yongari
2013-12-18 08:53:40 +00:00
Kevin Lo
fd8fcee579 Fix style: add tab after #define. 2013-12-18 08:39:12 +00:00
Kevin Lo
c48c6bf8fc Fix typo in comment. 2013-12-18 07:47:50 +00:00
Kevin Lo
010b13fa94 Add support to IQ calibration. 2013-12-18 07:34:57 +00:00
Pyun YongHyeon
2e6383a8e8 Failed m_devget(9) indicates lack of free mbuf cluster. Update
if_iqdrops counter for that case since the received frame is ok.
While here, simplify updating counter logic.
2013-12-18 07:23:42 +00:00
Gleb Smirnoff
256d9417f8 Fix build. 2013-12-18 04:36:35 +00:00
Aleksandr Rybalko
fdc3c84b5b Skip processing of R.Alt as a second Alt key, if sysctl kern.vt.enable_altgr is
not zero.

Submitted by:	andreast
Sponsored by:	The FreeBSD Foundation
2013-12-18 00:14:58 +00:00
Navdeep Parhar
88bb82e511 Do not create a hardware IPv6 server if the listen address is not
in6addr_any and is not in the CLIP table either.  This fixes a reported
TOE+IPv6 NULL-dereference panic in do_pass_open_rpl().

While here, stop creating hardware servers for any loopback address.
It's just a waste of server tids.

MFC after:	1 week
2013-12-17 21:41:23 +00:00
Nathan Whitehorn
95e3bfe889 Simplify the ofw_bus_lookup_imap() API slightly: make it allocate maskbuf
internally instead of requiring the caller to allocate it.
2013-12-17 15:11:24 +00:00
Nathan Whitehorn
fc54707f7d Remove dead code. Most of this was in an #if 0 block; the rest is not
used and duplicates functionality in dev/ofw.
2013-12-17 14:51:47 +00:00
Nathan Whitehorn
cb6d9d6cb1 Configure interrupt sense based on device tree information. This extends
the OF interrupt map API to return sense information to the caller and
the PowerPC Open Firmware PCI base driver to use it to program the PIC.
2013-12-17 14:50:35 +00:00
Luigi Rizzo
2e159ef0b5 fix the build using __builtin_prefetch() instead of redefining prefetch() 2013-12-16 23:57:43 +00:00
Hans Petter Selasky
6f0468df7a Fix regression issue after r259248:
Some Intel XHCI controlles timeout processing so-called "TRBs" when
the final LINK TRB of a so-called "TD" has the CHAIN-BIT set.

MFC after:	1 week
Tested by:	glebius @
2013-12-16 10:50:13 +00:00
Luigi Rizzo
f9790aeb88 split netmap code according to functions:
- netmap.c		base code
- netmap_freebsd.c	FreeBSD-specific code
- netmap_generic.c	emulate netmap over standard drivers
- netmap_mbq.c		simple mbuf tailq
- netmap_mem2.c		memory management
- netmap_vale.c		VALE switch

simplify devce-specific code
2013-12-15 08:37:24 +00:00
Nathan Whitehorn
e14376e4dd Avoid warning about insecure format with clang. 2013-12-14 22:28:32 +00:00
Justin Hibbits
0587a07215 Add userland PMC backtracing, and use the PMC trapframe macros for kernel
backtraces.

MFC after:	1 week
2013-12-14 20:12:28 +00:00
Gavin Atkinson
4c631db3cc Fix several panics when initialization of an ISA or PC-CARD device fails:
o  Assign sc->an_dev in an_probe() (which isn't really a probe function in
   the standard newbus sense) as we may need it for printing errors.
o  Use device_printf() rather than if_printf() in an_reset() - this is
   called from an_probe() long before the ifp structure is initialised
   in an_attach().
o  Initialize the ifp structure early in an_attach() as we use if_printf()
   in cases where allocation of descriptors etc fails.

MFC after:	3 days
2013-12-14 18:49:59 +00:00
Navdeep Parhar
93e9cae3fa Read card capabilities after firmware initialization, instead of setting
them up as part of firmware initialization (which the driver gets to do
only if it's the master driver).

Read the range of tids available for the ETHOFLD functionality if it's
enabled.

New is_ftid() and is_etid() functions to test whether a tid falls within
the range of filter tids or ETHOFLD tids respectively.

MFC after:	2 weeks
2013-12-14 03:08:03 +00:00
Aleksandr Rybalko
c3ebd5edbc Do not try to probe/attach if attempt to add fbd child are failed.
Sponsored by:	The FreeBSD Foundation
2013-12-12 14:49:26 +00:00
Hans Petter Selasky
27ce2fd67c Set chain bit correctly. This will fix some problems sending and
receiving Zero Length Packets, ZLPs. See comment in code for more
information.

MFC after:	1 week
Reported by:	Kohji Okuno <okuno.kohji@jp.panasonic.com>
2013-12-12 08:34:51 +00:00
Alexander Motin
8adff99c8d Destroy mtx lock when failed to allocate memory during attach.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	2 weeks
2013-12-11 17:40:35 +00:00
George V. Neville-Neil
8528c7c86e Fix a panic when booting with kernels that have FREEBBSD_COMPAT
4, 5, 6 or 43 by only thunking the data parameter for old ioctls
compatability ioctls instead of doing it for all of them.

Submitted by:	jhb@
2013-12-11 17:18:10 +00:00
Hans Petter Selasky
e892b3fe36 USB method structures for USB controllers and USB pipes should be
constant and does not need to be modified. This also saves a small
amount of RAM.
2013-12-11 13:20:32 +00:00
Konstantin Belousov
68a9d67c29 The opt_*.h headers must be included before any system header, except
sys/cdefs.h.  In particular, in case of COMPAT_43, param.h includes
sys/types.h, which includes sys/select.h, which includes
sys/_sigset.h.  The _sigset.h customizes the provided definions based
on COMPAT_43, eliminating osigset_t if symbol is not defined.  The
sys/proc.h is included after opt_compat.h and needs osigset_t.

Move opt_compat.h inclusion into the right place.

Sponsored by:	The FreeBSD Foundation
2013-12-10 22:33:02 +00:00
Nathan Whitehorn
641ed4622f Return the correct IEEE 1275 code for "nextprop". 2013-12-10 21:01:28 +00:00
Konstantin Belousov
60b6e19785 Only assert the length of the passed bio in the mdstart_vnode() when
the bio is unmapped, so we must map the bio pages into pbuf.  This
works around the geom classes which do not follow the MAXPHYS limit on
the i/o size, since such classes do not know about unmapped bios
either.

Reported by:	Paolo Pinto <paolo.pinto@netasq.com>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-12-10 20:52:31 +00:00
Edward Tomasz Napierala
0260023fbb Properly refuse handoff requests on already connected sessions. Previously
this would result in dropping the session.

MFC after:	2 days
Sponsored by:	The FreeBSD Foundation
2013-12-10 18:18:39 +00:00
Pawel Jakub Dawidek
ca5b58f5b1 Fix missing new line after:
Netvsc initializing...

during boot.
2013-12-10 17:16:13 +00:00
Aleksandr Rybalko
8c68d7b224 Disable error message about failed attempt to attach fbd when drm2 built with
syscons.

Sponsored by:	The FreeBSD Foundation
2013-12-10 15:53:00 +00:00
Aleksandr Rybalko
00f4f023f1 Break build with error in case when both syscons and newcons are enabled.
Sponsored by:	The FreeBSD Foundation
2013-12-10 15:36:29 +00:00
Adrian Chadd
ac68deae6d Print out the full PCIe link negotiation during dmesg.
I found this useful when checking whether a NIC is in a PCIE 3.0 8x slot
or not.

Reviewed by:	np
Sponsored by:	Netflix, inc.
2013-12-10 00:07:04 +00:00
Navdeep Parhar
d419aaa126 Unstaticize t4_list and t4_uld_list. This works around a clang
annoyance[1] and allows kgdb to find these symbols.

[1] http://lists.freebsd.org/pipermail/freebsd-hackers/2012-November/041166.html

MFC after:	3 days
2013-12-09 23:33:57 +00:00
Aleksandr Rybalko
c323f8035b o Compat options have to be defined before sys/ioccom.h included, so move
inclusion of right after sys/param.h.
o Only vt_core module use compat options, move it from common header to module.

Reported by:	Larry Rosenman ler at lerctr dot org

Sponsored by:	The FreeBSD Foundation
2013-12-09 15:28:34 +00:00
Aleksandr Rybalko
0f49db6e47 Respect SC_NO_CUTPASTE option. It disable mouse cursor and cut/paste support
for vt(9). Note: /dev/sysmouse not affected.

Sponsored by:	The FreeBSD Foundation
2013-12-09 15:01:34 +00:00
Adrian Chadd
929f6e3c8b Add some initial support for the Intel 6235.
Tested:

* Intel 5100
* Intel 6235

Obtained from:	mav, others
2013-12-09 03:40:02 +00:00
Aleksandr Rybalko
37fd54ff81 o Build syscons(9)'s splash support if both sc and splash are enabled.
o Include opt_splash.h for vt(9) to know when splash device is enabled.
o Build logo_freebsd.c only if splash and vt are enabled.
o Include opt_compat.h to know when we have to respect compatibility.

Sponsored by:	The FreeBSD Foundation
2013-12-08 22:49:12 +00:00
Jean-Sébastien Pédron
01a31db4d1 drm/radeon: radeon_dp_i2c_aux_ch() must return 0 on FreeBSD
The code was unmodified compared to Linux and returned the amount of
received bytes from the i2c bus. This led to non-working i2c bus and
failure to eg. read monitor's EDID, if connected to DisplayPort.

MFC after:	3 days
Tested by:	Mikaël Urankar <mikael.urankar@gmail.com>
2013-12-08 18:48:07 +00:00
Navdeep Parhar
273ef9912d cxgbe(4): save a copy of the RSS map for each port for the driver's use. 2013-12-08 17:47:37 +00:00
Jean-Sébastien Pédron
a7c17730f4 drm/radeon: agp_info->ai_aperture_size is in bytes, not Mbytes
This fixes radeon_agp_init() and gtt_size is now correct. However, this
is not enough to make Radeon AGP cards work: ttm_agp_backend.c isn't
implemented yet.

Submitted by:	tijl@
2013-12-08 14:21:54 +00:00
Hans Petter Selasky
468f354b0e Fix typos.
Found by:	remko
2013-12-08 06:52:22 +00:00
Justin Hibbits
e17bec9172 Make more unsigned ints signed.
Found by:	clang (powerpc64)
MFC after:	1 week
2013-12-07 22:25:07 +00:00
Justin Hibbits
8991c54091 Fix some integer signs. These unsigned integers should all be signed.
Found by:	clang (powerpc64)
2013-12-07 19:55:34 +00:00
Adrian Chadd
a22cfd04e7 Refactor out the scan id and scan vap as part of the scan work.
Make the scan state optional - we'll obviously need a vap, but we now
won't require the scan state.  the only thing the scan state is needed
for is to check for the list of SSIDs to scan - which we can now
just plain ignore by passing in NULL as the scan state pointer.

Tested:

* Intel 5100 (STA)
2013-12-07 08:32:15 +00:00
Adrian Chadd
6c214017d0 Add a channel parameter to iwn_scan().
This is in preparation for being able to use iwn_scan() to do an off
channel scan to reset the RF tuning.

It should be a no-op.

Tested:

* Intel 5100 (STA)
2013-12-07 08:25:24 +00:00
Adrian Chadd
b860b2a9aa Refactor out the scan channel to be assigned early on in iwn_scan()
rather than it all being a mess of 'c' and 'ic->ic_curchan'.

Tested:

* Intel 5100 (STA)
2013-12-07 08:20:24 +00:00
Adrian Chadd
92d7ab9562 Begin fleshing out some code to handle tracking PLCP error rates
in preparation for the scan based retune logic.

The linux iwlwifi driver does a rescan (onto a non-active channel)
to force an RF retune when the PLCP error rates exceed a certain threshold.

* Add code to track HT PLCP rate errors;
* Separate out the PLCP error count fetch and update so the delta
  can be used when checking for PLCP error rates;
* Implement the PLCP error logic from iwlwifi;
* For now, just print out whenever the error rate exceeds the
  threshold.

The actual scan based retune will take a bit more effort; the scan
command code right now assumes that a scan state is passed in.
This does need to change to be more flexible (both for this and
in preparation for scanning multiple channels at once.)

Tested:

* 5100 (STA mode)
* 2200 (STA mode)
* 2230 (STA mode)
2013-12-07 08:03:10 +00:00
Adrian Chadd
90a4274834 Add some PLCP thresholds from Linux iwlwifi driver in preparation for
working on some RF tuning issues.

The linux iwlwifi driver has these thresholds which they use to see
if there are PLCP errors over a certain interval.  If they hit this,
they trigger a single-channel (different from active channels!)
scan to retune the RF front-end.
2013-12-07 06:45:09 +00:00
Aleksandr Rybalko
5ffea144c7 Fix td_frame flags for i386.
Submitted by:	jilles

Sponsored by:	The FreeBSD Foundation
2013-12-06 23:12:21 +00:00
Hans Petter Selasky
daab849b2c Fix compilation when the "USB_DEBUG" option is set. 2013-12-06 22:13:51 +00:00
Luiz Otavio O Souza
d442709662 Move the GPIOBUS_SET_PINFLAGS(..., ..., pin, GPIO_PIN_OUTPUT) to led(4)
control callback function.  This makes gpioled(4) works even if the pin
is accidentally set to an input.

Approved by:	adrian (mentor)
2013-12-06 17:56:20 +00:00
Luiz Otavio O Souza
41ec463c1e Remove unnecessary includes and an unused softc variable. While here apply
two minor style(9) fixes.

Approved by:	adrian (mentor)
2013-12-06 17:49:34 +00:00
Kevin Lo
242dbae34c Add support for the MediaTek/Ralink RT5572 chipset.
Committed over the TP-LINK TL-WDN3200 (RT5572) on amd64 with WPA.

While here, add my copyright.
2013-12-06 15:26:39 +00:00
Kevin Lo
e0790ad8eb Replace the magic numbers with something more readable. 2013-12-06 15:17:28 +00:00
Kevin Lo
b8161ff3c1 Cosmetic changes. 2013-12-06 15:15:58 +00:00
Kevin Lo
1d66c7a9cf Remove daft KASSERT. 2013-12-06 15:14:18 +00:00
Hans Petter Selasky
563ab08139 Improve the XHCI command timeout recovery handling code.
MFC after:	1 week
2013-12-06 08:42:41 +00:00
Aleksandr Rybalko
27cf7d04ef Merge VT(9) project (a.k.a. newcons).
Reviewed by:	nwhitehorn
MFC_to_10_after:	re approval

Sponsored by:	The FreeBSD Foundation
2013-12-05 22:38:53 +00:00
Robert Millan
7514065056 Initialize modesetting sysctls in radeonkms.
This is intended for MFC if re@ permits.

Reviewed by:	kib, dumbbell
Tested by:	Steven Chamberlain <steven@pyro.eu.org>
MFC after:	3 days
2013-12-05 20:23:32 +00:00
Hans Petter Selasky
bce421e9f7 Fix external compiler warning about write-only assigned variable. 2013-12-05 07:18:06 +00:00
Xin LI
b41206d84a Apply vendor improvements to oce(4) driver:
- Add support to 40Gbps devices;
 - Add support to control adaptive interrupt coalescing (AIC)
   via sysctl;
 - Improve support of BE3 devices;

Many thanks to Emulex for their continued support of FreeBSD.

Submitted by:	Venkata Duvvuru <VenkatKumar.Duvvuru Emulex Com>
MFC after:	3 days
2013-12-04 20:24:18 +00:00
Jean-Sébastien Pédron
20fa47be09 drm: Read PCIER_LINK_CAP/PCIER_LINK_CAP2 from the PCI bridge
Before this fix, capabilities were read from vgapci and were incorrect.
2013-12-04 19:04:56 +00:00
Hans Petter Selasky
0aff597a1f Fix what looks like a typo after r258732. 2013-12-04 12:30:51 +00:00
Hans Petter Selasky
8cfe54400e Fix external compiler warning(s). Avoid pointer dereferencing. 2013-12-04 12:07:46 +00:00
Edward Tomasz Napierala
bc2308d49e Change comment to match code.
Discussed with:	thompsa
Sponsored by:	The FreeBSD Foundation
2013-12-04 09:48:52 +00:00
Edward Tomasz Napierala
0efd9bfd47 Add "null" backend to mdconfig(8). This does exactly what the name
suggests, and is somewhat useful for benchmarking.

MFC after:	1 month
No objections from:	kib
Sponsored by:	The FreeBSD Foundation
2013-12-04 07:38:23 +00:00
Navdeep Parhar
05337b80ee cxgbe(4): T4_SET_SCHED_CLASS and T4_SET_SCHED_QUEUE ioctls to program
scheduling classes in the chip and to bind tx queue(s) to a scheduling
class respectively.  These can be used for various kinds of tx traffic
throttling (to force selected tx queues to drain at a fixed Kbps rate,
or a % of the port's total bandwidth, or at a fixed pps rate, etc.).

Obtained from:	Chelsio
2013-12-03 18:34:52 +00:00
Kevin Lo
405886883d The RUN_MAX_TXSZ constat is defined as Tx desc + Tx wireless info + MCLBYTES +
max padding.  We were lucky in that run(4) working fine since both
rt2860_rxwi and rt2860_txwi structure sizes are the same.
2013-12-02 09:07:43 +00:00
Adrian Chadd
352c016bc1 * Sort the copyright lines by date
* Ok ok, I've touched this enough to claim part of it.
2013-12-02 05:45:11 +00:00
Pyun YongHyeon
67129934a9 Add support for BCM57764, BCM57767, BCM57782, BCM57786 and BCM57787.
Submitted by:	jhb
PR:	184304
2013-12-02 05:21:54 +00:00
Adrian Chadd
fee842aa2a Overhaul the iwn(4) scan infrastructure to be slightly more "correct"
for these chipsets.

* Correctly set the active/passive flag in the scan request - this is
  NOT a "is the channel active|passive"; it's to do with whether we
  have an SSID to actively scan for or not.  The firmware takes care
  of the active/passive setup of the channel.

* Calculate the active/passive dwell time based on the beacon interval
  and the channel mode, rather than using a hard coded value.

* For now, hardcode the scan service_time.  It's defined as:

  31:22 - number of beacon intervals to come back onto the home channel
          for;
  0:21  - time (microseconds) to come back onto the home channel for.

  When doing an active scan when the NIC is active (whether we're associated
  or not - it only matters if we've setup the NIC to a destination or not)
  this determines how much time to stay on the home channel for when
  scanning.  We can tune this based on the amount of active traffic.

  For now it's 4 beacon intervals and 100 microseconds.

* Fix the "good crc threshold" setting.  It differs based on the NIC
  firmware.  Some older firmware required a workaround; the later
  firmware instead treats the field as a flag.

* Enforce that we are not sending a scan command if one is already
  pending.  Any time this is done is a bug and it absolutely needs
  to be fixed - so be very loud.

* Add the SCAN flag to a few debug messages that are scan related but
  only occuring under STATE.

Now, this does get noisy when you're scanning in an actively busy 2GHz
network as the firmware (for reason I don't quite yet understand) seems
hell bent on staying on some passive channels longer than it should.
However, it should eventually recover and complete the scan.

This is a work in progress; please let me know if things get stuck or
if things improve!

Tested:

* intel centrino 2200
* intel centrino 2230
* intel 6200
* intel 5100
* intel 4965 (gets upset, but that's a known issue)

Obtained from:	linux iwlwifi
2013-12-02 03:59:45 +00:00
Ian Lepore
f32d80bf1f Add a nand flash controller driver for Atmel at91 family. Tested only
on at91rm9200 so far.

The files.at91 has listed a nand driver for ages, but it never existed.
2013-12-02 03:52:40 +00:00
Adrian Chadd
d27bb17b9c Log the rx ring offset as part of the debug message. 2013-12-02 03:49:33 +00:00
Adrian Chadd
30ca148cf7 Oops - fix bad indent. Sorry! 2013-12-02 03:43:37 +00:00
Adrian Chadd
9d8e8cd665 Add some sanity checks to the TLV fetch.
Obtained from:	Linux iwlwifi
2013-12-02 03:42:39 +00:00
Adrian Chadd
c6f810c6a4 Add some code to double-check whether we're correctly populating the
TX ring according to what the firmware requires.

The firmware requires A-MPDU sub-frames to be at a very specific ring
offset - that is, the ring slot offset should be (seqno % 256.)

This holds for every NIC I've tested thus far except the 4965,
which starts erroring out here shortly before the firmware panics.
Which is good, it's doing what it's supposed to (read: capture that
we've screwed up somewhere.)

The specifics about getting this stuff right:

* the initial seqno allocation should match up with the ringid.
* .. yes, this means we can start at a ring offset that isn't zero.
* .. because we program the start seqno in the firmware message
  to setup the AC.
* The initial seqno allocation may be non-zero _and_ frames may be
  being transmitted during a-mpdu negotiation.  I faced similar
  issues on ath(4) and had to software queue frames to that node+TID
  during A-MPDU negotiation.
* seqno allocation should be in lockstep with ring increments.
* If we fail to transmit some segment, no, we shouldn't reuse that
  ring slot.  We should just transmit a BAR (which we aren't yet
  doing, sigh) and move onto the next seqno.
* In theory there shouldn't be any holes in the seqno space when
  we are transmitting frames.

Tested:

* 4965 (throws problems, so yes we have to fix this);
* 5100 (seems ok);
* 6200 (seems ok);
* 2200 (seems ok);
* 2230 (seems ok).
2013-12-02 03:40:51 +00:00
Eitan Adler
2526f9d725 Partial revert of r258779 and r258780:
The directory sys/dev/drm2/i915 is apperently contributed code.
	Revert to the broken version of this file to make future imports easier.

Requested by:	kib
2013-12-02 03:36:44 +00:00
Nathan Whitehorn
02ef3f33de Real OF systems have an ihandle under /chosen/stdout, not a phandle. Use
the right type.
2013-12-01 19:05:32 +00:00
Nathan Whitehorn
fb5b9994b3 Open Firmware mandates that certain cross-references, in particular those
in /chosen, be ihandles. The ePAPR spec makes those cross-reference phandles,
since FDT has no concept of ihandles. Have the OF FDT CI module interpret
queries about ihandles as cross-reference phandles.
2013-12-01 19:03:20 +00:00
Nathan Whitehorn
49aba28afe Make uart_cpu_powerpc work on both FDT and OFW systems. This is the last
remaining modification required to build kernels that work with both on
PowerPC.
2013-12-01 16:02:22 +00:00
Edward Tomasz Napierala
c4dfe4abe2 Fix hang on reboot with active iSCSI connections.
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2013-12-01 08:13:10 +00:00
Eitan Adler
7a22215c53 Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this
shifts into the sign bit.  Instead use (1U << 31) which gets the
expected result.

This fix is not ideal as it assumes a 32 bit int, but does fix the issue
for most cases.

A similar change was made in OpenBSD.

Discussed with:	-arch, rdivacky
Reviewed by:	cperciva
2013-11-30 22:17:27 +00:00
Eitan Adler
c8aef31d30 Similar to the (1 << 31) case it is not defined to do (2 << 30). 2013-11-30 22:16:37 +00:00
Adrian Chadd
011a151b50 Disable this debugging - it's far too verbose when doing TX rate debugging. 2013-11-29 22:36:00 +00:00
Adrian Chadd
2f1b79906d Use the correct endian-ness accessor for this TLV field.
(It's coming from firmware and thus it's defined as little-endian.)
2013-11-29 22:35:24 +00:00
Ian Lepore
ff00fd81aa Look up a nand chip by id in the static table before trying to obtain
ONFI parameters.  This allows a static table entry to provide valid data
for chips known to provide invalid ONFI data.
2013-11-29 14:23:22 +00:00
Kevin Lo
5b7514646c Change run_rt2870_rf_write() prototype (no functional change) 2013-11-29 07:08:17 +00:00
Kevin Lo
5f7e329cec On the RT2870, rf registers are now 64-bit, not 32-bit after r257955.
Committed over a Buffalo WLI-UC-AG300N (RT2870).
2013-11-29 06:10:44 +00:00
Navdeep Parhar
2471928bf8 Disable an assertion that relies on some code[1] that isn't in HEAD yet.
[1] http://lists.freebsd.org/pipermail/freebsd-net/2013-August/036573.html
2013-11-27 19:54:19 +00:00
Sergey Kandaurov
d9140d3691 Bandaid for compiling with gcc. 2013-11-27 08:39:48 +00:00
Hans Petter Selasky
361f264ba0 Style changes. 2013-11-26 11:11:24 +00:00
Hans Petter Selasky
beb13f0407 Add missing static keyword.
MFC after:	2 weeks
2013-11-26 10:53:12 +00:00
Adrian Chadd
3b64bbd285 Add definitions for the microcode TLV flags entry (type 18.)
This isn't used anywhere just yet!

Obtained from:	Linux iwlwifi
2013-11-26 08:58:08 +00:00
Adrian Chadd
b9066e384d Add a new debug section. 2013-11-26 08:57:25 +00:00
Andriy Gapon
d9fae5ab88 dtrace sdt: remove the ugly sname parameter of SDT_PROBE_DEFINE
In its stead use the Solaris / illumos approach of emulating '-' (dash)
in probe names with '__' (two consecutive underscores).

Reviewed by:	markj
MFC after:	3 weeks
2013-11-26 08:46:27 +00:00
Adrian Chadd
39bb444c76 The bssid can change from underneath us, so take a reference before
we fiddle with it.
2013-11-26 01:30:10 +00:00
Jean-Sébastien Pédron
d52ba34e7b drm: Fix build with gcc, broken with r258549
The code was easier to read without __DECONST and clang didn't report
any error. I thought the cast was enough...

MFC after:	3 days
X-MFC-With:	r258549
2013-11-25 15:01:59 +00:00
Jean-Sébastien Pédron
1eafa5d8b0 drm: Dereference pointers given to qsort_r()'s cmp callback
drm_le_cmp() (qsort_r()'s callback) receives pointers to elements in the
array passed to qsort_r(), not the elements themselves.

Before this fix, the use of qsort_r() shuffled the array, not sorted it,
because the compare callback accessed random memory locations, not the
expected elements.

This bug triggered an infinite loop in KDE/xserver:

    1. KDE has a kded module called "randrmonitor" which queries xserver
       for current monitors at startup and then listens to RandR
       notifications from xserver.

    2. xserver handles the query from "randrmonitor" by polling the
       video device using the "drm_mode_getconnector()" ioctl. This
       ioctl returns a list of connectors and, for those with a
       connected monitor, the available modes. Each modes list is sorted
       by the kernel before returning. When xserver gets the connectors
       list, it sorts the modes lists again.

       In the case of this bug, when two modes are equal (in xserver's
       compare function PoV), their order is kept stable (ie. the
       kernel order is kept for those two modes). And because the list
       was shuffled by the kernel, the order of two equal modes was
       frequently changed in the final modes list in xserver.

    3. xserver compares the returned connectors list with the list
       obtained earlier. In particular, it compares the sorted
       modes lists for each connector. If a property of a connector
       changes (eg. modes), xserver sends a "RRNotify_OutputChange"
       notification.

       Because of the change of order between equal modes, xserver sent
       a notification after each polling of the connectors.

    4. "randrmonitor" receives a notification, triggered by its query. The
       notification doesn't contain the new connectors list, therefore, it
       asks for the new list using the same function: go back to step #2.

MFC after:	3 days
2013-11-25 11:15:51 +00:00
Hans Petter Selasky
5c0f828a07 Comply to the XHCI specification. Certain input context fields should
always be zero.

MFC after:	1 week
2013-11-25 10:58:02 +00:00
Attilio Rao
54366c0bd7 - For kernel compiled only with KDTRACE_HOOKS and not any lock debugging
option, unbreak the lock tracing release semantic by embedding
  calls to LOCKSTAT_PROFILE_RELEASE_LOCK() direclty in the inlined
  version of the releasing functions for mutex, rwlock and sxlock.
  Failing to do so skips the lockstat_probe_func invokation for
  unlocking.
- As part of the LOCKSTAT support is inlined in mutex operation, for
  kernel compiled without lock debugging options, potentially every
  consumer must be compiled including opt_kdtrace.h.
  Fix this by moving KDTRACE_HOOKS into opt_global.h and remove the
  dependency by opt_kdtrace.h for all files, as now only KDTRACE_FRAMES
  is linked there and it is only used as a compile-time stub [0].

[0] immediately shows some new bug as DTRACE-derived support for debug
in sfxge is broken and it was never really tested.  As it was not
including correctly opt_kdtrace.h before it was never enabled so it
was kept broken for a while.  Fix this by using a protection stub,
leaving sfxge driver authors the responsibility for fixing it
appropriately [1].

Sponsored by:	EMC / Isilon storage division
Discussed with:	rstone
[0] Reported by:	rstone
[1] Discussed with:	philip
2013-11-25 07:38:45 +00:00
Navdeep Parhar
245a0bd40a cxgbe(4): update the internal list of device features.
MFC after:	3 days
2013-11-21 20:07:58 +00:00
Grzegorz Bernacki
364871328e Unbreak compilation with GCC. 2013-11-21 09:19:14 +00:00
Grzegorz Bernacki
8e16e025ac Split raw reading/programming into smaller chunks to avoid allocating too
big chunk of kernel memory. Validate size of data. Add error handling to
avoid calling copyout() when data has not been read correctly.

Reviewed by:    zbb
Reported by:    x90c <geinblues@gmail.com>
MFC after:      2 days
2013-11-20 11:10:23 +00:00
Don Lewis
3ca52b0d34 Add alternate ID for Novatel MiFi 2200 CDMA, which is used by my
Virgin Mobile branded device.  It needs the U3GINIT_SCSIEJECT quirk.

Reviewed by:	hselasky
MFC after:	1 month
2013-11-20 02:16:47 +00:00
Mark Johnston
da089c1410 Import the axge(4) driver for the ASIX AX88178A and AX88179 USB Ethernet
adapters. Both devices support Gigabit Ethernet and USB 2.0, and the AX88179
supports USB 3.0. The driver was written by kevlo@ and lwhsu@, with a few
bug fixes from me.

MFC after:	2 months
2013-11-19 00:37:53 +00:00
Jean-Sébastien Pédron
05ad6397b3 drm: Support DRM_CAP_TIMESTAMP_MONOTONIC capability
This fixes DPMS with KDE and radeonkms. Without this, the display would
freeze when the monitor is put into sleep state, and only resumes after
several dozens of minutes once the monitor is powered on again.

Tested by:	Mathias Picker <Mathias.Picker@virtual-earth.de>
2013-11-17 16:07:52 +00:00
Eitan Adler
c1e1ddd57f Centrino Wireless-N 2200 does not have bluetooth support. 2013-11-16 04:29:02 +00:00
Ian Lepore
774b082ca9 Rework the routine that returns a pointer to the table of software ECC
byte positions within the OOB area to support chips with unusual OOB
sizes such as 218 or 224 bytes.

The table for 128 byte OOB works for these but it assumes 3 bytes of ECC
per 256 byte block, and in the case of an ONFI chip the params page may
ask for something different.  In other words, this is better but not
yet perfect.
2013-11-15 23:48:51 +00:00
Ian Lepore
8fad47e60f Move the luns field to the end of the struct, for serendipitous packing.
(I was supposed to do this before committing it initially.)
2013-11-15 23:45:13 +00:00
Ian Lepore
c3c04faa3a ONFI parameters are little-endian, hence we must take care to convert them
to native endianness.  We must also pay attention to unaligned accesses.

Copy the interesting parameters to a new struct so the rest of the code can
forget about these problems.

Submitted by:	Kristof Provost <kristof@sigsegv.be> (cleanup) and me (orig).
2013-11-15 23:41:32 +00:00
Ian Lepore
1b45c6cd53 Search for and validate the ONFI params as specified in the standard.
The ONFI spec states that at least two bytes of the signature ("ONFI")
must be present, and the CRC must be correct to have a valid parameter
page.  If the page is not valid there are at least two backup pages where
the data can also be found.

Submitted by:	Kristof Provost <kristof@sigsegv.be> (cleanup) and me (orig).
2013-11-15 23:37:33 +00:00
Ian Lepore
7aa6428bc6 Update the onfi_params struct to ONFI revision 3.2 (06 12 2013).
Submitted by:	Kristof Provost <kristof@sigsegv.be> (cleanup) and me (orig).
2013-11-15 23:35:10 +00:00
Ian Lepore
1337b92635 The vendor specified field is 88 bytes, not 8 bytes.
Submitted by:	Kristof Provost <kristof@sigsegv.be>
2013-11-15 23:31:39 +00:00
Eric Davis
5e33beca59 Fixed a tx watchdog chip reset that could occur on mostly idle links.
Fixed various link related issues and 10GBaseT is now linking properly.
Modified the types for the driver tunables to be consistent with the sysctl APIs.

Approved by:	davidch (mentor)
2013-11-15 20:26:14 +00:00
Justin T. Gibbs
70046ce650 Improve robustness of the Xen balloon driver.
sys/dev/xen/balloon/balloon.c:
	Remove unused and commented out code.

	Fix deadlock caused by performing a sleepable malloc
	while holding the balloon mutex.

	Perform proper accounting of the memory used by the domain.

Submitted by:	Roger Pau Monné
Sponsored by:	Citrix Systems R&D
Reviewed by:	gibbs
MFC after:	2 days
2013-11-15 16:35:28 +00:00
Alexander Motin
9a6b4cb929 Add few more minor parts of DevSleep support from AHCI 1.3.1 proposal. 2013-11-15 15:14:07 +00:00
Alexander Motin
c9b3a5a00b Add some more Intel HDA controller IDs and rename HDMI CODEC to Haswell. 2013-11-15 13:55:55 +00:00
Alexander Motin
f00fac180f Add ID for Intel Avoton SMBus controller. 2013-11-15 13:19:15 +00:00
Alexander Motin
667b72800a Add ID for Intel Lynx Point HDMI CODEC.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2013-11-15 13:12:53 +00:00
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