Commit Graph

72261 Commits

Author SHA1 Message Date
Rick Macklem
9ec7b004d0 Add the experimental nfs subtree to the kernel, that includes
support for NFSv4 as well as NFSv2 and 3.
	It lives in 3 subdirs under sys/fs:
	nfs - functions that are common to the client and server
	nfsclient - a mutation of sys/nfsclient that call generic functions
	to do RPCs and handle state. As such, it retains the
	buffer cache handling characteristics and vnode semantics that
	are found in sys/nfsclient, for the most part.
	nfsserver - the server. It includes a DRC designed specifically for
	NFSv4, that is used instead of the generic DRC in sys/rpc.
	The build glue will be checked in later, so at this point, it
	consists of 3 new subdirs that should not affect kernel building.

Approved by:	kib (mentor)
2009-05-04 15:23:58 +00:00
Ed Schouten
3382ac3233 Remove unneeded check for SESS_LEADER().
We perform the same check ~10 lines above.
2009-05-04 11:11:10 +00:00
Alexander Motin
64886da216 Oops, sorry. Fix for fix. 2009-05-04 08:41:54 +00:00
Alexander Motin
b5f9da0f8d There is no atrtc driver in pc98, so hide atrtcclock_disable variable usage
in APM driver for this platform. This should fix pc98 build.
2009-05-04 08:36:47 +00:00
Alan Cox
3a2cdcb0e3 Eliminate vnode_pager_input_smlfs()'s pointless call to pmap_clear_modify().
The page can't possibly have any modified page table entries because it
isn't even mapped.
2009-05-04 06:30:00 +00:00
Robert Watson
6fb82ecbde Remove redundant NFSMNT_NFSV3 check in DTrace hooks for NFS RPC.
MFC after:	1 month
2009-05-04 02:19:52 +00:00
Robert Watson
9e4fda10a0 Fix typo in comment.
MFC after:	1 month
2009-05-04 02:06:39 +00:00
Andrew Thompson
8ee6f90a0c Relax the condition for printing the lost state transition message. The new
state will be set before the EXT_STATEWAIT flag is cleared and its ok to
transition again at that point.
2009-05-03 18:29:04 +00:00
Alexander Motin
1703f2b424 Rename statclock_disable variable to atrtcclock_disable that it actually is,
and hide it inside of atrtc driver. Add new tunable hint.atrtc.0.clock
controlling it. Setting it to 0 disables using RTC clock as stat-/
profclock sources.

Teach i386 and amd64 SMP platforms to emulate stat-/profclocks using i8254
hardclock, when LAPIC and RTC clocks are disabled.

This allows to reduce global interrupt rate of idle system down to about
100 interrupts per core, permitting C3 and deeper C-states provide maximum
CPU power efficiency.
2009-05-03 17:47:21 +00:00
Alexander Motin
2500b6d96d Make dev.cpu.X.cx_usage sysctl also report current average of sleep time. 2009-05-03 06:25:37 +00:00
Alexander Motin
bb1d6ad5b3 Remove unused variable and fix spelling in comment. 2009-05-03 04:58:44 +00:00
Warner Losh
12e36acb09 Bring in Andrew Thompson's port of Sepherosa Ziehau's bwi driver for
Broadcom BCM43xx chipsets.  This driver uses the v3 firmware that
needs to be fetched separately.  A port will be committed to create
the bwi firmware module.

The driver matches the following chips: Broadcom BCM4301, BCM4307,
BCM4306, BCM4309, BCM4311, BCM4312, BCM4318, BCM4319

The driver works for 802.11b and 802.11g.

Limitations:
	This doesn't support the 802.11a or 802.11n portion of radios.
	Some BCM4306 and BCM4309 cards don't work with Channel 1, 2 or 3.
	Documenation for this firmware is reverse engineered from
		 http://bcm.sipsolutions.net/
	V4 of the firmware is needed for 11a or 11n support
		 http://bcm-v4.sipsolutions.net/
	Firmware needs to be fetched from a third party, port to be committed

# I've tested this with a BCM4319 mini-pci and a BCM4318 CardBus card, and
# not connected it to the build until the firmware port is committed.

