dragonfly.git
13 years ago- Add KTR_IF_{BGE,EM} to opt_ktr.h
Sepherosa Ziehau [Fri, 22 Jun 2007 12:08:07 +0000 (12:08 +0000)]
- Add KTR_IF_{BGE,EM} to opt_ktr.h
- Add commented out KTR_IF_{BGE,EM} entries to LINT

Reminded-by: swildner@
# LINT compiling test is conducted with KTR_IF_{BGE,EM}

13 years agoDrain packets even if link is down.
Sepherosa Ziehau [Fri, 22 Jun 2007 11:53:40 +0000 (11:53 +0000)]
Drain packets even if link is down.

Suggested-by: joerg@
Obtained-from: NetBSD (mlelstv@netbsd.org)

13 years agoAdd some KTRs in bge(4) to count RX/TX packets per interrupt.
Sepherosa Ziehau [Thu, 21 Jun 2007 15:00:18 +0000 (15:00 +0000)]
Add some KTRs in bge(4) to count RX/TX packets per interrupt.

13 years agoAdd mpls-in-ip. Bring in some fixes from IANA and FreeBSD in progress.
Hasso Tepper [Thu, 21 Jun 2007 13:36:58 +0000 (13:36 +0000)]
Add mpls-in-ip. Bring in some fixes from IANA and FreeBSD in progress.

13 years agoUpgrade to less-406 fixing some display bugs.
Peter Avalos [Wed, 20 Jun 2007 23:37:33 +0000 (23:37 +0000)]
Upgrade to less-406 fixing some display bugs.

13 years agoAdd our READMEs.
Peter Avalos [Wed, 20 Jun 2007 23:28:28 +0000 (23:28 +0000)]
Add our READMEs.

13 years agoMerge from vendor branch LESS:
Peter Avalos [Wed, 20 Jun 2007 23:25:56 +0000 (23:25 +0000)]
Merge from vendor branch LESS:
Import less-406.

13 years agoImport less-406.
Peter Avalos [Wed, 20 Jun 2007 23:25:56 +0000 (23:25 +0000)]
Import less-406.

13 years agoFix an issue with positive namecache timeouts. Locked children often
Matthew Dillon [Wed, 20 Jun 2007 06:23:24 +0000 (06:23 +0000)]
Fix an issue with positive namecache timeouts.  Locked children often
depend on the resolved vnode in the parent ncp's remaining intact, but
the positive namecache timeout code broke that rule and caused certain
VFS functions which depend on an intact parent (rename & remove primarily)
to occassionally return EPERM.  Only zap the node if it has no children.

Reported-by: Thomas Nikolajsen <thomas.nikolajsen@mail.dk>
13 years agoCorrect a bug in the -S truncation mode where the mode was not being passed
Matthew Dillon [Tue, 19 Jun 2007 19:28:18 +0000 (19:28 +0000)]
Correct a bug in the -S truncation mode where the mode was not being passed
to open(2), resulting in new files being created with weird permissions.

13 years agoDo not blindly allow the block count to overflow. Restrict newfs filesystem
Matthew Dillon [Tue, 19 Jun 2007 19:18:20 +0000 (19:18 +0000)]
Do not blindly allow the block count to overflow.  Restrict newfs filesystem
sizes to just under 1TB and report a fatal error if the media is too large.

13 years agoThe fstype was not being properly tested for a CCD uuid.
Matthew Dillon [Tue, 19 Jun 2007 19:09:46 +0000 (19:09 +0000)]
The fstype was not being properly tested for a CCD uuid.

Correct a bug when generating an interleave table for very large disk
arrays (> 2TB).  A size variable was 32 bits instead of 64 bits.

13 years agoRefuse to label media that is too large to handle a 32 bit disklabel
Matthew Dillon [Tue, 19 Jun 2007 19:07:41 +0000 (19:07 +0000)]
Refuse to label media that is too large to handle a 32 bit disklabel
(aka > 2TB).  disklabel64 will have to be used instead on such media.

13 years agoAdd the -p pidfile option to the vkernel.
Matthew Dillon [Tue, 19 Jun 2007 17:25:48 +0000 (17:25 +0000)]
Add the -p pidfile option to the vkernel.

Submitted-by: Chris Turner <c.turner@199technologies.org>
13 years agoAdd sysctl/tunable for TX/RX interrupt coalescing variables. Default
Sepherosa Ziehau [Tue, 19 Jun 2007 14:59:41 +0000 (14:59 +0000)]
Add sysctl/tunable for TX/RX interrupt coalescing variables.  Default
values are obtained from empirical measurement on bcm5751(PCIe).
Inspired-by: Bruce Evans <brde@optusnet.com.au> on freebsd-net mail list
For a running bge(4), setting these sysctl variables will not take
effect immediately; they are committed to device in the upcoming
interrupt handler.
Adapted-from: NetBSD if_bge.c 1.58 (jonathan@netbsd.org)

