Commit Graph

27824 Commits

Author SHA1 Message Date
Navdeep Parhar
bc22dc708f cxgbe(4): Let caller specify whether it's ok to sleep in
t4_sched_config and t4_sched_params.

MFC after:	2 weeks
2014-08-06 19:38:03 +00:00
Nathan Whitehorn
f051baa008 Set fb_pbase properly on PowerPC in the case where we have to guess at
the right register bank for the framebuffer. Disable the assigned-addresses
path on SPARC since it is just a hack for IBM PPC systems and was neither
relevant for nor worked on SPARC anyway.
2014-08-06 18:13:09 +00:00
Roger Pau Monné
d0746cb4be drm: fix usage of vm_phys_fictitious_to_vm_page
vm_phys_fictitious_to_vm_page should not be called directly, even when
operating on a range that has been registered using
vm_phys_fictitious_reg_range. PHYS_TO_VM_PAGE should be used instead
because on arches that use VM_PHYSSEG_DENSE the page might come
directly from vm_page_array.

Reported by: nwhitehorn
Tested by: nwhitehorn, David Mackay <davidm.jx8p@gmail.com>
Sponsored by: Citrix Systems R&D
2014-08-06 17:45:59 +00:00
Nathan Whitehorn
9ed297c83c Retire various intertwined bits of fbd(4) and vt_fb, in particular the
pixel modification indirection. No actual drivers use it and those that
might (e.g. creatorfb) use custom implementations of vd_bitbltchr().
2014-08-06 00:35:48 +00:00
John Baldwin
49b3fc4062 Various fixes to hptmv(4):
- Replace the global driver lock with a per-instance device lock.
- Use the per-instance device lock instead of Giant for the CAM sim lock.
- Add global locks to protect the adapter list and DPC queues.
- Use wakeup() and mtx_sleep() to wait for certain events like the
  controller going idle rather than polling via timeouts passed to
  tsleep().
- Use callout(9) instead of timeout(9).
- Mark the interrupt handler MPSAFE.
- Remove compat shims for FreeBSD versions older than 8.0.

Reviewed by:	Steve Chang <ychang@highpoint-tech.com>
2014-08-05 23:58:49 +00:00
John Baldwin
04584935bc Various fixes to hptrr(4):
- Use the existing vbus locks instead of Giant for the CAM sim lock.
- Use callout(9) instead of timeout(9).
- Mark the interrupt handler MPSAFE.
- Don't attempt to pass data in the softc from probe() to attach().
- Remove compat shims for FreeBSD versions older than 8.0.

Reviewed by:	Steve Chang <ychang@highpoint-tech.com>
2014-08-05 23:47:26 +00:00
John Baldwin
630a434023 Various fixes to hptnr(4):
- Use the existing vbus locks instead of Giant for the CAM sim lock.
- Use callout(9) instead of timeout(9).
- Mark the interrupt handler MPSAFE.
- Don't attempt to pass data in the softc from probe() to attach().
- Remove compat shims for FreeBSD versions older than 8.0.

Reviewed by:	Steve Chang <ychang@highpoint-tech.com>
2014-08-05 23:39:35 +00:00
John Baldwin
ef588050a9 Various fixes to hptiop(4):
- Use callout(9) instead of timeout(9).
- Use the existing hba lock as the CAM sim lock instead of Giant.
- Mark interrupt handler MPSAFE.
- Reorder detach and destroy the hba lock in detach.

Reviewed by:	Steve Chang <ychang@highpoint-tech.com>
2014-08-05 23:35:19 +00:00
John Baldwin
465619d78a Remove compat shims for FreeBSD versions older than 8.0.
Reviewed by:	Steve Chang <ychang@highpoint-tech.com>
2014-08-05 23:32:53 +00:00
Glen Barber
a74c18162d Add device ID for the Chicony USB 2.0 HD UVC Webcam
found on the Asus X550LA.

Reviewed by:	sbruno
Sponsored by:	The FreeBSD Foundation
2014-08-05 19:43:44 +00:00
Hans Petter Selasky
5ec70ad261 - Implement fast interrupt handler to save CPU usage.
- Cleanup some register reads and writes to use existing register
  access macros.
- Ensure code which only applies to the control endpoint is not run
  for other endpoints in the data transfer path.

MFC after:	3 days
2014-08-05 18:48:12 +00:00
Hans Petter Selasky
ae369036ec Add handler for read-back of USB audio volume levels. 2014-08-05 18:35:34 +00:00
Nathan Whitehorn
c529ffef57 Add a simple unaccelerated vt(4) framebuffer driver for Sun framebuffers
handled by creator(4) (Sun Creator 3D, Elite 3D, etc.). This provides
vt(4) consoles on all devices currently supported by syscons on sparc64.
The driver should also be easily adaptable to support newer Sun framebuffers
such as the XVR-500 and higher.

Many thanks to dumbbell@ (Jean-Sebastien Pedron) for testing this remotely
during development.
2014-08-05 18:19:51 +00:00
Ian Lepore
633dbf2e1b Adjust ofwbus and simplebus to attach at BUS_PASS_ORDER_MIDDLE, so that
a platform can attach some other bus first if necessary.
2014-08-05 17:32:47 +00:00
Ian Lepore
2d12d35cf8 Set ofwbus and simplebus to attach during BUS_PASS_BUS. 2014-08-05 16:31:03 +00:00
Hans Petter Selasky
88e27ba861 - Ensure code which only applies to the control endpoint is not run
for other endpoints in the data transfer path.
- Ensure all bits of the "EPCON" register is written during
initialisation.

MFC after:	3 days
2014-08-05 13:36:26 +00:00
Nick Hibma
c376f4397d Add support for Huawei E3272 modems which are supported by the CDC
ethernet class.

