]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoCorrect the multicast handling in the E1000 drivers as was
Jack F Vogel [Wed, 3 Apr 2013 23:39:54 +0000 (23:39 +0000)]
Correct the multicast handling in the E1000 drivers as was
done in ixgbe, thanks to Mike Karels for this fix. When exiting
promiscuous mode MPE bit was being unconditionally cleared, this
should not be done if we are in MAX multicast groups.

11 years agoMFP4 change 217313 and part of 222068:
Brooks Davis [Wed, 3 Apr 2013 22:37:40 +0000 (22:37 +0000)]
MFP4 change 217313 and part of 222068:

Add a simple nexus attachment for cfi(4).

11 years agoMFP4 change 210763
Brooks Davis [Wed, 3 Apr 2013 22:24:36 +0000 (22:24 +0000)]
MFP4 change 210763

Allow boothowto and bootverbose to be set via kernel options, which
is useful on architectures that are unable to rely on a boot loader
to pass configuration variables to the kernel.

Submitted by: rwatson

11 years agoUpdate man page for igb(4) with a little bit of information about
Sean Bruno [Wed, 3 Apr 2013 21:55:19 +0000 (21:55 +0000)]
Update man page for igb(4) with a little bit of information about
hw.igb.num_queues for those so inclined.

PR: kern/177384
Submitted by: hiren.panchasara@gmail.com
Reviewed by: sbruno@
Approved by: jfv@
Obtained from: Yahoo! Inc.
MFC after: 2 weeks

11 years agoTrailing whitespace cleanup along with 80 column enforcemnt.
Sean Bruno [Wed, 3 Apr 2013 21:34:35 +0000 (21:34 +0000)]
Trailing whitespace cleanup along with 80 column enforcemnt.

Submitted by: hiren.panchasara@gmail.com
Reviewed by: sbruno@freebsd.org
Obtained from: Yahoo! Inc.
MFC after: 2 weeks

11 years agoFix typo (devicde -> device).
Jim Harris [Wed, 3 Apr 2013 20:52:17 +0000 (20:52 +0000)]
Fix typo (devicde -> device).

11 years agoCheck for SS_NBIO in the socket state field rather than socket buffer
John Baldwin [Wed, 3 Apr 2013 20:31:10 +0000 (20:31 +0000)]
Check for SS_NBIO in the socket state field rather than socket buffer
flags.

Submitted by: Vijay Singh
MFC after: 1 week

11 years agoFix locking problem in ctl_maintenance_in() - one cannot use M_WAITOK or call
Edward Tomasz Napierala [Wed, 3 Apr 2013 20:26:52 +0000 (20:26 +0000)]
Fix locking problem in ctl_maintenance_in() - one cannot use M_WAITOK or call
ctl_done() with mutex held.

Reviewed by: ken
Sponsored by: FreeBSD Foundation

11 years agoThe code in clear_remove() and clear_inodedeps() skips one entry
Kirk McKusick [Wed, 3 Apr 2013 19:26:32 +0000 (19:26 +0000)]
The code in clear_remove() and clear_inodedeps() skips one entry
in the pagedep and inodedep hash tables. An entry in the table is
skipped because 'pagedep_hash' and 'inodedep_hash' hold the size
of the hash tables - 1.

The chance that this would have any operational failure is extremely
unlikely. These funtions only need to find a single entry and are
only called when there are too many entries. The chance that they
would fail because all the entries are on the single skipped hash
chain are remote.

Submitted by: Pedro Martelletto
Reviewed by:  kib
MFC after:    2 weeks

11 years agoIFP4 change 222074.
Brooks Davis [Wed, 3 Apr 2013 19:19:45 +0000 (19:19 +0000)]
IFP4 change 222074.

Introduce an explicit close of the output descriptor so that work done
on close is accounted for in the summary output triggered at exit
(implicit close()s occur after atexit() hooks).

This is useful because some devices such as cfi(4) may perform
signficant work after a close occurs (e.g. erasing and rewriting a
block of flash).

11 years agoSince ATA_CAM mode has no implemented support for serializing access to the
Alexander Motin [Wed, 3 Apr 2013 18:30:09 +0000 (18:30 +0000)]
Since ATA_CAM mode has no implemented support for serializing access to the
different ATA channels, required for acard and pc98 ATA controllers, block
access to second channels of both, hoping that one working channel is better
then none.  I have an idea how that support could be implemented, but I have
no hardware to work on that.

MFC after: 1 week

11 years agoTell bmake to use the FreeBSD preferred makefile preference list.
Simon J. Gerraty [Wed, 3 Apr 2013 16:20:21 +0000 (16:20 +0000)]
Tell bmake to use the FreeBSD preferred makefile preference list.

PR: 177593
Reviewed by: obrien

11 years agoAdd some more ATA_CAM ifdefs.
Alexander Motin [Wed, 3 Apr 2013 14:10:37 +0000 (14:10 +0000)]
Add some more ATA_CAM ifdefs.

Submitted by: marius (partially)
MFC after: 1 week

