Commit Graph

27793 Commits

Author SHA1 Message Date
Adrian Chadd
062cf7d90a Shut down RX before TX - in theory, this should make the chip less likely
to get upset.

The Qualcomm Atheros reference design code goes through significant
hacks to shut down RX before TX.  It doesn't even try do do it in the
driver - it actually makes the DMA stop routines in the HAL shut down
RX before shutting down TX.

So, to make this work for chips that aren't the AR9380 and later, do
it in the driver.  Shuffle the TX stop/drain HAL calls to be called
*after* the RX stop HAL call.

Tested:

* AR5413 (STA)
* AR5212 (STA)
* AR5416 (STA)
* AR9380 (STA)
* AR9331 (AP)
* AR9341 (AP)

TODO:

* test ar92xx series NIC and the AR5210/AR5211, in case there's something
  even odder about those.
2014-08-23 18:55:51 +00:00
Jean-Sébastien Pédron
5a7d2743bf ofwfb: Implement vd_bitblt_text_t
MFC after:	1 week
2014-08-23 15:05:11 +00:00
Jean-Sébastien Pédron
54927e051c creator_fb: Implement vd_bitblt_text_t
MFC after:	1 week
2014-08-23 15:04:20 +00:00
Jean-Sébastien Pédron
c285e4a5e9 vt_fb: Implement vd_bitblt_text_t for vt_fb and derivatives
MFC after:	1 week
2014-08-23 15:00:47 +00:00
Jean-Sébastien Pédron
946d0288f2 vt(4): Fix cursor handling in vt_flush()
There were situations where the cursor was not erased/redrawn or its
position was marked as dirty even though it's not displayed. The code is
now more straightforward.

At the same, add a function to determine if the cursor covers a given
area. This is used by backends to know if they need to draw the cursor.

This new function should be paired with a new state in struct vt_device,
called vd_mshown, which indicates if the cursor should be displayed.
This again simplifies vd_bitblt_text_t callback's API.

MFC after:	1 week
2014-08-23 11:46:52 +00:00
Jean-Sébastien Pédron
835ceac677 vt(4): Fix a crash in vt_mark_mouse_position_as_dirty() when in textmode
In textmode, no font is loaded, thus the page fault in
vt_mark_mouse_position_as_dirty() when it wants the font width/height.

For now, create a fake area for the textmode. This needs to be modified
if vt_vga gains mouse support in textmode.

While here, fix a build failure when SC_NO_CUTPASTE is defined:
vt_mark_mouse_position_as_dirty() must not be included in this case.

MFC after:	1 week
2014-08-23 07:41:08 +00:00
Jean-Sébastien Pédron
81788a2b59 vt_vga: Give only the character part of term_char_t to vga_get_cp437()
This fixes a bug where vga_get_cp437() was called with an invalid
argument. The screen was then filled with '?' instead of the actual
character.

MFC after:	1 week
2014-08-23 07:02:57 +00:00
Xin LI
090234abd3 Update hptnr(4) driver to version 1.0.1 supplied by the vendor.
v1.0.1 2014-8-19
  * Do not retry the command and reset the disk when failed to enable or
    disable spin up feature.
  * Fix up a bug that disk failed to probe if driver failed to access the
    10th LBA.
  * Fix a bug that request timeout but it has been completed in certain
    cases.
  * Support smartmontool for R750.

Many thanks to HighPoint for continued support of FreeBSD!

MFC after:	3 days
2014-08-23 01:52:43 +00:00
Jack F Vogel
61ae650d55 Update to the Intel Base driver for the Intel XL710 Ethernet Controller Family
- It was decided to change the driver name to if_ixl for FreeBSD
	- This release adds the VF Driver to the tree, it can be built into
	  the kernel or as the if_ixlv module
	- The VF driver is independent for the first time, this will be
	  desireable when full SRIOV capability is added to the OS.
	- Thanks to my new coworker Eric Joyner for his superb work in
	  both the core and vf driver code.

Enjoy everyone!

Submitted by:	jack.vogel@intel.com and eric.joyner@intel.com
MFC after:	3 days (hoping to make 10.1)
2014-08-22 18:59:19 +00:00
Jean-Sébastien Pédron
1f9c1db5f5 vt(4): Remove "FIXME" about multiple locking of vt_buf in vt_flush()
After some testing, it appears that acquiring the lock once and keeping
it longer is slower than taking it multiple times.

While here, fix a typo in another comment.

MFC after:	1 week
2014-08-22 17:49:24 +00:00
Jean-Sébastien Pédron
82276bbb00 vt(4): Use the actual size of the mouse when marking its position as dirty
This fixes a bug where part of the cursor was not erased.

