dragonfly.git
17 years ago- Use jumbo buffers only when MTU > 1518 bytes.
Sepherosa Ziehau [Thu, 21 Dec 2006 14:13:04 +0000 (14:13 +0000)]
- Use jumbo buffers only when MTU > 1518 bytes.
  o  In sk_dma_alloc(), allocate additional DMA stuffs for normal mbuf cluster
     to use.
  o  In sk_init(), set sk_if_softc.sk_use_jumbo if ifnet.if_mtu > 1518.  This
     should only be done after sk_stop(), so sk_stop() will not free wrong RX
     buffers.  Add a comment about it.
  o  Don't touch jumbo buffer related bits in hardware registers, if jumbo
     buffer is not used currently.
  o  Rename old sk_newbuf() to sk_newbuf_jumbo().
  o  Implement sk_newbuf_std(), which allocates RX buffer using mbuf clusters.
  o  Add a wrapper function, sk_newbuf(), to switch between above two functions
     based on whether sk_if_softc.sk_use_jumbo is set or not.
- If something fail in sk_rxeof(), don't call sk_newbuf() with old mbuf:
  Hardware will not change RX descriptor's buffer address part.  Only
  controlling bits of the RX descriptor need to be set up properly.
  Nuke third parameter (i.e. mbuf) of sk_newbuf() after this change and
  rearrange sk_newbuf_jumbo() accordingly.
- Since sk_chain and TX/RX descriptor use same index, nuke unnecessary
  sk_chain.sk_desc field, which points to a corresponding TX/RX descriptor.
  Pass the TX/RX descriptor index to sk_newbuf() instead of sk_chain pointer.
  Nuke never used sk_chain.sk_next field.  These changes degenarate sk_chain
  into a mbuf pointer, so nuke no longer needed sk_chain structure.

Tested-by: Rumko <rumcic@gmail.com> and Gergo Szakal <bastyaelvtars@gmail.com>
Partially-reviewed-by: dillon@
17 years agoAdd the PCI_MAP_FIXUP code as proposed two weeks ago. The code is only
Thomas E. Spanjaard [Wed, 20 Dec 2006 23:29:18 +0000 (23:29 +0000)]
Add the PCI_MAP_FIXUP code as proposed two weeks ago. The code is only
enabled with options PCI_MAP_FIXUP in your kernel, and should only be used
when using nata.

17 years agoRename sprintf -> ksprintf
Matthew Dillon [Wed, 20 Dec 2006 18:14:44 +0000 (18:14 +0000)]
Rename sprintf  -> ksprintf
Rename snprintf -> knsprintf

Make allowances for source files that are compiled for both userland and
the kernel.

17 years agoAdd IFF_MONITOR support.
Matthew Dillon [Tue, 19 Dec 2006 00:11:13 +0000 (00:11 +0000)]
Add IFF_MONITOR support.

Submitted-by: "Vlad Galu" <dudu@dudu.ro>
Obtained-from: FreeBSD

17 years agoSee whether we should compile ipfilter with INET6 support by looking at the
Peter Avalos [Mon, 18 Dec 2006 23:26:36 +0000 (23:26 +0000)]
See whether we should compile ipfilter with INET6 support by looking at the
kernel config rather than requiring the user to use an undocumented build
option.

Thanks to corecode, TGEN, and vbd for various suggestions and Max Herrgard
<herrgard@gmail.com> for testing.

Dragonfly-bug:  <http://bugs.dragonflybsd.org/issue322>
Reviewed-by: vbd
17 years agoUndo some renames that don't apply to the boot code (linked against libstand).
Matthew Dillon [Mon, 18 Dec 2006 23:12:31 +0000 (23:12 +0000)]
Undo some renames that don't apply to the boot code (linked against libstand).

17 years agoAdd 'k' versions for printf, sprintf, and snprintf. kprintf, ksprintf, and
Matthew Dillon [Mon, 18 Dec 2006 21:02:59 +0000 (21:02 +0000)]
Add 'k' versions for printf, sprintf, and snprintf.  kprintf, ksprintf, and
ksnprintf.  This will allow these functions to be renamed piecemeal without
breaking the source tree.

17 years agoRename kvprintf -> kvcprintf (call-back version)
Matthew Dillon [Mon, 18 Dec 2006 20:41:02 +0000 (20:41 +0000)]
Rename kvprintf  -> kvcprintf (call-back version)
Rename vprintf   -> kvprintf
Rename vsprintf  -> kvsprintf
Rename vsnprintf -> kvsnprintf

17 years agoAdd a prototype for the new mcontrol() system call.
Matthew Dillon [Mon, 18 Dec 2006 19:44:51 +0000 (19:44 +0000)]
Add a prototype for the new mcontrol() system call.

17 years agoRepo copy machine/pc32/i386/mem.c to kern/kern_memio.c and separate out
Matthew Dillon [Sun, 17 Dec 2006 20:07:33 +0000 (20:07 +0000)]
Repo copy machine/pc32/i386/mem.c to kern/kern_memio.c and separate out
the (few) machine-dependant parts.  This file primarily controls access
to /dev/zero, /dev/null, /dev/random, and kernel memory, and does not belong
in a machine-dependant directory.

