dragonfly.git
16 years agoQuickly update UPDATING with 1.8 -> 1.9+ documentation.
Matthew Dillon [Sun, 20 May 2007 01:07:30 +0000 (01:07 +0000)]
Quickly update UPDATING with 1.8 -> 1.9+ documentation.

16 years agoDisklabel operations are no longer legal on the raw disk, use DIOCGPART to
Matthew Dillon [Sat, 19 May 2007 21:43:32 +0000 (21:43 +0000)]
Disklabel operations are no longer legal on the raw disk, use DIOCGPART to
get the geometry.

16 years agoInclude geometry data in DIOCGPART so fdisk can use it instead of trying
Matthew Dillon [Sat, 19 May 2007 21:37:01 +0000 (21:37 +0000)]
Include geometry data in DIOCGPART so fdisk can use it instead of trying
to read a faked disklabel.

Change MAKEDEV to create 'compatibility slice' devices, e.g. da0s0a,
da0s0b, etc.  Previously the compatibility slice devices were e.g. da0a, da0b,
and there was no 'whole slice' device for the compatibility slice at all,
meaning one couldn't disklabel it.  Now there is, e.g. da0s0.

16 years agoFix device recognition, /dev/vn0 now uses WHOLE_SLICE_PART, not partition 'c'.
Matthew Dillon [Sat, 19 May 2007 20:31:16 +0000 (20:31 +0000)]
Fix device recognition, /dev/vn0 now uses WHOLE_SLICE_PART, not partition 'c'.

16 years agoFix a one-character allocated string buffer overflow that was introduced
Matthew Dillon [Sat, 19 May 2007 19:33:02 +0000 (19:33 +0000)]
Fix a one-character allocated string buffer overflow that was introduced
in the last commit.  Space for the '/' separator was not being accounted
for.

Reported-by: "Sepherosa Ziehau" <sepherosa@gmail.com>
16 years agoMiscellaneous mdoc fixes.
Sascha Wildner [Sat, 19 May 2007 17:32:13 +0000 (17:32 +0000)]
Miscellaneous mdoc fixes.

16 years agoKeep the ds_skip_* fields in struct diskslice properly synchronized.
Matthew Dillon [Sat, 19 May 2007 09:46:18 +0000 (09:46 +0000)]
Keep the ds_skip_* fields in struct diskslice properly synchronized.
ds_skip_bsdlabel is inclusive of bsd_skip_platform but was being improperly
set to 0 even when an mbr reserved sector existed.  The fields were not
being properly reset for a slice whos disklabel is destroyed.

Defer reading the disklabel on a slice until a partition on the slice
is opened or a disklabel related DIOC ioctl is performed on the slice.
In particular, we do not attempt to read the disklabel when opening the
whole-disk-slice for the whole disk or the whole-slice-partition for a slice.

Previously the code attempted to scan all available BSD slices for
disklabels.

When writing to a raw slice, do not snoop or do reserved-sector checks
unless a disklabel has been loaded for the slice.  Typically a disklabel
will only be loaded in two situations: (1) if filesystems are mounted from
that slice or (2) the disklabel program has performed ioctls on the
whole-slice-partition to set a disklabel.  Now writing to raw slices works
almost the same as writing to the whole-disk-slice, with no interpretation.

Remove all remaining references to the LABELSECTOR constant.  Instead,
use the ds_skip_* fields to determine the sector where the disklabel
starts within a slice.  These changes significantly cleaned up the
snoop and reserved sector checking code in dscheck().

16 years agoContinue untangling the disklabel. Clean up dumpdev handling by having
Matthew Dillon [Sat, 19 May 2007 07:05:26 +0000 (07:05 +0000)]
Continue untangling the disklabel.  Clean up dumpdev handling by having
it use DIOCGPART instead of trying to access the disklabel directly, and
replace references to LABELSECTOR with partinfo.skip_bsdlabel.

16 years agoMake savecore work wagain by using the new 64 bit dumplo (_dumplo64).
Matthew Dillon [Sat, 19 May 2007 06:54:29 +0000 (06:54 +0000)]
Make savecore work wagain by using the new 64 bit dumplo (_dumplo64).

16 years agoTemporary hack until we can get rid of the disklabel dependancies.
Matthew Dillon [Sat, 19 May 2007 06:39:39 +0000 (06:39 +0000)]
Temporary hack until we can get rid of the disklabel dependancies.
DIOCGDINFO and DIOCWDINFO can only operate on the slice, not on the
partition.  Figure out the name of the slice and temporarily open a
descriptor to read and update the label.

16 years ago- Turn on VLAN_MTU for 905B typed cards.
Sepherosa Ziehau [Sat, 19 May 2007 06:21:43 +0000 (06:21 +0000)]
- Turn on VLAN_MTU for 905B typed cards.
- Adjust SIOCSIFCAP logic, after turning on VLAN_MTU.

Tested-with: 3c905C-TX, 3c575C, 3c905-TX