Note: This is untested as I do not have a device like this. That is
reflected in the MFC timeout.

PR:		192345
Submitted by:	rozhuk.im gmail.com
MFC after:	4 weeks
2014-08-05 12:08:50 +00:00
Nick Hibma
273e613024 don't OR integer error values together as this does not make sense.
Instead bail on the first failed command.
2014-08-05 11:50:16 +00:00
Nick Hibma
dc26b3369f Return USB_ERR_INVAL if the eject method is not known.
PR:		145319
Submitted by:	rozhuk.im gmail.com
2014-08-05 09:59:16 +00:00
Nick Hibma
c5377460ea Add a second Huawei SCSI eject command as USB mode switch config files
sometimes use one or the other. Maybe newer Huawei modems switched.

Add a quirk for it as well.

PR:		145319
Submitted by:	rozhuk.im gmail.com
2014-08-05 09:35:25 +00:00
Nick Hibma
e28d2b2275 Reset the error value in the softc before starting a BBB transfer.
PR:		145319
Submitted by:	rozhuk.im gmail.com
MFC after:	3 days
2014-08-05 08:48:24 +00:00
Nick Hibma
89fc30aaa5 Add ID for Novatel MC990D to u3g.
PR:		145319
Submitted by:	rozhuk.im gmail.com
MFC after:	3 days
2014-08-05 08:29:16 +00:00
Nick Hibma
7ae432c00d Remove unused defines.
Fix some device_printf's that were missing '\n' at the end or had
speling errors.

PR:		145319
Submitted by:	rozhuk.im gmail.com
2014-08-05 08:24:41 +00:00
Hans Petter Selasky
f9478f91fb Add new USB phone descriptor template for USB device side mode.
MFC after:	3 days
2014-08-05 07:03:16 +00:00
Hans Petter Selasky
c3ccd2bf8c Fix for deadlock in USB device side mode.
MFC after:	3 days
2014-08-05 06:38:21 +00:00
Hans Petter Selasky
c65494287f Rename driver name a bit to avoid unit number confusion in dmesg.
MFC after:	3 days
2014-08-05 06:37:07 +00:00
Hans Petter Selasky
6d3fae9533 - Implement fast interrupt handler to save CPU usage.
- Add support for striding register offsets.
- Cleanup some register reads and writes to use existing register
access macros.
2014-08-05 06:33:59 +00:00
Hans Petter Selasky
08b3b75235 Ensure we catch USB transfers which complete right away. 2014-08-05 06:31:09 +00:00
Navdeep Parhar
46a646940f cxgbe(4): Do not run any sleepable code in the SIOCSIFFLAGS handler when
IFF_PROMISC or IFF_ALLMULTI is being flipped.  bpf(4) holds its global
mutex around ifpromisc in at least the bpf_dtor path.

MFC after:	3 days
2014-08-04 22:32:16 +00:00
Roger Pau Monné
c2641d23e1 xen: add ACPI bus to xen_nexus when running as Dom0
Also disable a couple of ACPI devices that are not usable under Dom0.
To this end a couple of booleans are added that allow disabling ACPI
specific devices.

Sponsored by: Citrix Systems R&D
Reviewed by: jhb

x86/xen/xen_nexus.c:
 - Return BUS_PROBE_SPECIFIC in the Xen Nexus attachement routine to
   force the usage of the Xen Nexus.
 - Attach the ACPI bus when running as Dom0.

dev/acpica/acpi_cpu.c:
dev/acpica/acpi_hpet.c:
dev/acpica/acpi_timer.c
 - Add a variable that gates the addition of the devices.

x86/include/init.h:
 - Declare variables that control the attachment of ACPI cpu, hpet and
   timer devices.
2014-08-04 09:05:28 +00:00
Roger Pau Monné
2382778f40 xen: Dom0 console fixes
Minor fixes to make the Xen Dom0 console work. This includes always
returning there's pending input in xencons_has_input, because on Dom0
there's no shared ring and we cannot test the indexes. The second
fix is to use the CONSOLEIO_read hypercall in order to read input
data from the Xen console.

Sponsored by: Citrix Systems R&D

dev/xen/console/xencons_ring.c:
 - Always return true in xencons_has_input for Dom0.
 - Implement Dom0 console support for xencons_handle_input.
2014-08-04 09:02:49 +00:00
Gavin Atkinson
7458a79a14 For reasons which are not clear, r254263 broke some PCMCIA and CardBus
bridges in strange ways, either rendering them unable to detect
insertion and removal events, or possibly unable to read from the
device behind the bridge.

This fixes at least one laptop, a Toshiba Tecra M5 with a Texas
Instruments PCxx12 (d=0x8039 v=0c104c) bridge.  The very similar
Tecra M9 has the same bridge, but worked fine without this change.

The bridge chip has no I/O port BAR, and there is nothing in the spec
to suggest I/O decoding should be enabled; however enabling it fixes
the issue.  Add an XXX comment to this effect.

Discussed with:	jhb, imp
MFC after:	2 weeks
2014-08-03 21:56:53 +00:00
Marcel Moolenaar
2ea1fcce34 Fix multicast, broken by the conversion of the nfe(4) driver to the
driver API.

Submitted by:	Mikhail <mp@lenta.ru>
2014-08-03 16:45:07 +00:00
Aleksandr Rybalko
45dc370059 Allow to disable some special key combinations handled by vt(4), like debug
request, reboot request.

Requested by:	Claude Buisson

