Commit graph

68765 commits

Author SHA1 Message Date
Warner Losh 33b4ae7d79 Minor cleanup of this config file:
o It has been tested only on KB9202, KB9202A and KB9202B boards
o Better comments about hints
o option<space><tab>
o Add newer SX_NOINLINE option.
o Fix a few comments
2008-09-07 18:55:55 +00:00
Bjoern A. Zeeb 3cee92e074 Split tcp_mss() in tcp_mss() and tcp_mss_update() where the former
calls the latter.

Merge tcp_mss_update() with code from tcp_mtudisc() basically
doing the same thing.

This gives us one central place where we calcuate and check mss values
to update t_maxopd (maximum mss + options length) instead of two slightly
different but almost equal implementations to maintain.

PR:		kern/118455
Reviewed by:	silby (back in March)
MFC after:	2 months
2008-09-07 18:50:25 +00:00
Rui Paulo 941f9f10b2 Add support for MacBook Air. (not tested)
Obtained from:	mactel-linux
2008-09-07 18:15:34 +00:00
Konstantin Belousov 9dee707cf0 Segment registers are stored in the uc_mcontext member of the struct
l_ucontext. To restore the registers content, trampoline needs to
dereference uc_mcontext instead of taking some undefined values from
l_ucontext.

Submitted by:	Dmitry Chagin <dchagin@>
MFC after:	1 week
2008-09-07 16:39:21 +00:00
Bjoern A. Zeeb ebe5426934 V_irtualize SVN r182846 tcp_mssdflt/tcp_v6mssdflt procedure based
sysctl implementations for VIMAGE the same way we did elsewhere:
update the implementation but leave the globals and the SYSCTL
statement untouched.
2008-09-07 15:20:21 +00:00
Bjoern A. Zeeb 4cdf3bedf3 Convert SYSCTL_INTs for tcp_mssdflt and tcp_v6mssdflt to
SYSCTL_PROCs and check that the default mss for neither v4 nor
v6 goes below the minimum MSS constant (216).

This prevents people from shooting themselves in the foot.

PR:		kern/118455 (remotely related)
Reviewed by:	silby (as part of a larger patch in March)
MFC after:	2 months
2008-09-07 14:44:55 +00:00
Ulf Lilleengen f805f204b6 - Add a new ioctl for getting the provider name of a geom provider.
- Add a routine for looking up a device and checking if it is a valid geom
  provider given a partial or full path to its device node.

Reviewed by:	phk
Approved by:	pjd (mentor)
2008-09-07 13:54:57 +00:00
Bjoern A. Zeeb 6f4745d575 Catch a possible NULL pointer deref in case the offsets got mangled
somehow.
As a consequence we may now get an unexpected result(*).
Catch that error cases with a well defined panic giving appropriate
pointers to ease debugging.

(*) While the concensus was that the case should never happen unless
    there was a bug, noone was definitively sure.

Discussed with:		kmacy (about 8 months back)
Reviewed by:		silby (as part of a larger patch in March)
MFC after:		2 months
2008-09-07 13:09:04 +00:00
Bjoern A. Zeeb c4982fae59 Add a second KASSERT checking for len >= 0 in the tcp output path.
This is different to the first one (as len gets updated between those
two) and would have caught various edge cases (read bugs) at a well
defined place I had been debugging the last months instead of
triggering (random) panics further down the call graph.

MFC after:	2 months
2008-09-07 11:38:30 +00:00
Pawel Jakub Dawidek 1b856fa491 Initialize vp, so we don't call VOP_UNLOCK() with NULL vnode pointer.
Confirmed by:	marcus
2008-09-07 07:55:12 +00:00
Yoshihiro Takahashi 3726c6bbc1 Use bus_space_compare() rather than i386_memio_compare() directly. 2008-09-07 04:47:39 +00:00
Yoshihiro Takahashi 05165e3276 - Add the i386_memio_map_load() function to load I/O address table.
- Add the bus_space_compare macro for bus_space consistency.
- Switch using the bus_space_map_load() in isa_load_resourcev().
2008-09-07 04:44:24 +00:00
Yoshihiro Takahashi ebd2b74476 - Cleanup i8251 related defines.
- Move i8255 related defines into a separate file.
2008-09-07 04:35:04 +00:00
Sam Leffler 0f52b1c477 make all checks if ni_chw consistent 2008-09-06 17:51:02 +00:00
Sam Leffler c9f78f45c9 use c99 syntax for initializers; this silences
warnings with picky compiler settings
2008-09-06 17:48:25 +00:00
Sam Leffler 900de99561 only return the negotiated ampdu density for sta mode 2008-09-06 17:43:47 +00:00
Sam Leffler c54fbb33b9 o kill IEEE80211_NODE_PSUPDATE; it was never used
o kill IEEE80211_NODE_CHWUPDATE; it's use was pointless and it was defined
  wrong (overlap w/ existing flags)
2008-09-06 17:42:51 +00:00
Sam Leffler c0756f5f2e put back placeholder comment 2008-09-06 17:39:31 +00:00
Sam Leffler eaff8e2689 o validate the ba policy in addba response
o leave a check for the max ba window disabled; we accept out of range
  values and just truncate them but may want to act differently in the future
2008-09-06 17:38:20 +00:00
Sam Leffler 9c62b7d4ed add IEEE80211_NODE_HT_ALL to collect up all the HT-related node flags 2008-09-06 17:33:46 +00:00
Sam Leffler 1582f2562d don't do ampdu reordering of fragments; they should never happen 2008-09-06 17:31:55 +00:00
Sam Leffler 33b9a974d5 moreve the aggregation q; it's not being used and
there's a better way to do this
2008-09-06 17:29:11 +00:00
Pawel Jakub Dawidek 433751bb50 Lock vnode exclusively around insmntque(). 2008-09-06 17:24:07 +00:00
Sam Leffler 9d365d36cc o show key indices w/o adjustment
o display all key flags symbolically
2008-09-06 17:18:38 +00:00
Sam Leffler 1cc8822ed7 purge ni_reqcw; not used and never will be 2008-09-06 17:15:55 +00:00
Sam Leffler 8524d591d1 o fix BAR definitions
o add 11e reason codes
2008-09-06 17:14:27 +00:00
Sam Leffler 7705b0838b fix age calculations (yet again); entries in the q have values
relative to the head

MFC after:	3 days
2008-09-06 17:04:44 +00:00
Roman Kurakin 8191aa7c0b Export the IPFW_DEFAULT_RULE outside ip_fw2.c. This number in not only
the default rule number but also the maximum rule number.  User space
software such as ipfw and natd should be aware of its value.  The
software that already includes ip_fw.h should use the defined value.  All
other a expected to use sysctl (as discussed on net@).

MFC after: 5 days.
Discussed on: net@
2008-09-06 16:47:07 +00:00
Ed Schouten 4fcf52f697 Small style(9) nit in <sys/termios.h>.
There are a lot of places where we do "#define<space>" instead of
"#define<tab>". Clean this up a little.
2008-09-06 15:41:58 +00:00
Ed Schouten 3c8574bc8a Make TIOCCONS use priv_check() instead of checking /dev/console permissions.
As discussed with Robert on IRC, checking the permissions on
/dev/console to see if we can call TIOCCONS could be unreliable. When we
run a chroot() without a devfs instance mounted inside, it won't
actually check the permissions on the device node inside the devfs
instance.

Using the already existing PRIV_TTY_CONSOLE for this seems like a better
idea.

Approved by:	rwatson
2008-09-06 14:43:32 +00:00
Pyun YongHyeon 97cf11ec18 Read ethernet address from ID registers for RTL8102E/RTL8102EL as
reading from EEPROM doesn't seem to work on these controllers.

Reported by:	Milan Obuch ( freebsd-net at dino dot sk )
Tested by:	Milan Obuch ( freebsd-net at dino dot sk )
2008-09-06 00:25:16 +00:00
Warner Losh 8691fc004b Turn some lame pseudo-code into a less lame comment. 2008-09-05 22:30:59 +00:00
Warner Losh 5fdde3724c Kill bogus #if 0'd stuff for interrupts. They don't happen, and this
driver will need more serious help to work with an interrupt driven
path.  There's many subtleties in driving the DMA engine with
interrupts in many configurations.  Best to not "guess" what the right
way would be and mislead people.
2008-09-05 22:29:50 +00:00
Warner Losh e704206e27 Kill vestiges of the special case code we once had in place for usb
memory allocation.  It was change to include the range in the normal
memory area, so these ifdef'd out special cases are no longer useful
to keep around.
2008-09-05 22:27:10 +00:00
Rui Paulo 5df8ba31f0 Merge ath again (addition of wisoc files). 2008-09-05 22:24:31 +00:00
Warner Losh 9df90e6ba5 Kill bogus #if 1. There's no need for it since usb works these days. 2008-09-05 22:23:41 +00:00
Julian Elischer abeae30cf4 Be consistent about whether these multi-lined macros are separated by
a blank line. Some were, some weren't. Decide in favour of the line
as it matches what an inline would do, and it's easier to read.
2008-09-05 21:03:19 +00:00
Warner Losh 39f3ec0342 Keep track of the active buffer on output. For the moment, panic if
the device indicates that it wasn't able to write all the data in the
buffer out.

