]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoAdd in specific TDMA logging types.
adrian [Tue, 27 Nov 2012 02:24:05 +0000 (02:24 +0000)]
Add in specific TDMA logging types.

11 years agoFix the TDMA nexttbtt programming for 802.11n chips.
adrian [Tue, 27 Nov 2012 02:23:45 +0000 (02:23 +0000)]
Fix the TDMA nexttbtt programming for 802.11n chips.

The existing logic wrapped programming nexttbtt at 65535 TU.
This is not good enough for the 11n chips, whose nexttbtt register
(GENERIC_TIMER_0) has an initial value from 0..2^31-1 TSF.
So converting the TU to TSF had the counter wrap at (65535 << 10) TSF.

Once this wrap occured, the nexttbtt value was very very low, much
lower than the current TSF value.  At this point, the nexttbtt timer
would constantly fire, leading to the TX queue being constantly gated
open.. and when this occured, the sender was not correctly transmitting
in its slot but just able to continuously transmit.  The master would
then delay transmitting its beacon until after the air became free
(which I guess would be after the burst interval, before the next burst
interval would quickly follow) and that big delta in master beacon TX
would start causing big swings in the slot timing adjustment.

With this change, the nexttbtt value is allowed to go all the way up
to the maximum value permissable by the 32 bit representation.
I haven't yet tested it to that point; I really should.  The AR5212
HAL now filters out values above 65535 TU for the beacon configuration
(and the relevant legal values for SWBA, DBA and NEXTATIM) and the
AR5416 HAL just dutifully programs in what it should.

With this, TDMA is now useful on the 802.11n chips.

Tested:

* AR5416, AR9280 TDMA slave
* AR5413 TDMA slave

11 years agoAdd a note about the magic values here; don't change them.
adrian [Tue, 27 Nov 2012 02:19:35 +0000 (02:19 +0000)]
Add a note about the magic values here; don't change them.

11 years agoWhen programming the beacon timer configuration, be very explicit about
adrian [Tue, 27 Nov 2012 02:18:41 +0000 (02:18 +0000)]
When programming the beacon timer configuration, be very explicit about
what the maximum legal values are.

The current beacon timer configuration from TDMA wraps things at
HAL_BEACON_PERIOD-1 TU.  For the 11a chips this is fine, but for
the 11n chips it's not enough resolution.  Since the 11a chips have a
limit on what's "valid", just enforce this so when I do write larger
values in, they get suitably wrapped before programming.

Tested:

* AR5413, TDMA slave

Todo:

* Run it for a (lot) longer on a clear channel, ensure that no strange
  slippages occur.
* Re-validate this on STA configurations, just to be sure.

11 years agoAllow this file to build on FreeBSD.
jmallett [Tue, 27 Nov 2012 02:03:41 +0000 (02:03 +0000)]
Allow this file to build on FreeBSD.

11 years agoAdd NOTES and Makefile in order to generate LINT. NOTES contains pretty
marcel [Tue, 27 Nov 2012 01:17:50 +0000 (01:17 +0000)]
Add NOTES and Makefile in order to generate LINT. NOTES contains pretty
much all the union of all the kernel configuration files, including all
the CPU types, Marvell SOC types and at91 board types. Any device not
supported (read: does not compile) has been removed, which is a fairly
small set actually. As such, LINT gives us very good coverage without
having to build a zillion kernels.

11 years agoAllow building LINT by defining both SAMPLE_AT_RESET on the one hand
marcel [Tue, 27 Nov 2012 01:10:58 +0000 (01:10 +0000)]
Allow building LINT by defining both SAMPLE_AT_RESET on the one hand
and SAMPLE_AT_RESET_{LO|HI} on the other. It doesn't matter which
values they take, as long as they are defined.

11 years agoDon't include arm/xscale/i8134x/i81342reg.h when we're compiling LINT.
marcel [Tue, 27 Nov 2012 01:08:05 +0000 (01:08 +0000)]
Don't include arm/xscale/i8134x/i81342reg.h when we're compiling LINT.
The definitions in i81342reg.h clash with those in i80321reg.h.

11 years agoRemove print_kernel_section_addr(). All statements in that function
marcel [Tue, 27 Nov 2012 01:05:07 +0000 (01:05 +0000)]
Remove print_kernel_section_addr(). All statements in that function
expand to uncompilable code when the kernel configuration contains
"options DEBUG", such as it is for LINT. The toolchain is often a
better approach to figure this out, as it doesn't require one to
boot the kernel.

11 years agoDon't define intr_disable and intr_restore as macros. The macros
marcel [Tue, 27 Nov 2012 00:41:39 +0000 (00:41 +0000)]
Don't define intr_disable and intr_restore as macros. The macros
interfere with structure fields of the same name in drivers, like
the intr_disable function pointer in struct cphy_ops in cxgb(4).
Instead define intr_disable and intr_restore as inline functions.

With intr_disable() an inline function, the I32_bit and F32_bit
macros now need to be visible in MI code and given the rather
poor names, this is not at all good. Define ARM_CPSR_F32 and
ARM_CPSR_I32 and use that instead of F32_bit and I32_bit (resp)
for now.