#
# Non-905B cards were claimed to work with VLAN_MTU, but
# it turns out my 3c905-TX can't hear packets, whose size
# are > 1514 (excluding CRC).
#
# I conducted the following two 'ping' tests:
#
# 192.168.4.2 vlan iface, whose parent device is a 3c905-TX
# based xl(4)
# 192.168.4.1 vlan iface, whose parent device is a 3c575
# based xl(4)
#
# TEST1:
# On 192.168.4.1
# Run 'tcpdump -e -ni xl1' when 'ping -s 1468 192.168.4.2':
# 14:09:06.049912 00:10:5a:9f:bc:d5 > 00:01:02:e3:dd:b5,
# ethertype 802.1Q (0x8100), length 1514: vlan 11, p 0,
# ethertype IPv4, 192.168.4.2 > 192.168.4.1: ICMP echo reply,
# id 1283, seq 4352, length 1476
# 14:09:07.069522 00:01:02:e3:dd:b5 > 00:10:5a:9f:bc:d5,
# ethertype 802.1Q (0x8100), length 1514: vlan 11, p 0,
# ethertype IPv4, 192.168.4.1 > 192.168.4.2: ICMP echo request,
# id 1283, seq 4608, length 1476
#
# Above test shows 3c905 still works when packets size is 1514.
#
#
# TEST2:
# Run 'tcpdump -e -ni xl1' when 'ping -s 1469 192.168.4.2':
# 14:12:07.119839 00:01:02:e3:dd:b5 > 00:10:5a:9f:bc:d5,
# ethertype 802.1Q (0x8100), length 1515: vlan 11, p 0,
# ethertype IPv4, 192.168.4.1 > 192.168.4.2: ICMP echo request,
# id 2563, seq 2048, length 1477
# 14:12:08.140366 00:01:02:e3:dd:b5 > 00:10:5a:9f:bc:d5,
# ethertype 802.1Q (0x8100), length 1515: vlan 11, p 0,
# ethertype IPv4, 192.168.4.1 > 192.168.4.2: ICMP echo request,
# id 2563, seq 2304, length 1477
#
# Tcpdump is also run on 192.168.4.2 during the second test,
# nothing pops up at all.
#
# Above test shows 3c905 does NOT work when packets size is 1515,
# i.e. > 1514
#

16 years agoImplement raw extensions for WHOLE_DISK_SLICE device accesses for acd0.
Matthew Dillon [Sat, 19 May 2007 02:39:05 +0000 (02:39 +0000)]
Implement raw extensions for WHOLE_DISK_SLICE device accesses for acd0.
Disallow special accesses on devices that do not support the extensions.

Implement direct track reading via /dev/acd0 or /dev/acd0t* (use
MAKEDEV acd0t to create per-track devices).

Fix a few bugs with the minor device numbers generated by MAKEDEV for
/dev/acd*.  /dev/acd0a and /dev/acd0c were improperly specifying the
WHOLE_DISK_SLICE instead of the compatibility slice.

Change all mountroot operations that were trying to access disks via
RAW_PART to instead access them via WHOLE_SLICE_PART (removing more
dependancies on the old disklabel structure).

Replace the unconditional sector sanity check in dsopen() with better
sanity checks in dscheck().  The checks are not made for special
WHOLE_DISK_SLICE accesses, allowing weird sector sizes to feed through to
the device.

16 years agoUse the WHOLE_DISK_SLICE instead of the compatibility slice to
Matthew Dillon [Sat, 19 May 2007 01:31:46 +0000 (01:31 +0000)]
Use the WHOLE_DISK_SLICE instead of the compatibility slice to
access CD tracks.

16 years agoContinue untangling the disklabel.
Matthew Dillon [Sat, 19 May 2007 00:52:02 +0000 (00:52 +0000)]
Continue untangling the disklabel.

* Move dk*() inline functions and other related stuff not directly related
  to the BSD disklabel out of sys/disklabel.h and into sys/diskslice.h.
  Add additional functions to sys/diskslice.h

* Extend the slice and partition fields in the device minor number.  We
  now support up to 128 slices and up to 256 partitions.

* Implement new minor device numbers for 'raw slices', such as ad0s1.
  Previously raw slices used the same minor number as partition c within
  the slice.  e.g. ad0s1 and ad0s1c had the same device number.
  This made it impossible to distinguish between the two.

  The 'whole disk' device's minor number has also changed.  Our new whole-slice
  and whole-disk devices specify a partition number of (DKMAXPARTITIONS - 1)
  (aka 255).

* Completely disable disklabel related operations on the raw disk, e.g.
  da0, and on partitions, e.g. da0s1a.  Only allow disklabel
  operations on whole slices, e.g. da0s1.

  NOTE!! For compatibility while booting drivers which set DSO_COMPATLABEL,
  the compat disklabel may be read, but not written, via the whole-disk
  device.  e.g. acd0.

  NOTE!! For compatibility we have no choice but to continue to snoop
  read/write operations on raw slices (e.g. da0s1) because the
  disklabel program and the kernel still depend on the snooping to modify
  the in-core version of the disklabel to the on-disk version.

  No snooping will occur on the whole-disk device (e.g. da0).

  No snooping will occur on raw slices (e.g. da0s1) if the disk is
  unlabeled and no in-core label was set.  Note that disklabel -r -w
  DOES set an in-core label before writing to a raw-slice, so it is still
  ok.

* dsopen() no longer attempts to scan the MBR or slice table when the
  whole-disk device (e.g. da0) is opened, and no longer attempts to read
  the disklabel when the whole-slice device is opened (e.g. da0s1).  The
  disklabel is only read when a partition is explicitly opened or the
  label is explicitly read via an ioctl.

* The virgin disklabel is stored in the struct diskslice for
  WHOLE_DISK_SLICE (slice 1).

16 years agoUpdate # comments and documentation for disktab(5).
Matthew Dillon [Fri, 18 May 2007 17:14:14 +0000 (17:14 +0000)]
Update # comments and documentation for disktab(5).

16 years agoCleanup shutdown(2) usage and make it consistent. The implementation in rsh
Matthew Dillon [Fri, 18 May 2007 17:05:13 +0000 (17:05 +0000)]
Cleanup shutdown(2) usage and make it consistent.  The implementation in rsh
was particularly amusing.

Submitted-by: "Nuno Antunes" <nuno.antunes@gmail.com>
16 years agoFinish moving boot/i386 to boot/pc32 (it was left half done), remove
Matthew Dillon [Fri, 18 May 2007 07:41:43 +0000 (07:41 +0000)]
Finish moving boot/i386 to boot/pc32 (it was left half done), remove
boot/i386, and cleanup boot/pc32.

