Commit Graph

28045 Commits

Author SHA1 Message Date
Jean-Sébastien Pédron
0d06446812 vt(4): Don't recalculate buffer size if we don't know screen size
When the screen size is unknown, it's set to 0x0. We can't use that as
the buffer size, otherwise, functions such as vtbuf_fill() will fail.

This fixes a panic on RaspberryPi, where there's no vt(4) backend
configured early in boot.

PR:		193981
Tested by:	danilo@
MFC after:	3 days
2014-10-04 18:40:40 +00:00
Hans Petter Selasky
b06d477b3c When we fail to get a USB reference we should just return, because
there are no more references held.

MFC after:	3 days
2014-10-03 16:09:46 +00:00
Hans Petter Selasky
30c6f4bac5 Fix XHCI driver for devices which have more than 15 physical root HUB
ports. The current bitmap array was too small to hold more than 16
bits and would at some point toggle the context size, which then would
trigger an enumeration fault and cause a fallback to the EHCI
companion controller, if any.

MFC after:	3 days
2014-10-03 15:58:04 +00:00
George V. Neville-Neil
974577b5cd Fixup the setting of the baud rate. 2014-10-02 22:05:48 +00:00
Jung-uk Kim
313a0c13ef Merge ACPICA 20140926. 2014-10-02 19:11:18 +00:00
Hans Petter Selasky
8b0569ba8f Make sure we always set the maximum number of valid contexts.
MFC after:	3 days
2014-10-02 16:56:00 +00:00
Jean-Sébastien Pédron
61220c0d64 vt(4): Save/restore keyboard mode & LED states when switching window
Add new functions to manipulate these mode & state, instead of calling
kbdd_ioctl() everyhere.

This fixes at least two bugs:

    1. The state of the Scroll Lock LED and the state of scroll mode
       could be out-of-sync. For instance, if one enables scroll mode on
       window #1 and switches to window #2, the LED would remain on, but
       the window wouldn't be in scroll mode.

       Similarily, when switching between a console and an X.Org
       session, the LED states could be inconsistent with the real
       state.

    2. When exiting from an X.Org session, the user could be unable to
       type anything. The workaround was to switch to another console
       window and come back.

Differential Revision:	https://reviews.freebsd.org/D821
Reviewed by:	ray@
Approved by:	ray@
Tested by:	kwm@
MFC after:	3 days
2014-10-02 16:36:37 +00:00
George V. Neville-Neil
f857a2b4a0 Properly handle a case that should never happen (the bus_dma
callback being called with error set to non-zero).
2014-10-02 15:03:51 +00:00
Hans Petter Selasky
e8fa59aa5e Add new USB ID.
PR:		194091
MFC after:	3 days
2014-10-02 12:27:41 +00:00
Ganbold Tsagaankhuu
dc7717a863 Add uart driver for Qualcomm MSM 7000/8000 series chips.
It is working on IFC6410 board which has Qualcomm Snapdragon SoC.

Approved by:    stas (mentor)
2014-10-02 08:12:42 +00:00
Will Andrews
bb6b32dd81 Add sysctl to track the resource consumption of ACPI interrupts.
Submitted by:	gibbs
MFC after:	1 month
Sponsored by:	Spectra Logic
MFSpectraBSD:	636827 on 2012/09/28
2014-10-01 14:35:52 +00:00
Hans Petter Selasky
a4a51f054d Set default cycle state in case of early interrupts.
MFC after:	3 days
2014-10-01 07:34:49 +00:00
Ian Lepore
c3f0f2847f Return the actual baud rate programmed in the hardware rather than 115200.
This allows the "3wire" entry in /etc/ttys (with no speed specified) to work.
2014-09-30 23:01:11 +00:00
George V. Neville-Neil
060a95ef01 Support tunable to control Tx deferred packet list limits
Also increase default for Tx queue get-list limit.
Too small limit results in TCP packets drops especiall when many
streams are running simultaneously.
Put list may be kept small enough since it is just a temporary
location if transmit function can't get Tx queue lock.

Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2014-09-30 20:57:25 +00:00
George V. Neville-Neil
bc85c897c7 The patch allows to check state of the software Tx queues at run time.
Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2014-09-30 20:43:21 +00:00
George V. Neville-Neil
385b1d8e67 Make size of Tx and Rx rings configurable
Required size of event queue is calculated now.

Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2014-09-30 20:36:07 +00:00
George V. Neville-Neil
b7b0edd17c cleanup: code style fixes
Remove trailing whitespaces and tabs.
Enclose value in return statements in parentheses.
Use tabs after #define.
Do not skip comparison with 0/NULL in boolean expressions.

Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2014-09-30 20:18:10 +00:00
Roger Pau Monné
59adbba20f xen: fix blkback pushing responses before releasing internal resources
Fix a problem where the blockback driver could run out of requests,
despite the fact that we allocate enough request and reqlist
structures to satisfy the maximum possible number of requests.