17 years agoPass NULL to objcache_create() to indicate that null_ctor() and/or null_dtor()
Matthew Dillon [Sun, 17 Dec 2006 19:28:32 +0000 (19:28 +0000)]
Pass NULL to objcache_create() to indicate that null_ctor() and/or null_dtor()
should be used.  Make null_ctor() and null_dtor() private functions.

Disallow M_ZERO entirely, it doesn't really fit the objcache model.

With-input-from: "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>,
 "Thomas E. Spanjaard" <tgen@netphreax.net>,
 Jeffrey Hsu <hsu@crater.dragonflybsd.org>

17 years ago- Factor out ieee80211_print_rateset().
Sepherosa Ziehau [Fri, 15 Dec 2006 12:44:23 +0000 (12:44 +0000)]
- Factor out ieee80211_print_rateset().
- Add a debug macro: IEEE80211_PRINT_NODERATES().  Replace two almost same
  debug code segments with it.

17 years agoAdd a manual page for umct(4).
Sascha Wildner [Thu, 14 Dec 2006 16:21:34 +0000 (16:21 +0000)]
Add a manual page for umct(4).

17 years agoMake umct compilable into the kernel and add it to LINT.
Sascha Wildner [Thu, 14 Dec 2006 16:20:22 +0000 (16:20 +0000)]
Make umct compilable into the kernel and add it to LINT.

17 years agoFix a typo (found in FreeBSD) and update CVS tag.
Sascha Wildner [Thu, 14 Dec 2006 16:18:04 +0000 (16:18 +0000)]
Fix a typo (found in FreeBSD) and update CVS tag.

17 years agoThere is no "atapi-all.h" anymore. Remove reference to it from atapi-cam.c.
Thomas E. Spanjaard [Thu, 14 Dec 2006 16:06:40 +0000 (16:06 +0000)]
There is no "atapi-all.h" anymore. Remove reference to it from atapi-cam.c.

17 years agorename sscanf -> ksscanf
Matthew Dillon [Wed, 13 Dec 2006 21:58:52 +0000 (21:58 +0000)]
rename sscanf -> ksscanf
rename vsscanf -> kvsscanf
rename fnmatch -> kfnmatch
rename qsort -> kqsort

17 years agoFix umct and add F5U409 USB Serial Adaptor.
Matthew Dillon [Wed, 13 Dec 2006 20:19:06 +0000 (20:19 +0000)]
Fix umct and add F5U409 USB Serial Adaptor.

Submitted-by: Joe Talbott <josepht@cstone.net>
17 years agoHave the genassym.o target depend on forwarding-headers. This unbreaks
Thomas E. Spanjaard [Wed, 13 Dec 2006 19:39:52 +0000 (19:39 +0000)]
Have the genassym.o target depend on forwarding-headers. This unbreaks
parallel kernel builds.

17 years ago${_LHDRS} must succeed ${_MACHINE_FWD}/include/machine, which creates
YONETANI Tomokazu [Wed, 13 Dec 2006 15:29:50 +0000 (15:29 +0000)]
${_LHDRS} must succeed ${_MACHINE_FWD}/include/machine, which creates
${_MACHINE_FWD}/include, in which ${_LHDRS} target creates some headers.

Reported-by: tgen@
17 years agoModify the device description for the standard nForce and nForce2 on-chip
Thomas E. Spanjaard [Wed, 13 Dec 2006 14:48:26 +0000 (14:48 +0000)]
Modify the device description for the standard nForce and nForce2 on-chip
ethernet controllers to Fast Ethernet. Only the last one or two models of
the nForce2 (Ultra 400Gb and possibly Ultra 400R) supported a gmiibus.

Also add a comment regarding PCI_PRODUCT_NVIDIA_NFORCE3_LAN2, as that PCI
ID also appears on the nForce2 Ultra 400Gb chipset's MCP.

17 years agoExplicitly specify null_dtor as our objcache destructor. Fixes a panic when
Thomas E. Spanjaard [Wed, 13 Dec 2006 12:41:36 +0000 (12:41 +0000)]
Explicitly specify null_dtor as our objcache destructor. Fixes a panic when
we were out of empty magazines.

17 years agoAdd another ICH PCI ID.
Matthew Dillon [Tue, 12 Dec 2006 19:01:31 +0000 (19:01 +0000)]
Add another ICH PCI ID.

Submitted-by: "Vlad Galu" <dudu@dudu.ro>
17 years agoMerge from vendor branch FILE:
Peter Avalos [Tue, 12 Dec 2006 18:44:17 +0000 (18:44 +0000)]
Merge from vendor branch FILE:
Update to file-4.19.

17 years agoUpdate to file-4.19.
Peter Avalos [Tue, 12 Dec 2006 18:44:17 +0000 (18:44 +0000)]
Update to file-4.19.

17 years agoUpdate to file-4.19.
Peter Avalos [Tue, 12 Dec 2006 18:44:17 +0000 (18:44 +0000)]
Update to file-4.19.

