wpaul [Thu, 25 Mar 2004 18:31:52 +0000 (18:31 +0000)]
- In subr_ndis.c:ndis_init_event(), initialize events as notification
objects rather than synchronization objects. When a sync object is
signaled, only the first thread waiting on it is woken up, and then
it's automatically reset to the not-signaled state. When a
notification object is signaled, all threads waiting on it will
be woken up, and it remains in the signaled state until someone
resets it manually. We want the latter behavior for NDIS events.
- In kern_ndis.c:ndis_convert_res(), we have to create a temporary
copy of the list returned by BUS_GET_RESOURCE_LIST(). When the PCI
bus code probes resources for a given device, it enters them into
a singly linked list, head first. The result is that traversing
this list gives you the resources in reverse order. This means when
we create the Windows resource list, it will be in reverse order too.
Unfortunately, this can hose drivers for devices with multiple I/O
ranges of the same type, like, say, two memory mapped I/O regions (one
for registers, one to map the NVRAM/bootrom/whatever). Some drivers
test the range size to figure out which region is which, but others
just assume that the resources will be listed in ascending order from
lowest numbered BAR to highest. Reversing the order means such drivers
will choose the wrong resource as their I/O register range.
Since we can't traverse the resource SLIST backwards, we have to
make a temporary copy of the list in the right order and then build
the Windows resource list from that. I suppose we could just fix
the PCI bus code to use a TAILQ instead, but then I'd have to track
down all the consumers of the BUS_GET_RESOURCE_LIST() and fix them
too.
ru [Thu, 25 Mar 2004 08:46:27 +0000 (08:46 +0000)]
Untangle IP multicast routing interaction with delayed payload checksums.
Compute the payload checksum for a locally originated IP multicast where
God intended, in ip_mloopback(), rather than doing it in ip_output() and
only when multicast router is active. This is more correct as we do not
fool ip_input() that the packet has the correct payload checksum when in
fact it does not (when multicast router is inactive). This is also more
efficient if we don't join the multicast group we send to, thus allowing
the hardware to checksum the payload.
wpaul [Thu, 25 Mar 2004 08:23:08 +0000 (08:23 +0000)]
- In kern_ndis.c, implement ndis_unsched(), the complement to ndis_sched(),
which pulls a job off a thread work queue (assuming it hasn't run yet).
This is needed for KeRemoveQueueDpc().
- In subr_ntoskrnl.c, implement KeInsertQueueDpc() and KeRemoveQueueDpc(),
to go with KeInitializeDpc() to round out the API. Also change the
KeTimer implementation to use this API instead of the private
timer callout scheduler. Functionality of the timer API remains
unchanged, but we get a couple new Windows kernel API routines and
more closely imitate the way thing works in Windows. (As of yet
I haven't encountered any drivers that use KeInsertQueueDpc() or
KeRemoveQueueDpc(), but it doesn't hurt to have them.)
peter [Thu, 25 Mar 2004 03:38:31 +0000 (03:38 +0000)]
Run print_AMD_features() for both AuthenticAMD and GenuineIntel cpus.
Report the %ecx bits in cpuid function 1. This is a hack.
When reporting AMD Features, only mask off the common bits. Otherwise
the SEP bit masks off SYSCALL etc in the report.
jhb [Wed, 24 Mar 2004 17:51:54 +0000 (17:51 +0000)]
- Update for the new interrupt code on i386 meaning that SMP kernels can
now run on UP machines, options APIC_IO is now spelled device apic, and
HT CPUs are now enabled by default.
- Add a 'I386 NOTES' section header to the i386-specific paragraphs.
Someone with more mdoc fu can suggest a better name if needed.
se [Wed, 24 Mar 2004 10:25:24 +0000 (10:25 +0000)]
Bring man page back in shape. Many option descriptions lacked the
option name and paramaters they apply to and there was a mix of
formatting methods and styles.
I'm not sure that the description of "nfs_retransmit_counter" is
correct, but it does now at least match what's in -STABLE.
wpaul [Wed, 24 Mar 2004 05:35:03 +0000 (05:35 +0000)]
The ndis_wlan_bssid_ex structure we retrieve in ndis_get_assoc() is
variable length, so we should not be trying to copy it into a fixed
length buffer, especially one on the stack. malloc() a buffer of the
right size and return a pointer to that instead.
Fixes a crash I discovered when testing whe a Cisco AP in infrastructure
mode, which returns several information elements that make the
ndis_wlan_bssid_ex structure larger than expected.
tmm [Tue, 23 Mar 2004 23:41:39 +0000 (23:41 +0000)]
Correct the boundary parameter to the bus_dma_tag_create() calls (it was
(1 << 24) - 2 instead of 1 << 24, which it was obviously intended to
be). This fixes SBus isp(4)s on sparc64 machines.
Report and testing: Marius Strobl <marius@alchemy.franken.de>
brooks [Tue, 23 Mar 2004 23:22:35 +0000 (23:22 +0000)]
Overhaul the /etc/rc.d/diskless script by splitting it out into
hostname, resolve, tmp, and var scripts. The latter three are new and
were repo copied. These scripts no longer depend on being booted with
and NFS root instead attempt to automaticly create mfs /tmp and /var
volumes if the they are not writable. This behavior can be overridden
in /etc/rc.conf.
tmm [Tue, 23 Mar 2004 23:20:34 +0000 (23:20 +0000)]
Correct the termination condition of the DVMA pruning loop in
iommu_dvma_vallocseg(), which I botched in r1.32. This bug could
cause an endless loop when a map was loaded and DVMA was scarce,
or that map had a stringent alignment or boundary.
Report and additional testing: Marius Strobl <marius@alchemy.franken.de>
tmm [Tue, 23 Mar 2004 23:12:02 +0000 (23:12 +0000)]
Intitialize the frame pointer and return pc of a new process created
in cpu_fork(). This prevents the stack tracer from running past the
end of the stack (only the pc is checked in that case), which became
fatal when db_print_backtrace() was introduced and called outside
of ddb.
mlaier [Tue, 23 Mar 2004 22:30:15 +0000 (22:30 +0000)]
Add rc.d script for pf(4) (more to come once pflogd(8) works as well).
Update defaults and write some lines for rc.conf(5) also.
Mostly dup'ed from ipf
jhb [Tue, 23 Mar 2004 22:28:16 +0000 (22:28 +0000)]
Enable interrupt preemption on Alpha. Previously, flipping this switch on
caused hangs on SMP systems under load. My theory was that an interrupted
thread was migrating and returning to PAL on a different CPU and that that
caused the hangs. To prevent this, I used the recently added sched_pin()
API to pin the interrupted thread to the CPU that received the interrupt
across ithread_schedule() to prevent migration. This seems to have fixed
the hangs based on tests by several folks on the alpha@ list.
wpaul [Tue, 23 Mar 2004 19:51:17 +0000 (19:51 +0000)]
Recently I realized that the ADMtek 8211 driver wasn't working correctly
(NIC would claim to establish a link with an ad-hoc net but it couldn't
send/receive packets). It turns out that every time the checkforhang
handler was called by ndis_ticktask(), the driver would generate a new
media connect event. The NDIS spec says the checkforhang handler is
called "approximately every 2 seconds" but using exactly 2 seconds seems
too fast. Using 3 seconds makes it happy again, so we'll go with that
for now.
dwmalone [Tue, 23 Mar 2004 12:37:02 +0000 (12:37 +0000)]
Add support for decoding Timespec, Timeval, Itimerval, Pollfd,
Fd_set and Sigaction structures. Use these for printing the arguments
to sigaction(), nanosleep(), select(), poll(), gettimeofday(),
clock_gettime(), recvfrom(), getitimer() and setitimer().
This is based on Dan's patch from the PR but I've hacked it for
style and some other issues. While Dan has checked this patch, any
goofs are probably my fault.
(The PR also contains support for the dual return values of pipe().
These will follow once I've ported that support to platforms other
than i386.)
PR: 52190
Submitted by: Dan Nelson <dnelson@allantgroup.com>
tjr [Tue, 23 Mar 2004 08:37:34 +0000 (08:37 +0000)]
Do not copy vm_exitingcnt to the new vmspace in vmspace_exec(). Copying
it led to impossibly high values in the new vmspace, causing it to never
drop to 0 and be freed.
obrien [Mon, 22 Mar 2004 22:36:11 +0000 (22:36 +0000)]
Rather than display which interrupts are MPSAFE, display those that aren't.
This way we can take stock of the work to be done. boot -v will note those
interrupts that are MPSAFE.
njl [Mon, 22 Mar 2004 20:11:49 +0000 (20:11 +0000)]
Revert 1.22. Go back to "FreeBSD" as our _OS value. Since we now support
_OSI, we can claim compatibility with MS products without claiming to BE
one. :-)
wpaul [Mon, 22 Mar 2004 18:00:39 +0000 (18:00 +0000)]
if_ndis.c no longer depends on either pci or pccard. Also, add an
extra entry for if_ndis_pci.c that depends on cardbus, just to cover
all the bases. (I don't think you can have cardbus without PCI, but
just in case...)
rwatson [Mon, 22 Mar 2004 16:37:32 +0000 (16:37 +0000)]
Commit a message to UPDATING indicating that during network stack locking
merges, debug.mpsafenet will no longer be safe to use, and that it should
be turned off (which is the default). I will commit a follow-up message
to UPDATING (and post to freebsd-current) when it's safe to turn it on,
with a description of under what circumstances it is safe to use.
des [Mon, 22 Mar 2004 16:35:35 +0000 (16:35 +0000)]
Set start_cmd and stop_cmd correctly so the code that extracts the names
of the ntp servers from ntp.conf is actually used. Remove pidfile since
ntpdate is not a daemon.
rwatson [Mon, 22 Mar 2004 16:04:43 +0000 (16:04 +0000)]
Lock down global variables in if_gre:
- Add gre_mtx to protect global softc list.
- Hold gre_mtx over various list operations (insert, delete).
- Centralize if_gre interface teardown in gre_destroy(), and call this
from modevent unload and gre_clone_destroy().
- Export gre_mtx to ip_gre.c, which walks the gre list to look up gre
interfaces during encapsulation. Add a wonking comment on how we need
some sort of drain/reference count mechanism to keep gre references
alive while in use and simultaneous destroy.
This commit does not lockdown softc data, which follows in a future
commit.
rwatson [Mon, 22 Mar 2004 15:43:14 +0000 (15:43 +0000)]
Lock down global variables in if_gif:
- Add gif_mtx, which protects globals.
- Hold gif_mtx around manipulation of gif_softc_list.
- Abstract gif destruction code into gif_destroy(), which tears down
a softc after it's been removed from the global list by either module
unload or clone destroy.
- Lock gif_called, even though we know gif_called is broken with reentrant
network processing.
- Document an event ordering problem in gif_set_tunnel() that will need
to be fixed.
ache [Mon, 22 Mar 2004 14:44:00 +0000 (14:44 +0000)]
Forced commit note to explain why NO_POSIX_COMPAT was removed with upgrade.
NO_POSIX_COMPAT was added in 1996 as attempt to resolve POSIX regex
functions conflict for fixit floppy (they are both in libc and libgnuregex)
The way it done (simple excluding POSIX functions from compile) breaks
legitimate case when, say, some program from ports calls both POSIX
and GNU regex functions (it will call POSIX ones from libc and fails,
because header <regex.h> is from GNU).
Now our fixit floppy (and other crunched floppies, as I check) not
use libgnuregex, so the hack can be removed.
rwatson [Mon, 22 Mar 2004 14:24:26 +0000 (14:24 +0000)]
Move "called", a static function variable used to detect recursive
processing with gif interfaces, to a global variable named "gif_called".
Add an annotation that this approach will not work with a reentrant
network stack, and that we should instead use packet tags to detect
excessive recursive processing.
dwmalone [Mon, 22 Mar 2004 12:01:23 +0000 (12:01 +0000)]
On startup, warn if inetd's config file doesn't exist. This isn't
exactly the same as patch from the PR, which also exited if the
config file was missing. I didn't use Jeff's patch because I was
worried that some people might start inetd, create the config file
and then HUP inetd.
PR: 60806
Submitted by: Jeff Ito <jeffi@rcn.com>
MFC after: 2 weeks
alc [Mon, 22 Mar 2004 08:08:25 +0000 (08:08 +0000)]
Add an implementation of uiomove_fromphys() to sparc64. This
implementation could be characterized as a hybrid of the amd64 and i386
implementations. Specifically, the direct virtual-to-physical mapping is
used if possible and sf_buf_alloc() is used if the direct map cannot.