# On Altima AC9100 (bcm5701 based), TX/RX interrupt coalescing values
# seem to have no effect at all :(

13 years agoRename d_obj_uuid to d_stor_uuid to conform to the naming convention being
Matthew Dillon [Tue, 19 Jun 2007 06:39:10 +0000 (06:39 +0000)]
Rename d_obj_uuid to d_stor_uuid to conform to the naming convention being
used in other structures.

13 years agoCorrect a couple of uuid retention issues. Output the storage uuid for
Matthew Dillon [Tue, 19 Jun 2007 06:38:33 +0000 (06:38 +0000)]
Correct a couple of uuid retention issues.  Output the storage uuid for
each partition and generate a new storage uuid for any partition missing
one (also regenerate it if the user deletes the storage uuid line for
that partition).

13 years agoMake some adjustments to clean up structural field names. Add type and
Matthew Dillon [Tue, 19 Jun 2007 06:07:57 +0000 (06:07 +0000)]
Make some adjustments to clean up structural field names.  Add type and
storage uuid's to the partinfo structure for the DIOCGPART ioctl and
load the fields up for GPT slices and disklabel64 partitions.

13 years agoImplement non-booting support for the DragonFly 64 bit disklabel:
Matthew Dillon [Tue, 19 Jun 2007 02:53:56 +0000 (02:53 +0000)]
Implement non-booting support for the DragonFly 64 bit disklabel:

* Add full kernel support.  Both 32 and 64 bit labels will be probed.
* Add a new program, disklabel64, which allows you to create and edit
  the new disklabel.
* Add some logic to prevent foot shooting.

DragonFly's 64 bit disklabels start at byte offset 0 on the disk slice
or GPT partition and operate in a slice-relative fashion.  No translation
is required when going from on-disk to in-core or vise-versa, unlike the
existing 32 bit disklabels.  512 bytes at the beginning of the label are
reserved for legacy boot code.  Specifically, the label starts at sector 0,
NOT sector 1, which means its location on the disk is the same regardless
of the sector size.

The label has a UUID to uniquely identify the storage and a type and
object uuid for each partition.  All location specifications are 64 bit
byte offsets, NOT logical blocks.  The label enforces an alignment
requirement for label-related I/O and partitions which defaults to 4K
regardless of the sector size.  This makes the label 100% portable across
media with different sector sizes within the constraints of the alignment
requirement.

All partitions are specified using byte offsets and sizes, constrained
by the alignment requirement, relative to the base of the label (i.e.
offset 0 in the slice).  disklabel64 will adjust the offsets for display
purposes to be relative to the partition table area.  The label headers,
partition table, and boot2 areas come BEFORE the partition table area and
partitions which overlap any of those objects are not allowed.

By default, a virgin 64 bit disklabel will reserve 32K for boot2.  As of
this writing, boot1 and boot2 blocks have not yet been implemented.

13 years agoImprove the error message for gpt add a little.
Matthew Dillon [Tue, 19 Jun 2007 02:30:35 +0000 (02:30 +0000)]
Improve the error message for gpt add a little.

13 years agoMake vkernel compile with 'options SMP'. Most functions are stubs that
Joe Talbott [Mon, 18 Jun 2007 18:57:13 +0000 (18:57 +0000)]
Make vkernel compile with 'options SMP'.  Most functions are stubs that
call panic(9).

Reviewed-By: Matt Dillon
13 years agoMove all the code related to handling the current 32 bit disklabel
Matthew Dillon [Mon, 18 Jun 2007 05:13:43 +0000 (05:13 +0000)]
Move all the code related to handling the current 32 bit disklabel
to subr_disklabel32.c.  Move the header file from sys/disklabel.h to
sys/disklabel32.h.  Rename all the related structures and constants
and retire 'struct disklabel'.

Redo the sys/disklabel.h header file to implement a generic disklabel
abstraction.  Modify kern/subr_diskslice.c to use this abstraction, with
some shims for the ops dispatch at the moment which will be cleaned up later.

Adjust all auxillary code that directly accesses 32 bit disklabels to use
the new structure and constant names.

Remove the snoop-adjust code.  The kernel would snoop reads and writes to
the disklabel area via the raw slice device (e.g. ad0s1) and convert the
disklabel from the in-core format to the on-disk format and vise-versa.
The reads and writes made by disklabel -r and the kernel's own internal
readdisklabel and writedisklabel code used the snooping.

Rearrange the kernel's internal code to manually convert the disklabel when
reading and writing.  Rearrange the /sbin/disklabel program to do the same
when the -r option is used.  Have the disklabel program also check which
DragonFly OS it is running under so it can be run on older systems.  Note
that the disklabel binary prior to these changes will NOT operate on the
disklabel properly if running on a NEW kernel.

Introduce skeleton files for 64 bit disklabel support.

13 years agoDisklabel separation work - more.
Matthew Dillon [Mon, 18 Jun 2007 00:38:08 +0000 (00:38 +0000)]
Disklabel separation work - more.