Obtained from:	DragonFlyBSD, //depot/projects/vap
Reviewed by:	sam@, thompsa@
2009-05-03 04:01:43 +00:00
Yoshihiro Takahashi
80c516a808 MFi386: revision 191745
Add support for using i8254 and rtc timers as event sources for i386 SMP
  system. Redistribute hard-/stat-/profclock events to other CPUs using IPI.
2009-05-03 02:37:13 +00:00
Alexander Motin
b0baaaaecf Avoid comparing negative signed to positive unsignad values. It was
leading to a bug, when C-state does not decrease on sleep shorter then
declared transition latency. Fixing this deprecates workaround for broken
C-states on some hardware.

By the way, change state selecting logic a bit. Instead of last sleep
time use short-time average of it. Global interrupts rate in system is a
quite random value, to corellate subsequent sleeps so directly.
2009-05-02 22:30:33 +00:00
Kip Macy
51a70df2db fix XEN compilation 2009-05-02 22:22:00 +00:00
Sam Leffler
86629111ea don't say "ac WME_AC_BE"; remove "ac" 2009-05-02 20:28:55 +00:00
Sam Leffler
dca68715ab promote ieee80211_seq typedef 2009-05-02 20:25:22 +00:00
Sam Leffler
43049c4828 o dump tx/rx seq#'s for qos tid's
o improve check for when to dump rx ampdu state
2009-05-02 20:21:21 +00:00
Sam Leffler
24a599dd50 whitespace 2009-05-02 20:18:18 +00:00
Sam Leffler
04f19fd699 make superg/fast-frames state dynamically-allocated (and indirect off
the com structure instead of embedded); this reduces the overhead when
not configured and reduces visibility of the contents
2009-05-02 20:16:55 +00:00
Andrew Thompson
5efea30f03 Create a taskqueue for each wireless interface which provides a serialised
sleepable context for net80211 driver callbacks. This removes the need for USB
and firmware based drivers to roll their own code to defer the chip programming
for state changes, scan requests, channel changes and mcast/promisc updates.
When a driver callback completes the hardware state is now guaranteed to have
been updated and is in sync with net80211 layer.

This nukes around 1300 lines of code from the wireless device drivers making
them more readable and less race prone.

The net80211 layer has been updated as follows
 - all state/channel changes are serialised on the taskqueue.
 - ieee80211_new_state() always queues and can now be called from any context
 - scanning runs from a single taskq function and executes to completion. driver
   callbacks are synchronous so the channel, phy mode and rx filters are
   guaranteed to be set in hardware before probe request frames are
   transmitted.

Help and contributions from Sam Leffler.

Reviewed by:	sam
2009-05-02 15:14:18 +00:00
Alexander Motin
a40d9024df Add support for using i8254 and rtc timers as event sources for i386 SMP
system. Redistribute hard-/stat-/profclock events to other CPUs using IPI.
2009-05-02 12:59:47 +00:00
Alexander Motin
6a3a164d6e Add support for using i8254 and rtc timers as event sources for amd64 SMP
system. Redistribute hard-/stat-/profclock events to other CPUs using IPIs.
2009-05-02 12:20:43 +00:00
Dmitry Chagin
40092d93b4 Linux socketpair() call expects explicit specified protocol for
AF_LOCAL domain unlike FreeBSD which expects 0 in this case.

Approved by:	kib (mentor)
MFC after:	1 month
2009-05-02 10:51:40 +00:00
Dmitry Chagin
d789bfd562 Move extern variable definitions to the header file.
Approved by:	kib (mentor)
MFC after:	1 month
2009-05-02 10:06:49 +00:00
Marko Zec
5f416f8e84 Make indentation more uniform accross vnet container structs.
This is a purely cosmetic / NOP change.

Reviewed by:	bz
Approved by:	julian (mentor)
Verified by:	svn diff -x -w producing no output
2009-05-02 08:16:26 +00:00
Alan Cox
7b89d46e0f A variety of changes:
Reimplement "kernel_pmap" in the standard way.

Eliminate unused variables.  (These are mostly variables that were
discarded by the machine-independent layer after FreeBSD 4.x.)

Properly handle a vm_page_alloc() failure in pmap_init().

Eliminate dead or legacy (FreeBSD 4.x) code.

Eliminate unnecessary page queues locking.

Eliminate some excess white space.

Correct the synchronization of pmap_page_exists_quick().

