]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
17 years agoAdd the following functions to abstract away the creation of task threads
alfred [Mon, 8 Jan 2007 23:21:06 +0000 (23:21 +0000)]
Add the following functions to abstract away the creation of task threads
for usb.  I hope that this will eventually be used for generic devices
that need full fledged blocking threads for event processing.

Create a taskqueue:
void usb_ether_task_init(device_t, int, struct usb_taskqueue *);

Enqueue a task:
void usb_ether_task_enqueue(struct usb_taskqueue *, struct task *);

Wait for all tasks queued to complete:
void usb_ether_task_drain(struct usb_taskqueue *, struct task *);

Destroy the taskqueue:
void usb_ether_task_destroy(struct usb_taskqueue *);

17 years agoFactor out my copyrights + licenses from Charles D. Cranor and
rwatson [Mon, 8 Jan 2007 22:30:39 +0000 (22:30 +0000)]
Factor out my copyrights + licenses from Charles D. Cranor and
University of Washington copyrights, which include the
advertising clause.  Move $NetBSD$ into standard location for
FreeBSD source files, and normalize formatting.

MFC after: 3 days

17 years agoFactor out UCB and my copyrights from copyrights of Mike Mitchell;
rwatson [Mon, 8 Jan 2007 22:14:00 +0000 (22:14 +0000)]
Factor out UCB and my copyrights from copyrights of Mike Mitchell;
the former use a three-clause BSD license (per UCB authorization
letter), whereas he uses a four-clause BSD license.

MFC after: 3 days

17 years agoReplace (name) with Henric Vestergaard Draboel since it was clear that
imp [Mon, 8 Jan 2007 21:21:45 +0000 (21:21 +0000)]
Replace (name) with Henric Vestergaard Draboel since it was clear that
this was just cut N paste and '(name)' doesn't make any sense.  If
someone knows how to contact Mr. Draboel, please let me know.

17 years agoSort copyrights together.
rwatson [Mon, 8 Jan 2007 20:37:02 +0000 (20:37 +0000)]
Sort copyrights together.

MFC after: 3 days

17 years agoResort copyrights and licenses in kern_acct.c: per UCB letter,
rwatson [Mon, 8 Jan 2007 20:35:13 +0000 (20:35 +0000)]
Resort copyrights and licenses in kern_acct.c: per UCB letter,
the UCB license now excludes the advertising clause.  I'm not
interested in it either, so move my copyright.  This leaves
only a CGD copyright with the advertising clause.

MFC after:      3 days

17 years agoPer Olivier Houchard, use the proper license for this file. He
imp [Mon, 8 Jan 2007 18:25:58 +0000 (18:25 +0000)]
Per Olivier Houchard, use the proper license for this file.  He
bogusly used the kvm_powerpc.c file as a template for the license, but
then either wrote the code himself, or cribbed it from the kvm_i386
file.  The only thing from the kvm_powerpc.c file was the license.
Correct this mistake with his blessing.

17 years agoFix potential node refcnt leak. If mbufs are q'd on ic_mgtq when
sam [Mon, 8 Jan 2007 18:23:43 +0000 (18:23 +0000)]
Fix potential node refcnt leak.  If mbufs are q'd on ic_mgtq when
the state machine clocks to INIT, node references are not reclaimed.
Add a new routine ieee80211_drain_ifq that does this and use it
instead of IF_DRAIN.

Submitted by: Sepherosa Ziehau
Obtained from: DragonFly
MFC after: 1 month

17 years agoBreak out my copyrights with our 2-clause BSD license from the UMich
rwatson [Mon, 8 Jan 2007 17:58:27 +0000 (17:58 +0000)]
Break out my copyrights with our 2-clause BSD license from the UMich
copyright, which while similar, is different.

MFC after: 3 days

17 years agoCanonicalize copyright: use a date range rather than comma-delimited
rwatson [Mon, 8 Jan 2007 17:55:32 +0000 (17:55 +0000)]
Canonicalize copyright: use a date range rather than comma-delimited
list.

MFC after: 3 days

17 years agoCanonicalize copyrights in some files I hold copyrights on:
rwatson [Mon, 8 Jan 2007 17:49:59 +0000 (17:49 +0000)]
Canonicalize copyrights in some files I hold copyrights on:

- Sort by date in license blocks, oldest copyright first.
- All rights reserved after all copyrights, not just the first.
- Use (c) to be consistent with other entries.

MFC after: 3 days

17 years agoRemove the advertising clause. UCB did this some time ago, but these
imp [Mon, 8 Jan 2007 17:35:36 +0000 (17:35 +0000)]
Remove the advertising clause.  UCB did this some time ago, but these
files were never updated to reflect that.

MFC After: 2 days

17 years agoCorrect several issues with rate set negotiation:
sam [Mon, 8 Jan 2007 17:24:51 +0000 (17:24 +0000)]
Correct several issues with rate set negotiation:
o add IEEE80211_F_JOIN flag to ieee80211_fix_rate to indicate a station
  is joining a BSS; this is used to control whether or not we over-write
  the basic rate bit in the calculated rate set
o fix ieee80211_fix_rate to honor IEEE80211_F_DODEL when IEEE80211_F_DONEGO
  is not specified (e.g. when joining an ibss network)