Ed Schouten doesn't like the idea of a panic here.  I think for
production code, we need something better.  For right now, while we're
trying to assess the impact of this issue, a panic is OK.  So complain
to me, not him if this is hit.
2008-09-05 20:49:45 +00:00
Warner Losh b1ce3a05ee Sort products numerically. 2008-09-05 20:45:31 +00:00
Rui Paulo 89ea496520 Fix build. 2008-09-05 18:11:18 +00:00
Rui Paulo 87662ab391 Keep entries sorted. 2008-09-05 18:09:49 +00:00
Rui Paulo f877ae62e8 Add a couple more Apple GPT entries and NetBSD GPT entries. 2008-09-05 17:45:24 +00:00
Rui Paulo 35fa2f1bcd Include the vendor in the partition name. 2008-09-05 16:54:07 +00:00
Ed Schouten c27991e819 Fix a small typo in a comment in calcru1().
The word "happene" should read "happened".

Submitted by:	Jille Timmermans <jille quis cx>
2008-09-05 15:55:06 +00:00
Joseph Koshy ab5ed97ed0 Correct a copy-paste error---do not look for REX prefixes in i386 code. 2008-09-05 14:45:56 +00:00
Rui Paulo fa9a79b4fd Merge fix for P4 expansion from vendor branch. 2008-09-05 13:18:06 +00:00
Rui Paulo d7255ff42e Detect Apple HFS GPT slices. 2008-09-05 12:49:14 +00:00
Weongyo Jeong 3448d11d50 Add ZyXEL G-202
Obtained from:	OpenBSD
2008-09-05 11:27:33 +00:00
David Xu fbc48e974e Fix LOR between vnode lock and internal mqueue locks. 2008-09-05 07:32:57 +00:00
Pawel Jakub Dawidek 7fa1f32a7e Catch up after last insmntque() changes:
- The vnode has to be locked exclusively before calling insmntque().
- Until I find a way to handle insmntque() failures use VV_FORCEINSMQ flag
  to force insmntque() to always succeed.

Reported by:	kris, trasz, des, others
Suggested by:	kib
Tested by:	trasz
2008-09-05 07:00:40 +00:00
Andrew Thompson 9128ec21f3 Remove the alignment of the align parameter. This is up to the caller to pass
in and it breaks tap(4) on strict alignment machines as m_uiotombuf is called
with ETHER_ALIGN.

Found by:	Jared Go
Reviewed by:	emax
MFC after:	3 days
2008-09-05 04:05:31 +00:00
David Xu b042e9760c Fix lock name conflict.
PR:	kern/127040
2008-09-05 02:07:25 +00:00
Giorgos Keramidas 57a5a46e00 Slightly reword comment and remove typos. 2008-09-05 01:36:30 +00:00
Marius Strobl 74e73c7cc2 When determining whether we trapped while in the PROM don't only
check for addresses below the PROM range but also those above.
2008-09-04 21:06:09 +00:00
Marius Strobl e5858aa9d5 Use the PROM provided SUNW,set-trap-table to take over the trap
table. This is required in order to set obp-control-relinquished
within the PROM, allowing to safely read the OFW translations node.
Without this, f.e. a `ofwdump -ap` triggers a fatal reset error or
worse things on machines based on USIII and beyond.
In theory this should allow to remove touching %tba in cpu_setregs(),
in practice we seem to currently face a chicken and egg problem when
doing so however.
2008-09-04 20:52:54 +00:00
Marius Strobl f2ac8af4bc Ensure the caches have the desired configuration (see especially
cheetah_cache_enable()).
2008-09-04 20:08:21 +00:00
Marius Strobl 597b17a0e0 Flesh out MMU and cache handling of cheetah-class CPUs. 2008-09-04 19:58:52 +00:00
Marius Strobl 4f76d0a885 The physical address space of cheetah-class CPUs has been extended
to 43 bits so update TD_PA_BITS accordingly. For the most part this
increase is transparent to the existing code except for when reading
the physical address from ASI_{D,I}TLB_DATA_ACCESS_REG, which we
only do in the loader and which was already adjusted in r182478, or
from the OFW translations node.
While at it, ensure we are only taking valid OFW mapping entries
into account.
2008-09-04 19:43:14 +00:00
Marius Strobl 5aa6f9f392 Ensure interrupts are off while in {d,i}tlb_va_to_pa_sun4u().
I think this is necessary in order to make sure the workarounds
in {d,i}tlb_get_data_sun4u() work correctly.
2008-09-04 19:41:54 +00:00
David E. O'Brien 7aadc92e95 style(9) 2008-09-04 17:10:52 +00:00
Ed Schouten 64308260f6 Implement pts(4) packet mode.
As reported by several users on the mailing lists, applications like
screen(1) fail to properly handle ^S and ^Q characters. This was because
MPSAFE TTY didn't implement packet mode (TIOCPKT) yet. Add basic packet
mode support to make these applications work again.

Obtained from:	//depot/projects/mpsafetty/...
2008-09-04 16:39:02 +00:00
Ed Schouten 2bda9238e5 Fix an awful bug inside our COMPAT_43TTY code.
When I migrated tty_compat.c to MPSAFE TTY, I just hooked it up to the
build and fixed it until it compiled and somewhat worked. It turns out
this was not the smartest thing, because the old TTY layer also had a
field called t_flags, which contained a set of sgtty flags.

This means our current COMPAT_43TTY code overwrites the TTY flags,
causing all strange problems to occur. Fix this code to use a new struct
member called t_compatflags. This commit may cause kern/127054 to be
fixed, but this still has to be tested/confirmed by the originator. It
has to be fixed anyway.

PR:		kern/127054
2008-09-04 16:30:53 +00:00
Dag-Erling Smørgrav 19de3e9011 Unbreak the build.
Pointy hat to:	kevlo
2008-09-04 13:06:36 +00:00
Rafal Jaworowski d99ebc85d9 Recognize 88E1116R phy variation. This part is found on some embedded devices.
Obtained from:	Semihalf
2008-09-04 11:09:40 +00:00
Kevin Lo f308bddd3f If the process id specified is invalid, the system call returns ESRCH 2008-09-04 10:44:33 +00:00
Alexander Motin 02e5ff6c1b Add one more SII3132 chip PCI ID found on Adaptec Serial ATA II RAID 1220SA.
Submitted by:	Dmitry S. Luhtionov <mitya@cabletv.dp.ua>
2008-09-04 10:27:58 +00:00
Marius Strobl 9546a68999 Additionally clear the STICK bit in the SOFTINT register when
receiving a PIL_TICK interrupt. This change was erroneously
omitted in r182730.
2008-09-03 21:48:12 +00:00
Brooks Davis d3c4cf45ba Replace a line matching /^ $/ with one matching /^$/.
Obtained from:	//depot/projects/vimage-commit2/...
2008-09-03 20:33:11 +00:00
Julian Elischer ad34e48415 New file missed vimagification. 2008-09-03 19:23:01 +00:00
Simon L. B. Nielsen 59ca51adba - Fix amd64 local privilege escalation. [08:07]
- Fix nmount(2) local privilege escalation. [08:08]
- Fix IPv6 remote kernel panics. [08:09]

Fix for [08:07] is merge of r181823.

Submitted by:	kib [08:07], csjp [08:08], bz [08:09]
Reviewed by:	peter [08:07], jhb [08:07]
Reviewed by:	jinmei [08:09], rwatson [08:09]
Approved by:	re (SA blanket)
Approved by:	so (simon)
Security:	FreeBSD-SA-08:07.amd64
Security:	FreeBSD-SA-08:08.nmount
Security:	FreeBSD-SA-08:09.icmp6
2008-09-03 19:09:47 +00:00
Xin LI e08d55674d Reflect license change of NetBSD code.
Obtained from:	NetBSD
MFC after:	3 days
2008-09-03 18:53:48 +00:00
David E. O'Brien 9014c90537 Catch up with the move from mips32/. 2008-09-03 18:49:54 +00:00
David E. O'Brien 86102aae67 Catch up with the move from mips32/. 2008-09-03 18:40:29 +00:00
David E. O'Brien 69dda689d1 Style(9). 2008-09-03 18:40:02 +00:00
Julian Elischer 9c238a0ec4 Add Marko's pipe node.
This allows one to do flow modulation similar to dummynet
between arbitrary nodes.
2008-09-03 18:17:45 +00:00
Julian Elischer 9c6b07a695 whitespace nit 2008-09-03 18:09:15 +00:00
Rafal Jaworowski cf725aeb0b Improve loader support for U-Boot.
- add new diag commands: devinfo, sysinfo for U-Boot-style details about the system
  configuration
