]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/log
FreeBSD/stable/8.git
12 years agoMFC r219722 (by jhb):
bz [Sat, 18 Jun 2011 22:12:17 +0000 (22:12 +0000)]
MFC r219722 (by jhb):
  Preserve errno in an error case.
  Submitted by: gcooper

MFC r222899:
  Contrary to when returning in all-good cases at the end of functions we
  did not free memory (1) or close the file descriptor (2) in error cases.

  Reported by: Mark Johnston (1)
  Reported by: attilio (2)
  Reviewed by: jhb
Sponsored by: Sandvine Incorporated

git-svn-id: svn://svn.freebsd.org/base/stable/8@223274 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222272:
bz [Sat, 18 Jun 2011 22:09:22 +0000 (22:09 +0000)]
MFC r222272:

  Add FEATURE() definitions for IPv4 and IPv6 so that we can use
  feature_present(3) to dynamically decide whether to use one or the
  other family.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223272 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220896:
bschmidt [Sat, 18 Jun 2011 12:35:08 +0000 (12:35 +0000)]
MFC r220896:
Add ref to the latest firmware additions.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223258 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220895,221634:
bschmidt [Sat, 18 Jun 2011 12:32:48 +0000 (12:32 +0000)]
MFC r220895,221634:
Now that all bits are in for 1030/6230 adapters enable those.
While here pull the adapter names from the Linux driver and sort
the list by ID.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223257 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220893:
bschmidt [Sat, 18 Jun 2011 12:30:33 +0000 (12:30 +0000)]
MFC r220893:
- Add firmware images for the 6000 series g2a and g2b adapters.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223256 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220892:
bschmidt [Sat, 18 Jun 2011 12:27:49 +0000 (12:27 +0000)]
MFC r220892:
Update iwn(4) firmware blobs:
- bump iwn1000fw to 39.31.5.1
- bump iwn5000fw to 8.83.5.1
- bump iwn6050fw to 41.28.5.1

git-svn-id: svn://svn.freebsd.org/base/stable/8@223255 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220894:
bschmidt [Sat, 18 Jun 2011 12:13:27 +0000 (12:13 +0000)]
MFC r220894:
The 6000 series gen2 adapters have 2 firmware images, one with
advanced btcoex support and one without.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223253 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220891:
bschmidt [Sat, 18 Jun 2011 12:11:48 +0000 (12:11 +0000)]
MFC r220891:
Add basic support for advanced bluetooth coexistence required
for 6005 gen2b (1030/6030) adapters.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223252 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220866-220867:
bschmidt [Sat, 18 Jun 2011 12:10:06 +0000 (12:10 +0000)]
MFC r220866-220867:
- Pull some features out of the firmware:
  - If a ENH_SENS TLV section exit the firmware is capable of doing
    enhanced sensitivity calibration.
  - Newer devices/firmwares have more calibration commands therefore
    hardcoding the noise gain/reset commands no longer works. It is
    supposed to use the next index after the newest calibration type
    support. Read the command index of the TLV section if available.
- Enable DC calibration for all 6000 series devices, except those
  with an internal PA.
- Override the chainmask also for the 6050.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223251 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220729:
bschmidt [Sat, 18 Jun 2011 12:07:06 +0000 (12:07 +0000)]
MFC r220729:
Add some new features:
- 6000 series devices need enhanced sensitivity calibration.
- 6000 series devices need a different setting for the shadow reg.
- set the IWN_FLAG_HAS_11N bit if the EEPROM says the device has 11n
  support.

Obtained from: OpenBSD

git-svn-id: svn://svn.freebsd.org/base/stable/8@223250 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220727-220728:
bschmidt [Sat, 18 Jun 2011 12:03:30 +0000 (12:03 +0000)]
MFC r220727-220728:
- Read RX/TX chainmasks directly of the EEPROM. Some chips are known to
  have the wrong/broken information stored, keep the hardcoded values for
  those.
- Bring over the HAL/OPS changes, instead of two const structs it is now
  slightly more dynamic.

Obtained from: OpenBSD

git-svn-id: svn://svn.freebsd.org/base/stable/8@223249 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220721,220723-220726:
bschmidt [Sat, 18 Jun 2011 12:00:49 +0000 (12:00 +0000)]
MFC r220721,220723-220726:
- Rename some stuff in favour of the OpenBSD names:
  - prefer EDCA over WME
  - qid for a TXQ ID
  - reg for register values
- Shuffle code around a bit. Mostly to group functional connected things,
  others to get the same order as the OpenBSD code.
- Sync debug and error messages with OpenBSD. The device capability
  announcements are now hidden behind bootverbose.
- Sync comments with OpenBSD.
- Whitespace sync, some more style(9) conform then others.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223248 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220720:
bschmidt [Sat, 18 Jun 2011 11:56:40 +0000 (11:56 +0000)]
MFC r220720:
Fix WME/QoS handling:
- move the TX queue selection into iwn_tx_data/iwn_tx_data_raw
- extract traffic identifier and use it
- do not expect ACKs for frames marked as such