The problem was that we were sending responses back to the other
end (blockfront) before freeing resources. The Citrix Windows
driver is pretty agressive about queueing, and would queue more I/O
to us immediately after we sent responses to it. We would run into
a resource shortage and stall out I/O until we freed resources.

It isn't clear whether the request shortage condition was an
indirect cause of the I/O hangs we've been seeing between Windows
with the Citrix PV drivers and FreeBSD's blockback, but the above
problem is certainly a bug.

Sponsored by: Spectra Logic
Submitted by: ken
Reviewed by: royger

dev/xen/blkback/blkback.c:
 - Break xbb_send_response() into two sub-functions,
   xbb_queue_response() and xbb_push_responses().
   Remove xbb_send_response(), because it is no longer
   used.

 - Adjust xbb_complete_reqlist() so that it calls the
   two new functions, and holds the mutex around both
   calls.  The mutex insures that another context
   can't come along and push responses before we've
   freed our resources.

 - Change xbb_release_reqlist() so that it requires
   the mutex to be held instead of acquiring the mutex
   itself.  Both callers could easily hold the mutex
   while calling it, and one really needs to hold the
   mutex during the call.

 - Add two new counters, accessible via sysctl
   variables.  The first one counts the number of
   I/Os that are queued and waiting to be pushed
   (reqs_queued_for_completion).  The second one
   (reqs_completed_with_error) counts the number of
   requests we've completed with an error status.
2014-09-30 17:41:16 +00:00
Roger Pau Monné
22c1633270 xen/balloon: fix accounting of current memory pages on PVH
Using realmem on PVH is not realiable, since in this case the realmem value
is computed from Maxmem, which contains the higher memory address found. Use
HYPERVISOR_start_info->nr_pages instead, which is set by the hypervisor and
contains the exact number of memory pages assigned to the domain.

Sponsored by: Citrix Systems R&D
2014-09-30 17:38:21 +00:00
Roger Pau Monné
557077b5fc xen: add xenstored user-space device
This device is used by the user-space daemon that runs xenstore
(xenstored). It allows xenstored to map the xenstore memory page, and
reports the event channel xenstore is using.

Sponsored by: Citrix Systems R&D

dev/xen/xenstore/xenstored_dev.c:
 - Add the xenstored character device that's used to map the xenstore
   memory into user-space, and to report the event channel used by
   xenstore.

conf/files:
 - Add the device to the build process.
2014-09-30 17:37:26 +00:00
Roger Pau Monné
45ce037de2 xen: convert the xenstore user-space char device to a newbus device
Convert the xenstore user-space device (/dev/xen/xenstore) to a device
using the newbus interface. This allows us to make the device
initialization dependant on the initialization of xenstore itself in
the kernel.

Sponsored by: Citrix Systems R&D

dev/xen/xenstore/xenstore.c:
 - Convert to a newbus device, this removes the xs_dev_init function.

xen/xenstore/xenstore_internal.h:
 - Remove xs_dev_init prototype.

dev/xen/xenstore/xenstore.c:
 - Don't call xs_dev_init anymore, the device will attach itself when
   xenstore is started.
2014-09-30 17:31:04 +00:00
Roger Pau Monné
1d84e2b3c8 xen: defer xenstore initialization until xenstored is started
The xenstore related devices in the kernel cannot be started until
xenstored is running, which will happen later in the Dom0 case. If
start_info_t doesn't contain a valid xenstore event channel, defer all
xenstore related devices attachment to later.

Sponsored by: Citrix Systems R&D

dev/xen/xenstore/xenstore.c:
 - Prevent xenstore from trying to attach it's descendant devices if
   xenstore is not initialized.
 - Add a callback in the xenstore interrupt filter that will trigger
   the plug of xenstore descendant devices on the first received
   interrupt. This interrupt is generated when xenstored attaches to
   the event channel, and serves as a notification that xenstored is
   running.
2014-09-30 17:27:56 +00:00
Roger Pau Monné
a6aedc5d49 xen: move xenstore devices
Move xenstore related devices (xenstore.c and xenstore_dev.c) from
xen/xenstore to dev/xen/xenstore. This is just code motion, no
functional changes.

Sponsored by: Citrix Systems R&D
2014-09-30 17:14:11 +00:00
Roger Pau Monné
ae3078d9e4 xen: make xen balloon a driver that depends on xenstore
This is done so we can prevent the Xen Balloon driver from attaching
before xenstore is setup.

Sponsored by: Citrix Systems R&D

dev/xen/balloon/balloon.c:
 - Make xen balloon a driver that depends on xenstore.