17 years agoWe don't use magic2mime, so remove it.
Peter Avalos [Tue, 12 Dec 2006 18:27:25 +0000 (18:27 +0000)]
We don't use magic2mime, so remove it.

17 years ago- Correct some debug messages format.
Sepherosa Ziehau [Tue, 12 Dec 2006 15:48:09 +0000 (15:48 +0000)]
- Correct some debug messages format.
- In ieee80211_init_neighbor(), print neighbors' rate set.

17 years agoExploring low speed busses during cold boot, so USB keyboard will work even
Sepherosa Ziehau [Tue, 12 Dec 2006 11:14:27 +0000 (11:14 +0000)]
Exploring low speed busses during cold boot, so USB keyboard will work even
if the kernel is configured with "device atkbd" and "device atkbdc"

Reported-by: Petr Janda <elekktretterr@exemail.com.au>
Tested-by: Petr Janda <elekktretterr@exemail.com.au>
17 years agoUpdate with the latest newsletters from the ISO3166 Maintenance Agency:
Peter Avalos [Tue, 12 Dec 2006 06:56:25 +0000 (06:56 +0000)]
Update with the latest newsletters from the ISO3166 Maintenance Agency:

http://www.iso.ch/iso/en/prods-services/iso3166ma/03updates-on-iso-3166/index.html

This has the nice side-effect of fixing tzsetup.

17 years agoRemove unnecessary escape character.
Sascha Wildner [Tue, 12 Dec 2006 01:47:23 +0000 (01:47 +0000)]
Remove unnecessary escape character.

17 years agoConvert to mdoc.
Sascha Wildner [Tue, 12 Dec 2006 01:27:10 +0000 (01:27 +0000)]
Convert to mdoc.

17 years agoConvert to mdoc.
Sascha Wildner [Tue, 12 Dec 2006 00:49:22 +0000 (00:49 +0000)]
Convert to mdoc.

17 years agoAdd documentation for the mcontrol system call.
Sascha Wildner [Tue, 12 Dec 2006 00:26:38 +0000 (00:26 +0000)]
Add documentation for the mcontrol system call.

17 years agoAdd markup and bump date for rev. 1.5.
Sascha Wildner [Tue, 12 Dec 2006 00:08:17 +0000 (00:08 +0000)]
Add markup and bump date for rev. 1.5.

17 years agoFix typos: mininum/minimun -> minimum
Sascha Wildner [Mon, 11 Dec 2006 23:59:49 +0000 (23:59 +0000)]
Fix typos: mininum/minimun -> minimum

17 years agoDocument MADV_SETMAP and MAP_VPAGETABLE. These functions support virtualized
Matthew Dillon [Mon, 11 Dec 2006 20:55:25 +0000 (20:55 +0000)]
Document MADV_SETMAP and MAP_VPAGETABLE.  These functions support virtualized
page tables for memory mapped regions from userland.

17 years agoUse ${.CURDIR} to get the correct path to the root skeleton directory.
Matthew Dillon [Mon, 11 Dec 2006 20:54:22 +0000 (20:54 +0000)]
Use ${.CURDIR} to get the correct path to the root skeleton directory.

17 years agoThis time *really* fix the .PATHs in the kmod Makefiles. I promise.
Thomas E. Spanjaard [Sun, 10 Dec 2006 23:39:43 +0000 (23:39 +0000)]
This time *really* fix the .PATHs in the kmod Makefiles. I promise.

17 years agoFix a deadlock in the request completion code when the timeout timed out.
Thomas E. Spanjaard [Sun, 10 Dec 2006 23:36:13 +0000 (23:36 +0000)]
Fix a deadlock in the request completion code when the timeout timed out.
The cause was not unlocking the done spinlock before calling ata_completed,
resulting in ata_completed waiting forever because it needs to acquire the
lock as well.

The solution introduces a new request flag, ATA_R_COMPLETED to signal
sleepers that a request has or has not been completed. In theory, we could
just check the return value of msleep(), but this is quite elegant, and
corecode convinced me ;).

Reported-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
Reviewed-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>

17 years agoDon't mention recently nuked sysctl MIBs
Sepherosa Ziehau [Sun, 10 Dec 2006 05:21:40 +0000 (05:21 +0000)]
Don't mention recently nuked sysctl MIBs

17 years agoMention required kernel devices for rtw(4) and acx(4)
Sepherosa Ziehau [Sun, 10 Dec 2006 05:15:59 +0000 (05:15 +0000)]
Mention required kernel devices for rtw(4) and acx(4)

17 years agortw(4) requires wlan_wep(4)
Sepherosa Ziehau [Sun, 10 Dec 2006 05:10:41 +0000 (05:10 +0000)]
rtw(4) requires wlan_wep(4)

17 years ago- Add manpage for rum(4)
Sepherosa Ziehau [Sun, 10 Dec 2006 05:03:20 +0000 (05:03 +0000)]
- Add manpage for rum(4)
  Obtained-from: OpenBSD
