11 years agoFix module loading for vkernel.
Simon Schubert [Thu, 7 Jun 2007 22:58:11 +0000 (22:58 +0000)]
Fix module loading for vkernel.

Some symbols in the vkernel are actually provided by libs the
kernel binary is linked to, which can not be resolved by the
internal kernel linker.  Fall back on using dlsym() if no
symbol could be found by the kernel linker.  This actually means
that the kernel needs to be linked dynamically.

11 years agoDon't loose count when adding too many plexes to a volume.
Simon Schubert [Thu, 7 Jun 2007 22:58:00 +0000 (22:58 +0000)]
Don't loose count when adding too many plexes to a volume.

11 years agoUse MAXPARTITIONS instead of hardcoded value.
Simon Schubert [Thu, 7 Jun 2007 22:57:49 +0000 (22:57 +0000)]
Use MAXPARTITIONS instead of hardcoded value.

11 years agoAdd KTR logging for SMP page table syncing ops.
Matthew Dillon [Thu, 7 Jun 2007 20:35:54 +0000 (20:35 +0000)]
Add KTR logging for SMP page table syncing ops.

11 years agoUse the slab cache for PAGE_SIZE and PAGE_SIZE*2 sized allocations. This
Matthew Dillon [Thu, 7 Jun 2007 20:34:14 +0000 (20:34 +0000)]
Use the slab cache for PAGE_SIZE and PAGE_SIZE*2 sized allocations.  This
reduces the number of SMP page invals the ELF loader and mmio have to do
for operations that occur on a single cpu.

11 years agoAdd polling support to BGE.
Matthew Dillon [Thu, 7 Jun 2007 20:30:20 +0000 (20:30 +0000)]
Add polling support to BGE.

11 years agoWhen compiling a kernel with all ktr logging (KTR_ALL), do not auto-enable
Matthew Dillon [Thu, 7 Jun 2007 18:03:15 +0000 (18:03 +0000)]
When compiling a kernel with all ktr logging (KTR_ALL), do not auto-enable
the KTRs on boot because logging everything is counter productive.  Instead,
let userland enable particular KTRs via sysctl.

11 years agoAdd a field to the keyboard abstraction structure that allows the USB
Matthew Dillon [Wed, 6 Jun 2007 18:49:28 +0000 (18:49 +0000)]
Add a field to the keyboard abstraction structure that allows the USB
keyboard controller to save and restore the translation state.  This
allows you to disconnect and reconnect a USB keyboard and not get
gibberish when you type.

Reported-by: Petr Janda <elekktretterr@exemail.com.au>
11 years agobridge_enqueue() does not use bridge(4)'s softc, so don't pretend that the
Sepherosa Ziehau [Wed, 6 Jun 2007 13:10:39 +0000 (13:10 +0000)]
bridge_enqueue() does not use bridge(4)'s softc, so don't pretend that the
parameter is needed.

11 years agoUpdate FreeBSD ID tags.
Sascha Wildner [Tue, 5 Jun 2007 18:30:40 +0000 (18:30 +0000)]
Update FreeBSD ID tags.

11 years agoDon't let ether_input() to do the bridging work, i.e. change input iface,
Sepherosa Ziehau [Tue, 5 Jun 2007 13:41:39 +0000 (13:41 +0000)]
Don't let ether_input() to do the bridging work, i.e. change input iface,
since it breaks following things:
o  IFF_MONITOR support.
o  Assumption that ether_input() is called with input iface's serializer
o  Per interface input packets and bytes statistics.

Let the bridge(4) handle the input iface change, which is centralized
at the end of bridge_input() after leaving bridge(4) iface's serializer.
We call ifnet.if_input() when handling iface change, instead of skipping
the "upper" half of ifnet.if_input() as we did originally; the assumption
that "upper" half of ifnet.if_input() does nothing according to input iface
does not sounds good.  M_PROTO1 mbuf flag is used to prevent infinite loop;
we may need to create a meaningful alias macro for it.

Other changes:
- Delay bridge_lookup_member_if() call until it is really necessary.
- Update ipackets for bridge(4) iface, if mcast/bcast packet is received
  and is going to be delivered to bridge(4) iface.
- Use IF_LLADDR() macro to get bridge(4) iface's MAC address.
- Nuke never reached code.
- Minor style changes.

11 years agoAdd some words about -v.
Sascha Wildner [Mon, 4 Jun 2007 21:04:27 +0000 (21:04 +0000)]
Add some words about -v.