11 years agoAdd xpt_release_ccb()'s missed at r248872. That made `shutdown -p` stuck
Alexander Motin [Wed, 3 Apr 2013 11:30:18 +0000 (11:30 +0000)]
Add xpt_release_ccb()'s missed at r248872.  That made `shutdown -p` stuck
on controller with small number of queue slots and several disks connected.

11 years agospa_open_common: fix argument to zvol_create_minors
Andriy Gapon [Wed, 3 Apr 2013 11:06:26 +0000 (11:06 +0000)]
spa_open_common: fix argument to zvol_create_minors

Prior to r248571 spa_open was always called with a bare pool name,
but now it is called with a dataset name instead (spa_lookup handles
that).
So, when a ZFS root is mounted spa_open is called with a name of a root
dataset, which can very well be different from the pool name.
But zvol_create_minors should be called with the pool name, because it
performs a recursive traversal of all datasets under the name to find
all those that are volumes.

MFC after: 7 days

11 years agoAdd missing ifdef's for reduced feature compilations.
Hans Petter Selasky [Wed, 3 Apr 2013 10:31:13 +0000 (10:31 +0000)]
Add missing ifdef's for reduced feature compilations.

11 years agoFix possible pool hold leak in dmu_send_impl()
Martin Matuska [Wed, 3 Apr 2013 09:52:30 +0000 (09:52 +0000)]
Fix possible pool hold leak in dmu_send_impl()

Problem reported to vendor:
  https://www.illumos.org/issues/3645

Reported by: Andriy Gapon <avg@FreeBSD.org>
MFC after: 15 days

11 years agodrm and i915: Left-shift iic_msg.slave at creation time
Jean-Sébastien Pédron [Wed, 3 Apr 2013 08:27:35 +0000 (08:27 +0000)]
drm and i915: Left-shift iic_msg.slave at creation time

This is required because, in the radeon driver, we can't left-shift in a
central place, like it was done in the i915 driver.

Reviewed by: kib@, kan@, avg@
Tested by: kib@, avg@

11 years agoAdd new USB ID.
Hans Petter Selasky [Wed, 3 Apr 2013 06:45:21 +0000 (06:45 +0000)]
Add new USB ID.

MFC after: 1 week
Submitted by: Bruce Simpson <bms@fastmail.net>

11 years agoReplace the remaining uses of vm_radix_node_page() by vm_radix_isleaf() and
Alan Cox [Wed, 3 Apr 2013 06:37:25 +0000 (06:37 +0000)]
Replace the remaining uses of vm_radix_node_page() by vm_radix_isleaf() and
vm_radix_topage().  This transformation eliminates some unnecessary
conditional branches from the inner loops of vm_radix_insert(),
vm_radix_lookup{,_ge,_le}(), and vm_radix_remove().

Simplify the control flow of vm_radix_lookup_{ge,le}().

Reviewed by: attilio (an earlier version)
Tested by: pho
Sponsored by: EMC / Isilon Storage Division

11 years agoComment out the VIMAGE since we need to build both LINTS to
Kevin Lo [Wed, 3 Apr 2013 01:27:15 +0000 (01:27 +0000)]
Comment out the VIMAGE since we need to build both LINTS to
get good coverage.

Pointed out by: jhb

11 years agoReplace access to /dev/random with the kernel pseudo-random number
Xin LI [Tue, 2 Apr 2013 23:41:20 +0000 (23:41 +0000)]
Replace access to /dev/random with the kernel pseudo-random number
source sysctl(KERN_ARND) and remove the fallback code.

Obtained from: OpenBSD
Reviewed by: secteam
MFC after: 1 month

11 years agosh: Write as much into the heredoc pipe as possible, to avoid forking.
Jilles Tjoelker [Tue, 2 Apr 2013 21:34:38 +0000 (21:34 +0000)]
sh: Write as much into the heredoc pipe as possible, to avoid forking.

Use non-blocking I/O to write as much as the pipe will accept (often 64K,
but it can be as little as 4K), avoiding the need for the ugly PIPESIZE
constant. If PIPESIZE was set too high, a deadlock would occur.

11 years agoUpdate to bmake-20130330
Simon J. Gerraty [Tue, 2 Apr 2013 21:31:11 +0000 (21:31 +0000)]
Update to bmake-20130330

11 years agoDo not declare that preloaded md(4) supports unmapped bio requests, it
Konstantin Belousov [Tue, 2 Apr 2013 19:39:31 +0000 (19:39 +0000)]
Do not declare that preloaded md(4) supports unmapped bio requests, it
does not.

Reported by: <mh@kernel32.de>
Sponsored by: The FreeBSD Foundation

11 years agoFix sending virtual scatter/gather lists from the CTL CAM frontend
Kenneth D. Merry [Tue, 2 Apr 2013 17:29:17 +0000 (17:29 +0000)]
Fix sending virtual scatter/gather lists from the CTL CAM frontend
peripheral.

Sponsored by: Spectra Logic