11 years agoUnbreak building a kernel with EHCI: there's no ehci_atmelarm.c.
marcel [Mon, 26 Nov 2012 23:30:47 +0000 (23:30 +0000)]
Unbreak building a kernel with EHCI: there's no ehci_atmelarm.c.

11 years agoPull in r168610 from upstream libc++:
dim [Mon, 26 Nov 2012 21:32:31 +0000 (21:32 +0000)]
Pull in r168610 from upstream libc++:

  When using libc++ headers on FreeBSD, in combination with -std=c++98,
  -ansi or -std=c++03, the long long type is not supported.  So in this
  case, several functions and types, like lldiv_t, strtoll(), are not
  declared.

This should make it possible to use the libc++ headers in c++98 mode.

Note: libc++ is originally designed as a c++0x or higher library, so you
should still take care when using it with c++98 or c++03.

Noted by: Yamaya Takashi <yamayan@kbh.biglobe.ne.jp>
MFC after: 1 week

11 years agoFix problem with the Samsung 840 PRO series SSD detection.
mav [Mon, 26 Nov 2012 20:07:10 +0000 (20:07 +0000)]
Fix problem with the Samsung 840 PRO series SSD detection.
The device reports support for SATA Asynchronous Notification in its
IDENTIFY data, but returns error on attempt to enable that feature.
Make SATA XPT of CAM only report these errors, but not fail the device.

MFC after: 1 week

11 years ago drbr_enqueue() awlays consumes mbuf, no matter did it
glebius [Mon, 26 Nov 2012 20:03:57 +0000 (20:03 +0000)]
  drbr_enqueue() awlays consumes mbuf, no matter did it
fail or not. The mbuf pointer is no longer valid, so
can't be reused after.

  Fix igb_mq_start() where mbuf pointer was used after
drbr_enqueue().

  This eventually leads us to all invocations of
igb_mq_start_locked() called with third argument as NULL.
This allows us to simplify this function.

Submitted by: Karim Fodil-Lemelin <fodillemlinkarim gmail.com>
Reviewed by: jfv

11 years agoRe-initialize eh pointer after m_adj()
glebius [Mon, 26 Nov 2012 19:45:01 +0000 (19:45 +0000)]
Re-initialize eh pointer after m_adj()

Submitted by: Kohji Okuno <okuno.kohji jp.panasonic.com>
Reviewed by: yongari

11 years agoFix typo in weekly line which made it to rotated after reaching > 1 Kb.
glebius [Mon, 26 Nov 2012 19:42:38 +0000 (19:42 +0000)]
Fix typo in weekly line which made it to rotated after reaching > 1 Kb.

PR: conf/173857
Submitted by: Matt Smith <matt xtaz.co.uk>

11 years agoAdd support for sctp_peeloff() also in the front states of the
tuexen [Mon, 26 Nov 2012 16:44:03 +0000 (16:44 +0000)]
Add support for sctp_peeloff() also in the front states of the
association.

MFC after: 3 days

11 years agoFind the endpoint for an incoming packet also if the endpoint
tuexen [Mon, 26 Nov 2012 16:43:32 +0000 (16:43 +0000)]
Find the endpoint for an incoming packet also if the endpoint
comes from sctp_peeloff().

MFC after: 3 days

11 years agoUpdate manpage dates in zfs.8 and zpool.8
mm [Mon, 26 Nov 2012 13:16:55 +0000 (13:16 +0000)]
Update manpage dates in zfs.8 and zpool.8

MFC after: 2 weeks

11 years agoMFV r243395:
mm [Mon, 26 Nov 2012 12:24:39 +0000 (12:24 +0000)]
MFV r243395:

Introduce a new dataset aclmode setting "restricted" to protect ACL's
being destroyed or corrupted by a drive-by chmod.

illumos-gate 13889:a67716f16746
3254 add support in zfs for aclmode=restricted

References:
https://www.illumos.org/issues/3254

MFC after: 2 weeks

11 years agoAllow shutdown() to be used on fds returned from sctp_peeloff().
tuexen [Mon, 26 Nov 2012 08:50:00 +0000 (08:50 +0000)]
Allow shutdown() to be used on fds returned from sctp_peeloff().

MFC after: 3 days

11 years agoProvide an option to users to shoot themselves in the foot.
eadler [Mon, 26 Nov 2012 05:11:07 +0000 (05:11 +0000)]
Provide an option to users to shoot themselves in the foot.

Reviewed by: bapt
Approved by: cperciva
MFC after: 1 month

11 years agoUse modern license instead of being consistent with the other pkg_ tools
eadler [Mon, 26 Nov 2012 05:11:03 +0000 (05:11 +0000)]
Use modern license instead of being consistent with the other pkg_ tools
Use a more informative message
Fix some style(9) nits.
Bump version number
In pkg_add only warn users after the chroot is performed.

Submitted by: gavin, jilles
Reviewed by: beat, bapt
Approved by: cperciva
MFC after: 1 month

11 years ago- smbfs_rename() might return an error value without correctly upgrading
davide [Mon, 26 Nov 2012 04:29:47 +0000 (04:29 +0000)]
- smbfs_rename() might return an error value without correctly upgrading
the vnode use count, and this might cause the kernel to panic if compiled
with WITNESS enable.
- Be sure to put the '\0' terminator to the rpath string.