Sponsored by:	The FreeBSD Foundation
2014-08-03 13:07:25 +00:00
Aleksandr Rybalko
34cb8c9fb5 Fix vt_vga driver to draw not-8-bit-aligned fonts correctly.
Still one bug here: mouse left some gaps on track when moving left.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-08-03 11:01:35 +00:00
Joerg Wunsch
4cac8309a3 Avoid a divide-by-zero panic when setting the baudrate to 0.
MFC after:	2 weeks
2014-08-03 10:47:45 +00:00
Adrian Chadd
8f1d4b2dd6 Do the iwn(4) panic reinitialisation under IWN_LOCK().
I've checked each of the functions being called and there's either a
_locked version or it's supposed to be called with IWN_LOCK() held.
2014-08-03 03:51:33 +00:00
Navdeep Parhar
b2c5bf0de2 cxgbe(4): Remove an unused version of t4_enable_vi.
MFC after:	2 weeks
2014-08-02 18:37:22 +00:00
Nathan Whitehorn
2661dd32df Don't assume that the framebuffer driver is using vt_fb_blank() when blanking
the screen during init.

MFC after:	1 week
2014-08-02 17:45:08 +00:00
Navdeep Parhar
4d6db4e0f7 cxgbe(4): some optimizations in freelist handling.
MFC after:	2 weeks.
2014-08-02 06:55:36 +00:00
Navdeep Parhar
f10405b396 cxgbe(4): Fix an off by one error when looking for the BAR2 doorbell
address of an egress queue.

MFC after:	2 weeks
2014-08-02 01:48:25 +00:00
Navdeep Parhar
b2daa9a9cd cxgbe(4): minor optimizations in ingress queue processing.
Reorganize struct sge_iq.  Make the iq entry size a compile time
constant.  While here, eliminate RX_FL_ESIZE and use EQ_ESIZE directly.

MFC after:	2 weeks
2014-08-02 00:56:34 +00:00
Ian Lepore
f3a4b7f73b Export an mmc or sd card's serial number from the mmc layer as an ivar.
In the mmcsd layer use this value to populate disk->d_ident.  Also set
disk->d_descr to the full set of card identification info (includes vendor,
model, manufacturing date, etc).
2014-07-31 16:54:54 +00:00
Kevin Lo
5dc8bea6de Replace the whole license block with the standard one.
Suggested by:	emaste
2014-07-31 05:12:21 +00:00
Kevin Lo
77c6646471 In copyright statement correct that the author is me, not Bill Paul. 2014-07-31 03:34:25 +00:00
Steven Hartland
e248a3d1f6 Bring in LSI's phase19 changes
* Removed unused mpssas_discovery_timeout function.
* Don't alter mapping boundaries if not raid firmware.
* Check free_busaddr instead of post_busaddr (diff minimisation really)

MFC after:	2 weeks
2014-07-30 18:21:06 +00:00
Steven Hartland
7571e7f64a Bring in LSI's phase16 - phase18 changes
* Implements Start Stop Unit for SATA direct-attach devices in IR mode to avoid
  data corruption.
* Use CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT and CAM_TID_INVALID

Obtained from:	LSI
MFC after:	2 weeks
2014-07-30 17:58:17 +00:00
Nathan Whitehorn
232490c660 Make mmap() of the console device when using ofwfb work like other supported
framebuffer drivers. This lets ofwfb work with xf86-video-scfb and makes
the driver much more generic and less PCI-centric. This changes some
user-visible behavior and will require updates to the xorg-server port
on PowerPC when using ATI graphics cards.
2014-07-29 23:11:05 +00:00
Ed Maste
aed5fb0a32 Correct typo in comment 2014-07-29 14:41:28 +00:00
Alexander Motin
f0389e79cd Add support for SOUND_MIXER_INFO IOCTL, used by gstreamer.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	2 weeks
2014-07-29 08:31:10 +00:00
Jack F Vogel
60186ca3e7 Add new README to the driver... 2014-07-28 22:23:49 +00:00
Jack F Vogel
9d052f904b Update the new 40G XL710 driver to Release version 1.0.0 2014-07-28 21:57:09 +00:00
Edward Tomasz Napierala
e403cfdc57 Fix potential double free that could happen after connection error.
MFC after:	3 days
2014-07-28 21:14:41 +00:00
Aleksandr Rybalko
eeadf17a21 Revise font initialization handling.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-07-28 14:41:22 +00:00
Aleksandr Rybalko
ba5c073ae3 Update comments.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-07-28 14:37:59 +00:00
Aleksandr Rybalko
5cc762d4c0 Remove special handling of console window size. It's done in vt_upgrade() for
all windows.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-07-28 14:35:21 +00:00
Konstantin Belousov
5d9b4508fd For md(4), posix shm(3) and tmpfs(5), free swap space used by paged in
dirty page, which is written by the process.

Reviewed by:	alc
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-07-28 14:27:05 +00:00
Aleksandr Rybalko
9a0f8af7d4 Avoid embedding buffers into static virtual terminal window.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-07-28 14:22:34 +00:00
Aleksandr Rybalko
8b1932a845 o Remove useless debug string.
o Fix indent.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-07-28 14:15:41 +00:00
Aleksandr Rybalko
3f71a6b88a Remove unused macro VT_CONSDEV_DECLARE. Join console device now declared in one
place.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-07-28 14:14:33 +00:00
Adrian Chadd
3fdeac5b5a Update from mav@ - don't break the input switching. 2014-07-27 20:14:22 +00:00
Adrian Chadd
dcd850637a Add support for my Lenovo T400.
Tested:

* Lenovo T400, model w/ P8700 Intel CPU on-board
2014-07-27 08:44:15 +00:00
Adrian Chadd
9682e34719 Add another revision of the AR8327. 2014-07-26 21:33:17 +00:00
Hans Petter Selasky
0722247439 Split the XHCI TRB allocations into smaller parts, so that we don't
end up allocating contiguous busdma buffers above PAGE_SIZE bytes.

