]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoDon't fail on executable maps that return no entries. This turns useless
trasz [Sat, 23 Aug 2014 11:51:46 +0000 (11:51 +0000)]
Don't fail on executable maps that return no entries.  This turns useless
error message into useful one.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agovt(4): Fix cursor handling in vt_flush()
dumbbell [Sat, 23 Aug 2014 11:46:52 +0000 (11:46 +0000)]
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

9 years agoAutofs softc needs to be global anyway, so don't pass it as a local
trasz [Sat, 23 Aug 2014 11:45:14 +0000 (11:45 +0000)]
Autofs softc needs to be global anyway, so don't pass it as a local
variable, and don't store in autofs_mount.  Also rename it from 'sc'
to 'autofs_softc', since it's global and extern.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agoAdd comment explaining one of the quirks in autofs.
trasz [Sat, 23 Aug 2014 11:38:31 +0000 (11:38 +0000)]
Add comment explaining one of the quirks in autofs.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agoAdd support for /etc/rc.conf.d/<service> subdirectories. This is
des [Sat, 23 Aug 2014 10:51:37 +0000 (10:51 +0000)]
Add support for /etc/rc.conf.d/<service> subdirectories.  This is
particularly useful for services such as "network" (netif) where each
interface can now have its own separate configuration file.
Add /etc/rc.conf.d to the mtree file so it is always present.

MFC after: 3 days

9 years agoSetting rc_debug explicitly in /etc/defaults/rc.conf defeats its purpose.
des [Sat, 23 Aug 2014 10:49:02 +0000 (10:49 +0000)]
Setting rc_debug explicitly in /etc/defaults/rc.conf defeats its purpose.

MFC after: 3 days

9 years agovt(4): Fix a crash in vt_mark_mouse_position_as_dirty() when in textmode
dumbbell [Sat, 23 Aug 2014 07:41:08 +0000 (07:41 +0000)]
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

9 years agovt_vga: Give only the character part of term_char_t to vga_get_cp437()
dumbbell [Sat, 23 Aug 2014 07:02:57 +0000 (07:02 +0000)]
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

9 years agoRelax one of the conditions for mapping a page on the fast path.
alc [Sat, 23 Aug 2014 05:24:31 +0000 (05:24 +0000)]
Relax one of the conditions for mapping a page on the fast path.

Reviewed by: kib
X-MFC with: r270011
Sponsored by: EMC / Isilon Storage Division

9 years agoUpdate hptnr(4) driver to version 1.0.1 supplied by the vendor.
delphij [Sat, 23 Aug 2014 01:52:43 +0000 (01:52 +0000)]
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

9 years agoInstead of using timestamp in the AVL, use the memory address when
delphij [Fri, 22 Aug 2014 23:13:53 +0000 (23:13 +0000)]
Instead of using timestamp in the AVL, use the memory address when
comparing.

Illumos issue:
    5095 panic when adding a duplicate dbuf to dn_dbufs

MFC after: 3 days

9 years agoMFV r270197:
delphij [Fri, 22 Aug 2014 22:13:36 +0000 (22:13 +0000)]
MFV r270197:

Illumos issue:
    5066 remove support for non-ANSI compilation
    5068 Remove SCCSID() macro from <macros.h>

MFC after: 2 weeks

9 years agoMake DTrace stuff compile with C99 standard.
delphij [Fri, 22 Aug 2014 20:04:51 +0000 (20:04 +0000)]
Make DTrace stuff compile with C99 standard.

9 years agoSuppress warnings when retrieving protocol stats from interfaces that
markj [Fri, 22 Aug 2014 19:23:38 +0000 (19:23 +0000)]
Suppress warnings when retrieving protocol stats from interfaces that
don't support IPv6 (e.g. pflog(4)).

Reviewed by: hrs
MFC after: 2 weeks

9 years agoAdd some missing checks for unsupported interfaces (e.g. pflog(4)) when
markj [Fri, 22 Aug 2014 19:21:08 +0000 (19:21 +0000)]
Add some missing checks for unsupported interfaces (e.g. pflog(4)) when
handling ioctls. While here, remove duplicated checks for a NULL ifp in
in6_control(): this check is already done near the beginning of the
function.