Submitted-by: y0netan1
11 years agoDo any crash dump operation before the shutdown_post_sync event handler
Matthew Dillon [Mon, 4 Jun 2007 17:22:02 +0000 (17:22 +0000)]
Do any crash dump operation before the shutdown_post_sync event handler
is invoked.  Move numerous legacy device shutdown event handlers from
shutdown_final to shutdown_post_sync.  Note that newer devices uses
the device_shutdown DEVMETHOD.

11 years agoAdd the cvsup manpage to the ISO, dammit.
Sascha Wildner [Mon, 4 Jun 2007 01:47:41 +0000 (01:47 +0000)]
Add the cvsup manpage to the ISO, dammit.

11 years agoReadjust some comments.
Sascha Wildner [Mon, 4 Jun 2007 01:08:02 +0000 (01:08 +0000)]
Readjust some comments.

11 years agoReplace the remaining NG_*LEN constants with NG_*SIZ constants for real.
Sascha Wildner [Mon, 4 Jun 2007 00:40:32 +0000 (00:40 +0000)]
Replace the remaining NG_*LEN constants with NG_*SIZ constants for real.

Submitted-by: Nuno Antunes <nuno.antunes@gmail.com>
11 years agoReplace the remaining *LEN constants with *SIZ constants.
Sascha Wildner [Sun, 3 Jun 2007 23:41:25 +0000 (23:41 +0000)]
Replace the remaining *LEN constants with *SIZ constants.

Reported-by: walt <wa1ter@myrealbox.com>
Submitted-by: Nuno Antunes <nuno.antunes@gmail.com>
11 years agoUpdate for libarchive 2.2.3.
Peter Avalos [Sun, 3 Jun 2007 21:29:07 +0000 (21:29 +0000)]
Update for libarchive 2.2.3.

11 years agoMerge from vendor branch LIBARCHIVE:
Peter Avalos [Sun, 3 Jun 2007 21:26:40 +0000 (21:26 +0000)]
Merge from vendor branch LIBARCHIVE:
Import libarchive 2.2.3 fixing a few memory leaks and other fixes.

11 years agoImport libarchive 2.2.3 fixing a few memory leaks and other fixes.
Peter Avalos [Sun, 3 Jun 2007 21:26:40 +0000 (21:26 +0000)]
Import libarchive 2.2.3 fixing a few memory leaks and other fixes.

11 years agoCatch up a bit with FreeBSD netgraph by replacing *LEN constants with
Matthew Dillon [Sun, 3 Jun 2007 20:51:13 +0000 (20:51 +0000)]
Catch up a bit with FreeBSD netgraph by replacing *LEN constants with
*SIZ constants which already account space for trailing '\0's.

Submitted-by: "Nuno Antunes" <nuno.antunes@gmail.com>
Obtained from: FreeBSD (sorta).

11 years agoGC old sendmail version.
Peter Avalos [Sun, 3 Jun 2007 17:22:57 +0000 (17:22 +0000)]
GC old sendmail version.

11 years agoCorrect conditional to correctly treat segments which end on a boundary.
Simon Schubert [Sun, 3 Jun 2007 13:02:24 +0000 (13:02 +0000)]
Correct conditional to correctly treat segments which end on a boundary.

11 years agoGo to bed before the sun comes up.
Matthew Dillon [Sun, 3 Jun 2007 11:52:45 +0000 (11:52 +0000)]
Go to bed before the sun comes up.

11 years agoPart 1/2: Add a sanity check to the NATA interrupt code to assert that
Matthew Dillon [Sun, 3 Jun 2007 11:52:09 +0000 (11:52 +0000)]
Part 1/2: Add a sanity check to the NATA interrupt code to assert that
the command has actually been issued.

11 years agoSet the IDE DMA start bit as a separate I/O write from the DMA port
Matthew Dillon [Sun, 3 Jun 2007 11:49:54 +0000 (11:49 +0000)]
Set the IDE DMA start bit as a separate I/O write from the DMA port
direction setting.  It's just a whole lot safer not to mix the two in
a single write.

11 years agovmstat -iv: include IRQ number before the interrupt name, unless
YONETANI Tomokazu [Sun, 3 Jun 2007 11:49:30 +0000 (11:49 +0000)]
vmstat -iv: include IRQ number before the interrupt name, unless
it begins with "irq", in which case the name contains the number.

11 years agoImplement boundary and maximum segment size handling in bus_dmamap_load().
Matthew Dillon [Sun, 3 Jun 2007 11:47:10 +0000 (11:47 +0000)]
Implement boundary and maximum segment size handling in bus_dmamap_load().
This fixes NATA's UDMA device support.  The UDMA dma controller is limited
to a transfer size of 65536 bytes and address incrementation might not
carry over to bit 16.