git-svn-id: svn://svn.freebsd.org/base/stable/8@223247 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220719:
bschmidt [Sat, 18 Jun 2011 11:54:44 +0000 (11:54 +0000)]
MFC r220719:
Remove if_ierrors which do not necessarily indicate a RX error, also
do account send packets. While here use the IWN_TX_FAIL constant.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223246 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220715:
bschmidt [Sat, 18 Jun 2011 11:52:58 +0000 (11:52 +0000)]
MFC r220715:
Instead of hardcoding TX rates and using that to fill the retry table
use the neogotiated ni_rates instead.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223245 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220691-220694,220700-220702,220704,220710-220711:
bschmidt [Sat, 18 Jun 2011 11:51:17 +0000 (11:51 +0000)]
MFC r220691-220694,220700-220702,220704,220710-220711:
- Remove the flags argument of iwn_dma_contig_alloc(), it is always set
  as BUS_DMA_NOWAIT. While here also set BUS_DMA_COHERENT.
- OpenBSD uses IWN_RBUF_SIZE not MJUMPAGESIZE for the RX path, also replace
  caddr_t with void * to be in sync.
- In case a new mbuf can't be loaded, reuse the old one.
- scratch_paddr has the same address pre-assigned, use that instead.
- Rewrite DMA segment handling to be more inline with the OpenBSD code.
  Also change the m_len == 0 hack to have less code churn.
- Make sure to destroy all DMA tags and maps.
- Unify TX/RX ring allocation, finish the descriptior DMA stuff before
  starting with data.
- Add missing bus_dmamap_sync calls as well as remove two duplicate ones.
- Prevent double-free, also use the same error codes as OpenBSD.
- Replace RX/TX ring allocation error messages with something more sane
  and remove those where the caller already prints one.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223244 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220689:
bschmidt [Sat, 18 Jun 2011 11:44:54 +0000 (11:44 +0000)]
MFC r220689:
RSSI related syncs with the OpenBSD code:
- read RSSI only for the active chains
- cast RSSI/NF to int8_t before passing it up to radiotap
- remove the htole64() for the timestamp

Obtained from: OpenBSD

git-svn-id: svn://svn.freebsd.org/base/stable/8@223243 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220688:
bschmidt [Sat, 18 Jun 2011 11:43:06 +0000 (11:43 +0000)]
MFC r220688:
Pass errors that might happen during state transitions up to net80211.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223242 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220687:
bschmidt [Sat, 18 Jun 2011 11:41:06 +0000 (11:41 +0000)]
MFC r220687:
Obtain the channel number directly from the laster RXON command, also
chan is an uint8_t.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223241 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220676-220677:
bschmidt [Sat, 18 Jun 2011 11:39:09 +0000 (11:39 +0000)]
MFC r220676-220677:
The 6005 series devices need additional temperature offset calibration
as well as the IWN_GP_DRIVER_CALIB_VER6 bit set.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223240 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220674:
bschmidt [Sat, 18 Jun 2011 11:36:57 +0000 (11:36 +0000)]
MFC r220674:
Revert some of local calibration changes in favour of the OpenBSD
implementation. This includes the fix required for the 6050 series
devices.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223239 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220667+220668:
bschmidt [Sat, 18 Jun 2011 11:33:55 +0000 (11:33 +0000)]
MFC r220667+220668:
Split up watchdog and calibration callout. This allows us to use different
timing on both and to remove some monitor mode specific hacks (which has
no calibration).

git-svn-id: svn://svn.freebsd.org/base/stable/8@223238 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220662:
bschmidt [Sat, 18 Jun 2011 11:31:19 +0000 (11:31 +0000)]
MFC r220662:
Split out bluetooth coexistence setup.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223237 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220661:
bschmidt [Sat, 18 Jun 2011 11:29:44 +0000 (11:29 +0000)]
MFC r220661:
Fixes for firmware handling:
- there is a local variable for sc->fw_dma, use that instead
- OpenBSD uses 5*hz to wait for firmware to be loaded
- in case the firmware module contains invalid data, actually release it

git-svn-id: svn://svn.freebsd.org/base/stable/8@223236 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220660:
bschmidt [Sat, 18 Jun 2011 11:27:28 +0000 (11:27 +0000)]
MFC r220660:
Only handle beacon misses while in RUN state and not scanning.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223234 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220659:
bschmidt [Sat, 18 Jun 2011 11:25:33 +0000 (11:25 +0000)]
MFC r220659:
Don't timeout when stopping DMA channels.

Obtained from: OpenBSD

git-svn-id: svn://svn.freebsd.org/base/stable/8@223233 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220636:
bschmidt [Sat, 18 Jun 2011 11:23:42 +0000 (11:23 +0000)]
MFC r220636:
Instead of trying to figure out which rxon.flags to clear, restart
from scratch. Remove htole16() calls, rxon.chan is an uint8_t,
ieee80211_chan2ieee() does return an ic_ieee as an int, but I heavily
doubt a htole16() will buy us anything here.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223232 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220635:
bschmidt [Sat, 18 Jun 2011 11:21:56 +0000 (11:21 +0000)]
MFC r220635:
iwn_cleanup() is just a wrapper around iwn_detach(), call it directly
instead.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223231 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220634:
bschmidt [Sat, 18 Jun 2011 11:19:12 +0000 (11:19 +0000)]
MFC r220634:
Reuse net80211 code:
- IWN_TXOP_TO_US is equal to IEEE80211_TXOP_TO_US
- use IEEE80211_DUR_TU
- ieee80211_add_rates/ieee80211_add_xrates are public, use em
- copied ieee80211_add_ssid it is not public

git-svn-id: svn://svn.freebsd.org/base/stable/8@223230 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220633:
bschmidt [Sat, 18 Jun 2011 11:17:13 +0000 (11:17 +0000)]
MFC r220633:
Remove IWN_FLAG_HAS_5GHZ and IWN_PCI_BAR0, both unused.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223229 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r216177: Remove stale link.
jh [Sat, 18 Jun 2011 05:12:54 +0000 (05:12 +0000)]
MFC r216177: Remove stale link.