PR: 189117
Reviewed by: hrs
MFC after: 2 weeks

9 years agoRestore historical behavior of in_control, which, when no matching address
delphij [Fri, 22 Aug 2014 19:08:12 +0000 (19:08 +0000)]
Restore historical behavior of in_control, which, when no matching address
is found, the first usable address is returned for legacy ioctls like
SIOCGIFBRDADDR, SIOCGIFDSTADDR, SIOCGIFNETMASK and SIOCGIFADDR.

While there also fix a subtle issue that a caller from a jail asking for
INADDR_ANY may get the first IP of the host that do not belong to the jail.

Submitted by: glebius
Differential Revision: https://reviews.freebsd.org/D667

9 years agoUpdate to the Intel Base driver for the Intel XL710 Ethernet Controller Family
jfv [Fri, 22 Aug 2014 18:59:19 +0000 (18:59 +0000)]
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)

9 years agoIn do_lock_pi(), do not override error from umtxq_sleep_pi() when
kib [Fri, 22 Aug 2014 18:42:14 +0000 (18:42 +0000)]
In do_lock_pi(), do not override error from umtxq_sleep_pi() when
doing suspend check.  This restores the pre-r251684 behaviour, to
retry once after the signal is detected.

PR: kern/192918
Submitted by: Elliott Rabe, Dell Inc., Eric van Gyzen <eric@vangyzen.net>
Obtained from: Dell Inc.
MFC after: 1 week

9 years agovt(4): Remove "FIXME" about multiple locking of vt_buf in vt_flush()
dumbbell [Fri, 22 Aug 2014 17:49:24 +0000 (17:49 +0000)]
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

9 years agovt(4): Use the actual size of the mouse when marking its position as dirty
dumbbell [Fri, 22 Aug 2014 17:09:31 +0000 (17:09 +0000)]
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

9 years agovt_vga: Remove a "FIXME" comment; the issue was solved in r270338
dumbbell [Fri, 22 Aug 2014 17:05:41 +0000 (17:05 +0000)]
vt_vga: Remove a "FIXME" comment; the issue was solved in r270338

MFC after: 1 week

9 years agovt(4): Don't run vt_set_border() and vt_flush() concurrently
dumbbell [Fri, 22 Aug 2014 16:30:26 +0000 (16:30 +0000)]
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

9 years agoxen: fix incorrectly accounted free
royger [Fri, 22 Aug 2014 15:38:21 +0000 (15:38 +0000)]
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.

9 years agovt(4): The offset to center the text area is per-window now
dumbbell [Fri, 22 Aug 2014 15:36:57 +0000 (15:36 +0000)]
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

9 years agonetback: remove dead code
royger [Fri, 22 Aug 2014 15:34:56 +0000 (15:34 +0000)]
netback: remove dead code

Remove the xen_net_read_mac function since it's not used anymore.

Sponsored by: Citrix Systems R&D

9 years agovt(4): Give the window to vd_bitblt_text_t callback
dumbbell [Fri, 22 Aug 2014 15:16:41 +0000 (15:16 +0000)]
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

9 years agonetback: fixes for netback
royger [Fri, 22 Aug 2014 15:10:26 +0000 (15:10 +0000)]
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.

9 years agopci: add a new pci_child_added newbus method.
royger [Fri, 22 Aug 2014 15:05:51 +0000 (15:05 +0000)]
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.

9 years agovt(4): Store cursor bitmap & colors in struct vt_device
dumbbell [Fri, 22 Aug 2014 14:31:53 +0000 (14:31 +0000)]
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

9 years agovt(4): Mark new mouse position as dirty only when it's actually displayed
dumbbell [Fri, 22 Aug 2014 13:48:33 +0000 (13:48 +0000)]
vt(4): Mark new mouse position as dirty only when it's actually displayed

MFC after: 1 week

9 years agoWe should never enter the PROBE_SETAN phase if we're not ATAPI, since
imp [Fri, 22 Aug 2014 13:15:59 +0000 (13:15 +0000)]
We should never enter the PROBE_SETAN phase if we're not ATAPI, since
that's ATAPI specific. Instead, skip to PROBE_SET_MULTI instead for
non ATAPI protocols. The prior code incorrectly terminated the probe
with a break, rather than arranging for probedone to get called. This
caused panics or worse on some systems.