MFC after:	1 week
Tested by:	Ruslan Bukin <br@bsdpad.com>
2014-07-26 19:08:52 +00:00
Marcel Moolenaar
aa5fed07eb Remove bogus module dependencies. 2014-07-26 17:57:13 +00:00
Marcel Moolenaar
359ee827e1 Do not fail the low-level device probe simply because the kernel
doesn't have support for the Z8530. Embedded PowerPC platforms
typically don't. Fail when the device class we actually need is
not present.

Obtained from:	Juniper Networks, Inc.
2014-07-26 17:49:40 +00:00
Hans Petter Selasky
b8e3094c34 Fix for division by zero.
MFC after:	3 days
2014-07-26 16:06:01 +00:00
Navdeep Parhar
0fe982772d Some hooks in cxgbe(4) for the offloaded iSCSI driver.
(I'm committing this on behalf of my colleagues in the Storage team
at Chelsio).

Submitted by:	Sreenivasa Honnur <shonnur at chelsio dot com>
Sponsored by:	Chelsio Communications.
2014-07-24 18:39:08 +00:00
Navdeep Parhar
82eff304b6 cxgbe(4): Keep track of the clusters that have to be freed by the
custom free routine (rxb_free) in the driver.  Fail MOD_UNLOAD with
EBUSY if any such cluster has been handed up to the kernel but hasn't
been freed yet.  This prevents a panic later when the cluster finally
needs to be freed but rxb_free is gone from the kernel.

MFC after:	1 week
2014-07-23 22:29:22 +00:00
Adrian Chadd
fa4be7cc42 Fix the igb(4) redirection table to correctly populate.
This is similar to the ixgbe(4) fix.

Tested:

* Intel I350 gigabit adapter
2014-07-23 05:40:28 +00:00
Navdeep Parhar
c086e3d1b7 Add missing newline to an error message.
MFC after:	3 days
2014-07-22 19:48:21 +00:00
Aleksandr Rybalko
b856b87699 Remove #ifdef-s to reduce difference to upstream.
Pointed by:	kib

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-07-22 08:52:49 +00:00
Navdeep Parhar
c3fb772502 Simplify r267600, there's no need to distinguish between allocated and
inlined mbufs.

MFC after:	1 week
2014-07-22 02:02:39 +00:00
Sean Bruno
77f3aefe61 Merge change from upstream linux kernel submitted by OpenBSD:
drm/radeon: fix-up some float to fixed conversion thinkos

Spotted by Brad Smith when porting to OpenBSD.
Noticed-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

ref: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=1cd73ff7

Remove #ifdef DUMBBELL_WIP in favor of upstream fix.

Phabric:	https://phabric.freebsd.org/D423
Reviewed by:	dumbbell, jkim
MFC after:	2 weeks
2014-07-21 19:33:08 +00:00
Ed Maste
4a87818e07 Hide syscons-specific workaround under DEV_SC
This change is a bit ugly, but so is the coupling between the i915
driver and syscons.  It isn't worth developing a more elegant solution
only to support the legacy syscons console.
2014-07-21 16:38:05 +00:00
Hans Petter Selasky
de65cb9aa9 Add new device ID.
MFC after:	1 week
PR:		191959
2014-07-20 21:02:35 +00:00
Adrian Chadd
ce44e5f776 Add the UDP hash -> RSS mbuf hash type for the ixgbe(4) driver. 2014-07-20 08:43:53 +00:00
Adrian Chadd
e3af537e75 Teach ixgbe(4) about rss_gethashconfig().
If RSS is enabled, ixgbe(4) will query the RSS API for the types of hashes
which should be used.  It'll then only enable hashes that are exposed via
the RSS layer.

This way it won't try to do things like enable UDP hashing if RSS explicitly
states that it isn't supported in lookups.

Tested:

* 82599EB ixgbe(4) NIC
2014-07-20 07:45:48 +00:00
Adrian Chadd
e965b0dcd1 Disable the ixgbe(4) UDP 4-tuple hashing for the time being.
A mix of fragmented and non-fragmented UDP in a single stream will end up
being hashed differently, resulting in out-of-order behaviour in the receive
path.

This was done in the linux e1000 driver in 2011.

Discussed with:	jfv
2014-07-20 07:43:41 +00:00
Adrian Chadd
c64a6bc62d Correctly program the RSS redirection table entries.
Without this, the RSS bucket assignments aren't correct - they're
DCBA instead of ABCD in each DWORD.

Tested:	82599EB ixgbe(4), TCP and UDP RSS
2014-07-20 04:11:18 +00:00
Xin LI
cd01c7a84f Fix build by using the driver API (driver converted in r266979 which should
be upstreamed).

X-MFC with:	r268854
MFC after:	5 days
2014-07-18 21:28:59 +00:00
David C Somayajulu
e3a36fb018 Initiate error recovery stats fail to update after 3 retries.
Change bxe_panic() ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() to
panic only if ECORE_STOP_ON_ERROR is defined.

MFC after:5 days
2014-07-18 20:04:11 +00:00
Hiren Panchasara
eee92ad073 The description is a bit misleading. Trying to make it more obvious.
Phabric:    https://phabric.freebsd.org/D435
Reviewed by:	gnn
2014-07-18 16:25:35 +00:00
Peter Wemm
a127e581c5 Fix an apparent conversion error in bge to the new driver api.
if_multiaddr_array() does the LLADDR work, don't do it twice.

