Commit Graph

52676 Commits

Author SHA1 Message Date
ru
f97d0ba600 Pull up to ETHER_HDR_LEN before passing an mbuf to ether_input().
The bug was found by running ng_dummy(4) node configured with a
delay, in front of the ng_eiface(4) node.
2005-03-01 19:39:57 +00:00
jhb
407a285a6f Remove linux_emul_find() and the CHECKALT*() macros as they are no longer
used.
2005-03-01 17:57:45 +00:00
ps
90b32391ca Use kern_kevent instead of the stackgap for 32bit syscall wrapping.
Submitted by:	jhb
Tested on:	amd64
2005-03-01 17:45:55 +00:00
ps
d3b5771598 regen 2005-03-01 17:44:34 +00:00
ps
4e3e9f019c Change the prototype of kevent to remove the const from the changelist.
Reviewed by:	jhb
2005-03-01 17:43:08 +00:00
wpaul
88eacaa717 In windrv_load(), I was allocating the driver object using
malloc(sizeof(device_object), ...) by mistake. Correct this, and
rename "dobj" to "drv" to make it a bit clearer what this variable
is supposed to be.

Spotted by: Mikore Li at Sun dot comnospamplzkthx
2005-03-01 17:21:25 +00:00
ps
3477112899 Ooops. I will compile test before committing. The stackgap version
of kevent32 will be going away shortly, so this is temporary until
I commit the non-stackgap version.
2005-03-01 13:50:57 +00:00
glebius
1f4abe7c9a Add more locking when reading/writing to carp softc. When carp softc is
attached to a parent interface we use its mutex to lock the softc. This
means that in several places like carp_ioctl() we lock softc conditionaly.
This should be redesigned.

To avoid LORs when MII announces us a link state change, we schedule
a quick callout and call carp_carpdev_state_locked() from it.

Initialize callouts using NET_CALLOUT_MPSAFE.

Sponsored by:	Rambler
Reviewed by:	mlaier
2005-03-01 13:14:33 +00:00
glebius
1f62a67ad7 - Add carp_mtx. Use it to protect list of all carp interfaces.
- In carp_send_ad_all() walk through list of all carp interfaces
  instead of walking through list of all interfaces.

Sponsored by:	Rambler
Reviewed by:	mlaier
2005-03-01 12:36:07 +00:00
phk
42879cd3ce Avoid a couple of mutex operations in the process exit path for the
common case where procfs have never been mounted.

OK'ed by:	des
2005-03-01 12:20:49 +00:00
glebius
2df73116df Use NET_CALLOUT_MPSAFE macro. 2005-03-01 12:01:17 +00:00
glebius
1a5cca00eb Add macro NET_CALLOUT_MPSAFE, which should be used when initializing
network related callouts.

Reviewed by:	rwatson
2005-03-01 11:54:46 +00:00
glebius
bf0eae5562 Replace NG_PARSE_APPEND() macro with ng_parse_append() function. Check
its return value and free resources if function returns error. Plug
several memory leaks with this change.

Submitted by:	archie
Found by:	Coverity Prevent analysis tool
2005-03-01 11:31:06 +00:00
glebius
ea3bf9bbdd Revert change to struct ifnet. Use ifnet pointer in softc. Embedding
ifnet into smth will soon be removed.

Requested by:	brooks
2005-03-01 10:59:14 +00:00
glebius
d86b1595dd Remove debugging printf.
Reviewed by:	mlaier
2005-03-01 09:31:36 +00:00
imp
6ca1ed35db Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in
preference to some random negative number to allow other drivers a
bite at the apple.
2005-03-01 08:58:06 +00:00
rwatson
cccc27e99a When mac_check_system_acct() fails, make sure to unlock as well as close
the vnode.

Pointed out by:	jeff
2005-03-01 08:56:13 +00:00
sobomax
44978948ef Merge from NetBSD.
o usb_subr.c, add delta 1.119:

  Move usb_get_string() and make it public.