Sponsored by: iXsystems inc.

11 years agoFix uninitialized variable reported by gcc, but not clang.
mav [Mon, 26 Nov 2012 02:04:11 +0000 (02:04 +0000)]
Fix uninitialized variable reported by gcc, but not clang.

11 years agoRemove extra sbuf_trim() copy/pasted into r243530.
mav [Mon, 26 Nov 2012 01:54:00 +0000 (01:54 +0000)]
Remove extra sbuf_trim() copy/pasted into r243530.

11 years agoAdd a primitive to check if a lock is not owned.
adrian [Mon, 26 Nov 2012 00:06:55 +0000 (00:06 +0000)]
Add a primitive to check if a lock is not owned.

11 years agoAdd my mentor relationships to committers-ports.dot
bar [Sun, 25 Nov 2012 21:32:13 +0000 (21:32 +0000)]
Add my mentor relationships to committers-ports.dot

Approved by: flo (mentor)

11 years agoOn multiple requests, compact HDA driver verbose output by hiding CODEC's
mav [Sun, 25 Nov 2012 20:06:01 +0000 (20:06 +0000)]
On multiple requests, compact HDA driver verbose output by hiding CODEC's
detailed information under the sound debug.  To make it easier accessible,
export that information through the set of sysctls like dev.hdaa.X.nidY.
Also tune some output to make it both more compact and informative.

11 years agoMake a few small changes to vm_map_pmap_enter():
alc [Sun, 25 Nov 2012 19:42:36 +0000 (19:42 +0000)]
Make a few small changes to vm_map_pmap_enter():

Add detail to the comment describing this function.  In particular,
describe what MAP_PREFAULT_PARTIAL does.

Eliminate the abrupt change in behavior when the specified address range
grows from MAX_INIT_PT pages to MAX_INIT_PT plus one pages.  Instead of
doing nothing, i.e., preloading no mappings whatsoever, map any resident
pages that fall within the start of the specified address range, i.e.,
[addr, addr + ulmin(size, ptoa(MAX_INIT_PT))).

Long ago, the vm object's list of resident pages was not ordered, so
this function had to choose between probing the global hash table of
all resident pages and iterating over the vm object's unordered list of
resident pages.  Now, the list is ordered, so there is no reason for
MAP_PREFAULT_PARTIAL to be concerned with the vm object's count of
resident changes.

MFC after: 14 days

11 years agoLook for zombie process only if we were given process id.
pjd [Sun, 25 Nov 2012 19:31:42 +0000 (19:31 +0000)]
Look for zombie process only if we were given process id.

Reviewed by: kib
MFC after: 2 weeks
X-MFC-after-or-with: 243142

11 years agoPrint kernel args when booting the kernel.
kientzle [Sun, 25 Nov 2012 18:22:53 +0000 (18:22 +0000)]
Print kernel args when booting the kernel.

11 years agoAdd loader(8) tunable to enable/disable nopwrite functionality:
mm [Sun, 25 Nov 2012 16:54:43 +0000 (16:54 +0000)]
Add loader(8) tunable to enable/disable nopwrite functionality:
vfs.zfs.nopwrite_enabled

MFC after: 2 weeks

11 years agoMFV r243013 and r243267:
mm [Sun, 25 Nov 2012 16:32:07 +0000 (16:32 +0000)]
MFV r243013 and r243267:

Import the zio nop-write improvement from Illumos. To reduce I/O,
nop-write omits overwriting data if the checksum (cryptographically
secure) of new data matches the checksum of existing data.
It also saves space if snapshots are in use.

It currently works only on datasets with enabled compression, disabled
deduplication and sha256 checksums.

IllumOS 13887:196932ec9e6a and 13888:7204b3392a58
3236 zio nop-write

References:
https://www.illumos.org/issues/3236

MFC after: 2 weeks

11 years agoFix spelling.
kientzle [Sun, 25 Nov 2012 16:19:12 +0000 (16:19 +0000)]
Fix spelling.

11 years agozfs_freebsd_reclaim: remove a stray variable
avg [Sun, 25 Nov 2012 15:46:29 +0000 (15:46 +0000)]
zfs_freebsd_reclaim: remove a stray variable

... which leaked from a subsequent local change.
Unfortunately I noticed that only after commit.

MFC after: 5 weeks
X-MFC with: r243520

11 years agozfs: overhaul zfs-vfs glue for vnode life-cycle management
avg [Sun, 25 Nov 2012 15:33:26 +0000 (15:33 +0000)]
zfs: overhaul zfs-vfs glue for vnode life-cycle management

* There is no need for the delayed destruction of znodes via taskqueue,
now that we do not need to fear recursion from getnewvnode into
zfs_inactive and zfs_freebsd_reclaim, thus making znode/vnode state
machine a bit simpler.

* More complete porting of zfs_inactive from Solaris VFS model to FreeBSD
vop_inactive and vop_reclaim model.  All destructive actions are done
in zfs_freebsd_reclaim.
This allows to simplify zfs_zget logic.

* Allow zfs_zget to return a doomed vnode if the current thread already
has an exclusive lock on the vnode.

