Commit Graph

84814 Commits

Author SHA1 Message Date
dyoung
2d1d707101 Plug memory leak. 2006-11-13 05:48:00 +00:00
dyoung
f6957fedf7 Cosmetic: join lines. 2006-11-13 05:44:37 +00:00
dyoung
a25eaede91 Add a source-address selection policy mechanism to the kernel.
Also, add ioctls SIOCGIFADDRPREF/SIOCSIFADDRPREF to get/set preference
numbers for addresses.  Make ifconfig(8) set/display preference
numbers.

To activate source-address selection policies in your kernel, add
'options IPSELSRC' to your kernel configuration.

Miscellaneous changes in support of source-address selection:

        1 Factor out some common code, producing rt_replace_ifa().

        2 Abbreviate a for-loop with TAILQ_FOREACH().

        3 Add the predicates on IPv4 addresses IN_LINKLOCAL() and
          IN_PRIVATE(), that are true for link-local unicast
          (169.254/16) and RFC1918 private addresses, respectively.
          Add the predicate IN_ANY_LOCAL() that is true for link-local
          unicast and multicast.

        4 Add IPv4-specific interface attach/detach routines,
          in_domifattach and in_domifdetach, which build #ifdef
          IPSELSRC.

See in_getifa(9) for a more thorough description of source-address
selection policy.
2006-11-13 05:13:38 +00:00
dyoung
075fd7d1e9 Stop using typeof() in the bit-twiddling macros, per yamt@'s
suggestion.  This change requires that I use the __PRIuBITS format
string in atw and rtw, so do that.
2006-11-13 03:35:59 +00:00
dyoung
e3361bb265 Add strsep(3) to libkern.
To avoid code duplication, move strsep.c to the kernel/userland
common files.

Soon I will commit source-address selection (options IPSELSRC).
It will use strsep(3).
2006-11-13 03:26:43 +00:00
christos
b7cb52a381 for pt_syscall, send a signal to our parent, not out grandparent. Noted by
mrg and ad.
2006-11-13 02:52:08 +00:00
dyoung
fabb7d3379 Improve the tags target for i386:
Update the Atheros HAL directories.

	Don't compute tags for nonexistent assembly-language sources
	in sys/arch/i386/isa/.

	Don't echo the rm -f step.
2006-11-12 22:44:00 +00:00
bouyer
df1600e329 Properly detect if BAR5 is IO or MEM type; avoid a message about not being
able to map the BAR on boot (note that it's just cosmetic, the registers were
mapped anyway). Tested by paul at whooppee.com; thanks !
2006-11-12 22:42:20 +00:00
yamt
ec585a4e4d protect bt_poolcache by splvm because it's shared among all arenas
including ones which can be used in interrupt context.
PR/35042 from Manuel Bouyer.
2006-11-12 22:28:17 +00:00
plunky
57c0199dcf Tidy away wsmouse_input() abstractions and update
documentation to include the W direction.
2006-11-12 19:00:42 +00:00
tsutsui
d990bcf038 Replace RTK_ETHER_ALIGN with RE_ETHER_ALIGN, which I missed.
Pointed out by dieter roelants in PR kern/35041.
2006-11-12 15:12:02 +00:00
tsutsui
26a4066f11 Remove an extra semicolon. 2006-11-12 12:02:19 +00:00
jmmv
d4e479987d Regen. Per bernd@'s instructions. 2006-11-12 09:14:32 +00:00
itohy
96de608110 Oops, I didn't notice the file had been updated and overwrote
the changes in 1.93....
Rescue the changes in 1.93 (IPv4 checksum fix).
2006-11-12 07:16:14 +00:00
itohy
3b284b614d - In some rare cases, both Tx Complete and Dn Complete bits are set.
I'm not sure what it exactly means, but at least, the packet in question
  is reloaded in ex_txstat() and should not handle the Dn Complete event
  at the moment ---  it should be served on later interrupt.

- Reload packet on collision, too.
2006-11-12 07:07:39 +00:00
tsutsui
0d397b62fe - merge re_encap() into re_start() so that we can handle each error case
more flexible
- account a number of free txq and use it to see if packets are queued or sent
- assume free TX descriptors are not owned by the chip in re_start() and
  panic if there is any inconsistency on them #ifdef DIAGNOSTIC case.
