Commit Graph

84992 Commits

Author SHA1 Message Date
Jaakko Heinonen
9cb24e3c98 Check the return value of sbuf_finish() in pfs_readlink() and return
ENAMETOOLONG if the buffer overflowed.

Approved by:	des
MFC after:	2 weeks
2012-01-06 09:17:34 +00:00
Adrian Chadd
ff23e401a5 Flip these options on so the modules build correctly for now. 2012-01-06 08:51:20 +00:00
Oleksandr Tymoshenko
6cc1d135cd - Add better COP2 (crypto coprocessor) context handler for Octeon. Keep
COP2 disabled and lazily allocate COP2 context structure in exception
    handler. Keep kernel and userland contexts separated.
2012-01-06 01:23:26 +00:00
Sergey Kandaurov
4f7fca1ca1 Fix a typo.
X-MFC-with:	229665
2012-01-06 00:23:17 +00:00
Jim Harris
9bea89c1b0 Add 0x2826 device ID for C600 (Patsburg) SATA controller in RAID mode.
Reviewed by: mav
Approved by: scottl
2012-01-06 00:22:55 +00:00
John Baldwin
1e96ae8193 Remove the assertion from tcp_input() that rcv_nxt is always greater
than or equal to rcv_adv and fix tcp_twstart() to handle this case by
assuming the last window was zero rather than a negative value.

The code in tcp_input() already safely handled this case.  It can happen
due to delayed ACKs along with a remote sender that sends data beyond
the window we previously advertised.  If we have room in our socket buffer
for the extra data beyond the advertised window, we will accept it.
However, if the ACK for that segment is delayed, then we will not
effectively fixup rcv_adv to account for that extra data until the
next segment arrives and forces out an ACK.  When that next segment
arrives, rcv_nxt will be beyond rcv_adv.

Tested by:	pjd
MFC after:	1 week
2012-01-05 22:29:11 +00:00
Pawel Jakub Dawidek
62859c9061 - Allow to change vfs.zfs.arc_meta_limit at runtime.
- Change vfs.zfs.arc_meta_used from CTLFLAG_RDTUN to CTLFLAG_RD, as it is
  not a tunable.

MFC after:	3 days
2012-01-05 22:16:41 +00:00
Andreas Tobler
8d252f7868 Fix build on powerpc64 too. The same as r229640. 2012-01-05 22:06:01 +00:00
Adrian Chadd
8cb8d9fb89 Fix build. 2012-01-05 20:19:33 +00:00
Adrian Chadd
4573d52b08 Add missing options so modules build/load correctly. 2012-01-05 20:18:01 +00:00
John Baldwin
948c460971 Fix a logic bug in change 228207 in the check for a thread's new user
priority being a realtime priority.

MFC after:	3 days
2012-01-05 19:02:52 +00:00
John Baldwin
137f91e80f Convert all users of IF_ADDR_LOCK to use new locking macros that specify
either a read lock or write lock.

Reviewed by:	bz
MFC after:	2 weeks
2012-01-05 19:00:36 +00:00
John Baldwin
a2cb1d522b Add new variants of the IF_ADDR_*LOCK*() macros used for protecting
interface address lists that distinguish read locks from write locks.
To preserve the KPI, the previous operations are mapped to the write
lock macros.  The lock is still kept as a mutex for now.

Reviewed by:	bz
MFC after:	2 weeks
2012-01-05 18:35:49 +00:00
John Baldwin
b02a80a7c5 Update recently added drivers to use the if_*addr_r*lock() wrapper
functions instead of using the IF_ADDR_LOCK directly.  The wrapper
functions are the supported interface for device drivers.

Reviewed by:	bz, philip
MFC after:	1 week
2012-01-05 18:32:37 +00:00
Robert Watson
19d52de5f4 When extracting the VLAN tag from if_em and if_lem receive descriptor
rings, copy the whole VLAN tag, not just the VLAN ID.  This fixes a
problem in which VLAN priority information was dropped when using
offloaded VLAN processing with these drivers.

Discussed with:	jfv, rrs
Sponsored by:	ADARA Networks, Inc.
MFC after:	3 days
2012-01-05 17:30:15 +00:00
Adrian Chadd
3d090dd20d Flip on IEEE80211_SUPPORT_MESH and AH_SUPPORT_AR5416, the
wlan and ath modules respectively assume this is set.

Pointy hat to:	adrian
2012-01-05 17:28:05 +00:00
Dimitry Andric
f39adedd5b In sys/fs/nullfs/null_subr.c, in a KASSERT, output the correct vnode
pointer 'lowervp' instead of 'vp', which is uninitialized at that point.

Reviewed by:	kib
MFC after:	1 week
2012-01-05 17:06:04 +00:00
John Baldwin
e0636bc0ca Remove use of explicit bus space tags and handles and use methods that
operate on resource objects instead.

MFC after:	1 week
2012-01-05 16:27:32 +00:00
Robert Watson
5a39f779b2 Refine last comment.
Submitted by:	joeld
Sponsored by:	ADARA Networks, Inc.
MFC after:	3 days
2012-01-05 11:42:34 +00:00
Robert Watson
15f6780ef4 Add comment to the VLAN code about its integration with VIMAGE: we see what
the code is doing, we recognise the legitimacy of its goal, but we're not
quite sure it's going about it the right way.  More pondering is clearly
required.

Sponsored by:	ADARA Networks, Inc.
Discussed with:	bz
MFC after:	3 days
2012-01-05 11:24:22 +00:00
Ed Schouten
f8fd121ca4 Add __generic(), to be able to use a very simple _Generic().
Already introducing this allows us to be forward compatible with C11
compilers. By implementing <tgmath.h> on top of this interface, it
becomes trivial to support both our existing GCC and newer compilers.
2012-01-05 10:43:03 +00:00
Ed Schouten
30b42655cf Also import WEAK_ALIAS() from the MIPS code. 2012-01-05 08:51:06 +00:00
Adrian Chadd
8f5aa976d7 This isn't required any longer - it turns out the flash
has ~ 1.7MB of space for a kernel.  There's thus plenty of
space for a full, non-module kernel.
2012-01-05 07:19:05 +00:00
Adrian Chadd
188da34c00 Re-enable this bit of logic from before, which only sets a default
opt_ah.h file if KERNBUILDDIR isn't defined.

For now, AH_SUPPORT_AR5416 is required, so I'll just fix any
configuration file in /usr/src which is missing this option.

Pointy hat when things do break to:	adrian
2012-01-05 06:22:09 +00:00
Adrian Chadd
b018dade46 Use geom_uncompress now, rather than geom_uzip.
This results in a much smaller rootfs image and it easily
fits in the 8MB flash.
2012-01-05 03:38:34 +00:00
Bjoern A. Zeeb
9d9b92f299 Mark a couple of file local functions static and stop exporting them.
MFC after:	1 week
2012-01-05 01:14:35 +00:00
Bjoern A. Zeeb
f67e13d66d Convert an #ifdef DIAGNOSTIC if/panic to a KASSERT.
MFC after:	1 week
2012-01-05 01:13:25 +00:00
Aleksandr Rybalko
ce96bb7942 GEOM_UNCOMPRESS module, can be used with uzip images and with new ulzma images.
Approved by:	adrian (mentor)
2012-01-04 23:39:11 +00:00
Aleksandr Rybalko
e11f2b8243 Update contrib/xz-embedded to build with new GEOM_UNCOMPRESS module.
Approved by:	adrian (mentor)
2012-01-04 23:26:22 +00:00
John Baldwin
5d0dc219a0 Fix 'make clean' for this module so it cleans up the generated gssd.h.
MFC after:	1 week
2012-01-04 21:14:22 +00:00
Andreas Tobler
3079d69f90 Apply the same change as in r229494.
Requested by: ed
2012-01-04 16:07:16 +00:00
Konstantin Belousov
e65919f9fc Do not restart the scan in vm_object_page_clean() on the object
generation change if requested mode is async. The object generation is
only changed when the object is marked as OBJ_MIGHTBEDIRTY. For async
mode it is enough to write each dirty page, not to make a guarantee that
all pages are cleared after the vm_object_page_clean() returned.

Diagnosed by:	truckman
Tested by:	flo
Reviewed by:	alc, truckman
MFC after:	2 weeks
2012-01-04 16:04:20 +00:00
Andreas Tobler
54c699c4cc Introduce internal macros for __U/INT64_C to define the U/INT64_MAX/MIN
values properly. The previous definition only worked if __STDC_LIMIT_MACROS
and __STDC_CONSTANT_MACROS were defined at the same time.
2012-01-04 16:02:52 +00:00
John Baldwin
19b0c9b246 Use the mli_relinmhead list normally used to defer calls to
in6m_release_locked() to defer calls to mld_v1_transmit_report() until
after the IF_ADDR_LOCK is dropped.  This removes a race where the lock
is dropped and reacquired while attempting to walk an interface's
address list.

Reviewed by:	bz
MFC after:	1 week
2012-01-04 13:35:20 +00:00
John Baldwin
0f188ebb1d Use a helper variable to wrap a long line. 2012-01-04 13:29:26 +00:00
John Baldwin
56d6e1292d In the handling of the SIOC[DG]LIFADDR icotls in in_lifaddr_ioctl(), add
missing interface address list locking and grab a reference on the
matching interface address after dropping the lock while it is used to
avoid a potential use after free.

Reviewed by:	bz
MFC after:	1 week
2012-01-04 13:26:56 +00:00
John Baldwin
0823c29b81 Fix the SIOC[DG]LIFADDR ioctls in in_lifaddr_ioctl() to work with IPv4
interface address rather than IPv6.

Submitted by:	hrs
Reviewed by:	bz
MFC after:	1 week
2012-01-04 13:23:51 +00:00
Fabien Thomas
ba89031aea Update PMC events from October 2011 Intel documentation.
Submitted by:	Davide Italiano <davide.italiano@gmail.com>
MFC after:	3 days
2012-01-04 07:58:36 +00:00
Fabien Thomas
3444c31af6 Add missing MSR programming for some events.
Submitted by:	Davide Italiano <davide.italiano@gmail.com>
MFC after:	3 days
2012-01-04 07:33:06 +00:00
Gleb Smirnoff
1331bbc33f Use correct locking when traversing interface address list.
Reviewed by:	bz
2012-01-04 07:01:23 +00:00
Adrian Chadd
450a186c06 Add a couple more SPI flash device IDs found in commercial
consumer wireless kit.

Submitted by:	Stefan Bethke <stb@lassitu.de>
2012-01-04 04:17:03 +00:00
Yoshihiro Takahashi
a57b8b9e02 MFi386: revision 229435
Add special loader environment variables 'comconsole_port' and
  'comconsole_pcidev'.

MFC after:	2 weeks
2012-01-04 03:54:30 +00:00
Yoshihiro Takahashi
da5f7df3a6 Fix 230MB MO support.
Submitted by:	Kaho Toshikazu
MFC after:	1 week
2012-01-04 03:49:41 +00:00
Konstantin Belousov
5a1e37174f Add special loader environment variables 'comconsole_port' and
'comconsole_pcidev'. The former allows to set the base address of the
serial console i/o port. The later takes the string of the format
'bus:device:function:[bar]' as a value and uses the serial port attached
as PCI device at the specified location for console.

Both variants pass 'hw.uart.console' variable to the uart driver to
properly hand-over the kernel console.

Change allows to use ISA serial ports other than COM1 for the
loader/kernel console without loader recompilation. Also, you can use
PCI-attached port as the console, e.g. Intel AMT serial pseudo-port on
some motherboards based on Q67 chipset.

Reviewed by:	jhb
MFC after:	2 weeks
2012-01-03 22:36:12 +00:00
Konstantin Belousov
dd0f9532f3 Do the vput() for the lowervp in the null_nodeget() for error case too.
Several callers of null_nodeget() did the cleanup itself, but several
missed it, most prominent being null_bypass(). Remove the cleanup from
the callers, now null_nodeget() handles lowervp free itself.

Reported and tested by:	pho
MFC after:	1 week
2012-01-03 21:09:07 +00:00
Pedro F. Giffuni
c7e0c9db2b Replace a GPL'd header in the emu10k1 snd driver code.
This brings in the emuxkireg.h from NetBSD (dev/pci) which
is used for the same purpose but is smaller. The emu10k1
is now free from the GPL.

PR:		153901
Obtained from:	NetBSD
Approved by:	core (mentor implicit)
MFC after:	2 weeks
2012-01-03 21:04:54 +00:00
John Baldwin
7e3a96ea37 Some small fixes to CPU accounting for threads:
- Only initialize the per-cpu switchticks and switchtime in sched_throw()
  for the very first context switch on APs during boot.  This avoids a
  small gap between the middle of thread_exit() and sched_throw() where
  time is not accounted to any thread.