- Add manpage for ural(4)
  Obatined-frim: FreeBSD

Reviewed-by: swildner@
17 years ago- Hook rum(4) and ural(4) into GENERIC and LINT
Sepherosa Ziehau [Sun, 10 Dec 2006 04:59:38 +0000 (04:59 +0000)]
- Hook rum(4) and ural(4) into GENERIC and LINT
- Hook rum(4) and ural(4) into module building
- Enable wlan_ratectl_onoe in GENERIC.  It is required by rum(4) and ural(4)
- Add a commented-out entry in GENERIC for wlan_ratectl_amrr
- Enable rtw(4) in GENERIC again

17 years agoAdd missing header if USB_DEBUG is defined
Sepherosa Ziehau [Sun, 10 Dec 2006 04:37:02 +0000 (04:37 +0000)]
Add missing header if USB_DEBUG is defined

17 years agoAdd support for RT2501USB/RT2601USB devices.
Sepherosa Ziehau [Sun, 10 Dec 2006 03:24:25 +0000 (03:24 +0000)]
Add support for RT2501USB/RT2601USB devices.

Thank Niall O'Higgins <niallo@openbsd.org> and
Damien Bergamini <damien@openbsd.org> for writing this driver.

Obtained-from: OpenBSD

17 years agoAdd support for RT2500USB devices.
Sepherosa Ziehau [Sun, 10 Dec 2006 02:53:34 +0000 (02:53 +0000)]
Add support for RT2500USB devices.

Thank Damien Bergamini <damien@openbsd.org> for writing this driver.

Obtained-from: FreeBSD

17 years agoUpdate following manpage to reflect changes made to USB host controller part:
Sepherosa Ziehau [Sun, 10 Dec 2006 02:16:26 +0000 (02:16 +0000)]
Update following manpage to reflect changes made to USB host controller part:
- usb.4
  Obtained-from: FreeBSD
- ehci.4 ohci.4 uhci.4

Reviewed-by: swildner@
17 years agoSync USB support (host controller part) with FreeBSD6.
Sepherosa Ziehau [Sun, 10 Dec 2006 02:03:57 +0000 (02:03 +0000)]
Sync USB support (host controller part) with FreeBSD6.

Following changes on FreeBSD-CURRENT(by iedowse@freebsd.org) are merged:
ehci.c rev 1.52
ohci.c rev 1.167
uhci.c rev 1.172
usb.c rev 1.111
usbdi.h rev 1.61
"Use a different task queue for host controller and peripheral driver
 tasks. Since the host controllers rely on tasks to process transfer
 timeouts, if a synchronous transfer from a driver was invoked from
 a task and timed out, it would never complete because the single
 task thread was stuck performing the synchronous transfer so couldn't
 process the timeout."

As of this commit, only following kernel APIs are changed:
- usbd_get_string_desc() takes one more argument which returns the actual
  size of the string description.
- usb_add_task() takes one more argument.  The extra arguemnt is used
  to specify to which task queue the task should be added.  There is
  two task queues defined, one for peripheral driver (USB_TASKQ_DRIVER),
  one for host controller (USB_TASKQ_HC).

ugen(4) is adapted according to the above kernel API changes.

Thank all of the folks for their work on the USB support.

Tested-by:
swildner@, vbd@, joerg@(1.6 backport), Max Herrgard <herrgard@gmail.com>

# Though VT6202 is supported by ehci(4), I still have problems with this
# chip, even with the updated ehci(4).

17 years agoregen
Sepherosa Ziehau [Sat, 9 Dec 2006 10:57:31 +0000 (10:57 +0000)]
regen

17 years ago- Add ids for RT2501USB/RT2601USB/RT2500USB
Sepherosa Ziehau [Sat, 9 Dec 2006 10:56:32 +0000 (10:56 +0000)]
- Add ids for RT2501USB/RT2601USB/RT2500USB
- Add ids for MGE UPS

17 years ago- Use ieee80211_probe_resp_alloc() to setup probe response template.
Sepherosa Ziehau [Sat, 9 Dec 2006 08:10:04 +0000 (08:10 +0000)]
- Use ieee80211_probe_resp_alloc() to setup probe response template.
- Check the return value of ieee80211_probe_resp_alloc() and
  ieee80211_beacon_alloc().  Since these two functions use MB_DONTWAIT
  to allocate mbuf, it is quite possible they will return NULL.
- Turn on IEEE80211_FC0_VERSION_0 when setup null data and probe request
  templates as what we do in netproto/802_11.
- Don't transmit probe responses injected by netproto/802_11 layer,
  firmware will handle them for us.
- Move acx100's TIM ie template setup into common templates initialization
  routine, so acx111 will get its TIM ie template properly set up.
  This makes firmware add well formatted TIM ies to the end of the beacons
  instead of junked ones.
Reported-by: Marcus Glocker <mglocker@openbsd.org>
- Obey DTIM period set in netproto/802_11, i.e. use ieee80211com.ic_dtim_period
- Reduce the length of Partial Virtual Bitmap in TIM template.