11 years agobridge_{input,output_serialized}() only need to be static; they are actually
Sepherosa Ziehau [Sun, 3 Jun 2007 11:25:58 +0000 (11:25 +0000)]
bridge_{input,output_serialized}() only need to be static; they are actually
declared as static functions.

11 years agoM_NOWAIT can only be used in a driver where a failed memory allocation is
Matthew Dillon [Sun, 3 Jun 2007 04:48:29 +0000 (04:48 +0000)]
M_NOWAIT can only be used in a driver where a failed memory allocation is
recoverable, such as in a network driver.  FreeBSD seems to have a looser
definition but in DragonFly M_NOWAIT really means M_NOWAIT ... any blocking
at all, including waiting on the BGL or getting the kernel_map lock,
will result in a failure NULL.

Change all M_NOWAIT's to either M_WAITOK or M_INTWAIT.

11 years agoAdd a timings line for UDMA6 in two places. The drivers in question may or
Matthew Dillon [Sun, 3 Jun 2007 04:27:56 +0000 (04:27 +0000)]
Add a timings line for UDMA6 in two places.  The drivers in question may or
may not support it, but the array still needs to be large enough for all
possible elements.

Revamp the programming of register 0x48, 0x54, and 0x40 for the Intel
chipset support, and document the hell out of the whole thing.

Register 0x54 covers both primary and secondary controllers and master and
slave devices and was being fully programmed for each sub-device, causing
some sub devices to become misprogrammed.  Change it so only the elements
related to the sub-device are programmed.  It is unclear how much of a
difference this makes for the parts in question but at least it's documented

Fix logic that was causing UDMA66 devices on intel controllers to operate
at UDMA33 speeds (does anyone even have UDMA66 devices any more?).

Add support for the SB600 - from "Thomas E. Spanjaard"

11 years agoGC old less version.
Peter Avalos [Sun, 3 Jun 2007 04:24:35 +0000 (04:24 +0000)]
GC old less version.

11 years agoUpgrade to less version 403.
Peter Avalos [Sun, 3 Jun 2007 04:23:45 +0000 (04:23 +0000)]
Upgrade to less version 403.

These are the differences between version 394 and version 403:

-Allow decimal point in number for % (percent) command.
-Allow decimal point in number for -j option (fraction of screen height).
-Make n command fetch previous pattern from history file on first search.
-Don't rewrite history file if it has not changed.
-Don't move to bottom of screen on first page.
-Don't output extraneous newlines, so copy & pasting lines from the output
works better.
-The -c option has been made identical with the -C option.
-Allow "/dev/null" as synomym for "-" in LESSHISTFILE to indicate that no
history file should be used.
-Better compatibility with POSIX more specification.
-Make -f work for directories.
-Make "t" cmd traverse tags in the correct order.
-Allow a few binary characters in the input file before warning that the
file is binary.
-Don't warn that file is binary if it merely contains ANSI color sequences
and -R is in effect.
-Update Unicode character tables.
-Fix bug when filename contains certain shell metacharacters such as "$".
-Fix bug when resizing the window while waiting for input from a pipe.

11 years agoAdd our READMEs.
Peter Avalos [Sun, 3 Jun 2007 04:20:21 +0000 (04:20 +0000)]
Add our READMEs.

11 years agoMerge from vendor branch LESS:
Peter Avalos [Sun, 3 Jun 2007 04:18:02 +0000 (04:18 +0000)]
Merge from vendor branch LESS:
Import of less-403.

11 years agoImport of less-403.
Peter Avalos [Sun, 3 Jun 2007 04:18:02 +0000 (04:18 +0000)]
Import of less-403.

11 years agoUse exec and fix handling of filenames containing whitespace.
Peter Avalos [Sun, 3 Jun 2007 03:59:53 +0000 (03:59 +0000)]
Use exec and fix handling of filenames containing whitespace.

Obtained-from:  FreeBSD

11 years agoUpdate MAKEDEV for acd* and cd* devices, the kernel now manages the
Matthew Dillon [Sun, 3 Jun 2007 03:44:17 +0000 (03:44 +0000)]
Update MAKEDEV for acd* and cd* devices, the kernel now manages the
disk layer for these devices.  Users have to regenerate their acd and cd

Create e.g. /dev/cd0 and /dev/acd0 as special raw access devices and
create e.g. /dev/cd0s0 and /dev/acd0s0 for label access.   This fixes
burncd on acd0 by allowing it to bypass the disk management layer entirely,
including bypassing the disk size checks in dscheck().

Implement the disk layer for NATA CD devices so it matches the ATA driver.