- In thread_exit(), update the timestamp bookkeeping to track the changes
  to mi_switch() introduced by td_rux so that the code once again matches
  the comment claiming it is mimicing mi_switch().  Specifically, only
  update the per-thread stats directly and depend on ruxagg() to update
  p_rux rather than adjusting p_rux directly.  While here, move the
  timestamp bookkeeping as late in the function as possible.

Reviewed by:	bde, kib
MFC after:	1 week
2012-01-03 21:03:28 +00:00
Konstantin Belousov
48a1e3f624 Document the state of the lowervp vnode for null_nodeget().
Tested by:	pho
MFC after:	1 week
2012-01-03 21:03:20 +00:00
John Baldwin
289908743e Fix a few bugs in the SRAT parsing code:
- Actually increment ndomain when building our list of known domains
  so that we can properly renumber them to be 0-based and dense.
- If the number of domains exceeds the configured maximum (VM_NDOMAIN),
  bail out of processing the SRAT and disable NUMA rather than hitting an
  obscure panic later.
- Don't bother parsing the SRAT at all if VM_NDOMAIN is set to 1 to
  disable NUMA (the default).

Reported by:	phk (2)
MFC after:	1 week
2012-01-03 20:53:58 +00:00
Dimitry Andric
a5988eb997 In sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c, check the
the number of links against LINK_MAX (which is INT16_MAX), not against
UINT32_MAX.  Otherwise, the constant would implicitly be converted to
-1.

Reviewed by:	pjd
MFC after:	1 week
2012-01-03 20:53:07 +00:00
Dimitry Andric
7c864d7df9 In sys/dev/qlxgb/qla_misc.c, fix a copy/paste issue. Clang complained
the variable 'val' was uninitialized when used.  Instead, 'sig' should
have been printed.

Reviewed by:	davidcs
MFC after:	1 week
2012-01-03 20:51:26 +00:00
John Baldwin
c6f4ea8062 When cancelling multicast timers on an interface, don't release the
reference on a group in the leaving state while iterating over the loop.
Instead, use the same approach used in igmp_ifdetach() and mld_ifdetach()
of placing the groups to free on pending release list and then releasing
the references after dropping the IF_ADDR_LOCK.  This closes an ugly race
where the code was dropping the lock in the middle of iterating over the
list.  It also fixes some additional potential use-after-free bugs since
the cancellation routine also applied other changes to the group after
dropping the reference.  Now those changes are performed before the
reference is dropped and the group is potentially freed.

Prodded to fix by:	glebius
Reviewed by:	bz
MFC after:	1 week
2012-01-03 20:34:52 +00:00
Xin LI
3093cb15fb Don't forget to release queue lock when allocation of memory failed.
Submitted by:	Sascha Wildner <saw online de>
Obtained from:	DragonFly
MFC after:	2 weeks
2012-01-03 20:17:35 +00:00
John Baldwin
9f745f61b8 Grab a reference on the matching interface address (ifa) in the handling
of the SIOC[DG]LIFADDR icotls before dropping the IF_ADDR_LOCK() and
release the reference after using it.  This prevents the address from
being potentially freed out from under the ioctl handler.

Reviewed by:	bz
MFC after:	1 week
2012-01-03 19:44:36 +00:00
Oleksandr Tymoshenko
1f74cf8ccf - Octeon-SDK strictly requires multi_count to be zero for
full and low speed devices.
2012-01-03 19:10:37 +00:00
Pedro F. Giffuni
5eda6329b2 Minor cleanups to ntfs code
bzero -> memset
rename variables to avoid shadowing.

PR:		142401
Obtained from:	NetBSD
Approved by	jhb (mentor)
2012-01-03 19:09:01 +00:00
Ed Schouten
b3608ae18f Replace index() and rindex() calls with strchr() and strrchr().
The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.
2012-01-03 18:51:58 +00:00
Dimitry Andric
69ee3e2f52 In sys/compat/linux/linux_ioctl.c, work around a warning when a pointer
is compared to an integer, by casting the pointer to l_uintptr_t.  No
functional difference on both i386 and amd64.

Reviewed by:	ed, jhb
MFC after:	1 week
2012-01-03 18:49:39 +00:00
Dimitry Andric
54a55725a3 In sys/dev/if_ndis/if_ndis_pccard.c, fix a bug where a garbage rid was
passed to resource_list_add().  The rid that was just returned by
bus_alloc_resource_any() should have been used instead.

Reviewed by:	jhb
MFC after:	1 week
2012-01-03 18:40:41 +00:00
John Baldwin
debfd27f8e Improve the cscope target's handling of MD directories. Automatically
include the MACHINE_CPUARCH directory if it differents from MACHINE when
building an index for a single machine.  Also, include the 'x86' directory
when building an index for i386, pc98, or amd64.

MFC after:	1 week
2012-01-03 17:31:27 +00:00
Alexander Motin
2cb9ba56ca Add support for CDRIOCGETBLOCKSIZE and CDRIOCSETBLOCKSIZE IOCTLs to control
sector size same as acd driver does. Together with r228808 and r228847 this
allows existing multimedia/vlc to play Audio CDs via CAM cd driver.

PR:		ports/162190
MFC after:	1 week
2012-01-03 17:04:09 +00:00
John Baldwin
f5b50e25ec Use TAILQ_FOREACH() instead of TAILQ_FOREACH_SAFE() for some loops that
do not modify the queues they iterate over.

Submitted by:	glebius
2012-01-03 16:22:29 +00:00
Kevin Lo
1a74905fee Add support for Intel EG20T serial ports 2012-01-03 10:01:12 +00:00
Bernhard Schmidt
3e51210689 Don't rely on MCS7 being at index 7 while determining the amount
of antennas to use. Not all APs enable all MCS rates.

Poked by:	Lucius Windschuh <lwindschuh at googlemail dot com>
MFC after:	1 week
2012-01-03 09:42:31 +00:00
Ed Schouten
46632c18bd Merge index() and strchr() together.
As I looked through the C library, I noticed the FreeBSD MIPS port has a
hand-written version of index(). This is nice, if it weren't for the
fact that most applications call strchr() instead.

Also, on the other architectures index() and strchr() are identical,
meaning we have two identical pieces of code in the C library and
statically linked applications.

Solve this by naming the actual file strchr.[cS] and let it use
__strong_reference()/STRONG_ALIAS() to provide the index() routine. Do
the same for rindex()/strrchr().

This seems to make the C libraries and static binaries slightly smaller,
but this reduction in size seems negligible.
2012-01-03 07:14:01 +00:00
Ed Schouten
766992d738 Add support for strong aliasing of symbols in i386 assembly.
This macro is a literal copy from the MIPS version of <machine/asm.h>.
2012-01-03 07:06:35 +00:00
Ed Schouten
22fec34a57 Implement extensions on top of standards instead of the other way around.
Now that index() and rindex() have become unused, simply turn them into
wrappers around strchr() and strrchr(), respectively.
2012-01-03 07:05:30 +00:00
Alan Cox
04f883d798 Don't pass VM_ALLOC_ZERO to vm_page_grab() in tmpfs_mappedwrite() and
tmpfs_nocacheread().  It is both unnecessary and a pessimization.  It
results in either the page being zeroed twice or zeroed first and then
overwritten by an I/O operation.

MFC after:	3 weeks
2012-01-03 03:29:01 +00:00
Glen Barber
2bfabe4196 Trivial standardization to a few comments in kern.pre.mk.
Submitted by:		arundel
MFC after:		3 days
2012-01-03 00:22:08 +00:00
Hans Petter Selasky
6bbe7cdfb2 Make sure we probe and attach the root HUB after
resume else no devices will appear again.

MFC after:	1 day
2012-01-02 20:28:33 +00:00
Alexander Motin
157bc8dd42 Remove unneeded checks for CAM_DEV_QFRZN after cam_periph_runccb() call.
cam_periph_runccb() since the beginning checks it and releases device queue.
After r203108 it even clears CAM_DEV_QFRZN flag after that to avoid double
release, so removed code is unreachable now.

MFC after:	1 month
2012-01-02 17:02:45 +00:00
Bernhard Schmidt
65d22fe921 MCS32 equals 32, not 8*ic_txstream. 2012-01-02 16:02:30 +00:00
Bjoern A. Zeeb
ad05fc1d2d Remove an uneeded inpcb forward declaration and align the function
declaration following to match the style in the rest of the file.

MFC after:	3 days
2012-01-02 13:03:13 +00:00
Ed Schouten
dc15eac046 Use strchr() and strrchr().
It seems strchr() and strrchr() are used more often than index() and
rindex(). Therefore, simply migrate all kernel code to use it.

For the XFS code, remove an empty line to make the code identical to
the code in the Linux kernel.
2012-01-02 12:12:10 +00:00
Bjoern A. Zeeb
762ad1d614 As I came by and noticed add a comment that inp locking is a bit optistic
(read: non-existent) here and should be fixed.
2012-01-02 09:18:58 +00:00
Adrian Chadd
63dab8eed9 Initial copy of xz-embedded to sys/contrib/.
The upcoming geom_compress module (a read-only gzip/ulzma translation layer,
similar to what geom_uzip does) will leverage parts of this.
2012-01-01 21:32:25 +00:00
Ed Schouten
41adcfa1d0 Remove the now unused skpc() function.
It was only used by ufs and ext2 and I have really strong doubts that
there are other pieces of code that also use this function. If it turns
out that external drivers use this code as well, I'd be happy to migrate
or revert.

