Commit Graph

85349 Commits

Author SHA1 Message Date
Martin Matuska
34b95dbb6a Bump __FreeBSD_version due to libarchive update. 2012-02-25 11:03:13 +00:00
Mikolaj Golub
662c901c54 When detaching an unix domain socket, uipc_detach() checks
unp->unp_vnode pointer to detect if there is a vnode associated with
(binded to) this socket and does necessary cleanup if there is.

The issue is that after forced unmount this check may be too late as
the unp_vnode is reclaimed and the reference is stale.

To fix this provide a helper function that is called on a socket vnode
reclamation to do necessary cleanup.

Pointed by:	kib
Reviewed by:	kib
MFC after:	2 weeks
2012-02-25 10:15:41 +00:00
Adrian Chadd
0caafbf948 If an interrupt is received with no vap attached, just fail LINK events.
This fixes a NULL pointer dereference which occurs if the vap list is
empty but someone brings up the wi0 interface.
2012-02-25 08:01:29 +00:00
Pyun YongHyeon
e7e7593cd8 Use correct Config registers for RTL8139 family. Unlike RTL8168 and
RTL810x family , RTL8139 has different register map for Config
registers.

While here, follow the lead of re(4) in WOL configuration.
 - Disable WOL_UCAST and WOL_MCAST capabilities by default.
 - Config5 register write does not need to unlock EEPROM access
   on RTL8139 family but unlocking EEPROM access does not affect
   its operation and make it consistent with re(4).

Reported by:	Matt Renzelmann  mjr <> cs dot wisc dot edu
2012-02-25 04:54:51 +00:00
David Xu
df1f1bae9e In revision 231989, we pass a 16-bit clock ID into kernel, however
according to POSIX document, the clock ID may be dynamically allocated,
it unlikely will be in 64K forever. To make it future compatible, we
pack all timeout information into a new structure called _umtx_time, and
use fourth argument as a size indication, a zero means it is old code
using timespec as timeout value, but the new structure also includes flags
and a clock ID, so the size argument is different than before, and it is
non-zero. With this change, it is possible that a thread can sleep
on any supported clock, though current kernel code does not have such a
POSIX clock driver system.
2012-02-25 02:12:17 +00:00
Konstantin Belousov
aa10345311 Do not write to the user address directly, use suword().
Reported by:	Bengt Ahlgren <bengta sics se>
MFC after:	1 week
2012-02-25 01:33:39 +00:00
Jung-uk Kim
4fd3565a35 Fix a long-standing bug for AcpiOsGetTimer(). time_t is 32-bit on i386 and
it needs proper casting before multiplication.

MFC after:	3 days
2012-02-24 23:15:21 +00:00
Bjoern A. Zeeb
5aa7e8edc5 In selectroute() add a missing fibnum argument to an in6_rtalloc()
call in an #if 0 section.

In in6_selecthlim() optimize a case where in6p cannot be NULL due to an
earlier check.

More consistently use u_int instead of int for fibnum function arguments.

Sponsored by:	Cisco Systems, Inc.
MFC after:	3 days
2012-02-24 20:06:04 +00:00
Andrew Thompson
8d45bd6e80 Only look for a usable MAC address for the bridge ID from ports within our
bridge, this allows us to have more than one independent bridge in the same
STP domain.

PR:		kern/164369
Submitted by:	Nikos Vassiliadis (earlier version)
MFC after:	2 weeks
2012-02-24 17:50:36 +00:00
John Baldwin
52c746eacc Adjust the nfs_skip_wcc_data_onerr setting so that it does not block
post-op attributes for ENOENT errors now that the name caching logic
depends on working post-op attributes.

MFC after:	2 weeks
2012-02-24 17:26:06 +00:00
Konstantin Belousov
dcdc6c361b Restore the return statement erronously removed in the r232048.
Submitted by:	cognet
Pointy hat to:	kib (reuse the one I already got today)
MFC after:	13 days
2012-02-24 11:02:35 +00:00
Konstantin Belousov
9d22083da8 Place the if() at the right location, to activate the v_writecount
accounting for shared writeable mappings for all filesystems, not only
for the bypass layers.

Submitted by:	alc
Pointy hat to:	kib
MFC after:	20 days
2012-02-24 10:41:58 +00:00
Kevin Lo
19b029a487 Remove an unused structure and unnecessary cast 2012-02-24 07:30:44 +00:00
Kevin Lo
a61d3d5a99 Check if the user has necessary permissions on the device 2012-02-24 07:29:06 +00:00
Adrian Chadd
70e0b5ac20 Hold IF_LOCK when manipulating the interface flags.
It doesn't _really_ help all that much, I'll commit something to
sys/net/if.c at some point explaining why, but the lock should be held
when checking/manipulating/branching because of said lock.
2012-02-24 05:40:36 +00:00
Adrian Chadd
dcc56af073 Although it's documented that the vap newstate call can drop the
comlock, I'd like to find and analyse these cases to see if they
really are valid.