9 years agoFix a recursive lock acquisition in vi_reset_dev().
tychon [Fri, 22 Aug 2014 13:01:22 +0000 (13:01 +0000)]
Fix a recursive lock acquisition in vi_reset_dev().

Reviewed by: grehan

9 years agovt_vga: Clip the draw area to never draw offscreen
dumbbell [Fri, 22 Aug 2014 10:49:51 +0000 (10:49 +0000)]
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

9 years agovt(4): Add new vd_bitblt_text_t callback, and implement it for vt_vga
dumbbell [Fri, 22 Aug 2014 08:22:40 +0000 (08:22 +0000)]
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

9 years agoEnsure that sigaction flags for signal, which disposition is reset to
kib [Fri, 22 Aug 2014 08:19:08 +0000 (08:19 +0000)]
Ensure that sigaction flags for signal, which disposition is reset to
ignored or default, are not leaking.  Apparently, there exists code
which relies on SA_SIGINFO not reported for SIG_DFL or SIG_IGN.

In kern_sigaction, ignore flags when resetting.  Encapsulate the flag
and disposition testing into helper sigact_flag_test().

On exec, and when delivering signal with SA_RESETHAND flag set,
signals are reset automatically.  Use new helper sigdflt(), which
removes duplicated code and corrects all flag bits for the signal.

For proc0, set sigintr bit for all ignored signals.  Ignored signals
are consumed in tdsendsignal() and not delivered to the victim thread
at all.

Reported and tested by: royger
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoCheck the validity of struct sigaction sa_flags value, reject unknown
kib [Fri, 22 Aug 2014 07:52:47 +0000 (07:52 +0000)]
Check the validity of struct sigaction sa_flags value, reject unknown
flags.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoFix a panic which occurs in a VIMAGE-enabled kernel after r270158, and
hrs [Fri, 22 Aug 2014 05:03:30 +0000 (05:03 +0000)]
Fix a panic which occurs in a VIMAGE-enabled kernel after r270158, and
separate socket_hhook_register() part and put it into VNET_SYS{,UN}INIT()
handler.

Discussed with: marcel

9 years agoFix powerpc build:
delphij [Fri, 22 Aug 2014 01:23:38 +0000 (01:23 +0000)]
Fix powerpc build:

Chase r270227 and compile lockstat with C99 standard.

Suggested by: bde

9 years agoInclude two headers to provide prototype for modfind(2) and kldload(2).
delphij [Thu, 21 Aug 2014 22:53:14 +0000 (22:53 +0000)]
Include two headers to provide prototype for modfind(2) and kldload(2).

MFC after: 2 weeks

9 years agoThis module requires pci_if.h, add it to the SRCS list.
ian [Thu, 21 Aug 2014 22:42:02 +0000 (22:42 +0000)]
This module requires pci_if.h, add it to the SRCS list.

We haven't noticed that it was missing because eisa has been disabled for
a while in -current, but it became apparent when some parallel-build stuff
was MFC'd to 10-stable and this module failed to build there.

9 years agoAdd the Samsung 843T as a 4k enabled drive
sbruno [Thu, 21 Aug 2014 21:05:58 +0000 (21:05 +0000)]
Add the Samsung 843T as a 4k enabled drive

Submitted by: Jason Wolfe <jason@llnw.com>
MFC after: 2 weeks
Sponsored by: Limelight Networks

9 years agoelfdump: Remove extraneous _SUNW_ in reported DT_ names
emaste [Thu, 21 Aug 2014 20:58:43 +0000 (20:58 +0000)]
elfdump: Remove extraneous _SUNW_ in reported DT_ names

Sponsored by: The FreeBSD Foundation

9 years agoRename DT_FEATURE_1 to DT_FEATURE
emaste [Thu, 21 Aug 2014 20:55:10 +0000 (20:55 +0000)]
Rename DT_FEATURE_1 to DT_FEATURE

This provides a minor cleanup in elfdump; there are otherwise no
consumers in the tree.  Old SUN documentation can be found for either
variant, but GNU binutils switched to DT_FEATURE around 2000.

Sponsored by: The FreeBSD Foundation