Tell CAM to create a compatibility 'a' slice for CDs (it wasn't before).

11 years agoNuke some obsolete named(8) related variables which were removed from the
Sascha Wildner [Sat, 2 Jun 2007 23:53:26 +0000 (23:53 +0000)]
Nuke some obsolete named(8) related variables which were removed from the
system when we upgraded to BIND9 in 2004.

11 years agoSynchronize to FreeBSD 1.35 - just adds a #define for ATA_SMART_CMD.
Matthew Dillon [Sat, 2 Jun 2007 19:17:01 +0000 (19:17 +0000)]
Synchronize to FreeBSD 1.35 - just adds a #define for ATA_SMART_CMD.

11 years agoBring in 1.343 from FreeBSD. FreeBSD commit message:
Matthew Dillon [Sat, 2 Jun 2007 18:48:40 +0000 (18:48 +0000)]
Bring in 1.343 from FreeBSD.  FreeBSD commit message:
"Add support for chipsets that has NULL'd BAR's for legacy ports.
This allows DMA to be used on a fine little geode system I got here and
most like on lots of older systems like that."

Obtained-from: FreeBSD / sos

11 years ago- Nuke the second parameter of bridge_stop(). This kind of stop interface
Sepherosa Ziehau [Sat, 2 Jun 2007 12:51:48 +0000 (12:51 +0000)]
- Nuke the second parameter of bridge_stop().  This kind of stop interface
  is never adopted by DragonFly.
- In bridge_ioctl():
  o  Use suser_ucred() instead of suser(), since ucred is passed to us.
  o  Correct comment and nuke unapplicable comment.
- In bridge_start():
  o  Move stack variables near their usage.
  o  Make sure that ether_header is contiguous in mbuf before accessing it.
- Add serializer assertion at the beginning of all ifnet functions.
- Minor style changes.

11 years agoDocument pf(4) related variables.
Sascha Wildner [Sat, 2 Jun 2007 10:59:37 +0000 (10:59 +0000)]
Document pf(4) related variables.

11 years agoOops, add variable types.
Sascha Wildner [Sat, 2 Jun 2007 10:26:47 +0000 (10:26 +0000)]
Oops, add variable types.

11 years agoDocument some variables which were added with Andreas Hauser's rc.firewall
Sascha Wildner [Sat, 2 Jun 2007 10:07:03 +0000 (10:07 +0000)]
Document some variables which were added with Andreas Hauser's rc.firewall
rewrite of 2004.

11 years agoFix loopback setup for firewall_type="closed".
Sascha Wildner [Sat, 2 Jun 2007 09:16:49 +0000 (09:16 +0000)]
Fix loopback setup for firewall_type="closed".

11 years ago- Break long lines.
Sepherosa Ziehau [Sat, 2 Jun 2007 09:08:26 +0000 (09:08 +0000)]
- Break long lines.
- Use __func__ instead of hardwired function name.
- kprintf("%s: ...", ifp->if_xname) ===> if_printf(ifp, "...")
- White space.

11 years agokmalloc(M_WAITOK) will never return NULL.
Sepherosa Ziehau [Sat, 2 Jun 2007 08:31:00 +0000 (08:31 +0000)]
kmalloc(M_WAITOK) will never return NULL.

11 years agobstp_input() can't return non-NULL mbuf, explicitly assert that.
Sepherosa Ziehau [Sat, 2 Jun 2007 05:33:09 +0000 (05:33 +0000)]
bstp_input() can't return non-NULL mbuf, explicitly assert that.

11 years ago- Avoid mbuf "use after free", if bridge(4) is in monitor mode.
Sepherosa Ziehau [Sat, 2 Jun 2007 05:09:18 +0000 (05:09 +0000)]
- Avoid mbuf "use after free", if bridge(4) is in monitor mode.
- Minor style changes.

11 years agoMake 'device natausb' compile again.
Sascha Wildner [Fri, 1 Jun 2007 22:48:16 +0000 (22:48 +0000)]
Make 'device natausb' compile again.

11 years agoRegen.
Sascha Wildner [Fri, 1 Jun 2007 19:15:58 +0000 (19:15 +0000)]

Hart:    2007-05-16 (version 640)
Boemler: 2007-06-01

11 years agoMerge all the FreeBSD work done since our initial import of NATA, except
Matthew Dillon [Fri, 1 Jun 2007 00:31:15 +0000 (00:31 +0000)]
Merge all the FreeBSD work done since our initial import of NATA, except
for the disk flushing code.  The disk flushing code still needs to be done.
The work includes a ton of SATA chipset work, bug fixes, cleanups, and new
chip support.

Obtained-from: FreeBSD / =?ISO-8859-1?Q?S=F8ren_Schmidt?= <sos@deepcore.dk>

11 years agoAdd a missing header file dependancy.
Matthew Dillon [Fri, 1 Jun 2007 00:25:23 +0000 (00:25 +0000)]
Add a missing header file dependancy.

11 years agoAdd flsl() for the NATA driver.
Matthew Dillon [Fri, 1 Jun 2007 00:24:25 +0000 (00:24 +0000)]
Add flsl() for the NATA driver.

11 years agoAdd flsl() for the NATA driver.
Matthew Dillon [Fri, 1 Jun 2007 00:23:28 +0000 (00:23 +0000)]
Add flsl() for the NATA driver.

11 years agoKill documentation for harvest_{interrupt,ethernet,p_to_p} which were
Sascha Wildner [Thu, 31 May 2007 23:03:36 +0000 (23:03 +0000)]
Kill documentation for harvest_{interrupt,ethernet,p_to_p} which were
removed in 2004.

11 years agoAdjust M_NOWAIT to M_WAITOK or M_INTWAIT as appropriate.
Matthew Dillon [Thu, 31 May 2007 22:10:59 +0000 (22:10 +0000)]
Adjust M_NOWAIT to M_WAITOK or M_INTWAIT as appropriate.

11 years agoAdd ip6 and icmp6 displays to systat(1).
Hasso Tepper [Thu, 31 May 2007 11:38:37 +0000 (11:38 +0000)]
Add ip6 and icmp6 displays to systat(1).

Obtained-from: FreeBSD

11 years agoCatch up with the latest LWKT msgport updating.
Sepherosa Ziehau [Thu, 31 May 2007 11:00:25 +0000 (11:00 +0000)]
Catch up with the latest LWKT msgport updating.

Reviewed-by: dillon@
11 years agoRename private to privdata and class to srclass to avoid conflicts with
Matthew Dillon [Tue, 29 May 2007 17:01:04 +0000 (17:01 +0000)]
Rename private to privdata and class to srclass to avoid conflicts with

Reported-by: Hasso Tepper <bugs@crater.dragonflybsd.org>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue663>

11 years agoAdd implementations of the inet6_opt* and inet6_rth* functions (RFC3542).
Hasso Tepper [Tue, 29 May 2007 10:58:11 +0000 (10:58 +0000)]
Add implementations of the inet6_opt* and inet6_rth* functions (RFC3542).

The patch brings in the part of the RFC3542 API we already have declared
in the sys/netinet6/in6.h, but implementations were missing which confuses
third party apps.

As IPv6 Routing Header Type 0 is already in the way to deprecation (see
draft-ietf-ipv6-deprecate-rh0-00.txt for details), handling of these is
removed from inet6_rth* functions.

Obtained-from: KAME

11 years agoUpdate ping(8) code and manpage to the newest ones from FreeBSD.
Hasso Tepper [Tue, 29 May 2007 10:21:41 +0000 (10:21 +0000)]
Update ping(8) code and manpage to the newest ones from FreeBSD.
Besides many small fixes this brings in some new features:

  * -D to set Don't Fragment bit
  * -G, -g and -h for sweeping pings
  * -M for using ICMP_MASKREQ or ICMP_TSTAMP instead of ICMP_ECHO
  * -o to exit successfully after receiving one reply packet
  * -W to set time to wait for a reply for each packet sent
  * -z to set TOS

Significant part of diff not related to the new features is coming
from reordering command line options into alphabetic order.

Obtained-from: FreeBSD

11 years agoRemove unnecessary initialization and fix a GCC-4.x run-time linking issue
Matthew Dillon [Mon, 28 May 2007 18:55:41 +0000 (18:55 +0000)]
Remove unnecessary initialization and fix a GCC-4.x run-time linking issue
at the same time.

Reported-by: David Murray <dave@nospam.murray.name>
11 years agoUpdate to file 4.21 which is a bugfix release including an integer
Peter Avalos [Mon, 28 May 2007 18:42:39 +0000 (18:42 +0000)]
Update to file 4.21 which is a bugfix release including an integer
overflow.  See Changelog for more changes.

11 years agoMerge from vendor branch FILE:
Peter Avalos [Mon, 28 May 2007 18:42:39 +0000 (18:42 +0000)]
Merge from vendor branch FILE:
Update to file 4.21 which is a bugfix release including an integer
overflow.  See Changelog for more changes.

11 years agoUpdate to file 4.21 which is a bugfix release including an integer
Peter Avalos [Mon, 28 May 2007 18:42:39 +0000 (18:42 +0000)]
Update to file 4.21 which is a bugfix release including an integer
overflow.  See Changelog for more changes.

11 years agoAdd some syslink debugging programs.
Matthew Dillon [Mon, 28 May 2007 05:28:12 +0000 (05:28 +0000)]
Add some syslink debugging programs.

11 years agoOpen the root image O_EXLOCK|O_NONBLOCK and exit with an error message
Matthew Dillon [Mon, 28 May 2007 05:26:29 +0000 (05:26 +0000)]
Open the root image O_EXLOCK|O_NONBLOCK and exit with an error message
if the open fails due to e.g. another virtual kernel using the same root

Enable NL->CRNL conversion when we put the console in raw mode.

11 years agoRemove etc/rc.d/archdep which didn't serve any real purpose.
Sascha Wildner [Sun, 27 May 2007 23:46:29 +0000 (23:46 +0000)]
Remove etc/rc.d/archdep which didn't serve any real purpose.

11 years agoFrom within a virtual kernel, make /sbin/shutdown and /sbin/halt actually
Matthew Dillon [Sun, 27 May 2007 23:28:30 +0000 (23:28 +0000)]
From within a virtual kernel, make /sbin/shutdown and /sbin/halt actually
halt and exit the vkernel, and make /sbin/reboot automatically re-exec
a fresh vkernel.

Talk about creating a clean slate!  Having reboot re-exec the vkernel
is really nice.  The kernel development cycle time is now down to around
18 seconds, reboot -n -q to root login prompt, and 28 seconds for a normal
reboot.  That's running a vkernel with a normal RC startup and as a
bridged DHCP client.

11 years agoFix typo.
Sascha Wildner [Sun, 27 May 2007 23:17:47 +0000 (23:17 +0000)]
Fix typo.

11 years agoRemove unnecessary empty arguments.
Sascha Wildner [Sun, 27 May 2007 23:06:33 +0000 (23:06 +0000)]
Remove unnecessary empty arguments.

11 years agoSyslink API work - greatly simplify the syslink_msg structure. Reimplement
Matthew Dillon [Sun, 27 May 2007 20:35:43 +0000 (20:35 +0000)]
Syslink API work - greatly simplify the syslink_msg structure.  Reimplement
the user API (NOTE: DMA buffers not yet implemented) and start working on
a kernel backend API.

Get rid of the inband DMA buffer fields and physical routing fields.
Replace the 32 bit message id with a 64 bit message id.

The 64 bit msgid allows guarenteed unique ids to be synthesized without
requiring the end points to actually track message ids.

Add a RPC protocol field (sm_proto) and move the command/reply bit and
endian detect bits from sm_msgid to sm_proto.  This allows the exact same
sm_msgid supplied in a command to be used in the reply and frees up bits
in the msgid that were previously going to be used for the protocol.
A separate protocol field also makes it a lot easier for the recipient
to check that the protocol is compatible with its expectations.

Implement a message based userland API and implement a syslink pair feature
so userland can get descriptors for both sides, for testing.  Implement
buffering limits, non-blocking I/O (but not select support yet), check
for duplicate message ids in active commands and match replies to commands.

Implement endian conversion to native endianess for the syslink message
header and any structured message elements.

Begin work on an out-of-band dma buffer API.

11 years agoThe proper root device for a vkernel fs is vkd0s0a, not vkd0a.
Matthew Dillon [Sun, 27 May 2007 18:37:25 +0000 (18:37 +0000)]
The proper root device for a vkernel fs is vkd0s0a, not vkd0a.
Also fix kern/vfs_conf.c to properly interpret 's0'.

11 years agoAdd ifmedia(4) reference.
Sascha Wildner [Sun, 27 May 2007 17:30:01 +0000 (17:30 +0000)]
Add ifmedia(4) reference.

11 years agoAdd a bus_set_resource(9) manual page.
Sascha Wildner [Sun, 27 May 2007 16:07:41 +0000 (16:07 +0000)]
Add a bus_set_resource(9) manual page.

Obtained-from: FreeBSD

11 years agoFor rum(4) and ural(4):
Sepherosa Ziehau [Sun, 27 May 2007 10:53:29 +0000 (10:53 +0000)]
For rum(4) and ural(4):
- Use crit section to protect external interfaces, callouts, USB
  task and USB operation callback functions.
- Avoid holding ifnet.if_serializer across various USB operations,
  since current USB stack does not aware of lwkt serializer.
- In various callout, USB task and USB operation callback functions,
  hold ifnet.if_serializer around ieee80211 functions.

11 years agoApply if_rum.c rev 1.11's resource alloc/free fixes and cleanup to ural(4)
Sepherosa Ziehau [Sun, 27 May 2007 02:45:48 +0000 (02:45 +0000)]
Apply if_rum.c rev 1.11's resource alloc/free fixes and cleanup to ural(4)

11 years agoWelcome our new bce(4) driver to various manpages & files.
Sascha Wildner [Sat, 26 May 2007 22:54:29 +0000 (22:54 +0000)]
Welcome our new bce(4) driver to various manpages & files.

11 years agoNuke commented out compat shim.
Sepherosa Ziehau [Sat, 26 May 2007 22:07:18 +0000 (22:07 +0000)]
Nuke commented out compat shim.

11 years agoAdd the kernel support function allocsysid().
Matthew Dillon [Sat, 26 May 2007 20:31:38 +0000 (20:31 +0000)]
Add the kernel support function allocsysid().

12 years agoAdd support for Broadcom NetXtreme II GigE. Jumbo buffer support
Sepherosa Ziehau [Sat, 26 May 2007 08:50:49 +0000 (08:50 +0000)]
Add support for Broadcom NetXtreme II GigE.  Jumbo buffer support
is missing currently, which will be added later.

Thank David Christensen <davidch@broadcom.com> for sending us two
sample NICs.
Thank dillon@ for providing a blazing fast machine and environment
to test the driver.
Also thank Walter <wa1ter@myrealbox.com> very much, who contacted
Broadcom for me :)