* Clean up Solaris-isms like bailing out of reclaim/inactive on certain
values of v_usecount (aka v_count) or directly messing with this counter.

* Do not clear z_vnode while znode is still accessible.
z_vnode should be cleared only after zfs_znode_dmu_fini.
Otherwise zfs_zget may get an effectively half-deconstructed znode.
This allows to simplify zfs_zget logic further.

The above changes fix at least two known/reported problems:

o An indefinite wait in the following code path:
vgone -> VOP_RECLAIM -> zfs_freebsd_reclaim -> vnode_destroy_vobject ->
put_pages -> zfs_write -> zil_commit -> zfs_zget
This happened because vgone marks a vnode as VI_DOOMED before calling
VOP_RECLAIM, but zfs_zget would not return a doomed vnode under any
circumstances.
The fix in this change is not complete as it won't fix a deadlock between
two threads doing VOP_RECLAIM where one thread is in zil_commit trying to
zfs_zget a znode/vnode being reclaimed by the other thread, which would be
blocked trying to enter zil_commit.  This type of deadlock has not been
reported as of now.

o An indefinite wait in the unmount path caused by a znode "falling through
the cracks" in inactive+reclaim.  This would happen if the znode is unlinked
while its vnode is still active.

To Do: pass locking flags parameter to zfs_zget, so that the zfs-vfs
glue code doesn't have to re-lock a vnode but could ask for proper locking
from the very start.  This would also allow for the higher level code to
obtain a doomed vnode when it is expected/requested.  Or to avoid blocking
when it is not allowed (see zil_commit example above).

ffs_vgetf seems like a good source of inspiration.

Tested by: Willem Jan Withagen <wjw@digiware.nl>
MFC after: 6 weeks

11 years agozfs_fhtovp: there is no reason to amend lock flags with LK_RETRY here
avg [Sun, 25 Nov 2012 15:07:27 +0000 (15:07 +0000)]
zfs_fhtovp: there is no reason to amend lock flags with LK_RETRY here

MFC after: 12 days

11 years agoadd zfs_bmap to aid vnode_pager_haspage
avg [Sun, 25 Nov 2012 15:01:12 +0000 (15:01 +0000)]
add zfs_bmap to aid vnode_pager_haspage

... otherwise zfs_getpages would mostly be called with one page at a time.

It is expected that ZFS VOP_BMAP is only called from vnode_pager_haspage.
Since ZFS files can have variable block sizes and also because we don't
really know if any given blocks are consecutive, we can not really report
any additional blocks behind or ahead of a given block.  Since physical
block numbers do not make sense for ZFS, we do not do any real translation
and thus pass back blk = lblk.  The net effect is that vnode_pager_haspage
knows that the block exists and that the pages backed by the block can be
accessed.  vnode_pager_haspage may be wrong about the exact count of the
pages backed by the block, because of a variable block size, which
vnode_pager_haspage doesn't really know - it only knows max block size in
a filesystem.  So pages from multiple blocks can be passed to zfs_getpages,
but that is expected and correctly handled.

vnode_pager should not call zfs_bmap for any other reason, because ZFS
implements VOP_PUTPAGES and thus vnode_pager_generic_getpages is not used.

vfs_cluster code vfs_bio code should not be called for ZFS, because ZFS does
not use buffer cache layer.

Also, ZFS does not use vn_bmap_seekhole, it has its prviate mechanism for
working with holes.

The above list should cover all the current calls to VOP_BMAP.

Reviewed by: kib
MFC after: 6 weeks

11 years agozfs_getpages: optimize for large block sizes
avg [Sun, 25 Nov 2012 14:53:26 +0000 (14:53 +0000)]
zfs_getpages: optimize for large block sizes

MFC after: 6 weeks

11 years agoRemove unused function.
tuexen [Sun, 25 Nov 2012 14:25:08 +0000 (14:25 +0000)]
Remove unused function.

MFC after: 1 week

11 years agoremove stop_scheduler_on_panic knob
avg [Sun, 25 Nov 2012 14:22:08 +0000 (14:22 +0000)]
remove stop_scheduler_on_panic knob

There has not been any complaints about the default behavior, so there
is no need to keep a knob that enables the worse alternative.

Now that the hard-stopping of other CPUs is the only behavior, the panic_cpu
spinlock-like logic can be dropped, because only a single CPU is
supposed to win stop_cpus_hard(other_cpus) race and proceed past that
call.

MFC after: 1 month

11 years agozfs sha256 checksum is missing in zfs.8 manpage
mm [Sun, 25 Nov 2012 11:26:36 +0000 (11:26 +0000)]
zfs sha256 checksum is missing in zfs.8 manpage

MFC after: 3 days

11 years agoMFV r243012:
mm [Sun, 25 Nov 2012 10:53:42 +0000 (10:53 +0000)]
MFV r243012:

Illumos 13886:e3261d03efbf

3349 zpool upgrade -V bumps the on disk version number, but leaves
     the in core version

References:
https://www.illumos.org/issues/3349

MFC after: 1 week

11 years agoSplit IP address validation routines and improve error detection for dotted-
dteske [Sun, 25 Nov 2012 10:37:10 +0000 (10:37 +0000)]
Split IP address validation routines and improve error detection for dotted-
quad notation in IPv6 addresses.

