]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years ago[mdoc] remove a hard sentence break.
ru [Thu, 5 May 2011 10:17:08 +0000 (10:17 +0000)]
[mdoc] remove a hard sentence break.

13 years agoFormatting fixes:
ae [Thu, 5 May 2011 09:55:55 +0000 (09:55 +0000)]
Formatting fixes:
 o Fix date
 o Break sentences
 o Remove trailing whitespaces
 o Sort xrefs by section number

Requested by: ru
MFC after: 2 weeks

13 years agoAdd nvram2env (untested) and geom_map (tested) to PB92.
adrian [Thu, 5 May 2011 09:04:49 +0000 (09:04 +0000)]
Add nvram2env (untested) and geom_map (tested) to PB92.

13 years agoDon't perform NF calibration for radio chains which aren't in use:
adrian [Thu, 5 May 2011 08:11:22 +0000 (08:11 +0000)]
Don't perform NF calibration for radio chains which aren't in use:

Quoting the ath9k commit message:

At present the noise floor calibration is processed in supported
control and extension chains rather than required chains.
Unnccesarily doing nfcal in all supported chains leads to
invalid nf readings on extn chains and these invalid values
got updated into history buffer. While loading those values
from history buffer is moving the chip to deaf state.

This issue was observed in AR9002/AR9003 chips while doing
associate/dissociate in HT40 mode and interface up/down
in iterative manner. After some iterations, the chip was moved
to deaf state. Somehow the pci devices are recovered by poll work
after chip reset. Raading the nf values in all supported extension chains
when the hw is not yet configured in HT40 mode results invalid values.

Reference: https://patchwork.kernel.org/patch/753862/

Obtained from: Linux ath9k

13 years agoMerge two upstream patches from vendor branch. No functional changes.
des [Thu, 5 May 2011 08:08:18 +0000 (08:08 +0000)]
Merge two upstream patches from vendor branch.  No functional changes.

13 years agoAnother Howl (AR9130) fix.
adrian [Thu, 5 May 2011 04:43:05 +0000 (04:43 +0000)]
Another Howl (AR9130) fix.

I haven't seen a 5ghz AR9130 based board yet though!

Obtained from: Atheros

13 years agoFix up the chipset checks for the AR5416 and later silicon.
adrian [Thu, 5 May 2011 03:42:04 +0000 (03:42 +0000)]
Fix up the chipset checks for the AR5416 and later silicon.

The checks should function as follows:

* AR_SREV_<silicon> : check macVersion matches that version id
* AR_SREV_<silicon>_<revision> : check macVersion and macRevision match
    the version / revision respectively

* AR_SREV_<silicon>_<revision>_OR_LATER: check that
  + if the chip silicon version == macVersion, enforce revision >= macRevision
  + if the chip silicon version > macVersion, allow it.

For example, AR_SREV_MERLIN() only matches AR9280 (any revision),
AR_SREV_MERLIN_10() would only match AR9280 version 1.0, but
AR_SREV_MERLIN_20_OR_LATER() matches AR9280 version >= 2.0 _AND_
any subsequent MAC (So AR9285, AR9287, etc.)

The specific fixes which may impact users:

* if there is Merlin hardware > revision 2.0, it'll now be correctly
  matched by AR_SREV_MERLIN_20_OR_LATER() - the older code simply
  would match on either Merlin 2.0 or a subsequent MAC (AR9285, AR9287, etc.)

* Kite version 1.1/1.2 should now correctly match. As these macros
  are used in the AR9285 reset/attach path, and it's assumed that the
  hardware is kite anyway, the behaviour shouldn't change. It'll only
  change if these macros are used in other codepaths shared with
  older silicon.

Obtained from: Linux ath9k, Atheros

13 years agoImport some HOWL (AR9130) related fixes from Atheros.
adrian [Thu, 5 May 2011 02:59:31 +0000 (02:59 +0000)]
Import some HOWL (AR9130) related fixes from Atheros.

Obtained from: Atheros

13 years agoT4 packet timestamps.
np [Thu, 5 May 2011 02:38:08 +0000 (02:38 +0000)]
T4 packet timestamps.

Reference code that shows how to get a packet's timestamp out of
cxgbe(4).  Disabled by default because we don't have a standard way
today to pass this information up the stack.

The timestamp is 60 bits wide and each increment represents 1 tick of
the T4's core clock.  As an example, the timestamp granularity is ~4.4ns
for this card:

# sysctl dev.t4nex.0.core_clock
dev.t4nex.0.core_clock: 228125

MFC after: 1 week

13 years agoGuard ptrdiff_t.
obrien [Thu, 5 May 2011 02:35:25 +0000 (02:35 +0000)]
Guard ptrdiff_t.

13 years ago1. If PKG_DBDIR cannot be determined from make, set the default
dougb [Thu, 5 May 2011 02:35:11 +0000 (02:35 +0000)]
1. If PKG_DBDIR cannot be determined from make, set the default
2. Add the -H flag to tar in case /var/db/pkg itself is a symlink
3. Direct stderr to /dev/null to suppress the leading slash warning [1]