9 years agoModify a few output file names as used with vt.
se [Thu, 21 Aug 2014 20:35:39 +0000 (20:35 +0000)]
Modify a few output file names as used with vt.

MFC after: 3 days

9 years agoNext round of fixes.
se [Thu, 21 Aug 2014 20:33:09 +0000 (20:33 +0000)]
Next round of fixes.

MFC after: 3 days

9 years agovt_vga: When clearing video memory, don't read from it
dumbbell [Thu, 21 Aug 2014 20:10:05 +0000 (20:10 +0000)]
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

9 years agovt(4): Rename the "mouse_cursor" structure to "vt_mouse_cursor"
dumbbell [Thu, 21 Aug 2014 19:42:24 +0000 (19:42 +0000)]
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

9 years agovt(4): Test if the cursor is shown only once
dumbbell [Thu, 21 Aug 2014 19:15:22 +0000 (19:15 +0000)]
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

9 years agoChange file permissions for some setuid executables so they are "o+r".
neel [Thu, 21 Aug 2014 19:04:15 +0000 (19:04 +0000)]
Change file permissions for some setuid executables so they are "o+r".
The executable itself doesn't contain any privileged information.

An example of where this is useful is when makefs(8) is creating an image
that includes /sbin/shutdown. This can now be done without root privileges.

Reviewed by: delphij
Discussed with: delphij, des
CR: https://reviews.freebsd.org/D662

9 years agovt(4): Constify vt_buf argument of vtbuf_iscursor()
dumbbell [Thu, 21 Aug 2014 18:26:32 +0000 (18:26 +0000)]
vt(4): Constify vt_buf argument of vtbuf_iscursor()

MFC after: 1 week

9 years ago* Add new net/sff8436.h containing constants used to access
melifaro [Thu, 21 Aug 2014 17:54:42 +0000 (17:54 +0000)]
* Add new net/sff8436.h containing constants used to access
  QSFP+ data via i2c inteface. These constants has been taken
  from SFF-8436 "QSFP+ 10 Gbs 4X PLUGGABLE TRANSCEIVER" standard
  rev 4.8.
* Add support for printing QSFP+ information from 40G NICs
  such as Chelsio T5.

This commit does not contain ioctl changes necessary for this
functionality work, there will be another commit soon.

Example:
cxl1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=ec07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,.....>
        ether 00:07:43:28:ad:08
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet 40Gbase-LR4 <full-duplex>
        status: active
        plugged: QSFP+ 40GBASE-LR4 (MPO Parallel Optic)
        vendor: OEM PN: OP-QSFP-40G-LR4 SN: 20140318001 DATE: 2014-03-18
        module temperature: 64.06 C voltage: 3.26 Volts
        lane 1: RX: 0.47 mW (-3.21 dBm) TX: 2.78 mW (4.46 dBm)
        lane 2: RX: 0.20 mW (-6.94 dBm) TX: 2.80 mW (4.47 dBm)
        lane 3: RX: 0.18 mW (-7.38 dBm) TX: 2.79 mW (4.47 dBm)
        lane 4: RX: 0.90 mW (-0.45 dBm) TX: 2.80 mW (4.48 dBm)

Tested on: Chelsio T5
Tested on: Mellanox/Huawei passive/active cables/transceivers.
MFC after: 2 weeks
Sponsored by: Yandex LLC

9 years agoAdd `-A' flag to pkg-install(8) invocation when installing dependencies.
dteske [Thu, 21 Aug 2014 17:15:09 +0000 (17:15 +0000)]
Add `-A' flag to pkg-install(8) invocation when installing dependencies.

MFC after: 3 days
X-MFC-to: stable/10, stable/9
Reported by: gjb
Discussed with: jelischer, gjb, bdrewery

9 years agoUse proper include paths in kernel iSCSI code.
trasz [Thu, 21 Aug 2014 16:08:17 +0000 (16:08 +0000)]
Use proper include paths in kernel iSCSI code.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agoFix includes.
trasz [Thu, 21 Aug 2014 15:59:25 +0000 (15:59 +0000)]
Fix includes.

Suggested by: pluknet@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agovt(4): Pause the flush timer while swithing window
dumbbell [Thu, 21 Aug 2014 15:55:18 +0000 (15:55 +0000)]
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