Bump __FreeBSD_version while there.
2012-01-01 20:54:44 +00:00
Ed Schouten
8f8d30274a Migrate ufs and ext2fs from skpc() to memcchr().
While there, remove a useless check from the code. memcchr() always
returns characters unequal to 0xff in this case, so inosused[i] ^ 0xff
can never be equal to zero. Also, the fact that memcchr() returns a
pointer instead of the number of bytes until the end, makes conversion
to an offset far more easy.
2012-01-01 20:47:33 +00:00
Ed Schouten
de85bfc508 Introducing memcchr(3).
It seems two of the file system drivers we have in the tree, namely ufs
and ext3, use a function called `skpc()'. The meaning of this function
does not seem to be documented in FreeBSD, but it turns out one needs to
be a VAX programmer to understand what it does.

SPKC is an instruction on the VAX that does the opposite of memchr(). It
searches for the non-equal character. Add a new function called
memcchr() to the tree that has the following advantages over skpc():

- It has a name that makes more sense than skpc(). Just like strcspn()
  matches the complement of strspn(), memcchr() is the complement of
  memchr().

- It is faster than skpc(). Similar to our strlen() in libc, it compares
  entire words, instead of single bytes. It seems that for this routine
  this yields a sixfold performance increase on amd64.

- It has a man page.
2012-01-01 20:26:11 +00:00
Konstantin Belousov
cdb7a43117 Avoid double-unlock or double unreference for ndp->ni_dvp when the vnode dp
lock upgrade right after the 'success' label fails.

In collaboration with:	pho
MFC after:	1 week
2012-01-01 18:45:59 +00:00
Oleksandr Tymoshenko
af8b177113 - Properly set IRQ handlers for all USB ports 2012-01-01 09:12:21 +00:00
Adrian Chadd
c0711b9756 If frames are dumped out of the queue, let's at least see what they are.
This shows that the majority of the weird traffic I see here are probe
frames that haven't been sent out, but I can also trigger this condition
by doing ICMP w/ -i 0.3 - enough to trigger the TX during actual scanning,
but not fast enough to stop scanning from occuring.

PR:		kern/163689
2012-01-01 01:08:51 +00:00
Adrian Chadd
a92de4a5f6 This particular work around isn't required any longer, now that the
11n radio backends are also added into the RF linker set.

This saves around 7k from the kernel binary.
2011-12-31 23:41:19 +00:00
Oleksandr Tymoshenko
868fb4d19b - struct clocktime sets different ranges for DOW and month
comparing to struct timeval. for clocktime they should be
    1..7 and 1..12 respectively

- CAPK-0100ND uses RTC without centruy bit (DS1307) so set it 21st
2011-12-31 23:21:36 +00:00
Bjoern A. Zeeb
1a69707f40 Remove a declaration to a non-existent function.
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2011-12-31 16:19:22 +00:00
Adrian Chadd
b2e6077c31 Oops - this was referencing a local file, which I've done away with. 2011-12-31 15:56:00 +00:00
Marius Strobl
7ccccd843a Fix header pollution, possibly unbreaking the build of cfi_bus_ixp4xx.c
as part of cfi.ko.
2011-12-31 15:53:34 +00:00
Konstantin Belousov
36fd83b613 Make the comment in i386/include/ucontext.h identical to the one in
amd64/include/ucontext.h. The later is better worded.

Requested by:	deischen
MFC after:	3 days
2011-12-31 14:44:42 +00:00
Hans Petter Selasky
c2d0465a9b Add missing change to XHCI driver similar to changes in r228483.
MFC after:	0 days
2011-12-31 13:34:42 +00:00
Gavin Atkinson
c1cbd9ab53 Default to not performing the early-boot memory tests when we detect we
are booting inside a VM.  There are three reasons to disable this:

o  It causes the VM host to believe that all the tested pages or RAM are
   in use.  This in turn may force the host to page out pages of RAM
   belonging to other VMs, or otherwise cause problems with fair resource
   sharing on the VM cluster.
o  It adds significant time to the boot process (around 1 second/Gig in
   testing)
o  It is unnecessary - the host should have already verified that the
   memory is functional etc.

Note that this simply changes the default when in a VM - it can still be
overridden using the hw.memtest.tests tunable.

MFC after:	4 weeks
2011-12-31 13:24:53 +00:00
Dimitry Andric
b38c0519c5 In sys/dev/hwpmc/hwpmc_amd.c, fix a clang warning about invalid enum
conversions.

Reviewed by:	jkoshy
MFC after:	1 week
2011-12-31 12:37:07 +00:00
Lawrence Stewart
253a3814d4 Revert r228986 until it can be reworked to avoid panicing the kernel when the
same interface is attached multiple times with different DLTs, as is done in
net80211 for example.

Reported by:	adrian
2011-12-31 07:21:28 +00:00
Oleksandr Tymoshenko
9db595847a - Pass proper endpoint number (without direction flag) to
cvmx_usb_open_pipe
2011-12-31 05:45:10 +00:00
Oleksandr Tymoshenko
d77d1b1a17 - Properly clean state structure in cvmx_usb_initialize 2011-12-31 05:25:42 +00:00
Oleksandr Tymoshenko
67c1180199 - CAPK-0100 board's USB timer is 12MHz 2011-12-31 05:24:21 +00:00
David E. O'Brien
879dda1fd5 Happy 2012 to FreeBSD users in Samoa. 2011-12-31 04:38:04 +00:00
Marius Strobl
0f1999cddf Add header required by cfi_bus_fdt.c. 2011-12-30 21:22:10 +00:00
Alan Cox
c65205a6e2 Merge r216333 and r216555 from the native pmap
When r207410 eliminated the acquisition and release of the page queues
  lock from pmap_extract_and_hold(), it didn't take into account that
  pmap_pte_quick() sometimes requires the page queues lock to be held.
  This change reimplements pmap_extract_and_hold() such that it no
  longer uses pmap_pte_quick(), and thus never requires the page queues
  lock.

Merge r177525 from the native pmap
  Prevent the overflow in the calculation of the next page directory.
  The overflow causes the wraparound with consequent corruption of the
  (almost) whole address space mapping.

Strictly speaking, r177525 is not required by the Xen pmap because the
hypervisor steals the uppermost region of the normal kernel address
space.  I am nonetheless merging it in order to reduce the number of
unnecessary differences between the native and Xen pmap implementations.

Tested by:	sbruno
2011-12-30 18:16:15 +00:00
Dimitry Andric
84143cee4f In sys/compat/ndis/subr_ntoskrnl.c, change the RtlFillMemory function
definition from K&R to ANSI, to avoid a clang warning about the uint8_t
parameter being promoted to int, which is not compatible with the type
declared in the earlier prototype.

MFC after:	1 week
2011-12-30 17:18:09 +00:00
Gleb Smirnoff
4bd1b55756 style(9), whitespace and spelling nits. 2011-12-30 15:41:28 +00:00
Dimitry Andric
97a15669a0 Disable several instances instances of clang's -Wself-assign warning.
All of these are harmless, and are in fact used to shut up warnings from
lint.

While here, remove -Wno-missing-prototypes from the xfs module
Makefile, as I could not reproduce those warnings either with gcc or
clang.

MFC after:	1 week
2011-12-30 13:16:59 +00:00
Adrian Chadd
38192bfc9f Add a configuration file for the Atheros PB47 reference board.
This is an AR71xx based board with 8MB flash, 64MB RAM, a
Mini-PCI+ slot (see below) and a single 10/100/1000baseT
ethernet port.  It also has two USB ports.

This is an easier board than most to add as it doesn't have a
switch PHY on-board.  This made it (mostly) trivial to craft a
working configuration.

Things to note:

* This, like most other reference boards, use uboot rather then
  redboot.  It means that you typically have to manually flash
  both the kernel and rootfs partitions.

* Since there's currently no (nice) way to extract out the
  ethernet MAC and RAM from the uboot environment, the RAM
  will default to 32mb and the MAC will be something very
  incorrect.   I'll try to fix this up in a subsequent commit
  or two, even if it's just some hard-coded nonsense in
  ar71xx_machdep.c for now.

* The board is designed for a specific model of mini-PCI+
  NIC which never made it into production.  Normal mini-PCI
  NICs will work fine; if you happen to have the NIC in question
  then it will work fine with this board.
2011-12-30 09:48:35 +00:00
Adrian Chadd
687021dd92 Add a couple of missing wlan modules. 2011-12-30 09:39:24 +00:00
Lawrence Stewart
0f89fc22f3 - Introduce the net.bpf.tscfg sysctl tree and associated code so as to make one
aspect of time stamp configuration per interface rather than per BPF
  descriptor. Prior to this, the order in which BPF devices were opened and the
  per descriptor time stamp configuration settings could cause non-deterministic
  and unintended behaviour with respect to time stamping. With the new scheme, a
  BPF attached interface's tscfg sysctl entry can be set to "default", "none",
  "fast", "normal" or "external". Setting "default" means use the system default
  option (set with the net.bpf.tscfg.default sysctl), "none" means do not
  generate time stamps for tapped packets, "fast" means generate time stamps for
  tapped packets using a hz granularity system clock read, "normal" means
  generate time stamps for tapped packets using a full timecounter granularity
  system clock read and "external" (currently unimplemented) means use the time
  stamp provided with the packet from an underlying source.

- Utilise the recently introduced sysclock_getsnapshot() and
  sysclock_snap2bintime() KPIs to ensure the system clock is only read once per
  packet, regardless of the number of BPF descriptors and time stamp formats
  requested. Use the per BPF attached interface time stamp configuration to
  control if sysclock_getsnapshot() is called and whether the system clock read
  is fast or normal. The per BPF descriptor time stamp configuration is then
  used to control how the system clock snapshot is converted to a bintime by
  sysclock_snap2bintime().

- Remove all FAST related BPF descriptor flag variants. Performing a "fast"
  read of the system clock is now controlled per BPF attached interface using
  the net.bpf.tscfg sysctl tree.

- Update the bpf.4 man page.

Committed on behalf of Julien Ridoux and Darryl Veitch from the University of
Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward
Clock Synchronization Algorithms" project.

For more information, see http://www.synclab.org/radclock/

In collaboration with:	Julien Ridoux (jridoux at unimelb edu au)
2011-12-30 08:57:58 +00:00
Sergey Kandaurov
744aebe369 Unset the environment variables associated with individual menu items
before invoking the kernel.

Quoting submitter:

The issue is with the new boot loader menu. It adds many loader variables
including ones that contain ANSI color escapes.

Obviously, these ANSI codes don't play well with serial consoles when
kenv(1) is executed without arguments (reports vary as to what happens,
but it's never pretty).

The net-effect is that kenv(1) no longer reports menu-related variables.

In essence, kenv(1) output should now appear the same as on RELENG_8
(which lacks the new boot loader and didn't use any such variables).
Thus, restoring serial console glory.

Submitted by:	Devin Teske <devin dott teske fisglobal.com>
MFC after:	2 weeks
2011-12-30 06:24:59 +00:00
Marcel Moolenaar
49a5225199 DEBUG is a kernel option. Don't define it here, as it breaks LINT.
Since DEBUG was subsequently undefined, this is just debugging left-
over.
2011-12-30 04:00:31 +00:00
Marcel Moolenaar
b9887274c1 Actually set the baudrate from the FDT. 2011-12-30 03:57:17 +00:00
Marcel Moolenaar
abc9d2bbc7 Remove trailing white-space. 2011-12-30 03:54:22 +00:00
Marcel Moolenaar
2064b86fc4 Add a module for cfi(4). Build only for arm and powerpc, as there are
only bus attachments only for these.
2011-12-30 03:48:39 +00:00
Dimitry Andric
a3388f6d69 Reapply r228785 now it has been tested by Adrian. Also add comments
with the old AR_SCR_SLE_XXX values, with a short explanation why they
were changed.

Reviewed by:	adrian
MFC after:	1 week
2011-12-30 02:58:37 +00:00
Dimitry Andric
1acc420fe0 In sys/dev/drm/radeon_state.c, use the correct printf length modifiers
for ints.

MFC after:	1 week
2011-12-30 02:07:50 +00:00
Dimitry Andric
874fb554f7 For several files in sys/dev/drm, disable -Wunused-value when building
with clang.  There are several macros in these files that return values,
and in some cases nothing is done with them, but it is completely
harmless.  For some other files, also disable -Wconstant-conversion,
since that triggers a false positive with the DMA_BIT_MASK() macro.

MFC after:	1 week
2011-12-30 01:54:45 +00:00
Robert Watson
009d2032af Add "options CAPABILITY_MODE" and "options CAPABILITIES" to GENERIC kernel
configurations for various architectures in FreeBSD 10.x.  This allows
basic Capsicum functionality to be used in the default FreeBSD
configuration on non-embedded architectures; process descriptors are not
yet enabled by default.

MFC after:	3 months
Sponsored by:	Google, Inc
2011-12-29 22:48:36 +00:00
Dimitry Andric
e0b124a618 For sys/dev/ce/tau32-ddk.c, disable the following warning when building
with clang:

sys/dev/ce/tau32-ddk.c:1228:37: warning: implicit truncation from 'int' to bitfield changes value from 65532 to 8188 [-Wconstant-conversion]

Since this file is obfuscated C, we can never determine (in a sane way,
at least :) if this points to a real problem or not.  The driver has
been in the tree for more than five years, so it most likely isn't.

MFC after:	1 week
2011-12-29 21:17:35 +00:00
John Baldwin
c23de1f45b Defer the work of freeing IPv4 multicast options from a socket to an
asychronous task.  This avoids tearing down multicast state including
sending IGMP leave messages and reprogramming MAC filters while holding
the per-protocol global pcbinfo lock that is used in the receive path of
packet processing.

Reviewed by:	rwatson
MFC after:	1 month
2011-12-29 20:41:16 +00:00
Pyun YongHyeon
1ad7a2570d Update if_obytes and if_omcast after successful transmit.
While I'm here update if_oerrors if parent interface of vlan is not
up and running.  Previously it updated collision counter and it was
confusing to interprete it.

PR:		kern/163478
Reviewed by:	glebius, jhb
Tested by:	Joe Holden < lists <> rewt dot org dot uk >
2011-12-29 18:40:58 +00:00
John Baldwin
3b0b2840be Use queue(3) macros instead of home-rolled versions in several places in
the INET6 code.  This includes retiring the 'ndpr_next' and 'pfr_next'
macros.

Submitted by:	pluknet (earlier version)
Reviewed by:	pluknet
2011-12-29 18:25:18 +00:00
Dimitry Andric
8520ce6001 Fix clang warnings in sys/dev/ce/if_ce.c and sys/dev/cp/if_cp.c,
using jkim's last patch (reviewed by bde) from here:

http://docs.freebsd.org/cgi/mid.cgi?201010141558.03154.jkim

MFC after:	1 week
2011-12-29 17:46:24 +00:00
John Baldwin
b494482f39 Use curthread rather than PCPU_GET(curthread). 'curthread' uses
special-case optimizations on several platforms and is preferred.

Reported by:	dim (indirectly)
MFC after:	2 weeks
2011-12-29 16:40:54 +00:00
John Baldwin
a74d695299 Further relax the strictness of enforcing allocations to only come from
decoded ranges.  Pass any request for a specific range that fails because
it is not in a decoded range for an ACPI Host-PCI bridge up to the parent
to see if it can still be allocated.  This is based on the assumption that
many BIOSes are inconsistent/broken and that settings programmed into BARs
or resources assigned to other built-in components are more trustworthy than
the list of decoded resource ranges in _CRS.  This effectively limits the
decoded ranges to only being used for "wildcard" ranges when allocating
fresh resources for a BAR, etc.  At some point I would like to only be
this permissive during an early scan of firmware-assigned resources during
boot and to be strict about all later allocations, but that isn't viable
currently.

MFC after:	2 weeks
2011-12-29 16:23:14 +00:00
John Baldwin
0c0d27d5dd Cap the priority calculated from the current thread's running tick count
at SCHED_PRI_RANGE to prevent overflows in the priority value.  This can
happen due to irregularities with clock interrupts under certain
virtualization environments.

Tested by:	Larry Rosenman  ler lerctr org
MFC after:	2 weeks
2011-12-29 16:17:16 +00:00
Gleb Smirnoff
9de96e891c Don't fallback to a CARP address in BACKUP state. 2011-12-29 15:59:14 +00:00
John Baldwin
4eda7b08af Regen. 2011-12-29 15:35:47 +00:00
John Baldwin
dd01579cde Implement linux_fadvise64() and linux_fadvise64_64() using
kern_posix_fadvise().

Reviewed by:	silence on emulation@
MFC after:	2 weeks
2011-12-29 15:34:59 +00:00
Sergey Kandaurov
5aa417b0e0 Update LOCKLEAF comment: it should say "vnode".
Inspired by PR docs/11596.
2011-12-29 12:28:05 +00:00
Konstantin Belousov
84f941284c Add PCI Id for the Intel AMT serial interface as found on my DQ67OW.
MFC after:	1 week
2011-12-29 08:27:37 +00:00
Adrian Chadd
425fc5768b Flesh out the RSPRO GPIO config, including the RF LED. 2011-12-29 06:07:24 +00:00
Adrian Chadd
530028c9d6 Break out the AR71XX config file into _BASE and board specific
bits.

The ROUERSTATION and RSPRO variants contain:

* the board specific bits (eg the RTC for RSPRO, later on it'll
  include the GPIO/LED definitions);
* the boot specific bits (eg, on-board flash, usb flash, etc).

For now the AR71XX_BASE file contains the common board config,
drivers and net80211/ath wireless drivers.

I'll follow this up with config files for the other boards I
have (eg the Ubiquiti LSSR71, as well as some Mikrotik boards
that use the AR71XX and atheros reference boards) which will
be quite easy to do now.
2011-12-29 05:51:48 +00:00
Xin LI
81966bce06 Import the first release of HighPoint RocketRAID 27xx SAS 6Gb/s HBA card
driver.  This driver works for FreeBSD/i386 and FreeBSD/amd64 platforms.

Many thanks to HighPoint for providing this driver.

MFC after:	2 weeks
2011-12-28 23:26:58 +00:00
Alexander Motin
a0b435f856 Set maximum I/O size for mps(4) to MAXPHYS. Looking into the code, I see
no reason why it should be limited to 64K of DFLTPHYS. DMA data tag is any
way set to allow MAXPHYS, S/G lists (chain elements) are sufficient and
overflows are also handled. On my tests even 1MB I/Os are working fine.

Reviewed by:	ken@
2011-12-28 22:49:28 +00:00
Alan Cox
b5f359b7c3 Optimize vm_object_split()'s handling of reservations. 2011-12-28 20:27:18 +00:00
Alan Cox
fe8b9971a8 Fix a bug in the Xen pmap's implementation of pmap_extract_and_hold():
If the page lock acquisition is retried, then the underlying thread is
not unpinned.

Wrap nearby lines that exceed 80 columns.
2011-12-28 19:59:54 +00:00
Oleksandr Tymoshenko
6b194c7ade - Add generic GPIO driver for Cavium Octeon. At the moment pin definition is
hardcoded but will be changed later with more flexible way to define them.
2011-12-28 05:57:03 +00:00
Alan Cox
9800a50f2d Eliminate many of the unnecessary differences between the native and
paravirtualized pmap implementations for i386.  This includes some
style fixes to the native pmap and several bug fixes that were not
previously applied to the paravirtualized pmap.

Tested by:	sbruno
MFC after:	3 weeks
2011-12-27 23:53:00 +00:00
David Chisnall
3033610f5d Define NULL to nullptr in C++11 mode (not strictly required, but it makes
migrating code to C++11 easier).

Approved by:	dim (mentor)
2011-12-27 21:36:31 +00:00
Sergey Kandaurov
8f3f6f16e4 Clean up from the 4.x era.
In an example of boot command:
- rename wd(4) IDE disk drives name to ad(4) for the time being.
- update the used kernel path "/kernel" to the current default.
[It still worked occasionally by looking into the /boot/kernel directory,
so the resulting path was "/boot//kernel/kernel", with two slashes.]

Bump .Dd for this and previous changes.

MFC after:	1 week
2011-12-27 15:59:51 +00:00
Matt Jacob
f6683e5594 Fix target mode compilation issues that arose after a change
in the sense data structures.

MFC after:	1 week
2011-12-27 14:59:24 +00:00
Michael Tuexen
60990c0c06 Address issues found by clang. While there, fix also some style
issues.

MFC after: 3 months.
2011-12-27 10:16:24 +00:00
Ed Schouten
489818ac07 Add cdefs-magic to add optional C11 bits to headers. 2011-12-26 18:49:56 +00:00
Ed Schouten
2157f34d3a The standard is now called C11 -- C12.
While there, compare against the proper __STDC_VERSION value.
2011-12-26 10:58:21 +00:00
Adrian Chadd
613f73a82d AR5416 has 14 GPIO pins, from 0->13. 2011-12-26 08:21:29 +00:00
Adrian Chadd
404b0e8b91 Since the only thing with a mux is the AR5416 and later, and we're now
doing split software/hardware LED configuration, we can now simply
treat "softled" as an "output" mux type.

This works fine on this DWA-552. Previous generation (pre-11n NICs) don't
have a GPIO mux - only input/output configuration - so they ignore this
field.
2011-12-26 07:48:29 +00:00
Adrian Chadd
3440495a52 Flesh out configurable hardware based LED blinking.
The hardware (MAC) LED blinking involves a few things:

* Selecting which GPIO pins map to the MAC "power" and "network" lines;
* Configuring the MAC LED state (associated, scanning, idle);
* Configuring the MAC LED blinking type and speed.

The AR5416 HAL configures the normal blinking setup - ie, blink rate based
on TX/RX throughput.  The default AR5212 HAL doesn't program in any
specific blinking type, but the default of 0 is the same.

This code introduces a few things:

* The hardware led override is configured via sysctl 'hardled';
* The MAC network and power LED GPIO lines can be set, or left at -1
  if needed.  This is intended to allow only one of the hardware MUX
  entries to be configured (eg for PCIe cards which only have one LED
  exposed.)

TODO:

* For AR2417, the software LED blinking involves software blinking the
  Network LED.  For the AR5416 and later, this can just be configured
  as a GPIO output line.  I'll chase that up with a subsequent commit.

* Add another software LED blink for "Link", separate from "activity",
  which blinks based on the association state.  This would make my
  D-Link DWA-552 have consistent and useful LED behaviour (as they're
  marked "Link" and "Activity."

* Don't expose the hardware LED override unless it's an AR5416 or later,
  as the previous generation hardware doesn't have this multiplexing
  setup.
2011-12-26 07:47:05 +00:00
Adrian Chadd
a497cd8806 Setup the initial LED state on attach and resume.
Some of the NICs I have here power up with the LEDs blinking, which is
incorrect. The blinking should only occur when the NIC is attempting
to associate.

* On powerup, set the state to HAL_LED_INIT, which turns on the "Power" MAC
  LED but leaves the "Network" MAC LED the way it is.

* On resume, also init it to HAL_LED_INIT unless in station mode, where
  it's forced to HAL_LED_RUN. Hopefully the net80211 state machine will
  call newstate() at some point, which will refiddle the LEDs.

I've tested this on a handful of 11n and pre-11n NICs. The blinking
behaviour is slightly more sensible now.
2011-12-26 06:25:12 +00:00
Adrian Chadd
2942e03f5c Update the hardware LED blinking code to do something useful rather than
relying on what the register defaults are.

This forces the blink mode to be proportional to the TX and RX frames
which match the RX filter.

This (along with a few tweaks to if_ath_led.c to configure the correct
GPIO pins) allows my DWA-552 AR5416 NIC to blink the LEDs in a useful
fashion, however those LEDs are marked "Link" and "Act(ivity)", which
don't really map well to the "power" / "network" LED interface which
the MAC provides. Some further tinkering is needed to see what other
useful operating modes are possible.
2011-12-26 06:07:21 +00:00
Adrian Chadd
6558ffd99a Refactor out the software LED config code into a common function, called
ath_led_config().

The eventual aim is to have both software and hardware based LED
configuration done here.
2011-12-26 05:46:22 +00:00
Adrian Chadd
c65ee21d46 First pass of LED related code changes.
Migrate the LED code out of if_ath.c and into if_ath_led.c.
These routines are _all_ software based LED blinking.
2011-12-26 05:37:09 +00:00
Adrian Chadd
7e97436b0e Do a quick style(9) pass of some of the code introduced with 802.11n
support.
2011-12-26 05:26:35 +00:00
Luigi Rizzo
6f3bc95594 remove a variable definition which shadows the correct one.
Submitted by:	Eitan Adler
2011-12-25 21:00:56 +00:00
Bjoern A. Zeeb
d9667fc69e Quite the tinderbox for the holidays. Remove the assert[1].
Suggested by:	jhibbits [1]
MFC after:	3 days
2011-12-25 14:29:36 +00:00
Oleksandr Tymoshenko
27e093e7f4 - Initialize compact_flash_attribute_base_addr from bootinfo structure 2011-12-24 23:15:25 +00:00
Justin Hibbits
7b25dcca76 Implement hwpmc counting PMC support for PowerPC G4+ (MPC745x/MPC744x).
Sampling is in progress.

Approved by:	nwhitehorn (mentor)
MFC after:	9.0-RELEASE
2011-12-24 19:34:52 +00:00
Dimitry Andric
1e139d5f54 When building the kernel for amd64 with clang, don't attempt to use the
-frename-registers option, as it is not supported.  No change for builds
with gcc.

MFC after:	1 week
2011-12-24 19:01:31 +00:00
Dimitry Andric
8cd925d925 Make another clang warning, -Wparentheses-equality, non-fatal during
kernel builds.  All the instances of this warning in our tree are
completely harmless, and many people seem to like adding extra
parentheses to make precedence clearer.

MFC after:	1 week
2011-12-24 18:57:42 +00:00
John Baldwin
94e8313349 Fix a bug where TAILQ_FIRST(&V_ifnet) was accessed without holding the
proper lock.

Reviewed by:	bz
MFC after:	1 week
2011-12-24 18:11:54 +00:00
Dimitry Andric
6512fa7aec Amend r228781 by also disabling -Warray-bounds warnings for the asr
module.

MFC after:	1 week
2011-12-24 17:54:58 +00:00
Kevin Lo
824be4a073 Discard local array based on return values.
Pointed out by:	uqs
Found with:	Coverity Prevent(tm)
CID:	10089
2011-12-24 15:49:52 +00:00
Dimitry Andric
e6b475640f Set WERROR= for the nve(4) module. This driver gives several warnings
with clang, which will probably never be fixed, as it is unmaintained,
and superseded by nfe(4).

MFC after:	1 week
2011-12-24 13:36:28 +00:00
Dimitry Andric
7afac0fdc8 Make another clang warning, -Wempty-body, non-fatal during kernel
builds.  All the instances of this warning in our tree are completely
harmless.  (Most of the empty bodies look to be used simply as reminder
for the developer to add something later.)

While here, assign to CWARNEXTRA with ?=, so it can be overridden
easily, if needed.

MFC after:	1 week
2011-12-24 13:30:15 +00:00
David Chisnall
5dc8e009ab Some GCC-compatibility definitions. Define clang's feature test pseudomacros
to always evaluate to 0 if we are using a compiler that doesn't implement them.
This lets us use the macros easily in standard headers (e.g. stdatomic.h, which
should be the subject of my next commit).

Approved by:	dim (mentor)
2011-12-24 13:28:49 +00:00
Marius Strobl
1496f65717 Update a comment to reflect reality and explain why we're using the
medany code model.
2011-12-24 12:28:23 +00:00
Lawrence Stewart
6cedd609b7 Introduce the sysclock_getsnapshot() and sysclock_snap2bintime() KPIs. The
sysclock_getsnapshot() function allows the caller to obtain a snapshot of all
the system clock and timecounter state required to create time stamps at a later
point. The sysclock_snap2bintime() function converts a previously obtained
snapshot into a bintime time stamp according to the specified flags e.g. which
system clock, uptime vs absolute time, etc.

These KPIs enable useful functionality, including direct comparison of the
feedback and feed-forward system clocks and generation of multiple time stamps
with different formats from a single timecounter read.

Committed on behalf of Julien Ridoux and Darryl Veitch from the University of
Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward
Clock Synchronization Algorithms" project.

For more information, see http://www.synclab.org/radclock/

In collaboration with:	Julien Ridoux (jridoux at unimelb edu au)
2011-12-24 01:32:01 +00:00
Sergey Kandaurov
da914858e1 Fix LINT-VIMAGE build after r228814: use virtualized pf_pool_limits. 2011-12-24 00:23:27 +00:00
Oleksandr Tymoshenko
d42cc94633 - Enable usbus on octusb 2011-12-24 00:22:21 +00:00
Oleksandr Tymoshenko
5a312a4a9a - Set CF physical address base in sysinfo structure 2011-12-23 22:10:55 +00:00
Alexander Motin
c8c8fe876f Report stripeoffset as zero not stripesize if physical block is zero
aligned, same as it is done for ATA.
2011-12-23 20:59:13 +00:00
John Baldwin
f0d6c5caf0 Add post-VOP hooks for VOP_DELETEEXTATTR() and VOP_SETEXTATTR() and use
these to trigger a NOTE_ATTRIB EVFILT_VNODE kevent when the extended
attributes of a vnode are changed.

Note that OS X already implements this behavior.

Reviewed by:	rwatson
MFC after:	2 weeks
2011-12-23 20:11:37 +00:00
Alexander Motin
2789ec41bc Addition to r228808:
READ CD is a 12 byte command. So fill additional bytes and update CDB length
when patching READ(10).

MFC after:	1 month
2011-12-23 19:53:28 +00:00
Alexander Motin
f67daabb25 Use READ CAPACITY(16) to get information about device physical sectors.
As soon as not all devices support READ CAPACITY(16), automatically fall
back to READ CAPACITY(10) if CAM_REQ_INVALID or SSD_KEY_ILLEGAL_REQUEST
status returned.

It also provides first bits of information about Logical Block Provisioning
(aka UNMAP/TRIM) support by the device.
2011-12-23 19:12:02 +00:00
Luigi Rizzo
d0c7b0751a 1. don't use if_pspare directly, but through a macro WMA()
2. move a variable declaration at the beginning of a block
2011-12-23 16:03:57 +00:00
Luigi Rizzo
57bf0568e1 whitespace fixes (one missing newline, one extra tab) 2011-12-23 16:02:14 +00:00
Dimitry Andric
2cd8464e4e Amend r228822 by not directly adding to CWARNFLAGS, but to an optional
CWARNEXTRA variable, which gets included into the initial CWARNFLAGS
setting.  This makes it easier to override CWARNFLAGS with completely
custom settings (including enabling any disabled warnings).

Reminded by:	arundel
MFC after:	1 week
2011-12-23 13:50:33 +00:00
Konstantin Belousov
75ff604a78 Optimize the common case of msyncing the whole file mapping with
MS_SYNC flag. The system must guarantee that all writes are finished
before syscalls returned. Schedule the writes in async mode, which is
much faster and allows the clustering to occur. Wait for writes using
VOP_FSYNC(), since we are syncing the whole file mapping.

Potentially, the restriction to only apply the optimization can be
relaxed by not requiring that the mapping cover whole file, as it is
done by other OSes.

Reported and tested by:	 az
Reviewed by: alc
MFC after:   2 weeks
2011-12-23 09:09:42 +00:00
Adrian Chadd
252b52fd58 Disable the code which hard-sets the LEDs on. This prevents the LED
state from correctly updating things.

The reference driver directly enables/disables the LED state as required,
rather than nailing it up like it currently is.  That'll have to come
later by adding some further HAL methods.

Obtained from:	Atheros
2011-12-23 09:09:10 +00:00
Adrian Chadd
b5e55cb397 Port over some more GPIO fixes from the atheros reference HAL.
* Bring the AR5416 GPIO mux mask code in line with the code from the
  HAL.

* Add HAL_DEBUG_GPIO debugging statements, to track what's going on.

* Add Kiwi GPIO specific changes for reading values back.

Obtained from:	Atheros
2011-12-23 08:53:22 +00:00
Adrian Chadd
e81f85f155 Port over some GPIO and LED fixes.
* As a preparation for AR9287 GPIO support, add in the AR9287 GPIO mask.
* Fix the association mask values; these are post-shift values but were
  being shifted in twice. This resulted in some garbage being written
  in the wrong place and the link LED (at least on my d-link AR5416
  NIC) giving totally incorrect blink patterns.
2011-12-23 08:32:53 +00:00
Adrian Chadd
153bf8fbd3 Remove unused #define's.
Pointy hat to: adrian, for not properly reading things when he copied
  ar9285.h to ar9287.h.
2011-12-23 04:05:39 +00:00
Adrian Chadd
ee3219757a Rework this ugly mess that tries to handle reset serialisation.
Some users were reporting concurrent resets _were_ occuring - ie,
either two ath_reset()s ran at the same time (likely one on each CPU)
or ath_reset() versus ath_chan_change().

Instead, this now tries to grab the serialisation semaphore and will
pause() for a while if it fails. It will always eventually succeed though
and will log an error if it hits the recursion situation.

All of this stuff needs to die a horrible death at some point and be
replaced with a properly serialising method of programming this stuff
(eg using the net80211 taskqueue for all of this stuff.) The trouble
is figuring out how to handle the concurrent ioctl() based things without
introducing more LORs (which is another reason why I haven't just wrapped
all of this stuff in large, long-lived locks, a-la what Linux can get
away with.)

MFC after:	Absolutely, positively never.
2011-12-23 03:59:49 +00:00
Adrian Chadd
6e0f116875 Make some more of the 11n specific code conditional.
This doesn't fix compilation w/out AH_SUPPORT_AR5416 as all of the software
aggregation support in if_ath_tx.c and 11n code in if_ath_tx_ht.c touches
the 11n specific fields. I'll work on that later.
2011-12-23 02:40:35 +00:00
Adrian Chadd
197d53c565 Add a temporary debugging statement in order to try and identify what's
going on with the occasional garbage rs_antenna field reported by AR9285
users.

I've discovered that the 11n NICs only fill out the entire RX status
descriptor on the final descriptor in an aggregate. Some of the fields
(notably RSSI) are complete nonsense for A-MPDU subframes. This may
be another example of this.

The driver doesn't currently toss out statistics for non-final aggregate
frames. It's likely that this should be done.

If any users hit this particular debugging message they should report it
immediately to freebsd-wireless@freebsd.org - please ensure you have
ATH_DEBUG enabled so it prints out the full receive descriptor.

PR:		kern/163312
2011-12-23 02:21:22 +00:00
Rick Macklem
f855a3c570 During investigation of an NFSv4 client crash reported by glebius@,
jhb@ spotted that nfscl_getstateid() might modify credentials when
called from nfsrpc_read() for the case where p != NULL, whereas
nfsrpc_read() only did a crdup() to get new credentials for p == NULL.
This bug was introduced by r195510, since pre-r195510 nfscl_getstateid()
only modified credentials for the p == NULL case. This patch modifies
nfsrpc_read()/nfsrpc_write() so that they do crdup() for the p != NULL case.
It is conceivable that this bug caused the crash reported by glebius@, but
that will not be determined for some time, since the crash occurred after
about 1month of operation.

Tested by:	glebius
Reviewed by:	jhb
MFC after:	2 weeks
2011-12-23 02:04:35 +00:00
Navdeep Parhar
e050eaa32a Fix return value of function.
Submitted by:	Dan McGregor <dan dot mcgregor at usask dot ca>
2011-12-23 01:39:10 +00:00
Dimitry Andric
0ed78d642e When building the kernel with clang, it produces several warnings which
might be useful in some cases, but which are not severe enough to error
out the whole kernel build.  Display them anyway, so there is at least
some incentive to fix them eventually.

Start with -Wtautological-compare warnings.  These usually occur when
people check if unsigned quantities are negative, or similar cases.  To
clean these up would be painful, and might give problems if the base
type which is compared against changes to signed later on.

MFC after:	1 week
2011-12-23 00:23:37 +00:00
Alexander Motin
e66b36c6a7 Merge to da driver quirks hinting 4K physical sector sizes for SATA disks
connected via SAS or USB. Unluckily I've found that SAS (mps) and USB-SATA
I have translate models in different ways, requiring twice more quirks.
Unluckily for Hitachi, their model names are trimmed on SAS, making
impossible to identify 4K sector drives that way.
2011-12-23 00:10:17 +00:00
Alexander Motin
643d18260b Update list of 4K physical sector hard drives. 2011-12-22 23:50:31 +00:00
Dimitry Andric
f15dabe59d Disable various warnings for the ath module in a more fine-grained way:
only add the option for the specific .c files that need them, like via
sys/conf/files.

MFC after:	1 week
2011-12-22 23:40:52 +00:00
Adrian Chadd
ead079638f Use the correct types when calling the decompression mask function.
There's currently no public code which uses this feature and the
current reference driver doesn't enable this feature at all.
It's possible it was used by a previous version of the driver and
that indeed it should return HAL_STATUS; but at this point I'm
happy to require that they complain and submit a patch.

This was found by LLVM compile-time type checking.

Submitted by:	dim
2011-12-22 21:54:53 +00:00
Gleb Smirnoff
6bc752e028 Merge from OpenBSD:
revision 1.122
  date: 2009/05/13 01:01:34;  author: dlg;  state: Exp;  lines: +6 -4
  only keep track of the number of updates on tcp connections. state sync on
  all the other protocols is simply pushing the timeouts along which has a
  resolution of 1 second, so it isnt going to be hurt by pfsync taking up
  to a second to send it over.

  keep track of updates on tcp still though, their windows need constant
  attention.
2011-12-22 19:09:55 +00:00
Gleb Smirnoff
2662e31fc3 Merge from OpenBSD:
revision 1.120
  date: 2009/04/04 13:09:29;  author: dlg;  state: Exp;  lines: +5 -5
  use time_uptime instead of time_second internally. time_uptime isnt
  affected by adjusting the clock.

  revision 1.175
  date: 2011/11/25 12:52:10;  author: dlg;  state: Exp;  lines: +3 -3
  use time_uptime to set state creation values as time_second can be
  skewed at runtime by things like date(1) and ntpd. time_uptime is
  monotonic and therefore more useful to compare against.
2011-12-22 19:05:58 +00:00
Gleb Smirnoff
e3b670692a Merge couple more fixes from OpenBSD to bulk processing:
revision 1.118
  date: 2009/03/23 06:19:59;  author: dlg;  state: Exp;  lines: +8 -6
  wait an appropriate amount of time before giving up on a bulk update,
  rather than giving up after a hardcoded 5 seconds (which is generally much
  too short an interval for a bulk update).
  pointed out by david@, eyeballed by mcbride@

  revision 1.171
  date: 2011/10/31 22:02:52;  author: mikeb;  state: Exp;  lines: +2 -1
  Don't forget to cancel bulk update failure timeout when destroying an
  interface.  Problem report and fix from Erik Lax, thanks!

Start a brief note of revisions merged from OpenBSD.
2011-12-22 18:56:27 +00:00
Gleb Smirnoff
c5360c2998 We really mean MTU of the real interface here, not of our pseudo. 2011-12-22 18:51:35 +00:00
Gleb Smirnoff
1c435c73a1 Use a better log message for master down event. 2011-12-22 18:48:21 +00:00
Gleb Smirnoff
538c3a7cd0 In FreeBSD we always have bpf(4) API, either real or stub. No need
in detecting presense of 'device bpf'.
2011-12-22 18:31:47 +00:00
Alexander Motin
90a987e4de Make cd driver to handle Audio CDs, reporting their 2352 bytes sectors to
GEOM and using READ CD command for reading data, same as acd driver does.
Audio CDs identified by checking respective bit of the control field of
the first track in TOC.

This fixes bunch of error messages during boot (GEOM taste) with Audio CD
inserted and allows to grab Audio CD image using just dd.

MFC after:	1 month
2011-12-22 16:40:35 +00:00
Dimitry Andric
40c56173c2 Disable -Wconstant-conversion warnings for the aic7xxx module in a more
fine-grained way: only add the option for the specific .c files that
need them, like via sys/conf/files.

MFC after:	1 week
2011-12-22 16:16:12 +00:00
John Baldwin
268e76d86e Use TASK_INITIALIZER() for dev_dtr_task rather than a dedicated SYSINIT(). 2011-12-22 16:01:10 +00:00
Luigi Rizzo
2d0d326d91 put back netmap support, deleted by mistake in a previous commit 2011-12-22 15:33:41 +00:00
Fabien Thomas
a7c3afc33f Correctly spell my email address. 2011-12-22 15:13:32 +00:00
Dimitry Andric
38d3d227ed Revert r228786. We'll need to work around the warnings in another way.
Requested by:	adrian
MFC after:	1 week
2011-12-22 14:09:08 +00:00
Dimitry Andric
a6c1d38f59 Revert r228785. We'll need to work around the warnings in another way.
Requested by:	adrian
MFC after:	1 week
2011-12-22 13:47:36 +00:00
Kevin Lo
e2ee19e346 Discarding local array based on return values 2011-12-22 06:31:29 +00:00
Dimitry Andric
510ac7e382 Amend r228783 by also disabling -Wshift-count-negative
-Wshift-count-overflow warnings for the ath module.

MFC after:	1 week
2011-12-21 22:13:50 +00:00
Dimitry Andric
ff0dd2e517 Amend r228779 by also disabling -Wconstant-conversion warnings for the
aic7xxx module.

MFC after:	1 week
2011-12-21 20:23:03 +00:00
John Baldwin
ef93f57495 Restore the sysctl changes from 223676 and 227309 lost in the previous
import:
- Add read-only sysctls for all of the tunables supported by the igb and
  em drivers.
- Make the per-instance 'enable_aim' sysctl truly per-instance by having it
  change a per-instance variable (which is used to control AIM) rather
  than having all of the per-instance sysctls operate on a single global
  variable.

While here, restore the previously existing hw.igb.rx_processing_limit
tunable as it is very useful to be able to set a default tunable that
applies to all adapters in the system.
2011-12-21 20:10:11 +00:00
Eitan Adler
53113e4db9 - Remove extra space
Submitted by:	Davide Italiano <davide.italiano@gmail.com>
Approved by:	brucec
2011-12-21 17:51:49 +00:00
Dimitry Andric
6831e3178a Fix enum conversion problems in sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
and sys/dev/ath/ath_hal/ar5416/ar5416_misc.c:

sys/dev/ath/ath_hal/ar5212/ar5212_misc.c:577:24: warning: implicit conversion from enumeration type 'HAL_STATUS' to different enumeration type 'HAL_BOOL' [-Wconversion]
                return HAL_EINVAL;
                ~~~~~~ ^~~~~~~~~~

and:

sys/dev/ath/ath_hal/ar5416/ar5416_misc.c:164:9: warning: implicit conversion from enumeration type 'HAL_STATUS' to different enumeration type 'HAL_BOOL' [-Wconversion]
        return HAL_OK;
        ~~~~~~ ^~~~~~

In both cases, enums HAL_BOOL and HAL_STATUS are mixed up.

MFC after: 1 week
2011-12-21 17:36:45 +00:00
Dimitry Andric
46fb42dc9d Fix shift overflow problem in sys/dev/ath/ath_hal/ar5210/ar5210_power.c
and sys/dev/ath/ath_hal/ar5211/ar5211_power.c:

sys/dev/ath/ath_hal/ar5210/ar5210_power.c:36:3: warning: signed shift result (0x200000000) requires 35 bits to represent, but 'int' only has 32 bits [-Wshift-overflow]
                OS_REG_RMW_FIELD(ah, AR_SCR, AR_SCR_SLE, AR_SCR_SLE_ALLOW);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sys/dev/ath/ath_hal/ah_internal.h:472:42: note: expanded from:
                (OS_REG_READ(_a, _r) &~ (_f)) | (((_v) << _f##_S) & (_f)))
                                                       ^
sys/dev/ath/ah_osdep.h:127:49: note: expanded from:
            (bus_space_handle_t)(_ah)->ah_sh, (_reg), (_val))
                                                       ^~~~

The AR_SCR_SLE_{WAKE,SLP,NORM} values are pre-shifted in ar5210reg.h and
ar5211reg.h, while they should be unshifted, like in ar5212reg.h.  Then,
when the OS_REG_RMW_FIELD() macro shifts them again, the values will
overflow, becoming effectively zero.

MFC after: 1 week
2011-12-21 17:16:43 +00:00
Dimitry Andric
6f7651b9b6 When building with clang, disable -Wshift-count-negative and
-Wshift-count-overflow for sys/dev/ath/ath_hal/ah_regdomain.c, as it
gets multiple instances of the following warnings:

In file included from sys/dev/ath/ath_hal/ah_regdomain.c:99:
sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:69:15: warning: shift count is negative [-Wshift-count-negative]
         .chan11a               = BM4(F1_4950_4980,
                                  ^~~~~~~~~~~~~~~~~
sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:41:4: note: expanded from:
          W1(_fa) | W1(_fb) | W1(_fc) | W1(_fd) }
          ^
sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:34:45: note: expanded from:
        (((_a) > 63 && (_a) < 128 ? (((uint64_t) 1)<<((_a)-64)) : (uint64_t) 0))
                                                   ^ ~~~~~~~~~

and:

In file included from sys/dev/ath/ath_hal/ah_regdomain.c:99:
sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:629:15: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
         .chan11a               = BM4(W2_5260_5320,
                                  ^~~~~~~~~~~~~~~~~
sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:40:34: note: expanded from:
        { W0(_fa) | W0(_fb) | W0(_fc) | W0(_fd),                        \
                                        ^
sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:32:44: note: expanded from:
        (((_a) >= 0 && (_a) < 64 ? (((uint64_t) 1)<<(_a)) : (uint64_t) 0))
                                                  ^ ~~~~

Both warnings are false positives, caused by LLVM PR 10030.  For global
initializations, clang fails to detect that the branch of the ternary
operator causing the warning is dead.

MFC after:	1 week
2011-12-21 17:01:13 +00:00
Ed Schouten
39154992db Make the RTC checking for QEMU even more aggressive.
At work, where we use use KVM+QEMU, we notice that pxeboot is pratically
impossible because of network timeouts. This is due to the fact that the
RTC code makes aggressive jumps.

Two RTC reads does not seem to be sufficient. Change the code to check
for 8 identical RTC values.

Sponsored by:	Kumina bv
2011-12-21 16:47:01 +00:00
Dimitry Andric
fea858696e When building with clang, disable -Warray-bounds for sys/dev/asr/asr.c,
as it gets the following warning:

sys/dev/asr/asr.c:1836:29: warning: array index of '58' indexes past the end of an array (that contains 1 element) [-Warray-bounds]
        while ((len > 0) && (sg < &((PPRIVATE_SCSI_SCB_EXECUTE_MESSAGE)
                                   ^
sys/dev/asr/i2omsg.h:934:8: note: array 'Simple' declared here
       I2O_SGE_SIMPLE_ELEMENT              Simple[1];
       ^

This is a false positive, since I2O_SG_ELEMENT::Simple is not declared
as a C99 flexible array member, but in the old (but more portable) way.
At run-time, the proper number of array elements will hopefully have
been allocated.

MFC after:	1 week
2011-12-21 16:38:37 +00:00
Dimitry Andric
a380d07b92 Start selectively disabling a few kernel build warnings for clang, since
there are some places in the kernel where fixing them is too disruptive,
or where there is a false positive.

In this case, disable -Wconstant-conversion for two aic7xxx-related
files, as they get the following warning on i386 (and possibly on other
32-bit arches):

sys/dev/aic7xxx/ahc_pci.c:112:10: warning: implicit conversion from 'long long' to 'bus_addr_t' (aka 'unsigned int') changes value from 549755813887 to 4294967295 [-Wconstant-conversion]
                                   ? 0x7FFFFFFFFFLL
                                   ~~^~~~~~~~~~~~~~

This is a false positive, since the code only passes the 0x7FFFFFFFFFLL
argument, if sizeof(bus_addr_t) is larger than 4 (e.g. on 64 bit arches,
or when PAE is enabled on i386).  The code could be refactored to do
compile-time checks, but that is more disruptive.

MFC after:	1 week
2011-12-21 15:59:18 +00:00
Gleb Smirnoff
7121247312 Provide ABI compatibility shim to enable configuring of addresses
with ifconfig(8) prior to r228571.

Requested by:	brooks
2011-12-21 12:39:08 +00:00
Andriy Gapon
b133becced sc_cngrab: switch to console vty when possible
In the future we may want to perform the switch even if the console is
currently in the graphics mode by trying to reset the video adapter first
(e.g. by executing vesa/vga bios post).  That would probably require
some sort of a one-way flag as returning the control of the console back
to the interrupted application most likely would result in a mess.

Reviewed by:	emaste
MFC after:	2 months
2011-12-21 12:21:22 +00:00
Andriy Gapon
bc40a96992 ukbd: adjust for SCHEDULER_STOPPED() and overhaul locking code
This change is designed to let USB keyboard work in the panic context
with stop_scheduler_on_panic=1.  Most of change consists of removing
mtx_owned() checks where they can be easily avoided.  Some additional
lock cleanup is performed along the way.

A list of the smaller changes:
- newbus methods should be executed with Giant already held, just assert
  this
- kbd methods called in the non-polling context should be executed with
  Giant already held, just assert this
- Giant is recursive, so we should just take it where we must have it,
  without redundant checks if we already have it
- thanks to recent syscons changes we don't need to go through the hoops
  to detect if kernel is going to poll us; polling mode is now clearly
  separated from non-polling mode
- at present the polling mode can be entered by only one thread
- document special cases in greater detail

Please note that the ukbd code and underlying USB code still lve
dangerously in the kdb context by trying to obtain various locks
including the Giant.  If any of those locks are already held by the
stopped threads, then the things would blow up.
Another limitation of the ukbd driver is that it is detached before a
system enters the halt state.

With this commit we can enable kern.stop_scheduler_on_panic by default,
that should not introduce any regressions.

Reviewed by:	hselasky
MFC after:	3 months
X-MFC after:	r228424, r228760
2011-12-21 11:49:33 +00:00
Andriy Gapon
6703915ee7 adapt usb transfer code for SCHEDULER_STOPPED
When SCHEDULER_STOPPED() is true the mtx_owned() call may return
an unexpected and thus meaningless result.
So, in the code paths that can be reached when SCHEDULER_STOPPED() is true
we need to protect the mtx_owned() calls with the SCHEDULER_STOPPED()
checks and ensure that an appropriate branch is taken in each case.

Reviewed by:	hselasky
MFC after:	3 months
X-MFC after:	r228424
2011-12-21 10:52:17 +00:00
Hans Petter Selasky
85b44a018c Fix for race against user-space applications trying to change the
configuration on USB HUBs.

PR:		kern/163091
MFC after:	1 week
2011-12-21 08:46:08 +00:00
Rick Macklem
713f46ac47 jwd@ reported a problem via email where the old NFS client would
get a reply of EEXIST from an NFS server when a Mkdir RPC was retried,
for an NFS over UDP mount.
Upon investigation, it was found that the client was retransmitting
the Mkdir RPC request over UDP, but with a different xid. As such,
the retransmitted message would miss the Duplicate Request Cache
in the server, causing it to reply EEXIST. The kernel client side
UDP rpc code has two timers. The first one causes a retransmit using
the same xid and socket and was set to a fixed value of 3seconds.
(The default can be overridden via CLSET_RETRY_TIMEOUT.)
The second one creates a new socket and xid and should be larger
than the first. However, both NFS clients were setting the second
timer to nm_timeo ("timeout=<value>" mount argument), which defaulted to
1second, so the first timer would never time out.
This patch fixes both NFS clients so that they set the first timer
using nm_timeo and makes the second timer larger than the first one.

Reported by:	jwd
Tested by:	jwd
Reviewed by:	jhb
MFC after:	2 weeks
2011-12-21 02:45:51 +00:00
Alan Cox
7e77373c83 The size passed to kmem functions should be in terms of bytes and not
pages.

Avoid an out-of-bounds array access.

Reviewed by:	cperciva
2011-12-20 20:29:45 +00:00
Alan Cox
971238ae48 The Xen pmap doesn't support superpages. So, there is no point in it
initializing structures, like the pv table, that are only used to
implement superpages.  In fact, some of the unnecessary code in
pmap_init() was actually doing harm.  It was preventing the kernel from
booting on virtual machines with more than 768 MB of memory.

Tested by:	sbruno
2011-12-20 20:16:12 +00:00
John Baldwin
f9a0145857 Allow boot0cfg to force a PXE boot via boot0 on the next boot.
- Fix boot0 to check for PXE when using the pre-set setting for the
  preferred slice.
- Update boot0cfg to use slice 6 to select PXE.  Accept a 'pxe' argument
  instead of a number for the 's' option as a way to select PXE as well.

Submitted by:	Andrew Boyer  aboyer averesystems
MFC after:	2 weeks
2011-12-20 15:19:29 +00:00
Gleb Smirnoff
f08535f872 Restore a feature that was present in 5.x and 6.x, and was cleared in
7.x, 8.x and 9.x with pf(4) imports: pfsync(4) should suppress CARP
preemption, while it is running its bulk update.

However, reimplement the feature in more elegant manner, that is
partially inspired by newer OpenBSD:

- Rename term "suppression" to "demotion", to match with OpenBSD.
- Keep a global demotion factor, that can be raised by several
  conditions, for now these are:
  - interface goes down
  - carp(4) has problems with ip_output() or ip6_output()
  - pfsync performs bulk update
- Unlike in OpenBSD the demotion factor isn't a counter, but
  is actual value added to advskew. The adjustment values for
  particular error conditions are also configurable, and their
  defaults are maximum advskew value, so a single failure bumps
  demotion to maximum. This is for POLA compatibility, and should
  satisfy most users.
- Demotion factor is a writable sysctl, so user can do
  foot shooting, if he desires to.
2011-12-20 13:53:31 +00:00
Gleb Smirnoff
352e70652f - Cover pfsync callouts deletion with PF_LOCK().
- Cover setting up interface between pf and pfsync with PF_LOCK().
2011-12-20 12:34:16 +00:00
Adrian Chadd
74ab90b71e Fix broken locking that I introduced in the previous commit. 2011-12-20 03:25:11 +00:00
Adrian Chadd
fd06fec782 IIC bitbang changes - prepare to make the bit delay configurable; debug print changes.
* Right now the delay is hard coded at 10uS. This is a bit long when doing lots
  of periodic i2c transactions. So create a 'udelay' parameter and initialise it
  to 10. This can be tuned later.

* Add a newline after a transaction finishes, so the debugging output isn't so
  horrible.
2011-12-20 02:49:01 +00:00
Alexander Motin
823efe3764 Oops, list of IDs is not sequential. Have to list all of them expoicitly. 2011-12-20 02:42:53 +00:00
Alexander Motin
3e6059772d Cast some vendor-specific spell on VIA VT1708S codecs to:
- make analog input loopback work;
 - get access to the mics boost controls.

Sponsored by:	iXsystems, Inc.
MFC after:	1 month
2011-12-20 02:00:27 +00:00
Adrian Chadd
ddd7699151 Remove these locks - they aren't strictly needed and cause measurable
performance issues.

* Access to the GPIO bus is already locked by requesting
  and releasing the bus - thus the lock isn't really needed
  for each GPIO pin change.
* Don't lock and unlock the GPIO bus for -each- i2c access -
  the i2c bus code is already doing this by calling the upper
  layer callback to request/release the bus. This thus locks
  the bus for the entirety of the transaction.

TODO:

* Further verify that everything is correctly requesting/
  releasing the GPIO bus.
* Look at how to lock the GPIO pin configuration stuff,
  potentially by locking/unlocking the bus at the gpiobus
  layer.
2011-12-20 00:33:56 +00:00
Xin LI
25841e912f Add comments in NOTES to say what viawd is. 2011-12-20 00:16:52 +00:00
Hans Petter Selasky
d63cc02d7a Make the recently added "no_shutdown_wait" sysctl writeable.
Suggested by:	avg @
MFC after:	3 days
2011-12-19 23:39:08 +00:00
Andriy Gapon
167057914b ule: ensure that batch timeshare threads are scheduled fairly
With the previous code, if the range of priorities for timeshare batch
threads was greater than RQ_NQS, then the threads with low priorities in
the part of the range above RQ_NQS would be scheduled to the run-queues
as if they had high priorities at the beginning of the range.
In other words, threads with a nice level of +N could be scheduled as
if they had a nice level of -M.

Reported by:	George Mitchell <george@m5p.com>
Reviewed by:	jhb
Tested by:	George Mitchell <george@m5p.com> (earlier version)
MFC after:	1 week
2011-12-19 20:01:21 +00:00
Pyun YongHyeon
7659f3c35d Increase wait time for OP_TCPSTART command processing. It seems
100us is not enough to ensure prefetch unit work.
2011-12-19 19:02:36 +00:00
Pyun YongHyeon
cbecedb2c5 TCP header size is represented by number of 32bits words.
Fix the TCP header size calculation such that makes TSO engine
cache all header(ethernet/IP/TCP) bytes to its internal buffer.
While here, remove extra pull up for TCP payload.  Unlike some
em(4) controllers, fxp(4) does not require such work around for
TSO.
The two limitations are ethernet/IP/TCP header size should be less
than or equal to the size of controller's internal buffer(80 bytes)
and these header information should be found in the first fragment
of a TSO frame.
2011-12-19 19:00:34 +00:00
John Baldwin
a7f5f7948b Add a TASK_INITIALIZER() macro that can be used to statically
initialize a task structure.

Reviewed by:	gj
MFC after:	2 weeks
2011-12-19 18:55:13 +00:00
Hans Petter Selasky
5ed294aec0 Add code to wait for USB shutdown to be executed at system shutdown.
Add sysctl which can be used to skip this waiting.

MFC after:	3 days
2011-12-19 15:35:05 +00:00
Andriy Gapon
528bf6e40e opensolaris compat: fix vcmn_err so that panic(9) produces a proper message
... instead of just a verbatim format string.

Reviewed by:	pjd
MFC after:	1 week
2011-12-19 14:55:14 +00:00
Hans Petter Selasky
6bd3e53514 Add missing unlock of USB controller's lock, when
doing shutdown, suspend and resume.

Suggested by:	avg @
MFC after:	3 days
2011-12-19 14:53:42 +00:00
Maxim Konovalov
d96ea877a7 o Convert IPv6 read-only stats sysctls to the read-write ones.
o Teach netstat(1) -z to reset these stats sysctls.

PR:		bin/153206
Reviewed by:	glebuis
Sponsored by:	NGINX, Inc.
MFC after:	1 month
2011-12-19 05:50:34 +00:00
Marius Strobl
e0a4047562 Fix compilation on sparc64 by actually supplying the bus_dma_tag_t member
of the rx_ring to bus_dmamap_sync(9). Given that netmap code tries to
obtain the bus addresses of netmap buffers via vtophys(9) instead of using
bus_dma(9) it currently has zero chance of actually working on sparc64
though (and for that matter f.e. also not with MACs limited to 32-bit DMA
on x86 machines with more than 4GB of RAM).
2011-12-18 17:48:54 +00:00
Nathan Whitehorn
263b790117 Support infrastructure for X11 on PS3.
Submitted by:	geoffrey dot levand at mail dot ru
MFC after:	1 week
2011-12-18 16:53:21 +00:00
Nathan Whitehorn
795c0232aa Add version header to output file. 2011-12-18 16:53:03 +00:00
Sergey Kandaurov
148ddfed15 Use FOREACH_PROC_IN_SYSTEM instead of using its unrolled form.
Reviewed by:	kib
2011-12-18 15:36:21 +00:00
Pawel Jakub Dawidek
bb265163b2 From time to time people report space map corruption resulting in panic
(ss == NULL) on pool import. I had such a panic recently. With current version
of ZFS it is still possible to import the pool in readonly mode and backup
all the data, but in case it is impossible for some reason add tunable
vfs.zfs.space_map_last_hope, which when set to '1' will tell ZFS to remove
colliding range and retry. This seems to have worked for me, but I consider
it highly risky to use.

MFC after:	1 week
2011-12-18 12:27:45 +00:00
Pawel Jakub Dawidek
efe17e5a28 Implement replying of ACLs updates. ACL changes should go to ZIL only
if the 'sync' property is set to 'always', so replying them is not common.

MFC after:	1 month
2011-12-18 12:19:03 +00:00
Mikolaj Golub
547b155eb1 Fix style and white spaces.
MFC after:	1 week
2011-12-17 22:18:26 +00:00
Michael Tuexen
7215cc1b74 Fix unused parameter warnings.
While there, fix some whitespace issues.

MFC after: 3 months.
2011-12-17 19:21:40 +00:00
Mikolaj Golub
fa3935bcea On start most of sysctl_kern_proc functions use the same pattern:
locate a process calling pfind() and do some additional checks like
p_candebug(). To reduce this code duplication a new function pget() is
introduced and used.

As the function may be useful not only in kern_proc.c it is in the
kernel name space.

Suggested by:	kib
Reviewed by:	kib
MFC after:	2 weeks
2011-12-17 16:59:22 +00:00
Andriy Gapon
8f3ae92165 syscons: provide a first iteration of cngrab/cnungrab implementation
- put underlying keyboard(s) into the polling mode for the whole
  duration of the grab, instead of the previous behavior of going into
  and out of the polling mode around each polling attempt
- ditto for setting K_XLATE mode and enabling a disabled keyboard

Inspired by:	bde
MFC after:	2 months
2011-12-17 15:57:39 +00:00
Andriy Gapon
f389bc9585 belatedly transfer copyrights from libkern/gets.c to kern_cons.c
MFC after:	2 months
MFC with:	r228642
2011-12-17 15:50:45 +00:00
Andriy Gapon
6aa40c0146 retire libkern gets
Inspired by:	bde
MFC after:	2 months
X-MFC-Note:	if deemed a part of KPI, just call cngets internally
2011-12-17 15:48:55 +00:00
Bjoern A. Zeeb
3b29d0033d Unbreak the OCTEON1 kernel build after r228483 removing the left over
declaration.

MFC after:	11 days
2011-12-17 15:42:37 +00:00
Andriy Gapon
ac8dee6952 move GETS_*ECHO* defintions from libkern.h to cons.h
MFC after:	2 months
2011-12-17 15:39:14 +00:00
Kevin Lo
0022629fe0 Another axe(4), found in ASUS zenbook. 2011-12-17 15:38:16 +00:00
Andriy Gapon
f6ce353e58 replace uses of libkern gets with cngets
MFC after:	2 months
2011-12-17 15:26:34 +00:00
Andriy Gapon
8e62854265 introduce cngets, a method for kernel to read a string from console
This is intended as a replacement for libkern's gets and mostly borrows
its implementation.  It uses cngrab/cnungrab to delimit kernel's access
to console input.

Note: libkern's gets obviously doesn't share any bits of implementation
iwth libc's gets.  They also have different APIs and the former doesn't
have the overflow problems of the latter.

Inspired by:	bde
MFC after:	2 months
2011-12-17 15:16:54 +00:00
Andriy Gapon
bf8696b408 introduce cngrab/cnungrab stub calls in some places where they make sense
MFC after:	2 months
2011-12-17 15:11:22 +00:00
Andriy Gapon
9976156f12 kern cons: introduce infrastructure for console grabbing by kernel
At the moment grab and ungrab methods of all console drivers are no-ops.

Current intended meaning of the calls is that the kernel takes control of
console input.  In the future the semantics may be extended to mean that
the calling thread takes full ownership of the console (e.g. console
output from other threads could be suspended).

Inspired by:	bde
MFC after:	2 months
2011-12-17 15:08:43 +00:00
Bernhard Schmidt
5a8801b0ea Remove now redundant mac argument.
Discussed with:	adrian@
2011-12-17 10:32:31 +00:00
Bernhard Schmidt
fcd9500f91 Fix some net80211 enum nits:
- ic_vap_create() uses an ieee80211_opmode argument
- ieee80211_rate2media() takes an ieee80211_phymode argument
- ieee80211_plcp2rate() takes an ieee80211_phytype argument
- cast to enum ieee80211_protmode and ieee80211_roamingmode to silence
  compiler warnings

Submitted by:	arundel@
2011-12-17 10:23:17 +00:00
Nathan Whitehorn
e347e23bfe Allow this to work on embedded systems without Open Firmware by making
lack of a /chosen non-fatal, and manually removing memory in use by the
kernel from the physical memory map.

Submitted by:	rpaulo
2011-12-16 23:46:05 +00:00
Nathan Whitehorn
b059c637fb Zero BSS on start, in case the ELF loader that started the kernel did not
do this for us. This can happen on some embedded systems.

Submitted by:	rpaulo
2011-12-16 23:40:56 +00:00
John Baldwin
f427c78b19 Fire a kevent if necessary after seeking on a regular file. This fixes a
case where a kevent would not fire on a regular file if an application read
to EOF and then seeked backwards into the file.

Reviewed by:	kib
MFC after:	2 weeks
2011-12-16 20:10:00 +00:00
Pedro F. Giffuni
5ed5554f0a Style cleanups by jh@.
Fix a comment from the previous commit.
Use M_ZERO instead of bzero() in ext2_vfsops.c
Add include guards from PR.

PR:		162564
Approved by:	jhb (mentor)
MFC after:	2 weeks
2011-12-16 15:47:43 +00:00
Gleb Smirnoff
663222f1d2 - Rename if_carp.ko to carp.ko.
- carp.ko depends on sha1.c
2011-12-16 14:28:34 +00:00
Gleb Smirnoff
92ed4e1a24 Since size of struct in_aliasreq has just been changed in r228571,
and thus ifconfig(8) needs recompile, it is a good chance to make
parameter checks on SIOCAIFADDR arguments more strict.
2011-12-16 13:30:17 +00:00
Stefan Eßer
9ee4b7eb64 Fix format string Z --> z, since the former is a deprecated and (in FreeBSD)
unsupported form of the latter. This change has been reviewed and accepted
in the -hackers list.

Submitted by:	Alexander Best
Reviewed by:	David Schulz
2011-12-16 12:42:02 +00:00
Gleb Smirnoff
08b68b0e4c A major overhaul of the CARP implementation. The ip_carp.c was started
from scratch, copying needed functionality from the old implemenation
on demand, with a thorough review of all code. The main change is that
interface layer has been removed from the CARP. Now redundant addresses
are configured exactly on the interfaces, they run on.

The CARP configuration itself is, as before, configured and read via
SIOCSVH/SIOCGVH ioctls. A new prefix created with SIOCAIFADDR or
SIOCAIFADDR_IN6 may now be configured to a particular virtual host id,
which makes the prefix redundant.

ifconfig(8) semantics has been changed too: now one doesn't need
to clone carpXX interface, he/she should directly configure a vhid
on a Ethernet interface.

To supply vhid data from the kernel to an application the getifaddrs(8)
function had been changed to pass ifam_data with each address. [1]

The new implementation definitely closes all PRs related to carp(4)
being an interface, and may close several others. It also allows
to run a single redundant IP per interface.

Big thanks to Bjoern Zeeb for his help with inet6 part of patch, for
idea on using ifam_data and for several rounds of reviewing!

PR:		kern/117000, kern/126945, kern/126714, kern/120130, kern/117448
Reviewed by:	bz
Submitted by:	bz [1]
2011-12-16 12:16:56 +00:00
Konstantin Belousov
9ab83ecbcb Add 'findstack' ddb command to search either the thread kernel stack
or cached stack containing the specified kernel virtual address.

Discussed with:	pho
MFC after:	1 week
2011-12-16 11:44:20 +00:00
Konstantin Belousov
38474ef299 Show the thread kernel stack base address for 'show threads'.
Discussed with:	pho
MFC after:	1 week
2011-12-16 11:42:50 +00:00
Konstantin Belousov
e878d99718 Move kstack_cache_entry into the private header, and make the
stack cache list header accessible outside vm_glue.c.

MFC after:	1 week
2011-12-16 10:56:16 +00:00
Ed Schouten
c52a37bafb Fix typo in macro.
I copied this macro directly from Bruce's email, as I assumed it was
awesome already.

Reported by:	tijl@
2011-12-16 09:56:22 +00:00
Gleb Smirnoff
65e4e49949 Fix my braino in description of RADIX_MPATH. 2011-12-16 08:27:04 +00:00
Ed Schouten
61c574cb72 Process a lot of feedback from bde@ on <sys/cdefs.h>:
- Add __alignof() for non-GCC and GCC < 2.95.
- Simply implement the C1X keywords on top of the existing __macros.
- Add struct __hack to _Static_assert to require consumers to add a
  semicolon.
- Add an extra underscore to __assert_ to allow it to be combined with
  locally defined versions of CTASSERT in the tree.
- Add proper casts to __offsetof() to make it work for cases where
  sizeof(size_t) != sizeof(uintptr_t).
- Globally replace size_t and uintptr_t by __size_t and __uintptr_t.
  This removes the dependency on <sys/types.h> / <stdint.h>. Practically
  any header file ends up including <machines/_types.h> somehow.
- Change argument names of macros to match with the rest of the file.

MFC after:	3 months
2011-12-16 08:22:23 +00:00
Navdeep Parhar
733b92779e Many updates to cxgbe(4)
- Device configuration via plain text config file.  Also able to operate
  when not attached to the chip as the master driver.

- Generic "work request" queue that serves as the base for both ctrl and
  ofld tx queues.

- Generic interrupt handler routine that can process any event on any
  kind of ingress queue (via a dispatch table).

- A couple of new driver ioctls.  cxgbetool can now install a firmware
  to the card ("loadfw" command) and can read the card's memory
  ("memdump" and "tcb" commands).

- Lots of assorted information within dev.t4nex.X.misc.*  This is
  primarily for debugging and won't show up in sysctl -a.

- Code to manage the L2 tables on the chip.

- Updates to cxgbe(4) man page to go with the tunables that have changed.

- Updates to the shared code in common/

- Updates to the driver-firmware interface (now at fw 1.4.16.0)

MFC after:	1 month
2011-12-16 02:09:51 +00:00
Rick Macklem
22ea9f58f0 Patch the new NFS server in a manner analagous to r228520 for the
old NFS server, so that it correctly handles a count == 0 argument
for Commit.

PR:		kern/118126
MFC after:	2 weeks
2011-12-16 00:58:41 +00:00
Dimitry Andric
487d088e4e Add "%option noinput" to aicasm_scan.l and aicasm_macro_scan.l, so no
unneeded input functions will be emitted.

Spotted by:	arundel
MFC after:	1 week
2011-12-16 00:04:28 +00:00
Dimitry Andric
c5e2b668eb In sys/contrib/ngatm/netnatm/msg/uni_ie.c, use a more appropriate way to
tell the compiler some parameters are purposefully unused.

MFC after:	1 week
2011-12-15 23:47:36 +00:00
Pedro F. Giffuni
5b63c1252b Bring in reallocblk to ext2fs.
The feature has been standard for a while in UFS as a means to reduce
fragmentation, therefore maintaining consistent performance with
filesystem aging. This is also very similar to what ext4 calls
"delayed allocation".

In his 2010 GSoC, Zheng Liu ported and benchmarked the missing
FANCY_REALLOC code to find more consistent performance improvements than
with the preallocation approach.

PR:		159233
Author:		Zheng Liu <gnehzuil AT SPAMFREE gmail DOT com>
Sponsored by:	Google Inc.
Approved by:	jhb (mentor)
MFC after:	2 weeks
2011-12-15 20:31:18 +00:00
Alan Cox
725e839b9f Simplify the implementation of the identity mapping in start_all_aps().
Since mpboot.s enables processor support for PG_PS before enabling
paging, there is no reason that the identity must use 4 KB page mappings.

Discussed with:	jhb
2011-12-15 17:54:23 +00:00
John Baldwin
338e7cf235 Use vm_mmap_to_errno().
Submitted by:	kib
2011-12-15 15:17:19 +00:00
Gleb Smirnoff
f3909e37ff Simplify rtrequest(RTM_ADD): ifa can't be NULL after rt_getifa_fib(). 2011-12-15 12:49:10 +00:00
Rafal Jaworowski
68f8dc2950 ARM pmap fixes:
- Write Buffers have to be drained after write to Page Table even if caches
  are in write-through mode.

- Make sure to sync PTE in pmap_zero_page_generic().

Submitted by:	Michal Mazur
Reviewed by:	cognet
Obtained from:	Semihalf
MFC after:	1 month
2011-12-15 12:14:15 +00:00
David Chisnall
2ff02bff09 Add a pointless and superfluous GNUism that people at a certain large data
aggregation and advertising company seem to believe is standard.

Approved by:	dim (mentor)
2011-12-15 11:21:56 +00:00
Gleb Smirnoff
9731596a5e Add RADIX_MPATH to LINT. 2011-12-15 11:15:23 +00:00
Kevin Lo
1a7e07818d s/timout/timeout 2011-12-15 06:29:13 +00:00
Alan Cox
3b03ca3bbe Eliminate vestiges of page coloring. 2011-12-15 05:07:16 +00:00
Xin LI
f8dee27442 Honor NFSv3 commit call (RFC 1813, Section 3.3.21) where when count is 0,
the full length from offset is being flushed.  Note that for now VOP_FSYNC
does not support offset and length parameters so we still do the same full
VOP_FSYNC.  This issue was reported at FreeNAS support site as FreeNAS
ticket #1096.

Submitted by:	"ceckerle" <ce.freenas eckerle net>
Prodded by:	gcooper
Reviewed by:	rmacklem
MFC after:	2 weeks
2011-12-15 02:26:53 +00:00
Adrian Chadd
3f9bdcef12 * Add in the gpio/gpioled drivers into AR91XX_BASE.
* Add in a default GPIO section for AR91XX_BASE.hints, which doesn't
  define the GPIO function masks or any GPIO pines.
* Add in the GPIO line definitions for LEDs and GPIO pins for the
  TP-WR1043nd.

I've verified the LEDs work fine using gpioset.
2011-12-15 01:05:38 +00:00
Adrian Chadd
19ac3f84d0 Re-jiggle the GPIO code a little to remove the hard-coded AR71xx GPIO
config and function mask setup.

* "gpiomask" now specifies which GPIO pins to enable, for devices to bind to.
* "function_set" allows bits in the function register to be set at GPIO setup.
* "function_clear" allows bits in the function register to be cleared at
  GPIO setup.

The function_set/function_clear bits allow for individual GPIO pins to either
drive a GPIO line or an alternate function - eg USB, JTAG, etc. This allows
for things like CS1/CS2 be enabled for those boards w/ >1 SPI device connected,
or disabling JTAG for the AR7240 (which is apparently needed ..)

I've verified this on the AR71xx.
2011-12-15 01:03:49 +00:00
Adrian Chadd
4473d4da67 Add the 11n chipset RF frontends to the linker set, even though they're not
attached this way.

The AR5212 based NICs have a variety of RF frontends, so there's a linker set
which the AR5212 attach routine calls. The same framework is used for the
AR5416 and later but as there's a fixed RF frontend for each 11n NIC, it
is just directly attached.

However in the case of compiling a cut down HAL (eg _just_ AR9130 WMAC support),
the linker set ends up being empty and this causes the compile to fail.

So this is just a workaround for that - it means those users who wish an 11n
only HAL can compile the 11n chipsets and RF frontend they need, and just
"ath_ar5212" for the AR5212/AR5416 common code, and it'll just work.

Sponsored by:	Hobnob, Inc.
2011-12-15 00:59:11 +00:00
Adrian Chadd
46a924c4c8 Print out the radio RF version at startup, so I can better see which
RF frontend versions people have when they submit problem reports.

Sponsored by:	Hobnob, Inc.
2011-12-15 00:55:27 +00:00
Adrian Chadd
7f4245c1b3 Use the correct RF version probe routine.
Obtained from:	Atheros
Sponsored by:	Hobnob, Inc.
2011-12-15 00:54:11 +00:00
Adrian Chadd
957458a836 Modify the ACL code slightly to support a few nifty things:
* Call it before sending probe responses, so the ACL code has the
  chance to reject sending them.

* Pass the whole frame to the ACL code now, rather than just the
  destination MAC - that way the ACL module can look at the frame
  contents to determine what the response should be.

This is part of some uncommitted work to support band steering.

Sponsored by:	Hobnob, Inc.
2011-12-15 00:52:30 +00:00
Alan Cox
894b2848d3 Create large page mappings in pmap_map().
MFC after:	6 weeks
2011-12-14 23:57:47 +00:00
Jilles Tjoelker
6d1c58f8a2 Fix select/poll/kqueue for write on reverse direction before first write.
The reverse direction of a pipe is lazily allocated on the first write in
that direction (because pipes are usually used in one direction only).  A
special case is needed to ensure the pipe appears writable before the first
write because there are 0 bytes of pending data in 0 bytes of buffer space
at that point, leaving 0 bytes of data that can be written with the normal
code.

Note that the first write returns [ENOMEM] if kern.ipc.maxpipekva is
exceeded and does not block or return [EAGAIN], so selecting true for write
is correct even in that case.

PR:		kern/93685
Submitted by:	gianni
MFC after:	2 weeks
2011-12-14 22:26:39 +00:00
John Baldwin
fb680e16f4 Add a helper API to allow in-kernel code to map portions of shared memory
objects created by shm_open(2) into the kernel's address space.  This
provides a convenient way for creating shared memory buffers between
userland and the kernel without requiring custom character devices.
2011-12-14 22:22:19 +00:00
Hans Petter Selasky
58a1ff3bf4 Improve fix for random USB transfer time out.
Suggested by:	YougHyeon
MFC after:	3 days
2011-12-14 22:14:05 +00:00
Pedro F. Giffuni
c14d4ad1c6 Merge ext2_readwrite.c into ext2_vnops.c as done in UFS in r101729.
This removes the obfuscations mentioned in ext2_readwrite and
places the clustering funtion in a location similar to other
UFS-based implementations.

No performance or functional changeses are expected from
this move.

PR:		kern/159232
Suggested by:	bde
Approved by:	jhb (mentor)
MFC after:	2 weeks
2011-12-14 22:04:14 +00:00
Rafal Jaworowski
dd63f0ab98 Make *intr{cnt,names} on ARM reside in data section, similar to other arches.
sintrnames and sintrcnt are initialized with non-zero values, which were
discarded by the .bss directive, so consumers like "vmstat -i" were not
getting correct data.

Submitted by:	Lukasz Plachno
Obtained from:	Semihalf
MFC after:	1 month
2011-12-14 17:12:59 +00:00
Fabien Thomas
7e1f37e14e Rework the attachement to probe directly on isab(4).
Depend on r228496.

Requested by:	jhb
MFC after:	1 month
2011-12-14 15:39:51 +00:00
Eitan Adler
33fd7c5628 - The previous commit (r228449) accidentally moved the vm.stats.vm.* sysctls
to vm.stats.sys.  Move them back.

Noticed by:		pho
Reviewed by:	bde (earlier version)
Approved by:	bz
MFC after:		1 week
Pointy hat to:	me
2011-12-14 13:25:00 +00:00