PR: 151252

git-svn-id: svn://svn.freebsd.org/base/stable/8@223220 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222768:
dchagin [Fri, 17 Jun 2011 18:16:23 +0000 (18:16 +0000)]
MFC r222768:

Fix regex for ptraceopname().

PR: bin/157663
Submitted by: jason wright <jason@thought.net>

git-svn-id: svn://svn.freebsd.org/base/stable/8@223194 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r222627
rmacklem [Fri, 17 Jun 2011 16:23:50 +0000 (16:23 +0000)]
MFC: r222627
Fix the nfs related daemons so that they don't intermittently
fail with "bind: address already in use". This problem was reported
to the freebsd-stable@ mailing list on Feb. 19 under the subject
heading "statd/lockd startup failure" by george+freebsd at m5p dot com.
The problem is that the first combination of {udp,tcp X ipv4,ipv6}
would select a port# dynamically, but one of the other three combinations
would have that port# already in use. The patch is somewhat involved
because it was requested by dougb@ that the four combinations use the
same port# wherever possible. The patch splits the create_service()
function into two functions. The first goes as far as bind(2) in a
loop for up to GETPORT_MAXTRY - 1 times, attempting to use the same port#
for all four cases. If these attempts fail, the last attempt allows
the 4 cases to use different port #s. After this function has succeeded,
the second function, called complete_service(), does the rest of what
create_service() did.
The three daemons mountd, rpc.lockd and rpc.statd all have a
create_service() function that is patched in a similar way. However,
create_service() has non-trivial differences for the three daemons
that made it impractical to share the same functions between them.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223191 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r222624
rmacklem [Fri, 17 Jun 2011 16:03:00 +0000 (16:03 +0000)]
MFC: r222624
Fix the nfs related daemons so that they don't intermittently
fail with "bind: address already in use". This problem was reported
to the freebsd-stable@ mailing list on Feb. 19 under the subject
heading "statd/lockd startup failure" by george+freebsd at m5p dot com.
The problem is that the first combination of {udp,tcp X ipv4,ipv6}
would select a port# dynamically, but one of the other three combinations
would have that port# already in use. The patch is somewhat involved
because it was requested by dougb@ that the four combinations use the
same port# wherever possible. The patch splits the create_service()
function into two functions. The first goes as far as bind(2) in a
loop for up to GETPORT_MAXTRY - 1 times, attempting to use the same port#
for all four cases. If these attempts fail, the last attempt allows
the 4 cases to use different port #s. After this function has succeeded,
the second function, called complete_service(), does the rest of what
create_service() did.
The three daemons mountd, rpc.lockd and rpc.statd all have a
create_service() function that is patched in a similar way. However,
create_service() has non-trivial differences for the three daemons
that made it impractical to share the same functions between them.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223187 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r219969:
mav [Fri, 17 Jun 2011 07:05:47 +0000 (07:05 +0000)]
MFC r219969:
Make `geom XXX list` and `geom XXX status` outputs more consistent:
Add -a options to print all geoms, not only ones with providers.
Add -g option for `status` to report geom's names, not provider's.
Make `status` by default report provider's status (if present), not geom's.
Make `status` report consumer's statuses, not only "synchronized" field.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223179 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r219974, r220209, r220210, r220790:
mav [Fri, 17 Jun 2011 06:59:49 +0000 (06:59 +0000)]
MFC r219974, r220209, r220210, r220790:
Add new RAID GEOM class, that is going to replace ataraid(4) in supporting
various BIOS-based software RAIDs. Unlike ataraid(4) this implementation
does not depend on legacy ata(4) subsystem and can be used with any disk
drivers, including new CAM-based ones (ahci(4), siis(4), mvs(4), ata(4)
with `options ATA_CAM`). To make code more readable and extensible, this
implementation follows modular design, including core part and two sets
of modules, implementing support for different metadata formats and RAID
levels.

Support for such popular metadata formats is now implemented:
Intel, JMicron, NVIDIA, Promise (also used by AMD/ATI) and SiliconImage.

Such RAID levels are now supported:
RAID0, RAID1, RAID1E, RAID10, SINGLE, CONCAT.

For all of these RAID levels and metadata formats this class supports
full cycle of volume operations: reading, writing, creation, deletion,
disk removal and insertion, rebuilding, dirty shutdown detection
and resynchronization, bad sector recovery, faulty disks tracking,
hot-spare disks. For Intel and Promise formats there is support multiple
volumes per disk set.

Look graid(8) manual page for additional details.

Co-authored by: imp
Sponsored by:   Cisco Systems, Inc. and iXsystems, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223177 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r219970:
mav [Fri, 17 Jun 2011 06:23:58 +0000 (06:23 +0000)]
MFC r219970:
Introduce new type of BIO_GETATTR -- GEOM::setstate, used to inform lower
GEOM about state of it's providers from the point of upper layers.
Make geom_disk use led(4) subsystem to illuminate states in such fashion:
FAILED - "1" (on), REBUILD - "f5" (slow blink), RESYNC - "f1" (fast blink),
ACTIVE - "0" (off).
LED name should be set for each disk via kern.geom.disk.%s.led sysctl.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223176 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r219951:
mav [Fri, 17 Jun 2011 06:19:23 +0000 (06:19 +0000)]
MFC r219951:
Add simple in-kernel API for controlling leds.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223175 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r212371 (by mdf):
mav [Fri, 17 Jun 2011 06:17:45 +0000 (06:17 +0000)]
MFC r212371 (by mdf):
Fix an incorrect use of sbuf_overflowed() after a call to sbuf_finish().