This broke IPv6 in "interesting" ways in the FreeBSD.org cluster.
2014-07-18 07:41:38 +00:00
Nathan Whitehorn
35e6436e38 Fix embarassing typos I made.
Submitted by:	rayddteam
2014-07-17 12:47:34 +00:00
Hiren Panchasara
2814ea66e3 Fix a typo.
PR:		191898
Submitted by:	vsjcfm@gmail.com
2014-07-17 06:21:58 +00:00
Nathan Whitehorn
351e92cc2d Allow efifb to be used with xf86-video-scfb. This is important for EFI
systems without either a CSM or real graphics drivers, such as my Lenovo
Haswell laptop.

This provides working X with the small complication of a console cursor
permanently overlaid on the upper-left corner of the screen that will be
dealt with later.

Also remove some redundant screen clearing.
2014-07-16 18:52:21 +00:00
Nathan Whitehorn
60d7ea3d32 Allow console drivers active from early boot to be used with xf86-video-scfb,
rather than only drivers attached later on. This involves a small amount of
code duplication with dev/fb/fbd.c, which will fixed later on.

Also improve performance of vt_blank() by making it not read from the
framebuffer unnecessarily.
2014-07-16 18:49:46 +00:00
Hans Petter Selasky
0a54509ff9 Improve support for Intel Lynx Point USB 3.0 controllers by using the
USB 2.0 port mask in addition to the USB 3.0 port mask. The hardware
does not always accept when writing -1U to the port switching
registers.

MFC after:	3 days
Tested by:	Huang Wen Hui <huanghwh@gmail.com>
2014-07-16 06:14:41 +00:00
Rick Macklem
e2ade3b6f7 Move the "retry:" label so that the calls to m_pullup() are
not done after the call to m_defrag(). This fixes a problem
where m_pullup() would prepend an mbuf to the list created
by m_defrag() making the chain greater than 32 again.

Tested by:	rcarter@pinyon.org
Reviewed by:	yongari, jfv
MFC after:	2 weeks
2014-07-15 23:32:13 +00:00
Navdeep Parhar
bae4e5af99 cxgbe(4): Display CF facility correctly in the device log.
MFC after:	3 days
2014-07-15 18:24:41 +00:00
Navdeep Parhar
44eb893659 Allow multi-byte reads in the private CHELSIO_T4_GET_I2C ioctl. The
firmware allows up to 48B to be read this way but the driver limits
itself to 8B at a time to remain compatible with old cxgbetool
binaries.

MFC after:	1 week
2014-07-15 01:03:29 +00:00
Ian Lepore
0f822edead Fix the Zedboard/Zynq ethernet driver to handle media speed changes so
that it can connect to switches at speeds other than 1gb.

This requires changing the reference clock speed.  Since we still don't
have a general clock API that lets a SoC-independant driver manipulate its
own clocks, this change includes a weak reference to a routine named
cgem_set_ref_clk().  The default implementation is a no-op; SoC-specific
code can provide an implementation that actually changes the speed.

Submitted by:	Thomas Skibo <ThomasSkibo@sbcglobal.net>
2014-07-14 20:58:57 +00:00
Nathan Whitehorn
b85beee188 On my Lenovo laptop, the firmware maps the EFI framebuffer with MTRRs set
to uncacheable. This leads to execrable console performance. Once PMAP is
up, remap the framebuffer as write-combining. This reduces boot time on my
laptop by 60% when booting with EFI.

MFC after:	2 weeks
2014-07-14 17:42:22 +00:00
Mark Johnston
05929f8bd0 Add a headphone redirection quirk for the Lenovo G580.
MFC after:	1 week
2014-07-13 10:31:29 +00:00
Hans Petter Selasky
817a8cac2e Turn off blinking device leds at attach.
MFC after:	3 days
PR:		183735
2014-07-13 09:34:59 +00:00
Hans Petter Selasky
948d799e27 Fix performance problems with AXGE network adapter in RX direction:
- Remove 4 extra bytes from the ethernet payload.
- The maximum RX buffer was incorrectly set. Increase it to 64K for
now, until the exact limit is understood.
- Enable hardware checksumming again.
- Make hardware data structure packed.

MFC after:	3 days
2014-07-13 07:39:28 +00:00
Rui Paulo
efce3748f3 Revert r268543.
We should probably fix sys/gpio.h instead.
2014-07-12 06:23:42 +00:00
Rui Paulo
bd08cbb81a Move iic.h to sys/ so that it's automatically installed in /usr/include/sys.
This lets us call iic(4) ioctls without needing the kernel source code
and follows the same model of GPIO.

MFC after:	3 weeks
2014-07-12 01:04:10 +00:00
Navdeep Parhar
30f337891d cxgbe(4): Add an iSCSI softc to the adapter structure. 2014-07-11 21:02:54 +00:00
Gleb Smirnoff
fcc34a238c Fix style bug: rename the refcount field of m_ext to ext_cnt, to match
other members.

Sponsored by:	Nginx, Inc.
2014-07-11 14:34:29 +00:00
Gleb Smirnoff
15c28f87b8 All mbuf external free functions never fail, so let them be void.
Sponsored by:	Nginx, Inc.
2014-07-11 13:58:48 +00:00
Mark Johnston
58e6549541 Correct the setting of the VID in transmit descriptors when hardware VLAN
tagging is enabled. This was broken in r266978.

Reported by:	gjb
Tested by:	gjb
2014-07-10 16:46:46 +00:00
Kevin Lo
b11ce478cf Enable 8051 before downloading firmware.
Tested by:	Carlos Jacobo Puga Medina <cpm at fbsd dot es>
2014-07-10 09:42:34 +00:00
Bryan Venteicher
32487a8973 Rework when the Tx queue completion interrupt is enabled
The Tx interrupt is now kept disabled in the common case, only
enabled when the number of free descriptors in the queue falls
below a threshold. Transmitted frames are cleared from the VQ
before subsequent transmit, or in the watchdog timer.

This was a very big performance improvement for an experimental
Netmap bhyve backend.