2014-09-30 16:53:08 +00:00
Roger Pau Monné
44e06d158a msi: add Xen MSI implementation
This patch adds support for MSI interrupts when running on Xen. Apart
from adding the Xen related code needed in order to register MSI
interrupts this patch also makes the msi_init function a hook in
init_ops, so different MSI implementations can have different
initialization functions.

Sponsored by: Citrix Systems R&D

xen/interface/physdev.h:
 - Add the MAP_PIRQ_TYPE_MULTI_MSI to map multi-vector MSI to the Xen
   public interface.

x86/include/init.h:
 - Add a hook for setting custom msi_init methods.

amd64/amd64/machdep.c:
i386/i386/machdep.c:
 - Set the default msi_init hook to point to the native MSI
   initialization method.

x86/xen/pv.c:
 - Set the Xen MSI init hook when running as a Xen guest.

x86/x86/local_apic.c:
 - Call the msi_init hook instead of directly calling msi_init.

xen/xen_intr.h:
x86/xen/xen_intr.c:
 - Introduce support for registering/releasing MSI interrupts with
   Xen.
 - The MSI interrupts will use the same PIC as the IO APIC interrupts.

xen/xen_msi.h:
x86/xen/xen_msi.c:
 - Introduce a Xen MSI implementation.

x86/xen/xen_nexus.c:
 - Overwrite the default MSI hooks in the Xen Nexus to use the Xen MSI
   implementation.

x86/xen/xen_pci.c:
 - Introduce a Xen specific PCI bus that inherits from the ACPI PCI
   bus and overwrites the native MSI methods.
 - This is needed because when running under Xen the MSI messages used
   to configure MSI interrupts on PCI devices are written by Xen
   itself.

dev/acpica/acpi_pci.c:
 - Lower the quality of the ACPI PCI bus so the newly introduced Xen
   PCI bus can take over when needed.

conf/files.i386:
conf/files.amd64:
 - Add the newly created files to the build process.
2014-09-30 16:46:45 +00:00
Alexander Motin
c8dbed028f Fix old iSCSI initiator to work with new CAM locking.
This switches code to using xpt_scan() routine, irrelevant to locking.
Using xpt_action() directly requires knowledge about higher level locks,
that SIM does not need to have.

This code is obsoleted, but that is not a reason to crash.

MFC after:	3 days
2014-09-30 16:17:12 +00:00
Adrian Chadd
1b65908ea7 Add a missing file from the last commit.
Noticed by: jhibbits
2014-09-30 05:50:34 +00:00
Adrian Chadd
9389d5a95e Add initial support for the AR9485 CUS198 / CUS230 variants.
These variants have a few differences from the default AR9485 NIC,
namely:

* a non-default antenna switch config;
* slightly different RX gain table setup;
* an external XLNA hooked up to a GPIO pin;
* (and not yet done) RSSI threshold differences when
  doing slow diversity.

To make this possible:

* Add the PCI device list from Linux ath9k, complete with vendor and
  sub-vendor IDs for various things to be enabled;
* .. and until FreeBSD learns about a PCI device list like this,
  write a search function inspired by the USB device enumeration code;
* add HAL_OPS_CONFIG to the HAL attach methods; the HAL can use this
  to initialise its local driver parameters upon attach;
* copy these parameters over in the AR9300 HAL;
* don't default to override the antenna switch - only do it for
  the chips that require it;
* I brought over ar9300_attenuation_apply() from ath9k which is cleaner
  and easier to read for this particular NIC.

This is a work in progress.  I'm worried that there's some post-AR9380
NIC out there which doesn't work without the antenna override set as
I currently haven't implemented bluetooth coexistence for the AR9380
and later HAL.  But I'd rather have this code in the tree and fix it
up before 11.0-RELEASE happens versus having a set of newer NICs
in laptops be effectively RX deaf.

Tested:

* AR9380 (STA)
* AR9485 CUS198 (STA)

Obtained from:	Qualcomm Atheros, Linux ath9k
2014-09-30 03:19:29 +00:00
Ryan Stone
cf3c0c32d2 Ensure that ixl_flush() uses a defined register on VFs
In some code that is shared between the ixl(4) and ixlv(4) drivers,
a macro hard-coded a register offset that was not valid on ixlv devices.
Fix this by having each driver define a variable that contains the correct
offset.

Reviewed by:	Eric Joyner <ricera10 AT gmail.com>
MFC after:	3 days
Sponsored by:	Sandvine Inc
2014-09-29 17:51:39 +00:00
Alexander V. Chernikov
c6682d5906 Convert most BPF_TAP users to BPF_MTAP.
MFC after:	2 weeks
2014-09-28 19:05:22 +00:00
Gleb Smirnoff
bd071d4d19 - Remove empty wrappers ether_poll_[de]register_drv(). [1]
- Move polling(9) declarations out of ifq.h back to if_var.h
  they are absolutely unrelated to queues.