o usbdi.c, bring on par with 1.106, this includes:

  - Make an iterator abstraction for looping through all descriptors.

  - Whine about not being able to figure out default language if we are debugging.

  - Move usb_get_string() and make it public.

o usbdi.h, bring on par with 1.64, this includes:

  - Make an iterator abstraction for looping through all descriptors.

  - Move usb_get_string() and make it public.

o usbdi_util.c, bring on par with 1.42, this includes:

  - Add usbd_get_protocol().

  - Use NULL instead of 0.

  - Fix (mostly harmless) typo.

  - Move utility routine from uirda.c to usbdi_util.c.

o usbdi_util.h, bring on par with 1.31, this includes:

  - Add usbd_get_protocol().

  - Move utility routine from uirda.c to usbdi_util.c.

MFC after:	3 days
2005-03-01 08:01:22 +00:00
grehan
98882623fa Catch up with "physical memory" sysctl change.
(MFi386: rev 1.608)
2005-03-01 07:59:24 +00:00
imp
ca5e477ca2 Use BUS_PROBE_DEFAULT in preference to 0. Also for vx, return
BUS_PROBE_LOW_PRIORITY in stead of ifdef for devices that xl and vx
both support so that xl will snarf them on up.
2005-03-01 07:50:12 +00:00
jeff
bdb2a76365 - Fix anoter dyslexic moment; an atomic_set_int should've become ACTIVESET,
not ACTIVECLEAR.

Submitted by:	iedowse
2005-03-01 07:38:45 +00:00
sobomax
6320d710d9 Sync with 1.9 from NetBSD, this includes:
o Add Ethernet descriptor.

o Use attribute packed for on-the-wire data structures.

MFC after:	3 days
2005-03-01 06:35:04 +00:00
ps
7f5f318c48 Correct the freebsd32_kevent prototype. 2005-03-01 06:32:53 +00:00
alc
f12d22f480 Use the kernel pmap's lock to guarantee that only one thread at a time is
using either pmap_temp_map_1 or pmap_temp_map_2.