16 years agouse_mcd.h, use_scd.h no longer exist.
Matthew Dillon [Fri, 18 May 2007 03:12:02 +0000 (03:12 +0000)]
use_mcd.h, use_scd.h no longer exist.

16 years agoRemove the NATA config file generation rules. Add a rule to the check:
Matthew Dillon [Fri, 18 May 2007 02:13:04 +0000 (02:13 +0000)]
Remove the NATA config file generation rules.  Add a rule to the check:
target to check that the NATA config file exists instead.

16 years agoAdd back PCI_MAP_FIXUP, it was mistakenly removed.
Matthew Dillon [Fri, 18 May 2007 02:07:57 +0000 (02:07 +0000)]
Add back PCI_MAP_FIXUP, it was mistakenly removed.

Reported-by: Sascha
16 years agoFix buildworld, getdiskbyname() has moved to <disktab.h>
Matthew Dillon [Thu, 17 May 2007 23:53:44 +0000 (23:53 +0000)]
Fix buildworld, getdiskbyname() has moved to <disktab.h>

16 years agoAdd getdisktabbyname() to libc. This will soon replace getdiskbyname().
Matthew Dillon [Thu, 17 May 2007 23:50:00 +0000 (23:50 +0000)]
Add getdisktabbyname() to libc.  This will soon replace getdiskbyname().
Move _PATH_DISKTAB to <disktab.h>, remove #define DISKTAB entirely.

16 years agoRemove libdisk from the Makefile.
Matthew Dillon [Thu, 17 May 2007 21:09:47 +0000 (21:09 +0000)]
Remove libdisk from the Makefile.

16 years agoRemove #include <sys/disklabel.h> from various source files which no longer
Matthew Dillon [Thu, 17 May 2007 21:08:50 +0000 (21:08 +0000)]
Remove #include <sys/disklabel.h> from various source files which no longer
need it.

16 years agoUse DIOCGPART instead of DIOCGDINFO to remove references to the disklabel
Matthew Dillon [Thu, 17 May 2007 21:07:13 +0000 (21:07 +0000)]
Use DIOCGPART instead of DIOCGDINFO to remove references to the disklabel
from linux_ioctl_BLKGETSIZE(), and rename the function to
linux_ioctl_BLKGETSIZE32().

16 years agoSynchronize the NATA kernel build.
Matthew Dillon [Thu, 17 May 2007 21:06:01 +0000 (21:06 +0000)]
Synchronize the NATA kernel build.

16 years agoRemove libdisk from the build.
Matthew Dillon [Thu, 17 May 2007 20:43:03 +0000 (20:43 +0000)]
Remove libdisk from the build.

16 years agoRemove mcd(4) and scd(4) remains.
Sascha Wildner [Thu, 17 May 2007 19:26:06 +0000 (19:26 +0000)]
Remove mcd(4) and scd(4) remains.

16 years agoRemove support for mcd and scd - these were old proprietary ISA cdrom
Matthew Dillon [Thu, 17 May 2007 17:55:17 +0000 (17:55 +0000)]
Remove support for mcd and scd - these were old proprietary ISA cdrom
interfaces that haven't been in the build for ages.

16 years agoRemove the roll-your-own disklabel from the ATA CD driver. Use the
Matthew Dillon [Thu, 17 May 2007 17:44:27 +0000 (17:44 +0000)]
Remove the roll-your-own disklabel from the ATA CD driver.  Use the
disk management layer instead.

16 years agoFix typo.
Sascha Wildner [Thu, 17 May 2007 16:36:31 +0000 (16:36 +0000)]
Fix typo.

16 years agoInclude <diskslice.h> for DIOCGPART. This fixes the LINT build.
Sascha Wildner [Thu, 17 May 2007 15:05:27 +0000 (15:05 +0000)]
Include <diskslice.h> for DIOCGPART. This fixes the LINT build.

16 years agoNext round of fixing all kinds of spelling mistakes.
Sascha Wildner [Thu, 17 May 2007 08:19:03 +0000 (08:19 +0000)]
Next round of fixing all kinds of spelling mistakes.

16 years agoKill references to the recently removed diskpart(8).
Sascha Wildner [Thu, 17 May 2007 06:12:05 +0000 (06:12 +0000)]
Kill references to the recently removed diskpart(8).

16 years agoRemove the roll-your-own disklabel from CCD. Use the kernel disk manager
Matthew Dillon [Thu, 17 May 2007 03:20:13 +0000 (03:20 +0000)]
Remove the roll-your-own disklabel from CCD.  Use the kernel disk manager
for disklabel support instead.

Make CCD a real disk device rather then a fake one.  NOTE: All /dev/ccd*
devices have changed and must be remade

Introduce DSO_COMPATMBR.  This forces an MBR sector to be reserved in front
of a disklabel even when the target disk does not have slices.  It is used
by the CCD and VN devices to keep the disklabel aligned the same way it has
been historically.

Implement 64 bit block addressing for CCD.

Implement a new filesystem type "ccd", and require that the devices backing
the CCD use that filesystem type for safety.

Fix a bug in DIOCGPART where the partinfo->media_blocks was not being
set properly for partitions.

16 years agoAdd dev_drefs() - return the number of references on a cdev_t
Matthew Dillon [Thu, 17 May 2007 03:02:00 +0000 (03:02 +0000)]
Add dev_drefs() - return the number of references on a cdev_t

16 years agoPort 16 byte SCSI command support from FreeBSD. This adds support for
Matthew Dillon [Wed, 16 May 2007 20:59:38 +0000 (20:59 +0000)]
Port 16 byte SCSI command support from FreeBSD.  This adds support for
detecting and performing I/O on disks greater then 2TB (with more
then 2^32 blocks).

Remove KKASSERT from dual user/kernel compiled file - reported by Sascha