13 years agoDisklabel separation work - Generally shift all disklabel-specific
Matthew Dillon [Sun, 17 Jun 2007 23:50:16 +0000 (23:50 +0000)]
Disklabel separation work - Generally shift all disklabel-specific
procedures for the kernel proper to a new source file, subr_disklabel32.c.
Move the DTYPE_ and FS_ defines out of sys/disklabel.h and into a new
header files sys/dtype.h

Make adjustments to the uuids file, renaming "DragonFly Label" to
"DragonFly Label32" and creating a "DragonFly Label64" uuid.

13 years agoMore syslink messaging work. Now basically done except for the I/O 'DMA'
Matthew Dillon [Sun, 17 Jun 2007 21:31:07 +0000 (21:31 +0000)]
More syslink messaging work.  Now basically done except for the I/O 'DMA'
component.

13 years ago* Add a missing KMODDEP to ng_eiface and hook it into the build. [*]
Sascha Wildner [Sun, 17 Jun 2007 20:33:14 +0000 (20:33 +0000)]
* Add a missing KMODDEP to ng_eiface and hook it into the build. [*]

* Add a ng_eiface(4) manual page from FreeBSD-4 [*] and add a reference
  to it in netgraph(4).

* Add a NETGRAPH_EIFACE kernel config option.

* Sync libnetgraph with our node types.

[*] Submitted-by: Nuno-Antunes <nuno.antunes@gmail.com>

13 years agoSync with NetBSD.
Peter Avalos [Sun, 17 Jun 2007 18:00:08 +0000 (18:00 +0000)]
Sync with NetBSD.

13 years agoAdd nan, nanf, nanl.
Peter Avalos [Sun, 17 Jun 2007 17:46:01 +0000 (17:46 +0000)]
Add nan, nanf, nanl.

Dragonfly-bug:  http://bugs.dragonflybsd.org/issue632
Obtained-from:  NetBSD

13 years agoImplement SIGTERM handling. When a SIGTERM is received by a VKERNEL, it
Matthew Dillon [Sun, 17 Jun 2007 16:46:17 +0000 (16:46 +0000)]
Implement SIGTERM handling.  When a SIGTERM is received by a VKERNEL, it
will automatically shutdown.

A little shutdown kernel thread is created to handle the shutdown, since
an operation at that level of significance requires a real thread context
as a base of operations.

Submitted-by: Chris Turner <c.turner@199technologies.org>
13 years agoDisable per-channel interrupt sources before enabling the master interrupt
Matthew Dillon [Sun, 17 Jun 2007 16:34:43 +0000 (16:34 +0000)]
Disable per-channel interrupt sources before enabling the master interrupt
in AHCI mode to try to clean out BIOS spam.

13 years agoerr takes 2 arguments.
Sascha Wildner [Sun, 17 Jun 2007 14:08:00 +0000 (14:08 +0000)]
err takes 2 arguments.

13 years ago- Make "ifconfig nfeX mtu xxx" work.
Sepherosa Ziehau [Sun, 17 Jun 2007 11:38:58 +0000 (11:38 +0000)]
- Make "ifconfig nfeX mtu xxx" work.
- Don't use jumbo frames by default for chips that support jumbo frames.
  Jumbo frame pool is still allocated in case mtu is set above 1500.
Tested-by: "Rumko" <rumcic@gmail.com>
- Make number of RX descriptors tunable, hw.nfe.rx_ring_count, default
  value seems to be too small if jumbo frames are used.  Add a read-only
  sysctl node hw.nfe.rx_ring_count, which reflects the value of the newly
  added tunable.
Submitted-by: "Rumko" <rumcic@gmail.com> (w/ modification)
13 years agoImprove markup and add missing functions/values.
Sascha Wildner [Sun, 17 Jun 2007 10:53:25 +0000 (10:53 +0000)]
Improve markup and add missing functions/values.

13 years agoFix an overflow in the GPT code, I wasn't allocating enough slice structures.
Matthew Dillon [Sun, 17 Jun 2007 09:56:19 +0000 (09:56 +0000)]
Fix an overflow in the GPT code, I wasn't allocating enough slice structures.
Fix the openmask array declaration, it was declaring too-large an array.

Disallow GPT partitions with invalid spans.

When calculating a virgin disklabel take into account the possibility of
absurdly small GPT or MBR slices that would cause the calculation of
disklabel->d_ncylinders to result in 0.  Reduce the number of heads and
the number of sectors per track until a reasonable cylinder count is
achieved.