11 years agoDon't directly dereference userland pointer; instead use kernel pointer
Edward Tomasz Napierala [Tue, 2 Apr 2013 16:50:50 +0000 (16:50 +0000)]
Don't directly dereference userland pointer; instead use kernel pointer
copied in from userspace.  This fixes instant panic when creating CTL LUN
on sparc64.  Not a security problem, since the API is root-only.

Reviewed by: ken
Sponsored by: FreeBSD Foundation

11 years agoAdd support for XPT_CONT_TARGET_IO CCBs in _bus_dmamap_load_ccb().
Kenneth D. Merry [Tue, 2 Apr 2013 16:49:49 +0000 (16:49 +0000)]
Add support for XPT_CONT_TARGET_IO CCBs in _bus_dmamap_load_ccb().

Declare CCB types in their respective switch blocks.

Sponsored by: Spectra Logic

11 years ago- Remove extra $FreeBSD$
Gleb Smirnoff [Tue, 2 Apr 2013 13:52:09 +0000 (13:52 +0000)]
- Remove extra $FreeBSD$
- Touch options headers to make module buildable.

Reviewed by: trasz

11 years agoRemove obsolete references to sysinstall.
Eitan Adler [Tue, 2 Apr 2013 12:40:01 +0000 (12:40 +0000)]
Remove obsolete references to sysinstall.

This change is not intended for MFC.

PR: docs/177570
Submitted by: Garrett Cooper <yaneurabeya@gmail.com> (partial)
Approved by: bcr (mentor)

11 years agoFix comment formatting.
Edward Tomasz Napierala [Tue, 2 Apr 2013 12:22:44 +0000 (12:22 +0000)]
Fix comment formatting.

11 years agoMerge upstream patch to silence spurious "no such identity file" warnings.
Dag-Erling Smørgrav [Tue, 2 Apr 2013 11:44:55 +0000 (11:44 +0000)]
Merge upstream patch to silence spurious "no such identity file" warnings.

11 years agoSilence printf format warnings.
Dag-Erling Smørgrav [Tue, 2 Apr 2013 11:42:39 +0000 (11:42 +0000)]
Silence printf format warnings.

11 years agoRemove unused code.
Edward Tomasz Napierala [Tue, 2 Apr 2013 09:45:34 +0000 (09:45 +0000)]
Remove unused code.

Reviewed by: ken

11 years agoFix dates in manual pages modified in 249009.
Edward Tomasz Napierala [Tue, 2 Apr 2013 09:44:59 +0000 (09:44 +0000)]
Fix dates in manual pages modified in 249009.

11 years agoMake it possible to build CTL as a module.
Edward Tomasz Napierala [Tue, 2 Apr 2013 09:42:42 +0000 (09:42 +0000)]
Make it possible to build CTL as a module.

Reviewed by: ken
Sponsored by: FreeBSD Foundation

11 years agoFix panic in the error path caused by recursive acquisition of XPT topology
Edward Tomasz Napierala [Tue, 2 Apr 2013 09:38:04 +0000 (09:38 +0000)]
Fix panic in the error path caused by recursive acquisition of XPT topology
lock.

Reviewed by: ken

11 years agoPull in a patchset from upstream to silence spurious "no such identity
Dag-Erling Smørgrav [Tue, 2 Apr 2013 08:41:38 +0000 (08:41 +0000)]
Pull in a patchset from upstream to silence spurious "no such identity
file" warnings.

11 years agoDo not check against uninitialized rc and comment out vendor code
Martin Matuska [Tue, 2 Apr 2013 08:15:39 +0000 (08:15 +0000)]
Do not check against uninitialized rc and comment out vendor code

MFC after: 16 days

11 years agoMark a couple of places where I think the dmamap isn't being unmapped
Adrian Chadd [Tue, 2 Apr 2013 06:25:10 +0000 (06:25 +0000)]
Mark a couple of places where I think the dmamap isn't being unmapped
before the TX path is being aborted.

Right now it's in the TDMA code and I can live with that; but it really
should get fixed.

I'll do a more thorough audit of this code soon.

11 years agoSome TX dmamap cleanups.
Adrian Chadd [Tue, 2 Apr 2013 06:24:22 +0000 (06:24 +0000)]
Some TX dmamap cleanups.

* Don't use BUS_DMA_ALLOCNOW for descriptor DMA maps; we never use
  bounce buffers for the descriptors themselves.

* Add some XXX's to mark where the ath_buf has its mbuf ripped from
  underneath it without actually cleaning up the dmamap.  I haven't
  audited those particular code paths to see if the DMA map is guaranteed
  to be setup there; I'll do that later.

* Print out a warning if the descdma tidyup code is given some descriptors
  w/ maps to free.  Ideally the owner will free the mbufs and unmap
  the descriptors before freeing the descriptor/ath_buf pairs, but
  right now that's not guaranteed to be done.

Reviewed by: scottl (BUS_DMA_ALLOCNOW tag)

11 years agoAdd a missing unmap; if we're freeing this mbuf then we must
Adrian Chadd [Tue, 2 Apr 2013 06:21:37 +0000 (06:21 +0000)]
Add a missing unmap; if we're freeing this mbuf then we must
really both sync/unmap the dmamap before freeing it.