Obtained-from: FreeBSD / Kenneth D. Merry did the original FreeBSD work.

16 years agoE2BIG -> EFBIG
Sepherosa Ziehau [Wed, 16 May 2007 14:37:55 +0000 (14:37 +0000)]
E2BIG -> EFBIG

16 years agoE2BIG -> EFBIG
Sepherosa Ziehau [Wed, 16 May 2007 14:24:40 +0000 (14:24 +0000)]
E2BIG -> EFBIG

16 years agoContinue untangling the disklabel. Add sector index reservation fields
Matthew Dillon [Wed, 16 May 2007 05:20:26 +0000 (05:20 +0000)]
Continue untangling the disklabel.  Add sector index reservation fields
to the diskslice and partinfo structures.  These fields will replace the
hardcoded LABELSECTOR constant and also help manage reserved areas in
the disklabel.

16 years agoSupport 64 bit file sizes and 64 bit sector numbers.
Matthew Dillon [Tue, 15 May 2007 22:45:10 +0000 (22:45 +0000)]
Support 64 bit file sizes and 64 bit sector numbers.

16 years ago* The diskslice abstraction now stores offsets/sizes as 64 bit quantities.
Matthew Dillon [Tue, 15 May 2007 22:44:21 +0000 (22:44 +0000)]
* The diskslice abstraction now stores offsets/sizes as 64 bit quantities.
  (NOTE: DOS partition tables and standard disklabels can't handle 64 bit
  sector numbers yet).  For future pluggable disklabel/partitioning schemes.

* The kernel panic / kernel core API is now 64 bits.

* The VN device now uses 64 bit sector numbers and can handle block devices
  up to what is supported by the filesystem (typically 8TB).  This change
  was made primarily so we can test future disklabel / partition table
  support.

* Pass 64 bit LBAs to various block devices and to the SCSI layer.

* Check for and assert 32 bit overflow conditions in various places, instead
  of wrapping.

16 years agoThe normal ATA driver is capable of handling 48 bit block addressing, but
Matthew Dillon [Tue, 15 May 2007 20:29:16 +0000 (20:29 +0000)]
The normal ATA driver is capable of handling 48 bit block addressing, but
the blockaddr field in the ad_request structure was only 32 bits.  Expand it
to 64 bits.  Note that NATA didn't have this problem.

16 years agoAdd a new command, /sbin/diskinfo, which uses the revamped DIOCGPART
Matthew Dillon [Tue, 15 May 2007 17:53:11 +0000 (17:53 +0000)]
Add a new command, /sbin/diskinfo, which uses the revamped DIOCGPART
ioctl to extract information from storage devices.  As an added bonus,
the physical byte offset relative to the base of the raw device
for the beginning of a slice or partition can be displayed.  Great for
debugging.

16 years agoContinue untangling the disklabel. Reorganize struct partinfo and the
Matthew Dillon [Tue, 15 May 2007 17:51:04 +0000 (17:51 +0000)]
Continue untangling the disklabel.  Reorganize struct partinfo and the
DIOCGPART ioctl to extract the required information directly, and fix
the DIOCGPART ioctl direction so userland can use it.

This removes numerous disklabel references, particularly from the filesystem
code which was doing silly indirections just to figure out the sector size.

NOTE: The absolute byte offset of the slice or partition (relative to the
base of the raw disk) is also made available, but is not currently used
by the kernel.

16 years ago- Fix a typo which may leave promisc/allmulti mode mis-configured.
Sepherosa Ziehau [Tue, 15 May 2007 12:58:45 +0000 (12:58 +0000)]
- Fix a typo which may leave promisc/allmulti mode mis-configured.
- Clean up bge_ioctl() a little bit:
  o  Nuke unnecessay local variable 'flags', use 'mask' instead.
  o  Move 'mii' declaration near its usage.
  o  Nuke redundant 'error' resetting.
- Minor style changes.

16 years agoContinue untangling the disklabel. Use the generic disk_info structure
Matthew Dillon [Tue, 15 May 2007 05:37:39 +0000 (05:37 +0000)]
Continue untangling the disklabel.  Use the generic disk_info structure
to hold template information instead of the disklabel structure.

This removes all references to the disklabel structure from the MBR code
and leaves mostly opaque references in the slice code.

16 years agoContinue untangling the disklabel. Have most disk device drivers fill out
Matthew Dillon [Tue, 15 May 2007 00:01:04 +0000 (00:01 +0000)]
Continue untangling the disklabel.  Have most disk device drivers fill out
and install a generic disk_info structure instead of filling out random
fields in the disklabel.

The generic disk_info structure uses a 64 bit integer to represent
the media size in bytes or total sector count.

16 years agoRemove diskpart(8) manual page.
Sascha Wildner [Mon, 14 May 2007 21:26:56 +0000 (21:26 +0000)]
Remove diskpart(8) manual page.

16 years agoStart untangling the disklabel from various bits of code with the goal of
Matthew Dillon [Mon, 14 May 2007 20:02:45 +0000 (20:02 +0000)]
Start untangling the disklabel from various bits of code with the goal of
introducing support for a new 64 bit disklabel.

Remove the D_* flags for disklabel.d_flags.  These sorts of flags just do
not belong in the disk image.

Relabel the partition sub-structure in disktab.h, and remove other ancient
compatibility defines in disklabel.h.

16 years agoRemove the ancient diskpart program.
Matthew Dillon [Mon, 14 May 2007 19:28:40 +0000 (19:28 +0000)]
Remove the ancient diskpart program.

16 years agoLink to pkgsrc(7) instead of packages(7).
Sascha Wildner [Mon, 14 May 2007 14:28:47 +0000 (14:28 +0000)]
Link to pkgsrc(7) instead of packages(7).