- replace a magic number (reserved TX descs?) with macro
2006-11-12 03:09:37 +00:00
tsutsui
cad156cdf4 Add a workaround for a hardware ip4csum-tx bug which would sometimes put
wrong IPv4 checksum on sending 21 or 22 byte IP packets.

See discussion on tech-kern and tech-net for details:
http://mail-index.netbsd.org/tech-kern/2006/11/04/0004.html
2006-11-12 02:49:46 +00:00
he
cb4c2207ba Add a netbsd-sd0 kernel, so that the corresponding gzimg can be built. 2006-11-11 23:50:54 +00:00
jld
bd403112d6 Under Xen2, timestamp updates should happen every 10ms, and a timer
event should be raised every 10ms if we're runnable.  Unfortunately,
there seems to be an intermittent bug in the hypervisor such that,
for about 1<<32 ns (~4.3s) after it manifests, every running domain
continues to run but not get its timer events and new timestamps (nor
is it preempted in favor of other domains on that CPU).  This can cause
strange behavior from our timekeeping; for example, hardclock() is never
called during this interval.

So here's a workaround: if timestamp is allegedly up to date but is more
than 40ms old (this is semi-arbitrary), the domain sets its timer to a
time in the past, which causes it to become immediately pending, and also
results in the publication of a new timestamp.
2006-11-11 23:33:12 +00:00
christos
36534cb271 move USE_SSP=no one level up. 2006-11-11 22:38:38 +00:00
macallan
3f9bd18e6d add 1024x768 @ 89Hz for the Apple eMac
from Marco Trillo
2006-11-11 22:14:44 +00:00
christos
31b7f8ae5f Don't build lkms with SSP for now. 2006-11-11 21:35:45 +00:00
bouyer
a897b56088 Simplify XEN3 domU kernel config by including the XEN2 domU configs and
adding only XEN3 specific options/devices.
2006-11-11 20:00:39 +00:00
bouyer
b8f3db3eea Follow GENERIC and enable TMPFS 2006-11-11 19:34:54 +00:00
jmmv
fb3e66fdb3 Enable TMPFS by default. OK'ed by core@.
I'm leaving those platforms with few users and those whose machines are
not very powerful untouched per uwe@'s suggestion.  The port masters or
the real users of those ports are better suited to make the decision of
enabling it.
2006-11-11 19:00:16 +00:00
jmmv
7a13fe4abf Remove tmpfs's experimental status. OK'ed by core@. 2006-11-11 18:47:08 +00:00
bjh21
7cd2ca16b5 COMPAT_10 implies COMPAT_11, so there's no need to test both.
Also collapse two tightly-nested #ifs into one.
2006-11-11 17:28:16 +00:00
bjh21
7acb866d02 All of the older COMPAT_?? options imply COMPAT_13, so there's no need to
check each one individually.
2006-11-11 16:58:04 +00:00
tsutsui
6e1aa2e387 Minor style tweaks in re_txeof(). 2006-11-11 13:51:44 +00:00
jmmv
ea4fb88d87 Do not mess with B_VFLUSH in the read/write case. Requested by yamt@.
(I did this because the system could panic otherwise.  But this seemed to
be a side-effect of another mistake that was present in the code before it
was commited.  So effectively this simplification should have happened
before.)
2006-11-11 13:42:14 +00:00
tsutsui
216b5d71df - declare struct re_txq separately
- reorder bus_dma_segment_t members since they are used only on attach/detach
2006-11-11 13:41:06 +00:00
tsutsui
15ce034c2c Some minor tweaks in re_intr():
- check status bits at once (I'm not sure how gcc optimized them though)
- no need to check (ifp->if_flags & IFF_UP) twice
  (re_init() must be called at splnet() anyway)
- call re_start() only if the interrupt is actually handled here
- call re_start() directly rather than via (*ifp->if_start)()
2006-11-11 12:41:56 +00:00
tsutsui
82ada0b76e Clear a TX timeout only if all queued packets are handled. 2006-11-11 12:13:55 +00:00
tsutsui
677bbfc799 Remove a leftover comment.
(note bus_dmamap_sync(9) is still needed even if no changes are made to
 DMA descriptors but once they are fetched into the CPU cache)
2006-11-11 12:04:08 +00:00
tsutsui
319c2aeb6a - set descriptor DMA addresses before enabling TX and RX
- set RTK_EARLY_TX_THRESH before starting TX and RX
2006-11-11 11:31:30 +00:00
jnemeth
daa80ec43e add another file to the VARSTACK list 2006-11-11 08:40:42 +00:00
christos
a62de02966 Add SSP support.
XXX: This is broken for me right now, because my kernel resets after fxp0
is probed, but it could be some bug in the driver/compiler.
2006-11-11 02:12:53 +00:00
reinoud
dc6975451a Add missing space in comment 2006-11-10 22:31:19 +00:00
tsutsui
df320777c1 Call re_reset() after re_stop() in re_init().
Without this, re(4) on my macppc sometimes falls into mangled state
and generates many errors after ifconfig(8) or tcpdump(8) etc.
2006-11-10 21:49:02 +00:00
macallan
f8fc7e5c07 remove some leftover #includes 2006-11-10 20:27:44 +00:00
christos
eeedf4b2c2 convert variable allocation to constant. 2006-11-10 18:15:12 +00:00
martin
43ae9165b5 size_t is not always == int 2006-11-10 14:31:14 +00:00
yamt
d4d55c3dc9 tcp_ctloutput: when called for a socket which is not AF_INET or AF_INET6,
panic rather than returning possibly leaking an mbuf.
2006-11-10 13:19:16 +00:00
yamt
22ffb8ee31 udp_ctloutput: plug a memory leak. 2006-11-10 13:02:32 +00:00
yamt
850e08319b remove some __unused in function parameters. 2006-11-10 13:01:55 +00:00
yamt
d547c3b722 udp_ctloutput: remove unnecessary goto and break. 2006-11-10 13:00:23 +00:00
yamt
511f1a8ff8 udp_ctloutput: ansify. 2006-11-10 12:59:59 +00:00
yamt
641f2cc444 xennet_checksum_fill: remove a debug printf. 2006-11-10 11:52:49 +00:00
bouyer
4a1c74e813 Yet another broken seagate drive. 2006-11-09 19:43:05 +00:00
jmmv
cff91bd8fc Add 2006 to the copyright notice; should have done this when touching the
files before.
2006-11-09 16:20:06 +00:00
jmmv
ccb670c8b8 Opening a file after it has been removed (e.g. rmdir $(pwd)) has to fail. 2006-11-09 15:36:30 +00:00
jmmv
b6714d04d8 Check if the underlying file system supports VOP_BMAP and VOP_STRATEGY and,
if not, fallback to VOP_READ and VOP_WRITE.  This makes vnd work with files
on, e.g. tmpfs and smbfs; all file systems should behave as before.
OK'ed by silence in tech-kern@.
2006-11-09 15:27:40 +00:00
tsutsui
36fcb0cbe4 Add rgephy at mii and rlphy at mii.
Tested on Ultra5 with RTL8139C (not plus) and RTL8169S.
2006-11-09 15:23:42 +00:00
tsutsui
2ae6e40c03 More cleanup of sparc64 clock stuff:
- split mkclock attachment from sparc64/clock.c into dev/mkclock.c
  (now clock.s only contains clock interrupt and timecounter stuff)
- rename match/attach functions of rtc at ebus to match the device name
- update some comments around clock devices in GENERIC

No objection on port-sparc64 for a month.
2006-11-09 15:08:04 +00:00
jmmv
117b5f5104 Audit kqueue notifications. The reference behavior is taken from MFS and
is represented in the regression tests.
2006-11-09 15:06:03 +00:00
tsutsui
492fddeb4a Print device revision on attach. 2006-11-09 14:59:55 +00:00
tsutsui
8d3021b407 Add #include <sys/device.h> for struct device.
Fixes compile error on sparc64.
2006-11-09 14:43:10 +00:00
cube
3574e17e23 Regen (PR#34951 fixes). 2006-11-09 14:10:21 +00:00
cube
1277ee639e - Make better use of COMPAT_XX type in syscalls.master
- Remove useless (thanks to COMPAT_XX behaviour) #ifdefs in
  syscalls.master
- Make netbsd32_compat_43.c compiled per COMPAT_LINUX32 because the latter
  needs stuff from it.

Fixes Perry's PR#34951.
2006-11-09 14:09:37 +00:00
pooka
098590e87e few renames to better differentiate between mount & start.. plus some
other renaming
2006-11-09 13:09:34 +00:00
yamt
1de5b4994d vmem_xalloc: plug memory leak on error. 2006-11-09 10:08:53 +00:00
yamt
89682b24fe remove some __unused in function parameters. 2006-11-09 09:53:57 +00:00
scw
814254d821 Add an install kernel for CP3100. 2006-11-09 00:28:37 +00:00
scw
5bfa580df1 Add support for the Certance CP-3100.
"The Certance CP3100 product family provides high-end disk-to-disk-to-tape
(D2D2T) functionality for small-to-medium businesses."

To software, the unit is very similar to the IQ80321 and IQ31244 eval
boards from Intel. As such, we share almost all of their code.

Onboard hardware:
 - IOP321 XScale CPU. Core clock is 600MHz.
 - 256MB SDRAM (not sure if that's true for all)
 - Four-port Intel i31244 SATA controller. One port is connected to the
   internal disk. The remaining three are available on the back-panel.
 - Dual GigE ports on the back panel, using an Intel i82546EB controller.
 - Two Symbios Logic 53c1010 SCSI controllers, one in host mode the other
   in target mode. Both SCSI busses are available on the back panel.
   Note that NetBSD does not support SCSI target mode.
 - 8MB of NOR Flash, containing a fairly vanilla Redboot together with
   a minimal compressed Linux image.
 - Some front-panel LEDS (not supported).
 - Serial console.

Contributed by Wasabi Systems, Inc.
2006-11-08 23:49:02 +00:00
scw
d3089a454e If I80321_HPI_ENABLED is defined, add support for handling interrupts from
devices hooked up to the HPI pin.

HPIs cannot be masked at the interrupt controller; they can only be masked
by disabling IRQs in the XScale core. To deal with this, we tweak the
interrupt frame so that IRQs are disabled when the interrupt dispatcher
returns due to a masked HPI interrupt. IRQs will be re-enabled by a
subsequent splx(9).

Fortunately the only instance where HPI is used is for the console UART
on a couple of boards, so this hack does not adversely affect performance.

Contributed by Wasabi Systems.
2006-11-08 23:45:41 +00:00
rpaulo
4081961b95 Backout half of previous by popular demand. 2006-11-08 21:18:13 +00:00
rpaulo
2313f534c1 regen 2006-11-08 21:03:35 +00:00
rpaulo
809c9d3540 Add AMD PCI-X IOAPIC. 2006-11-08 21:02:02 +00:00
drochner
b1af2cb9b9 -SUS says that a successful call to setcontext(2) does not return. This
implies that _UC_CPU must be set in the context passed. Check for this
 and return EINVAL if not; this gives a cheap test for corrupted
 ucontexts eg on a signal handler stack which would go unnoticed otherwise.
-Don't ckeck for NULL ucontext pointers explicitely. This is an error,
 except in the swapcontext() case where it can be easily caught in
 userland.
2006-11-08 20:18:32 +00:00
drochner
3f8c6dc981 while we are here, also print the interrupt disable bit
in VERBOSE/pcictl
2006-11-08 18:44:16 +00:00
rpaulo
a70745bf73 Remove MATH_EMULATE.
Add DEBUG and LOCKDEBUG. This kernel config is suited for development.
2006-11-08 16:01:50 +00:00
pooka
7288f6ba9f update struct buf resid in strategy according to what was transferred.
seems like only nestiobuf complains when it wasn't updated ...
2006-11-08 11:49:36 +00:00
martti
fc8a9d267d Regenerated. 2006-11-08 11:36:21 +00:00
martti
06061bc2fd Fix aligment. 2006-11-08 11:35:11 +00:00
martti
45ffbf91af List MEGARAID_SAS and MEGARAID_VERDE_ZCR as SYMBIOS products. 2006-11-08 11:32:45 +00:00
drochner
53056d0217 avoid magic number 2006-11-08 11:09:52 +00:00
macallan
a6f7fc75a8 enable accelerated wsdisplay drivers 2006-11-08 05:48:43 +00:00
macallan
65d4544efe add control codes for virtual console switching
looks like I forgot to commit this ages ago...
2006-11-08 03:27:29 +00:00
dogcow
7a82abd9dc remove extraneous kauth check; since open already does the auth - and
mmap doesn't even get passed the lwp - the check here neither compiles
nor does anything terribly useful.
2006-11-08 02:53:31 +00:00
macallan
4f70466a7c split ofb into one part that attaches right on kernel startup and one that
attaches to pci so we can build kernels with - say - machfb but without
ofb at pci.
2006-11-08 01:25:10 +00:00
elad
87d047b739 Replace securelevel checks with kauth(9) calls. 2006-11-08 00:17:09 +00:00
pooka
b3bdf665dd attach to genfs & support page cache. most noticeable effect is
mmap and therefore execution of binaries starting to work, some
speed improvements with large file I/O also.  caching semantics
and error case handling most likely need revisiting.
2006-11-07 22:10:18 +00:00
jmmv
749d415179 tmpfs_open cannot assume that the node to be open is still linked to a
directory, so remove an invalid assertion.  Otherwise the kernel incorrectly
panics when accessing the current directory after it has been removed.
2006-11-07 14:08:13 +00:00
mrg
72a7dfed29 fix another uninitialised variable picked up by the gcc -O3 optimiser. 2006-11-07 10:31:31 +00:00
martti
c99cfadbd6 Regenerated. 2006-11-07 09:34:37 +00:00
martti
df5b06ab10 Added some MegaRAID SAS controllers. 2006-11-07 09:29:31 +00:00
elad
75451f036c Better VCHR handling. 2006-11-07 08:53:49 +00:00
macallan
0bb8ed626b allow IDE DMA on Heathrow again 2006-11-07 02:23:27 +00:00
pooka
c15972c2b3 puffs_park always contains a specific puffs_req, so make it a member
instead of a pointer
2006-11-06 23:18:18 +00:00
macallan
1009b21c56 add wsdisplay_preattach() to attach an early console that can be overridden
by wsdisplay_cnattach() for instance when a hardware-specific display driver
attaches.
as discussed on tech-kern
2006-11-06 19:51:12 +00:00
jmmv
c3429f8083 Pass a simple ELF header to ksyms_init_explicit with the minimum contents
required to initialize ksyms_hdr.  Otherwise LKMs do not work when using
ksyms_init_explicit instead of ksyms_init, as is the case of booting an
i386 kernel using Multiboot.
2006-11-06 13:35:35 +00:00
pooka
f212146148 make it possible to build & load puffs as an LKM
by Lubomir Kundrak, PR kern/35000
2006-11-06 11:44:54 +00:00
elad
993da55808 simplify & fix logic in device/rawio/spec. 2006-11-06 02:02:18 +00:00
elad
66e42f0f77 XXX: use KAUTH_DEVICE_RAWIO_PASSTHRU for direct disk access here. 2006-11-05 23:00:54 +00:00
jmmv
8d45655462 Add a lkm for tmpfs. All the regression tests pass fine when using the
module rather than an in-core build.
2006-11-05 22:42:14 +00:00
cube
c3fe38a0cd config_found() is for direct configuration, not indirect.
Change the code to use config_search/config_attach, and print a warning
when the user has device* at pcppi? in the kernel configuration file.
2006-11-05 21:06:26 +00:00
jmmv
042827a010 Randomly initialize the node's generation to make file handles less
predictable.  This solves a problem that may appear when serving a tmpfs
over NFS: if the server reboots, newly allocated files should have
different file handles; otherwise the remote clients could access files
they were not supposed to touch.
2006-11-05 19:40:31 +00:00
jmmv
1a3e8c3caa Protect the dircookie stuff with _KERNEL. Fixes build problems of
mount_tmpfs as reported by Hisashi T Fujinaka in private mail.
2006-11-05 19:36:07 +00:00
jmmv
2a3293d093 Exporting tmpfs file systems through NFS now works. Sure, file handles are
not persistent across reboots but neither are those of MFS, which we are
trying to replace.  We should probably warn the user somehow, but not
prevent him doing this if he really wants to.

While here add a "reply" to the code-style change item.
2006-11-05 18:03:21 +00:00
jmmv
b2603104c2 Truncate directory cookies to 31 bits to avoid problems exposed in Linux
binaries which cast the returned values to 64-bits and fail due to sign
expansion.  More details are provided in the big comment in tmpfs.h that
describes how the new tmpfs_dircookie works.

This is a rather ugly hack that shall be fixed with a cleaner solution,
but this resolves the problem in an effective way.

Fixes kern PR/32034.
2006-11-05 16:59:18 +00:00
tsutsui
a6058d8988 Rename prefixes of re(4) specific macro and structure members
from RTK_ or rtk_ to RE_ or re_ for maintainability of these sources.
Eventually we should split these files (and struct rtk_softc) into
three elements, rtk(4) specific one, re(4) specific one, and a common
(register definitions, eeprom and multicast functions etc) part.

While here, add a couple of comments around weird definitions.
2006-11-05 16:52:10 +00:00
tsutsui
7274f167d2 - make TX threshold macro more generic
- no need to bother to initialize sc_txthresh in rtk_attach()
  since it's done in rtk_init()
2006-11-05 15:49:41 +00:00
christos
9573aa20e8 - call the initialization routine for arc4randbytes.
- knf (add continues)
2006-11-05 14:13:56 +00:00
tsutsui
527c7a697a Use uintNN_t. 2006-11-05 13:05:18 +00:00
jld
e973fa550e If the timestamp is/becomes stale when computing the current system_time,
obviously shadow_system_time will need to be reread as well.
2006-11-05 10:11:55 +00:00
jdolecek
d5f5129729 add one code style and one knote-related item 2006-11-05 09:40:26 +00:00
yamt
0f0ac5fba9 vmapbuf: don't try to modify non-lvalue. 2006-11-05 08:04:55 +00:00
itohy
bb94735ed0 Restart transmitter, not reset the entire chip, on transmission errors
like Tx underrun.
This should improve performance on such errors.

Handle fifo threshold properly --- actually it did not handled at all.
Note that the Tx Complete interrupts occur only on errors, and ex_txstat()
is not good place to increment sc->tx_succ_ok.  Increase the sc->tx_succ_ok
count from 100 to 256, since the ex(4) does busmastering and underruns
should rarely happen in normal operations.

Possibly improve some situation for the hang-on-heavy-load problems,
such as kern/11450 and kern/27096.
2006-11-05 07:59:21 +00:00
itohy
4be0089972 Add definition for Tx Reclaim status (TXS_RECLAIM). 2006-11-05 05:57:53 +00:00
elad
a996c89fcf forward decl struct vnode 2006-11-04 21:24:20 +00:00
jmmv
9d877d347c Use size_t in a couple of places as it makes more sense WRT the places
where the variables are later used.  From PR kern/25277 by Jeff Ito.
2006-11-04 20:51:32 +00:00
pooka
78e8aceaac adapt to mnt_vnodelist being TAILQ 2006-11-04 20:33:17 +00:00
pooka
88134b62a2 add mountdump, prints mount point information a little like mount(8) 2006-11-04 20:29:30 +00:00
elad
03a082e7aa Oops, forgot to do this one in previous commit.
Pointed out by mjf@, thanks!
2006-11-04 15:36:37 +00:00
yamt
3aef238dc0 - define some macros and use them.
- fix an off-by-one in testcode.
2006-11-04 13:26:22 +00:00
yamt
e1b6afe136 todo. 2006-11-04 13:25:52 +00:00
jmmv
d4cb7c851a Fix matching of options with common prefixes (e.g. console and console_speed).
While here remove an useless assignment and bind a variable to a loop.
2006-11-04 11:37:12 +00:00
elad
9477ac30bc Add "@uid" keyword translation, to translate effective user-id of the
process.
2006-11-04 10:14:00 +00:00
elad
63d078b99e Use KASSERT() as requested by yamt@. 2006-11-04 09:56:59 +00:00
elad
fe9e2303fd Change KAUTH_SYSTEM_RAWIO to KAUTH_DEVICE_RAWIO_SPEC (moving the raw i/o
requests to the device scope) and add KAUTH_DEVICE_RAWIO_PASSTHRU.

Expose iskmemdev() through sys/conf.h.

okay yamt@
2006-11-04 09:30:00 +00:00
dyoung
0787046d01 Change lengthy ((struct sockaddr_in *)x) to satosin(x). 2006-11-04 07:13:19 +00:00
dyoung
f6cb813915 Remove unused variables. 2006-11-04 06:41:48 +00:00
dyoung
cce119d20c Expand the comment concerning gre_kick().
Shorten the code in gre_compute_route() that flips the least
significant bit of the tunnel address.  No functional change.
2006-11-04 06:38:05 +00:00
tsutsui
fb1f06475c Remove vtophys (in comment). 2006-11-04 05:54:53 +00:00
tsutsui
c5bcc82dd7 Preserve m_pkthdr.csum_flags in TX packets because
it could be lost if bus_dmamap_load_mbuf(9) returns EFBIG.
(though I've never seen the "too mamy segments" message
 which indicates the packet has more than 32 fragments)
2006-11-04 05:18:26 +00:00
tsutsui
f2a3a089d1 Rather than copying m_pkthdr.csum_flags in m_defrag() (which was
committed in rev 1.22), save it before calling m_defrag().

I haven't confirmed whether the m_pkthdr.csum_flags is preserved during
m_defrag(), but the previous way sometimes makes vge(4) chip mad...
2006-11-04 05:07:16 +00:00
tsutsui
5a460391d7 Return a proper error from vge_encap() if m_defrag() fails. 2006-11-04 04:40:00 +00:00
ad
5bfcdd68c1 - ltsleep(): for now, stay at splsched() when releasing sched_lock, or we
may allow wakeup() to occur before switching away.  PR/32962.
- mi_switch(): don't inspect p->p_cred or send signals without holding the
  kernel lock.
2006-11-03 20:46:00 +00:00
ad
1cffc415cb - issignal(): acquire the kernel lock before inspecting signal state
- lwp_exit2(): don't drop the kernel lock until after doing wakeup()
2006-11-03 19:46:03 +00:00
tsutsui
da98d43bd0 Pull another 8139C+ fix from FreeBSD if_re.c rev 1.68:
Perform hardware diagnostic only on the original RTL8169,
which was the only device that really needed it.
(i.e. a possible hardware bug when the NIC was put on a 64bit PCI slot)

Tested with on-board 8139C+ by Brian A. Seklecki.

Note this change might also fix PR kern/34952
(because re_diag() is no longer called on 8169S/8110S),
but I'm not sure if the re(4) chip was properly initialized in such case.
2006-11-03 17:51:47 +00:00
tsutsui
445d5743e4 Pull a 8139C+ fix from FreeBSD if_re.c rev 1.73:
Ignore BMCR_LOOP and BMCR_ISO bits which have different meanings on 8139C+.

Tested by Brian A. Seklecki.
2006-11-03 17:16:58 +00:00
tsutsui
ff1bacae2e Make rlphy also match if parent MII is re(4) for RTL8139C+ case.
Tested by Brian A. Seklecki.
2006-11-03 17:05:16 +00:00
tsutsui
304b305c9e Minor cleanups:
- move some driver specific definitions from rtl81x9reg.h to rtl81x9var.h
- move several macro where related structures are declared
- remove unused macro
- fix some comments
- unwrap some lines
2006-11-03 17:01:54 +00:00
tsutsui
a8d1516f11 Use #define<space>, which seems consistent in these files. 2006-11-03 14:41:40 +00:00
abs
34133821e3 Regenerate after adding Broadcom BCM5754 (0x167a) 2006-11-03 13:00:09 +00:00
abs
f9237faff1 Add Broadcom BCM5754 (0x167a) 2006-11-03 12:59:47 +00:00
yamt
0ae566badc fix deadlocks due to ksiginfo_pool spl problems. 2006-11-03 12:18:41 +00:00
jld
9253e28032 Ensure that the timestamp we use in get_tsc_offset_ns remains valid
until after we do the rdtsc; since Xen3 dynamically adjusts its idea of
the clock frequency, this is important.  (Linux and FreeBSD both do this.)
2006-11-03 12:09:46 +00:00
yamt
1cd3142c15 make siginfo_pool and ksiginfo_pool static. 2006-11-03 11:41:07 +00:00
jld
f566d2017b "static volatile", not "volatile static". 2006-11-03 09:16:13 +00:00
tsutsui
690e60f366 Pull several fixes which improve TX error handling
from FreeBSD's if_vr.c rev 1.52:
- check more error status in TX descriptor and restart TX module
  appropriately in vr_txeof()
- check more error interrupt status in vr_intr()

I can't confirm whether these changes actually fix TX stalls because
I can't reproduce the problem I had about seven years ago (I guess
it might be caused by excessive collisions on a dumb hub), but at least
they don't seem to have bad side effects on normal operations on my macppc.
2006-11-03 08:41:05 +00:00
tsutsui
57a0051fe5 - no need to scan zsc units in zshard(), just use passed one
- call zsc_intr_soft() directly on softintr and remove zssoft()
  (no need spltty() since it should be done in each MD handler)
2006-11-03 03:04:53 +00:00
jld
2d61afc3e7 Recycle old buffers into new rx requests when their number reaches half of
those not tied up in active mbufs, rather than half of the total number.

(Or, to more literally translate the C, when there are at least as
many buffers waiting to be reused as outstanding rx requests.)

This prevents us from dropping off the network for a while when more
than 128 of the 256 buffers are in use by mbufs, which might not be
freed for an arbitrarily long time; the remaining buffers would stack up
on the free list but not be reclaimed until enough mbufs were eventually
freed, leaving the interface unable to receive packets until then.
2006-11-03 03:03:32 +00:00
tsutsui
23c5e05646 Remove a function declaration of zssoft() which was
inside #ifndef __HAVE_GENERIC_SOFT_INTERRUPTS.
2006-11-02 20:43:30 +00:00
tsutsui
ce97c50f55 Pass zsc_softc to zshard() directly rather than searching it in zshard().
Checking all zsc units in zshard() is efficient only on ports
which share one interrupt among all zsc units, like sparc or sun3.
On such ports, zshard() is established as a handler only once.

XXX1: more other MD zs drivers should be fixed similarly.
XXX2: zsc on macppc has independent interrupts for channel A and B,
      but MI z8530sc can't handle such configuration.
2006-11-02 20:05:04 +00:00
tsutsui
5e4ac42c65 macppc always defines __HAVE_GENERIC_SOFT_INTERRUPTS,
so remove #ifdef/#ifndefs against it.
2006-11-02 19:41:34 +00:00
jmmv
e0fd5659c6 Bring in fix from FreeBSD by tjr, 3 years and 9 months ago: Store a
reference to the parent directory's vnode instead of its smbnode to
avoid a use-after-free bug causing a panic when a smbfs mount is
forcefully unmounted.

Keep trying to flush the vnode list for the mount while some are still
busy and we are making progress towards making them not busy.  This
stops attempts to unmount idle smbfs mounts failing with EBUSY.

The easiest way to reproduce the above problem, from what I have seen is:
1) Assume /s is a smbfs mount point.
2) mount /s
3) stat /s/foo/1
4) umount /s
   Returns error because the file system is busy.