Approved by: adrian (co-mentor) (implicit)

11 years agoMFV r242735:
mm [Sun, 25 Nov 2012 09:06:32 +0000 (09:06 +0000)]
MFV r242735:

Illumos 13879:4eac7a87eff2:
3329 spa_sync() spends 10-20% of its time in spa_free_sync_cb()
3330 space_seg_t should have its own kmem_cache
3331 deferred frees should happen after sync_pass 1
3335 make SYNC_PASS_* constants tunable

New loader-only tunables:
vfs.zfs.sync_pass_deferred_free
vfs.zfs.sync_pass_dont_compress
vfs.zfs.sync_pass_rewrite

References:
https://www.illumos.org/issues/3329
https://www.illumos.org/issues/3330
https://www.illumos.org/issues/3331
https://www.illumos.org/issues/3335

MFC after: 2 weeks

11 years agozfs roopool: add support for multi-vdev configurations
avg [Sat, 24 Nov 2012 13:23:15 +0000 (13:23 +0000)]
zfs roopool: add support for multi-vdev configurations

Tested by: madpilot
MFC after: 10 days

11 years agospa_import_rootpool: initialize ub_version before calling spa_config_parse
avg [Sat, 24 Nov 2012 13:16:49 +0000 (13:16 +0000)]
spa_import_rootpool: initialize ub_version before calling spa_config_parse

... because the latter makes some decision based on the version.
This is especially important for raidz vdevs.
This is similar to what spa_load does.

This is not an issue for upstream because they do not seem to support
using raidz as a root pool.

Reported by: Andrei Lavreniyuk <andy.lavr@gmail.com>
Tested by: Andrei Lavreniyuk <andy.lavr@gmail.com>
MFC after: 6 days

11 years agospa_import_rootpool: do not call spa_history_log_version
avg [Sat, 24 Nov 2012 13:14:53 +0000 (13:14 +0000)]
spa_import_rootpool: do not call spa_history_log_version

The call is a NOP, because pool version in spa_ubsync.ub_version is not
initialized and thus appears to be zero.
If the version is properly set then the call leads to a NULL pointer
dereference because the spa object is still under-constructed.

The same change was independently made in the upstream as a part of
a larger change (4445fffbbb1ea25fd0e9ea68b9380dd7a6709025).

MFC after: 6 days

11 years agoassert_vop_locked: make the assertion race-free and more efficient
avg [Sat, 24 Nov 2012 13:11:47 +0000 (13:11 +0000)]
assert_vop_locked: make the assertion race-free and more efficient

this is really a minor improvement for the sake of correctness

MFC after: 6 days

11 years agoopensolaris compat: terminate cmn_err mesages with a new line
avg [Sat, 24 Nov 2012 13:10:36 +0000 (13:10 +0000)]
opensolaris compat: terminate cmn_err mesages with a new line

MFC after: 6 days

11 years agozfs: create devices/geoms from zvols after receiveing them
avg [Sat, 24 Nov 2012 13:07:31 +0000 (13:07 +0000)]
zfs: create devices/geoms from zvols after receiveing them

PR: kern/167066
Tested by: Andreas Nilsson <andrnils@gmail.com>
MFC after: 13 days

11 years agoWhitespace.
dteske [Sat, 24 Nov 2012 07:02:31 +0000 (07:02 +0000)]
Whitespace.

Approved by: adrian (co-mentor) (implicit)

11 years agoAdd IPv6 address-validation routine.
dteske [Sat, 24 Nov 2012 06:27:46 +0000 (06:27 +0000)]
Add IPv6 address-validation routine.

Approved by: adrian (co-mentor) (implicit)

11 years agoThe is_delim function works on wchar_t characters not ints, update the
andrew [Sat, 24 Nov 2012 04:15:25 +0000 (04:15 +0000)]
The is_delim function works on wchar_t characters not ints, update the
function to take a wchar_t as it's argument.

This fixes the build when wchar_t is not an int, i.e. ARM EABI.

11 years agoo) Have the FreeBSD kernel option "INVARIANTS" trickle down into the Simple
jmallett [Sat, 24 Nov 2012 02:55:05 +0000 (02:55 +0000)]
o) Have the FreeBSD kernel option "INVARIANTS" trickle down into the Simple
   Executive code where similar invariant knobs exist.
o) Make the Simple Executive's warning function print "WARNING: " on the same
   line as the warning it is displaying, rather than on a separate line.

11 years agoAdd a comment which covers what's going on with the 64 bit TSF write.
adrian [Sat, 24 Nov 2012 02:41:18 +0000 (02:41 +0000)]
Add a comment which covers what's going on with the 64 bit TSF write.