13 years agoFix compiler warning (embedded /*)
Matthew Dillon [Sun, 17 Jun 2007 08:42:31 +0000 (08:42 +0000)]
Fix compiler warning (embedded /*)

13 years agoMake indexes start at 0, not 1, so they match the GPT partition numbers.
Matthew Dillon [Sun, 17 Jun 2007 08:34:59 +0000 (08:34 +0000)]
Make indexes start at 0, not 1, so they match the GPT partition numbers.
Output <device>s<index> instead of <device>p<index>.

13 years agoCreate defaults/uuids and adjust the build to copy the file to /etc/defaults
Matthew Dillon [Sun, 17 Jun 2007 08:17:11 +0000 (08:17 +0000)]
Create defaults/uuids and adjust the build to copy the file to /etc/defaults
on upgrade.

Enter in all the UUIDs found in sys/gpt.h and generate a bunch of UUIDs
for DragonFly.

13 years agoAdjust gpt to use the new UUID lookup functions via /etc/[defaults/]uuids.
Matthew Dillon [Sun, 17 Jun 2007 08:15:08 +0000 (08:15 +0000)]
Adjust gpt to use the new UUID lookup functions via /etc/[defaults/]uuids.

Change the default partition type to the DragonFly Label type and add a
shortcut -t name 'dfly' as well.

13 years agoAugment RB tree macros even more, allowing for static declarations,
Matthew Dillon [Sun, 17 Jun 2007 07:58:33 +0000 (07:58 +0000)]
Augment RB tree macros even more, allowing for static declarations,
and separate out the LOOKUP macro for GENERATEX ops.

13 years agoFix mistake in last commit, the file locations were not changed properly.
Matthew Dillon [Sun, 17 Jun 2007 07:56:58 +0000 (07:56 +0000)]
Fix mistake in last commit, the file locations were not changed properly.

13 years agoChange the location of the files to /etc/defaults/uuids and /etc/uuids.
Matthew Dillon [Sun, 17 Jun 2007 07:47:32 +0000 (07:47 +0000)]
Change the location of the files to /etc/defaults/uuids and /etc/uuids.

13 years agoLines in /etc/uuids[.local] beginning with '#' are considered comments.
Matthew Dillon [Sun, 17 Jun 2007 07:36:28 +0000 (07:36 +0000)]
Lines in /etc/uuids[.local] beginning with '#' are considered comments.

13 years agoAdd two new UUID helper functions to libc, uuid_name_lookup() and
Matthew Dillon [Sun, 17 Jun 2007 07:35:12 +0000 (07:35 +0000)]
Add two new UUID helper functions to libc, uuid_name_lookup() and
uuid_addr_lookup().  These functions convert UUIDs to and from symbolic
names via the files /etc/uuids and /etc/uuids.local.

13 years agoOops, clean up SEE ALSO.
Sascha Wildner [Sun, 17 Jun 2007 06:39:54 +0000 (06:39 +0000)]
Oops, clean up SEE ALSO.

13 years agoClean up driver list and add wlan_ratectl(4) reference.
Sascha Wildner [Sun, 17 Jun 2007 06:35:54 +0000 (06:35 +0000)]
Clean up driver list and add wlan_ratectl(4) reference.

13 years agoAdd trunc and truncf.
Peter Avalos [Sun, 17 Jun 2007 06:26:18 +0000 (06:26 +0000)]
Add trunc and truncf.

Obtained-from:  NetBSD

13 years agoAdd the uuidgen(1) utility to the build.
Sascha Wildner [Sun, 17 Jun 2007 06:18:41 +0000 (06:18 +0000)]
Add the uuidgen(1) utility to the build.

13 years agoAdd uuidgen(2) to the build.
Sascha Wildner [Sun, 17 Jun 2007 06:06:12 +0000 (06:06 +0000)]
Add uuidgen(2) to the build.

13 years agoUse router_program.
Sascha Wildner [Sun, 17 Jun 2007 05:48:31 +0000 (05:48 +0000)]
Use router_program.

13 years agoHave UFS set the vnode type to VBAD instead of VNON so it gets cleaned
Matthew Dillon [Sun, 17 Jun 2007 05:08:52 +0000 (05:08 +0000)]
Have UFS set the vnode type to VBAD instead of VNON so it gets cleaned
up by the syncer and flusher and isn't left hanging if e.g. you pull
a USB stick out of a machine with its filesystem still mounted.

13 years agoBring in the uuidgen utility from FreeBSD.
Matthew Dillon [Sun, 17 Jun 2007 05:03:23 +0000 (05:03 +0000)]
Bring in the uuidgen utility from FreeBSD.

Obtained-from: FreeBSD / Marcel Moolenaar

13 years agoAdd subr_diskgpt.c - oops. part of the GPT commit.
Matthew Dillon [Sun, 17 Jun 2007 04:57:02 +0000 (04:57 +0000)]
Add subr_diskgpt.c - oops. part of the GPT commit.

13 years agowe do not want to shift by the block size, which is much larger than
YONETANI Tomokazu [Sun, 17 Jun 2007 03:54:07 +0000 (03:54 +0000)]
we do not want to shift by the block size, which is much larger than
the number of bits held in bio_offset.

13 years agoAdd subr_diskgpt.c to the platform conf files.
Matthew Dillon [Sun, 17 Jun 2007 03:52:03 +0000 (03:52 +0000)]
Add subr_diskgpt.c to the platform conf files.

13 years agoImplement (non-bootable) GPT support. If a PMBR partition type is detected
Matthew Dillon [Sun, 17 Jun 2007 03:51:14 +0000 (03:51 +0000)]
Implement (non-bootable) GPT support.  If a PMBR partition type is detected
the rest of the MBR is ignored and the GPT partition table will be parsed
into slices.  GPT partition 0 will be s0, GPT partition 1 will be s1, etc.
Bootable support is forthcoming.

Remove support for COMPATIBILITY_SLICE when a MBR/GPT table is present.  That
is, the COMPATIBILITY_SLICE (s0) will still point to the dangerously
dedicated disklabel or be synthesized for a CD, but it will no longer point
to the 'first BSD slice' in a real MBR or GPT table.  For GPT tables
slice 0 (s0) will point at GPT partition #0, slice 1 (s1) at
GPT partition #1, etc.

Redo the reserved sector handling code.  There is now a single reserved
sector count instead of separate fields for the slice layer and disklabel
layer.

Redo the disklabel snooping code.  Note that you cannot run an old
/sbin/disklabel in raw (-r) mode with a new OS because the old disklabel
will not turn on snooping.  For now the on-disk format remains the same,
but more changes may be forthcoming (after discussion).  I would like to
get rid of the snooping entirely.

Add kuuid_is_nil() and use it to ignore unset GPT paritions.

13 years agomake an intermediate float variable "volatile" on i386 to work around a gcc
Peter Avalos [Sun, 17 Jun 2007 02:27:53 +0000 (02:27 +0000)]
make an intermediate float variable "volatile" on i386 to work around a gcc
optimization problem: subsequent add/subs were done inside FPU registers,
with "double" precision, without rounding to "float" in between

Obtained-from:  NetBSD

13 years agoComment out dead code.
Peter Avalos [Sun, 17 Jun 2007 01:09:00 +0000 (01:09 +0000)]
Comment out dead code.

Unreachable code due to incorrect constants. Correct
constants according to the comments in the code, and add more comments.

Use float constants.

Obtained-from:  NetBSD

13 years agoFlip the order of the if statement to prevent unreachable code.
Peter Avalos [Sun, 17 Jun 2007 00:57:06 +0000 (00:57 +0000)]
Flip the order of the if statement to prevent unreachable code.

Obtained-from:  NetBSD

13 years agoForgot to update $NetBSD$ for previous commit.
Peter Avalos [Sun, 17 Jun 2007 00:53:52 +0000 (00:53 +0000)]
Forgot to update $NetBSD$ for previous commit.

13 years agoComment out dead/unreachable code.
Peter Avalos [Sun, 17 Jun 2007 00:44:00 +0000 (00:44 +0000)]
Comment out dead/unreachable code.

Obtained-from:  NetBSD

13 years agoThe second argument is not a float, so the "abi.h" abstraction
Peter Avalos [Sat, 16 Jun 2007 23:53:00 +0000 (23:53 +0000)]
The second argument is not a float, so the "abi.h" abstraction
doesn't work.
Open-code the argument handling instead.

Obtained-from:  NetBSD

13 years agoBackout the last commit, it's creating panics.
Matthew Dillon [Sat, 16 Jun 2007 23:22:32 +0000 (23:22 +0000)]
Backout the last commit, it's creating panics.

Reported-by: Sascha Wildner <saw@online.de>
13 years agoAdd MLINKS for log2 and log2f.
Peter Avalos [Sat, 16 Jun 2007 23:04:43 +0000 (23:04 +0000)]
Add MLINKS for log2 and log2f.

Reminded-by: swildner
13 years agoBring the gpt labeling program in from FreeBSD.
Matthew Dillon [Sat, 16 Jun 2007 22:29:27 +0000 (22:29 +0000)]
Bring the gpt labeling program in from FreeBSD.

Obtained-from: FreeBSD / Marcel Moolenaar

13 years agoAdd log2 and log2f.
Peter Avalos [Sat, 16 Jun 2007 22:26:53 +0000 (22:26 +0000)]
Add log2 and log2f.

Dragonfly-bug:  <http://bugs.dragonflybsd.org/issue632>
Obtained-from:  NetBSD

13 years agoCreate the USB task queues before creating the event thread to avoid
Matthew Dillon [Sat, 16 Jun 2007 20:57:59 +0000 (20:57 +0000)]
Create the USB task queues before creating the event thread to avoid
possible races with the discovery.  Clean up the event thread termination
code.

13 years agoTurn VINUM_LABEL into a noop (fixing LINT).
Sascha Wildner [Sat, 16 Jun 2007 20:48:34 +0000 (20:48 +0000)]
Turn VINUM_LABEL into a noop (fixing LINT).

According to corecode vinum is still kinda broken but that's a
separate story.

Submitted-by: Thomas Nikolajsen <thomas.nikolajsen@mail.dk>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue704>

13 years agoCorrect mistake in last commit.
Matthew Dillon [Sat, 16 Jun 2007 20:43:47 +0000 (20:43 +0000)]
Correct mistake in last commit.

13 years agoUpdate all sound code to use the snd_*() locking abstraction and sndlock_t.
Matthew Dillon [Sat, 16 Jun 2007 20:07:22 +0000 (20:07 +0000)]
Update all sound code to use the snd_*() locking abstraction and sndlock_t.

Fix issues with spinlocks being held through blocking conditions (because
DragonFly spinlocks aren't FreeBSD mutexes) by replacing the spinlocks
with lockmgr locks.

13 years agoRegenerate system callsa (add uuidgen()).
Matthew Dillon [Sat, 16 Jun 2007 20:00:37 +0000 (20:00 +0000)]
Regenerate system callsa (add uuidgen()).

13 years agoImplement an opaque function, if_getanyethermac(), which retrieves MAC
Matthew Dillon [Sat, 16 Jun 2007 19:59:30 +0000 (19:59 +0000)]
Implement an opaque function, if_getanyethermac(), which retrieves MAC
information from the first real hardware interface for use by the uuidgen
code.

13 years agoBring uuidgen(3) into libc and implement the uuidgen() system call.
Matthew Dillon [Sat, 16 Jun 2007 19:57:14 +0000 (19:57 +0000)]
Bring uuidgen(3) into libc and implement the uuidgen() system call.

Obtained-from: FreeBSD / Marcel Moolenaar

13 years agoBring in the latest sound changes from RELENG_6.
Hasso Tepper [Sat, 16 Jun 2007 19:48:05 +0000 (19:48 +0000)]
Bring in the latest sound changes from RELENG_6.

Obtained-from: FreeBSD

13 years agoImport the kernel GPT and UUID header files from FreeBSD, and bring in
Matthew Dillon [Sat, 16 Jun 2007 18:55:28 +0000 (18:55 +0000)]
Import the kernel GPT and UUID header files from FreeBSD, and bring in
kern_uuid.c from FreeBSD.

13 years agosnd_emu10kx.4 was removed today.
Sascha Wildner [Sat, 16 Jun 2007 18:48:18 +0000 (18:48 +0000)]
snd_emu10kx.4 was removed today.

13 years agoBring in manpages from RELENG_6. Manpages related to sound imported in
Hasso Tepper [Sat, 16 Jun 2007 17:44:34 +0000 (17:44 +0000)]
Bring in manpages from RELENG_6. Manpages related to sound imported in
January from FreeBSD were from HEAD, but the code from RELENG_6.

Obtained-from: FreeBSD

13 years ago- In bridge_enqueue(), dispatch the mbuf to the current cpu's netisr, instead
Sepherosa Ziehau [Sat, 16 Jun 2007 15:27:27 +0000 (15:27 +0000)]
- In bridge_enqueue(), dispatch the mbuf to the current cpu's netisr, instead
  of calling member iface's handoff directly, so we don't need to release
  bridge's serializer to avoid possible bridge/member iface serializer dead
  lock.  Add bridge_handoff(), which calls member iface's handoff directly.
- Add bridge_pfil_enqueue(), which dispatches the mbuf to the current cpu's
  netisr.  Its netisr handler runs pfil on destination before calling member
  iface's handoff.  With the help of this fucntion, bridge's serializer no
  longer needs to be released during bridge_broadcast()'s member iface
  iteration.  Originally the serializer was released mainly to:
  o  Avoid possible bridge/member iface serializer dead lock
  o  Avoid possible recursion introduced by pfil
  These are no longer applicable to the new code.
- Factor out bridge_enqueue_internal(), which dispatches the mbuf to the
  current cpu's netisr and strips MT_TAG mbufs before the dispatching.  It
  is used by bridge_{enqueue,pfil_enqueue}()
- In bridge_forward(), reorganize pfil code to minimize bridge's temporary
  serializer releasing period:
  o  For broadcast or multicast packets, push bridge_pfil(bifp, src_if) down
     into bridge_broadcast().
  o  For unicast packets, delay bridge_pfil(bifp, src_if) until we have made
     sure that the destination interface is in working state.
- In bridge_input(), if the input iface is not changed, don't go through
  the upper half of ether_input() again.
- Declare netisr_apanic_port in netisr.h, since netmsg is embedded in mbuf,
  this declaration probably will become more useful than netisr_afree_port.

Reviewed-by: dillon@
Tested-by: dillon@
13 years agoAdd a wlan_ratectl(4) manual page and reference it from drivers that support
Sascha Wildner [Sat, 16 Jun 2007 13:47:44 +0000 (13:47 +0000)]
Add a wlan_ratectl(4) manual page and reference it from drivers that support
rate control.

Loosely-based-on: wlan_amrr(4) from FreeBSD
Helped-by: sephe
13 years ago * testing
Joe Talbott [Sat, 16 Jun 2007 03:10:06 +0000 (03:10 +0000)]
 * testing

13 years agoFix typo.
Sascha Wildner [Fri, 15 Jun 2007 22:58:25 +0000 (22:58 +0000)]
Fix typo.

Spotted-by: TGEN
13 years agoAdjust Makefile like those of other drivers which support polling
Sascha Wildner [Fri, 15 Jun 2007 22:52:47 +0000 (22:52 +0000)]
Adjust Makefile like those of other drivers which support polling
(fixes 'make -DMODULES_WITH_WORLD buildworld').

Submitted-by: Thomas Nikolajsen
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue703>

13 years agoAdd some words about _Exit() and create an MLINK.
Sascha Wildner [Fri, 15 Jun 2007 19:36:33 +0000 (19:36 +0000)]
Add some words about _Exit() and create an MLINK.

Reported-by: Robin Carey <robin_carey5@yahoo.co.uk>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue702>

13 years agoAdd vfs.nfs.pos_cache_timeout to complement vfs.nfs.neg_cache_timeout.
Matthew Dillon [Fri, 15 Jun 2007 17:25:05 +0000 (17:25 +0000)]
Add vfs.nfs.pos_cache_timeout to complement vfs.nfs.neg_cache_timeout.
Because NFSv3 is stateless, the client normally relies on the server
returning ESTALE (Stale NFS handle) to determine whether a relookup is
needed.  However, this does not cover namespace issues such as rename()s
and it is possible to get into a situation where a NFS client winds up
getting permanently out of sync with a server, requiring remounting to
fix.

The positive cache timeout will force open/stat and other namespace
operations to re-lookup the name, even if the file handle is still
valid.  The performance impact tested via a buildworld with a read-only
NFS mounted /usr/src appears to be minimal.

The positive cache timeout defaults to 3 second, same as the negative cache
timeout.  The timeout can be adjusted on the fly for any new namespace
lookups but changing the sysctl will not change any namespace lookups already
cached until they timeout.

Reported-by: Joerg Sonnenberger <joerg@britannica.bec.de>
13 years agoSome non-802.11e non-standard conforming APs use seperate TX sequences
Sepherosa Ziehau [Fri, 15 Jun 2007 12:04:45 +0000 (12:04 +0000)]
Some non-802.11e non-standard conforming APs use seperate TX sequences
for non-beacon frames and beacons.  If local cache of <addr2,seq,fragno>
tuple is updated when beacons from such kind of AP are received, 802.11
duplication detection mechanism may decide to discard non-beacon retry
frames if its sequence is less than or equal to just received beacon's.
Together with the poor TX rate control algorithm chosen by these kinds
of APs, i.e. a lot of retry data frames, a TCP connection can be choked
by STA's duplication detection mechanism.

To handle these kinds of APs (yep, we are in the world of compat):
Don't update cache of <addr2,seq,fragno> tuple for multicast or broadcast
802.11 MAC frames.  This does not violate IEEE Std 802.11, 1999 Edition
subclause 9.2.9, which actually allows us to "omit tuples obtained from
broadcast/multicast ...".

Thank Petr Janda <elekktretterr@exemail.com.au> for providing all
necessary 802.11 tcpdumps to track down the problem.

Thank dillon@ for analyzing some tcpdumps which leads me to think that
the reported problem may be caused by the duplication detection in
802.11 layer.

Reported-by: Petr Janda <elekktretterr@exemail.com.au>
Tested-by: Petr Janda <elekktretterr@exemail.com.au>
13 years agodisklabel(8) and newfs(8) now act on the compatibility slice (s0)
Sascha Wildner [Fri, 15 Jun 2007 10:45:33 +0000 (10:45 +0000)]
disklabel(8) and newfs(8) now act on the compatibility slice (s0)
instead of the raw disk device.

Submitted-by: Nuno Antunes <nuno.antunes@gmail.com>
13 years agoThe text states that the CSPRNG is seeded from /dev/urandom, so add a
Sascha Wildner [Fri, 15 Jun 2007 10:10:13 +0000 (10:10 +0000)]
The text states that the CSPRNG is seeded from /dev/urandom, so add a
reference to urandom(4).

Reported-by: Robin Carey <robin_carey5@yahoo.co.uk>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue701>

13 years agoFix conditionals to prevent endless loop.
Simon Schubert [Fri, 15 Jun 2007 07:02:51 +0000 (07:02 +0000)]
Fix conditionals to prevent endless loop.

Reported-by: swildner
Duh-to:  corecode

13 years agoRemove obsolete names (MLINKS have been switched to nata(4)).
Sascha Wildner [Fri, 15 Jun 2007 05:53:06 +0000 (05:53 +0000)]
Remove obsolete names (MLINKS have been switched to nata(4)).

13 years agoDocument that nata(4) is now our default ATA driver:
Sascha Wildner [Thu, 14 Jun 2007 23:00:36 +0000 (23:00 +0000)]
Document that nata(4) is now our default ATA driver:

* Bring in a modified version of FreeBSD's ata(4) manual page as nata(4).

* Adjust related manual pages.

* Remove sata(4) MLINK.

13 years agoAllow vchans to have their own volume control.
Simon Schubert [Thu, 14 Jun 2007 21:48:36 +0000 (21:48 +0000)]
Allow vchans to have their own volume control.

This means you can use two processes producing audio and change their volume
independently (if they implement mixer controls themselves).

13 years agoCDRom -> CD-ROM
Sascha Wildner [Thu, 14 Jun 2007 21:16:13 +0000 (21:16 +0000)]
CDRom -> CD-ROM

13 years ago* Fix the example for configuring /etc/ttys according to the original
Sascha Wildner [Thu, 14 Jun 2007 21:11:29 +0000 (21:11 +0000)]
* Fix the example for configuring /etc/ttys according to the original
  instructions Matt posted on the lists.

* CDRom -> CD-ROM

* Start sentence with a capital letter.

13 years agoTo create a disklabel, the vn0s0 device is now used instead of the raw
Sascha Wildner [Thu, 14 Jun 2007 21:02:57 +0000 (21:02 +0000)]
To create a disklabel, the vn0s0 device is now used instead of the raw
device vn0.

Submitted-by: Nuno Antunes <nuno.antunes@gmail.com>
13 years agoWhen getnewvnode() is called the vnode's v_type defaults to VNON. Syncer
Matthew Dillon [Thu, 14 Jun 2007 02:55:27 +0000 (02:55 +0000)]
When getnewvnode() is called the vnode's v_type defaults to VNON.  Syncer
vnodes are also set to VNON and any vnode that is accessed without locking
whos v_type is VNON is probably in the middle of being initialized.  For
this reason the mountlist scan and vflush code typically ignores such
vnodes.

If a read error occurs while initializing a vnode, in particular if a hash
collision occurs or an I/O error occurs reading the inode, the vnode's
v_type was being left set to VNON.  Explicitly set it to VBAD for msdosfs
and ufs (other FS's probably need the same treatment) so the flush and
reclaim code can reuse the vnode.

This fixes 'dangling vnode' panics on unmount for filesystems which incur
I/O errors, such as when one pulls a USB memory stick out while it is
still mounted.

13 years agoxpt_bus_deregister() never returns 0, don't test for it.
Matthew Dillon [Thu, 14 Jun 2007 01:10:25 +0000 (01:10 +0000)]
xpt_bus_deregister() never returns 0, don't test for it.

Assert that the sim is attached if a backend sim function is called,
because cam_sim_free() now replaces the functions when the sim is
detached.

13 years agoDo not destroy the device queue, it is needed by the peripheral code
Matthew Dillon [Thu, 14 Jun 2007 01:09:30 +0000 (01:09 +0000)]
Do not destroy the device queue, it is needed by the peripheral code
(e.g. scsi/scsi_da.c, etc) even if the backend hardware has disappeared.
When cam_sim_free() is called, set up a dummy poll and action callback
and make the action callback generate an I/O error.

This allows things like filesystem mounts of USB memory sticks to start
returning I/O errors instead of blocking forever if the stick is pulled.

13 years agoExpand the diskslice->ds_openmask from 8 bits to 256 bits to cover all
Matthew Dillon [Wed, 13 Jun 2007 20:58:38 +0000 (20:58 +0000)]
Expand the diskslice->ds_openmask from 8 bits to 256 bits to cover all
possible partitions.  Partitions from 'i' on, and the whole-disk partition,
were not being properly tracked, resulting in multiple device opens and
device closes to the underlying device.

In particular, this caused USB memory sticks to connect to the CAM driver
with ever-increasing DA#n unit numbers because CAMs reference counting got
seriously corrupted.

Reported-by: "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>
13 years agodev_dopen() can be called multiple times with only one dev_dclose() when
Matthew Dillon [Wed, 13 Jun 2007 20:53:39 +0000 (20:53 +0000)]
dev_dopen() can be called multiple times with only one dev_dclose() when
D_TRACKCLOSE is not specified.  Make sure multiple opens only reference
the CAM peripheral once and complain if dev_dclose() is called more then
once.

This also prevents bugs in higher layers from propogating to lower ones.

13 years agoRefuse to poll a detached sim.
Matthew Dillon [Wed, 13 Jun 2007 20:45:24 +0000 (20:45 +0000)]
Refuse to poll a detached sim.

13 years agoDont poll PS/2 mouse interrupts, it can cause the mouse to get jumpy.
Matthew Dillon [Wed, 13 Jun 2007 17:15:25 +0000 (17:15 +0000)]
Dont poll PS/2 mouse interrupts, it can cause the mouse to get jumpy.
Also, the keyboard/mouse code is full of DELAY()s and pretty nasty
in general.