- better memory info summary
- style corrections

Obtained from:	Semihalf
2008-09-03 17:48:41 +00:00
Rafal Jaworowski 387a29b78d Show info about net devices in loader's 'lsdev' command. While there fix style. 2008-09-03 17:41:44 +00:00
Marius Strobl 09c7f9e338 - USIII-based machines can consist of CPUs running at different
frequencies (and having different cache sizes) so use the STICK
  (System TICK) timer, which was introduced due to this and is
  driven by the same frequency across all CPUs, instead of the
  TICK timer, whose frequency varies with the CPU clock, to drive
  hardclock. We try to use the STICK counter with all CPUs that are
  USIII or beyond, even when not necessary due to identical CPUs,
  as we can can also avoid the workaround for the BlackBird erratum
  #1 there. Unfortunately, using the STICK counter currently causes
  a hang with USIIIi MP machines for reasons unknown, so we still
  use the TICK timer there (which is okay as they can only consist
  of identical CPUs).
- Given that we only (try to) synchronize the (S)TICK timers of APs
  with the BSP during startup, we could end up spinning forever in
  DELAY(9) if that function is migrated to another CPU while we're
  spinning due to clock drift afterwards, so pin to the CPU in order
  to avoid migration. Unfortunately, pinning doesn't work at the
  point DELAY(9) is required by the low-level console drivers, yet,
  so switch to a function pointer, which is updated accordingly, for
  implementing DELAY(9). For USIII and beyond, this would also allow
  to easily use the STICK counter instead of the TICK one here,
  there's no benefit in doing so however.
  While at it, use cpu_spinwait(9) for spinning in the delay-
  functions. This currently is a NOP though.
- Don't set the TICK timer of the BSP to 0 during at startup as
  there's no need to do so.
- Implement cpu_est_clockrate().
- Unfortunately, USIIIi-based machines don't provide a timecounter
  device besides the STICK and TICK counters (well, in theory the
  Tomatillo bridges have a performance counter that can be (ab)used
  as timecounter by configuring it to count bus cycles, though unlike
  the performance counter of Schizo bridges, the Tomatillo one is
  broken and counts Sun knows what in this mode). This means that
  we've to use a (S)TICK counter for timecounting, which has the old
  problem of not being in sync across CPUs, so provide an additional
  timecounter function which binds itself to the BSP but has an
  adequate low priority.
2008-09-03 17:39:19 +00:00
Marius Strobl b898f38ce7 Switch sun4v to back to using its own clock.c, which was ressurected
in 182691, as the sparc64 version is going to be rototilled and sun4v
currently can't be verified to still work with the new sparc64 one
due to its overall state.
2008-09-03 17:31:13 +00:00
Rafal Jaworowski b2b88c5cb4 Use current SP instead of global data ptr for the U-Boot API signature search hint.
Global data (pointed by R2 on PowerPC) in principle is not guaranteed to be in
proximity of U-Boot heap (where the API signature is placed) accross different
architectures and platforms. Instead, use U-Boot stack pointer as a hint for
the search instead of the global data; this method tends to be more uniform
accross different platforms.

Obtained from:	Semihalf
2008-09-03 16:38:27 +00:00
Rafal Jaworowski 51e8f5a470 Make metadata.c shared across all platforms using U-Boot.
This will [soon] be needed for ARM.
2008-09-03 15:52:05 +00:00
Rafal Jaworowski aa8fb78b88 Move U-Boot compatibility library to WARNS=2 level. 2008-09-03 15:39:50 +00:00
Rui Paulo 1b217218d5 Fix the sysctl function parameters. We were only querying Sensor 0.
Noticed by:	des
MFC after:	3 days
2008-09-03 13:34:31 +00:00
Edward Tomasz Napierala 86a0c0aa7b When calling extattr_check_cred, use V{READ,WRITE}, not I{READ,WRITE}.
Approved by:	rwatson (mentor)
2008-09-03 12:46:09 +00:00
Bjoern A. Zeeb bf0d5f8e16 Fix a bug, when a specially crafted ICMPV6 MLD packet could lead
to an integer divide by zero panic in the kernel, if the kernel was
run with hz<1000.
Neither i386, pc98, amd64 or sparc64 are affected in the currently
supported branches and default configuration.

Submitted by:	Miikka Saukko, Ossi Herrala and Jukka Taimisto from
		the CROSS project at Codenomicon Ltd. via CERT-FI.
Reviewed by:	bz, rwatson
Security:	CVE-2008-2464
MFC after:	8 hours
2008-09-03 08:13:58 +00:00
Warner Losh 7589f19e81 Style nit. Continued lines are indented 2 spaces in this file. 2008-09-03 06:57:21 +00:00
Kip Macy 1fc7c4a654 enable the xen_guest string so that the freebsd xen kernel will
at least pass muster with the loader on 3.0.3

Note that this doesn't actually make it work as Xen 3.0.3
appears to disallow recursive mappings on the page directory
2008-09-03 00:06:10 +00:00
Kip Macy 6eb15755c7 Indicate at probe time if device can do offload and which revision it is
MFC after:	3 days
2008-09-02 22:38:49 +00:00
David E. O'Brien c6283b1a86 ahc(4) work better in Sparc64 with AHC_ALLOW_MEMIO.
Submitted by:	Nathan Whitehorn <nwhitehorn@freebsd.org>
2008-09-02 21:46:17 +00:00
Marius Strobl fd9d647916 MFsparc64: r177642
Remove sysbeep() from the non-beeping archs.
2008-09-02 21:35:57 +00:00
Marius Strobl b12572f400 Resurrect clock.c from r164371. 2008-09-02 21:28:04 +00:00
Marius Strobl ec0f669534 - USIII-based machines can consist of CPUs having different cache
sizes (and running at different frequencies) so move the cacheinfo
  to the PCPU data. While at it, remove some redundant and/or unused
  members from struct cacheinfo.
- In sparc64_init don't assume the first CPU node we find in the OFW
  device tree is the BSP.
2008-09-02 21:13:54 +00:00
Marius Strobl dffe703dea Bypass isa_probe_children(9) and directly call bus_generic_attach(9)
in order to avoid the invasive probes done by identify-routines of
ISA drivers, which may access unassigned addresses or those of
unrelated devices and thus in turn can trigger master/target aborts
as revealed by r182108 and ahc(4). I think that this is also the
cause of the hang previously seen on B100 blades during boot.
Bypassing isa_probe_children(9) also avoids adding ISA hints, which
just can be wrong for sparc64.

Reported by:	gavin
2008-09-02 21:06:28 +00:00
Konstantin Belousov f98c3ea74e - When executing FreeBSD/amd64 binaries from FreeBSD/i386 or Linux/i386
processes, clear PCB_32BIT and PCB_GS32BIT bits [1].

- Reread the fs and gs bases from the msr unconditionally, not believing
  the values in pcb_fsbase and pcb_gsbase, since usermode may reload
  segment registers, invalidating the cache. [2].

Both problems resulted in the wrong fs base, causing wrong tls pointer
be dereferenced in the usermode.

Reported and tested by:	Vyacheslav Bocharov <adeepv at gmail com> [1]
Reported by:	Bernd Walter <ticsoat cicely7 cicely de>,
	Artem Belevich <fbsdlist at src cx>[2]
Reviewed by:	peter
MFC after:	3 days
2008-09-02 17:52:11 +00:00
Ed Schouten ffffa83b60 Use size_t to store the return value of ttydisc_getc().
The ttydisc_getc() routine obtains a read length from ttyoutq_read().
For no valid reason, the current code stores this value in an int, and
returns a size_t. There is no need to perform this useless conversion.

Obtained from:	//depot/projects/mpsafetty/...
2008-09-02 17:13:11 +00:00
Robert Watson 26ec197d15 Remove XXXRW in soreceive_dgram that proves unnecessary.
Remove unused orig_resid variable in soreceive_dgram.