After chatting with the MAC team, the TSF writes (at least on the 11n
MACs, I don't know about pre-11n MACs) are done as 64 bit writes that
can take some time.  So, doing a 32 bit TSF write is definitely not
supported.  Leave a comment here which explains that.

Whilst here, add a comment which outlines that after a reset or TSF
write, the TSF write may take a while (up to 50uS) to update.
A write or reset shouldn't be done whilst the previous one is in
flight.  Also (and this isn't currently done) a read shouldn't
occur until the SLEEP32_TSF_WRITE_STAT is clear.  Right now we're
not doing that, mostly because we haven't been doing lots of TSF
resets/writes until recently.

11 years agoUse bootverbose to control debug printfs from the Cavium Simple Executive
jmallett [Sat, 24 Nov 2012 02:12:24 +0000 (02:12 +0000)]
Use bootverbose to control debug printfs from the Cavium Simple Executive
code.  Also remove an unnecessary CVMX_ENABLE_DEBUG_PRINTS conditional around
what is already a cvmx_dprintf.

11 years agoo) Add support for specifying a model of Octeon to target at compile-time,
jmallett [Sat, 24 Nov 2012 02:00:29 +0000 (02:00 +0000)]
o) Add support for specifying a model of Octeon to target at compile-time,
   reducing the number of runtime checks done by the SDK code.
o) Group board/CPU information at early startup by subject matter, so that e.g.
   CPU information is adjacent to CPU information and board information is
   adjacent to board information.

11 years agoAdd Raspberry Pi GPIO driver
gonzo [Fri, 23 Nov 2012 20:04:39 +0000 (20:04 +0000)]
Add Raspberry Pi GPIO driver

Submitted by: Luiz Otavio O Souza

11 years agoStyle fixes
gonzo [Fri, 23 Nov 2012 19:20:38 +0000 (19:20 +0000)]
Style fixes

- Remove C++ - style comments
- Use proper device name in panic messages

11 years agoThe tramp stuff isn't dependent on DDB, so always add these to the
imp [Fri, 23 Nov 2012 17:27:09 +0000 (17:27 +0000)]
The tramp stuff isn't dependent on DDB, so always add these to the
CLEANFILES list.

11 years agoStrip trailing newline.
imp [Fri, 23 Nov 2012 17:22:38 +0000 (17:22 +0000)]
Strip trailing newline.

11 years agoRemove "clone manager: " message from verbose dmesg. It is pointless to
mav [Fri, 23 Nov 2012 15:31:00 +0000 (15:31 +0000)]
Remove "clone manager: " message from verbose dmesg. It is pointless to
print values that are statically hardcoded few lines above that.

11 years agoMove sndbuf_setmap() output about buffer addresses from the general verbose
mav [Fri, 23 Nov 2012 13:43:51 +0000 (13:43 +0000)]
Move sndbuf_setmap() output about buffer addresses from the general verbose
output to sound verbose output, where all other sndbuf messages live.

11 years agoDocument sin6_scope_id handling change and bump FreeBSD_version to 1000025.
hrs [Fri, 23 Nov 2012 12:12:06 +0000 (12:12 +0000)]
Document sin6_scope_id handling change and bump FreeBSD_version to 1000025.

11 years ago- Use sin6_scope_id instead of sin6_addr.s6_addr[2].
hrs [Fri, 23 Nov 2012 11:21:58 +0000 (11:21 +0000)]
- Use sin6_scope_id instead of sin6_addr.s6_addr[2].
- Support a flag for ALLOW/BLOCK in source-specific multicast (RFC 4604).

11 years agoDocument that getpeername(2) and getsockname(2) can fail with EINVAL.
kevlo [Fri, 23 Nov 2012 10:14:54 +0000 (10:14 +0000)]
Document that getpeername(2) and getsockname(2) can fail with EINVAL.

Reviewed by: glebius

11 years agoAccording to r221124, the default NFS server and client are no longer
kevlo [Fri, 23 Nov 2012 08:47:57 +0000 (08:47 +0000)]
According to r221124, the default NFS server and client are no longer
experimental.

11 years agoCatch up with r243046. KTR buffer can be changed at runtime.
kevlo [Fri, 23 Nov 2012 08:44:36 +0000 (08:44 +0000)]
Catch up with r243046. KTR buffer can be changed at runtime.

11 years agoRemove no longer needed quirk.
hselasky [Fri, 23 Nov 2012 08:22:06 +0000 (08:22 +0000)]
Remove no longer needed quirk.

Submitted by: Mark Johnston

11 years agoNow that we have working USB keyboard add ukbd to the syscons-enabling
gonzo [Fri, 23 Nov 2012 07:58:12 +0000 (07:58 +0000)]
Now that we have working USB keyboard add ukbd to the syscons-enabling
part of config

11 years agoUse a 64 bit TSF write to update the TSF adjust, rather than a 32 bit
adrian [Fri, 23 Nov 2012 05:52:22 +0000 (05:52 +0000)]
Use a 64 bit TSF write to update the TSF adjust, rather than a 32 bit
TSF write.

The TSF_L32 update is fine for the AR5413 (and later, I guess) 11abg NICs
however on the 11n NICs this didn't work.  The TSF writes were causing
a much larger time to be skipped, leading to the timing to never
converge.

I've tested this 64 bit TSF read, adjust and write on both the
11n NICs and the AR5413 NIC I've been using for testing.  It works
fine on each.

This patch allows the AR5416/AR9280 to be used as a TDMA member.
I don't yet know why the AR9280 is ~7uS accurate rather than ~3uS;
I'll look into it soon.