11 years agoAdd VIMAGE to NOTES.
Kevin Lo [Tue, 2 Apr 2013 05:57:36 +0000 (05:57 +0000)]
Add VIMAGE to NOTES.

Reviewed by: zec

11 years agoRegen.
Matthew D Fleming [Tue, 2 Apr 2013 05:30:52 +0000 (05:30 +0000)]
Regen.

MFC after: 1 week

11 years agoFix return type of extattr_set_* and fix rmextattr(8) utility.
Matthew D Fleming [Tue, 2 Apr 2013 05:30:41 +0000 (05:30 +0000)]
Fix return type of extattr_set_* and fix rmextattr(8) utility.

extattr_set_{fd,file,link} is logically a write(2)-like operation and
should return ssize_t, just like extattr_get_*.  Also, the user-space
utility was using an int for the return value of extattr_get_* and
extattr_list_*, both of which return an ssize_t.

MFC after: 1 week

11 years agoFix a typo.
Pyun YongHyeon [Tue, 2 Apr 2013 00:57:54 +0000 (00:57 +0000)]
Fix a typo.

Reported by: David Imhoff via brad@OpenBSD
Tested by: hrs
Reviewed by: davidch

11 years agoAdded ATA Pass-Through support to CAM
Steven Hartland [Tue, 2 Apr 2013 00:11:35 +0000 (00:11 +0000)]
Added ATA Pass-Through support to CAM

sys/cam/scsi/scsi_all.c:
        - Added scsi_ata_pass_16 method
          Which use ATA Pass-Through to send commands to the attached disk.

sys/cam/scsi/scsi_all.h:
        - Added defines for all missing ATA Pass-Through commands values.

        - Added scsi_ata_pass_16 method.

        - Fixed a comment typo while I'm here

Reviewed by: mav
Approved by: pjd (mentor)
MFC after: 2 weeks

11 years agoFollow up to r247960 and rr247960 by also amending ctfmerge. For the
Dimitry Andric [Mon, 1 Apr 2013 21:16:32 +0000 (21:16 +0000)]
Follow up to r247960 and rr247960 by also amending ctfmerge.  For the
only other case where STT_FILE symbols are used, in symit_next() in
cddl/contrib/opensolaris/tools/ctf/cvt/input.c, save the basename of the
symbol, instead of the full pathname.

Reported by: avg
Tested by: avg, jimharris
MFC after: 1 week

11 years agoImport bmake-20130330
Simon J. Gerraty [Mon, 1 Apr 2013 21:12:55 +0000 (21:12 +0000)]
Import bmake-20130330

11 years agoEnsure that we only call the busdma unmap/flush routines once, when
Adrian Chadd [Mon, 1 Apr 2013 20:57:13 +0000 (20:57 +0000)]
Ensure that we only call the busdma unmap/flush routines once, when
the buffer is being freed.

* When buffers are cloned, the original mapping isn't copied but it
  wasn't freeing the mapping until later.  To be safe, free the
  mapping when the buffer is cloned.

* ath_freebuf() now no longer calls the busdma sync/unmap routines.

* ath_tx_freebuf() now calls sync/unmap.

* Call sync first, before calling unmap.

Tested:

* AR5416, STA mode

11 years agowordexp(): Remove wrong IFS usage.
Jilles Tjoelker [Mon, 1 Apr 2013 20:50:07 +0000 (20:50 +0000)]
wordexp(): Remove wrong IFS usage.

Words in shell script are separated by spaces or tabs independent of the
value of IFS. The value of IFS is only relevant for the result of
substitutions. Therefore, there should be a space between 'wordexp' and the
words to be expanded, not an IFS character.

Paranoia might dictate that the shell ignore IFS from the environment (even
though our sh currently uses it), so do not depend on it in the new test
case.

11 years agoRemove an un-needed comment.
Adrian Chadd [Mon, 1 Apr 2013 20:44:21 +0000 (20:44 +0000)]
Remove an un-needed comment.

11 years agoUse ATH_MAX_SCATTER rather than ATH_TXDESC.
Adrian Chadd [Mon, 1 Apr 2013 20:12:21 +0000 (20:12 +0000)]
Use ATH_MAX_SCATTER rather than ATH_TXDESC.

ATH_MAX_SCATTER is used to size the ath_buf DMA segment array.
We thus should use it when checking sizes of things.

11 years agoOnly unmap the RX mbuf DMA map if there's a buffer here.
Adrian Chadd [Mon, 1 Apr 2013 20:11:19 +0000 (20:11 +0000)]
Only unmap the RX mbuf DMA map if there's a buffer here.

The normal RX path (ath_rx_pkt()) will sync and unmap the
buffer before passing it up the stack.  We only need to do this
if we're flushing the FIFO during reset/shutdown.

11 years agoDtrace: enablings on defunct providers prevent providers from unregistering
Pedro F. Giffuni [Mon, 1 Apr 2013 19:13:46 +0000 (19:13 +0000)]
Dtrace: enablings on defunct providers prevent providers from unregistering