PR: ports/156810 [1]
Submitted by: Jeremy Chadwick <freebsd@jdc.parodius.com> [1]

13 years agoT4 packet filtering/steering.
np [Thu, 5 May 2011 02:04:56 +0000 (02:04 +0000)]
T4 packet filtering/steering.

- Enable 5-tuple and every-packet lookup.

- Setup the default filter mode to allow filtering/steering based on IP
  protocol, ingress port, inner VLAN ID, IP frag, FCoE, and MPS match
  type; all combined together.  You can also filter based on MAC index,
  Ethernet type, IP TOS/IPv6 Traffic Class, and outer VLAN ID but you'll
  have to modify the default filter mode and exclude some of the
  match-fields in it.

  IPv4 and IPv6 SIP/DIP/SPORT/DPORT are always available in all filter
  rules.

- Add driver ioctls to get/set the global filter mode.

- Add driver ioctls to program and delete hardware filters.  A couple of
  the "switch" actions that rewrite Ethernet and VLAN information and
  switch the packet out of another port may not work as the L2 code is not
  yet in place.  Everything else, including all "drop" and "pass" rules
  with RSS or absolute qid, should work.

Obtained from:  Chelsio Communications

13 years agoModify the NFS nfssvc(2) syscall so that it allows
rmacklem [Thu, 5 May 2011 02:00:53 +0000 (02:00 +0000)]
Modify the NFS nfssvc(2) syscall so that it allows
anyone to get the statistics for the new NFS subsystem.

MFC after: 2 weeks

13 years agolibarchive is mixing libmd and libcrypto -- correct to use one or the other.
obrien [Thu, 5 May 2011 01:16:06 +0000 (01:16 +0000)]
libarchive is mixing libmd and libcrypto -- correct to use one or the other.
[mixing the two can be quite bad -- they define the same context structures,
 but with differing structure members (and sizes)]

Update the hash function support comments, and update config_freebsd.h
to match.

Approved by: kientzle

13 years agos/shaN_crypt/crypt_shaN/g to be a more consistent with the existing naming.
obrien [Thu, 5 May 2011 01:09:42 +0000 (01:09 +0000)]
s/shaN_crypt/crypt_shaN/g to be a more consistent with the existing naming.

Reviewed by: markm

13 years agoFix boot on old machines (e.g. blue and white G3s) by synthesizing a
nwhitehorn [Thu, 5 May 2011 00:52:19 +0000 (00:52 +0000)]
Fix boot on old machines (e.g. blue and white G3s) by synthesizing a
512-byte sector map instead unused space in the first 2048-byte sector.

13 years agoCorrect the kernel config name printed out during install.
obrien [Thu, 5 May 2011 00:43:55 +0000 (00:43 +0000)]
Correct the kernel config name printed out during install.

PR: 156579
Submitted by: dhw

13 years agoEnable Ethernet@WireSpeed for BCM5718/BCM57765 family. While I'm
yongari [Thu, 5 May 2011 00:43:40 +0000 (00:43 +0000)]
Enable Ethernet@WireSpeed for BCM5718/BCM57765 family. While I'm
here inverse meaning of PHY flag as Ethernet@WireSpeed is enabled
for most PHYs.

13 years agoFix the new NFS client so that it handles the 64bit fields
rmacklem [Thu, 5 May 2011 00:11:09 +0000 (00:11 +0000)]
Fix the new NFS client so that it handles the 64bit fields
that are now in "struct statfs" for NFSv3 and NFSv4. Since
the ffiles value is uint64_t on the wire, I clip the value
to INT64_MAX to avoid setting f_ffree negative.

Tested by: kib
MFC after: 2 weeks

13 years agoRepair release CD generation on PC98 and sun4v after release building
nwhitehorn [Wed, 4 May 2011 23:41:11 +0000 (23:41 +0000)]
Repair release CD generation on PC98 and sun4v after release building
changes, and backport the new logic (ISO images are TARGET dependant, not
TARGET_CPUARCH dependant) to Makefile.sysinstall. While modifying ISO
image scripts, change several archs to use makefs (from base) instead of
mkisofs (from ports) which makes release CD generation both faster and
self-hosting.

13 years agoChange the way powerpc bootable CDs are generated to work around a bug
nwhitehorn [Wed, 4 May 2011 23:34:10 +0000 (23:34 +0000)]
Change the way powerpc bootable CDs are generated to work around a bug
in hybrid image generation in cdrtools. This produces a small HFS partition
containing loader, mapped in by an oddly-formed APM table using a new
feature in makefs. This does not appear to work yet on early-model G3
systems, which will be fixed later, but produces bootable CDs on
everything else.

13 years agoAlways re-arm an iq's interrupt before leaving the handler.
np [Wed, 4 May 2011 23:07:30 +0000 (23:07 +0000)]
Always re-arm an iq's interrupt before leaving the handler.

MFC after: 1 week

13 years agosh: Apply set -u to variables in arithmetic.
jilles [Wed, 4 May 2011 22:12:22 +0000 (22:12 +0000)]
sh: Apply set -u to variables in arithmetic.