git-svn-id: svn://svn.freebsd.org/base/stable/8@223174 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r219950:
mav [Fri, 17 Jun 2011 05:55:41 +0000 (05:55 +0000)]
MFC r219950:
Change BIO_GETATTR("GEOM::kerneldump") API to make set_dumper() called by
consumer (geom_dev) instead of provider (geom_disk). This allows any geom
insert it's code into the dump call chain, implementing more sophisticated
functionality then just disk partitioning.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223172 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r222541
rmacklem [Thu, 16 Jun 2011 19:47:56 +0000 (19:47 +0000)]
MFC: r222541
Add a sentence to the umount.8 man page to clarify the behaviour
for forced dismount when used on an NFS mount point.
This is a content change.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223159 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r222540
rmacklem [Thu, 16 Jun 2011 19:32:00 +0000 (19:32 +0000)]
MFC: r222540
Fix the new NFS client so that it doesn't do an NFSv3
Pathconf RPC for cases where the reply doesn't include
the answer. This fixes a problem reported by avg@ where
the NFSv3 Pathconf RPC would fail when "ls -l" did an
lpathconf(2) for _PC_ACL_NFS4.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223157 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222795 (jkim) + 222967:
delphij [Thu, 16 Jun 2011 01:52:42 +0000 (01:52 +0000)]
MFC r222795 (jkim) + 222967:

Validate INT 15h and 16h vectors more strictly.  Traditionally these entry
points are fixed addresses and (U)EFI CSM specification also mandated that.
Unfortunately, (U)EFI CSM specification does not specifically mention this
is to call service routine via interrupt vector table or to jump directly
to the entry point.  As a result, some CSM seems to install two routines
and acts differently, depending on how it was executed, unfortunately.
When INT 15h is used, it calls a function pointer (which is probably a UEFI
service function).  When it jumps directly to the entry point, it executes
a simple and traditional INT 15h service routine.  Therefore, actually there
are two possible fixes, i. e., this fix or jumping directly to the fixed
entry point.  However, we chose this fix because a) keyboard typematic
support via BIOS is becoming extremely rarer and b) we cannot support random
service routine installed by a firmware or a boot loader.  This should fix
Lenovo X220 laptop, specifically.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223134 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222454:
trociny [Wed, 15 Jun 2011 20:34:40 +0000 (20:34 +0000)]
MFC r222454:

In soreceive_generic(), if MSG_WAITALL is set but the request is
larger than the receive buffer, we have to receive in sections.
When notifying the protocol that some data has been drained the
lock is released for a moment. Returning we block waiting for the
rest of data. There is a race, when data could arrive while the
lock was released and then the connection stalls in sbwait.

Fix this by checking for data before blocking and skip blocking
if there are some.

PR: kern/154504
Reported by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
Tested by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
Reviewed by: rwatson