9 years agoMake the iSCSI stack use __FBSDID() properly.
trasz [Thu, 21 Aug 2014 15:32:38 +0000 (15:32 +0000)]
Make the iSCSI stack use __FBSDID() properly.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agovt(4): Mark cursor position as dirty when we enable/disable it
dumbbell [Thu, 21 Aug 2014 15:14:54 +0000 (15:14 +0000)]
vt(4): Mark cursor position as dirty when we enable/disable it

MFC after: 1 week

9 years agoAdd guards to ptrdiff_t definition in include/stddef.h
kan [Thu, 21 Aug 2014 15:10:10 +0000 (15:10 +0000)]
Add guards to ptrdiff_t definition in include/stddef.h

Back in 2011 obrien has added the #define macro in sys/sys/stddef.h to
guard ptrdiff_t. Add similar protection to the identical code in
include/stddef.h.

Submitted by:   Mariusz Zaborski <oshogbo@FreeBSD.org>
MFC after:      1 week

9 years agoUse __FBSDID() properly.
trasz [Thu, 21 Aug 2014 15:07:25 +0000 (15:07 +0000)]
Use __FBSDID() properly.

Suggested by: pluknet@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agovt(4): Mark the current cursor position as dirty
dumbbell [Thu, 21 Aug 2014 15:00:21 +0000 (15:00 +0000)]
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

9 years agovt(4): If the cursor didn't move, don't mark its position as dirty
dumbbell [Thu, 21 Aug 2014 14:54:37 +0000 (14:54 +0000)]
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

9 years agovt(4): If the cursor is globally disabled, don't mark its position as dirty
dumbbell [Thu, 21 Aug 2014 14:12:11 +0000 (14:12 +0000)]
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

9 years agovt(4): Mark cursor old position as dirty before reading the dirty area
dumbbell [Thu, 21 Aug 2014 13:28:48 +0000 (13:28 +0000)]
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

9 years agovt(4): Handle global and per-window mouse cursor toggle in one place
dumbbell [Thu, 21 Aug 2014 13:04:34 +0000 (13:04 +0000)]
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.

9 years agoDocument MAC address selection and setting for atse(4).
bz [Thu, 21 Aug 2014 12:50:11 +0000 (12:50 +0000)]
Document MAC address selection and setting for atse(4).

Submitted by: brooks
MFC after: 3 days
Sponsored by: DARPA/AFRL

9 years agovt(4): Fix an inconsistency between the mouse cursor bitmap and its mask
dumbbell [Thu, 21 Aug 2014 10:54:39 +0000 (10:54 +0000)]
vt(4): Fix an inconsistency between the mouse cursor bitmap and its mask

MFC after: 1 week

9 years agoRevert r270227. GCC doesn't like the lack of LL suffix,
davide [Thu, 21 Aug 2014 09:01:42 +0000 (09:01 +0000)]
Revert r270227. GCC doesn't like the lack of LL suffix,
so this makes powerpc build failing.

9 years agoProvide compatibility shim for atomic_dec_64_nv.
delphij [Thu, 21 Aug 2014 08:25:46 +0000 (08:25 +0000)]
Provide compatibility shim for atomic_dec_64_nv.

X-MFC-with: r270247
MFC after: 13 days

9 years agoAdd a missing brace to callout_init_rm() to fix syntax.
gavin [Thu, 21 Aug 2014 07:52:51 +0000 (07:52 +0000)]
Add a missing brace to callout_init_rm() to fix syntax.

MFC after: 1 week

9 years agoAlways check the limits of array index variables before using them.
pfg [Thu, 21 Aug 2014 02:40:33 +0000 (02:40 +0000)]
Always check the limits of array index variables before using them.

Obtained from: DragonFlyBSD
MFC after: 1 week

9 years agoAdd missing locking.
adrian [Thu, 21 Aug 2014 00:57:32 +0000 (00:57 +0000)]
Add missing locking.

Whilst here, assert that the lock is held when calling epstop().

Tested:

ep0: <3com Megahertz 574B>