MFC after:	1 week
2014-08-22 17:09:31 +00:00
Jean-Sébastien Pédron
523473b8f7 vt_vga: Remove a "FIXME" comment; the issue was solved in r270338
MFC after:	1 week
2014-08-22 17:05:41 +00:00
Jean-Sébastien Pédron
15c6d8f590 vt(4): Don't run vt_set_border() and vt_flush() concurrently
In the case of vt_vga, the two concurrent calls were writing to the same
VGA registers, causing incorrect refresh of the screen.

MFC after:	1 week
2014-08-22 16:30:26 +00:00
Roger Pau Monné
1e218ce964 xen: fix incorrectly accounted free
Fix some frees incorrectly assigned to M_XENBUS when the memory is
allocated with M_XENSTORE.

Sponsored by: Citrix Systems R&D
MFC after:	1 week

dev/xen/blkback/blkback.c:
 - Fix incorrect frees.
2014-08-22 15:38:21 +00:00
Jean-Sébastien Pédron
ccd5615a33 vt(4): The offset to center the text area is per-window now
The previous global offset, based on the last loaded font, had no
meaning for other windows. This caused a shifted text area, often partly
out-of-screen.

MFC after:	1 week
2014-08-22 15:36:57 +00:00
Roger Pau Monné
b740f63f23 netback: remove dead code
Remove the xen_net_read_mac function since it's not used anymore.

Sponsored by: Citrix Systems R&D
2014-08-22 15:34:56 +00:00
Jean-Sébastien Pédron
ab06c77688 vt(4): Give the window to vd_bitblt_text_t callback
... instead of both the buffer and the font. Again, this simplifies the
API.

MFC after:	1 week
2014-08-22 15:16:41 +00:00
Roger Pau Monné
1b386f626f netback: fixes for netback
This patch contains the following fixes for netback:
 - Only unbind the evtchn if it has been bound.
 - Set xnb->bridge to NULL after free to prevent double-freeing it.
 - Set the MAC address for the host-facing interface to a dummy value.

Sponsored by: Citrix Systems R&D

dev/xen/netback/netback.c:
 - Prevent trying to unbind if the evtchn has not been bounded.
 - Prevent double-freeing xnb->bridge.
 - Set the MAC address of the host-facing interface to a dummy value,
   so it can work when the interface is added to a bridge.
2014-08-22 15:10:26 +00:00
Roger Pau Monné
cd407ca216 pci: add a new pci_child_added newbus method.
This is needed so when running under Xen the calls to pci_child_added
can be intercepted and a custom Xen method can be used to register
those devices with Xen. This should not include any functional
change, since the Xen implementation will be added in a following
patch and the native implementation is a noop.

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

dev/pci/pci.c:
dev/pci/pci_if.m:
dev/pci/pci_private.h:
dev/pci/pcivar.h:
 - Add the pci_child_added newbus method.
2014-08-22 15:05:51 +00:00
Jean-Sébastien Pédron
3235c9eb55 vt(4): Store cursor bitmap & colors in struct vt_device
This removes the need to specify them to each call to vd_bitblt_text_t
and, therefore, simplifies the API.

MFC after:	1 week
2014-08-22 14:31:53 +00:00
Jean-Sébastien Pédron
e2eb041785 vt(4): Mark new mouse position as dirty only when it's actually displayed
MFC after:	1 week
2014-08-22 13:48:33 +00:00
Jean-Sébastien Pédron
37fcd2911e vt_vga: Clip the draw area to never draw offscreen
This fixes a bug when two windows use different fonts, but a longer-term
solution is required. The dirty area should be stored as pixels, not
character cells, because such coordinates don't have the same meaning in
all windows, when using different fonts.

MFC after:	1 week
2014-08-22 10:49:51 +00:00
Jean-Sébastien Pédron
bdcaf97c3e vt(4): Add new vd_bitblt_text_t callback, and implement it for vt_vga
Compared to the deprecated vd_bitbltchr_t callback, vd_bitblt_text_t
receives:
    o  the whole text buffer
    o  the dirty area
    o  the mouse cursor (map, position, colors)

This allows the backend to perform optimization on how to draw things.
The goal is to remove vd_bitbltchr_t and vd_putchar_t, once all driver
are converted (only vt_vga is included in this commit).

In vt_vga, this allows to draw the text and the cursor in one pass,
without ever reading from video memory (because it has all the context).
The main benefit is the speed improvement: no more slideshow during
boot!

Other bugs fixed in vt_vga are:
    o  left-most characters are drawn properly (the left-most pixels were
       missing with bold characters and some wide letters such as 'm')
    o  no more black square around the cursor
    o  no cursor flickering when the text is scrolling

There are still many problems to fix: the known issues are marked with
"FIXME" inside the code.