16 years agoUse M_DONTWAIT for mcluster allocation on em_init() path to prevent system
Sepherosa Ziehau [Mon, 14 May 2007 12:31:41 +0000 (12:31 +0000)]
Use M_DONTWAIT for mcluster allocation on em_init() path to prevent system
hanging, if user configures RX descriptors to the maximum allowable value,
but kern.ipc.nmbclusters tunable is forgotten to be adjusted accordingly.

System-Hanging-Experienced-by: hasso@ :P
# This commit can be reverted once object cache limit can grow automaticly.

16 years agoAdd NetBSD's pkgsrc(7) manpage.
Sascha Wildner [Mon, 14 May 2007 11:31:23 +0000 (11:31 +0000)]
Add NetBSD's pkgsrc(7) manpage.

16 years agoRemove old unused cruft.
Matthew Dillon [Mon, 14 May 2007 05:58:59 +0000 (05:58 +0000)]
Remove old unused cruft.

16 years agoMake the kern.ipc.nmbclusters and kern.ipc.nmbufs sysctls read-only.
Matthew Dillon [Sun, 13 May 2007 22:56:59 +0000 (22:56 +0000)]
Make the kern.ipc.nmbclusters and kern.ipc.nmbufs sysctls read-only.
These may only be set as boot-time variables in /boot/loader.conf.

Adjusting them after the fact w/sysctl will not update the objcache limits
and will cause a ton of confusion because then netstat -m will report
the adjusted limits but the system won't actually be using the adjusted
limits.

objcache mbuf limits can be adjusted dynamically, we just need some code to
do it -> for the future!

Reported-by: Peter Avalos <pavalos@theshell.com>
16 years agoAnother round of spelling fixes in manpages, messages, readmes etc.
Sascha Wildner [Sun, 13 May 2007 22:25:42 +0000 (22:25 +0000)]
Another round of spelling fixes in manpages, messages, readmes etc.

16 years agoMy round of spelling corrections in /share/man.
Hasso Tepper [Sun, 13 May 2007 20:29:48 +0000 (20:29 +0000)]
My round of spelling corrections in /share/man.

16 years agoFix numerous spelling mistakes.
Sascha Wildner [Sun, 13 May 2007 18:33:59 +0000 (18:33 +0000)]
Fix numerous spelling mistakes.

16 years agoOoops, cache_inval_vp_nonblock() was being called too late, after the
Matthew Dillon [Sun, 13 May 2007 04:34:47 +0000 (04:34 +0000)]
Ooops, cache_inval_vp_nonblock() was being called too late, after the
vgone() call instead of before.  Change the semantics to call it beforehand,
document that no new namecache associations can be made once a vnode is marked
for reclamation, and assert that no new namecache associations have been
made later on when the reclaimed vnode is reused.

16 years agoFix a vnode recyclement namecache<->vnode deadlock introduced with recent
Matthew Dillon [Sun, 13 May 2007 02:34:22 +0000 (02:34 +0000)]
Fix a vnode recyclement namecache<->vnode deadlock introduced with recent
changes.  Two primary fixes have been made to the allocvnode and vnlru
recyclement code.

There are still a few possible deadlocks in less traveled code
paths (such as in procfs) that existed prior to recent changes.

Reported-by: Peter Avalos <pavalos@theshell.com>,
     Thomas Nikolajsen <thomas.nikolajsen@mail.dk>

16 years agoRemove variables that are no longer used due to the previous commit.
Matthew Dillon [Sun, 13 May 2007 01:32:28 +0000 (01:32 +0000)]
Remove variables that are no longer used due to the previous commit.

16 years agoUse .Nm
Sascha Wildner [Sat, 12 May 2007 23:22:36 +0000 (23:22 +0000)]
Use .Nm

16 years agoSort references
Sascha Wildner [Sat, 12 May 2007 23:00:16 +0000 (23:00 +0000)]
Sort references

16 years agoMake fsstress compile.
Sascha Wildner [Sat, 12 May 2007 21:46:49 +0000 (21:46 +0000)]
Make fsstress compile.

16 years agoUse .Nx
Sascha Wildner [Sat, 12 May 2007 21:27:31 +0000 (21:27 +0000)]
Use .Nx

16 years agoUse .At, .Bsx, .Fx, .Nx and .Ox
Sascha Wildner [Sat, 12 May 2007 21:22:11 +0000 (21:22 +0000)]
Use .At, .Bsx, .Fx, .Nx and .Ox

16 years agoUse .Pa for URLs
Sascha Wildner [Sat, 12 May 2007 21:16:23 +0000 (21:16 +0000)]
Use .Pa for URLs

16 years agoUse .An/.Aq
Sascha Wildner [Sat, 12 May 2007 21:15:35 +0000 (21:15 +0000)]
Use .An/.Aq

16 years agoAdd missing newline.
Sascha Wildner [Sat, 12 May 2007 18:05:43 +0000 (18:05 +0000)]
Add missing newline.

16 years agoUse GNU style like the rest of the file for my last commit.
Sascha Wildner [Sat, 12 May 2007 09:18:52 +0000 (09:18 +0000)]
Use GNU style like the rest of the file for my last commit.

16 years agoSync newsyslog(8) with FreeBSD's current code.
Sascha Wildner [Sat, 12 May 2007 08:52:00 +0000 (08:52 +0000)]
Sync newsyslog(8) with FreeBSD's current code.

New things:

* Re-ordering of the rotate/signal steps. First, rotate all files which
  need to be rotated and then send a single signal to each daemon that
  needs to be notified. This way, each daemon will only be signaled once
  instead of once per file.

* Allow /var/log to be a symbolic link.

* -d option for specifying an alternate root for log files.

* -D option for debugging purposes.

* -N option to suppress log file rotation (intended to be used in
  conjunction with -C and -CC).

* Bug fixes and minor improvements.