17 years ago- Factor out _ieee80211_probe_resp_alloc() from ieee80211_send_mgmt().
Sepherosa Ziehau [Sat, 9 Dec 2006 07:22:49 +0000 (07:22 +0000)]
- Factor out _ieee80211_probe_resp_alloc() from ieee80211_send_mgmt().
  This function creates frame body of a Probe Response.
- Add ieee80211_probe_resp_alloc(), which utilizes
  _ieee80211_probe_resp_alloc() to create a complete Probe Response
  management frame (i.e. has MAC header).

17 years agoFix compilation warnings when compiling without DEVICE_POLLING.
Sascha Wildner [Sat, 9 Dec 2006 01:44:23 +0000 (01:44 +0000)]
Fix compilation warnings when compiling without DEVICE_POLLING.

17 years agoFix the paths in ata_if.m and the module Makefiles to reflect their
Thomas E. Spanjaard [Fri, 8 Dec 2006 15:09:19 +0000 (15:09 +0000)]
Fix the paths in ata_if.m and the module Makefiles to reflect their
location in our tree, rather than my development tree at home.

Submitted-by: YONETANI Tomokazu <qwht+dfly@les.ath.cx>

17 years agoFix a stack overflow in ifconfig(8).
Sepherosa Ziehau [Fri, 8 Dec 2006 14:25:07 +0000 (14:25 +0000)]
Fix a stack overflow in ifconfig(8).

The stack overflow happens, if "-" is passed as the argument to 'ssid' or
'wepkey' commands.  The offender is ifieee80211.c:get_string()'s "-" special
handling:
...
len = p - buf;
/* The string "-" is treated as the empty string. */
if (!hexstr && len == 1 && buf[0] == '-')
len = 0;
if (len < *lenp)
memset(p, 0, *lenp - len);
...

If the string is "-", the 'p' will be 1 byte beyound 'buf' and 'len' is set to
0.  'len' must be less than '*lenp' here, so memset() will be called.  But the
length, used to clear the buffer, is 1 byte larger the buffer pointed by 'p'

17 years agoExpand the Intel Brand ID table to cover all known brand IDs as mentioned
Thomas E. Spanjaard [Thu, 7 Dec 2006 13:33:04 +0000 (13:33 +0000)]
Expand the Intel Brand ID table to cover all known brand IDs as mentioned
in Intel document AP-485, released September 2006, document number
241618-31, page 42.