MFC after:	1 week
2014-08-22 08:22:40 +00:00
Jean-Sébastien Pédron
0c1c6af438 vt_vga: When clearing video memory, don't read from it
The goal is to clear the video memory, in case an application drew to
it. So the content shouldn't be loaded in the latches, it can't be
trusted anyway.

This improves a bit the window switch speed.

MFC after:	1 week
2014-08-21 20:10:05 +00:00
Jean-Sébastien Pédron
02ebdd502d vt(4): Rename the "mouse_cursor" structure to "vt_mouse_cursor"
At the same time, "w" and "h" members are now called "width" and
"height". The goal is to have a more "public" structure, because it will
soon be passed as argument to a new callback, replacing vd_bitbltchr_t.

MFC after:	1 week
2014-08-21 19:42:24 +00:00
Jean-Sébastien Pédron
943c702a1b vt(4): Test if the cursor is shown only once
Later, we just see if the "struct mouse_cursor" pointer is set. This
avoids the need to mess with all the conditions several times; this has
been error prone.

While here, rename the variable "m" to a more meaningful "cursor", like
it's done elsewhere in the code.

MFC after:	1 week
2014-08-21 19:15:22 +00:00
Jean-Sébastien Pédron
c6e1a98786 vt(4): Constify vt_buf argument of vtbuf_iscursor()
MFC after:	1 week
2014-08-21 18:26:32 +00:00
Edward Tomasz Napierala
ddc5fd903d Use proper include paths in kernel iSCSI code.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-08-21 16:08:17 +00:00
Jean-Sébastien Pédron
52ff33d967 vt(4): Pause the flush timer while swithing window
This fixes bad looking refresh when switching window: squares instead
of text, flashing screen, and so on. In the worst case, vt_flush() came
at a very inappropriate timing and the screen was not refreshed at all
(leaving squares all over the place).

This doesn't fix the flickering of the screen with vt_vga, because the
sync signal is temporarily stopped and the video memory is cleared.

MFC after:	1 week
2014-08-21 15:55:18 +00:00
Edward Tomasz Napierala
b7a65e3936 Make the iSCSI stack use __FBSDID() properly.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-08-21 15:32:38 +00:00
Jean-Sébastien Pédron
353ad09fad vt(4): Mark cursor position as dirty when we enable/disable it
MFC after:	1 week
2014-08-21 15:14:54 +00:00
Jean-Sébastien Pédron
7e6dfdd6e5 vt(4): Mark the current cursor position as dirty
Like r270273, this has no effect for now, because the cursor is always
drawn. This is in preparation of future changes to vd_bitbltchr_t API.

MFC after:	1 week
2014-08-21 15:00:21 +00:00
Jean-Sébastien Pédron
608b7ceace vt(4): If the cursor didn't move, don't mark its position as dirty
Currently, this has no effect, because the cursor is always redrawn
anyway. But this will be useful after improvements to the vd_bitbltchr_t
callback API.

The vt_device structure members used to store the position of the cursor
as of the last redraw are renamed from vd_mdirty{x,y} to vd_mold{x,y}.
The associated comment is fixed too. Also, their value is now expressed
in pixels, not in character columns/row.

MFC after:	1 week
2014-08-21 14:54:37 +00:00
Jean-Sébastien Pédron
e861fb376a vt(4): If the cursor is globally disabled, don't mark its position as dirty
This avoids unnecessary redraw. In particular, during boot, where the
cursor is disabled and its fake position is [0;0], this triggered a
refresh of the whole screen each time vt_flush() is called.

MFC after:	1 week
2014-08-21 14:12:11 +00:00
Jean-Sébastien Pédron
c5dabe0780 vt(4): Mark cursor old position as dirty before reading the dirty area
Otherwise, the redraw is done during the next vt_flush run.

MFC after:	1 week
2014-08-21 13:28:48 +00:00
Jean-Sébastien Pédron
c4ad232a03 vt(4): Handle global and per-window mouse cursor toggle in one place
Before the global flag was set/unset using the CONS_MOUSECTL ioctl, and
the per-window flag through the MOUSE_SETLEVEL or MOUSE_SETMODE ioctls.

Also, if the cursor is already enabled/disabled, return immediatly. This
avoids to reset the cursor's position to the center of the screen.

This matches syscons' behavior.

While here, remove a trailing space and a redundant variable
declaration.
2014-08-21 13:04:34 +00:00
Jean-Sébastien Pédron
a5d099afa9 vt(4): Fix an inconsistency between the mouse cursor bitmap and its mask
MFC after:	1 week
2014-08-21 10:54:39 +00:00
Adrian Chadd
f8cdacdd18 Add missing locking.
Whilst here, assert that the lock is held when calling epstop().

Tested:

ep0: <3com Megahertz 574B>
2014-08-21 00:57:32 +00:00
Navdeep Parhar
9721a22d4a Change netmap's global lock to sx instead of a mutex.
Reviewed by:	luigi@
MFC after:	1 day
2014-08-20 23:37:44 +00:00
John Baldwin
669eac89c5 Fix build of si(4) and enable it in LINT on amd64 and i386. 2014-08-20 16:07:17 +00:00
Roger Pau Monné
073bf9dd70 pci: make MSI(-X) enable and disable methods of the PCI bus
Make the functions pci_disable_msi, pci_enable_msi and pci_enable_msix
methods of the newbus PCI bus. This code should not include any
functional change.

Sponsored by: Citrix Systems R&D
Reviewed by: imp, jhb
Differential Revision: https://reviews.freebsd.org/D354

dev/pci/pci.c:
 - Convert the mentioned functions to newbus methods.
 - Fix the callers of the converted functions.

sys/dev/pci/pci_private.h:
dev/pci/pci_if.m:
 - Declare the new methods.

dev/pci/pcivar.h:
 - Add helpers to call the newbus methods.

ofed/include/linux/pci.h:
 - Add define to prevent the ofed version of pci_enable_msix from
   clashing with the FreeBSD native version.
2014-08-20 14:57:20 +00:00
Kevin Lo
51a25d3479 If eapol packets are sent at the lowest rate, key negotiation will
become more reliable.

Submitted by:	Akinori Furukoshi <moonlightakkiy at yahoo dot ca>
2014-08-20 01:32:04 +00:00
Kevin Lo
d4bcd25553 Add the D-Link DWA-125 rev D1.
Tested by myself.
2014-08-20 01:26:27 +00:00
Kevin Lo
7e1c22c476 Sort ASUS section and add USB device ID of ASUS USB-AC51. 2014-08-19 09:02:58 +00:00
Hans Petter Selasky
f09566d3bd Use the "bSubslotSize" and "bSubFrameSize" fields to obtain the actual
sample size. According to the USB audio frame format specification
from USB.org, the value in the "bBitResolution" field can be less than
the actual sample size, depending on the actual hardware, and should
not be used for this computation.

PR:		192755
MFC after:	1 week
2014-08-18 14:30:43 +00:00
Luigi Rizzo
1460a86867 staticize two functions, and use proper format for a struct sglist
(reported by bz)
2014-08-17 10:25:27 +00:00
Luigi Rizzo
4bf50f18eb Update to the current version of netmap.
Mostly bugfixes or features developed in the past 6 months,
so this is a 10.1 candidate.

Basically no user API changes (some bugfixes in sys/net/netmap_user.h).

In detail:

1. netmap support for virtio-net, including in netmap mode.
  Under bhyve and with a netmap backend [2] we reach over 1Mpps
  with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode.

2. (kernel) add support for multiple memory allocators, so we can
  better partition physical and virtual interfaces giving access
  to separate users. The most visible effect is one additional
  argument to the various kernel functions to compute buffer
  addresses. All netmap-supported drivers are affected, but changes
  are mechanical and trivial

3. (kernel) simplify the prototype for *txsync() and *rxsync()
  driver methods. All netmap drivers affected, changes mostly mechanical.

4. add support for netmap-monitor ports. Think of it as a mirroring
  port on a physical switch: a netmap monitor port replicates traffic
  present on the main port. Restrictions apply. Drive carefully.

5. if_lem.c: support for various paravirtualization features,
  experimental and disabled by default.
  Most of these are described in our ANCS'13 paper [1].
  Paravirtualized support in netmap mode is new, and beats the
  numbers in the paper by a large factor (under qemu-kvm,
  we measured gues-host throughput up to 10-12 Mpps).

A lot of refactoring and additional documentation in the files
in sys/dev/netmap, but apart from #2 and #3 above, almost nothing
of this stuff is visible to other kernel parts.

Example programs in tools/tools/netmap have been updated with bugfixes
and to support more of the existing features.

This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline.

A lot of this code has been contributed by my colleagues at UNIPI,
including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella.

MFC after:	3 days.
2014-08-16 15:00:01 +00:00
Luigi Rizzo
a5b6123ea9 print additional debugging info in virtqueue_dump()
(not fundamental, but useful to debug performance issues on vtnet)

MFC after:	3 days
2014-08-16 13:13:17 +00:00
Warner Losh
d628fa28fa Delete pp_isadma. It isn't use, and the code that used it has been
commented out (temporarily) since 1998 when this driver hit the
tree. Also, no need to compute the ethernet header and then never use
it.
2014-08-14 16:01:38 +00:00
Steven Hartland
d7b5bae512 Renamed hw.ixgbe.unsupported_sfp -> hw.ix.unsupported_sfp
This now matches all other ixgbe sysctl / tunables.

Sponsored by:	Multiplay
2014-08-14 13:25:05 +00:00