Submitted by:	alfred
X-MFC with:	soreceive_dgram (r180198, r180211)
2008-09-02 16:55:21 +00:00
Kip Macy 1ffd6e5809 Import ioctl updates for latest rev of cxgbtool
Obtained from:	Chelsio Inc.
MFC after:	3 days
2008-09-02 07:47:14 +00:00
Weongyo Jeong b20f0ed118 free ifp allocated at ieee80211_vap_setup.
Reviewed by:	sam, thompsa
2008-09-02 04:49:35 +00:00
Kip Macy 42e68d4d74 Accomodate the fact that the number of l1 pages varies with the size of the initially
allocated memory - this lets us boot with 3GB

MFC after:	1 month
2008-09-02 02:55:45 +00:00
Nathan Whitehorn 20a94ecc79 Fix a multiple locking bug in bm(4) that could cause panics on a WITNESS-enabled kernel.
Approved by:	marcel (mentor)
MFC after:	1 day
2008-09-02 02:50:52 +00:00
Kip Macy 32a5d14b26 Fix problem with large memory configuration by ensuring that all NKPT
page table pages have been zeroed before entering them in the page
directory

MFC after:	1 month
2008-09-02 01:32:52 +00:00
Warner Losh 9e51595ce6 Per email to arch@ a little while ago (that was greeted with silence),
prefer the more common > ${.TARGET} over > opt_foo.h in modules
makefiles.
2008-09-01 23:59:00 +00:00
Brooks Davis 0eb7cf4d5f Wrap an 81 column SYSCTL_NODE decleration.
Obtained from:	//depot/projects/vimage-commit2/...
2008-09-01 19:25:27 +00:00
Ed Schouten da378661c0 Remove unneeded D_NEEDMINOR from cpuctl(4).
The D_NEEDMINOR flag was introduced for drivers that do not actually
depend on storing a device unit/minor number, but require the ability to
address the cdevs by this number, which is used by clone_create().

The cpuctl(4) driver sets D_NEEDMINOR, even though it doesn't use the
clone_create() API. Remove the flag, because maybe we want to get rid of
it somewhere in the far future.
2008-09-01 18:56:01 +00:00
Brooks Davis c7cacf27f0 Wrap a line that became too long with the addition of V_.
(This file contains many more unwrapped or badly wrapped lines.)
2008-09-01 17:15:29 +00:00
Konstantin Belousov 67c7bbf39c In rev. 1.17 (r33548) of msdosfs_fat.c, relative cluster numbers were
replaced by file relative sector numbers as the buffer block number when
zero-padding a file during extension. Revert the change, it causes wrong
blocks filled with zeroes on seeking beyond end of file.

PR:	kern/47628
Submitted by:	tegge
MFC after:	3 days
2008-09-01 13:18:16 +00:00
Pawel Jakub Dawidek 2765482b7f When setting error to EINVAL in 'fvp == tdvp' case, jump to out label,
because if not, the error will be later overwritten by
mac_vnode_check_rename_to() call.

Reviewed by:	rwatson
2008-09-01 10:11:39 +00:00
Kip Macy 7c80e4f37f Don't check if an interface can do tcp offload if there are no offload devices registered on the system.
Suggested by: rwatson
MFC after:	3 days
2008-09-01 05:30:22 +00:00
Marcel Moolenaar cbb6aaf62f Trace interrupts with KTR_INTR. 2008-08-31 23:54:22 +00:00
Marcel Moolenaar 8d8cca480c Remove redundant KTR statements. 2008-08-31 20:55:31 +00:00
Marcel Moolenaar 09a94c6407 Trace all PMAP calls using KTR_PMAP. 2008-08-31 20:08:13 +00:00
Julian Elischer 22b55ba9a0 fix tiny nti in comment 2008-08-31 18:54:35 +00:00
Warner Losh fcce278bf2 Use a locally assigned address rather than stealing Atmel's which
might cause a conflict...
2008-08-31 18:20:01 +00:00
Attilio Rao 59d4932531 Decontextualize vfs_busy(), vfs_unbusy() and vfs_mount_alloc() functions.
Manpages are updated accordingly.

Tested by:	Diego Sardina <siarodx at gmail dot com>
2008-08-31 14:26:08 +00:00
Robert Watson 7a0a0eecf0 In UDPv6, reduce scope of global udbinfo lock during append to last
matching socket by dropping it before udp6_append(), and remove
duplicate unlocks of udbinfo and inpcb in sysctl return path.

MFC after:	3 days
2008-08-31 13:16:45 +00:00
Ed Schouten 0639d527ca Disable processing of output data after disabling scroll lock by force.
The syscons code disabled scroll lock inside sc_cnputs() if it's going
to print a system message. The code currently wants to process any TTY
output data as well, but we cannot do this, because the TTY lock is a
sleep mutex, while cnputs() picks up a spin mutex.

Disable the code for now. It solves a panic when a console message is
printed while scroll lock is enabled. One solution would be to
initialize a task structure here.

Reported by:	Paul B. Mahol <onemda gmail com>
2008-08-31 10:17:40 +00:00
Stanislav Sedov a0ac6fc0bc - Fix comment.
- Set U/L bit of generated ethernet address to 1 to not
  clash with Atmel assigned addresses.

Suggested by:	yar
Approved by:	kib (mentor)
2008-08-31 09:28:49 +00:00
Warner Losh b2fcf23526 Make uipaq's ucom callbacks easier to read while I'm hear looking for
other why this seems to be broken with my phone...
2008-08-31 03:39:59 +00:00
Warner Losh 88c29cec87 All the other routines returned EIO from the param routine. Return it
from umodem and ufoma.

With these changes, umodem kinda works for me now.  It certainly gets
past the "tip" bug that I found earlier where 115200 wasn't a valid
baud rate.  This was "broken" in the mpsafetty commit, but in reality,
umodem was always broken.
2008-08-31 03:22:19 +00:00
Warner Losh 8a5492b881 Ioctls that aren't handled by this layer need to return ENOIOCTL, not
ENOTTY.  Also, make the ucom callback structure easier to read while
I'm here.
2008-08-31 03:16:31 +00:00
Warner Losh c9b04e1085 Kill dead code. This has been a 'todo' item for a long time and the
skelton ioctl handler has decayed beyond usefulness in both of these
drivers.
2008-08-31 03:08:26 +00:00
Marcel Moolenaar 24c8466e8f Remove restore_intr(). We have intr_restore()... 2008-08-31 02:25:20 +00:00
Christian S.J. Peron 8751c5bac8 Improve the entropy of the source port randomization for network address
translation.  It turns out this is useful for applications which require
source port randomization for security (i.e. dns servers).