Tested by: gonzo
2009-05-02 06:12:38 +00:00
Marko Zec
d7fcc52895 Unbreak options VIMAGE + nooptions INVARIANTS kernel builds.
Submitted by:	julian
Approved by:	julian (mentor)
2009-05-02 05:02:28 +00:00
Alexander Motin
58a2bb4996 Add resume methods to i8254 and atrtc devices. 2009-05-01 21:43:04 +00:00
Sam Leffler
ce7fa847ac revert wip 2009-05-01 21:31:39 +00:00
Robert Watson
fa76567150 Rename MAC Framework-internal macros used to invoke policy entry points:
MAC_BOOLEAN           -> MAC_POLICY_BOOLEAN
  MAC_BOOLEAN_NOSLEEP   -> MAC_POLICY_BOOLEANN_NOSLEEP
  MAC_CHECK             -> MAC_POLICY_CHECK
  MAC_CHECK_NOSLEEP     -> MAC_POLICY_CHECK_NOSLEEP
  MAC_EXTERNALIZE       -> MAC_POLICY_EXTERNALIZE
  MAC_GRANT             -> MAC_POLICY_GRANT
  MAC_GRANT_NOSLEEP     -> MAC_POLICY_GRANT_NOSLEEP
  MAC_INTERNALIZE       -> MAC_POLICY_INTERNALIZE
  MAC_PERFORM           -> MAC_POLICY_PERFORM_CHECK
  MAC_PERFORM_NOSLEEP   -> MAC_POLICY_PERFORM_NOSLEEP

This frees up those macro names for use in wrapping calls into the MAC
Framework from the remainder of the kernel.

Obtained from:	TrustedBSD Project
2009-05-01 21:05:40 +00:00
Alexander Motin
2f369c9496 Small addition to r191720.
Restore previous behaviour for the case of unknown interrupt. Invocation
of IRQ -1 crashes my system on resume. Returning 0, as it was, is not
perfect also, but at least not so dangerous.
2009-05-01 20:53:37 +00:00
Andrew Thompson
3f11aba75f Reorder the bridge add and delete routines to avoid calling ifpromisc() with
the bridge lock held.
2009-05-01 19:46:42 +00:00
Sam Leffler
dcad868984 o add uath
o sort usb wireless drivers
2009-05-01 17:20:16 +00:00
Sam Leffler
9e0ebab5d4 add more tdma fixed rate defaults 2009-05-01 17:18:45 +00:00
Sam Leffler
71aa1d3234 add uath; sort usb wireless drivers 2009-05-01 17:17:06 +00:00
Sam Leffler
cebc52549c add uath 2009-05-01 17:16:33 +00:00
Sam Leffler
cae597f39f add ralfw 2009-05-01 17:15:29 +00:00
Alexander Motin
1ecff35a6b Use value -1 instead of 0 for marking unused APIC vectors. This fixes
IRQ0 routing on LAPIC-enabled systems.

Add hint.apic.0.clock tunable. Setting it 0 disables using LAPIC timers
as hard-/stat-/profclock sources falling back to using i8254 and rtc timers.

On modern CPUs LAPIC is a part of CPU core which is shutting down when CPU
enters C3 or deeper power state. It makes no problems for interrupt
processing, as chipset wakes up CPU on interrupt triggering. But entering
C3 state kills LAPIC timer and freezes system time, making C3 and deeper
states practically unusable. Using i8254 timer allows to avoid this
problem.

By using i8254 timer my T7700 C2D CPU with UP kernel successfully enters
C3 state, saving more then a Watt of total idle power (>10%) in addition to
all other power-saving techniques.

This technique is not working for SMP yet, as only one CPU receives
timer interrupts. But I think that problem could be fixed by forwarding
interrupts to other CPUs with IPI.
2009-05-01 17:05:49 +00:00
Dmitry Chagin
79262bf1f0 Reimplement futexes.
Old implemention used Giant to protect the kernel data structures,
but at the same time called malloc(M_WAITOK), that could cause the
calling thread to sleep and lost Giant protection. User-visible
result was the missed wakeup.

New implementation uses one sx lock per futex. The sx protects
the futex structures and allows to sleep while copyin or copyout
are performed.