Note: FreeBSD's r1.107 of newsyslog.c was not brought in as it generates
      a warning in DragonFly instead of fixing one.

16 years agoReset ifnet.if_timer in bge_stop()
Sepherosa Ziehau [Sat, 12 May 2007 08:39:56 +0000 (08:39 +0000)]
Reset ifnet.if_timer in bge_stop()

16 years agoAdd reference to dntpd(8) in SEE ALSO.
Sascha Wildner [Sat, 12 May 2007 08:08:29 +0000 (08:08 +0000)]
Add reference to dntpd(8) in SEE ALSO.

16 years ago* Add descriptions for:
Sascha Wildner [Sat, 12 May 2007 07:38:01 +0000 (07:38 +0000)]
* Add descriptions for:

  dntpd_enable, dntpd_flags, dntpd_program, dhcpd_enable, dhcrelay_enable,
  ftpd_enable, ftpd_flags, mixer_enable, nfs_client_flags, rand_irq,
  resident_enable, varsym_enable, vidhistory

* Add references to the associated manual pages.

* Move sshd_program below sshd_enable.

* Minor cleanup.

There's still some work left.

16 years agoFix typo.
Sascha Wildner [Sat, 12 May 2007 07:22:41 +0000 (07:22 +0000)]
Fix typo.

16 years agoHook resident.conf(5) and varsym.conf(5) into the build and add some
Sascha Wildner [Sat, 12 May 2007 07:21:51 +0000 (07:21 +0000)]
Hook resident.conf(5) and varsym.conf(5) into the build and add some
references to them.

16 years agoAdd resident.conf(5) and varsym.conf(5) manual pages.
Sascha Wildner [Sat, 12 May 2007 07:09:00 +0000 (07:09 +0000)]
Add resident.conf(5) and varsym.conf(5) manual pages.

16 years ago- Merge bge_release_resources() into bge_detach(). This funcion is only used
Sepherosa Ziehau [Sat, 12 May 2007 04:05:35 +0000 (04:05 +0000)]
- Merge bge_release_resources() into bge_detach().  This funcion is only used
  by bge_detach() and is quite simple.
- Minor style changes.

16 years agoBump .Dd for recent updates and do some mdoc cleanup.
Sascha Wildner [Fri, 11 May 2007 08:25:24 +0000 (08:25 +0000)]
Bump .Dd for recent updates and do some mdoc cleanup.

16 years agoAdd the ID for the Realtek ALC862 codec to the hda sound driver.
Matthew Dillon [Fri, 11 May 2007 01:03:06 +0000 (01:03 +0000)]
Add the ID for the Realtek ALC862 codec to the hda sound driver.

Submitted-by: Joe Talbott <josepht@cstone.net>
16 years agoFix the location of Make.tags.inc
Matthew Dillon [Fri, 11 May 2007 00:10:10 +0000 (00:10 +0000)]
Fix the location of Make.tags.inc

Submitted-by: Joe Talbott <josepht@cstone.net>
16 years agoUpgrade to libarchive 2.2.1 which fixes device node handling.
Peter Avalos [Wed, 9 May 2007 19:39:24 +0000 (19:39 +0000)]
Upgrade to libarchive 2.2.1 which fixes device node handling.

16 years agoAdd our READMEs.
Peter Avalos [Wed, 9 May 2007 19:32:43 +0000 (19:32 +0000)]
Add our READMEs.

16 years agoMerge from vendor branch LIBARCHIVE:
Peter Avalos [Wed, 9 May 2007 19:11:49 +0000 (19:11 +0000)]
Merge from vendor branch LIBARCHIVE:
Import libarchive 2.2.1.

16 years agoImport libarchive 2.2.1.
Peter Avalos [Wed, 9 May 2007 19:11:49 +0000 (19:11 +0000)]
Import libarchive 2.2.1.

16 years agoFix a bug where multiple mounts on the same mount point cause the
Matthew Dillon [Wed, 9 May 2007 05:12:45 +0000 (05:12 +0000)]
Fix a bug where multiple mounts on the same mount point cause the
machine to lockup when the mount is access.  The wrong namecache handle
was being used to traverse "..", causing an endless loop when more then one
iteration was required to chain up the mount points.

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

16 years agoSynchronize libkvm etc, with recent kernel major/minor device
Matthew Dillon [Wed, 9 May 2007 04:33:52 +0000 (04:33 +0000)]
Synchronize libkvm etc, with recent kernel major/minor device
numbering changes.

16 years agoGive the device major / minor numbers their own separate 32 bit fields
Matthew Dillon [Wed, 9 May 2007 00:53:36 +0000 (00:53 +0000)]
Give the device major / minor numbers their own separate 32 bit fields
in the kernel.  Change dev_ops to use a RB tree to index major device
numbers and remove the 256 device major number limitation.

Build a dynamic major number assignment feature into dev_ops_add() and
adjust ASR (which already had a hand-rolled one), and MFS to use the
feature.  MFS at least does not require any filesystem visibility to
access its backing device.  Major devices numbers >= 256 are used for
dynamic assignment.

Retain filesystem compatibility for device numbers that fall within the
range that can be represented in UFS or struct stat (which is a single
32 bit field supporting 8 bit major numbers and 24 bit minor numbers).

16 years agoFix some warnings and raise WARNS to 6.
Sascha Wildner [Tue, 8 May 2007 20:59:37 +0000 (20:59 +0000)]
Fix some warnings and raise WARNS to 6.

16 years agoSync zoneinfo database with tzdata2007f from elsie.
Sascha Wildner [Tue, 8 May 2007 17:47:28 +0000 (17:47 +0000)]
Sync zoneinfo database with tzdata2007f from elsie.

africa:         8.7  -> 8.8
australasia:    8.6  -> 8.7
northamerica:   8.16 -> 8.17

From Paul Eggert's comments:

Changes affecting current time stamps:

