Commit Graph

101326 Commits

Author SHA1 Message Date
Nate Lawson
865b8d0bfd Remove a non-variable static and move other static variables to the same
location.
2004-04-14 17:48:33 +00:00
Nate Lawson
dfd36c130b Fix some warnings by commenting out unused code. 2004-04-14 17:47:42 +00:00
Nate Lawson
916dc0e20c Only try to set the ACPI power state if the handle is valid. There was
probably no problem with this except it may have had the side effect of
registering a NULL consumer.
2004-04-14 17:46:21 +00:00
Nate Lawson
95ee367419 Even though the patch has been submitted to the vendor, this file is off
the vendor branch.  Once more, with feeling!
2004-04-14 16:52:19 +00:00
Jacques Vidrine
a8ec4401f4 Forced commit to note that the CVS patches in the previous commit
were

Submitted by:	Derek Robert Price <derek@ximbiot.com>
2004-04-14 16:48:27 +00:00
Jacques Vidrine
41b1a98f59 Patch vulnerabilities in the CVS client and server:
A malicious CVS server could cause your CVS client to overwrite
  arbitrary files (CAN-2004-0180).

  When a CVS client uses the `-p' checkout option, the server could be
  fooled into checking out files from outside the given $CVSROOT.

(This patch is applied in an unorthodox manner so as not to complicate
 a later vendor import of CVS.)
2004-04-14 16:40:50 +00:00
Hartmut Brandt
16b2454cdb Use a MANFILTER to patch the man pages to point to the right path.
Noted by: phk
2004-04-14 16:31:54 +00:00
Hartmut Brandt
ede24df2f4 Bump the shared library version number for the bsnmp v1.6 import
because of incompatible interface changes.
2004-04-14 16:29:46 +00:00
Nate Lawson
0f4f8be30d Unbreak the DDB build by replacing #includes that were deleted.
Pointed out by:	Tai-hwa Liang, Xin LI
Pointed hat to:	njl
2004-04-14 16:24:28 +00:00
Hartmut Brandt
6ccbb635d7 This commit was generated by cvs2svn to compensate for changes in r128237,
which included commits to RCS files with non-trunk default branches.
2004-04-14 16:20:14 +00:00
Hartmut Brandt
8eecd77ad5 Import of bsnmpd 1.6 2004-04-14 16:20:14 +00:00
Hartmut Brandt
a9ad93accb Put the name of the module first in the list of all .Nm calls with
argument. This makes the output of calling .Nm without an argument
more senseful later on.
2004-04-14 16:11:05 +00:00
Hartmut Brandt
c254ec5573 Compare with 0 if comparing an integer, not with NULL. 2004-04-14 16:09:20 +00:00
Hartmut Brandt
9de3b3505c Move the SNMP MIBs and tree definitions from /usr/share/bsnmp to
/usr/share/snmp. This mirrors the use of /usr/local/share/snmp and
makes also more sense when non-bsnmp-specific MIBs go in.
2004-04-14 16:06:19 +00:00
Brian Feldman
4ad8968a7f Document the "return" built-in better: it will exit . (sources) and
the top-level shell instance, too.
2004-04-14 15:58:50 +00:00
Brian Feldman
8fb9a995cf The newpcm headers currently #define away INTR_MPSAFE and INTR_TYPE_AV
because they bogusly check for defined(INTR_MPSAFE) -- something which
never was a #define.  Correct the definitions.

This make INTR_TYPE_AV finally get used instead of the lower-priority
INTR_TYPE_TTY, so it's quite possible some improvement will be had
on sound driver performance.  It would also make all the drivers
marked INTR_MPSAFE actually run without Giant (which does seem to
work for me), but:
	INTR_MPSAFE HAS BEEN REMOVED FROM EVERY SOUND DRIVER!
It needs to be re-added on a case-by-case basis since there is no one
who will vouch for which sound drivers, if any, willy actually operate
correctly without Giant, since there hasn't been testing because of
this bug disabling INTR_MPSAFE.

Found by:	"Yuriy Tsibizov" <Yuriy.Tsibizov@gfk.ru>
2004-04-14 14:57:49 +00:00
Bruce Evans
929789b42c Include <sys/proc.h> instead of depending on namespace pollution in
<sys/user.h> for the definition of TDF_SINTR.  Fixed anachronous
spelling of TDF_SINTR in a comment

Demangled VCS ids.  There were 2 misplaced copies of $FreeBSD$ and of
the include before it.  The vendor id infrastructure was edited.

Fixed the only other remaining style bug since rev.1.1 (expansion of
struct member names made a line too long).
2004-04-14 09:34:17 +00:00
Bruce Evans
a1541efa63 Include <sys/proc.h> for the definition of PS_INMEM instead of
depending on namespace pollution in <sys/user.h>.

Reduced nearby include messes.
2004-04-14 09:01:56 +00:00
Bill Paul
2b94c69d1d Continue my efforts to imitate Windows as closely as possible by
attempting to duplicate Windows spinlocks. Windows spinlocks differ
from FreeBSD spinlocks in the way they block preemption. FreeBSD
spinlocks use critical_enter(), which masks off _all_ interrupts.
This prevents any other threads from being scheduled, but it also
prevents ISRs from running. In Windows, preemption is achieved by
raising the processor IRQL to DISPATCH_LEVEL, which prevents other
threads from preempting you, but does _not_ prevent device ISRs
from running. (This is essentially what Solaris calls dispatcher
locks.) The Windows spinlock itself (kspin_lock) is just an integer
value which is atomically set when you acquire the lock and atomically
cleared when you release it.

FreeBSD doesn't have IRQ levels, so we have to cheat a little by
using thread priorities: normal thread priority is PASSIVE_LEVEL,
lowest interrupt thread priority is DISPATCH_LEVEL, highest thread
priority is DEVICE_LEVEL (PI_REALTIME) and critical_enter() is
HIGH_LEVEL. In practice, only PASSIVE_LEVEL and DISPATCH_LEVEL
matter to us. The immediate benefit of all this is that I no
longer have to rely on a mutex pool.

Now, I'm sure many people will be seized by the urge to criticize
me for doing an end run around our own spinlock implementation, but
it makes more sense to do it this way. Well, it does to me anyway.

Overview of the changes:

- Properly implement hal_lock(), hal_unlock(), hal_irql(),
  hal_raise_irql() and hal_lower_irql() so that they more closely
  resemble their Windows counterparts. The IRQL is determined by
  thread priority.

- Make ntoskrnl_lock_dpc() and ntoskrnl_unlock_dpc() do what they do
  in Windows, which is to atomically set/clear the lock value. These
  routines are designed to be called from DISPATCH_LEVEL, and are
  actually half of the work involved in acquiring/releasing spinlocks.

- Add FASTCALL1(), FASTCALL2() and FASTCALL3() macros/wrappers
  that allow us to call a _fastcall function in spite of the fact
  that our version of gcc doesn't support __attribute__((__fastcall__))
  yet. The macros take 1, 2 or 3 arguments, respectively. We need
  to call hal_lock(), hal_unlock() etc... ourselves, but can't really
  invoke the function directly. I could have just made the underlying
  functions native routines and put _fastcall wrappers around them for
  the benefit of Windows binaries, but that would create needless bloat.

- Remove ndis_mtxpool and all references to it. We don't need it
  anymore.

- Re-implement the NdisSpinLock routines so that they use hal_lock()
  and friends like they do in Windows.

- Use the new spinlock methods for handling lookaside lists and
  linked list updates in place of the mutex locks that were there
  before.

- Remove mutex locking from ndis_isr() and ndis_intrhand() since they're
  already called with ndis_intrmtx held in if_ndis.c.

- Put ndis_destroy_lock() code under explicit #ifdef notdef/#endif.
  It turns out there are some drivers which stupidly free the memory
  in which their spinlocks reside before calling ndis_destroy_lock()
  on them (touch-after-free bug). The ADMtek wireless driver
  is guilty of this faux pas. (Why this doesn't clobber Windows I
  have no idea.)

- Make NdisDprAcquireSpinLock() and NdisDprReleaseSpinLock() into
  real functions instead of aliasing them to NdisAcaquireSpinLock()
  and NdisReleaseSpinLock(). The Dpr routines use
  KeAcquireSpinLockAtDpcLevel() level and KeReleaseSpinLockFromDpcLevel(),
  which acquires the lock without twiddling the IRQL.

- In ndis_linksts_done(), do _not_ call ndis_80211_getstate(). Some
  drivers may call the status/status done callbacks as the result of
  setting an OID: ndis_80211_getstate() gets OIDs, which means we
  might cause the driver to recursively access some of its internal
  structures unexpectedly. The ndis_ticktask() routine will call
  ndis_80211_getstate() for us eventually anyway.

- Fix the channel setting code a little in ndis_80211_setstate(),
  and initialize the channel to IEEE80211_CHAN_ANYC. (The Microsoft
  spec says you're not supposed to twiddle the channel in BSS mode;
  I may need to enforce this later.) This fixes the problems I was
  having with the ADMtek adm8211 driver: we were setting the channel
  to a non-standard default, which would cause it to fail to associate
  in BSS mode.

- Use hal_raise_irql() to raise our IRQL to DISPATCH_LEVEL when
  calling certain miniport routines, per the Microsoft documentation.

I think that's everything. Hopefully, other than fixing the ADMtek
driver, there should be no apparent change in behavior.
2004-04-14 07:48:03 +00:00
Nate Lawson
a3924cd9b4 Style cleanups, M_ZERO instead of bzero. 2004-04-14 03:45:20 +00:00
Nate Lawson
e4a5123464 Style cleanups, use M_ZERO instead of bzero, unify the !semaphore and
semaphore return paths.
2004-04-14 03:43:06 +00:00
Nate Lawson
e6f06f99f6 Style cleanup, plus properly backup partial resource allocation in
AcpiOsInstallInterruptHandler() in the case of failure to initialize.
2004-04-14 03:41:06 +00:00
Nate Lawson
c871a6da4c Style cleanups to reduce diffs to locking tree. 2004-04-14 03:39:08 +00:00
Nate Lawson
ea6b2bc923 Style and printf message cleanups. 2004-04-14 03:34:11 +00:00
Nate Lawson
96d340f27d Use METHOD_VIDEO instead of the method string itself.
Pointed out by:	Andrew Thompson
2004-04-14 03:32:01 +00:00
Nate Lawson
c2b3a864be Use TRUE for a boolean and a style nit. 2004-04-14 03:30:09 +00:00
Warner Losh
d9c060ad52 sx was randomly added to NOTES. Instead, place it in the misc
hardware in properly sorted order.  Fix a little disorder while I'm
here.

Submitted by: bde
2004-04-14 02:25:31 +00:00
Nate Lawson
b7d13479aa Update the name for edge triggered for the 20040402 import. 2004-04-14 02:20:35 +00:00
Warner Losh
267afa1eab Prefer uint16_t to ushort.
Submitted by: bde
2004-04-14 02:20:01 +00:00
Nate Lawson
aa87b3ef75 Check in files with local changes:
* In the resume path, give up after waiting for a while
for WAK_STS to be set.  Some BIOSs never set it.

* Allow access to the field if it is within the region size rounded
up to a multiple of the access byte width.  This overcomes "off-by-one"
programming errors in the AML often found in Toshiba laptops.
2004-04-14 02:17:00 +00:00
Nate Lawson
ea905c360c Check in unmodified files off the vendor branch. 2004-04-14 02:14:51 +00:00
Nate Lawson
630c18309b This commit was generated by cvs2svn to compensate for changes in r128212,
which included commits to RCS files with non-trunk default branches.
2004-04-14 02:10:27 +00:00
Nate Lawson
e0ef747b89 Import ACPI-CA 20040402 distribution. 2004-04-14 02:10:27 +00:00
Nate Lawson
ba551b7d6b Add another cleanfile for future imports. 2004-04-14 02:03:33 +00:00
Luigi Rizzo
e6e51f0518 In an effort to simplify the routing code, try to deprecate rtalloc()
in favour of rtalloc_ign(), which is what would end up being called
anyways.

There are 25 more instances of rtalloc() in net*/ and
about 10 instances of rtalloc_ign()
2004-04-14 01:13:14 +00:00
Brooks Davis
bb2bfb4fa9 Staticize <if>_clone_{create,destroy} functions.
Reviewed by:	mlaier
2004-04-14 00:57:49 +00:00
Tim Kientzle
17834543c8 A simple cache of uid->uname lookups and gid->gname lookups eliminates
almost 1/2 of the CPU time required to create an uncompressed archive
and makes a noticable reduction in wallclock time.
2004-04-14 00:40:54 +00:00
Nate Lawson
0287be96bf Add support for video output switching. It appears no systems use HCI to
change the video output but use a separate device with a DSSX method
and a HID of "TOS6201" instead.  We use a pseudo-driver to get the handle
for this object and pass it to the acpi_toshiba driver.

This is untested but seems to match the Linux Toshiba driver.
2004-04-14 00:23:58 +00:00
Tim Kientzle
c7141791f3 When all the links to a file have been dumped, don't forget
to free() the memory used to store the filename.
2004-04-13 23:50:48 +00:00
Tim Kientzle
907d74bb26 Eliminate a lot of malloc/free calls by using
a stack-allocated buffer for safe_fprintf formatting.
Only if the result is too large do we resort to malloc.
2004-04-13 23:49:02 +00:00
Tim Kientzle
d911e48507 * Plug a buffer overrun in ACL parsing. (archive_entry.c)
* Re-use a single buffer for shar output formatting rather
   than hammering the heap. (archive_write_set_format_shar.c)
 * Fix a handful of minor memory leaks and clean up some of the
   memory-management code.
2004-04-13 23:45:37 +00:00
Vinod Kashyap
76633eae4d Adding man page for 3ware's 9000 series storage controller driver (twa).
Reviewed by: ru
2004-04-13 20:57:44 +00:00
Tim Kientzle
de60e4436b Manpage changes suggested by Irina Liakh.
Also, add -h as a synonym for -H, for Linux Standards Base compliance.
2004-04-13 19:45:55 +00:00
Warner Losh
c5d0726ad0 Boomerang 10/100BT (found in 2c905-TX) chips apparently suffer the
same problems as their Hurricane 575* bretheren in that one could set
the memory mapped port, but that has no effect.  Add a quirk for this.

# I'll have to see if I can dig up documentation on these parts to see
# if there's someway software can know this other than a table...
2004-04-13 19:34:20 +00:00
Warner Losh
d9f6718ee3 Some devices have what appear to be invalid BARs. They are invalid in
the sense that any write to them reads back as a 0.  This presents a
problem to our resource allocation scheme.  If we encounter such vars,
the code now treats them as special, allowing any allocation against
them to succeed.  I've not seen anything in the standard to clearify
what host software should do when it encounters these sorts of BARs.

Also cleaned up some output while I'm here and add commmented out
bootverbose lines until I'm ready to reduce the verbosity of boot
messages.

This gets a number of south bridges and ata controllers made mostly by
VIA, AMD and nVidia working again.  Thanks to Soren Schmidt for his
help in coming up with this patch.
2004-04-13 19:31:57 +00:00
Max Khon
722724d1d4 Fix examples. 2004-04-13 19:31:21 +00:00
Max Khon
02eb96c884 Use ifconfig(8) for setting common 802.11 parameters.
Submitted by:	Stanislav A. Svirid <count@riss-telecom.ru>
2004-04-13 19:25:26 +00:00
Max Khon
94251138a6 Add Direct Sequence 354K and 512K (needed for arl(4)). 2004-04-13 19:23:46 +00:00
Jacques Vidrine
52d887f87c Update version strings for Heimdal: 0.6 -> 0.6.1 2004-04-13 16:41:00 +00:00
Warner Losh
57094462fc Remove extra copy of code.
Noticed by: Carlos Velasco
2004-04-13 14:39:26 +00:00