Obtained-from: FreeBSD (w/ modification)

12 years agoAlthough our linker supports pie, our elf loader doesn't.
Hasso Tepper [Fri, 25 May 2007 19:05:12 +0000 (19:05 +0000)]
Although our linker supports pie, our elf loader doesn't.

12 years agoAdd a -c file option to the vkernel to specify CD images. The first -c or -r
Matthew Dillon [Fri, 25 May 2007 02:21:19 +0000 (02:21 +0000)]
Add a -c file option to the vkernel to specify CD images.  The first -c or -r
option will be the boot device.

Add a new virtual CDRom device, vcd.  Basically its works the same as VKD
but we open the device in read-only mode and use a block size of 2048 instead
of 512.

Install the console as a real device and change the console major to be
the same as the syscons major so a default init is able to start up a getty.

12 years agoUpdate documentation.
Matthew Dillon [Fri, 25 May 2007 00:59:06 +0000 (00:59 +0000)]
Update documentation.

Nudged in the back by: Sascha Wildner <saw@online.de>,  Ouch!

12 years agoAdd lwkt_sleep() to formalize a shortcut numerous bits of code have been
Matthew Dillon [Thu, 24 May 2007 20:51:22 +0000 (20:51 +0000)]
Add lwkt_sleep() to formalize a shortcut numerous bits of code have been
using for a while, which is to directly deschedule oneself and switch away.
This method of blocking requires a direct lwkt_schedule() call to reschedule
the thread and is primarily used by the message port abstraction.