* Haiti no longer observes DST.  (Thanks to Stephen Colebourne for this.)

Changes affecting past and future time stamps:

* The Turks and Caicos switch at 02:00, not at 00:00, and have adopted
  US DST rules.  (Thanks to Chris Dunn and Brian Inglis for this.)

Changes affecting future time stamps only:

* New Zealand is extending DST, starting later this year.
  (Thanks to Colin Sharples and many others for this info.)

Changes affecting commentary only:

* The Caprivi Strip unofficially does not observe DST, but we currently
  have no further details.  (Thanks to Petronella Sibeene for this.)

16 years agoReplace NOCDEV with NULL. NOCDEV was ((void *)-1) and as inherited
Matthew Dillon [Tue, 8 May 2007 02:31:43 +0000 (02:31 +0000)]
Replace NOCDEV with NULL.  NOCDEV was ((void *)-1) and as inherited
from *BSD a long time ago due to the device pointer / device number
duality.  Now that the pointer and device number has been separated, we
can just use NULL to indicate no-pointer.

Replace si_refs with si_sysref.  Use SYSREF for ref-count cdev_t.  Enable
cdev_t reclamation on deletion.

16 years agoAdd fields to the ktrace header to allow kdump to also display the TID
Matthew Dillon [Mon, 7 May 2007 15:43:31 +0000 (15:43 +0000)]
Add fields to the ktrace header to allow kdump to also display the TID
for individual threads.  Add a new option to ktrace, -j, which forces
TID display even if kdump doesn't think the program is threaded.

Submitted-by: Joe Talbott <josepht@cstone.net>
With-additions-by: Matt Dillon
16 years agoAdd hardware crypto support for 2x61 part of ral(4). This kind of hardware
Sepherosa Ziehau [Mon, 7 May 2007 14:14:21 +0000 (14:14 +0000)]
Add hardware crypto support for 2x61 part of ral(4).  This kind of hardware
can do hardware TKIP, TKIP MIC, WEP40/104 and CCMP.

Registers and global/pairwise key table layout are obtained from Ralink RT61
linux driver.  Their driver does not use pairwise key table, but how to setup
pairwise key table and how to enable pairwise key slot are shown.  BUT That's
still NOT enough to use pairwise key --- driver has to write 1 to SEC_CSR4 to
make the wheel whirl.  It is mentioned in no place, and I had to figure it
out myself ;)

2x61 part has 64 pairwise key slots, only last 60 slots will be used currently.
It is mainly because the RX descriptor does not contain a field to indicate
in which key table the decryption key belongs.

16 years agoAdapt 802.11 generic layer to support hardware crypto other than ath(4).
Sepherosa Ziehau [Mon, 7 May 2007 14:12:16 +0000 (14:12 +0000)]
Adapt 802.11 generic layer to support hardware crypto other than ath(4).
More specificly, it is changed for Wifi chips from Ralink (2x61 is used
as an example here), which have following hardware crypto features.  These
features are different from ath(4)'s and need special cares:
1) For TX, host does not need to insert IV and Extended IV after 802.11 MAC
   header, instead, host provides them in TX descriptor.
2) For RX, IV and Extended IV will not be left in RX buffer, instead, they
   are recorded in RX descriptor.
3) For RX and TKIP is used as crypto method, if the received MPDU is the
   only fragment of an MSDU then MIC is stripped and hardware will verify
   MIC for host.

Since these kinds of hardwares need to know IV and Extended IV,
ieee80211_crypto_iv structure is added.  It can hold IV and Extended IV, and
is used to pass these two IVs to and from 802.11 generic layer.  It requires
a special layout to ease crypto modules' processing, so comment is added to
make sure the structure's layout will not be changed.

To address the problems introduced by the hardware feature 1), following
changes are made:
- Add ic_getiv() interface for all crypto modules, which is (obviously) used
  to get IV and extended IV from crypto module.  Except that it puts IVs in
  ieee80211_crypto_iv instead of TX buffer, the new interface is quite similar
  to ic_encap().  Wrap ic_getiv() interface by ieee80211_crypto_getiv().
- Split ieee80211_crypto_encap() into two functions:
  o  ieee80211_crypto_findkey().  It is used to find the crypto key for given
     MPDU and receiver.
  o  ieee80211_crypto_encap_withkey().  It does the real encryption work.
     For Ralink's Wifi chips, this function is only called when host based
     encryption is used.
  After this splition, driver will have a chance to decide whether it need to
  do host encryption, which could happen when there are not enough hardware
  pairwise keys, or offload the encryption to hardware.  ath(4) does not need
  this interception, since no matter hardware encryption is used or not, host
  always has to insert IVs, while for Ralink Wifi chips, IV insertion can be
  done only if host encryption is to be used, for hardware encryption, they
  must be set in TX descriptor.
  This splition also causes another problem:
  ieee80211_crypto_encap_withkey() requires a keyid (read: not key index) and
  it will be too bloated to add a keyid parameter for both
  ieee80211_crypto_encap_withkey() and ieee80211_crypto_findkey(), so
  o  Change ieee80211_key.wk_pad to ieee80211_key.wk_keyid, which is keyid for
     a given key, and is set in ieee80211_crypto_resetkey().  Since
     ieee80211_crypto_resetkey() will need to know internals of ieee80211com,
     put it into ieee80211_crypto.c.
  o  Add assertion in ieee80211_crypto_findkey() to make sure that the crypto
     key has correct keyid.
  o  Make ieee80211_crypto_encap() a wrapper of ieee80211_crypto_findkey() and
     ieee80211_crypto_encap_withkey().  Old symantic of this function is still
     kept.
  The crypto encapsulation for Ralink Wifi chips will look like following:
  ...
  k = ieee80211_crypto_findkey();
  if (k is hardware encryption key)
      k = ieee80211_crypto_getiv(k, iv);
  else
      k = ieee80211_crypto_encap_withkey(k);
  ...