o on sta join always delete unusable rates from the negotiated rate set,
  this was being done only ibss networks but is also needed for 11g bss
  with mixed stations
o on sta join delete unusable rates from the bss node's rate set, not the
  scan table entry's rate set
o when calculating a rate set for new neighbors in an ibss caculate a
  negotiated rate set so drivers are not presented with rates they should
  not use

Submitted by: Sepherosa Ziehau (w/ modifications)
Obtained from: DragonFly
MFC after: 1 month

17 years agoo Changes to psycho_attach(): [1]
marius [Mon, 8 Jan 2007 01:26:47 +0000 (01:26 +0000)]
o Changes to psycho_attach(): [1]
  - Clear the PCI AFSR and status error bits as previous errors still
    might be indicated.
  - Set up the PCI control and diagnostic registers according to the
    capabilities, workarounds, etc of/for specific revisions of the
    supported bridges. This includes no longer setting Hummingbird-/
    Sabre-specific bits in the PCI control register but preserving
    what the firmware has initialized them to like OpenSolaris does.
    Previously we were setting these bits according to the example in
    the Sabre documentation, which I doubt is appropriate for all
    Sabre based designs and especially not for Hummingbirds. This
    also includes not enabling bus parking unless the firmware tells
    us to.
  - Set the PCI latency timer register as this isn't always done by
    the firmware.
o Remove a redundant argument from psycho_set_intr() and in this
  function check the return value of bus_setup_intr(). [2]
o Let psycho_setup_intr() return ENOMEM instead of 0 when it can't
  allocate memory for the interrupt wrapper stub and EINVAL instead
  of 0 if it can't find the interrupt vector in the interrupt map.