Note that this only applies to variables that are actually used.
Things like (0 && unsetvar) do not cause an error.

Exp-run done by: pav (with some other sh(1) changes)

13 years agoAdd a comment noting that the NFS code assumes that the
rmacklem [Wed, 4 May 2011 22:02:33 +0000 (22:02 +0000)]
Add a comment noting that the NFS code assumes that the
values of error numbers in sys/errno.h will be the same
as the ones specified by the NFS RFCs and that the code
needs to be fixed if error numbers are changed in sys/errno.h.

Suggested by: Peter Jeremy
MFC after: 2 weeks

13 years agosh: Detect an error for ${#var<GARBAGE>}.
jilles [Wed, 4 May 2011 21:49:34 +0000 (21:49 +0000)]
sh: Detect an error for ${#var<GARBAGE>}.

In particular, this makes things like ${#foo[0]} and ${#foo[@]} errors
rather than silent equivalents of ${#foo}.

PR: bin/151720
Submitted by: Mark Johnston
Exp-run done by: pav (with some other sh(1) changes)

13 years agoImplement Resource Pooling V2 and an MPTCP like congestion
tuexen [Wed, 4 May 2011 21:27:05 +0000 (21:27 +0000)]
Implement Resource Pooling V2 and an MPTCP like congestion
control.
Based on a patch received from Martin Becke.

MFC after: 2 weeks.

13 years agoUpdate nfsstat.1 to reflect the changes done to nfsstat(1)
rmacklem [Wed, 4 May 2011 20:28:06 +0000 (20:28 +0000)]
Update nfsstat.1 to reflect the changes done to nfsstat(1)
by r221455. This includes a new "-o" option for displaying
statistics from the old NFS client/server and a slightly
different description for the "-e" option.
This is a content change.

13 years agoModify nfsstat(1) so that it reports statistics for the
rmacklem [Wed, 4 May 2011 20:13:26 +0000 (20:13 +0000)]
Modify nfsstat(1) so that it reports statistics for the
new NFS client/server by default, in a format compatible
with the old NFS client/server. Also add a "-o" flag that
forces nfsstat(1) to get statistics for the old NFS
client/server.

13 years agoModify nfsstat(1) so that it prints out the buffer cache
rmacklem [Wed, 4 May 2011 19:28:44 +0000 (19:28 +0000)]
Modify nfsstat(1) so that it prints out the buffer cache
stats in the same way for the new client as the old one.

MFC after: 2 weeks

13 years agoRemove unneeded code.
ae [Wed, 4 May 2011 18:41:26 +0000 (18:41 +0000)]
Remove unneeded code.

MFC after: 1 week

13 years agoRemove unneeded code.
ae [Wed, 4 May 2011 18:26:45 +0000 (18:26 +0000)]
Remove unneeded code.

MFC after: 1 week

13 years agoRemove unneeded code.
ae [Wed, 4 May 2011 18:17:21 +0000 (18:17 +0000)]
Remove unneeded code.

MFC after: 1 week

13 years agoRemove unneeded tab after .Ed to make manlint happy.
gjb [Wed, 4 May 2011 18:16:05 +0000 (18:16 +0000)]
Remove unneeded tab after .Ed to make manlint happy.

Reported by: manlint

13 years agoRemoved KASSERT, g_new_providerf() can not fail.
ae [Wed, 4 May 2011 18:06:40 +0000 (18:06 +0000)]
Removed KASSERT, g_new_providerf() can not fail.

MFC after: 1 week

13 years agoEncode horizontal scroll events (AC Pan) as button presses (bit 5 and 6)
emax [Wed, 4 May 2011 17:58:15 +0000 (17:58 +0000)]
Encode horizontal scroll events (AC Pan) as button presses (bit 5 and 6)

Submitted by: David Demelier demelier dot david at gmail dot com
MFC after: 1 week

13 years agoRemove "for a moment" assignment. struct g_geom zeroed when allocated.
ae [Wed, 4 May 2011 17:56:53 +0000 (17:56 +0000)]
Remove "for a moment" assignment. struct g_geom zeroed when allocated.

MFC after: 1 week

13 years agoRemove unneeded checks, g_new_xxx functions can not fail.
ae [Wed, 4 May 2011 17:37:37 +0000 (17:37 +0000)]
Remove unneeded checks, g_new_xxx functions can not fail.

MFC after: 1 week

13 years agoAdd initial BCM57765 family support. The BCM57765 family seems to
yongari [Wed, 4 May 2011 17:04:31 +0000 (17:04 +0000)]
Add initial BCM57765 family support. The BCM57765 family seems to
have similar hardware features of BCM5718 family except the number
of receive return ring is 4. The BCM57765 family is known to
support IEEE 802.3az EEE(Energy Efficient Ethernet) but this change
does not include EEE support code. I hope EEE is implemented in
near future.
This change will support BCM57761, BCM57765, BCM57781, BCM57785,
BCM57791 and BCM57795. All hardware offloading features are
supported and suspend/resume also should work.
Many thanks to Broadcom for continuing support of FreeBSD.

Tested by: Paul Thornton (prt <> prt dot org)
HW donated by: Broadcom

13 years agoRevert by accident r221441.
attilio [Wed, 4 May 2011 14:52:17 +0000 (14:52 +0000)]
Revert by accident r221441.

13 years agoRemove the previously added comment.
attilio [Wed, 4 May 2011 14:37:01 +0000 (14:37 +0000)]
Remove the previously added comment.
Probabilly me is the only one who didn't know userland and kerneland sizes
were mismatching.

13 years agoFix nfsstat.c so that the "-z" option works for the new
rmacklem [Wed, 4 May 2011 13:50:37 +0000 (13:50 +0000)]
Fix nfsstat.c so that the "-z" option works for the new
NFS subsystem.

MFC after: 2 weeks

13 years agoAdd kernel support for NFSSVC_ZEROCLTSTATS and NFSSVC_ZEROSRVSTATS
rmacklem [Wed, 4 May 2011 13:36:18 +0000 (13:36 +0000)]
Add kernel support for NFSSVC_ZEROCLTSTATS and NFSSVC_ZEROSRVSTATS
so that they can be used by nfsstat(1) to implement the "-z" option
for the new NFS subsystem.

MFC after: 2 weeks

13 years agoRevert r221306, since NFSSVC_ZEROSTATS zero'd both client and
rmacklem [Wed, 4 May 2011 13:30:38 +0000 (13:30 +0000)]
Revert r221306, since NFSSVC_ZEROSTATS zero'd both client and
server stats, when separate modifiers for NFSSVC_GETSTATS for
each of client and server stats is what it required by nfsstat(1).

13 years agoImplemented a mount option "nocto" that disables cache coherency
ru [Wed, 4 May 2011 13:27:45 +0000 (13:27 +0000)]
Implemented a mount option "nocto" that disables cache coherency
checking at open time.  It may improve performance for read-only
NFS mounts.  Use deliberately.

MFC after: 1 week
Reviewed by: rmacklem, jhb (earlier version)

13 years agoRevert r221308, since it incorrectly zero'd both client and
rmacklem [Wed, 4 May 2011 13:20:44 +0000 (13:20 +0000)]
Revert r221308, since it incorrectly zero'd both client and
server stats when "-c" or "-s" was specified.

13 years agoCommit the missing linux_videdev2_compat.h (lost somewhere between
netchild [Wed, 4 May 2011 13:09:20 +0000 (13:09 +0000)]
Commit the missing linux_videdev2_compat.h (lost somewhere between
commit tree patch generation -> successful compile tree build test -> commmit).

Pointy hat to: netchild

13 years agoWhen checking existence of providers skip those which are orphaned.
ae [Wed, 4 May 2011 12:59:11 +0000 (12:59 +0000)]
When checking existence of providers skip those which are orphaned.

PR: kern/132273
MFC after: 2 week

13 years agoThe security run requests unmaskable output, even if the only output is to
netchild [Wed, 4 May 2011 12:48:02 +0000 (12:48 +0000)]
The security run requests unmaskable output, even if the only output is to
tell that there is a separate email or that the output is logged to a file.

This commit changes the return code for the non-inline case to tell that
this message is not important enough and can be masked if necessary. The
messages from the security checks themself are not affected by this and
show up as before in the periodic security email/file.

The inline case still requests to not mask the output, as with the current
way of handling this there is no easy way to handle this.

PR: 138692
Analysis/patch atch by: Chris Cowart <ccowart@timesinks.net>
X-MFC after: on request

13 years agoRegression tests for Capsicum capability mode.
jonathan [Wed, 4 May 2011 12:44:46 +0000 (12:44 +0000)]
Regression tests for Capsicum capability mode.

Ensure that system calls that access global namespaces, e.g. open(2), are not permitted, and that whitelisted sysctls like kern.osreldate are.

Approved by: rwatson
Sponsored by: Google, Inc.

13 years agoUse proper return codes (valuable output, invalid config, problems).
netchild [Wed, 4 May 2011 12:37:10 +0000 (12:37 +0000)]
Use proper return codes (valuable output, invalid config, problems).

MFC after: 1 week

13 years agoIn ncl_printf(), call vprintf() instead of printf().
ru [Wed, 4 May 2011 11:22:52 +0000 (11:22 +0000)]
In ncl_printf(), call vprintf() instead of printf().

MFC after: 3 days

13 years agoAdd FEATURE macros for v4l and v4l2 to the linuxulator.
netchild [Wed, 4 May 2011 09:52:34 +0000 (09:52 +0000)]
Add FEATURE macros for v4l and v4l2 to the linuxulator.

Suggested by: ae

13 years agoRemove this useless bit of code for Kite. The RIFS register value is overriden
adrian [Wed, 4 May 2011 09:26:33 +0000 (09:26 +0000)]
Remove this useless bit of code for Kite. The RIFS register value is overriden
by the initvals, so disabling RIFS before calling writeIni() effectively does
nothing.

13 years agoThis is v4l2 support for the linuxulator. This allows to access FreeBSD
netchild [Wed, 4 May 2011 09:05:39 +0000 (09:05 +0000)]
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.

Submitted by: nox
MFC after: 1 month

13 years agoFix typo in comment, improve comment.
netchild [Wed, 4 May 2011 08:42:31 +0000 (08:42 +0000)]
Fix typo in comment, improve comment.

13 years agoAdd explanation about the use-permission and FreeBSDify it.
netchild [Wed, 4 May 2011 08:41:55 +0000 (08:41 +0000)]
Add explanation about the use-permission and FreeBSDify it.

13 years agoCopy the v4l2 header unchanged from the vendor branch.
netchild [Wed, 4 May 2011 08:31:58 +0000 (08:31 +0000)]
Copy the v4l2 header unchanged from the vendor branch.

13 years agoAdd the v4l2 header now that we have an use case for it.
netchild [Wed, 4 May 2011 08:21:24 +0000 (08:21 +0000)]
Add the v4l2 header now that we have an use case for it.

13 years agoUpgrade to OpenSSH 5.8p2.
des [Wed, 4 May 2011 07:34:44 +0000 (07:34 +0000)]
Upgrade to OpenSSH 5.8p2.

13 years agoMake sure to run make obj before release. Trying to run them in one step
nwhitehorn [Wed, 4 May 2011 02:52:41 +0000 (02:52 +0000)]
Make sure to run make obj before release. Trying to run them in one step
doesn't always work reliably.

13 years agoFix some corner cases in the net80211 sequence number retransmission
adrian [Wed, 4 May 2011 02:23:59 +0000 (02:23 +0000)]
Fix some corner cases in the net80211 sequence number retransmission
handling.

The current sequence number code does a few things incorrectly:

* It didn't try eliminating duplications from HT nodes. I guess it's assumed
  that out of order / retransmission handling would be handled by the AMPDU RX
  routines. If a HT node isn't doing AMPDU RX, then retransmissions need to
  be eliminated. Since most of my debugging is based on this (as AMPDU TX
  software packet aggregation isn't yet handled), handle this corner case.

* When a sequence number of 4095 was received, any subsequent sequence number
  is going to be (by definition) less than 4095. So if the following sequence
  number (0) doesn't initially occur and the retransmit is received, it's
  incorrectly eliminated by the IEEE80211_FC1_RETRY && SEQ_LEQ() check.
  Try to handle this better.

This almost completely eliminates out of order TCP statistics showing up during
iperf testing for the 11a, 11g and non-aggregate 11n AMPDU RX case. The only
other packet loss conditions leading to this are due to baseband resets or
heavy interference.

13 years agoRemove code with any effect.
tuexen [Tue, 3 May 2011 20:34:02 +0000 (20:34 +0000)]
Remove code with any effect.

13 years agoAdd a missing break. This bug was introduced in r221249.
tuexen [Tue, 3 May 2011 20:32:21 +0000 (20:32 +0000)]
Add a missing break. This bug was introduced in r221249.

MFC after: 1 week

13 years agoConvert the last use of xcopyout() to ddi_copyout() and remove the now
marius [Tue, 3 May 2011 20:13:27 +0000 (20:13 +0000)]
Convert the last use of xcopyout() to ddi_copyout() and remove the now
unused xcopyin() as well as xcopyout().
MFC together with r219089.

Approved by: mm

13 years ago- Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOP
marius [Tue, 3 May 2011 19:51:29 +0000 (19:51 +0000)]
- Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOP
  (reporting IFM_LOOP based on BMCR_LOOP is left in place though as
  it might provide useful for debugging). For most mii(4) drivers it
  was unclear whether the PHYs driven by them actually support
  loopback or not. Moreover, typically loopback mode also needs to
  be activated on the MAC, which none of the Ethernet drivers using
  mii(4) implements. Given that loopback media has no real use (and
  obviously hardly had a chance to actually work) besides for driver
  development (which just loopback mode should be sufficient for
  though, i.e one doesn't necessary need support for loopback media)
  support for it is just dropped as both NetBSD and OpenBSD already
  did quite some time ago.
- Let mii_phy_add_media() also announce the support of IFM_NONE.
- Restructure the PHY entry points to use a structure of entry points
  instead of discrete function pointers, and extend this to include
  a "reset" entry point. Make sure any PHY-specific reset routine is
  always used, and provide one for lxtphy(4) which disables MII
  interrupts (as is done for a few other PHYs we have drivers for).
  This includes changing NIC drivers which previously just called the
  generic mii_phy_reset() to now actually call the PHY-specific reset
  routine, which might be crucial in some cases. While at it, the
  redundant checks in these NIC drivers for mii->mii_instance not being
  zero before calling the reset routines were removed because as soon
  as one PHY driver attaches mii->mii_instance is incremented and we
  hardly can end up in their media change callbacks etc if no PHY driver
  has attached as mii_attach() would have failed in that case and not
  attach a miibus(4) instance.
  Consequently, NIC drivers now no longer should call mii_phy_reset()
  directly, so it was removed from EXPORT_SYMS.
- Add a mii_phy_dev_attach() as a companion helper to mii_phy_dev_probe().
  The purpose of that function is to perform the common steps to attach
  a PHY driver instance and to hook it up to the miibus(4) instance and to
  optionally also handle the probing, addition and initialization of the
  supported media. So all a PHY driver without any special requirements
  has to do in its bus attach method is to call mii_phy_dev_attach()
  along with PHY-specific MIIF_* flags, a pointer to its PHY functions
  and the add_media set to one. All PHY drivers were updated to take
  advantage of mii_phy_dev_attach() as appropriate. Along with these
  changes the capability mask was added to the mii_softc structure so
  PHY drivers taking advantage of mii_phy_dev_attach() but still
  handling media on their own do not need to fiddle with the MII attach
  arguments anyway.
- Keep track of the PHY offset in the mii_softc structure. This is done
  for compatibility with NetBSD/OpenBSD.
- Keep track of the PHY's OUI, model and revision in the mii_softc
  structure. Several PHY drivers require this information also after
  attaching and previously had to wrap their own softc around mii_softc.
  NetBSD/OpenBSD also keep track of the model and revision on their
  mii_softc structure. All PHY drivers were updated to take advantage
  as appropriate.
- Convert the mebers of the MII data structure to unsigned where
  appropriate. This is partly inspired by NetBSD/OpenBSD.
- According to IEEE 802.3-2002 the bits actually have to be reversed
  when mapping an OUI to the MII ID registers. All PHY drivers and
  miidevs where changed as necessary. Actually this now again allows to
  largely share miidevs with NetBSD, which fixed this problem already
  9 years ago. Consequently miidevs was synced as far as possible.
- Add MIIF_NOMANPAUSE and mii_phy_flowstatus() calls to drivers that
  weren't explicitly converted to support flow control before. It's
  unclear whether flow control actually works with these but typically
  it should and their net behavior should be more correct with these
  changes in place than without if the MAC driver sets MIIF_DOPAUSE.

Obtained from: NetBSD (partially)
Reviewed by: yongari (earlier version), silence on arch@ and net@

13 years agoFix prototype for ffsll(3) and fls(3).
delphij [Tue, 3 May 2011 19:33:06 +0000 (19:33 +0000)]
Fix prototype for ffsll(3) and fls(3).

PR: docs/156796
Submitted by: Jean-Yves Migeon <jeanyves.migeon free.fr>
MFC after: 3 days

13 years agoUse make_dev_alias_p() added in r221397 to create alias dev entry.
mav [Tue, 3 May 2011 19:12:42 +0000 (19:12 +0000)]
Use make_dev_alias_p() added in r221397 to create alias dev entry.
It removes panic in case if alias name is already busy for some reason.

13 years agoDocument make_dev_alias_p().
ae [Tue, 3 May 2011 18:55:16 +0000 (18:55 +0000)]
Document make_dev_alias_p().

MFC after: 2 weeks

13 years agoAdd make_dev_alias_p() function. It is similar to make_dev_alias(),
ae [Tue, 3 May 2011 18:54:18 +0000 (18:54 +0000)]
Add make_dev_alias_p() function. It is similar to make_dev_alias(),
but it may return an error like make_dev_p() does.

Reviewed by: kib (previous version)
MFC after: 2 weeks

13 years agoEnable the new PCI-PCI bridge driver on amd64 and i386 by default. It can
jhb [Tue, 3 May 2011 18:23:11 +0000 (18:23 +0000)]
Enable the new PCI-PCI bridge driver on amd64 and i386 by default.  It can
be disabled via 'nooptions NEW_PCIB'.

13 years agoReimplement how PCI-PCI bridges manage their I/O windows. Previously the
jhb [Tue, 3 May 2011 17:37:24 +0000 (17:37 +0000)]
Reimplement how PCI-PCI bridges manage their I/O windows.  Previously the
driver would verify that requests for child devices were confined to any
existing I/O windows, but the driver relied on the firmware to initialize
the windows and would never grow the windows for new requests.  Now the
driver actively manages the I/O windows.

This is implemented by allocating a bus resource for each I/O window from
the parent PCI bus and suballocating that resource to child devices.  The
suballocations are managed by creating an rman for each I/O window.  The
suballocated resources are mapped by passing the bus_activate_resource()
call up to the parent PCI bus.  Windows are grown when needed by using
bus_adjust_resource() to adjust the resource allocated from the parent PCI
bus.  If the adjust request succeeds, the window is adjusted and the
suballocation request for the child device is retried.

When growing a window, the rman_first_free_region() and
rman_last_free_region() routines are used to determine if the front or
end of the existing I/O window is free.  From using that, the smallest
ranges that need to be added to either the front or back of the window
are computed.  The driver will first try to grow the window in whichever
direction requires the smallest growth first followed by the other
direction if that fails.

Subtractive bridges will first attempt to satisfy requests for child
resources from I/O windows (including attempts to grow the windows).  If
that fails, the request is passed up to the parent PCI bus directly
however.

The PCI-PCI bridge driver will try to use firmware-assigned ranges for
child BARs first and only allocate a "fresh" range if that specific range
cannot be accommodated in the I/O window.  This allows systems where the
firmware assigns resources during boot but later wipes the I/O windows
(some ACPI BIOSen are known to do this) to "rediscover" the original I/O
window ranges.

The ACPI Host-PCI bridge driver has been adjusted to correctly honor
hw.acpi.host_mem_start and the I/O port equivalent when a PCI-PCI bridge
makes a wildcard request for an I/O window range.

The new PCI-PCI bridge driver is only enabled if the NEW_PCIB kernel option
is enabled.  This is a transition aide to allow platforms that do not
yet support bus_activate_resource() and bus_adjust_resource() in their
Host-PCI bridge drivers (and possibly other drivers as needed) to use the
old driver for now.  Once all platforms support the new driver, the
kernel option and old driver will be removed.

PR: kern/143874 kern/149306
Tested by: mav

13 years agoGive some sort of message when the program is not run as root.
gnn [Tue, 3 May 2011 16:00:36 +0000 (16:00 +0000)]
Give some sort of message when the program is not run as root.
Root privileges are required to talk to the device.

Submitted by: Sriram Rapuru at Wipro for Exar Inc.
MFC after: 2 weeks

13 years agoDon't pass empty mount options to nmount(2).
jh [Tue, 3 May 2011 16:00:26 +0000 (16:00 +0000)]
Don't pass empty mount options to nmount(2).

Reviewed by: pjd
MFC after: 2 weeks

13 years agoAdd in support for multicast.
gnn [Tue, 3 May 2011 15:58:24 +0000 (15:58 +0000)]
Add in support for multicast.

Submitted by: Sriram Rapuru at @ Wipro for Exar Inc.
MFC after: 2 weeks

13 years agoSNDCTL_DSP_GETIPTR: set pointer to sndbuf_getfreeptr()
avg [Tue, 3 May 2011 15:50:22 +0000 (15:50 +0000)]
SNDCTL_DSP_GETIPTR: set pointer to sndbuf_getfreeptr()

Rationale:
- unlike current behavior this seems to be compliant with OSS
  specification:
  http://manuals.opensound.com/developer/SNDCTL_DSP_GETIPTR.html
- this seems to meet expectations of some OSS programs compiled for or
  ported from Linux, e.g. ALSA OSS plugin
- this doesn't seem to break any programs as far as current testing
  shows

Tested by: nox, hselasky
MFC after: 4 days

13 years agoAdd support for synthesizing an APM partition map to map Mac PowerPC
nwhitehorn [Tue, 3 May 2011 15:12:01 +0000 (15:12 +0000)]
Add support for synthesizing an APM partition map to map Mac PowerPC
bootstrap partitions from the ISO9660 boot catalog. This preserves OS X's
ability to mount the CD, while allowing us a way to provide HFS-ified
bootstrap code for Open Firmware.

13 years agoFix stack smash problem in makeinfo, by increasing buffer sizes in
dim [Tue, 3 May 2011 14:43:16 +0000 (14:43 +0000)]
Fix stack smash problem in makeinfo, by increasing buffer sizes in
current_chapter_number().

13 years agoFixed the HISTORY section which was copied without editing from aio(4).
ru [Tue, 3 May 2011 13:34:40 +0000 (13:34 +0000)]
Fixed the HISTORY section which was copied without editing from aio(4).

Submitted by: Igor Sysoev

13 years agoDo not report legacy unit numbers (do not create legacy aliases) for disks
mav [Tue, 3 May 2011 13:16:02 +0000 (13:16 +0000)]
Do not report legacy unit numbers (do not create legacy aliases) for disks
on port multiplier ports above first two. They don't fit into ATA_STATIC_ID
scheme and so can't be mapped properly. No need to pollute dev.

13 years agoFixed bad format and misorder.
ru [Tue, 3 May 2011 12:29:03 +0000 (12:29 +0000)]
Fixed bad format and misorder.

13 years agoUpdated `flags' field description.
ru [Tue, 3 May 2011 12:22:46 +0000 (12:22 +0000)]
Updated `flags' field description.

13 years agoUpdate to a 1-May-2011 release (except for the isblank change).
ru [Tue, 3 May 2011 11:47:19 +0000 (11:47 +0000)]
Update to a 1-May-2011 release (except for the isblank change).

13 years agoVendor import of OpenSSH 5.8p2
des [Tue, 3 May 2011 11:22:37 +0000 (11:22 +0000)]
Vendor import of OpenSSH 5.8p2

13 years agoCall pam_setcred() before login_getpwclass to support home directories
dfr [Tue, 3 May 2011 10:18:27 +0000 (10:18 +0000)]
Call pam_setcred() before login_getpwclass to support home directories
on GSS-API authenticated NFS where the kerberos credentials need to be
saved so that the kernel can authenticate to the NFS server.

13 years agoProperly detect interface's state in the LINK_STATE_UNKNOWN case.
ru [Tue, 3 May 2011 10:11:44 +0000 (10:11 +0000)]
Properly detect interface's state in the LINK_STATE_UNKNOWN case.

MFC after: 1 week

13 years agoDon't call -f option's argument "stdin".
ru [Tue, 3 May 2011 10:08:11 +0000 (10:08 +0000)]
Don't call -f option's argument "stdin".

MFC after: 3 days

13 years agoRename DEBUG macro to TFTP_DEBUG, to be more consistent with
rodrigc [Tue, 3 May 2011 07:46:02 +0000 (07:46 +0000)]
Rename DEBUG macro to TFTP_DEBUG, to be more consistent with
debug macros in other files.

13 years ago- Comment out unused variable.
rodrigc [Tue, 3 May 2011 07:43:47 +0000 (07:43 +0000)]
- Comment out unused variable.
- Add parentheses around expression to eliminate compiler warning.

13 years agoAdd #include <netinet/in_pcb.h> for missing forward declation of
rodrigc [Tue, 3 May 2011 07:39:54 +0000 (07:39 +0000)]
Add #include <netinet/in_pcb.h> for missing forward declation of
struct inpcb.

13 years agoAdd "-a alignment" option to gpart(8). When it specified gpart(8)
ae [Tue, 3 May 2011 07:33:39 +0000 (07:33 +0000)]
Add "-a alignment" option to gpart(8). When it specified gpart(8)
tries to align partition start offset and size to be multiple of
alignment value.

MFC after: 2 weeks

13 years agoChange the way rctl interfaces with jails by introducing prison_racct
trasz [Tue, 3 May 2011 07:32:58 +0000 (07:32 +0000)]
Change the way rctl interfaces with jails by introducing prison_racct
structure, which acts as a proxy between them.  This makes jail rules
persistent, i.e. they can be added before jail gets created, and they
don't disappear when the jail gets destroyed.

13 years agoSwitch to ANSI function prototypes in a few places.
rodrigc [Tue, 3 May 2011 04:44:50 +0000 (04:44 +0000)]
Switch to ANSI function prototypes in a few places.
Get rid of some unused parameter warnings.

13 years agoFix corner case where the size is a power of two.
marcel [Tue, 3 May 2011 01:43:04 +0000 (01:43 +0000)]
Fix corner case where the size is a power of two.

13 years ago- Fixed a typo in an if() statement when setting flow control for MTU
davidch [Mon, 2 May 2011 23:34:33 +0000 (23:34 +0000)]
- Fixed a typo in an if() statement when setting flow control for MTU
  greater than 5000 bytes.

Submitted by: yongari

13 years agoAdd LINT-NOINET6 which we have inofficially supported for years
bz [Mon, 2 May 2011 22:54:24 +0000 (22:54 +0000)]
Add LINT-NOINET6 which we have inofficially supported for years
and our users complained when broken.
Similarly add LINT-NOINET, and for at least documentation purposes add
LINT-NOIP (which compiles out INET and INET6 and couple of NIC drivers).

Tested by: make universe (if you broke it since you fix it)
Reviewed by: gnn
Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems
MFC after: 2 weeks

13 years agoClang r130700 can now compile sys/boot/i386/boot2 with room to spare.
dim [Mon, 2 May 2011 21:13:08 +0000 (21:13 +0000)]
Clang r130700 can now compile sys/boot/i386/boot2 with room to spare.

13 years agoMinor updates to the clang and tblgen manpages.
dim [Mon, 2 May 2011 21:10:13 +0000 (21:10 +0000)]
Minor updates to the clang and tblgen manpages.

13 years agoHandle a rare edge case with nearly full TCP receive buffers. If a TCP
jhb [Mon, 2 May 2011 21:05:52 +0000 (21:05 +0000)]
Handle a rare edge case with nearly full TCP receive buffers.  If a TCP
buffer fills up causing the remote sender to enter into persist mode, but
there is still room available in the receive buffer when a window probe
arrives (either due to window scaling, or due to the local application
very slowing draining data from the receive buffer), then the single byte
of data in the window probe is accepted.  However, this can cause rcv_nxt
to be greater than rcv_adv.  This condition will only last until the next
ACK packet is pushed out via tcp_output(), and since the previous ACK
advertised a zero window, the ACK should be pushed out while the TCP
pcb is write-locked.

During the window while rcv_nxt is greather than rcv_adv, a few places
would compute the remaining receive window via rcv_adv - rcv_nxt.
However, this value was then (uint32_t)-1.  On a 64 bit machine this
could expand to a positive 2^32 - 1 when cast to a long.  In particular,
when calculating the receive window in tcp_output(), the result would be
that the receive window was computed as 2^32 - 1 resulting in advertising
a far larger window to the remote peer than actually existed.

Fix various places that compute the remaining receive window to either
assert that it is not negative (i.e. rcv_nxt <= rcv_adv), or treat the
window as full if rcv_nxt is greather than rcv_adv.

Reviewed by: bz
MFC after: 1 month

13 years agoUpgrade our copy of llvm/clang to r130700, from upstream's trunk.
dim [Mon, 2 May 2011 21:04:37 +0000 (21:04 +0000)]
Upgrade our copy of llvm/clang to r130700, from upstream's trunk.

13 years agoCorrect spelling in comments.
marius [Mon, 2 May 2011 21:04:23 +0000 (21:04 +0000)]
Correct spelling in comments.

Submitted by: brucec