Change the psignal code to check TDF_SINTR in the thread flags instead
of checking MSGPORTF_WAITING in the thread's private message port.

The lwkt_waitmsg() and lwkt_waitport() functions use the same msgport
backend function (mp_waitport).  Separate the backend into two functions,
mp_waitport and mp_waitmsg, and allow tsleep flags to be passed in instead
of flagging interruptability in the lwkt_msg flags.

Optimize the lwkt_waitmsg() backends - in the fully synchronous critical
path case no critical sections or spinlocks are required at all.

12 years agoDo an even better job discerning between blocked threads and blocked
Matthew Dillon [Thu, 24 May 2007 20:32:02 +0000 (20:32 +0000)]
Do an even better job discerning between blocked threads and blocked

12 years agoProperly detect interruptable LWKT sleeps and display as 'S' instead of 'D'.
Matthew Dillon [Thu, 24 May 2007 20:28:15 +0000 (20:28 +0000)]
Properly detect interruptable LWKT sleeps and display as 'S' instead of 'D'.

Properly detect uninterruptable LWKT sleeps and display as 'B' instead of 'D'.

Properly display the wmesg for LWKT sleeps.  Note that not all LWKT sleeps
have a wmesg (maybe we should give them one).

12 years agoLWKT message ports contain a number of function pointers which abstract
Matthew Dillon [Thu, 24 May 2007 05:51:29 +0000 (05:51 +0000)]
LWKT message ports contain a number of function pointers which abstract
their backend operation.