Approved by: pjd (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@223119 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r221887,r222158,r222379,r222451,r222512,r222661,r222715,r222882: sh:
jilles [Tue, 14 Jun 2011 20:04:23 +0000 (20:04 +0000)]
MFC r221887,r222158,r222379,r222451,r222512,r222661,r222715,r222882: sh:
New testcases that already work in stable/8.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223096 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 222530:
jhb [Tue, 14 Jun 2011 18:58:57 +0000 (18:58 +0000)]
MFC 222530:
Add a new option to toggle the display of the system idle process (per-CPU
idle threads).  The process is displayed by default (subject to whether or
not system processes are displayed) to preserve existing behavior.  The
system idle process can be hidden via the '-z' command line argument or the
'z' key while top is running.  When it is hidden, top more closely matches
the behavior of FreeBSD <= 4.x where idle time was not accounted to any
process.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223095 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 222829:
jhb [Tue, 14 Jun 2011 18:56:45 +0000 (18:56 +0000)]
MFC 222829:
Log the socket address passed as the destination to sendto() and sendmsg()
via ktrace.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223094 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 222750:
jhb [Tue, 14 Jun 2011 18:54:31 +0000 (18:54 +0000)]
MFC 222750:
Clear the device_t pointer in 'struct resource' when releasing a device
as otherwise the sysctl to export rman info can dereference a stale
pointer.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223092 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 222343, 222518, 222835
mm [Tue, 14 Jun 2011 10:50:01 +0000 (10:50 +0000)]
MFC 222343, 222518, 222835

MFC r222343 (pjd):
Silence warnings about unsupoorted value types.

MFC r222518 (pjd):
Imagine situation where a security problem is found in setuid binary.
User upgrades his system to fix the problem, but if he has any
ZFS snapshots for the file system which contains problematic binary,
any user can mount the snapshot and execute vulnerable binary.

Prevent this from happening by always mounting snapshots with
setuid turned off.

MFC r222835:
Silence notice on pool creation, import and access.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223075 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 216147 [1], 219424 [2]:
gjb [Tue, 14 Jun 2011 10:49:18 +0000 (10:49 +0000)]
MFC 216147 [1], 219424 [2]:

216147 by delphij [1]:
 - Recommend a overwrite of whole geli provider before use.
 - Correct a typo.

219424 by pjd [2]:
 - Change example wording.

PR: 155385 [2]

git-svn-id: svn://svn.freebsd.org/base/stable/8@223074 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222473:
ae [Tue, 14 Jun 2011 04:37:09 +0000 (04:37 +0000)]
MFC r222473:
  Add tablearg support for ipfw setfib.

  PR: kern/156410

MFC r222474:
  Wrap long line.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223070 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222973:
np [Tue, 14 Jun 2011 04:20:17 +0000 (04:20 +0000)]
MFC r222973:

- driver ioctl to get SGE context for any given queue
- sysctls to display the context id, cidx, and pidx of all kinds of queues.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223066 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoCherry-pick a single bit from r222958. Do not pass '3' as the sleepflag
kib [Mon, 13 Jun 2011 19:40:09 +0000 (19:40 +0000)]
Cherry-pick a single bit from r222958. Do not pass '3' as the sleepflag
to bufobj_wwait() in the ffs_syncvnode(). It only mangles the priority
argument of msleep().

Discussed with: jeff

git-svn-id: svn://svn.freebsd.org/base/stable/8@223055 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222586:
kib [Mon, 13 Jun 2011 19:33:13 +0000 (19:33 +0000)]
MFC r222586:
Fix an infinite loop in vm_object_page_clean() when the
filesystem returns permanent errors for some page writes.

To accomodate the stable/8 locking requirements, vm page queue lock
is taken around the loop in vnode_pager_undirty_pages() which modifies
m->dirty field.

Reviewed by: alc

git-svn-id: svn://svn.freebsd.org/base/stable/8@223054 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r219925:
jh [Mon, 13 Jun 2011 15:53:56 +0000 (15:53 +0000)]
MFC r219925:

Recognize "ro", "rdonly", "norw", "rw" and "noro" as equal options in
vfs_equalopts(). This allows vfs_sanitizeopts() to filter redundant
occurrences of these options. It was possible that for example both "ro"
and "rw" options became active concurrently.

PR: kern/133614

MFC r220040:

Fix some style issues in r219925.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223050 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222802:
davidxu [Mon, 13 Jun 2011 06:32:56 +0000 (06:32 +0000)]
MFC r222802:
Use p4prio_to_tsprio to calculate TS priority instead of using
p4prio_to_rtpprio which is for RT priority.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223037 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r222466
rmacklem [Sun, 12 Jun 2011 02:05:59 +0000 (02:05 +0000)]
MFC: r222466
Modify the umount(8) command so that it doesn't do
a sync(2) syscall before unmount(2) for the "-f" case.
This avoids a forced dismount from getting stuck for
an NFS mountpoint in sync() when the server is not
responsive. With this commit, forced dismounts should
normally work for the NFS clients, but can take up to
about 1minute to complete.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223003 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r222464
rmacklem [Sun, 12 Jun 2011 01:48:31 +0000 (01:48 +0000)]
MFC: r222464
Add a check for MNTK_UNMOUNTF at the beginning of nfs_sync()
in the old NFS client so that a forced dismount doesn't
get stuck in the VFS_SYNC() call that happens before
VFS_UNMOUNT() in dounmount(). Analagous to r222329 for the new NFS client.
An additional change is needed before forced dismounts will work.

git-svn-id: svn://svn.freebsd.org/base/stable/8@223002 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 222758, 222759, 222770:
gjb [Sat, 11 Jun 2011 00:30:56 +0000 (00:30 +0000)]
MFC 222758, 222759, 222770:

- Document that when running 'su -m <user> -c <command>', <command> is
  run within a shell as <user>.
- Bump date
- Attempt to clear up some confusion in the following example, by
  stating the '-c' argument is passed to the shell, not to su(1), which
  would indicate the login class.

      'su -m <user> -c <command>'

PR: 157078

git-svn-id: svn://svn.freebsd.org/base/stable/8@222965 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 198714 [1]:
gjb [Fri, 10 Jun 2011 23:42:03 +0000 (23:42 +0000)]
MFC 198714 [1]:

- The majors file was removed long ago, 0 should be used instead.

PR: 139230
Original commit by: brueffer

git-svn-id: svn://svn.freebsd.org/base/stable/8@222961 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 222532:
jhb [Fri, 10 Jun 2011 19:16:26 +0000 (19:16 +0000)]
MFC 222532:
- Document the -H option and 'H' key alongside other options and keys
  rather than at the bottom of the manpage.
- Remove an obsolete comment about SWAIT being a stale state.  It was
  resurrected for a different purpose in FreeBSD 5 to mark idle ithreads.
- Add a comment documenting that the SLEEP and LOCK states typically
  display the name of the event being waited on with lock names being
  prefixed with an asterisk and sleep event names not having a prefix.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222948 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 221079:
jhb [Fri, 10 Jun 2011 19:13:22 +0000 (19:13 +0000)]
MFC 221079:
Generate the network byte order version of the window size structure in a
temporary variable on the stack and then copy that into the output buffer
so that the htons() conversions use aligned accesses.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222947 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 222660:
jhb [Fri, 10 Jun 2011 19:12:00 +0000 (19:12 +0000)]
MFC 222660:
- Rename the Cronyx Omega2-PCI entry to Exar XR17C158 since that is the
  real owner of the device ID.  Also rename the associated config
  function while here.
- Add support for the 2-port and 4-port Exar parts as well: Exar XR17C/D152
  and Exar XR17C154.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222946 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 222651:
jhb [Fri, 10 Jun 2011 19:08:07 +0000 (19:08 +0000)]
MFC 222651:
Properly return an ENOBUFS error if a write to a tun(4) device fails
due to m_uiotombuf() failing.

While here, trim unneeded error handling related to tuninit() since it
can never fail.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222944 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 222254:
jhb [Fri, 10 Jun 2011 19:03:17 +0000 (19:03 +0000)]
MFC 222254:
Fix an issue with critical sections and SMP rendezvous handlers.
Specifically, a critical_exit() call that drops the nesting level to zero
has a brief window where the pending preemption flag is set and the
nesting level is set to zero.  This is done purposefully to avoid races
where a preemption scheduled by an interrupt could be lost otherwise (see
revision 144777).  However, this does mean that if an interrupt fires
during this window and enters and exits a critical section, it may preempt
from the interrupt context.  This is generally fine as the interrupt code
is careful to arrange critical sections so that they are not exited until
it is safe to preempt (e.g. interrupts EOI'd and masked if necessary).

However, the SMP rendezvous IPI handler does not quite follow this rule,
and in general a rendezvous can never be preempted.  Rendezvous handlers
are also not permitted to schedule threads to execute, so they will not
typically trigger preemptions.  SMP rendezvous handlers may use
spinlocks (carefully) such as the rm_cleanIPI() handler used in rmlocks,
but using a spinlock also enters and exits a critical section.  If the
interrupted top-half code is in the brief window of critical_exit() where
the nesting level is zero but a preemption is pending, then releasing the
spinlock can trigger a preemption.  Because we know that SMP rendezvous
handlers can never schedule a thread, we know that a critical_exit() in
an SMP rendezvous handler will only preempt in this edge case.  We also
know that the top-half thread will happily handle the deferred preemption
once the SMP rendezvous has completed, so the preemption will not be lost.

This makes it safe to employ a workaround where we use a nested critical
section in the SMP rendezvous code itself around rendezvous action
routines to prevent any preemptions during an SMP rendezvous.  The
workaround intentionally avoids checking for a deferred preemption
when leaving the critical section on the assumption that if there is a
pending preemption it will be handled by the interrupted top-half code.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222942 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 222252:
jhb [Fri, 10 Jun 2011 18:58:32 +0000 (18:58 +0000)]
MFC 222252:
Simplify a stale assertion.  We have not called mi_switch() from a nested
critical section during a preemption for several years.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222940 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 222032:
jhb [Fri, 10 Jun 2011 18:55:58 +0000 (18:55 +0000)]
MFC 222032:
Fix a race in the SMP rendezvous code.  Specifically, the write by the
last CPU to to finish the rendezvous action may become visible to
different CPUs at different times.  As a result, the CPU that initiated
the rendezvous may exit the rendezvous and drop the lock allowing another
rendezvous to be initiated on the same CPU or a different CPU.  In that
case the exit sentinel may be cleared before all CPUs have noticed causing
those CPUs to hang forever.

Workaround this by using a generation count to notice when this race
occurs and to exit the rendezvous in that case.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222938 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 220794:
jhb [Fri, 10 Jun 2011 18:51:22 +0000 (18:51 +0000)]
MFC 220794:
When checking to see if a window update should be sent to the remote peer,
don't force a window update if the window would not actually grow due to
window scaling.  Specifically, if the window scaling factor is larger than
2 * MSS, then after the local reader has drained 2 * MSS bytes from the
socket, a window update can end up advertising the same window.  If this
happens, the supposed window update actually ends up being a duplicate ACK.
This can result in an excessive number of duplicate ACKs when using a
higher maximum socket buffer size.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222936 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 221209:
jhb [Fri, 10 Jun 2011 18:46:40 +0000 (18:46 +0000)]
MFC 221209:
TCP reuses t_rxtshift to determine the backoff timer used for both the
persist state and the retransmit timer.  However, the code that implements
"bad retransmit recovery" only checks t_rxtshift to see if an ACK has been
received in during the first retransmit timeout window.  As a result, if
ticks has wrapped over to a negative value and a socket is in the persist
state, it can incorrectly treat an ACK from the remote peer as a
"bad retransmit recovery" and restore saved values such as snd_ssthresh and
snd_cwnd.  However, if the socket has never had a retransmit timeout, then
these saved values will be zero, so snd_ssthresh and snd_cwnd will be set
to 0.

If the socket is in fast recovery (this can be caused by excessive
duplicate ACKs such as those fixed by 220794), then each ACK that arrives
triggers either NewReno or SACK partial ACK handling which clamps snd_cwnd
to be no larger than snd_ssthresh.  In effect, the socket's send window
is permamently stuck at 0 even though the remote peer is advertising a
much larger window and pending data is only sent via TCP window probes
(so one byte every few seconds).

Fix this by adding a new TCP pcb flag (TF_PREVVALID) that indicates that
the various snd_*_prev fields in the pcb are valid and only perform
"bad retransmit recovery" if this flag is set in the pcb.  The flag is set
on the first retransmit timeout that occurs and is cleared on subsequent
retransmit timeouts or when entering the persist state.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222934 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r222389
rmacklem [Fri, 10 Jun 2011 13:28:14 +0000 (13:28 +0000)]
MFC: r222389
Fix the new NFS client so that it handles NFSv4 state
correctly during a forced dismount. This required that
the exclusive and shared (refcnt) sleep lock functions check
for MNTK_UMOUNTF before sleeping, so that they won't block
while nfscl_umount() is getting rid of the state. As
such, a "struct mount *" argument was added to the locking
functions. I believe the only remaining case where a forced
dismount can get hung in the kernel is when a thread is
already attempting to do a TCP connect to a dead server
when the krpc client structure called nr_client is NULL.
This will only happen just after a "mount -u" with options
that force a new TCP connection is done, so it shouldn't
be a problem in practice.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222931 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r208582 (by mjacob):
mav [Fri, 10 Jun 2011 10:43:49 +0000 (10:43 +0000)]
MFC r208582 (by mjacob):
Add a new primitive, XPT_SCAN_TGT, to cover the range between scanning a
whole bus (XPT_SCAN_BUS) and a single lun on that bus (XPT_SCAN_LUN).

It's less resource comsumptive than scanning a whole bus when the
caller knows only one target has changes.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222928 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222520:
mav [Fri, 10 Jun 2011 10:13:40 +0000 (10:13 +0000)]
MFC r222520:
Add quirks to hint 4K physical sector (Advanced Format) for ATA disks not
reporting it properly (none? of known disks now).

Hitachi and WDC AF disks seem could be identified more or less formally.
For Seagate and Samsung enumerate some found models/series.
For other disks it can be forced with kern.cam.ada.X.quirks=1 tunable.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222927 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220778, r220785:
mav [Fri, 10 Jun 2011 10:09:48 +0000 (10:09 +0000)]
MFC r220778, r220785:
Remove some unused variables.

Found with:     Clang Static Analyzer

git-svn-id: svn://svn.freebsd.org/base/stable/8@222926 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220690 (by jh):
mav [Fri, 10 Jun 2011 09:58:48 +0000 (09:58 +0000)]
MFC r220690 (by jh):
Move a comment to the right place. The rearrange done in r208928 left
the comment to a wrong place.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222925 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220686 (by jh):
mav [Fri, 10 Jun 2011 09:57:48 +0000 (09:57 +0000)]
MFC r220686 (by jh):
Move TUNABLE_INT_FETCH() out of the SIM lock to avoid sleeping while
holding the lock. The fix is analogous to r220618 for ada(4).

git-svn-id: svn://svn.freebsd.org/base/stable/8@222924 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220644:
mav [Fri, 10 Jun 2011 09:54:48 +0000 (09:54 +0000)]
MFC r220644:
Make CAM report devices with ATA/SATA transport to devstat(9) as IDE.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222923 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r206112, r208928 (by mjacob):
mav [Fri, 10 Jun 2011 09:51:15 +0000 (09:51 +0000)]
MFC r206112, r208928 (by mjacob):
Rearrange how things are done to avoid dereferencing stale pointers in
the case of immediate unconfigure after configure. Hold the periph an
extra count while we have the task to create sysctl context outstanding
so that the periph doesn't go away unexpectedly.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222922 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222652:
mav [Fri, 10 Jun 2011 09:18:43 +0000 (09:18 +0000)]
MFC r222652:
Update disk's stripesize and stripeoffset parameters on provider open.
They are media-dependent and may change in run-time, same as sectorsize
and/or mediasize.

SCSI devices return physical sector size and offset via READ CAPACITY(16)
command and so can not report it until media inserted or at least until
probe sequence completed. UNMAP support is also reported there.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222921 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r221101:
mav [Fri, 10 Jun 2011 09:12:09 +0000 (09:12 +0000)]
MFC r221101:
Implement relaxed comparision for hardcoded provider names to make it
ignore adX/adaY difference in both directions to simplify migration to
the CAM-based ATA or back.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222920 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222306:
mav [Fri, 10 Jun 2011 08:59:30 +0000 (08:59 +0000)]
MFC r222306:
Add Marvell 88SE9172 chip PCI ID.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222919 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222304:
mav [Fri, 10 Jun 2011 08:58:13 +0000 (08:58 +0000)]
MFC r222304:
Marvell 88SE91xx controllers are known to report soft-reset completion
without waiting for device readiness (or at least not updating FIS receive
area in time). To workaround that, special quirk was added earlier to wait
for the FIS receive area update. But it was found that under same PCI ID
0x91231b4b and revision 0x11 there are two completely different chip
versions (firmware?): HBA and RAID. The problem is that RAID version in
some cases, such as hot-plug, does not update FIS receive area at all!

To workaround that, differentiate the chip versions by their capabilities,
and, if RAID version found, skip FIS receive area update waiting and read
device signature from the PxSIG register instead. This method doesn't work
for HBA version when PMP attached, so keep using previous workaround there.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222918 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222285:
mav [Fri, 10 Jun 2011 08:54:52 +0000 (08:54 +0000)]
MFC r222285:
According to SATA specification, when Serial ATA Enclosure Management Bridge
(SEMB) is unable to communicate to Storage Enclosure Processor (SEP), in
response to hard and soft resets it should among other things return value
0x7F in Status register. The weird side is that it means DRQ bit set, which
tells that reset request is not completed. It would be fine if SEMB was the
only device on port. But if SEMB connected to PMP or built into it, it may
block access to other devices sharing same SATA port.

Make some tunings/fixes to soft-reset handling to workaround the issue:
 - ahci(4): request CLO on the port after soft reset to ignore DRQ bit;
 - siis(4): gracefully reinitialize port after soft reset timeout (hardware
doesn't detect reset request completion in this case);
 - mvs(4): if PMP is used, send dummy soft-reset to the PMP port to make it
clear DRQ bit for us.

For now this makes quirks in ata_pmp.c, hiding SEMB ports of SiI3726/SiI4726
PMPs, less important.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222917 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC rr222039:
mav [Fri, 10 Jun 2011 08:49:38 +0000 (08:49 +0000)]
MFC rr222039:
Add support for "LED" enclosure management messages, defined by the AHCI.

When supported by hardware, this allows to control per-port activity, locate
and fault LEDs via the led(4) API for localization and status reporting
purposes. Supporting AHCI controllers may transmit that information to the
backplane controllers via SGPIO interface. Backplane controllers interpret
received statuses in some way (IBPI standard) to report them using present
indicators.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222916 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r220929:
mav [Fri, 10 Jun 2011 08:32:33 +0000 (08:32 +0000)]
MFC r220929:
According to ATA specifications, when ATAPI master is the only device, it
should respond with all zeroes to any access to slave registers. Test with
PATA devices confirmed such behavior. Unluckily, Intel SATA controllers in
legacy emulation mode behave differently, not making any difference between
ATA and ATAPI devices. It causes false positive slave device detection and,
as result, command timeouts.

To workaround this problem, mask result of legacy-emulated soft-reset with
the device presence information received from the SATA-specific registers.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222915 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r221423, r221424, r221426, r221428, r221434:
netchild [Fri, 10 Jun 2011 07:54:38 +0000 (07:54 +0000)]
MFC r221423, r221424, r221426, r221428, r221434:

  This is v4l2 support for the linuxulator. This allows to access FreeBSD
  native devices which support the v4l2 API from processes running within
  the linuxulator, e.g. skype or flash can access the multimedia/pwcbsd
  or multimedia/webcamd supplied drivers.

MFC r221425:

  Fix typo in comment, improve comment.

MFC tested by: nox

git-svn-id: svn://svn.freebsd.org/base/stable/8@222914 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222647:
ru [Fri, 10 Jun 2011 06:11:33 +0000 (06:11 +0000)]
MFC r222647:

Don't pass -o1- to groff(1) by default.  If ms(7) formatted document
uses the .RP macro, a separate cover page is created as page 0 which
is not otherwise output.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222913 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222589:
emaste [Fri, 10 Jun 2011 03:27:25 +0000 (03:27 +0000)]
MFC r222589:

  There are a couple of structs in mfireg.h with members named 'class'.
  These cause problems when trying to include the header in a C++ project.
  Rename them to 'evt_class', and track the change in mfi and mfiutil.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222912 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r221793: nc(1) from OpenBSD 4.9.
delphij [Fri, 10 Jun 2011 01:15:23 +0000 (01:15 +0000)]
MFC r221793: nc(1) from OpenBSD 4.9.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222909 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222603:
ae [Thu, 9 Jun 2011 10:43:36 +0000 (10:43 +0000)]
MFC r222603:
  Do not hide stripeoffset from libgeom(3), it may be useful even when
  stripesize is zero.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222895 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222757:
mm [Thu, 9 Jun 2011 10:04:11 +0000 (10:04 +0000)]
MFC r222757:

Remove empty #ifndef

git-svn-id: svn://svn.freebsd.org/base/stable/8@222894 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r222720,222721: corrections to amdsbwd.4
avg [Thu, 9 Jun 2011 08:30:46 +0000 (08:30 +0000)]
MFC r222720,222721: corrections to amdsbwd.4

git-svn-id: svn://svn.freebsd.org/base/stable/8@222892 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r221527: prepare code that does topology detection for amd cpus for bulldozer
avg [Thu, 9 Jun 2011 08:25:56 +0000 (08:25 +0000)]
MFC r221527: prepare code that does topology detection for amd cpus for bulldozer

git-svn-id: svn://svn.freebsd.org/base/stable/8@222891 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r219791:
dchagin [Thu, 9 Jun 2011 05:24:28 +0000 (05:24 +0000)]
MFC r219791:

Remove dead code.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222889 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r219783, r219786:
dchagin [Thu, 9 Jun 2011 05:23:28 +0000 (05:23 +0000)]
MFC r219783, r219786:

A bit rearranged rtalloc1_fib() code.
To avoid code duplication move the miss label to line up and jump on it.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222888 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r219776:
dchagin [Thu, 9 Jun 2011 05:21:08 +0000 (05:21 +0000)]
MFC r219776:

Remove a now unused variable.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222887 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r222329
rmacklem [Thu, 9 Jun 2011 01:10:39 +0000 (01:10 +0000)]
MFC: r222329
Add a check for MNTK_UNMOUNTF at the beginning of nfs_sync()
in the new NFS client so that a forced dismount doesn't
get stuck in the VFS_SYNC() call that happens before
VFS_UNMOUNT() in dounmount().
Additional changes are needed before forced dismounts will work.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222886 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r221784:
dchagin [Wed, 8 Jun 2011 21:39:00 +0000 (21:39 +0000)]
MFC r221784:

Remove wrong comment.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222881 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r215013 by mdf@:
dchagin [Wed, 8 Jun 2011 21:36:36 +0000 (21:36 +0000)]
MFC r215013 by mdf@:

Whitespace and other aspects of style(9).  No functional changes.

MFC r220730:

Remove malloc(9) return value checks when M_WAITOK is used.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222880 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 222328:
jhb [Wed, 8 Jun 2011 21:32:14 +0000 (21:32 +0000)]
MFC 222328:
For Timedia multiport serial adapters, the first two ports use a SUN1889
which uses a non-standard clock (* 8) while any additional ports use
SUN1699 chips which use a standard clock.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222879 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 222093:
jhb [Wed, 8 Jun 2011 21:29:12 +0000 (21:29 +0000)]
MFC 222093:
Add support for the SIIG Cyber 2S PCIe adapter.  It is based on an
Oxford Semiconductor OX16PCI954 but uses only two ports with a non-default
clock rate.

git-svn-id: svn://svn.freebsd.org/base/stable/8@222877 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f