Commit Graph

45752 Commits

Author SHA1 Message Date
Ruslan Ermilov
26f16ebeb1 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.
2004-03-25 08:46:27 +00:00
Bill Paul
52bfac6de0 - 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.)
2004-03-25 08:23:08 +00:00
Peter Wemm
fc900bcdd2 MFi386: correctly calculate the top-of-stack when a kthread is created
with a larger kernel stack.
2004-03-25 03:39:38 +00:00
Peter Wemm
946a5e675d 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.
2004-03-25 03:38:31 +00:00
David E. O'Brien
e6c2326d23 Add NTFS since many may want to dual-boot MS-Win64 w/FreeBSD. 2004-03-25 03:19:28 +00:00
David E. O'Brien
29906c8dfd Lets give -O2 kernels a try on sparc64.
Reviewed by:	kensmith
2004-03-25 00:02:49 +00:00
Alan Cox
2b63e7f397 Use uiomove_fromphys() instead of pmap_qenter() and pmap_qremove() in
proc_rwmem().
2004-03-24 23:35:04 +00:00
Ruslan Ermilov
a9b2cd0aa6 Properly reprogram the hardware when IFF_ALLMULTI flag is set. 2004-03-24 17:43:45 +00:00
Roman Kurakin
8b96678536 sppp (4) to netgraph (4) node. As always: I'l connect it to the
system after extra check.

Approved by:	imp (mentor)
Approved by:	julian (in general)
2004-03-24 17:24:01 +00:00
Warner Losh
9fc0327792 Conform to local file sytle and prefer (a && (b & flag)). 2004-03-24 16:49:37 +00:00
Julian Elischer
ba9c6c61b2 Don't duplicate a packet, just to throw it away when we discover the
duplicat hook is not connected.
2004-03-24 08:53:45 +00:00
Bill Paul
ee219b3e07 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.
2004-03-24 05:35:03 +00:00
Hidetoshi Shimokawa
a832f947f3 Fix a bug introduced in rev 1.33(mega API change).
Because xfer->send.payload is a pointer to the buffer, '&' shouldn't be there.

Submitted by: John Weisgerber <weisgerberj@gsilumonics.com>
PR: misc/64623
2004-03-24 01:29:08 +00:00
Thomas Moestl
eb01b42587 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>
2004-03-23 23:41:39 +00:00
Thomas Moestl
62b7be1be9 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>
2004-03-23 23:20:34 +00:00
Thomas Moestl
252cc8f6b2 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.

Additional testing:	kris
2004-03-23 23:12:02 +00:00
John Baldwin
fafb7a586b 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.

Tested by:	wilko, tisco, several others on alpha@
2004-03-23 22:28:16 +00:00
Bill Paul
7913049bf2 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.
2004-03-23 19:51:17 +00:00
Alan Cox
010b69bae2 Add an implementation of uiomove_fromphys() for PowerPC. This
implementation uses the direct virtual-to-physical mapping.

Discussed with:	grehan
2004-03-23 18:26:03 +00:00
Tim J. Robbins
ed0302e6a7 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.
2004-03-23 08:37:34 +00:00
David E. O'Brien
0d50bcb36b Change the !MPSAFE boot string to something that doesn't potentially
scare users that the kernel won't run on MP systems.
2004-03-23 01:58:09 +00:00
Alfred Perlstein
12e9993f65 Emit a traceback when witness_trace is set and witness_warn() is
called and triggers (typically caused by sleeping with a non-sleepable
lock).

Reviewed by: jhb
2004-03-23 00:32:27 +00:00
Bill Paul
150514c0eb Remove another case of grabbing Giant before doing a kthread_exit()
which is now no longer needed.
2004-03-22 22:46:22 +00:00
David E. O'Brien
f1c8692d0a 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.
2004-03-22 22:36:11 +00:00
Nate Lawson
e548abe75b Use the correct length for appending an extended irq resource. This may
have broken APIC routing.  This bug has been present since rev 1.33.
2004-03-22 20:39:20 +00:00
Nate Lawson
3dc52520c4 Shorten some printfs to fit better. No other functional changes. 2004-03-22 20:36:33 +00:00
Nate Lawson
3304735dd9 Whitespace and comment changes. No MD5 change to the object file. 2004-03-22 20:32:27 +00:00
Nate Lawson
bf4c71fd65 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.  :-)
2004-03-22 20:11:49 +00:00
Nate Lawson
9b41519c3e Bump FreeBSD version to indicate new bus_alloc_resource_any API. 2004-03-22 19:57:34 +00:00
Bill Paul
c5d019ec55 I'm a dumbass: the test in the MOD_SHUTDOWN case in ndis_modevent()
that checks to see if any devices are still in the devlist was reversed.
2004-03-22 18:34:37 +00:00
Bill Paul
3ccc038a0b 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...)
2004-03-22 18:00:39 +00:00
Robert Watson
bdae44a844 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.
2004-03-22 16:04:43 +00:00
David E. O'Brien
7676d865bd Use ' rather than ".
Submitted by:	ru
2004-03-22 15:45:17 +00:00
Robert Watson
17d5cb2d12 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.