5) Shutdown the machine: panic in smbfs_reclaim because vrele
   accesses already-released memory.
2006-11-02 17:34:21 +00:00
tsutsui
c2d79bf895 Don't touch the VR_STICKHW register on VT3043.
The commit log in FreeBSD's if_vr.c rev 1.43 says
"This is really only for the VT6102, but it doesn't hurt the older chips,"
but at least it hurts my VT86C100A (which returns a product ID of VT3043)
on macppc and causes kernel MCHK trap while the same board on i386
and VT6102 on macppc have no problem with it.
2006-11-02 17:32:11 +00:00
yamt
4d91d6d252 ltsleep: fix a race with wakeup(). 2006-11-02 16:26:25 +00:00
jmmv
51634dfd25 Make tmpfs_getpages behave as genfs_getpages by ignoring the input pages
array's contents and returning all the requested pages.  Otherwise there
are problems (accessing invalid memory) when the a_m vector is passed
uninitialized as the NFS server code does.  Fixes PR kern/34959.

Note that this is not a "real" fix.  While this makes tmpfs's getpages
operation consistent with the behavior of other file systems, it does
not resolve the different semantics between uvn_get and uao_get as
described in PR kern/32166.  I'm adding a comment in the code mentioning
exactly this so that it can be reviewed when this last problem is
addressed.
2006-11-02 15:35:25 +00:00