9 years agoChange netmap's global lock to sx instead of a mutex.
np [Wed, 20 Aug 2014 23:37:44 +0000 (23:37 +0000)]
Change netmap's global lock to sx instead of a mutex.

Reviewed by: luigi@
MFC after: 1 day

9 years agoFix return type of callout_init_rm() and add return type to
gavin [Wed, 20 Aug 2014 23:29:34 +0000 (23:29 +0000)]
Fix return type of callout_init_rm() and add return type to
callout_deactivate().

PR: 192520
Submitted by: yaneurabeya gmail com
MFC after: 3 days

9 years agoTurns out that IDENTIFY DEVICE and IDENTIFY PACKET DEVICE return data
imp [Wed, 20 Aug 2014 22:58:12 +0000 (22:58 +0000)]
Turns out that IDENTIFY DEVICE and IDENTIFY PACKET DEVICE return data
that's only mostly similar. Specifically word 78 bits are defined for
IDENTIFY DEVICE as
5 Supports Hardware Feature Control
while a IDENTIFY PACKET DEVICE defines them as
5 Asynchronous notification supported
Therefore, only pay attention to bit 5 when we're talking to ATAPI
devices (we don't use the hardware feature control at this time).
Ignore it for ATA devices. Remove kludge that papered over this issue
for Samsung SATA SSDs, since Micron drives also have the bit set and
the error was caused by this bad interpretation of the spec (which is
quite easy to do, since bits aren't normally overlapping like this).

9 years agoMFV r270196:
delphij [Wed, 20 Aug 2014 22:39:26 +0000 (22:39 +0000)]
MFV r270196:

Illumos issue:
    5047 don't use atomic_*_nv if you discard the return value

MFC after: 2 weeks

9 years agoMFC r270195:
delphij [Wed, 20 Aug 2014 21:44:48 +0000 (21:44 +0000)]
MFC r270195:

Illumos issue:
    5045 use atomic_{inc,dec}_* instead of atomic_add_*

MFC after: 2 weeks

9 years agosh: Remove two redundant (uintmax_t) casts.
jilles [Wed, 20 Aug 2014 20:15:43 +0000 (20:15 +0000)]
sh: Remove two redundant (uintmax_t) casts.

Submitted by: jmallett

9 years agoMFV r270193:
delphij [Wed, 20 Aug 2014 18:29:18 +0000 (18:29 +0000)]
MFV r270193:

Illumos issues:
    5042 stop using deprecated atomic functions

MFC after: 2 weeks

9 years agoRecover sin6_scope_id of gateway addresses in riprecv() by using the if_index
hrs [Wed, 20 Aug 2014 17:27:15 +0000 (17:27 +0000)]
Recover sin6_scope_id of gateway addresses in riprecv() by using the if_index
where a RIP packet was received.  This fixes a bug which prevented gateway
addresses in fe80::/64 from being added.

9 years agoThe conversion tools have been further improved and some erroneous
se [Wed, 20 Aug 2014 17:07:41 +0000 (17:07 +0000)]
The conversion tools have been further improved and some erroneous
conversions have been detected and fixed.

It is now possible to add options after the encoding in the parameter
list for convert-keymap.pl. This is currently used to selectively
enable interpretation of the ISO8859-1 currency symbol as the Euro
sign found in ISO5589-15, or to add a Yen symbol in place of '\' for
specific Japanese keyboards. The option are appended to the parameter
list, as in e.g. "convert-keymap.pl german.iso.kbd ISO5589-1 EURO".

The options are appended to the encoding in the form "+EURO" or "+YEN"
in KBDFILES.map, to keep the meaning of the columns intact.

MFC after: 3 days

9 years agoMisc fixes suggested by Coverity.
asomers [Wed, 20 Aug 2014 17:04:49 +0000 (17:04 +0000)]
Misc fixes suggested by Coverity.

sbin/devd/tests/client_test.c
* In the event that popen fails, don't dereference its return value.
* Fix array overwrite in the stream and seqpacket tests.
* Close sockets at the end of successful ATF tests.

Reported by: Coverity scan
CID: 1232019123202012320291232030
MFC after: 1 week
Sponsored by: Spectra Logic

9 years agoRewrite of ti_i2c based on gonzo's patch, fix the following bugs/problems:
loos [Wed, 20 Aug 2014 17:02:37 +0000 (17:02 +0000)]
Rewrite of ti_i2c based on gonzo's patch, fix the following bugs/problems:

  . interrupt storm detected on "intr70:"; throttling interrupt source;

  . Added access serialization on iicbus_transfer(), previously there was
    no such protection and a new transfer could easily confuse the
    controller;

  . Add error checkings (i.e. stop the transfer when a error is detected
    and do _not_ overwrite the previous error);

  . On command done interrupt do not assume that the transfer was finished
    sucessfully as we will receive the command done interrupt even after
    errors;

  . Simplify the FIFO handling;

  . Reset the FIFO between the transfers as the FIFO may contain data from
    the last (failed) transfer;

  . Fix the iicbus speed for AM335x, which in turn will make better use of
    the I2C noise filter (set to one internal clock cycle);

  . Move the read and write handler to ithread instead of notifying the
    requesting thread with wakeup(9);

  . Fix the comments based on OMAP4 TRM.

The above changes allows me to read the EDID from my HDMI monitor on BBB
with gonzo's patches to support TDA19988 (which does 128 bytes reads) and
repeatedly scan the iicbus (with a modified i2c(8)) without lock up the bus.

Phabric: D465

9 years agoAnother rpund of fixes, after checking keymaps for plausibility and with
se [Wed, 20 Aug 2014 17:00:47 +0000 (17:00 +0000)]
Another rpund of fixes, after checking keymaps for plausibility and with
several updates to the converter tools. There is now support for hybrid
source keymaps, which e.g. use ISO8859-1 (not -15) but still provide an
Euro key (on the "E" key). ISO8859-1 currency symbols on other keys are
still converted to that character, not the Euro sign. A similar hack was
applied to the Japanese keyboards to add the Yen key, that could not be
expressed in SYSCONS.

Several modifications have been applied after the conversion (removal of
unused accents tables, some reformatting, exchange of a few key symbols).

The German keymap (de.kbd) is now using deadkeys only for those keys,
that behave that way under Windows. There are now ".acc" and ".noacc"
variants, which use deadkeys vs. nodeadkeys for all accent keys.

I'm still in the process of comparing keymaps that existed in different
encodings in SYSCONS. These are generally translated slightly differently,
either because of mistakes, or because of different preferences, or due
to limitations of the respective encoding.

MFC after: 3 days

9 years agoNumerous small fixes, mostly suggested by Coverity.
asomers [Wed, 20 Aug 2014 16:59:33 +0000 (16:59 +0000)]
Numerous small fixes, mostly suggested by Coverity.

tests/sys/kern/unix_seqpacket_test.c
* Remove a duplicate error check in mk_pair_of_sockets
* Always close sockets in the success path of ATF test cases.  Don't
  bother with the error paths, because those are mostly assertions
  anyway.  Most of these socket leaks were reported by Coverity.
  All of them are harmless, because each ATF test case runs in its
  own process.
* Fix the len argument to send in shutdown_send and
  shutdown_send_sigpipe.  The old version was using sizeof a pointer
  instead of sizeof the char array.  Reported by Coverity.
* Change a few ATF_CHECK to ATF_REQUIRE if the test can't reasonably
  continue past a failure.

Reported by: Coverity Scan
CID: 122999512299911229988122999412299891229992
CID: 122999312299901229984122996712300051229977
CID: 122996612300041229976
MFC after: 1 week
Sponsored by: Spectra Logic

9 years agoMake Bruce happy removing the "LL abomination" from time.h
davide [Wed, 20 Aug 2014 16:32:02 +0000 (16:32 +0000)]
Make Bruce happy removing the "LL abomination" from time.h
It's not necessary in all the three instances because
they already have the correct type on all the supported
arches.

Requested by: bde

9 years agoAdd kernel modules for si(4), wds(4), and wl(4).
jhb [Wed, 20 Aug 2014 16:09:05 +0000 (16:09 +0000)]
Add kernel modules for si(4), wds(4), and wl(4).

9 years agoUnexpand TAILQ_FOREACH().
jhb [Wed, 20 Aug 2014 16:07:56 +0000 (16:07 +0000)]
Unexpand TAILQ_FOREACH().

9 years agoFix build of si(4) and enable it in LINT on amd64 and i386.
jhb [Wed, 20 Aug 2014 16:07:17 +0000 (16:07 +0000)]
Fix build of si(4) and enable it in LINT on amd64 and i386.

9 years agoBump MAXCPU on amd64 from 64 to 256. In practice APIC only permits 255
jhb [Wed, 20 Aug 2014 16:06:24 +0000 (16:06 +0000)]
Bump MAXCPU on amd64 from 64 to 256.  In practice APIC only permits 255
CPUs (IDs 0 through 254).  Getting above that limit requires x2APIC.

MFC after: 1 month

9 years agoBump the default size of cpuset_t masks in userland from 128 bits to 256.
jhb [Wed, 20 Aug 2014 16:05:15 +0000 (16:05 +0000)]
Bump the default size of cpuset_t masks in userland from 128 bits to 256.

This should not be an ABI change since the various public APIs that use
cpusets all include an explicit size parameter in addition to the cpuset
parameter.

MFC after: 1 week

9 years agoReplace dev_clone with cdevpriv(9) KPI in audit_pipe code.
davide [Wed, 20 Aug 2014 16:04:30 +0000 (16:04 +0000)]
Replace dev_clone with cdevpriv(9) KPI in audit_pipe code.
This is (yet another) step towards the removal of device
cloning from our kernel.

CR: https://reviews.freebsd.org/D441
Reviewed by: kib, rwatson
Tested by: pho

9 years agoAdd ${LIBC} to DPADD to fix "make checkdpadd"
ngie [Wed, 20 Aug 2014 15:43:26 +0000 (15:43 +0000)]
Add ${LIBC} to DPADD to fix "make checkdpadd"

Phabric: D632
Approved by: jmmv (mentor)
MFC after: 2 weeks

9 years agoAdd missing break.
pfg [Wed, 20 Aug 2014 14:58:25 +0000 (14:58 +0000)]
Add missing break.

CID: 603368

9 years agopci: make MSI(-X) enable and disable methods of the PCI bus
royger [Wed, 20 Aug 2014 14:57:20 +0000 (14:57 +0000)]
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.

9 years agoRemove useless - and buggy, it resulted in spurious warnings in logs - code.
trasz [Wed, 20 Aug 2014 13:54:27 +0000 (13:54 +0000)]
Remove useless - and buggy, it resulted in spurious warnings in logs - code.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agoAdd description for the "automounted" mount flag.
trasz [Wed, 20 Aug 2014 13:52:47 +0000 (13:52 +0000)]
Add description for the "automounted" mount flag.

Reviewed by: emaste@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agoRework ".." lookup; previous one failed to properly busy the mountpoint.
trasz [Wed, 20 Aug 2014 13:46:51 +0000 (13:46 +0000)]
Rework ".." lookup; previous one failed to properly busy the mountpoint.

Reviewed by: kib@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agoAfter much toying around with this AMRR initial rate stuff,
adrian [Wed, 20 Aug 2014 09:10:03 +0000 (09:10 +0000)]
After much toying around with this AMRR initial rate stuff,
I've decided that for 11n rates it's best to start (very) low and work
our way up.

So, from now on, the initial rate for AMRR 11n is MCS4.
It doesn't try MCS12 or MCS20 - at low signal strengths those don't
work very well at all.

AMRR will step the rate control up over time if things work out better.

Tested:

* Intel 5100
* Intel 5300 (using local diffs to test out 3x3 stream support)

9 years agoDo not busy the UFS mount point inside VOP_RENAME(). The
kib [Wed, 20 Aug 2014 08:15:23 +0000 (08:15 +0000)]
Do not busy the UFS mount point inside VOP_RENAME().  The
kern_renameat() already starts write on the mp, which prevents
parallel unmount from proceed.  Busying mp after vn_start_write()
deadlocks the unmount.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoCorrect the test for condition to suspend UFS filesystem during
kib [Wed, 20 Aug 2014 08:13:03 +0000 (08:13 +0000)]
Correct the test for condition to suspend UFS filesystem during
unmount.  There is no need to suspend read-only filesystem, while we
need suspension on modificable mount point.

Reported by: rwatson
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week