Merge change from illumos:

1368 enablings on defunct providers prevent providers from unregistering

We try to address some underlying differences between the Solaris
and FreeBSD implementations: dtrace_attach() / dtrace_detach() are
currently unimplemented in FreeBSD but the new code from illumos
makes use of taskq so some adaptations were made to dtrace_open()
and dtrace_close() to handle them appropriately.

Illumos Revision: r13430:8e6add739e38

Reference:
https://www.illumos.org/issues/1368

Reviewed by: gnn
Tested by: Fabian Keil
Obtained from: Illumos
MFC after: 3 weeks

11 years agosh: Fix various compiler warnings.
Jilles Tjoelker [Mon, 1 Apr 2013 17:18:22 +0000 (17:18 +0000)]
sh: Fix various compiler warnings.

It now passes WARNS=7 with clang on i386.

GCC 4.2.1 does not understand setjmp() properly so will always trigger
-Wuninitialized. I will not add the volatile keywords to suppress this.

11 years agoFormat per etc/mtree/README
Ed Maste [Mon, 1 Apr 2013 17:15:04 +0000 (17:15 +0000)]
Format per etc/mtree/README

- Spaces instead of tabs
- Sort some i18n entries

11 years agoAdd unmapped bio support to nvme(4) and nvd(4).
Jim Harris [Mon, 1 Apr 2013 16:23:34 +0000 (16:23 +0000)]
Add unmapped bio support to nvme(4) and nvd(4).

Sponsored by: Intel

11 years agoCall dmu_snapshot_list_next() in zvol.c with dsl_pool_config lock held
Martin Matuska [Mon, 1 Apr 2013 16:14:57 +0000 (16:14 +0000)]
Call dmu_snapshot_list_next() in zvol.c with dsl_pool_config lock held

Submitted by: Andriy Gapon <avg@FreeBSD.org>
MFC after: 17 days

11 years agoSilence warnings about redefined macros.
Dag-Erling Smørgrav [Mon, 1 Apr 2013 13:48:30 +0000 (13:48 +0000)]
Silence warnings about redefined macros.

11 years agoSlightly tune locking to not call xpt_alloc_ccb() that is allowed to sleep
Alexander Motin [Mon, 1 Apr 2013 13:18:34 +0000 (13:18 +0000)]
Slightly tune locking to not call xpt_alloc_ccb() that is allowed to sleep
while holding the SIM mutex.

11 years agoMention that read_attributes, write_attributes, read_acl and write_acl
Edward Tomasz Napierala [Mon, 1 Apr 2013 13:17:28 +0000 (13:17 +0000)]
Mention that read_attributes, write_attributes, read_acl and write_acl
are always permitted for the file owner.

PR: kern/174948
MFC after: 1 week

11 years agoFix ipfw rule validation partially broken by r248552.
Alexander V. Chernikov [Mon, 1 Apr 2013 11:28:52 +0000 (11:28 +0000)]
Fix ipfw rule validation partially broken by r248552.

Pointed by: avg
MFC with: r248552

11 years agoDo not call the VOP_LOOKUP() for the doomed directory vnode. The
Konstantin Belousov [Mon, 1 Apr 2013 09:59:38 +0000 (09:59 +0000)]
Do not call the VOP_LOOKUP() for the doomed directory vnode.  The
vnode could be reclaimed while lock upgrade was performed.

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

11 years agoRecord the correct error in the trace.
Konstantin Belousov [Mon, 1 Apr 2013 09:57:46 +0000 (09:57 +0000)]
Record the correct error in the trace.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

11 years agoStrip the unnneeded spaces, mostly at the end of lines.
Konstantin Belousov [Mon, 1 Apr 2013 09:56:48 +0000 (09:56 +0000)]
Strip the unnneeded spaces, mostly at the end of lines.

MFC after: 3 days

11 years agoFix low-level uart drivers that set their fifo sizes in the softc too late.
Ian Lepore [Mon, 1 Apr 2013 00:44:20 +0000 (00:44 +0000)]
Fix low-level uart drivers that set their fifo sizes in the softc too late.

uart(4) allocates send and receiver buffers in attach() before it calls
the low-level driver's attach routine.  Many low-level drivers set the
fifo sizes in their attach routine, which is too late.  Other drivers set
them in the probe() routine, so that they're available when uart(4)
allocates buffers.  This fixes the ones that were setting the values too
late by moving the code to probe().

11 years agoEnable hardware flow control and high speed bulk data transfer in at91 uarts.
Ian Lepore [Mon, 1 Apr 2013 00:00:10 +0000 (00:00 +0000)]
Enable hardware flow control and high speed bulk data transfer in at91 uarts.

Changes to make rtc/cts flow control work...