17 years agoRevert to zero'ing the objects we pull out of our objcaches ourselves.
Thomas E. Spanjaard [Thu, 7 Dec 2006 12:47:24 +0000 (12:47 +0000)]
Revert to zero'ing the objects we pull out of our objcaches ourselves.
Having it done by objcache_get() incurs too much of a penalty on the hot
path of it, that it isn't warranted, especially considering the fact that
pulling zero'ed objects out of it isn't taking advantage of the objcache
model. However, there are arguments for using it, like growability in
interrupt context (zones can't).

17 years agoFix some of the C++/Java-style comments in ata-usb.c. Adjust the default
Thomas E. Spanjaard [Wed, 6 Dec 2006 20:20:51 +0000 (20:20 +0000)]
Fix some of the C++/Java-style comments in ata-usb.c. Adjust the default
pipe abort to our interface.

These changes allow natausb to compile.

17 years agoAdd a function to retrieve the speed a USB device is running on.
Thomas E. Spanjaard [Wed, 6 Dec 2006 20:14:47 +0000 (20:14 +0000)]
Add a function to retrieve the speed a USB device is running on.

17 years agoPending enlightenment, specify confstr(3) to conform to SUSv3 instead of
Thomas E. Spanjaard [Wed, 6 Dec 2006 16:33:29 +0000 (16:33 +0000)]
Pending enlightenment, specify confstr(3) to conform to SUSv3 instead of
POSIX 1003.2.

17 years agoAdd a SUSv3 symbol to our local mdoc(7) file. A patch has been submitted to
Thomas E. Spanjaard [Wed, 6 Dec 2006 16:27:28 +0000 (16:27 +0000)]
Add a SUSv3 symbol to our local mdoc(7) file. A patch has been submitted to
upstream's doc-syms.

Approved-by: Sascha Wildner <saw@online.de>

17 years agonfe_init() should be called with softc not ifnet
Sepherosa Ziehau [Wed, 6 Dec 2006 13:47:29 +0000 (13:47 +0000)]
nfe_init() should be called with softc not ifnet

17 years agoFix a bug in our confstr(3) implementation, it did not conform to POSIX
Thomas E. Spanjaard [Wed, 6 Dec 2006 11:58:57 +0000 (11:58 +0000)]
Fix a bug in our confstr(3) implementation, it did not conform to POSIX
1003.2. It returned -1 for errors where it should have returned 0.

Also, fix the only consumer of confstr(3) in our tree, getconf(1).

Dragonfly-bug: <http://bugs.dragonflybsd.org/issue393>
Reviewed-by: Victor Balada Diaz <victor@bsdes.net>

17 years agoCorrect a signedness bug which allowed members of the operator
Simon Schubert [Wed, 6 Dec 2006 11:50:06 +0000 (11:50 +0000)]
Correct a signedness bug which allowed members of the operator
group to read kernel memory.

Obtained-from: FreeBSD / FreeBSD-SA-06:25.kmem

17 years agoLocal variables that were improperly named 'errno' must be renamed so as
Matthew Dillon [Tue, 5 Dec 2006 23:31:57 +0000 (23:31 +0000)]
Local variables that were improperly named 'errno' must be renamed so as
not to conflict with libc's errno, when building a virtual kernel.

17 years agoFor the moment conditionally remove the declaration of certain libc
Matthew Dillon [Tue, 5 Dec 2006 23:14:55 +0000 (23:14 +0000)]
For the moment conditionally remove the declaration of certain libc
functions when compiling with _KERNEL_VIRTUAL to avoid conflicts with
replicas in the kernel code.  This allows the virtual kernel source to
include standard libc header files.

Define _KERNEL_VIRTUAL in machine/vkernel/conf/kern.mk.

Begin fleshing out the virtual kernel init sequence.

17 years agoImport of the port of the new(er) FreeBSD atacontrol(8), as natacontrol(8).
Thomas E. Spanjaard [Tue, 5 Dec 2006 21:32:21 +0000 (21:32 +0000)]
Import of the port of the new(er) FreeBSD atacontrol(8), as natacontrol(8).
It has not yet been hooked into the build, though it does build.

17 years agoOur cam_sim_free() does not have a flag to signify it should free the devq.
Thomas E. Spanjaard [Tue, 5 Dec 2006 19:40:43 +0000 (19:40 +0000)]
Our cam_sim_free() does not have a flag to signify it should free the devq.
We can probably get away with it like this.

Also, make sure opt_scsi.h is generated for individual kmod builds. The CAM
header files need it.

17 years agoAdd more kmods to the Makefile after testing.
Thomas E. Spanjaard [Tue, 5 Dec 2006 19:30:14 +0000 (19:30 +0000)]
Add more kmods to the Makefile after testing.

17 years agoUse IODATA as pcmcia vendor id for the IO-Data CBIDE2. Actually, it should
Thomas E. Spanjaard [Tue, 5 Dec 2006 19:28:14 +0000 (19:28 +0000)]
Use IODATA as pcmcia vendor id for the IO-Data CBIDE2. Actually, it should
be -1, because it is really identified by CIS data. This requires (at least)
a sync of our pccarddevs with Free-/NetBSD, because this vendor id actually
belongs to another company.

Also call pccard_get_function_number() instead of pccard_get_function() with
error recording, as we don't have that, and this works.

17 years agoFix a NULL pointer dereference introduced in the previous commit.
Matthew Dillon [Tue, 5 Dec 2006 19:07:18 +0000 (19:07 +0000)]
Fix a NULL pointer dereference introduced in the previous commit.

Reported-by: Emiel Kollof <coolvibe@hackerheaven.org>
Submitted-by: "Thomas E. Spanjaard" <tgen@netphreax.net>, "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>
17 years agoGenerate forwarding header files to mimic /usr/include -> /usr/include/sys
Matthew Dillon [Tue, 5 Dec 2006 17:53:09 +0000 (17:53 +0000)]
Generate forwarding header files to mimic /usr/include -> /usr/include/sys
linkages for the benefit of virtual kernel builds and virtual kernel driver
builds.  Certain header files, such as <fcntl.h>, have to be generated this
way to allow virtual kernel and virtual kernel driver source files to do
standard #include's.

17 years agoAdd a generic interrupt controller type that the virtual kernel build can use.
Matthew Dillon [Tue, 5 Dec 2006 17:06:15 +0000 (17:06 +0000)]
Add a generic interrupt controller type that the virtual kernel build can use.

17 years agoOrder ${_MACHINE_FWD}/include/machine and ${_FWDHDRS} so that intermittent
Sepherosa Ziehau [Tue, 5 Dec 2006 11:02:19 +0000 (11:02 +0000)]
Order ${_MACHINE_FWD}/include/machine and ${_FWDHDRS} so that intermittent
error messages bugging me during 'make -j N buildkernel' go away.

Rolution-from: y0netan1@

17 years agoClean up code.
Jeffrey Hsu [Tue, 5 Dec 2006 08:09:10 +0000 (08:09 +0000)]
Clean up code.

17 years agoMisc vkernel work.
Matthew Dillon [Mon, 4 Dec 2006 18:04:05 +0000 (18:04 +0000)]
Misc vkernel work.

17 years agoMake int bootverbose and int cold declarations machine independant.
Matthew Dillon [Mon, 4 Dec 2006 18:03:28 +0000 (18:03 +0000)]
Make int bootverbose and int cold declarations machine independant.

17 years agoNow that the objcache supports M_ZERO for objcache_get() in the case of
Thomas E. Spanjaard [Mon, 4 Dec 2006 15:15:54 +0000 (15:15 +0000)]
Now that the objcache supports M_ZERO for objcache_get() in the case of
simple object caches, use it.

17 years agoInitial import of the port of the new(er) FreeBSD ATA code.
Thomas E. Spanjaard [Mon, 4 Dec 2006 14:40:37 +0000 (14:40 +0000)]
Initial import of the port of the new(er) FreeBSD ATA code.

Note this code has not yet been hooked into the build as such, unless you (unwisely) specify the devices in your kernel config according to sys/conf/files. The modules are also excluded from the module build due to not having a SUBDIR entry in sys/dev/disk/Makefile. The PCI code isn't yet operation pending a patch for sys/bus/pci/pci.c I will send to kernel@ shortly. It short-circuits lazy resource allocation for PCI ATA controllers in legacy mode (i.e. on legacy ISA ATA addresses, which are not configured in the PCI BARs).

The userland utility used to control nata ('natacontrol') and documentation will follow later. Also, be aware only nata, natapci, natadisk and natapicd have seen testing on real hardware so far. nataraid, natausb and natacam are probably not compilable yet, I need to clean those up.

17 years agoHello, world!
Thomas E. Spanjaard [Sun, 3 Dec 2006 21:46:17 +0000 (21:46 +0000)]
Hello, world!

17 years agoQuick-fix some mdoc errors.
Sascha Wildner [Sun, 3 Dec 2006 21:15:27 +0000 (21:15 +0000)]
Quick-fix some mdoc errors.

I'll do a more thorough run over it within the next few days.

17 years agoMove the committer manpage (outlining the rules for committers) from man8
Sascha Wildner [Sun, 3 Dec 2006 21:04:23 +0000 (21:04 +0000)]
Move the committer manpage (outlining the rules for committers) from man8
to man7.

17 years agoAdd a manual page outlining the rules for committers.
Matthew Dillon [Sun, 3 Dec 2006 20:28:07 +0000 (20:28 +0000)]
Add a manual page outlining the rules for committers.

17 years agoCheck an additional special pattern to detect dangerously dedicated mode.
Matthew Dillon [Sun, 3 Dec 2006 04:52:25 +0000 (04:52 +0000)]
Check an additional special pattern to detect dangerously dedicated mode.

Submitted-by: "Thomas E. Spanjaard" <tgen@netphreax.net>
17 years agoApply FreeBSD rev 1.17:
Jeffrey Hsu [Sun, 3 Dec 2006 03:16:24 +0000 (03:16 +0000)]
Apply FreeBSD rev 1.17:
  date: 2004-09-25 19:01:27 -0700;  author: sam;  state: Exp;  lines: +0 -5;
  Correct handling of SADB_UPDATE and SADB_ADD requests.  key_align may split
  the mbuf due to use of m_pulldown.  Discarding the result because of this
  does not make sense as no subsequent code depends on the entire msg being
  linearized (only the individual pieces).  It's likely something else is wrong
  here but for now this appears to get things back to a working state.

  Submitted by:   Roselyn Lee

17 years agoApply FreeBSD rev 1.6:
Jeffrey Hsu [Sun, 3 Dec 2006 02:52:44 +0000 (02:52 +0000)]
Apply FreeBSD rev 1.6:
  date: 2003-06-29 16:58:38 -0700;  author: sam;  state: Exp;  lines: +13 -2;
  plug xform memory leaks:

  o add missing zeroize op when deleting an SA
  o don't re-initialize an xform for an SA that already has one

  Submitted by:   Doug Ambrisko <ambrisko@verniernetworks.com>

17 years agoApply FreeBSD rev 1.16:
Jeffrey Hsu [Sun, 3 Dec 2006 02:47:53 +0000 (02:47 +0000)]
Apply FreeBSD rev 1.16:
  date: 2004-06-22 10:17:44 -0700;  author: bms;  state: Exp;  lines: +2 -2;
  Fix a paste-o in key_cmpspidx_withmask().

  PR:             misc/67013
  Submitted by:   Zhenmin <zli4@cs.uiuc.edu>

17 years agoApply FreeBSD rev 1.15:
Jeffrey Hsu [Sun, 3 Dec 2006 02:45:42 +0000 (02:45 +0000)]
Apply FreeBSD rev 1.15:
  date: 2004-05-02 22:15:53 -0700;  author: sam;  state: Exp;  lines: +2 -2;
  use correct address for SADB_EXT_ADDRESS_DST in key_do_allocsa_policy
  (was using src instead of dst)

  Submitted by:   Bjoern A. Zeeb
  Obtained from:  KAME

17 years agoApply FreeBSD rev 1.9:
Jeffrey Hsu [Sun, 3 Dec 2006 02:29:02 +0000 (02:29 +0000)]
Apply FreeBSD rev 1.9:
  date: 2004-02-05 15:19:17 -0800;  author: sam;  state: Exp;  lines: +7 -1;
  must convert protocol to sa type when preparing a DELETE message

  Submitted by:   Roselyn Lee <rosel@verniernetworks.com>

17 years agoReplace the global VM page hash table with a per-VM-object RB tree. No
Matthew Dillon [Sat, 2 Dec 2006 23:13:46 +0000 (23:13 +0000)]
Replace the global VM page hash table with a per-VM-object RB tree.  No
performance degradation was observed (probably due to locality of reference
in the RB tree improving cache characteristics for searches).  This also
significantly reduces the kernel memory footprint (no global VM page hash
table) and reduces the size of the vm_page structure.  Future MP work
should benefit from this change.

Prior work in the VM tree guarenteed that VM pages only existed in the hash
table while also associated with a VM object, this commit uses that guarentee
to make the VM page lookup structures VM-object-centric.

17 years agoAllow M_ZERO to be specified when using simple object cache setups which
Matthew Dillon [Sat, 2 Dec 2006 22:17:22 +0000 (22:17 +0000)]
Allow M_ZERO to be specified when using simple object cache setups which
do not have a ctor or dtor function.  Panic the system if M_ZERO is used
with more complex object setups.

Suggested-by: Thomas E. Spanjaard
17 years agoIn rtw_pci_shutdown(), hold serializer before calling rtw_stop()
Sepherosa Ziehau [Fri, 1 Dec 2006 07:52:30 +0000 (07:52 +0000)]
In rtw_pci_shutdown(), hold serializer before calling rtw_stop()

17 years ago- Enable PBCC based rate 22Mbit/s
Sepherosa Ziehau [Fri, 1 Dec 2006 07:37:18 +0000 (07:37 +0000)]
- Enable PBCC based rate 22Mbit/s
- Finish incomplete acx_watchdog()
- Add acx_media_change(), which re-initialize NIC and returns 0 if
  ieee80211_media_change() returns ENETRESET.  Use acx_media_change()
  as change_callback for ifmedia instead of ieee80211_media_change().
  This unbreaks 'ifconfig acx0 list sta' in HOSTAP operation mode.
- Nuke no longer needed debug messages

17 years agoAdd PBCC modulation support in netproto/802_11:
Sepherosa Ziehau [Fri, 1 Dec 2006 04:42:53 +0000 (04:42 +0000)]
Add PBCC modulation support in netproto/802_11:
- Since ieee80211com.ic_caps is already crowded, add ieee80211com.ic_caps_ext
  to extend it.  Currently only IEEE80211_CEXT_PBCC, which should be set by
  the drivers capable of PBCC modulation, is defined for this field.
- Adapt SIOCG80211:IEEE80211_IOC_DRIVER_CAPS ioctl handling to expose the
  content of ieee80211com.ic_caps_ext.  Old semantic of this ioctl is not
  changed, given ieee80211req is zeroed out before the ioctl call.
- Add debug information about peer node's rate set (after negociation)
- Set PBCC bit in Capability ie base on the value of
  (ieee80211com.ic_caps_ext & IEEE80211_CEXT_PBCC).  This is only done for 2GHz
  channels.
- Teach ifconfig(8) to print ieee80211.ic_caps_ext upon "list caps" command.

17 years agoProperly set ifmedia_entry.ifm_data when nge(4) tries to camouflage an
Sepherosa Ziehau [Thu, 30 Nov 2006 01:38:54 +0000 (01:38 +0000)]
Properly set ifmedia_entry.ifm_data when nge(4) tries to camouflage an
isolation media entry, and restore it once media isolation is done.

Reported-by: Steve O'Hara-Smith <steve@sohara.org>
Tested-by: Steve O'Hara-Smith <steve@sohara.org>
Reviewed-by: dillon@
17 years agoDon't use unprocessed (e.g. negociated) peer node's rate set to fill
Sepherosa Ziehau [Wed, 29 Nov 2006 15:12:10 +0000 (15:12 +0000)]
Don't use unprocessed (e.g. negociated) peer node's rate set to fill
Supported rates ie of Association Request, instead, use own supported
rate set (i.e. ieee80211com.ic_sup_rates).

In the orginal way, following senario is broken:
- STA is 11b
- AP is 11g
STA will send out sorted AP's rate set in Association Request.  Obviously
STA will not be able to receive at any data rates > 11Mbit/s.  So this
breaks IEEE Std 802.11b subclause 10.3.3.1.2:
"... The STA must be able to receive at each of the data rates listed
 in the set. ...".

17 years agoAccording to IEEE Std 802.11b-1999 subclause 7.3.1.4:
Sepherosa Ziehau [Tue, 28 Nov 2006 15:17:36 +0000 (15:17 +0000)]
According to IEEE Std 802.11b-1999 subclause 7.3.1.4:
"... STAs shall set the Short Preamble subfield to 1 in transmitted
 Association Request and Reassociation Request MMPDUs when the MIB
 attribute dot11ShortPreambleOptionImplemented is true. ..."

For us, 'dot11ShortPreambleOptionImplemented' is
(ieee80211com.ic_caps & IEEE80211_C_SHPREAMBLE)

17 years agoM_NOWAIT -> MB_DONTWAIT
Sepherosa Ziehau [Tue, 28 Nov 2006 14:44:03 +0000 (14:44 +0000)]
M_NOWAIT -> MB_DONTWAIT