Tested:

* AR5413, TDMA slave (~ 3us accuracy)
* AR5416, TDMA slave (~ 3us accuracy)
* AR9280, TDMA slave (~ 7us accuracy)

11 years agoFix up the nexttbtt -> TSF delta calculation to not wrap ridiculously
adrian [Fri, 23 Nov 2012 05:38:38 +0000 (05:38 +0000)]
Fix up the nexttbtt -> TSF delta calculation to not wrap ridiculously
on the 802.11n NICs.

The 802.11n NICs return a TBTT value that continues far past the 16 bit
HAL_BEACON_PERIOD time (in TU.)  The code would constrain nextslot to
HAL_BEACON_PERIOD, but it wasn't constraining nexttbtt - the pre-11n
NICs would only return TU values from 0 -> HAL_BEACON_PERIOD.  Thus,
when nexttbtt exceeded 64 milliseconds, it would not wrap (but nextslot
did) which lead to a huge tsfdelta.

So until the slot calculation is converted to work in TSF rather than
a mix of TSF and TU, "make" the nexttbtt values match the TU assumptions
for pre-11n NICs.

This fixes the crazy deltatsf calculations but it doesn't fix the
non-convergent tsfdelta issue.  That'll be fixed in a subsequent commit.

11 years agoAdd the HAL wrapper for settsf64.
adrian [Fri, 23 Nov 2012 05:33:01 +0000 (05:33 +0000)]
Add the HAL wrapper for settsf64.

11 years agoImplement a HAL method to set a 64 bit TSF value.
adrian [Fri, 23 Nov 2012 05:32:24 +0000 (05:32 +0000)]
Implement a HAL method to set a 64 bit TSF value.

TODO: implement it (and test) for the AR5210/AR5211.

11 years agoMultiple fixes for BCM2835 framebuffer
gonzo [Fri, 23 Nov 2012 04:30:54 +0000 (04:30 +0000)]
Multiple fixes for BCM2835 framebuffer

- Get resolution settings from FDT blob
- Properly handle 24 and 16 bits per pixel
- Add colors support for text console

11 years agoUse MIPS_PHYS_TO_DIRECT_UNCACHED rather than a homegrown version which is not
jmallett [Fri, 23 Nov 2012 04:28:13 +0000 (04:28 +0000)]
Use MIPS_PHYS_TO_DIRECT_UNCACHED rather than a homegrown version which is not
compatible with 32-bit kernels.

11 years agoLook for MAC address in FDT tree nodes that are usb network devices and
gonzo [Fri, 23 Nov 2012 03:34:12 +0000 (03:34 +0000)]
Look for MAC address in FDT tree nodes that are usb network devices and
have either "mac-address" or "local-mac-addrress" property.

11 years agoMake FDT blob compatible with Raspberry Pi firmware.
gonzo [Fri, 23 Nov 2012 03:24:52 +0000 (03:24 +0000)]
Make FDT blob compatible with Raspberry Pi firmware.

Rasperry Pi firmware has a set of hardcoded pathes it uses to fill
FDT with system-specific information like display resolution, memory
size, UART and SDHCI clocks, ethernet MAC address. Handle two of them:

- Add placeholder for ethernet MAC address
- Move display node out of "axi" node

11 years agoMFS security patches which seem to have accidentally not reached HEAD:
cperciva [Fri, 23 Nov 2012 01:48:31 +0000 (01:48 +0000)]
MFS security patches which seem to have accidentally not reached HEAD:

Fix insufficient message length validation for EAP-TLS messages.

Fix Linux compatibility layer input validation error.

Security: FreeBSD-SA-12:07.hostapd
Security: FreeBSD-SA-12:08.linux
Security: CVE-2012-4445, CVE-2012-4576
With hat: so@

11 years agoacpi_cpu: use fixed resource ids for cx state i/o resources
avg [Thu, 22 Nov 2012 14:40:26 +0000 (14:40 +0000)]
acpi_cpu: use fixed resource ids for cx state i/o resources

... instead of the ever increasing ones.
Also, do free old resources when allocating new ones when cx states
change.

Tested by: Tom Lislegaard <Tom.Lislegaard@proact.no>
Obtained from: jkim
MFC after: 1 week

11 years agoremove vop_lookup_pre and vop_lookup_post
avg [Thu, 22 Nov 2012 10:36:10 +0000 (10:36 +0000)]
remove vop_lookup_pre and vop_lookup_post

Suggested by: kib
MFC after: 5 days

11 years ago[mdoc] remove hard sentence breaks.
pluknet [Thu, 22 Nov 2012 10:24:30 +0000 (10:24 +0000)]
[mdoc] remove hard sentence breaks.

MFC after: 3 days

11 years agocore(5) references sysctl debug.num_cores, but it is really debug.ncores.
pluknet [Thu, 22 Nov 2012 09:56:13 +0000 (09:56 +0000)]
core(5) references sysctl debug.num_cores, but it is really debug.ncores.

PR: docs/173831
MFC after: 1 week

11 years ago- Remove reset of vpp pointer in some places as long as it's not really
davide [Thu, 22 Nov 2012 09:13:45 +0000 (09:13 +0000)]
- Remove reset of vpp pointer in some places as long as it's not really
useful and has the side effect of obfuscating the code a bit.
- Remove spurious references to simple_lock.