MFC after:	1 month
2014-07-10 05:36:04 +00:00
Bryan Venteicher
4b59668f0e Add accessor to get the number of free descriptors in the virtqueue
MFC after:	1 month
2014-07-10 05:26:01 +00:00
Aleksandr Rybalko
79b647995d Should check fb_read method presence instead of double check for fb_write.
Pointed by:     emaste

Sponsored by:	The FreeBSD Foundation
2014-07-09 21:55:34 +00:00
Aleksandr Rybalko
97f3c4e8a4 Fix inconsistent token parameters for kbd_allocate() and kbd_release() in vt(4).
PR:		191306
Submitted by:	jau789@gmail.com
Sponsored by:	The FreeBSD Foundation
2014-07-09 14:36:03 +00:00
Alexander Motin
950b6e126b Pass correct command that should be aborted to ISPCTL_ABORT_CMD.
This makes XPT_ABORT to work for me on initiator side of isp(4).
Previous code was trying to abort the XPT_ABORT itself and failed.

MFC after:	1 week
2014-07-08 13:01:36 +00:00
Alexander Motin
aa75114c57 Add XPT_ABORT support to iSCSI initiator.
While CAM does not use it normally, it is useful for targets testing.

MFC after:	2 weeks
2014-07-08 09:37:41 +00:00
Alexander Motin
462cf3ba2a Make XPT_GET_TRAN_SETTINGS to report CAM that command queueing is enabled,
but make couple changes to handle non-queued commands too, if happen.

MFC after:	2 weeks
2014-07-07 17:34:48 +00:00
Fabien Thomas
b8fad6c0ef Optim and Fix for mge driver:
- add missing rcvif in mbuf
- add missing ipacket stat
- remove uncessary mbuf copy on output path
- fix deadlock of the TX engine in case of error

Obtained from:	NETASQ
MFC after:	2 weeks
2014-07-07 08:22:39 +00:00
Hans Petter Selasky
88e0a63961 Improve support for Intel Lynx Point USB 3.0 controllers by masking
the port routing bits like done in Linux.

MFC after:	1 week
Tested by:	Tur-Wei Chan <twchan@singnet.com.sg>
2014-07-07 05:17:16 +00:00
Marcel Moolenaar
e7d939bda2 Remove ia64.
This includes:
o   All directories named *ia64*
o   All files named *ia64*
o   All ia64-specific code guarded by __ia64__
o   All ia64-specific makefile logic
o   Mention of ia64 in comments and documentation

This excludes:
o   Everything under contrib/
o   Everything under crypto/
o   sys/xen/interface
o   sys/sys/elf_common.h

Discussed at: BSDcan
2014-07-07 00:27:09 +00:00
Nathan Whitehorn
00cf40b0ca Use common vt_fb parts in ofwfb as far as we are able without sacrificing
performance.

MFC after:	2 weeks
2014-07-07 00:12:18 +00:00
Alexander Motin
ffe82e05b3 Make iSCSI initiator keep Initiator Session ID (ISID) across reconnects.
Previously ISID was changed every time, that made impossible correct
persistent reservation, because reconnected session was identified as
completely new one.

Reviewed by:	trasz
MFC after:	1 week
2014-07-06 17:37:49 +00:00
Gavin Atkinson
764442e03d Add support to asmc(4) for Macmini 3,1.
PR:		190195
Submitted by:	fbsdbugs2 sentry.org
MFC after:	1 week
Relnotes:	yes
2014-07-05 21:34:37 +00:00
Luiz Otavio O Souza
28b07d23a9 Allow the PVID setting on CPU port.
Return our static list of supported media for the CPU port.

Tested on TP-Link 1043ND.
2014-07-05 19:31:22 +00:00
Luiz Otavio O Souza
bfae93299c Initialize the switch vlan table at attachment.
Update some comments on code, specifying the correct vlans used on switch
setup.

Advertise the proper switch operation mode (the rtl8366rb only support
dot1q vlans).

This fixes the breakage that i introduced on r249752 and make the rtl8366rb
switch works again with etherswitchcfg(8).

Tested on TP-Link 1043ND.

Tested by:	me, Harm Weites (harm at weites.com)
2014-07-03 19:50:50 +00:00
Hans Petter Selasky
2110950be8 - Disable hardware checksumming until it is properly tested.
- Don't discard frames if the dropped or error flag is set.
- Don't remove the last 4-bytes of every packet.
- Add extra range check for data position offset when receiving data.

MFC after:	1 day
PR:		191432
2014-07-03 10:49:46 +00:00
Justin Hibbits
e42edd4db6 Fix a bug in hwpmc(4) callchain retrieval, for both user and kernel.
The array index for the callchain is getting double-incremented -- both in the
loop and the storing.  It should only be incremented in one location.

Also, constrain the stack pointer range check.

MFC after:	2 weeks
2014-07-03 06:52:26 +00:00
Bryan Venteicher
a88f19d8f1 Remove some write only variables
MFC after:	3 days
2014-07-02 23:28:21 +00:00
Sergey Kandaurov
59578ee028 Fixed build with DEVICE_POLLING. 2014-07-02 21:08:25 +00:00
Marcel Moolenaar
4a81240ca7 Fix off-by-one introduced by the conversion to the driver API.
Submitted by:   Sreekanth Rupavatharam <rupavath@juniper.net>
Obtained from:  Juniper Networks, Inc.
2014-07-02 16:17:48 +00:00
Luigi Rizzo
d398c8634a Various bugfixes from Stefano Garzarella:
1. oce_multiq_start(): make sure the buffer is consumed even on ENXIO
2. oce_multiq_transmit(): there is an extra call to drbr_enqueue()
  causing the mbuf to be enqueued twice when the NIC's queue is full,
  and potential panics