* Add a new function, mp_getport(), which takes over the functionality
  of lwkt_getport().

* Formalize the default backend and rename it the 'thread' port backend, used
  when a message port will only be drained by a single thread.  This backend
  is able to use critical sections and IPI messages to handle races.

* Fix a small timing window in the thread port backend where replying a
  synchronous message request from a different cpu may fail to wake up
  the originator who is waiting for the message completion.

* Abstract-out the message port initialization code and clean up related
  code pollution.

* Add a new backend called the 'spin' port backend.  This backend can be
  used if a message port might be drained by several different threads.
  For example, this would allow us to use a message port as part of a
  file pointer / file descriptor construct.

* Add a boot-time tunable, lwkt.use_spin_port (defaults to off) which
  forces spin ports to be used instead of thread ports for the per-thread
  message port.  This is used only for debugging.

12 years agoFix the kinfo run/sleep state for pure kernel threads. This effects /bin/ps
Matthew Dillon [Thu, 24 May 2007 05:45:45 +0000 (05:45 +0000)]
Fix the kinfo run/sleep state for pure kernel threads.  This effects /bin/ps
and so forth.  A pure kernel thread can deschedule itself without having
to set td_wchan[], so use its presence on the LWKT run queue to determine
whether it is running or not.

12 years agoThe dump device must be opened before ioctls can be performed on it.
Matthew Dillon [Wed, 23 May 2007 17:09:33 +0000 (17:09 +0000)]
The dump device must be opened before ioctls can be performed on it.
Fix a crash related to the setting of dumpdev in early boot (in

Reported-by: "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>
12 years agoRaise the values of several debug options to cover some more code.
Sascha Wildner [Wed, 23 May 2007 17:07:55 +0000 (17:07 +0000)]
Raise the values of several debug options to cover some more code.

12 years ago* Greatly reduce the complexity of the LWKT messaging and port abstraction.
Matthew Dillon [Wed, 23 May 2007 08:57:10 +0000 (08:57 +0000)]
* Greatly reduce the complexity of the LWKT messaging and port abstraction.
  Significantly reduce the overhead of the subsystem.

* The message abort algorithm has been rewritten.  It now sends a
  separate message to issue the abort instead of trying to requeue
  the original message.  This also means the TAILQ embedded in the
  lwkt_msg structure can be used by unrelated code during processing
  of the message.

* Numerous MSGF_ flags have been removed, and all the LWKT msg/port
  algorithms have been rewritten and simplified.  The message structure
  is now only touched by the current owner in all situations.

* Numerous structural fields have been removed.  In particular, the
  fields used for message abort sequencing have been simplified and
  we do not try to embed a 'command' field in the base LWKT message
  any more.

* Clean up the netmsg abstraction, which is used all over the network stack.
  Instead of trying to overload fields in lwkt_msg we now simply extend
  the base lwkt_msg into struct netmsg.  The function dispatch now takes
  a netmsg and returns void (before we had to return EASYNC), and we no
  longer need weird casts.

  Accept/connect message aborts are now greatly simplified.

12 years agoICMP extensions for MPLS support for traceroute(8).
Hasso Tepper [Wed, 23 May 2007 06:38:22 +0000 (06:38 +0000)]
ICMP extensions for MPLS support for traceroute(8).

Obtained-from: NetBSD with some fixes

12 years agoSimplify the lwkt_msg structure by removing two unused fields and a number
Matthew Dillon [Wed, 23 May 2007 02:09:41 +0000 (02:09 +0000)]
Simplify the lwkt_msg structure by removing two unused fields and a number
of obsolete preprocessor defines.

12 years agoRemove unused define.
Matthew Dillon [Tue, 22 May 2007 21:28:56 +0000 (21:28 +0000)]
Remove unused define.

12 years agoFix section numbers.
Sascha Wildner [Tue, 22 May 2007 16:57:41 +0000 (16:57 +0000)]
Fix section numbers.

12 years agoComment out empty section.
Sascha Wildner [Tue, 22 May 2007 14:04:23 +0000 (14:04 +0000)]
Comment out empty section.

12 years agoRemove DIOCWLABEL operation. Doing it destroyed the purpose of having
Matthew Dillon [Mon, 21 May 2007 15:53:29 +0000 (15:53 +0000)]
Remove DIOCWLABEL operation.  Doing it destroyed the purpose of having
write protected areas in the first place.  This also solves an issue
bootstrapping from older versions of DragonFly since the ioctl has moved
to a different header file.

Users can write-enable the label area with disklabel -W/-N if the issue
comes up.

Note: In DragonFly 1.9 and later, the MBR and disklabel areas are only
write protected when accessed via a slice or partition.  Access to these
areas via the raw disk (e.g. ad0) is no long write-protected.

Reported-by: Hasso Tepper <hasso@estpak.ee>,
     YONETANI Tomokazu <qhwt+dfly@les.ath.cx>