So, throw in a lock here and wait for the (hopefully!) inevitable
complaints.
2012-02-24 05:39:00 +00:00
Adrian Chadd
3ec1a8c90c Add a radiotap vendor header definition. 2012-02-24 05:33:11 +00:00
Jung-uk Kim
074d80ac13 - Add support for Family 12h, 14h and 15h processors.
- Remove all attempts to guess physical temperature using DiodeOffset.
There are too many reports that it varies wildly depending on motherboard.
Instead, if it is known to scale well and its offset is known from other
temperature sensors on board, the user may set "dev.amdtemp.0.sensor_offset"
tunable to compensate the difference.  Document the caveats in amdtemp(4).
- Add a quirk for Socket AM2 Revision G processors.  These processors are
known to have a different offset according to Linux k8temp driver.
- Warn about Family 10h Erratum 319.  These processors have broken sensors.
- Report temperature in more logical orders under dev.amdtemp node.  For
example, "dev.amdtemp.0.sensor0.core0" is now "dev.amdtemp.0.core0.sensor0".
- Replace K8, K10 and K11 with official processor names in amdtemp(4).
2012-02-24 00:02:46 +00:00
Andrew Thompson
3122b9120c Add a sysctl/tunable default value for the use_flowid sysctl in r232008. 2012-02-23 21:56:53 +00:00
Dimitry Andric
c995195062 Use a better way to silence unneeded internal declaration warnings in
several sys/cam/ctl files.

Suggested by:	ed
Reviewed by:	ken
MFC after:	1 week
2012-02-23 21:34:14 +00:00
Dimitry Andric
102a319895 Revert r231978, so I can apply a more proper fix to silence unneeded
internal declaration warnings in several sys/cam/ctl files.

MFC after:	1 week
2012-02-23 21:32:32 +00:00
Konstantin Belousov
84110e7e0b Account the writeable shared mappings backed by file in the vnode
v_writecount.  Keep the amount of the virtual address space used by
the mappings in the new vm_object un_pager.vnp.writemappings
counter. The vnode v_writecount is incremented when writemappings gets
non-zero value, and decremented when writemappings is returned to
zero.

Writeable shared vnode-backed mappings are accounted for in vm_mmap(),
and vm_map_insert() is instructed to set MAP_ENTRY_VN_WRITECNT flag on
the created map entry.  During deferred map entry deallocation,
vm_map_process_deferred() checks for MAP_ENTRY_VN_WRITECOUNT and
decrements writemappings for the vm object.

Now, the writeable mount cannot be demoted to read-only while
writeable shared mappings of the vnodes from the mount point
exist. Also, execve(2) fails for such files with ETXTBUSY, as it
should be.

Noted by:	tegge
Reviewed by:	tegge (long time ago, early version), alc
Tested by:	pho
MFC after:	3 weeks
2012-02-23 21:07:16 +00:00
Andrew Thompson
47190ea664 Indicate this function decrements the timer as well as testing for expiry. 2012-02-23 20:58:52 +00:00
Jung-uk Kim
7e330e8220 If the VBE implementation does not support save/restore function, defer to
VGA methods.  Unconditionally reset the VESA adapter before restoring state.
2012-02-23 20:54:22 +00:00
Jung-uk Kim
e7d5cd47c5 Update my copyright date. 2012-02-23 19:16:05 +00:00
Jung-uk Kim
257e5645da Probe supported states for save/restore function. Some VBE implementation
refuses to save/restore states if an unsupported bit is set.
2012-02-23 19:05:57 +00:00
Jung-uk Kim
3dd6e888c0 Fix a typo introduced in r231843. 2012-02-23 18:59:32 +00:00
Martin Matuska
bf3db8aa65 To improve control over the use of mount(8) inside a jail(8), introduce
a new jail parameter node with the following parameters:

allow.mount.devfs:
	allow mounting the devfs filesystem inside a jail

allow.mount.nullfs:
	allow mounting the nullfs filesystem inside a jail

Both parameters are disabled by default (equals the behavior before
devfs and nullfs in jails). Administrators have to explicitly allow
mounting devfs and nullfs for each jail. The value "-1" of the
devfs_ruleset parameter is removed in favor of the new allow setting.

Reviewed by:	jamie
Suggested by:	pjd
MFC after:	2 weeks
2012-02-23 18:51:24 +00:00
Kip Macy
11ac7ec076 merge pipe and fifo implementations
Also reviewed by: jhb, jilles (initial revision)
Tested by: pho, jilles

Submitted by:	gianni
Reviewed by:	bde
2012-02-23 18:37:30 +00:00
Kip Macy
a93cda789a When using flowtable llentrys can outlive the interface with which they're associated
at which the lle_tbl pointer points to freed memory and the llt_free pointer is no longer
valid.

Move the free pointer in to the llentry itself and update the initalization sites.