3. oce_multiq_transmit(): same problem fixed recently in ixgbe (r267187)
   and other drivers: if the mbuf is enqueued, the proper return value is 0

Submitted by:	Stefano Garzarella
MFC after:	3 days
2014-07-02 12:13:11 +00:00
Marcel Moolenaar
c2df73347b Convert nfe(4) to use the driver API.
Submitted by: Mikhail <mp@lenta.ru>
2014-07-01 23:41:54 +00:00
Marcel Moolenaar
fba8b10966 Convert bge(4) to use the driver API.
Submitted by:   Sreekanth Rupavatharam <rupavath@juniper.net>
Obtained from:  Juniper Networks, Inc.
2014-07-01 19:50:47 +00:00
John Baldwin
30a13db0c5 Free the static DMA buffer holding the command ring during detach as well
as if attach fails.
2014-07-01 18:24:54 +00:00
Marius Strobl
68c02e3d63 Actually pro AMD chipsets.
MFC after:	3 days
Sponsored by:	Bally Wulff Games & Entertainment GmbH
2014-07-01 14:54:34 +00:00
Luiz Otavio O Souza
b0bb5bfaec Fix the reported status for the switch CPU port which was (wrongly)
reporting half-duplex link.

Tested on TP-Link WR1043ND.
2014-07-01 14:49:46 +00:00
Luiz Otavio O Souza
dddab08921 Add the CPU port flag to the CPU port on rtl8366 (port 5).
Do not allow any media change on the switch CPU port.

Tested on TP-Link WR1043ND.
2014-07-01 14:33:48 +00:00
Scott Long
9b6ea4e794 Don't overload the CCB status field within the driver.
Obtained from:	Netflix, Inc.
MFC after:	2 days
2014-07-01 10:51:20 +00:00
Hans Petter Selasky
d9b6ab3a76 Fix order of USB serial layer uninit. Currently module dependency
rules prevent the USB serial module to be unloaded before any client
modules. This patch ensures that the "ucom_mtx" mutex is destroyed
last when doing a system uninit in a monotolith build aswell.

MFC after:	3 days
2014-07-01 07:30:29 +00:00
Hans Petter Selasky
31136808a4 Fix for use after free.
MFC after:	3 days
2014-07-01 07:13:41 +00:00
Scott Long
601781ccc3 Add accessor functions for manipulating the CAM CCB status field.
Reviewed by:	gibbs
Obtained from:	Netflix, Inc
MFC after:	2 days
2014-07-01 04:44:18 +00:00
Scott Long
b7f7712702 Refactor some code in mps.c to reduce header pollution.
Reviewed by:	gibbs
Obtained from:	Netflix, Inc.
MFC after:	2 days
2014-07-01 04:33:36 +00:00
Adrian Chadd
8c0d2adf3f Initialise these variables so gcc doesn't complain.
Submitted by:	luigi
2014-06-30 23:34:36 +00:00
Adrian Chadd
7063e348ab Add initial RSS awareness to the ixgbe(4) driver.
The ixgbe(4) hardware is capable of RSS hashing RX packets and doing RSS
queue selection for up to 8 queues.

However, even if multi-queue is enabled for ixgbe(4), the RX path doesn't use
the RSS flowid from the received descriptor.  It just uses the MSIX queue id.

This patch does a handful of things if RSS is enabled:

* Instead of using a random key at boot, fetch the RSS key from the RSS code
  and program that in to the RSS redirection table.

  That whole chunk of code should be double checked for endian correctness.

* Use the RSS queue mapping to CPU ID to figure out where to thread pin
  the RX swi thread and the taskqueue threads for each queue.

* The software queue is now really an "RSS bucket".

* When programming the RSS indirection table, use the RSS code to
  figure out which RSS bucket each slot in the indirection table maps
  to.

* When transmitting, use the flowid RSS mapping if the mbuf has
  an RSS aware hash.  The existing method wasn't guaranteed to align
  correctly with the destination RSS bucket (and thus CPU ID.)

This code warns if the number of RSS buckets isn't the same as the
automatically configured number of hardware queues.  The administrator
will have to tweak one of them for better performance.

There's currently no way to re-balance the RSS indirection table after
startup.  I'll worry about that later.