gif_softc fields not locked down in this commit.
2004-03-22 15:43:14 +00:00
Robert Watson
523ebc4efe 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.
2004-03-22 14:24:26 +00:00
Yoshihiro Takahashi
77890ec33d MFi386: revision 1.480. 2004-03-22 13:37:11 +00:00
Paul Saab
2eada6bc8e Remove some netbsd debug code that crept into rev 1.116 2004-03-22 10:17:40 +00:00
Alan Cox
1c5043680e 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.
2004-03-22 08:08:25 +00:00
Robert Watson
3280e5dc69 Rename 'ddpcb' variable to 'ddpcb_list' to better distinguish it from
'struct ddpcb'.
2004-03-22 04:54:36 +00:00
Robert Watson
4ddd6a81e0 Rename 'at_ifaddr' list to 'at_ifaddr_list' so that the variable is
more easily mechanically distinguished from 'struct at_ifaddr'.
2004-03-22 04:50:36 +00:00
Robert Watson
f2aa178725 Compare pointers with NULL rather than 0, or treating them as boolans in
if statements.

at_rmx gets a $FreeBSD$ out of the deal also (this code appears to be
unused).
2004-03-22 03:57:01 +00:00
Matthew N. Dodd
fd5bc0548f MAC addresses are 8 bits in ARCNET. Adjust bcopy(). 2004-03-22 03:52:51 +00:00
Robert Watson
e0af0ab104 Also modify ddp_input.c with the following changes previously applied
to other files in netatalk:

  Log:
  Since I have my hands all over netatalk adding locking and restructuring
  it, cinch the file's style closer to style(9) with regard to parenthesis:

    s/( /(/g
    s/ )/)/g
    s/return(/return (/g
    s/return 0/return (0)/
    s/return 1/return (1)/
2004-03-22 03:48:31 +00:00
Robert Watson
b8e3da4a83 Since I have my hands all over netatalk adding locking and restructuring
it, cinch the file's style closer to style(9) with regard to parenthesis:

  s/( /(/g
  s/ )/)/g
  s/return(/return (/g
  s/return 0/return (0)/
  s/return 1/return (1)/
2004-03-22 03:24:10 +00:00
Julian Elischer
0598ef01ee Dont count bytes being sent to a disconnected hook.
MFC after:	3 days
2004-03-22 01:15:28 +00:00
Bill Paul
e34e2a168a The Intel 2200BG NDIS driver does an alloca() of about 5000 bytes
when it associates with a net. Because FreeBSD's kstack size is only
2 pages by default, this blows the stack and causes a double fault.

To deal with this, we now create all our kthreads with 8 stack pages.
Also, we now run all timer callouts in the ndis swi thread (since
they would otherwise run in the clock ithread, whose stack is too
small). It happens that the alloca() in this case was occuring within
the interrupt handler, which was already running in the ndis swi
thread, but I want to deal with the callouts too just to be extra
safe.

NOTE: this will only work if you update vm_machdep.c with the change
I just committed. If you don't include this fix, setting the number
of stack pages with kthread_create() has essentially no effect.
2004-03-22 00:41:41 +00:00
Bill Paul
6041f1a522 The kthread_create() API is supposed to allow you to create threads
with more than the normal amount of stack pages, however the stack
pointer always wound up being initialized using KSTACK_PAGES. It
should be using td->td_kstack_pages instead. This means that although
the vm subsystem would give you all the stack pages you asked for,
%esp would always be initialized as if you had just 2 pages, and
the rest would go to waste.

I wanted to use the 'give me more stack pages' feature of kthread_create()
because the Intel 2200BG NDIS driver does an alloca() of about 5000 bytes,
which wrecks the stack with the default 2 page size, and I was baffled
that no matter how much code I shoved into thread contexts with
allegedly larger stacks, the thing would still crash unless I changed
KSTACK_PAGES.

Note: this bug is present in _ALL_ arches at this point. Peter has
promised to merge this fix into all of them.
2004-03-22 00:28:38 +00:00
Alan Cox
00cfafd7db Add an implementation of uiomove_fromphys() for i386. This implementation
uses sf_buf_alloc() and sf_buf_free() to create and destroy the necessary
ephemeral mappings.
2004-03-21 20:28:36 +00:00
Bill Paul
67aa83405a Make if_ndis_pci.c and if_ndis_pccard.c use bus_alloc_resource() again
instead of bus_alloc_resource_any() to restore source compatibility
with 5.2-REL and 5.2.1-REL systems. bus_alloc_resource_any() doesn't
really do anything besides hide some of bus_alloc_resource()'s arguments
from us, and in my opinion this isn't worth breaking backwards
compatibility for people who want to use the NDISulator code on 5.2.x.
2004-03-21 19:56:41 +00:00
David E. O'Brien
276233b632 Quote NM in case you need to force it to something with args.
Submitted by:	jmallett
2004-03-21 19:06:54 +00:00