MFC after:	2 weeks
2012-02-23 18:21:37 +00:00
Christian Brueffer
6bdc1841a9 Catch up with r195837 (2.5 years ago) which renamed net_add_domain() to domain_add().
PR:		165424
Submitted by:	Lachlan Kang
MFC after:	1 week
2012-02-23 17:47:19 +00:00
Rick Macklem
7cfce7cec7 hrs@ reported a panic to freebsd-stable@ under the subject line
"panic in 8.3-PRERELEASE" on Feb. 22, 2012. This panic was caused
by use of a mix of tsleep() and msleep() calls on the same event
in the new NFS server DRC code. It did "mtx_unlock(); tsleep();"
in two places, which kib@ noted introduced a slight risk that the
wakeup() would occur before the tsleep(), resulting in a 10sec
delay before waking up. This patch fixes the problem by replacing
"mtx_unlock(); tsleep();" with mtx_sleep(..PDROP..). It also
changes a nfsmsleep() call to mtx_sleep() so that the code uses
mtx_sleep() consistently within the file.

Tested by:	hrs (in progress)
Reviewed by:	jhb
MFC after:	5 days
2012-02-23 16:47:05 +00:00
Konstantin Belousov
dcd432817e Allow the parent to gather the exit status of the children reparented
to the debugger.  When reparenting for debugging, keep the child in
the new orphan list of old parent.  When looping over the children in
kern_wait(), iterate over both children list and orphan list to search
for the process by pid.

Submitted by:	Dmitry Mikulin <dmitrym juniper.net>
MFC after:	2 weeks
2012-02-23 11:50:23 +00:00
Adrian Chadd
398bca2e5e Use the passed-in channel rather than ic->ic_curchan.
I'm not sure _why_ the ic is NULL here, but I've seen it occasionally do
this after I've been tinkering with things for a while.  It ends up
crashing in a call to ath_chan_set() via the net80211 scan code and scan
task.
2012-02-23 08:32:54 +00:00
Pyun YongHyeon
8e10fb3d0b Add check for IFF_DRV_RUNNING flag after serving an interrupt and
don't give RX path more priority than TX path.
Also remove infinite loop in interrupt handler and limit number of
iteration to 32. This change addresses system load fluctuations
under high network load.
2012-02-23 08:22:44 +00:00
Hans Petter Selasky
9b5da8166e Avoid creating PCM devices for MIDI adapters.
MFC after:	3 days
2012-02-23 07:56:19 +00:00
Pyun YongHyeon
1db603d59d With r232015, sf(4) gets correct speed/duplex of established link.
Add more strict speed check in sf_miibus_statchg() and do not touch
MAC config registers when driver lost a link.
2012-02-23 06:35:18 +00:00
Andrew Thompson
2ad65e315d Now that network interfaces advertise if they support linkstate notifications
we do not need to perform a media ioctl every 15 seconds.
2012-02-23 06:26:16 +00:00
Pyun YongHyeon
bc6a83448b Remove taskqueue based MII stat change handler.
Driver does not need deferred link state change processing.
While I'm here, do not report current link status if interface is
not UP.
2012-02-23 06:13:12 +00:00
Pyun YongHyeon
1f8b1fbd02 No need to reprogram hardware RX filter when driver is not running. 2012-02-23 05:25:14 +00:00
Pyun YongHyeon
7ae32f8a3c Introduce sf_ifmedia_upd_locked() and have driver reset PHY before
switching to selected media.  While here, set if_drv_flags before
switching to selected media.
2012-02-23 05:23:21 +00:00
Pyun YongHyeon
0f881e21e5 If there are not enough RX buffers, release partially allocated RX
buffers.
2012-02-23 05:14:11 +00:00
Pyun YongHyeon
911dd7324d Give hardware chance to drain active DMA cycles. 2012-02-23 05:10:00 +00:00
Pyun YongHyeon
41e556b9d1 Connect smcphy(4) to mii module build. 2012-02-23 01:22:40 +00:00
Pyun YongHyeon
34fe3828ba Add Seeq Technology 80220 PHY support to smcphy(4). This PHY is
found on Adaptec AIC-6915 Starfire ethernet controller.
While here, use status register to know resolved speed/duplex.
With this change, sf(4) correctly reports speed/duplex of
established link.

Reviewed by:	marius
2012-02-23 01:20:21 +00:00
Andrew Thompson
4661f8627c bstp_input() always consumes the packet so remove the mbuf handling dance
around it.

Obtained from:	OpenBSD (r1.37)
2012-02-23 00:59:21 +00:00
Andrew Thompson
0bf97ae271 Using the flowid in the mbuf assumes the network card is giving a good hash for
the traffic flow, this may not be the case giving poor traffic distribution.
Add a sysctl which allows us to fall back to our own flow hash code.

PR:		kern/164901
Submitted by:	Eugene Grosbein
MFC after:	1 week
2012-02-22 22:01:30 +00:00
Konstantin Belousov
2b19466836 Properly lock DQREF() with dqhlock. Missed locking caused counter
corruption.

Assert that the dq reference value is sane before decrementing it.

Reported and tested by:	pho
MFC after:	1 week
2012-02-22 20:03:51 +00:00
Konstantin Belousov
501f538675 Remove wrong comment.
Discussed with:	alc
MFC after:	3 days
2012-02-22 20:01:38 +00:00
Josh Paetzel
d51e8487a7 Fix various typos and normalize spelling.
Approved by:	kib (mentor)
2012-02-22 15:05:19 +00:00