Submitted by:	Mikhail <mp lenta.ru> [1]
2014-09-28 14:05:18 +00:00
Hans Petter Selasky
8bf51ab563 Instead of creating the full range of possible ports, try to figure
out the actual number of so-called "embedded jacks" which are present
when a USB MIDI device is attaching.

MFC after:	3 days
2014-09-28 12:55:13 +00:00
Gleb Smirnoff
fbc4ef4ca7 Provide ixgb_get_counter(). 2014-09-28 07:40:26 +00:00
Gleb Smirnoff
058a38660e Convert to if_get_counter(). 2014-09-28 07:29:45 +00:00
Gleb Smirnoff
5fe12776aa Mechanically switch ixv(4) to if_inc_counter(). 2014-09-28 07:19:32 +00:00
Gleb Smirnoff
4b443922e0 Convert driver to if_get_counter method.
Submitted by:	rstone
Reviewed by:	Eric Joyner <ricera10 gmail.com>
2014-09-27 20:54:57 +00:00
Gleb Smirnoff
08c95c53d7 Mechanically convert to if_inc_counter(). 2014-09-27 20:43:01 +00:00
Steven Hartland
6e9a599b27 Use a local STAILQ for unlocked done CCB processing in ahci direct mode
Previously it was possible for issues e.g. use after free, to result
from processing the done queue while not holding the channel lock.

While this should never happen in practice, unexpected code flows
which result in two threads processing from the same queue may
be possible.

We now use a local STAILQ to prevent this ever being an issue.

Sponsored by:	Multiplay
2014-09-27 19:14:22 +00:00
Navdeep Parhar
e26e6373c8 cxgb(4): implement if_get_counter. 2014-09-27 18:35:16 +00:00
Alexander Kabaev
1ade5ec79a Do not pass whole descriptor block size as align to fwdma_malloc_multiseg
Do not pass wrong alignment value to fwdma_malloc_multiseg and ultimately
to contigalloc. In addition to being wrong, this causes insta-panic in
certain cases due to safety assertion - the alignment is required to be
the power of two and the value we calculate here seldom is.

MFC after:  1 month
2014-09-27 16:50:24 +00:00
Alexander Kabaev
23667f089d Remove obsolete compatibility glue and improve firewire code readability.
Commit my version of style(9) pass over the firewire code. Now that
other people have started changing the code carrying this is as a
local patch is not longer a viable option.

MFC after:	1 month
2014-09-27 16:50:21 +00:00
Navdeep Parhar
2d8910854b cxgbe(4): implement if_get_counter. 2014-09-27 05:50:31 +00:00
Navdeep Parhar
acc45299f5 cxgbe(4): explicitly set various if_hw_tso* values.
MFC after:	3 days
2014-09-26 22:21:02 +00:00
Navdeep Parhar
db25c97a1a Make sure the adapter's management queue and the event queue are
available before any uppper layer driver (TOE, iWARP, or iSCSI)
registers with the base cxgbe(4) driver.

Submitted by:	Hariprasad at chelsio dot com
Reviewed by:	np@
2014-09-26 18:53:00 +00:00
Gleb Smirnoff
0353415eb6 - Mechanically convert to if_inc_counter() the rest of counters.
- Do not set if_collisions on interrupt, read them in ti_get_counter().
- Add missing bus_dmamap_sync(BUS_DMASYNC_PREREAD) in ti_ioctl2(). [1]

Submitted by:	mav [1]
2014-09-26 10:47:57 +00:00
Gavin Atkinson
cd8d304e79 Add new (untested) device IDs to smsc(4)
MFC after:	1 week
2014-09-26 08:16:26 +00:00
John Baldwin
83e78a7f6e Merge the PC98 fdc(4) driver into the MI driver. While here, replace
the magic numbers used with NE7CMD_SPECIFY with invocations of the
NE7_SPEC_x() macros.

Approved by:	nyan
2014-09-25 20:40:24 +00:00
John Baldwin
9de2fdafa8 Lock ncr(4) and mark it MPSAFE along with various other fixes:
- Use bus_*() instead of bus_space_*().
- Use device_printf().
- Remove unused global variables and the extra warning suppression
  they required.
- Use callout() instead of timeout().

Reviewed by:	se
2014-09-25 18:43:52 +00:00
Ruslan Bukin
5d43fd685b Add driver for Synopsys DesignWare 3504-0 Universal 10/100/1000
Ethernet MAC.

Sponsored by:	DARPA, AFRL
2014-09-25 18:03:14 +00:00
Luigi Rizzo
b3d3758852 fix a panic when passing ifioctl from a netmap file descriptor to
the underlying device. This needs to be merged to 10.1

Reported by: Patrick Kelsey
MFC after:	3 days
2014-09-25 16:22:32 +00:00