Unlike linux, we return EINVAL when FUTEX_CMP_REQUEUE operation
is requested and either caller specified futexes are equial or
second futex already exists. This is acceptable since the situation
can only occur from the application error, and glibc falls back to
old FUTEX_WAKE operation when FUTEX_CMP_REQUEUE returns an error.

Approved by:	kib (mentor)
MFC after:	1 month
2009-05-01 15:36:02 +00:00
Bruce M Simpson
a3d3b633a9 Limit scope of acquisition of INP_RLOCK for multicast input filter
to the scope of its use, even though this may thrash the lock if
the INP is referenced for other purposes.

Tested by:	David Wolfskill
2009-05-01 11:05:24 +00:00
Alexander Motin
b1d1fff76c Improve kernel dumping reliability for busy ATA channels:
- Generate fake channel interrupts even if channel busy with previous
request to let it finish. Without this, dumping requests were just queued
and never processed.
 - Drop pre-dump requests queue on dumping. ATA code, working in dumping
(interruptless) mode, unable to handle long request queue. Actually, to get
coherent dump we anyway should do as few unrelated actions as possible.
2009-05-01 08:03:46 +00:00
Pyun YongHyeon
59dffaa088 Separate multicast filtering of SysKonnect GENESIS and Marvell
Yukon from common multicast handling code. Yukon uses hash-based
multicast filtering(big endian form) but GENESIS uses perfect
multicast filtering as well as hash-based one(little endian form).
Due to the differences of multicast filtering there is no much
sense to have a common code.
 o Remove sk_setmulti() and introduce sk_rxfilter_yukon(),
   sk_rxfilter_yukon() that handles multicast filtering setup.
 o Have sk_rxfilter_{yukon, genesis} handle promiscuous mode and
   nuke sk_setpromisc(). This simplifies ioctl handler as well as
   giving a chance to check validity of Rx control register of
   Yukon.
 o Don't reinitialize controller when IFF_ALLMULTI flags is changed.
 o Nuke sk_gmchash(), it's not needed anymore.
 o Always reconfigure Rx control register whenever a new multicast
   filtering condition is changed. This fixes multicast filtering
   setup on Yukon.

PR:	kern/134051
2009-05-01 03:24:03 +00:00
Jamie Gritton
3dd4fac97c Don't call the OSD destructor if the data slot is NULL
(since it's already not done on unused slots, which are indistinguishable
to the caller).

Approved by:	bz (mentor)
2009-04-30 22:43:21 +00:00
Andrew Thompson
6fca021096 We need to ref the bss node when sending the beacon since it goes through the
normal tx path and will be decremented on the mbuf free.
2009-04-30 22:30:01 +00:00
Jung-uk Kim
788399cbd9 - Fix divide-by-zero panic when SMP kernel is used on UP system[1].
- Avoid possible divide-by-zero panic on SMP system when the CPUID is
disabled, unsupported, or buggy.

Submitted by:	pluknet (pluknet at gmail dot com)[1]
2009-04-30 22:10:04 +00:00
Jung-uk Kim
54b43614e7 Fix off-by-one bug. S5 state must be checked as well. 2009-04-30 18:00:53 +00:00
Jung-uk Kim
19682c4826 Fix style(9). 2009-04-30 17:45:43 +00:00
Jung-uk Kim
2d0c82e8cf Prefer device_printf() over printf() where ever possible. 2009-04-30 17:42:11 +00:00
Jung-uk Kim
a0e73a122d General sleep state change clean up.
- Probe supported sleep states from acpi_attach() just once and do not
call AcpiGetSleepTypeData() again.  It is redundant because
AcpiEnterSleepStatePrep() does it any way.
- Treat UNKNOWN sleep state as NONE, i.e., "do nothing", and remove obscure
NONE state (ACPI_S_STATES_MAX + 1) to avoid confusions.
- Do not set unsupported sleep states as default button/switch events.
If the default sleep state is not supported, just set it as UNKNOWN/NONE.
- Do not allow sleep state change if the system is not fully up and running.
This should prevent entering S5 state multiple times, which causes strange
behaviours later.
- Make sleep states case-insensitive when they are used with sysctl(8).
For example,

	sysctl hw.acpi.lid_switch_state=s1
	sysctl hw.acpi.sleep_button_state=none

are now legal and equivalent to the uppercase ones.
2009-04-30 17:35:44 +00:00