Additionally, it may be worthwhile to always use the full 32 bit flowid if
multi-queue is enabled.  It'll make things like lagg(4) behave better with
respect to traffic distribution.
2014-06-30 04:38:29 +00:00
Adrian Chadd
1d72a9bea9 Add initial RSS awareness to the igb(4) driver.
The igb(4) hardware is capable of RSS hashing RX packets and doing RSS
queue selection for up to 8 queues.  (I believe some hardware is limited
to 4 queues, but I haven't tested on that.)

However, even if multi-queue is enabled for igb(4), the RX path doesn't use
the RSS flowid from the received descriptor.  It just uses the MSIX queue id.

This patch does a handful of things if RSS is enabled:

* Instead of using a random key at boot, fetch the RSS key from the RSS code
  and program that in to the RSS redirection table.

  That whole chunk of code should be double checked for endian correctness.

* Use the RSS queue mapping to CPU ID to figure out where to thread pin
  the RX swi thread and the taskqueue threads for each queue.

* The software queue is now really an "RSS bucket".

* When programming the RSS indirection table, use the RSS code to
  figure out which RSS bucket each slot in the indirection table maps
  to.

* When transmitting, use the flowid RSS mapping if the mbuf has
  an RSS aware hash.  The existing method wasn't guaranteed to align
  correctly with the destination RSS bucket (and thus CPU ID.)

This code warns if the number of RSS buckets isn't the same as the
automatically configured number of hardware queues.  The administrator
will have to tweak one of them for better performance.

There's currently no way to re-balance the RSS indirection table after
startup.  I'll worry about that later.

Additionally, it may be worthwhile to always use the full 32 bit flowid if
multi-queue is enabled.  It'll make things like lagg(4) behave better with
respect to traffic distribution.
2014-06-30 04:34:59 +00:00
Scott Long
3da2a91a57 In rare cases, a SATA drive can stop responding to commands and trigger a
reset device task request from the driver.  If the drive fails to respond
with a signature FIS, the driver would previously get into an endless retry
loop, stalling all I/O to the drive and keeping user processes stranded.
Instead, fail the i/o and invalidate the device if the task management
command times out.  This is controllable with the sysctl and tunable
hw.isci.fail_on_task_timeout
dev.isci.0.fail_on_task_timeout

The default for these is 1.

Reviewed by:	jimharris
Obtained from:	Netflix, Inc.
MFC after:	2 days
2014-06-30 01:01:54 +00:00
Scott Long
58cf99d20d Fix a case in ndling ATA_PASSTHROUGH commands that have an unaligned buffer.
This impacts some home-rolled SMART tools.

Reviewed by:	jimharris
Obtained from:	Netflix
MFC after:	2 days
2014-06-30 00:41:46 +00:00
Sean Bruno
0fb31ed073 Add detection for ciss(4) controllers that are set to non-raid JBOD mode.
If a controller is set to JBOD, it has no RAID functions turned on.

Populate even more of the firmware specification headers, copied from
cciss_vol_status.

Reviewed by:	Benesh, Scott <scott.benesh@hp.com>
MFC after:	2 weeks
2014-06-29 18:53:15 +00:00
Sean Bruno
97ed09b5ff Check return of cam_periph_find() before using it in a printf.
If cam_periph_find() doesn't locate the path we requested, bail to error
condition.

Acquire ciss->mtx for this operation.

Reviewed by:	"Benesh, Scott" <scott.benesh@hp.com>
MFC after:	2 weeks
2014-06-29 18:38:44 +00:00
Bryan Venteicher
efd48b30f1 Give each interrupt a descriptive name when using MSIX
MFC after:	3 days
2014-06-29 01:04:11 +00:00
Hans Petter Selasky
af3b2549c4 Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
Glen Barber
37a107a407 Revert r267961, r267973:
These changes prevent sysctl(8) from returning proper output,
such as:

 1) no output from sysctl(8)
 2) erroneously returning ENOMEM with tools like truss(1)
    or uname(1)
 truss: can not get etype: Cannot allocate memory
2014-06-27 22:05:21 +00:00
Xin LI
d2f1b8f4d2 Use Intel's official name (Secure Key) per Intel® Digital Random Number
Generator (DRNG) Software Implementation Guide.

Reviewed by:	kib
Approved by:	so
MFC after:	2 weeks
2014-06-27 21:33:15 +00:00
Marius Strobl
7344ee184b In order to get vt(4) a bit closer to the feature set provided by sc(4),
implement options TERMINAL_{KERN,NORM}_ATTR. These are aliased to
SC_{KERNEL_CONS,NORM}_ATTR and like these latter, allow to change the
default colors of normal and kernel text respectively.
Note on the naming: Although affecting the output of vt(4), technically
kern/subr_terminal.c is primarily concerned with changing default colors
so it would be inconsistent to term these options VT_{KERN,NORM}_ATTR.
Actually, if the architecture and abstraction of terminal+teken+vt would
be perfect, dev/vt/* wouldn't be touched by this commit at all.

Reviewed by:	emaste
MFC after:	3 days
Sponsored by:	Bally Wulff Games & Entertainment GmbH
2014-06-27 19:57:57 +00:00
Ed Maste
59644098f8 Use a common tunable to choose between vt(4)/sc(4)
With this change and previous work from ray@ it will be possible to put
both in GENERIC, and have one enabled by default, but allow the other to
be selected via the loader.

(The previous implementation had separate kern.vt.disable and
hw.syscons.disable tunables, and would panic if both drivers were
compiled in and neither was explicitly disabled.)

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-06-27 17:50:33 +00:00
Hans Petter Selasky
3da1cf1e88 Extend the meaning of the CTLFLAG_TUN flag to automatically check if
there is an environment variable which shall initialize the SYSCTL
during early boot. This works for all SYSCTL types both statically and
dynamically created ones, except for the SYSCTL NODE type and SYSCTLs
which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to
be used in the case a tunable sysctl has a custom initialisation
function allowing the sysctl to still be marked as a tunable. The
kernel SYSCTL API is mostly the same, with a few exceptions for some
special operations like iterating childrens of a static/extern SYSCTL
node. This operation should probably be made into a factored out
common macro, hence some device drivers use this. The reason for
changing the SYSCTL API was the need for a SYSCTL parent OID pointer
and not only the SYSCTL parent OID list pointer in order to quickly
generate the sysctl path. The motivation behind this patch is to avoid
parameter loading cludges inside the OFED driver subsystem. Instead of
adding special code to the OFED driver subsystem to post-load tunables
into dynamically created sysctls, we generalize this in the kernel.

Other changes:
- Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask"
to "hw.pcic.intr_mask".
- Removed redundant TUNABLE statements throughout the kernel.
- Some minor code rewrites in connection to removing not needed
TUNABLE statements.
- Added a missing SYSCTL_DECL().
- Wrapped two very long lines.
- Avoid malloc()/free() inside sysctl string handling, in case it is
called to initialize a sysctl from a tunable, hence malloc()/free() is
not ready when sysctls from the sysctl dataset are registered.
- Bumped FreeBSD version to indicate SYSCTL API change.

MFC after:	2 weeks
Sponsored by:	Mellanox Technologies
2014-06-27 16:33:43 +00:00