- Add a crypto key flag, IEEE80211_KEY_NOHDR, to indicate that host does not
  need to reserve space in TX buffer if hardware encryption is used.
- Honor IEEE80211_KEY_NOHDR in ieee80211_mbuf_adjust().
- Add an extended capability flag, IEEE80211_CEXT_CRYPTO_HDR, which is set by
  driver to inform crypto module that if hardware encryption is used for a
  crypto key, the key should have IEEE80211_KEY_NOHDR turned on.

To address the problems introduced by the hardware feature 2), following
changes are made:
- Add ic_update() interface for all crypto modules, which is used to update
  crypto modules' internal state according to the IVs passed in.  Except that
  it peeks at the passed in ieee80211_crypto_iv instead of RX buffer, it acts
  similarly to ic_decap().  Wrap ic_update() interface by
  ieee80211_crypto_update().  ieee80211_crypto_update() also locates the crypto
  key for given MPDU and sender.
- Add ieee80211_input_withiv(), which accepts an ieee80211_crypto_iv 'iv'
  parameter in addition to the original ieee80211_input() parameters.  If 'iv'
  parameter is NULL, old ieee80211_input() behaviour is used, if 'iv' is not
  NULL, ieee80211_crypto_update() will be called instead of
  ieee80211_crypto_decap().  ath(4) does not require this special processing,
  since no matter hardware encryption is used or not, IVs are always in RX
  buffer, but for Wifi chips from Ralink, we will have to explicitly pass the
  recorded IVs in RX descriptor down to crypto modules.
- Change ieee80211_input() to call ieee80211_input_withiv() with NULL 'iv'.
  Old symantic of this function is still kept.

To address the problems introduced by the hardware feature 3), following
changes are made:
- Add a key flag, IEEE80211_KEY_NOMIC, to give hint to TKIP crypto module that
  hardware will strip TKIP MIC.
- Honor IEEE80211_KEY_NOMIC in tkip_demic().
- Add an extended capability flag, IEEE80211_CEXT_STRIP_MIC, which is set by
  driver to inform crypto module that if hardware TKIP MIC is used for a
  crypto key, then the key should have IEEE80211_KEY_NOMIC turned on.

16 years agoMore agressive fix for IPv6 routing header type 0 issue.
Hasso Tepper [Mon, 7 May 2007 13:00:16 +0000 (13:00 +0000)]
More agressive fix for IPv6 routing header type 0 issue.
The ip6_rthdr0() function is commented out at all and the incoming Type 0
Routing Header is now processed as an unknown Routing Header. Also drop
packets with more than 1 routing headers and increment ifs6_in_hdrerr on
ip6s_toomanyhdr.

Obtained-from: KAME

16 years agoRevert intial IPv6 routing header type 0 processing fix.
Hasso Tepper [Mon, 7 May 2007 12:40:30 +0000 (12:40 +0000)]
Revert intial IPv6 routing header type 0 processing fix.

16 years agoReturn lowest rate for a "reclaimed" node, whose TX rate control data was
Sepherosa Ziehau [Mon, 7 May 2007 10:45:42 +0000 (10:45 +0000)]
Return lowest rate for a "reclaimed" node, whose TX rate control data was
already freed.  Since this kind of node will vanish soon, there is no need
to initialize TX rate control data for it here.  Add comment about it.

This problem (null pointer dereference) pops up when hostapd(8) is used on
a Ralink 2561S based ral(4).

16 years agoChanges to consdev - low level kernel console initialization.
Matthew Dillon [Mon, 7 May 2007 05:21:42 +0000 (05:21 +0000)]
Changes to consdev - low level kernel console initialization.

The consdev API was calling make_dev() extremely early in the boot sequence,
but except for a little code in syscons didn't really need the abstraction
to operate the kernel console during boot.

Change the consdev API to no longer require the use the device abstraction
to operate.  This will allow the device ABI (cdev_t) to be converted to
use SYSREF.

16 years agoAdd new devices support for bge(4)
Sepherosa Ziehau [Mon, 7 May 2007 04:54:32 +0000 (04:54 +0000)]
Add new devices support for bge(4)
- Recognize more devices, including PCI ids, chip ids and asic ids.
- Use meaningful macros to distinguish chip family and capability, instead of
  test against chip id or asic id directly.
- Pack bool fields of bge_softc into bge_softc.bge_flags,
  o  bge_softc.bge_extram is gone, which was never adopted.
  o  Add flags for jumbo frame capability.
  o  Add flags for various chip families.
  o  Add flags for the bus types (PCI-e/PCI-X).
  o  Add flags for various PHY bugs, which will be used by brgphy.
- Fix the detection of the bus type (PCI-e/PCI-X). (*)
- Properly initialize PCI-X bge(4).
- Fix support for certain 575x/578x chips (*):
  o  Correct bge_{read,write}mem_ind() by clearing BGE_PCI_MEMWIN_BASEADDR
     before returning.
  o  Use the appropriate register writing method when reseting the chip.
  o  Program the descriptor DMA engine correctly.
  o  Disable fastboot if the chips support it.
  o  Add some 'magical' magics on chip resetting path.
Obtained-from: FreeBSD
# (*) are done in if_bge.c rev 1.159 and 1.178 by scottl@freebsd.org and
# jkim@freebsd.org, based on code provided by David Christenson from Broadcom.

Adapt brgphy to work with the changes in bge(4)
- Recognize Broadcom 5755/5787 PHY.
- Add DSP code for various PHY bug workarounds.
- Detect PHY bugs based on the flags passed by bge(4) and load corresponding
  workaround DSP code.
Obtained-from: OpenBSD

- Set PHY jumbo frame settings.
Obtained-from: FreeBSD