This does not turn on the builtin hardware flow control on the SoC's usart
device, because that doesn't work on uart1 due to a chip erratum (they
forgot to wire up pin PA21 to RTS0 internally).  Instead it uses the
hardware flow control logic where the tty layer calls the driver to assert
and de-assert the flow control lines as needed.  This prevents overruns at
the tty layer (app doesn't read fast enough), but does nothing for overruns
at the driver layer (interrupts not serviced fast enough).

To work around the wiring problem with RTS0, the driver reassigns that pin
as a GPIO and controls it manually.  It only does so if given permission via
hint.uart.1.use_rts0_workaround=1, to prevent accidentally driving the pin
if uart1 is used without flow control (because something not related to
serial IO could be wired to that pin).

In addition to the RTS0 workaround, driver changes were needed in the area
of reading the current set of DCE signals.  A priming read is now done at
attach() time, and the interrupt routine now sets SER_INT_SIGCHG when any
of the DCE signals change.  Without these changes, nothing could ever be
transmitted, because the tty layer thought CTS was de-asserted (when in fact
we had just never read the status register, and the hwsig variable was
init'd to CTS de-asserted).

Changes to support bulk high-speed (230kbps and higher) data reception...

Allow the receive fifo size to be tuned with hint.uart.<dev>.fifo_bytes.
For high speed receive, a fifo size of 1024 works well.  The default is
still 128 bytes if no hint is provided.  Using a value larger than 384
requires a change in dev/uart/uart_core.c to size the intermediate
buffer as MAX(384, 3*sc->sc_rxfifosize).

Recalculate the receive timeout whenever the baud rate changes.  At low
baud rates (19.2kbps and below) the timeout is the number of bits in 2
characters.  At higher speed it's calculated to be 500 microseconds
worth of bits.  The idea is to compromise between being responsive in
interactive situations and not timing out prematurely during a brief
pause in bulk data flow.  The old fixed timeout of 1.5 characters was
just 32 microseconds at 460kbps.

At interrupt time, check for receiver holding register overrun status
and set the corresponding status bit in the return value.

When handling a buffer overrun, get a single buffer emptied and handed
back to the hardware as quickly as possible, then deal with the second
buffer.  This at least minimizes data loss compared to the old logic
that fully processed both buffers before restarting the hardware.

Rewrite the logic for handling buffers after a receive timeout.  The
original author speculated in a comment that there may be a race with
high speed data.  There was, although it was rare.  The code now handles
all three possible scenarios on receive timeout: two empty buffers, one
empty and one partial buffer, or one full and one partial buffer.

Reviewed by: imp

11 years agoAccommodate uart devices with large FIFOs (or DMA buffers which amount
Ian Lepore [Sun, 31 Mar 2013 23:24:04 +0000 (23:24 +0000)]
Accommodate uart devices with large FIFOs (or DMA buffers which amount
to the same thing) by allocating the uart(4) rx buffer based on the
device's rxfifosz rather than using a hard-coded size of 384 bytes.

The  historical 384 byte size is 3 times the largest hard-coded fifo
size in the tree, so use that ratio as a guide and allocate the buffer
as three times rxfifosz, but never smaller than the historical size.

11 years agoWhen running on armv6, set alignment checking to modulo-4 mode rather
Ian Lepore [Sun, 31 Mar 2013 22:43:16 +0000 (22:43 +0000)]
When running on armv6, set alignment checking to modulo-4 mode rather
than modulo-8, because clang emits ldrd and strd instructions for
addresses that are only 4-byte aligned

11 years agoWhen running on armv6, set alignment checking to modulo-4 mode rather
Ian Lepore [Sun, 31 Mar 2013 22:42:25 +0000 (22:42 +0000)]
When running on armv6, set alignment checking to modulo-4 mode rather
than modulo-8, because clang emits ldrd and strd instructions for
addresses that are only 4-byte aligned.

11 years agoAdd a macro for checking for IPv4 link local addresses.
Michael Tuexen [Sun, 31 Mar 2013 18:27:46 +0000 (18:27 +0000)]
Add a macro for checking for IPv4 link local addresses.

MFC after: 1 week

11 years agoRename do_pipe() to kern_pipe2() and declare it properly.
Jilles Tjoelker [Sun, 31 Mar 2013 17:42:54 +0000 (17:42 +0000)]
Rename do_pipe() to kern_pipe2() and declare it properly.

11 years agoFix a typo in the CF device driver name that prevented instantiation.
Ian Lepore [Sun, 31 Mar 2013 12:51:56 +0000 (12:51 +0000)]
Fix a typo in the CF device driver name that prevented instantiation.

11 years agoFix xdev-install when installing to a location other than /
Andrew Turner [Sun, 31 Mar 2013 08:54:04 +0000 (08:54 +0000)]
Fix xdev-install when installing to a location other than /

11 years agoFix xdev. Clang and libc were not building correctly on older worlds, for
Andrew Turner [Sun, 31 Mar 2013 08:31:06 +0000 (08:31 +0000)]
Fix xdev. Clang and libc were not building correctly on older worlds, for
example, on 9.1.
 * To fix clang add an _xb-bootstrap-tools target that mirrors the existing
   bootstrap-tools target in the full world.
 * For libc have the compiler use the newly installed includes, and, while
   here, tell the compiler about the xdev library path as some other
   libraries will link against the installed libraries.

11 years agoAdd counter to keep track of the number of timer interrupts generated by
Neel Natu [Sun, 31 Mar 2013 03:56:48 +0000 (03:56 +0000)]
Add counter to keep track of the number of timer interrupts generated by
the local apic for each virtual cpu.

11 years agoWhen building universe ensure the required worlds are finished before
Andrew Turner [Sun, 31 Mar 2013 02:03:34 +0000 (02:03 +0000)]
When building universe ensure the required worlds are finished before
starting the kernels. Before this the kernels would be built as part of the
last architecture universe target. There can cause problems when this world
finishes before the other worlds as the host compiler may be picked up
rather than the target compiler.

The solution is to add a target to build the universe kernels that depends
on all the world targets finishing. As we may not be building a world only
depend on it when MAKE_JUST_KERNELS is undefined.

11 years agoAdd some more stats to keep track of all the reasons that a vcpu is exiting.
Neel Natu [Sat, 30 Mar 2013 17:46:03 +0000 (17:46 +0000)]
Add some more stats to keep track of all the reasons that a vcpu is exiting.

11 years agoInitialize sym_count to 0.
Tim Kientzle [Sat, 30 Mar 2013 16:33:16 +0000 (16:33 +0000)]
Initialize sym_count to 0.

This fixes a compiler warning introduced in r248121.

11 years agoUse a shared lock for VOP_GETEXTATTR, as it is a read-like operation.
Matthew D Fleming [Sat, 30 Mar 2013 15:09:04 +0000 (15:09 +0000)]
Use a shared lock for VOP_GETEXTATTR, as it is a read-like operation.

MFC after: 1 week

11 years agoImprove namespacing in <sys/socket.h>:
Jilles Tjoelker [Sat, 30 Mar 2013 13:30:27 +0000 (13:30 +0000)]
Improve namespacing in <sys/socket.h>:

 * MSG_NOSIGNAL is in POSIX.1-2008.
 * MSG_NOTIFICATION (SCTP) is not in POSIX.
 * PRU_FLUSH_* (SCTP) are not in POSIX.
 * bindat()/connectat() are not in POSIX.

Discussed with: rrs (PRU_FLUSH_*)

11 years agoAR933x CPU device improvements:
Adrian Chadd [Sat, 30 Mar 2013 04:31:29 +0000 (04:31 +0000)]
AR933x CPU device improvements:

* Add baud rate and divisor programming code. See below for more
  information.

* Flesh out ar933x_init() to disable interrupts and program the initial
  console setup.

* Remove #if 0'ed code from ar933x_term().

* Explain what these functions do.

Now, the baud rate and divisor code comes from Linux, as a submission
to the OpenWRT project and Linux kernel from
Gabor Juhos <juhosg@openwrt.org>.

The original ticket for this code is https://dev.openwrt.org/ticket/12031 .

I've contacted Gabor and asked for his permission to also licence the patch
in question (which covers this code) to BSD lience and he's agreed.
Hence why I'm including it here in FreeBSD.

Tested:

* AP121 (AR9330)

11 years agoAR933x UART updates:
Adrian Chadd [Sat, 30 Mar 2013 04:13:47 +0000 (04:13 +0000)]
AR933x UART updates:

* Default clock is 25MHz;
* Remove the UART register macro here - it's not needed as we don't need
  to "adjust" the register offset / spacing at all;
* Remove unused fields in the softc.

Tested:

* AP121

11 years agocxgbe(4): Add support for Chelsio's Terminator 5 (aka T5) ASIC. This
Navdeep Parhar [Sat, 30 Mar 2013 02:26:20 +0000 (02:26 +0000)]
cxgbe(4):  Add support for Chelsio's Terminator 5 (aka T5) ASIC.  This
includes support for the NIC and TOE features of the 40G, 10G, and
1G/100M cards based on the T5.

The ASIC is mostly backward compatible with the Terminator 4 so cxgbe(4)
has been updated instead of writing a brand new driver.  T5 cards will
show up as cxl (short for cxlgb) ports attached to the t5nex bus driver.

Sponsored by: Chelsio

11 years agoAdds the ability to enable / disable sorting of BIO requests queued within
Steven Hartland [Fri, 29 Mar 2013 22:58:15 +0000 (22:58 +0000)]
Adds the ability to enable / disable sorting of BIO requests queued within
CAM. This can significantly improve performance particularly for SSDs
which don't suffer from seek latencies.

The sysctl / tunable kern.cam.sort_io_queues provides the systems default
setting where:-
0 = queued BIOs are NOT sorted
1 = queued BIOs are sorted (default)

Each device gets its own sysctl kern.cam.<type>.<id>.sort_io_queue
Valid values are:-
-1 = use system default (default)
0 = queued BIOs are NOT sorted
1 = queued BIOs are sorted

Note: Additional patch will look to add automatic use of none sorted queues
for none rotating media e.g. SSD's

Reviewed by: scottl
Approved by: pjd (mentor)
MFC after: 2 weeks

11 years agoKeep fwd_tag around for subsequent pcb lookups
Ed Maste [Fri, 29 Mar 2013 20:51:44 +0000 (20:51 +0000)]
Keep fwd_tag around for subsequent pcb lookups

For TIMEWAIT handling tcp_input may have to jump back for an additional
pass through pcblookup.  Prior to this change the fwd_tag had been
discarded after the first lookup, so a new connection attempt delivered
locally via 'ipfw fwd' would fail to find a match.

As of r248886 the tag will be detached and freed when passed to the
socket buffer.

11 years agoAdd "type" to nvme_request, signifying if its payload is a VADDR, UIO, or
Jim Harris [Fri, 29 Mar 2013 20:34:28 +0000 (20:34 +0000)]
Add "type" to nvme_request, signifying if its payload is a VADDR, UIO, or
NULL. This simplifies decisions around if/how requests are routed through
busdma.  It also paves the way for supporting unmapped bios.

Sponsored by: Intel

11 years agoDisable this; it's a local option that I haven't yet committed to -HEAD.
Adrian Chadd [Fri, 29 Mar 2013 20:07:51 +0000 (20:07 +0000)]
Disable this; it's a local option that I haven't yet committed to -HEAD.

11 years agoAdd userland access to at91 gpio functionality via ioctl calls. Also,
Ian Lepore [Fri, 29 Mar 2013 19:52:57 +0000 (19:52 +0000)]
Add userland access to at91 gpio functionality via ioctl calls.  Also,
add the ability for userland to be notified of changes on gpio pins via
a select(2)/read(2) interface.

Change the interrupt handler from filtered to threaded.

Because of the uiomove() calls in the new interface, change locking from
standard mutex to sx.

Add / restore the at91_gpio_high_z() function.

Reviewed by: imp (long ago)

11 years agoChange the API for at91_pio_gpio_get() to return the entire masked set
Ian Lepore [Fri, 29 Mar 2013 19:04:18 +0000 (19:04 +0000)]
Change the API for at91_pio_gpio_get() to return the entire masked set
of bits, not just a 0/1 indicating whether any of the masked bits are on.
This is compatible with the single in-tree caller of this function right now
(at91_vbus_poll() in dev/usb/controller/at91dci_atemelarm.c).

11 years agoCall soc_info.soc_data->soc_clock_init() before at91_pmc_init_clock(), so
Ian Lepore [Fri, 29 Mar 2013 18:47:08 +0000 (18:47 +0000)]
Call soc_info.soc_data->soc_clock_init() before at91_pmc_init_clock(), so
that the latter correctly fills in the clock data structures based on
proper hardware-specific shift and mask values from the soc_data structure.

11 years agoChange the define in the header to eliminate unnecessary data
Jack F Vogel [Fri, 29 Mar 2013 18:46:13 +0000 (18:46 +0000)]
Change the define in the header to eliminate unnecessary data
when using LEGACY TX.

11 years agoAdd a couple forward declarations, so that board support routines don't have
Ian Lepore [Fri, 29 Mar 2013 18:43:10 +0000 (18:43 +0000)]
Add a couple forward declarations, so that board support routines don't have
to pre-include a bunch of header files they don't need just to use this one.

11 years agoChange defines in the igb driver to allow an easier selection of
Jack F Vogel [Fri, 29 Mar 2013 18:25:45 +0000 (18:25 +0000)]
Change defines in the igb driver to allow an easier selection of
the older if_start/non-multiqueue interface from the stack. This
is not the default, but can be turned on in the Makefile now regardless
of the OS level to allow either testing or use of ALTQ.

MFC after: one week

11 years agoRedo the workaround for at91rm9200 erratum #26 in a way that doesn't
Ian Lepore [Fri, 29 Mar 2013 18:17:51 +0000 (18:17 +0000)]
Redo the workaround for at91rm9200 erratum #26 in a way that doesn't
cause a lockup on some rm92 hardware.

11 years agoFix a typo: the RXD0 pin is PA18, not PA19.
Ian Lepore [Fri, 29 Mar 2013 18:06:54 +0000 (18:06 +0000)]
Fix a typo: the RXD0 pin is PA18, not PA19.

11 years agoTwo small fixes:
Jack F Vogel [Fri, 29 Mar 2013 18:03:00 +0000 (18:03 +0000)]
Two small fixes:
  Set promiscuous code was unconditionally turning off multicast when
  turning off promiscuous mode, this should only be done when there are
  less than MAX groups. Thanks to Mike Karels for this correction.

  Second, the overtmp interrupt setup/detection was wrong, correcting it.

MFC after: one week

11 years agoRemove a really noisy printf left over from debugging hardware errata.
Ian Lepore [Fri, 29 Mar 2013 17:57:24 +0000 (17:57 +0000)]
Remove a really noisy printf left over from debugging hardware errata.

11 years agoAdd bus_dmamap_load_bio for non-CAM disk drivers that wish to enable
Jim Harris [Fri, 29 Mar 2013 16:26:25 +0000 (16:26 +0000)]
Add bus_dmamap_load_bio for non-CAM disk drivers that wish to enable
unmapped I/O.

Sponsored by: Intel
Reviewed by: kib