o Add a workaround for a bug of the Sabre-APB-combination where it
  doesn't drain DMA write data for devices behind additional PCI-PCI
  bridges underneath the APB PCI-PCI bridge. This workaround (do
  things necessary in order to achieve a manual drain when coherency
  is required) is currently implemented in psycho_setup_intr() and
  psycho_intr_stub() (for easy MFC'ing) and therefore is only applied
  for interrupt handlers. This should be moved to psycho(4)-specific
  bus_dma_tag_create() and bus_dmamap_sync() methods, respectively,
  once this driver is converted to make use of BUS_GET_DMA_TAG(), so
  the workaround is also applied for polling(4) callbacks. [3]
o Fix some minor style issues.

Info from: OpenSolaris [1]
Info from: Linux, OpenBSD, OpenSolaris [3]
Suggested by: Coverity Prevent (CID 682) [2]
MFC after: 1 month

17 years agoIn ofw_pcibus_attach() skip dupe PCI devices reported by the
marius [Mon, 8 Jan 2007 01:08:24 +0000 (01:08 +0000)]
In ofw_pcibus_attach() skip dupe PCI devices reported by the
firmware (mainly 'pmu' and its 'lomp' dupe found in a couple of
later USII{e,i}-based machines) by checking whether a device with
the same triple of bus number, slot and function already has been
added. This is the simple yet effective approach introduced in
OpenBSD some time ago, but which has the flaw that it assumes
that the device and its dupe(s) found in the OFW device tree are
equal or at least the one encountered first is in some way the
more important one (this is the case with 'pmu' and 'lomp'; the
'pmu' node has couple of properties and children while the 'lomp'
one misses most of these). If there's ever a device/dupe pair
where we don't encounter the more important node first, we'll
probably need to introduce a quirk list in order to add the
desired device but prevent its dupe(s) from being added.

MFC after: 1 week

17 years agoFix a typo which blindly enabled TSO capability without respect to
yongari [Mon, 8 Jan 2007 01:03:18 +0000 (01:03 +0000)]
Fix a typo which blindly enabled TSO capability without respect to
chip type.

17 years agoDon't rely on GM_GP_CTRL register contents when mii(4) layer reports
yongari [Mon, 8 Jan 2007 00:58:00 +0000 (00:58 +0000)]
Don't rely on GM_GP_CTRL register contents when mii(4) layer reports
link state changes. Instead, build new speed/duplex/flow-control
settings from the values reported from PHY.
This should fix speed/duplex/flow-control mismatches between GMAC and
PHY which resulted in very poor Rx performance due to lots of
out-of-order packet delivery.

Reported by: Arno J. Klaassen <arno AT heho DOT snv DOT jussieu DOT fr>
Tested by: Arno J. Klaassen <arno AT heho DOT snv DOT jussieu DOT fr>

17 years agoFix LINT and ACPI_DEBUG builds and add print for use of flush cache inst.
njl [Mon, 8 Jan 2007 00:45:46 +0000 (00:45 +0000)]
Fix LINT and ACPI_DEBUG builds and add print for use of flush cache inst.

17 years ago- Garbage collect more alpha remnants.
marius [Mon, 8 Jan 2007 00:33:27 +0000 (00:33 +0000)]
- Garbage collect more alpha remnants.
- Fix a typo in a comment in boot_font.c.

17 years agoInitialize legacy SYS_RES_IRQ resources before attempting to use MSI.
yongari [Mon, 8 Jan 2007 00:19:53 +0000 (00:19 +0000)]
Initialize legacy SYS_RES_IRQ resources before attempting to use MSI.
This fixes legacy SYS_RES_IRQ resource allocation failure when MSI is
disabled.

Reported by: rrs
Tested by: rrs

17 years agoTell backing v_object the filesize right on it's creation.
pav [Sun, 7 Jan 2007 23:53:16 +0000 (23:53 +0000)]
Tell backing v_object the filesize right on it's creation.

MFC after: 1 week

17 years agoBe more specific in ENXIO description:
pjd [Sun, 7 Jan 2007 23:06:53 +0000 (23:06 +0000)]
Be more specific in ENXIO description:
- O_NONBLOCK flag has to be set, if it is not set, open(2) will wait for
  another process opening the fifo for reading,
- Use O_WRONLY which implies that the file has to be opened _only_ for write.

17 years agoopen(2) returns EROFS when O_CREAT is specified and the named file would
pjd [Sun, 7 Jan 2007 23:01:32 +0000 (23:01 +0000)]
open(2) returns EROFS when O_CREAT is specified and the named file would
reside on a read-only file system.

17 years agoGarbage collect the code for auto-loading modules based on ISAPNP IDs,
marius [Sun, 7 Jan 2007 22:25:45 +0000 (22:25 +0000)]
Garbage collect the code for auto-loading modules based on ISAPNP IDs,
which is #if'ed out since nearly eight years, along with its outdated
database.

Agreed by: ru (some months ago)

17 years agoRe-work Cx handling to be per-cpu and asymmetrical, fixing support on
njl [Sun, 7 Jan 2007 21:53:42 +0000 (21:53 +0000)]
Re-work Cx handling to be per-cpu and asymmetrical, fixing support on
modern dual-core systems as well.

- Parse the _CST packages for each cpu and track all the states individually,
on a per-cpu basis.

- Revert to generic FADT/P_BLK based Cx control if the _CST package
is not present on all cpus. In that case, the new driver will
still support per-cpu Cx state handling. The driver will determine the
highest Cx level that can be supported by all the cpus and configure the
available Cx state based on that.

- Fixed the case where multiple cpus in the system share the same
registers for Cx state handling. To do that, added a new flag
parameter to the acpi_PkgGas and acpi_bus_alloc_gas functions that
enable the caller to add the RF_SHAREABLE flag.  This flag could also be
useful to other callers (acpi_throttle?) in the tree but this change is
not yet made.

- For Core Duo cpus, both cores seems to be taken out of C3 state when
any one of the cores need to transition out. This broke the short sleep
detection logic.  It is disabled now if there is more than one cpu in
the system for now as it fixed it in my case.  This quirk may need to
be re-enabled later differently.

- Added support to control cx_lowest on a per-cpu basis. There is still
a generic cx_lowest to enable changing cx_lowest for all cpus with a single
sysctl and for ease of use.  Sample output for the new sysctl:

dev.cpu.0.cx_supported: C1/1 C2/1 C3/57
dev.cpu.0.cx_lowest: C3
dev.cpu.0.cx_usage: 0.00% 43.16% 56.83%
dev.cpu.1.cx_supported: C1/1 C2/1 C3/57
dev.cpu.1.cx_lowest: C3
dev.cpu.1.cx_usage: 0.00% 45.65% 54.34%
hw.acpi.cpu.cx_lowest: C3

This work was done by Stephane E. Potvin with some simple reworking by
myself.  Thank you.

Submitted by: Stephane E. Potvin <sepotvin / videotron.ca>
MFC after: 2 weeks

17 years agoSpecial case to support hard-coded configuration for building on Windows.
kientzle [Sun, 7 Jan 2007 21:32:25 +0000 (21:32 +0000)]
Special case to support hard-coded configuration for building on Windows.

17 years agoDocument that we supported Intel PRO/100 VM Network Connection.
delphij [Sun, 7 Jan 2007 20:30:27 +0000 (20:30 +0000)]
Document that we supported Intel PRO/100 VM Network Connection.

17 years agoDisable multichannel recording in snd_emu10kx module. Whith multichannel
netchild [Sun, 7 Jan 2007 19:43:59 +0000 (19:43 +0000)]
Disable multichannel recording in snd_emu10kx module. Whith multichannel
recording enabled some programs (audio/audacity from ports) can't
correctly enumerate all /dev/dsp device.

Note: previous commit did not enable some debugging stuff, my eyes did
misread "#undef" as "#define".

Submitted by: Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>

17 years agoMFp4 (112646):
netchild [Sun, 7 Jan 2007 19:30:19 +0000 (19:30 +0000)]
MFp4 (112646):
Now (ok it's been a while...) that FreeBSD has RLIMIT_AS too, we can use
it in the linuxolator instead of ignoring it.

This fixes a LTP test.

Submitted by: rdivacky

17 years agoMFp4 (112535):
netchild [Sun, 7 Jan 2007 19:20:17 +0000 (19:20 +0000)]
MFp4 (112535):
No need to lock prison in a case of linux_use26 because the int
setting is atomic and process cannot leave jail.

Submitted by: kib
Reviewed by: jhb
Requested by: rdivacky

17 years agoMFp4 (112534):
netchild [Sun, 7 Jan 2007 19:14:06 +0000 (19:14 +0000)]
MFp4 (112534):
Dont lock em in a case of just using em->shared->group_pid because
the group_pid never changes.

Submitted by: rdivacky
Reviewed by: kib
Glanced at by: jhb

17 years agoMFp4 (112499):
netchild [Sun, 7 Jan 2007 19:09:20 +0000 (19:09 +0000)]
MFp4 (112499):
Protect em->shared with the lock in case of CLONE_THREAD.

Submitted by: rdivacky

17 years agoMFp4 (112498):
netchild [Sun, 7 Jan 2007 19:00:38 +0000 (19:00 +0000)]
MFp4 (112498):
Rename the locking flags to EMUL_DOLOCK and EMUL_DONTLOCK to prevent confusion.

Submitted by: rdivacky

17 years agoSort: powerpc comes after pc98.
marcel [Sun, 7 Jan 2007 18:14:44 +0000 (18:14 +0000)]
Sort: powerpc comes after pc98.

17 years ago- POSIX mentions that EACCES can be returned when O_TRUNC is specified
pjd [Sun, 7 Jan 2007 17:55:19 +0000 (17:55 +0000)]
- POSIX mentions that EACCES can be returned when O_TRUNC is specified
  separately. Do the same.
- Document when EPERM can be returned.

17 years agoPrefer "to be modified" over "to be opened for writing".
pjd [Sun, 7 Jan 2007 17:32:16 +0000 (17:32 +0000)]
Prefer "to be modified" over "to be opened for writing".
This is quite tricky situation, because we allow to open a file with
O_RDONLY|O_TRUNC. O_TRUNC modifies a file, but we actually don't open
it for writing. EISDIR is also returned when we try to open a directory
O_RDONLY|O_TRUNC, which is correct.
POSIX says that "The result of using O_TRUNC with O_RDONLY is undefined.",
we choose to accept it (Solaris did the same), that's why "to be modified"
seems more accurate to me.

17 years agoMFi386: revision 1.646.
nyan [Sun, 7 Jan 2007 12:13:10 +0000 (12:13 +0000)]
MFi386: revision 1.646.

17 years agoFix a few of the tests so that correct implementations actually pass them.
das [Sun, 7 Jan 2007 09:25:22 +0000 (09:25 +0000)]
Fix a few of the tests so that correct implementations actually pass them.

17 years agoImplement modfl().
das [Sun, 7 Jan 2007 07:54:21 +0000 (07:54 +0000)]
Implement modfl().

17 years agoDeclare the map entry created by kmem_init() for the range from
alc [Sun, 7 Jan 2007 07:32:04 +0000 (07:32 +0000)]
Declare the map entry created by kmem_init() for the range from
VM_MIN_KERNEL_ADDRESS to the end of the kernel's bootstrap data as
MAP_NOFAULT.

17 years agoUp the event class reporting from 10 (basically, nothing) to EVT_CLASS_INFO.
scottl [Sun, 7 Jan 2007 06:43:25 +0000 (06:43 +0000)]
Up the event class reporting from 10 (basically, nothing) to EVT_CLASS_INFO.

Submitted by: Doug Ambrisko

17 years agoFix a parsing bug when specifying more than one address with dotted decimal
mlaier [Sun, 7 Jan 2007 03:02:02 +0000 (03:02 +0000)]
Fix a parsing bug when specifying more than one address with dotted decimal
netmask.

Reported by: Igor Anishchuk
PR: kern/107565
MFC after: 3 days

17 years agoWhen returning early from audit_arg_file() due to so->so_pcb being NULL
rwatson [Sat, 6 Jan 2007 22:28:28 +0000 (22:28 +0000)]
When returning early from audit_arg_file() due to so->so_pcb being NULL
(due to an early reset or the like), remember to unlock the socket lock.
This will not occur in 7-CURRENT, but could in theory occur in 6-STABLE.

MFC after: 1 week

17 years agoMore minor cleanups:
dougb [Sat, 6 Jan 2007 22:04:46 +0000 (22:04 +0000)]
More minor cleanups:

1. Fix small typo "retorted ." -> "retorted."
2. Remove from fortunes a story that is duplicated in fortunes2-o
3. Remove from fortunes and fortunes2-o Zippy the Pinhead quotes
that are already in the zippy file.
4. ... therefore remove zippy from fortunes.sp.ok
5. Remove a duplicate in the zippy file.

17 years agoHandle inf/nan correctly.
das [Sat, 6 Jan 2007 21:50:04 +0000 (21:50 +0000)]
Handle inf/nan correctly.

17 years agoFix a problem relating to fesetenv() clobbering i387 register stack.
das [Sat, 6 Jan 2007 21:46:23 +0000 (21:46 +0000)]
Fix a problem relating to fesetenv() clobbering i387 register stack.

Details: As a side-effect of restoring a saved FP environment,
fesetenv() overwrites the tag word, which indicates which i387
registers are in use.  Normally this isn't a problem because
the calling convention requires the register stack to be empty
on function entry and exit.  However, fesetenv() is inlined, so we
need to tell gcc explicitly that the i387 registers get clobbered.

PR: 85101

17 years agoFix a cut-and-paste-o.
das [Sat, 6 Jan 2007 21:23:20 +0000 (21:23 +0000)]
Fix a cut-and-paste-o.

17 years agoCorrectly handle NaN.
das [Sat, 6 Jan 2007 21:22:57 +0000 (21:22 +0000)]
Correctly handle NaN.

17 years agoCorrectly handle inf/nan. This routine is currently unused because we
das [Sat, 6 Jan 2007 21:22:38 +0000 (21:22 +0000)]
Correctly handle inf/nan.  This routine is currently unused because we
seem to have assembly versions for all architectures, but it can't
hurt to fix it.

17 years agoRemove modf from libm's symbol map. It's actually in libc for
das [Sat, 6 Jan 2007 21:18:17 +0000 (21:18 +0000)]
Remove modf from libm's symbol map.  It's actually in libc for
hysterical raisins.

17 years agoWhen performing a mount update to change a mount from read-only to read-write,
rodrigc [Sat, 6 Jan 2007 20:46:02 +0000 (20:46 +0000)]
When performing a mount update to change a mount from read-only to read-write,
do not call markvoldirty() until the mount has been flagged as read-write.
Due to the nature of the msdosfs code, this bug only seemed to appear for
FAT-16 and FAT-32.

This fixes the testcase:
#!/bin/sh
dd if=/dev/zero bs=1m count=1 oseek=119 of=image.msdos
mdconfig -a -t vnode -f image.msdos
newfs_msdos -F 16 /dev/md0 fd120m
mount_msdosfs -o ro /dev/md0 /mnt
mount | grep md0
mount -u -o rw /dev/md0; echo $?
mount | grep md0
umount /mnt
mdconfig -d -u 0

PR: 105412
Tested by: Eugene Grosbein <eugen grosbein pp ru>

17 years agoFixes module build with DEB(x) defined to x.
netchild [Sat, 6 Jan 2007 19:11:48 +0000 (19:11 +0000)]
Fixes module build with DEB(x) defined to x.

Submitted by: Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>

17 years agoSync with NetBSD:
netchild [Sat, 6 Jan 2007 19:08:39 +0000 (19:08 +0000)]
Sync with NetBSD:
  revision 1.98 is NOT merged, because FreeBSD does not support this
  syntax.
  revision 1.99 is NOT merged, "const poisoning" part is not applicable
  to FreeBSD. There is no variable shadowing, GCC can't find
  this one (but there are others)
  revision 1.100 is NOT merged, because it was null patch (no changes)
  revision 1.101 is NOT merged, there is no BIT() macro in FreeBSD
  revision 1.102 is merged
  revision 1.103 is partially merged. There is no ai.ifaceh in FreeBSD
  revision 1.104 is NOT merged
  revision 1.105 is merged
  revision 1.106 is not merged, because of rev. 1.107
  revision 1.107 is a backuout of 1.106

Submitted by: Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>

17 years agoExtend the emu10kx driver. With the words of the author:
netchild [Sat, 6 Jan 2007 18:59:35 +0000 (18:59 +0000)]
Extend the emu10kx driver. With the words of the author:
---snip---
New features:
1. Optional multichannel recording (32 channels on Live!, 64 channels
  on Audigy).

  All channels are 16bit/48000Hz/mono, format is fixed.
  Half of them are copied from sound output, another half can be
  used to record any data from DSP. What should be recorded is
  hardcoded in DSP code. In this version it records dummy data, but
  can be used to record all DSP inputs, for example..

  Because there are no support of more-than-stereo sound streams
  multichannell stream is presented as one 32(64)*48000 Hz 16bit mono
  stream.

  Channel map:

  SB Live! (4.0/5.1)
  offset (words) substream
  0x00 Front L
  0x01 Front R
  0x02 Digital Front L
  0x03 Digital Front R
  0x04 Digital Center
  0x05 Digital Sub
  0x06 Headphones L
  0x07 Headphones R
  0x08 Rear L
  0x09 Rear R
  0x0A ADC (multi-rate recording) L
  0x0B ADC (multi-rate recording) R
  0x0C unused
  0x0D unused
  0x0E unused
  0x0F unused
  0x10 Analog Center (Live! 5.1) / dummy (Live! 4.0)
  0x11 Analog Sub (Live! 5.1) / dummy (Live! 4.0)
  0x12..-0x1F dummy

  Audigy / Audigy 2 / Audigy 2 Value / Audigy 4
  offset (words) substream
  0x00 Digital Front L
  0x01 Digital Front R
  0x02 Digital Center
  0x03 Digital Sub
  0x04 Digital Side L (7.1 cards) / Headphones L (5.1 cards)
  0x05 Digital Side R (7.1 cards) / Headphones R (5.1 cards)
  0x06 Digital Rear L
  0x07 Digital Rear R
  0x08 Front L
  0x09 Front R
  0x0A Center
  0x0B Sub
  0x0C Side L
  0x0D Side R
  0x0E Rear L
  0x0F Rear R
  0x10 output to AC97 input L (muted)
  0x11 output to AC97 input R (muted)
  0x12 unused
  0x13 unused
  0x14 unused
  0x15 unused
  0x16 ADC (multi-rate recording) L
  0x17 ADC (multi-rate recording) R
  0x18 unused
  0x19 unused
  0x1A unused
  0x1B unused
  0x1C unused
  0x1D unused
  0x1E unused
  0x1F unused
  0x20..0x3F dummy

Fixes:
1. Do not assign negative values to variables used to index emu_cards
  array. This array was never accessed when index is negative, but
  Alexander (netchild@) told me that Coverity does not like it.
  After this change emu_cards[0] should never be used to identify
  valid sound card.
2. Fix off-by-one errors in interrupt manager. Add more checks there.
3. Fixes to sound buffering code now allows driver to use large playback
  buffers.
4. Fix memory allocation bug when multichannel recording is not
  enabled.
5. Fix interrupt timeout when recording with low bitrate (8kHz).

Hardware:
1. Add one more known Audigy ZS card to list. Add two cards with
  PCI IDs betwen old known cards and new one.

Other changes:
1. Do not use ALL CAPS in messages.

Incomplete code:
1. Automute S/PDIF when S/PDIF signal is lost.

Tested on i386 only, gcc 3.4.6 & gcc41/gcc42 (syntax only).
---snip---

This commits enables a little bit of debugging output when the driver is
loaded as a module. I did a cross-build test for amd64.

The code has some style issues, this will be addressed later.

The multichannel recording part is some work in progress to allow playing
around with it until the generic sound code is better able to handle
multichannel streams.

This is supposed to fix
CID: 171187
Found by: Coverity Prevent

Submitted by: Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>

17 years agoMFi386 rev 1.56:
netchild [Sat, 6 Jan 2007 15:58:34 +0000 (15:58 +0000)]
MFi386 rev 1.56:
Bring the linux mmap code more into line with how linux (2.4.x) behaves.

Tested by: Scot Hetzel <swhetzel@gmail.com> on amd64 without PROT_EXEC

Additionally to the i386 version always use PROT_EXEC in the mapping like the
previous version of the amd64 code did. We need to examinate this further to
decide what the right thing to do is. For now this fixes several problems in
the LTP test runs and should behave regarding PROT_EXEC like before.

17 years agoo One more typo in the comment.
maxim [Sat, 6 Jan 2007 13:12:24 +0000 (13:12 +0000)]
o One more typo in the comment.

PR: kern/107609
Submitted by: Dr. Markus Waldeck

17 years ago - Don't let SCHED_TICK_TOTAL() return less than hz. This can cause integer
jeff [Sat, 6 Jan 2007 12:33:43 +0000 (12:33 +0000)]
 - Don't let SCHED_TICK_TOTAL() return less than hz.  This can cause integer
   divide faults in roundup() later if it is able to return 0.  For some
   reason this bug only shows up on my laptop and not my testboxes.

17 years agoFix compiling.
davidxu [Sat, 6 Jan 2007 11:32:15 +0000 (11:32 +0000)]
Fix compiling.

17 years agoAdd function __mq_oshandle() to get file handle of a mqueue.
davidxu [Sat, 6 Jan 2007 11:30:04 +0000 (11:30 +0000)]
Add function __mq_oshandle() to get file handle of a mqueue.

17 years ago - Fix the sched_priority() invalid priority bugs. Use roundup() instead
jeff [Sat, 6 Jan 2007 08:44:13 +0000 (08:44 +0000)]
 - Fix the sched_priority() invalid priority bugs.  Use roundup() instead
   of max() when computing the divisor in SCHED_TICK_PRI().  This prevents
   cases where rounding down would allow the quotient to exceed
   SCHED_PRI_RANGE.
 - Garbage collect some unused flags and fields.
 - Replace TDF_HOLD with sched_pin_td()/sched_unpin_td() since it simply
   duplicated this functionality.
 - Re-enable the rebalancer by default and fix the sysctl so it can be
   modified.

17 years agoRestore agp aperture size after resume, in case it is modified after boot.
takawata [Sat, 6 Jan 2007 08:31:31 +0000 (08:31 +0000)]
Restore agp aperture size after resume, in case it is modified after boot.

17 years agoFix compile error.
mjacob [Sat, 6 Jan 2007 05:38:18 +0000 (05:38 +0000)]
Fix compile error.

17 years ago - Add colors for up to 8 cpus.
jeff [Sat, 6 Jan 2007 04:40:44 +0000 (04:40 +0000)]
 - Add colors for up to 8 cpus.

17 years agofix declaration / definition mismatch with ieee80211_chan2ieee
kmacy [Sat, 6 Jan 2007 02:56:41 +0000 (02:56 +0000)]
fix declaration / definition mismatch with ieee80211_chan2ieee

17 years ago - Don't IPI unless we're going to interrupt something exiting in the kernel.
jeff [Sat, 6 Jan 2007 02:34:23 +0000 (02:34 +0000)]
 - Don't IPI unless we're going to interrupt something exiting in the kernel.
   otherwise we can afford the latency.  This makes a significant performance
   improvement.

17 years ago - Fix a comparison in sched_choose() that caused cpus to be constantly
jeff [Fri, 5 Jan 2007 23:45:38 +0000 (23:45 +0000)]
 - Fix a comparison in sched_choose() that caused cpus to be constantly
   marked idle, thus breaking cpu load balancing.
 - Change sched_interact_update() to fix cases where the stored history
   has expanded significantly rather than handling them in the callers.  This
   fixes a case where sched_priority() could compute a bad value.
 - Add a sysctl to disable the global load balancer for experimentation.

17 years agoRELENG_6 compilation
mjacob [Fri, 5 Jan 2007 23:01:54 +0000 (23:01 +0000)]
RELENG_6 compilation

17 years agoerror print cleanup && turn off ints if RISC is paused
mjacob [Fri, 5 Jan 2007 23:01:35 +0000 (23:01 +0000)]
error print cleanup && turn off ints if RISC is paused

17 years agoCheck the return from registering FC4 types with the fabric name
mjacob [Fri, 5 Jan 2007 22:59:26 +0000 (22:59 +0000)]
Check the return from registering FC4 types with the fabric name
server.

Don't complain about a hard loop id of 0xffff- we get this in
point-to-point topologies with the 2300 and 2K Login firmware.

Up the timeout on register FC4 types commands.

17 years ago- Clean up Aperture Access Global Enable (APEN) bit access.
jkim [Fri, 5 Jan 2007 22:55:19 +0000 (22:55 +0000)]
- Clean up Aperture Access Global Enable (APEN) bit access.
- Rename confusing AGP_INTEL_I845_MCHCFG to AGP_INTEL_I845_AGPM.
- Move E7205 and E7505 from i8x5 to i8x0 family.  It probably worked
because the actual offset is the same.

In fact, all three families have the bit at the exact same place.  Only
differences are name and width of the registers, i.e., NBXCFG (0x50, dword),
RDCR (0x51, byte), AGPM (0x51, byte), MCHCFG (0x50, word) depending on
the family of the chipsets.

17 years ago(commented out) multipath fault injection code.
mjacob [Fri, 5 Jan 2007 22:49:05 +0000 (22:49 +0000)]
(commented out) multipath fault injection code.

Some code to make diffs with RELENG_6 easier.

17 years agoAdd code to parse the utrace(2) entries generated by malloc(3) in a more
jhb [Fri, 5 Jan 2007 21:04:37 +0000 (21:04 +0000)]
Add code to parse the utrace(2) entries generated by malloc(3) in a more
human-readable format.  Note that we report 'realloc(p, 0)' as 'free(p)'
since both cases are encoded the same way and 'free()' is more common
than a realloc() to 0.

MFC after: 1 week

17 years agoFix style(9).
jkim [Fri, 5 Jan 2007 20:06:40 +0000 (20:06 +0000)]
Fix style(9).

17 years ago- Close a race between enumerating UNIX domain socket pcb structures via
jhb [Fri, 5 Jan 2007 19:59:46 +0000 (19:59 +0000)]
- Close a race between enumerating UNIX domain socket pcb structures via
  sysctl and socket teardown by adding a reference count to the UNIX domain
  pcb object and fixing the sysctl that enumerates unpcbs to grab a
  reference on each unpcb while it builds the list to copy out to userland.
- Close a race between UNIX domain pcb garbage collection (unp_gc()) and
  file descriptor teardown (fdrop()) by adding a new garbage collection
  flag FWAIT.  unp_gc() sets FWAIT while it walks the message buffers
  in a UNIX domain socket looking for nested file descriptor references
  and clears the flag when it is finished.  fdrop() checks to see if the
  flag is set on a file descriptor whose refcount just dropped to 0 and
  waits for unp_gc() to clear the flag before completely destroying the
  file descriptor.

MFC after: 1 week
Reviewed by: rwatson
Submitted by: ups
Hopefully makes the panics go away: mx1

17 years ago- Add a new function uma_zone_exhausted() to see if a zone is full.
jhb [Fri, 5 Jan 2007 19:09:01 +0000 (19:09 +0000)]
- Add a new function uma_zone_exhausted() to see if a zone is full.
- Add a printf in swp_pager_meta_build() to warn if the swapzone becomes
  exhausted so that there's at least a warning before a box that runs out
  of swapzone space before running out of swap space deadlocks.

MFC after: 1 week
Reviwed by: alc

17 years agoAnother (minor) CAM_NEW_TRAN backport thingie, plus a slightly
mjacob [Fri, 5 Jan 2007 17:51:33 +0000 (17:51 +0000)]
Another (minor) CAM_NEW_TRAN backport thingie, plus a slightly
closer to __FreeBSD_version comparison for this.

17 years agoIf append_archive fails while writing an archive header, output the error
cperciva [Fri, 5 Jan 2007 16:20:21 +0000 (16:20 +0000)]
If append_archive fails while writing an archive header, output the error
message from the archive being written (not the message from the archive
being read, where no error has occurred).

MFC after: 3 days

17 years agoMake agp_intel capable to work after resume from S3 state.
takawata [Fri, 5 Jan 2007 14:46:18 +0000 (14:46 +0000)]
Make agp_intel capable to work after resume from S3 state.

17 years agoSimplify code in union_hashins() and union_hashget() functions. These
rodrigc [Fri, 5 Jan 2007 14:06:42 +0000 (14:06 +0000)]
Simplify code in union_hashins() and union_hashget() functions.  These
functions now more closely resemble similar functions in nullfs.
This also eliminates some errors.

Submitted by: daichi, Masanori OZAWA <ozawa ongs co jp>

17 years agoPrevent adding a rule with a nat action in case IPFIREWALL_NAT was not defined.
piso [Fri, 5 Jan 2007 12:15:31 +0000 (12:15 +0000)]
Prevent adding a rule with a nat action in case IPFIREWALL_NAT was not defined.

Reviewed: luigi

17 years agoChange the client skipper API to use off_t instead of size_t/ssize_t; but
cperciva [Fri, 5 Jan 2007 10:48:18 +0000 (10:48 +0000)]
Change the client skipper API to use off_t instead of size_t/ssize_t; but
wrap this within #if/#else/#endif so that it will only take effect once
ARCHIVE_API_VERSION is increased (which should happen on HEAD some time
between now and when RELENG_7 is branched).

17 years agoHints are handled differently on -current
ticso [Fri, 5 Jan 2007 10:30:51 +0000 (10:30 +0000)]
Hints are handled differently on -current
Don't include hints.at91rm9200 for now

17 years agoFix 2 typos, as consequence update copyright year.
blackend [Fri, 5 Jan 2007 10:13:01 +0000 (10:13 +0000)]
Fix 2 typos, as consequence update copyright year.

17 years ago - ftick was initialized to -1 for init and any of it's children. Fix this by
jeff [Fri, 5 Jan 2007 08:50:38 +0000 (08:50 +0000)]
 - ftick was initialized to -1 for init and any of it's children.  Fix this by
   setting ftick = ltick = ticks in schedinit().
 - Update the priority when we are pulled off of the run queue and when we
   are inserted onto the run queue so that it more accurately reflects our
   present status.  This is important for efficient priority propagation
   functioning.
 - Move the frequency test into sched_pctcpu_update() so we don't repeat it
   each time we'd like to call it.
 - Put some temporary work-around code in sched_priority() in case the tick
   mechanism produces a bad priority.  Eventually this should revert to an
   assert again.

17 years agoRemove an unneeded fnstcw instruction.
das [Fri, 5 Jan 2007 07:15:26 +0000 (07:15 +0000)]
Remove an unneeded fnstcw instruction.

Noticed by: bde

17 years agoRemove a note pertaining to the Alpha.
das [Fri, 5 Jan 2007 07:14:26 +0000 (07:14 +0000)]
Remove a note pertaining to the Alpha.

17 years agoEliminate obsolete comment, now that getushort() is implemented in
rodrigc [Fri, 5 Jan 2007 05:28:57 +0000 (05:28 +0000)]
Eliminate obsolete comment, now that getushort() is implemented in
terms of functions in <sys/endian.h>.

17 years agoInsert mutex at tail if it has highest ceiling.
davidxu [Fri, 5 Jan 2007 03:57:11 +0000 (03:57 +0000)]
Insert mutex at tail if it has highest ceiling.

17 years agoOops, don't corrupt the list.
davidxu [Fri, 5 Jan 2007 03:33:47 +0000 (03:33 +0000)]
Oops, don't corrupt the list.

17 years agoCheck if the PP mutex is recursive, if we have already locked it, place the
davidxu [Fri, 5 Jan 2007 03:29:15 +0000 (03:29 +0000)]
Check if the PP mutex is recursive, if we have already locked it, place the
mutex in right order sorted by priority ceiling.

17 years agoFix parsing of -o uid and -o gid options, so that -o uidxx and -o gidxx
rodrigc [Fri, 5 Jan 2007 02:54:27 +0000 (02:54 +0000)]
Fix parsing of -o uid and -o gid options, so that -o uidxx and -o gidxx
are not accepted.

Submitted by: daichi, Masanori OZAWA <ozawa ongs co jp>

17 years agoMFp4: Use the next possible value for hz instead of defaulting to 128
ticso [Fri, 5 Jan 2007 02:52:06 +0000 (02:52 +0000)]
MFp4: Use the next possible value for hz instead of defaulting to 128
Update tick value after modifying hz.

17 years agoMFp4: Add missing atomic functions
ticso [Fri, 5 Jan 2007 02:50:27 +0000 (02:50 +0000)]
MFp4: Add missing atomic functions
Based on a patch by: des

17 years agoEliminate ASSERT_VOP_ELOCKED panics when doing mkdir or symlink when
rodrigc [Fri, 5 Jan 2007 02:25:44 +0000 (02:25 +0000)]
Eliminate ASSERT_VOP_ELOCKED panics when doing mkdir or symlink when
sysctl vfs.lookup_shared=1.

Submitted by: daichi, Masanori OZAWA <ozawa ongs co jp>

17 years agoMFp4: add BWCT kernel configuration
ticso [Fri, 5 Jan 2007 02:08:35 +0000 (02:08 +0000)]
MFp4: add BWCT kernel configuration

17 years agoMFp4: Make at91_rtc optional to allow other RTC choices
ticso [Fri, 5 Jan 2007 02:06:53 +0000 (02:06 +0000)]
MFp4: Make at91_rtc optional to allow other RTC choices

17 years agoMFp4: add basic driver for RTL8305SC switch in PHY emulation
ticso [Fri, 5 Jan 2007 01:46:26 +0000 (01:46 +0000)]
MFp4: add basic driver for RTL8305SC switch in PHY emulation

17 years agoMFp4: Read access require PDC to be setup first otherwise we might get
ticso [Fri, 5 Jan 2007 01:18:32 +0000 (01:18 +0000)]
MFp4: Read access require PDC to be setup first otherwise we might get
overrun errors.
Write access however need cmd first, so keep the existing order
for them.

17 years agoMFp4: BWCT boards are using an 16MHz xtal
ticso [Fri, 5 Jan 2007 01:14:14 +0000 (01:14 +0000)]
MFp4: BWCT boards are using an 16MHz xtal

17 years agoMFp4: Add VLAN_MTU support
ticso [Fri, 5 Jan 2007 01:07:59 +0000 (01:07 +0000)]
MFp4: Add VLAN_MTU support