Tested by: kris@
2005-03-01 05:06:52 +00:00
obrien
0e0b73fb27 Catch up with the "physical memory" sysctl change.
(MFi386: rev 1.608)
2005-03-01 04:18:32 +00:00
peter
f179ab15eb MFi386: Sync whitespace and an abbreviation 2005-02-28 23:39:58 +00:00
peter
52cccf7798 MFi386: Update alc's copyright notice 2005-02-28 23:38:15 +00:00
peter
7e1c228b9f MFi386: Bring over John's local apic timer code 2005-02-28 23:37:35 +00:00
wes
881fdd1aea Add a sysctl that records the amount of physical memory in the machine.
Submitted by:	Nicko Dehaine <nicko@stbernard.com>
MFC after:	1 day
2005-02-28 21:42:56 +00:00
iedowse
d89679b3ed Save and restore the VGA state across a suspend-resume cycle. This
is particularly useful when VESA is available (either `options VESA'
or load the vesa module), as BIOSes in some notebooks may correctly
save and restore LCD panel settings using VESA in cases where calling
the video BIOS POST is not effective. On some systems it may also
be necessary to set the hw.acpi.reset_video sysctl to 0.
2005-02-28 21:06:14 +00:00
iedowse
e1e12e9266 Add a missing bcopy() to make saving the VESA state actually work.
Also save the DAC state, increase the maximum save state size from
4k to 8k, and refuse to save the VESA state if the BIOS reports it
is larger than the maximum size we can handle.

It doesn't appear that anything currently uses this code, but it
turns out to be capable of restoring some notebook displays to a
working state after a suspend-resume cycle.
2005-02-28 20:40:44 +00:00
jhb
2a1aef8db3 Define the _mtx_assert() function prototype as well as the MA_* constants
if either INVARIANTS or INVARIANT_SUPPORT is defined so that kernel modules
that want to use mtx_assert() only need to define INVARIANTS.

MFC after:	1 week
2005-02-28 19:26:16 +00:00
wpaul
39e96588cc Use 0 instead if NULL for vm_offset_t argument to windrv_lookup() to
silence compiler warnings.
2005-02-28 16:47:54 +00:00
yar
d792578421 Support running carp(4) over a vlan(4) parent interface.
Encouraged by:	glebius
2005-02-28 16:19:11 +00:00
rwatson
6ae9352b09 In bpf_setf(), protect against races between multiple user threads
attempting to change the BPF filter on a BPF descriptor at the same
time: retrieve the old filter pointer under the same locked region
as setting the new pointer.

MFC after:	3 days
2005-02-28 14:04:09 +00:00
phk
ba21b23c12 Add missing () 2005-02-28 13:49:06 +00:00
rwatson
3cc07fe4d6 Update a comment describing bpf_iflist to indicate that the BPF interface
structures correspond to specific link layers, so the same network
interface may appear more than once.

MFC after:	3 days
2005-02-28 12:35:52 +00:00
glebius
3bad63fb1d Remove unused field from carp softc.
OK'ed by:	mcbride@OpenBSD
2005-02-28 11:57:03 +00:00
glebius
b190483209 Fix tcpdump(8) on carp(4) interface:
- Use our loop DLT type, not OpenBSD. [1]
- The fields that are converted to network byte order are not 32-bit
  fields but 16-bit fields, so htons should be used in htonl. [1]
- Secondly, ip_input changes ip->ip_len into its value without
  the ip-header length. So, restore the length to make bpf happy. [1]
- Use bpf_mtap2(), use temporary af1, since bpf_mtap2 doesn't
  understand uint8_t af identifier.

Submitted by:	Frank Volf [1]
2005-02-28 11:54:36 +00:00
nyan
e8f47d5fa9 MFi386: revisions 1.1186 and 1187
- Connect "options MP_WATCHDOG" to the LINT builds.
  - Spell "options" correctly as "options ".
2005-02-28 11:51:18 +00:00
grehan
2773bd509b Catch the case where the idle loop is entered with interrupts disabled,
causing a hard hang.
2005-02-28 09:49:00 +00:00
pjd
c471385d83 Typo. 2005-02-28 08:55:53 +00:00
grehan
78aa487988 - switch pcpu to a struct declaration ala amd64. It may be more efficient to
cache-align this struct, but that's a topic for a far-in-the-future
  commit.
- eliminate commented-out reference to a non-existent pcpu field.
2005-02-28 08:47:51 +00:00
grehan
ef9c4cef54 Correctly set kernelname for kern.bootfile sysctl
Noticed by:	gad
Code stolen from: sparc64
2005-02-28 07:14:13 +00:00
njl
60fa913bc3 Protect against multiple includes and use _KERNEL to protect the PCI fns. 2005-02-28 05:39:34 +00:00
njl
de6e7501a4 Bump FreeBSD version for change to install acpica includes in /usr/include. 2005-02-28 05:28:29 +00:00
yongari
865263b0b0 Add missing va_end() in fdc_cmd.
0 -> NULL in arguments of fdc_sense_int().

Reminded by:	joerg
2005-02-28 05:14:45 +00:00
imp
7642aaf239 There were two calls to cardbus_do_cis when cardbus_do_cis changed,
yet I only changed one of them.  So when we loaded drivers, we'd fail
to allocate resources correct.

This pointed out that we were doing the wrong thing when we failed to
attach a child.  We released all the resources and almost deleted the
child.  Instead, we should keep the resources allocated so when/if a
driver is loaded, we can go w/o having to allocate them.  We use
pci_cfg_save/restore to restore the BARs with these resources.

This seems to fix the problems that we were seeing that I thought
might have magically gone away in the last revision of cardbus.c (but
really didn't).

Noticed by: avatar (nicely done!)
2005-02-28 01:27:24 +00:00
imp
5c73f481a5 Expose pci_cfg_safe/restore for subclasses of pci to use. 2005-02-28 01:14:15 +00:00
obrien
f7e7502841 Spell "options" correctly as "options ". 2005-02-28 00:58:06 +00:00