Discussed with:	secteam
Requested by:	mlaier
MFC after:	2 weeks
2008-08-30 20:58:34 +00:00
Marcel Moolenaar 896b354188 In db_show_mdpcpu(), print MD fields. 2008-08-30 18:50:11 +00:00
Marcel Moolenaar 958ed50695 Whitespace fixes. 2008-08-30 18:48:17 +00:00
Marcel Moolenaar 20c5910af7 Call powerpc_sync() instead of using an asm statement. 2008-08-30 18:39:29 +00:00
Marcel Moolenaar d3f6fb3b91 Add powerpc_sync() as an inline function. 2008-08-30 18:38:37 +00:00
Marcel Moolenaar 7aff4169e3 Don't clear PSL_RI. Disabling external interrupts
doesn't make exceptions unrecoverable.
2008-08-30 18:37:55 +00:00
Warner Losh a423fd2c55 opt_bus.h isn't needed here anymore. It never was really needed,
since usb has no business including it like it did...
2008-08-30 16:24:01 +00:00
Warner Losh 06a6aa2b6b opt_bus.h isn't needed here. It is supposed to be for subr_bus.c only. 2008-08-30 16:23:04 +00:00
Warner Losh 277f167c86 opt_bus.h is supposed to be for subr_bus.c only. There's no need for
it in the usb code.
2008-08-30 16:21:16 +00:00
Marius Strobl 20e6aaf533 - Read ASI_{D,I}TLB_DATA_ACCESS_REG twice in order to work around
errata of USIII and beyond (USIII erratum #19, USIII+ erratum #1,
  USIIIi erratum #1).
- Use the cheetah PA mask in {d,i}tlb_va_to_pa_sun4u() for USIII
  and beyond. This is done so that these functions will still mask
  the debug bits of spitfire-class CPUs once we increase TD_PA_BITS
  to match the number of bits used for the PA by cheetah-class CPUs.
- Change {d,i}tlb_enter_sun4u() to also set TLB_CTX_KERNEL as the
  context of the mappings entered. This is more or less cosmetic as
  TLB_CTX_KERNEL is 0.
- Now that we have to distinguish between different sun4u CPUs in
  the loader anyway, no longer do trial and error when reading the
  portid property.
2008-08-30 16:03:22 +00:00
Stanislav Sedov 0787c9a03f - Try to look for MAC address in all SA registers, not only in the
first one. U-boot, for example, uses the second register to store
  MAC.[1]
- Use random MAC address if none configured instead of failing.

Submitted by:	Bjorn Konig <bkoenig@alpha-tierchen.de> [1]
Reviewed by:	imp
Approved by:	kib (mentor)
MFC after:	1 week
2008-08-30 15:16:40 +00:00
Stanislav Sedov ae8b75dddb - Style fix.
Approved by:	kib (mentor)
MFC after:	1 week
2008-08-30 15:04:53 +00:00
Attilio Rao 988d28340a - Improve some witness_watch operability in code which does perform both
lock tracking and checks, doing just the former ones.
- Fix a bug where sysctl utility was printing crazy values when setting a
  new value for debug.witness.watch [0]

[0] Reported by:	yongari
2008-08-30 13:20:35 +00:00
Ed Schouten 74bb9e3ad5 Fix some edge cases in the TTY queues:
- In the current design, when a TTY decreases its baud rate, it tries to
  shrink the queues. This may not always be possible, because it will
  not free any blocks that are still filled with data.

  Change the TTY queues to store a `quota' value as well, which means it
  will not free any blocks when changing the baud rate, but when placing
  blocks back into the queue. When the amount of blocks exceeds the
  quota, they get freed.

  It also fixes some edge cases, where TIOCSETA during read()/
  write()-calls could actually make the queue a tiny bit bigger than in
  normal cases.

- Don't leak blocks of memory when calling TIOCSETA when the device
  driver abandons the TTY while allocating memory.

- Create ttyoutq_init() and ttyinq_init() to initialize the queues,
  instead of initializing them by hand. The new TTY snoop driver also
  creates an outq, so it's good to have a proper interface to do this.

Obtained from:	//depot/projects/mpsafetty/...
2008-08-30 09:18:27 +00:00
Robert Noland 6f81ba0e97 Don't return EINVAL when trying to unlock.
anholt thinks that he added this check as part of some regression testing,
but it is failing at least some of the time.  I don't want to remove it
just yet.  I added a bit of debugging to help identify the issue.

Approved by:	kib
2008-08-30 01:00:18 +00:00
Robert Noland ac165058b7 We need to lock around driver unload now.
The i915 driver installs it's register map at load time now.  We can't
remove the map during unload without holding the lock.

Approved by:	kib
2008-08-30 00:53:30 +00:00
Robert Noland 4d8fefdaf4 Free the device lock around the call to drm_drawable_free_all()
This function manipulates a spin lock and we can't hold a mutex over it.

Approved by:	kib
2008-08-30 00:47:52 +00:00
George V. Neville-Neil e4762f75c3 Fix a bug whereby multicast packets that are looped back locally
wind up with the incorrect checksum on the wire when transmitted via
devices that do checksum offloading.

PR:		kern/119635
Reviewed by:	rwatson
MFC after:	5 days
2008-08-29 20:42:58 +00:00
Jung-uk Kim 12dc95824b Make bpf_maxinsns visible from ng_bpf.c.
Pass me the pointyhat, please.
2008-08-29 20:34:06 +00:00
Marius Strobl d0d67284f8 For chips with a broken DC_ISR_RX_STATE which f.e. never signals
stopped nor the waiting state and also no other means to check
whether the receiver is idle (see also r163774), we have no choice
than to call mii_tick(9) unconditionally even in the case of the
DC_REDUCED_MII_POLL handling as far as the RX side is concerned.
This isn't necessarily worse than checking whether RX is idle
though because unlike as with TX we're racing with the hardware,
which might receive packets any time while we poll the MII, anyway.

Reported and tested by:	Jacob Owens
Reviewed by:		yongari
MFC after:		3 days
2008-08-29 20:31:41 +00:00
Jung-uk Kim b87fd66b6d Fix the last missing parentheses for a return statement in bpf_filter.c. 2008-08-29 20:00:55 +00:00
Jung-uk Kim 7c5db425bf More convergence towards style(9). 2008-08-29 19:32:04 +00:00
Jung-uk Kim 07e7d73788 - Directly match code wherever possible instead of using macros.
- Macrofy bitmap table lookup.  Constify the table while I am here.
- Add missing continue statements in the for loop.

Functionally it should be the last remaining fix from:

PR:		kern/89752
MFC after:	1 month
2008-08-29 19:10:51 +00:00
Scott Long a25cb00747 Ensure that the padding calcualtion doesn't return a negative value.
Submitted by:	kib
Approved by:	jb
2008-08-29 15:55:49 +00:00
Jung-uk Kim 37b5fe59b5 Make sure BPF program is not bigger than set maximum (net.bpf.maxinsns). 2008-08-29 15:49:40 +00:00
Attilio Rao df3310e04a - Make witness_watch a 3 state value.
1 means that witness is up and running.
  0 means that witness is disabled but that it can be established later
    again in effective way.
  -1 means that witness is disabled permanently
- Fix a bug causing kernel to panic on witness disabling through
  witness_watch.  lock lists queues were still full of entries and this was
  causing throubles with debugging stubs (like witness_thread_exit()).

Reported by:	kris, yongari
Sponsored by:	Nokia
2008-08-29 15:47:53 +00:00
Ed Schouten 67d350d60c Restore assertion that was removed in r182444.
While merging back my changes from Perforce, it seemed I removed a
locking assertion that still applies to ttydisc_rint_poll(). Restore it,
because it may come in handy.
2008-08-29 15:05:34 +00:00
Ed Schouten a15ec0a5e4 Backport two small fixes from the MPSAFE TTY branch in Perforce:
- Implement IMAXBEL. It turned out the IMAXBEL termios switch was marked
  as supported, while it had not been implemented.

- Don't go into the high watermark when in canonical mode, no data has
  been canonicalized and the input buffer is full. This caused the
  terminal to lock up. This prevented users from pressing
  backspace/^U/etc in such cases.

  This could easily be simulated by pasting a very big amount of data in
  a shell with sh(1) in canonical mode.

Obtained from:	//depot/projects/mpsafetty/...
2008-08-29 15:02:50 +00:00
Yoshihiro Takahashi 5798cf97e9 unifdef PC98 2008-08-29 12:25:58 +00:00
Yoshihiro Takahashi c5fe188c44 Remove unneeded include. 2008-08-29 12:23:51 +00:00
Tai-hwa Liang 2bc01c3a32 Fixing INVARIANTS build by adding 'z' format prefix for size_t typed
variable.

Reminded by:	tinderbox
2008-08-29 08:44:51 +00:00
Sam Leffler 02a1ebb4e3 Fix mic calculation when final data is entirely in a trailing mbuf;
it's unclear if this can happen on freebsd but does appear on netbsd.
Identified by Matthias Drochner who came up with an initial change
that we then revised together.

Reviewed by:	thompsa, sephe, avatar
MFC after:	2 weeks
2008-08-29 05:02:10 +00:00
Scott Long b574dd8dd1 Fix a locking mistake in daopen(). If the open fails, which can happen
because the media was removed, the periph would get its refcount dropped
and ultimately freed before getting unlocked.  This created a dangling
pointer that was easy to trip over.  This fixes a common source of
crashes with removaable media, but problems remain and will get tracked
down.
2008-08-29 04:39:46 +00:00
Jung-uk Kim 28ae62aa8a Simplify jump instruction range checks.
MFC after:	1 month
2008-08-29 01:47:45 +00:00
David Xu 3eb8b8bbeb Don't remove queued SIGCHLD if options contain WNOWAIT, so other
threads still can be notified by the signal.
2008-08-29 01:34:05 +00:00
Scott Long d69c9c7867 Work again to fix the interrupt masking problems. We now recognize
that there are 3 different interrupt enable bits, 2 for different
families of cards, and 1 for when MSI is used.  Also apply a big
hammer backstop for cards that aren't recognized.  This should fix
all of the interrupt issues at boot.
2008-08-29 01:23:16 +00:00
Tom Rhodes 1e018d99f2 Fix a typo in r180291
"NAme of the current YP/NIS domain" -> "Name of the current YP/NIS domain"
2008-08-28 23:52:34 +00:00
Jack F Vogel 882a54f65f Update to igb driver:
- changes in support of the VLAN filter fix to 126850
	- removal of a bunch of legacy code that was cruft, if not
	  possibly harmful.
	- removal of POLLING from this driver, with multiqueue and
	   MSIX it just makes no sense here.
	- Fix an LRO bug that I've been working on internally, intermittent
	  panics under stress, the problem was releasing the RX ring lock
	  before the LRO flushing.
	- Following the above fix I now enable LRO by default
	- For performance reasons increase the default number of RX queues
	  to 4.
	- Add AIM - "Adaptive Interrupt Moderation", a fancy way of saying
	  that the EITR value is dynamically changed based on the size of
	  packets in the last interrupt interval.

	- Much goodness to try, enjoy!!
2008-08-28 22:28:28 +00:00
Jack F Vogel 22893351e5 Fix to bug kern/126850. Only dispatch event hander if the
interface had a parent (was attached).

Reviewed by: EvilSam
MFC after: 1 week
2008-08-28 22:05:19 +00:00
Jung-uk Kim 46e4a5d582 Check invalid BPF codes from bpf_validate(9).
Note that it is not critical because bpf_filter(9) returns zero
when it encounters invalid code at run time.

MFC after:	1 month
2008-08-28 22:00:21 +00:00
Rui Paulo 003c7e36b2 Fix typo in comment. 2008-08-28 21:55:40 +00:00
Randall Stewart df4ad1fd93 ok, non static the function and put in the .h so
when we do INVARANT compile the compiler will not
dis the function that is not used. Hmm maybe I should have
made it ifndef INVARIANTs..
2008-08-28 20:31:24 +00:00
Randall Stewart e1bfc4d739 Fixes compile error when INVARIANTs is on. Adds an
empty goto to keep the compiler happy.
2008-08-28 20:14:07 +00:00
John Baldwin 3b85b73802 Fail detach if cpufreq_unregister() fails.
MFC after:	1 week
2008-08-28 19:55:18 +00:00
Ed Schouten a05cae5186 Make ureadc() warn when holding any locks, just like uiomove().
A couple of months ago I was quite impressed, because when I was writing
code, I discovered that uiomove() would not allow any locks to be held,
while ureadc() did, mainly because ureadc() is implemented using the
same building blocks as uiomove().

Let's see if this triggers any aditional witness warnings on our source
tree.

Reviewed by:	atillio
2008-08-28 19:34:58 +00:00
David E. O'Brien 7660701e51 Protect _IOC's 'len' and 'inout' parameters so that _IOC can be used in
more flexible ways.
2008-08-28 18:29:59 +00:00
Jung-uk Kim 8cfdb2fb13 Validate scratch memory addresses for BPF_STX and BPF_LDX|BPF_MEM.
A badly written filter was able to reference invalid addresses,
even cause kernel crash.

MFC after:	3 days
2008-08-28 17:49:37 +00:00
Jung-uk Kim 06302de20d Initialize scratch memory for JIT-compiled filter when it is allocated.
Previously it may have contained unnecessary (even sensitive) data from
the previous allocation.
As a (good) side effect, scratch memory may be used to store the previous
filter state(s) safely because it is allocated and freed with filter itself.
However, use it carefully because bpf_filter(9) does not have this behavior.

MFC after:	3 days
2008-08-28 16:40:51 +00:00
Attilio Rao 0359a12ead Decontextualize the couplet VOP_GETATTR / VOP_SETATTR as the passed thread
was always curthread and totally unuseful.

Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
2008-08-28 15:23:18 +00:00
Randall Stewart df6e0cc37d - Make strict-sacks be the default.
- Change it so that without INVARIANTs there are
  no panics in SCTP.
- sctp_timer changes so that we have a recovery mechanism
  when the sent list is out of order.
2008-08-28 09:44:07 +00:00
Konstantin Belousov acd05e468a In ffs_valloc(), ffs_vget() may fail because insmntque() refused to
insert new vnode into the mount vnode list. Then, for the SU-enabled
mount, ffs_vfree could create freefile dependency. This dependency can
hang around forever since inode is not marked as IN_MODIFIED and
correspondingly inodeblock may be not marked as dirty.

After ffs_vget() fails, retry with FFSV_FORCEINSMQ, mark the inode as
modified, and vput() it immediately. Take care of the dup alloc.

Tested by:	pho
Reviewed by:	tegge
MFC after:	1 month
2008-08-28 09:19:50 +00:00
Konstantin Belousov 7b7ed832e4 Softdep code may need to instantiate vnode when processing
dependencies. In particular, it may need this while syncing filesystem
being unmounted. Since during unmount MNTK_NOINSMNTQUE flag is set,
that could sometimes disallow insertion of the vnode into the vnode
mount list, softdep code needs to overwrite the MNTK_NOINSMNTQUE flag.

Create the ffs_vgetf() function that sets the VV_FORCEINSMQ flag for
new vnode and use it consistently from the softdep code instead of
ffs_vget().

Add the retry logic to the softdep_flushfiles() to flush the vnodes
that could be instantiated while flushing softdep dependencies.

Tested by:	pho, kris
Reviewed by:	tegge
MFC after:	1 month
2008-08-28 09:18:20 +00:00
Konstantin Belousov a888d54d39 Introduce the VV_FORCEINSMQ vnode flag. It instructs the insmnque() function
to ignore the unmounting and forces insertion of the vnode into the mount
vnode list.

Change insmntque() to fail when forced unmount is in progress and
VV_FORCEINSMQ is not specified.

Add an assertion to the insmntque(), requiring the vnode to be
exclusively locked for mp-safe filesystems.

Use the VV_FORCEINSMQ for the creation of the syncvnode.

Tested by:	pho
Reviewed by:	tegge
MFC after:	1 month
2008-08-28 09:08:15 +00:00
Rafal Jaworowski c8e780791e Move initialization of tlb0, ptbl_bufs and kernel_pdir regions after we are
100% sure that TLB1 mapping covers for them; previously we could lock the CPU
with an untranslated references.

Obtained from:	Semihalf
2008-08-28 07:38:08 +00:00
John Baldwin 943bebd2c9 Remove hack attempt at using devfs cloning for per-file descriptor storage.
Use the much simpler cdevpriv for per-fd state and enable it.  This allows
multiple opens of /dev/ipmi0 (e.g. using ipmitool while ipmievd is running
in the background).

MFC after:	1 week
2008-08-28 02:13:53 +00:00
John Baldwin 93269b7123 - Tweak an error message.
- Fix a buglet where && was used instead of & to test if OBF was set in
  a couple of places.

MFC after:	1 week
2008-08-28 02:11:04 +00:00
Rui Paulo 66fe9e3277 Merge ath_hal 0.10.5.10 to head.
Approved by:	sam
2008-08-28 00:22:59 +00:00
Christian S.J. Peron f440aeea83 Fix a panic in MAC kernels that was a result of un-initialized label
storage.  We can safely remove the label copying operations since
M_MOVE_PKTHDR will move the mbuf tags (which contain MAC labels) to
the destination mbuf.

MFC after:	1 week
Discussed with:	rwatson
2008-08-27 23:52:03 +00:00
Rui Paulo e82cbe00b8 Flatten the vendor-sys/ath tree for future imports. 2008-08-27 19:52:48 +00:00
Rui Paulo c719bf13e9 Workaround the detect-merge-conflicts.sh script and 's/^======$/&='. 2008-08-27 19:47:48 +00:00
Ed Schouten ceef66c0e3 Properly unlock the init/lock-state devices when invoking TIOCSETA.
For some reason a return-statement crept into this code, where it
shouldn't belong. This means we didn't properly unlock the TTY before
returning to userspace.

Submitted by:	Tor Egge <tor egge cvsup no freebsd org>
2008-08-27 19:37:21 +00:00
David Christensen b6d57579a2 - Updated support for 5716.
- Added some additional code for debug builds.
- Fixed a problem printing physical memory on 64bit system during debugging.
- Modified some of the context memory and mailbox register names to more
  clearly distinguish their use.
- Added memory barriers for Intel CPUs when accessing host memory data
  structures which are written by hardware.

MFC after:	Two weeks.
2008-08-27 18:47:24 +00:00
John Baldwin 9c2bf0cce2 - Only count the number of CPUs in the rendezvous map once rather than
doing it on every CPU.
- Use CPU_ABSENT() rather than pcpu_find() to determine if a CPU is not
  present.
- Count up to mp_maxid rather than MAXCPU when iterating over CPUs to
  match the rest of the code in the kernel.

MFC after:	1 week
2008-08-27 18:23:55 +00:00
Ed Maste d54d93ac7f Move CTASSERT of ether header sizes out of the header file and into
if_ethersubr.c.  CTASSERT is implemented using a dummy typedef, which if
used in a header file may conflict with another CTASSERT in a source file
using that header.

I'll make a note of this in CTASSERT's man page.

Approved by:	imp
2008-08-27 17:10:37 +00:00
Randall Stewart 4a16c2c883 - When we close a socket with pending assoc's that are still
shutting down, NULL out the socket pointer so we won't
  ever refer to a dead socket.

Obtained from: Neil Wilson
2008-08-27 13:13:35 +00:00
Warner Losh ff54eabd8a Remove opt_wi.h from module and fix typo in pccarddevs. 2008-08-27 05:43:46 +00:00
Warner Losh db4ba9a33e Remove opt_wi.h 2008-08-27 05:39:44 +00:00
Warner Losh dcf77c235d The APDL-325 is a Wireless LAN pcmcia adapter that sits inside some
Billion Access Points.  Fix wi(4) to recognise the adapter.

PR:		77913
Submitted by:	Daan Vreeken [PA4DAN]
MFC after:	3 days
2008-08-27 04:52:27 +00:00
Warner Losh cfd23b465a Some PC Cards don't have the proper IRQ mask in them. The standard
says that in such cases we can pick any interrupt.  One of these cards
is the LG11 Wireless LAN card.  I don't have one of these, but I do
know that this doesn't hurt any cards I've tried it with.

PR:		92070
Submitted by:	Helge Oldach
MFC after:	3 days
2008-08-27 04:36:27 +00:00
Warner Losh 505c6d6ae9 Add preliminary support for the OLICOM OC2231 and OC2232. This is the
first driver that does the configuration dance with CFE's.  There's
likely some additional configuration that's needed to get things
working completely...
2008-08-27 04:11:03 +00:00
Warner Losh 55b418d32b Minor tweaks to remove references to files that aren't present in the
current FreeBSD/mips source base.  Make phases consistent.  Remove
comment that's no longer relevant.
2008-08-27 01:41:32 +00:00
Warner Losh 2da4559fe0 Sort the network options alphabetically. They were mostly
alphabetical before.
2008-08-27 01:31:42 +00:00
Warner Losh 7af423b34d Remove left-over divot from wi driver cleanup Sam did a while ago.
Since Symbol Firmware support was removed, it makes little sense to
have an option to enable loading of Symbol Firmware.
2008-08-27 01:26:14 +00:00
Jung-uk Kim a2b12e3b23 Move empty filter handling to MI source.
MFC after:	3 days
2008-08-26 21:06:31 +00:00
John Baldwin 95f20c6568 Disable the code to generate a simple table from the status MSR by default.
This can be enabled by setting the 'hw.est.msr_info' tunable to 1.
2008-08-26 17:43:46 +00:00
Rafal Jaworowski 959aea56c1 Improve kernel stack handling on e500.
- Allocate thread0.td_kstack in pmap_bootstrap(), provide guard page
- Switch to thread0.td_kstack as soon as possible i.e. right after return
  from e500_init() and before mi_startup() happens
- Clean up temp stack area
- Other minor cosmetics in machdep.c

Obtained from:	Semihalf
2008-08-26 17:07:37 +00:00
Jung-uk Kim 18b6f05552 Revert the previous commit to fix buildworld for now.
We have constified 'struct bpf_insn *' for bpf_filter(9) and bpf_validate(9)
since r1.19 but they conflict with pcap.h from libpcap.
2008-08-26 16:12:49 +00:00
Matteo Riondato 7b87c1e36e Add geom_journal
PR:	conf/126829
MFC after:	2 days
2008-08-26 13:27:48 +00:00
Konstantin Belousov cbc158449b Implement WNOWAIT flag for wait4(2). It specifies that process whose status
is returned shall be kept in the waitable state.
Add WSTOPPED as an alias for WUNTRACED.

Submitted by:	Jukka Ukkonen <jau at iki fi>
PR:	standards/116221
MFC after:	2 weeks
2008-08-26 12:37:16 +00:00
Konstantin Belousov eaad109973 When calculating arguments to the interpreter for the shebang script
executed by fexecve(2), imgp->args->fname is NULL. Moreover, there is
no way to recover the path to the script being executed.
Do what some other U*ixes do unconditionally, namely supply /dev/fd/n
as the script path when called from fexecve(). Document requirement of
having fdescfs mounted as caveat.
2008-08-26 10:53:32 +00:00
Rafal Jaworowski 321e12c82e tsec: Refactor driver's structure.
Split the driver into the core functionality part (sys/dev/tsec/if_tsec.c) and
the bus attachment (sys/dev/tsec/if_tsec_ocp.c).

This lets better integrate and maintain the driver in other environments with
different attachment abstractions (there is at least one other FreeBSD port --
MPC83xx -- which uses this TSEC driver, but with different local bus model
i.e. some OF derivative). While there, clean up and fix minor cosmetics.

Obtained from:	Semihalf
2008-08-26 10:41:49 +00:00
Rafal Jaworowski 5432bd9f6a tsec: Improve and clean up callouts.
- eliminate the unused tsec_tick_ch callout
- adjust and fix the main tsec callout handling
- minor naming improvements

Obtained from:	Semihalf
2008-08-26 09:38:28 +00:00
Warner Losh e36dee2c86 MFp4: Sort a couple options alphabetically. 2008-08-26 07:28:27 +00:00
Jung-uk Kim 32688992ef Make sys/net/bpf_filter.c build cleanly on user land. 2008-08-26 00:09:26 +00:00
Jung-uk Kim f471e5690e Fix a typo in copyrights. 2008-08-25 20:43:13 +00:00
Jung-uk Kim 02d2b7bd0e Embed scratch memory in the filter structure.
MFC after:	3 days
2008-08-25 20:39:56 +00:00
John Baldwin cf22c63dd5 Resort a few accessor routines so that they are consistently grouped
with 'set_foo/get_foo' adjacent to each other.
2008-08-25 16:16:57 +00:00
John Baldwin 94bf3b9f69 Add more PCI IDs including those for ICH10.
PR:		kern/126736
Submitted by:	Olivier Smedts  olivier of gid0 org
MFC after:	1 week
2008-08-25 15:23:54 +00:00
Yoshihiro Takahashi fb7921a5f7 Add the uart for 2nd CCU support. 2008-08-25 14:52:50 +00:00
Yoshihiro Takahashi 81df65c311 Add the 2nd CCU and PnP devices support on pc98.
Reviewed by:	imp
Obtained from:	//depot/projects/uart with some fixes
2008-08-25 14:45:24 +00:00
Robert Watson 3f3978840e More fully audit fexecve(2) and its arguments.
Obtained from:	TrustedBSD Project
Sponsored by:	Google, Inc.
2008-08-25 13:50:01 +00:00
Doug Rabson 710668615a Rename RPC's 'struct pmap' to 'struct portmap' to avoid confusing it with
the other 'struct pmap'.

Pointed out by:	kmacy
MFC after:	2 weeks
2008-08-25 09:36:17 +00:00
Doug Rabson d9ab5c4abf Add a missing return statement in nlm4_unlock_msg_4_svc which prevented it
from returning a reply message in most cases. This in turn caused
interoperability problems with Mac OS X clients.

PR:		126561
Submitted by:	Richard.Conto at gmail.com
MFC after:	1 week
2008-08-25 09:30:27 +00:00
Julian Elischer 28a2d0c1e1 I think we can remove the conditionals for freebsd 2.0 now 2008-08-25 07:33:17 +00:00
Julian Elischer 5e5d5c6f17 another missed V_ 2008-08-25 06:09:32 +00:00
Julian Elischer 2c0d658fca Another missed V_ instance 2008-08-25 05:57:56 +00:00
Julian Elischer b53c8130e5 Another V_ forgotten 2008-08-25 05:49:16 +00:00
Julian Elischer 576c43c844 We left out V_static_len from ip_fw2.c
(also a whitespace diff that i'd rahter fix her ethan break in the
vimage branch.)
2008-08-25 05:38:18 +00:00
Julian Elischer 7a5ecde3f7 This instance of ifnet got forgotten. 2008-08-25 05:20:29 +00:00
Warner Losh 93b7e554c5 MFp4: Network Adapter is redundant. 2008-08-25 05:20:17 +00:00
Warner Losh 2e8082cc0c MFp4: necessary quirks to get 3c1 not working (still no interrupts) 2008-08-25 04:59:43 +00:00
Julian Elischer 1d89fc4ebe All opt_x.h includes go at the top of other includes. 2008-08-25 04:55:29 +00:00
Warner Losh b8feb2e53e Send the magic unlock packet the linux driver claims to have sniffed
to enable line control.

PR:		121184
Submitted by:	Andriy Gapon
2008-08-25 02:42:13 +00:00
Warner Losh cea93ce340 Greatly expand the devices listed as being supported. This list was
taken from PR/121184 which was mechanically generated from similar
lists in the Linux ipaq driver.  I then took the numbers we had in
usbdevs and filled in the right symbols and eliminated duplicates.

PR:		121184
2008-08-25 02:36:27 +00:00
Warner Losh 677461a8dd Sort the list of supported products alphabetically. 2008-08-25 02:06:26 +00:00
Julian Elischer e0306e8be7 Move some struct defs around. This is a prep step for Vimage.A
No real effect of this at this time.
2008-08-25 00:33:30 +00:00
Benjamin Close 34f004ce88 Correct detection of particular wpi cards which only support b/g
and fix the output to indicate b/g not a/g

Submitted by:	ischram at telenet.be
Reviewed by:	thompsa
Approved by:	sam (co-mentor)
MFC after:	1 month
2008-08-24 22:42:39 +00:00
Julian Elischer 457af16631 VIMAGE is a global option 2008-08-24 21:33:10 +00:00
Warner Losh 4cd8dc22eb Add uipaq. HTC smart phones use it, and it seems like a reasonable
thing to have laying around.
2008-08-24 21:27:01 +00:00
Robert Watson 5ae504055a Regenerate following r182123. 2008-08-24 21:23:08 +00:00
Robert Watson e484af13ed When MPSAFE ttys were merged, a new BSM audit event identifier was
allocated for posix_openpt(2).  Unfortunately, that identifier
conflicts with other events already allocated to other systems in
OpenBSM.  Assign a new globally unique identifier and conform
better to the AUE_ event naming scheme.

This is a stopgap until a new OpenBSM import is done with the
correct identifier, so we'll maintain this as a local diff in svn
until then.

Discussed with:	ed
Obtained from:	TrustedBSD Project
2008-08-24 21:20:35 +00:00
Marius Strobl 474dee38bf There's a race in kmem(4) between checking whether a page is resident
in the kernel and copying it out, causing a panic when faulting on a
nofault entry. Handle this case gracefully by letting the kernel copy
functions return EFAULT instead. As such this change addresses the
same problem as r154721 does for i386.

MFC after:	3 days
2008-08-24 20:53:36 +00:00
Warner Losh de8bfff6c9 MFp4:
Remove all the OtherBSD ifdefs.  They are very out of date at this
point.  OtherBSD doesn't use this file verbatim, and they don't have
FreeBSD ifdefs in their code.

Reviewed by:	bms@, joerg@
2008-08-24 20:40:00 +00:00
Christian S.J. Peron e451733718 Remove worrying printf warning on bootup when processing vnodes which
have NULL mount-points.  This is the case for special vnodes, such as the
one used in nameiinit() which is used for crossing mount points in lookup()
to avoid  lock ordering issues.

MFC after:	2 weeks
Discussed with:	rwatson, kib
2008-08-24 20:16:44 +00:00
Marius Strobl e560e52d1d MFamd64: r133413
In syscall, always make a copy of parameters from trapframe, this
becauses some syscalls using set_mcontext can sneakily change
parameters and later when those syscalls references parameters,
they will wrongly use register values in mcontext_t.

PR:		72998
MFC after:	3 days
2008-08-24 20:02:18 +00:00
Robert Watson e08f2b26f4 Use ERANGE instead of EOVERFLOW selected in r182059, this seems more
appropriate even if Solaris doesn't document it (E2BIG) or use it
(EOVERFLOW).

Submitted by:	nectar at apple dot com
Sponsored by:	Apple, Inc.
MFC after:	3 days
2008-08-24 19:55:10 +00:00
Ed Schouten 537de51435 Make syscons(4) use ttyv0 instead of consolectl as its primary window.
When I was hacking on uart(4) to make it work with the MPSAFE TTY layer,
I noticed there was a difference between the way syscons and uart work
with respect to consoles:

- The uart(4) driver sets cn_name to the corresponding ttyu%r node,
  which means init(8) (which opens /dev/console) will have its output
  redirected to /dev/ttyu%r. After /etc/rc is done, it can spawn a getty
  on that device node as well.

- Syscons used a little different approach. Apart from the /dev/ttyv%r
  nodes, it creates a /dev/consolectl node. This device node is used by
  moused and others to deliver their data, but for some reason it also
  acts as a TTY, which shares its stat structure with ttyv0. This device
  node is used as a console (run conscontrol).

There are a couple advantages of this approach:

- Because we use two different TTY's to represent the 0th syscons
  window, we allocate two sets of TTY buffers. Even if you don't use
  /dev/consolectl after the system has booted (systems that don't run
  moused), it seems the buffers are still allocated.

- We have to apply an evil hack to redirect input to /dev/consolectl.
  Because each window (stat) is associated not associated with one TTY,
  syscons solves this by redirecting all input to closed TTY's to
  consolectl.

  This means that opening /dev/ttyv0 while in single user mode will
  probably cause strange things to happen with respect to keyboard input
  redirection.

The first patch that I discussed with philip@ turned consolectl into a
symlink to ttyv0, but this was not a good idea, because in theory we
would want consolectl to be a simple device node, which contains all the
`privileged' ioctl()'s. Apart from that, it didn't work, because each
time /dev/ttyv0 got revoked, moused also lost its descriptor to deliver
input, which meant you had to plug out/in your mouse to make it work
again. This version just leaves the consolectl device the way it is. It
can still be used to write output to ttyv0, but it can no longer receive
any input.

In my opinion this patch is not a complete solution, but it's already a
step in the good direction. It would allow us to turn consolectl into a
special (non-TTY) device node in the far future. It shaves off 15 KB of
wasted TTY buffer space.

Discussed with:	philip
2008-08-24 19:50:57 +00:00
Konstantin Belousov f2228325de Put the relocked variable from the r182111 into the #ifdef QUOTA braces
to prevent warning about unused var on the !QUOTA kernels.

Reported by:	ed
MFC after:	1 week
2008-08-24 19:06:19 +00:00
Bjoern A. Zeeb ad27dca959 Make the kernel compile with SCTP and SCTP_DEBUG but
no INET6 defined.
2008-08-24 18:29:22 +00:00
Bjoern A. Zeeb e1e6bc8b42 Make lmc(4) compile without INET6 defined[1]. While here make it
compile if there is no INET defined.

Obtained from:	zec (via p4 vimage branch)[1]
MFC after:	3 months
2008-08-24 18:27:19 +00:00
Konstantin Belousov 689eae1d90 Revert the r167541: "Remove unneeded getinoquota() call in the
ufs_access()." The call to getinoquota in ufs_access() serves the
purpose of instantiating inode dquot from the vn_open(). Since quotas
are accounted only for the inodes with already attached dquot, removal
of the call prevented opened inodes from participation in the quota
calculations.

Since ufs_access() may be called with the vnode being only shared
locked, upgrade (and then downgrade) vnode lock if calling
getinoquota().

Reported by:	simon at optinet com
In collaboration with:	pho
MFC after:	1 week
2008-08-24 17:24:22 +00:00
Marius Strobl bdebc2daa5 Announce the speed of the PCI bus for informational purpose.
MFC after:	3 days
2008-08-24 16:22:04 +00:00
Ed Schouten dd63e2a189 Make sysmouse(4) use its own locks, instead of using Giant.
When I changed syscons(4) to work with the MPSAFE TTY code, I just
locked all device nodes down using the compatibility feature that allows
you to override the TTY's lock (Giant in this case). Upon closer
inspection, it seems sysmouse(4) only has two internal variables that
need locking: mouse_level and mouse_status.

I haven't done any performance benchmarks on this, though I think it
won't have any dramatic improvements on the system. It is good to get
rid of Giant here, because the third argument of tty_alloc() has only
been added to ease migration to MPSAFE TTY. It should not be used when
not needed.

While there, remove SC_MOUSE, which is a leftover from the MPSAFE TTY
import.
2008-08-24 15:20:44 +00:00
Marius Strobl c87ba3b18c The PCI specifications don't explain the details on how to calculate
the latency based on the Min_Gnt register so use the algorithm found
in OpenSolaris as they probably know how to interpret the value Sun
puts into these registers (previously, the latency calculated for
66MHz was most likely wrong) and for bridges additionally set up the
secondary latency register. Also set up the bridge control register
the way it's done in OpenSolaris. As the latency register don't apply
to PCI-Express and the bridge control setup wasn't tested on sun4v
(besides most likely not being needed), expand the #ifndef SUN4V
accordingly.

MFC after:	3 days
2008-08-24 15:05:46 +00:00
Bjoern A. Zeeb f0c042211b Make the checks for ptp interfaces in ifa_ifwithdstaddr() and
ifa_ifwithnet() look more similar by comparing the pointer to NULL
in both cases.

MFC after:	3 months
2008-08-24 11:03:43 +00:00
Warner Losh 5b4ae40039 MFp4 (my newcard tree):
ISACFGATTR_MULTI is unused.  Retire it, and a function that has no
side effects used to compute it.
2008-08-24 07:40:14 +00:00
Kip Macy 2be5c100cf Evidently the block device starts at 767.
MFC after:	1 month
2008-08-24 04:42:41 +00:00