Reported by: attilio [1]
Sponsored by: iXsystems inc.

11 years agoUntil now, smbfs_fullpath() computed the full path starting from the
davide [Thu, 22 Nov 2012 08:58:29 +0000 (08:58 +0000)]
Until now, smbfs_fullpath() computed the full path starting from the
vnode and following back the chain of n_parent pointers up to the root,
without acquiring the locks of the n_parent vnodes analyzed during the
computation. This is immediately wrong because if the vnode lock is not
held there's no guarantee on the validity of the vnode pointer or the data.
In order to fix, store the whole path in the smbnode structure so that
smbfs_fullpath() can use this information.

Discussed with: kib
Reported and tested by: pho
Sponsored by: iXsystems inc.

11 years agoIf .PARSEDIR is defined we have bmake, and CTFCONVERT_CMD can be empty.
sjg [Thu, 22 Nov 2012 04:53:09 +0000 (04:53 +0000)]
If .PARSEDIR is defined we have bmake, and CTFCONVERT_CMD can be empty.

PR: 172440
Approved by: marcel (mentor)

11 years agoINSTALL_AS_USER: output of id -un will never match 0 so use id -u
sjg [Thu, 22 Nov 2012 04:50:42 +0000 (04:50 +0000)]
INSTALL_AS_USER: output of id -un will never match 0 so use id -u
and USER for BINOWN etc.

Approved by: marcel (mentor)

11 years agoUse %u for unsigned serial number
emaste [Thu, 22 Nov 2012 03:54:51 +0000 (03:54 +0000)]
Use %u for unsigned serial number

11 years agoFix uplcom clear stall logic for PL2303HX.
hselasky [Wed, 21 Nov 2012 22:04:40 +0000 (22:04 +0000)]
Fix uplcom clear stall logic for PL2303HX.

Submitted by: Mark Johnston
MFC after: 1 week

11 years agoRevert r243228. This commit appears to cause more trouble than
crees [Wed, 21 Nov 2012 18:12:28 +0000 (18:12 +0000)]
Revert r243228.  This commit appears to cause more trouble than
it was designed to avoid; the issue described in the PR was no
longer an issue anyway.

11 years agoPrint correct unit number when attaching preloaded memory disks.
jh [Wed, 21 Nov 2012 17:05:57 +0000 (17:05 +0000)]
Print correct unit number when attaching preloaded memory disks.
Retire now unused mdunits variable.

11 years agoDisallow attaching preloaded memory disks via ioctl.
jh [Wed, 21 Nov 2012 16:56:47 +0000 (16:56 +0000)]
Disallow attaching preloaded memory disks via ioctl.

- The feature is dangerous because the kernel code didn't check
  validity of the memory address provided from user space.
- It seems that mdconfig(8) never really supported attaching preloaded
  memory disks.
- Preloaded memory disks are automatically attached during md(4)
  initialization. Thus there shouldn't be much use for the feature.

PR: kern/169683
Discussed on: freebsd-hackers

11 years agoSetup BAT0 and BAT1 on the Wii.
adrian [Wed, 21 Nov 2012 08:04:21 +0000 (08:04 +0000)]
Setup BAT0 and BAT1 on the Wii.

This is the missing piece for FreeBSD/Wii, but there's still a lot of
work ahead. We have to reset the MMU in locore before continuing
the boot process because we don't know how the boot loaders might
have setup the BATs. We also disable the PCI BAT because there's no PCI
bus on the Wii.

Thanks to Nathan Whitehorn and Peter Grenhan for their help.

Submitted by: Margarida Gouveia

11 years agoCorrect an error in r230623. When both VM_ALLOC_NODUMP and VM_ALLOC_ZERO
alc [Wed, 21 Nov 2012 06:26:18 +0000 (06:26 +0000)]
Correct an error in r230623.  When both VM_ALLOC_NODUMP and VM_ALLOC_ZERO
were specified to vm_page_alloc(), PG_NODUMP wasn't being set on the
allocated page when it happened to be pre-zeroed.

MFC after: 5 days

11 years agoMake sure the address starts on a cache line boundary.
cognet [Wed, 21 Nov 2012 01:38:40 +0000 (01:38 +0000)]
Make sure the address starts on a cache line boundary.

11 years agoDo not expose LIBCXXRT and LIBCPLUSPLUS in bsd.libnames.mk, if
dim [Tue, 20 Nov 2012 21:26:13 +0000 (21:26 +0000)]
Do not expose LIBCXXRT and LIBCPLUSPLUS in bsd.libnames.mk, if
WITHOUT_LIBCPLUSPLUS is specified.

Submitted by: Garrett Cooper <yanegomi@gmail.com>
MFC after: 3 days

11 years agoMerge ACPICA 20121114.
jkim [Tue, 20 Nov 2012 21:01:59 +0000 (21:01 +0000)]
Merge ACPICA 20121114.

11 years agoNon-void function should return a value.
emaste [Tue, 20 Nov 2012 19:23:44 +0000 (19:23 +0000)]
Non-void function should return a value.

Found by: clang