Commit Graph

44911 Commits

Author SHA1 Message Date
harti
f63f4cf9ff Get rid of the last two uses of NG_NODELEN + 1 in the base system by
replacing them with NG_NODESIZ.
2004-01-26 16:41:21 +00:00
ale
9df797c6ac Add missing 'device ataraid' to support ATA software RAID.
Noticed by:	Dario Freni <saturnero@gufi.org>
Approved by:	blackend (mentor)
Reviewed by:	sos
2004-01-26 16:38:33 +00:00
harti
5ac16c0b2d Replace deprecated NG_NODELEN with the new NG_NODESIZ. There is one
problem here still to be solved: the sockaddr_hci has still a 16 byte
field for the node name. The code currently does not correctly use the
length field in the sockaddr to handle the address length, so
node names get truncated to 15 characters when put into a sockaddr_hci.
2004-01-26 15:19:43 +00:00
harti
8dea37aa01 Get rid of the old *LEN constants in favour of the new *SIZ constants
that also include the trailing \0 byte.
2004-01-26 14:57:49 +00:00
harti
84c84547c1 Define the new command NGM_SOURCE_START_NOW to allow generation of
traffic for non-ethernet hooks. This commit should have been packaged
with the commit to ng_source.c.
2004-01-26 14:54:39 +00:00
harti
df2fec8ed0 Make ng_source to work with non-ethernet interfaces. We do this by
introducing a START_NOW command. This command does not send
and GET_IFINDEX message downstream (to wait for the response from
the ETHERNET node), but directly starts the sending process. This allows
one to generate traffic as input for any hook on any node.
2004-01-26 14:53:16 +00:00
harti
ec433c9a41 Declare a function to silence a warning. 2004-01-26 14:48:21 +00:00
harti
bf65cd003c Should use the non-locking versions of the ifqueue macros to
fiddle around with private queues, because their mutex is not
needed. All this processing should be protected by the netgraph
locking.
2004-01-26 14:46:35 +00:00
harti
f80d965f52 Replace a call to bzero() with an M_ZERO flag. Replace the MALLOC() with
malloc().
2004-01-26 14:44:36 +00:00
harti
33e72d3c63 The version in the type description must be the ABI version, not
the netgraph version.

Correct the return type of a function: it wants to return an error
code, so it cannot be void.
2004-01-26 14:14:09 +00:00
harti
0ce707cd79 Get rid of the deprecated *LEN constants in favour of the new
*SIZ constants that include the trailing \0 byte.
2004-01-26 14:05:31 +00:00
sobomax
e4dc4fcb5d Add support for WCCPv2. It should be enablem manually using link2
ifconfig(8) flag since header for version 2 is the same but IP payload
is prepended with additional 4-bytes field.

Inspired by:	Roman Synyuk <roman@univ.kiev.ua>
MFC after:	2 weeks
2004-01-26 12:33:56 +00:00
nyan
62072ed0d9 Fixed some style bugs. 2004-01-26 12:28:40 +00:00
harti
f600b52ce6 Get rid of the deprecated *LEN constants and use the new *SIZ
(that include the trailing \0) constants instead.
2004-01-26 12:24:07 +00:00
sobomax
32e999b334 (whilespace-only)
Kill trailing spaces.
2004-01-26 12:21:59 +00:00
harti
78f4016091 Add a device type for virtual interfaces. 2004-01-26 12:13:11 +00:00
harti
3ba6f7cee8 Add an ATM sub-type for virtual interfaces. 2004-01-26 11:52:32 +00:00
wpaul
215f2d4e1e Avoid possible panic on shutdown: if there are still some devices
attached when shutting down, kill our kthreads, but don't destroy
the mutex pool and uma zone resources since the driver shutdown
routine may need them later.
2004-01-26 08:36:18 +00:00
matk
4d06b09564 Fix a panic in dsp_clone when trying to access a sound
device that doesn't exists.  I'm using my discretion and
committing without mentor approval since Seigo is away.

Noticed by:	Maxime Henrion <mux@freebsd.org>
2004-01-25 22:46:22 +00:00
rwatson
44532c56de When aborting fork() due to a failure, if using MAC, make sure to clean
up the p_label field.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, McAfee Research
2004-01-25 18:42:18 +00:00
ume
87f15e2106 avoid duplicate free.
(though KAME doesn't decide how to fix it yet, I once commit it
to be in time for 5.2.1-RELEASE.)

Submitted by:	itojun
2004-01-25 17:18:12 +00:00
bde
a4aa7a6cdd Fixed some style bugs (insertion sort errors, tab lossage, and ornation
of EOF).
2004-01-25 15:27:23 +00:00
ru
ee3ae6a8dc Register the uart(4)'s spin lock with witness(4). 2004-01-25 15:04:37 +00:00
des
550e38f1b1 Remove trailing whitespace. 2004-01-25 12:32:56 +00:00
des
c8fdb6f10e Replace description of the mutex profiling code with a reference to
the newly committed manual page.
2004-01-25 12:31:59 +00:00
sobomax
24ff98f7ec Move LongRun support out of identcpu.c, where it hardly belongs, into its
own file and make it opt-in, not mandatory, depending on CPU_ENABLE_LONGRUN
config(8) option.

Discussed with: nate
MFC after:      2 weeks
2004-01-25 09:59:16 +00:00
sobomax
3612b7d9fd Move LongRun support out of identcpu.c, where it hardly belongs, into its
own file and make it opt-in, not mandatory, depending on CPU_ENABLE_LONGRUN
config(8) option.

PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
Discussed with: nate
MFC after:      2 weeks
2004-01-25 09:59:15 +00:00
jeff
7d2010756f - sched_strict has been dead for a long time now. Get rid of it. 2004-01-25 08:58:14 +00:00
jeff
540495ca30 - Clean up KASSERTS. 2004-01-25 08:57:38 +00:00
jeff
b2d2d3a214 - Correct function names listed in KASSERTs. These were copied from other
code and it was sloppy of me not to adjust these sooner.
2004-01-25 08:21:46 +00:00
jeff
ec8b5190a8 - Now that both schedulers support temporary cpu pinning use this rather
than the switchin functions to guarantee that we're operating with the
   correct tlb entry.
 - Remove the post copy/zero tlb invalidations.  It is faster to invalidate
   an entry that is known to exist and so it is faster to invalidate after
   use.  However, some architectures implement speculative page table
   prefetching so we can not be guaranteed that the invalidated entry is still
   invalid when we re-enter any of these functions.  As a result of this we
   must always invalidate before use to be safe.
2004-01-25 08:04:45 +00:00
jeff
ed8d4e8703 - Implement cpu pinning and binding. This is acomplished by keeping a per-
cpu run queue that is only used for pinned or bound threads.

Submitted by:	Chris Bradfield <chrisb@ation.org>
2004-01-25 08:00:04 +00:00
jeff
c133d855d2 - Use a unique string for the sched_setup SYSINIT and rename sched_setup to
synch_setup.  The schedulers use the sched_setup function name.
2004-01-25 07:49:45 +00:00
jeff
16af7802dd - Compile 4BSD in LINT since ULE will be tested by GENERIC kernel builds.
- Fix the formatting on the ULE options line, I didn't notice that a space
   was used normally.

Reported by:	bde
2004-01-25 07:47:57 +00:00
alc
0832fdbafa MFi386 revision 1.230
- Move smp_topology to subr_smp.c so that it is defined on all architectures.
2004-01-25 06:19:37 +00:00
jeff
53a96dc6ba - Don't define DETECT_DEADLOCK. I don't know that this code has detected
a deadlock in several years.  Furthermore, the IPI code is currently
   protected by a seperate spinlock.  This only served to make IPIs twice as
   expensive as they had to be which severely slowed down the IPI heavy ULE
   scheduler.
2004-01-25 05:03:14 +00:00
jeff
8ac75a1ec6 - Add a flags parameter to mi_switch. The value of flags may be SW_VOL or
SW_INVOL.  Assert that one of these is set in mi_switch() and propery
   adjust the rusage statistics.  This is to simplify the large number of
   users of this interface which were previously all required to adjust the
   proper counter prior to calling mi_switch().  This also facilitates more
   switch and locking optimizations.
 - Change all callers of mi_switch() to pass the appropriate paramter and
   remove direct references to the process statistics.
2004-01-25 03:54:52 +00:00
rwatson
1d962a2810 Add some basic support for measuring sleep mutex contention to the
mutex profiling code.  As with existing mutex profiling, measurement
is done with respect to mtx_lock() instances in the code, as opposed
to specific mutexes.  In particular, measure two things:

(1) Lock contention.  How often did this mtx_lock() call get made and
    have to sleep (or almost sleep) waiting for the lock.  This helps
    identify the "victims" of contention.

(2) Hold contention.  How often, while the lock was held by a thread
    as a result of this mtx_lock(), did another thread try to acquire
    the same mutex.  This helps identify the causes of contention.

I'm currently exploring adding measurement of "time waited for the
lock", but the current implementation has proven useful to me so far
so I figured I'd commit it so others could try it out.  Note that this
increases the size of mutexes when MUTEX_PROFILING is enabled, so you
might find you need to further bump UMA_BOOT_PAGES.  Fixes welcome.

The once over:	des, others
2004-01-25 01:59:27 +00:00
wpaul
7f161a6afb Correct KASSERT() in ndis_destroy(): ndis_mtx is a pointer now.
Also add KASSERT() for ndis_intrmtx().
2004-01-25 00:13:07 +00:00
phk
4a674f916d Deal with MOD_FREQUENCY before MOD_OFFSET because the latter is the
one which runs the actual update.  This fixes a bug where there were
a delay in applying the frequency adjustment.  In extreme cases this
could result in marginal stability of the kernel-pll.
2004-01-24 21:48:43 +00:00
jeff
62e4a79461 - Remove local changes that leaked into my last commit.
Spotted by:	juli
2004-01-24 21:45:25 +00:00
jeff
87bacd3193 - Recruit some new ULE users by making it the default scheduler in GENERIC.
ULE will be in a probationary period to determine whether it will be left
   as the default in 5.3 which would likely mean the rest of the 5.x series.
2004-01-24 21:38:52 +00:00
jeff
96211c8f68 - ULE is not exactly experimental anymore. Change some comments and enable
it in LINT.
2004-01-24 21:32:53 +00:00
alc
890250d35a 1. Statically initialize swap_pager_full and swap_pager_almost_full to the
full state.  (When swap is added their state will change appropriately.)
2. Set swap_pager_full and swap_pager_almost_full to the full state when
   the last swap device is removed.
Combined these changes eliminate nonsense messages from the kernel on swap-
less machines.

Item 2 submitted by:	Divacky Roman <xdivac02@stud.fit.vutbr.cz>
Prodding by:		phk
2004-01-24 21:31:06 +00:00
sobomax
b871acbc45 Regen after rev. 1.161 of usbdevs. 2004-01-24 21:24:36 +00:00
sobomax
36c81a6c57 Add support for Crystalfontz CFA-631 USB LCD (uftdi(4) driver).
For some very unclear reason this device contains a FTDI 8U232AM USB->COM
adapter, but reports different device id than original 8U232AM. At the same
time, it reports vendor id of FTDI.

Sponsored by:	Porta Software Ltd
MFC after:	2 weeks
2004-01-24 21:23:12 +00:00
sobomax
58ae4f6271 - Move performance-controlling sysctls into hw.p4tcc.* tree;
Suggested by:   nate

- get rid of "magick" values in code and make sysctl's reflecting reality
  on processor versions which have one or another frequency "forbidden"
  due to errata.

MFC after:      2 weeks
2004-01-24 21:13:13 +00:00
sobomax
2586feaebf - Move performance-controlling sysctls into hw.p4tcc.* tree;
Suggested by:   nate

- get rid of "magick" values in code and make sysctl's reflecting reality
  on processor versions which have one or another frequency "forbidden"
  due to errata.

PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
MFC after:      2 weeks
2004-01-24 21:13:12 +00:00
jeff
1e5b101989 - Move smp_topology to subr_smp.c so that it is defined on all architectures. 2004-01-24 19:52:48 +00:00
nectar
a58ea33556 Add PFIL_HOOKS to the GENERIC kernel configuration, primarily so
that one can load the IPFilter module (which requires PFIL_HOOKS).

Requested by:	Many, for over a year
2004-01-24 14:59:51 +00:00
tjr
d5370294e3 Copy workaround from FFS: open device for write access even if
the user requests a read-only mount. This is necessary because we
don't do the VOP_OPEN again if they upgrade a read-only mount to
read-write.

Noticed by:	bde
2004-01-24 08:43:06 +00:00
sanpei
0fb6d61403 Sync to 1.160 of usbdevs 2004-01-24 07:15:23 +00:00
sanpei
2e1c3ea7e8 Add Support
- 2nd type of GL641USB USB-IDE bridge	[1]
	- Plextor Plexwriter 40/12/40U		[2]

PR:		kern/61671	[1]
		kern/61803	[2]
Submitted by:	Ralf Wenk <RZ-FreeBSD0401@fh-karlsruhe.de>	[1]
		Feisal Mohammed <feisal@uwi.tt>			[2]
MFC after:	1 week
2004-01-24 07:14:07 +00:00
wpaul
59cd55dba0 Add missing newlines to some device_printf()s.
Don't do anything in ndis_get_assoc() if the link isn't up (avoids
spurrious "couldn't get bssid" messages on the console).
2004-01-24 02:48:22 +00:00
mjacob
2b9b0c25cd If we have ISP_ROLE_INITIATOR set, make sure that we clear ICBOPT_INI_DISABLE
from the fwoptions. Likewise, we *set* ICBOPT_INI_DISABLE if we don't have
initiator role.
2004-01-23 23:23:31 +00:00
mjacob
f76917eee9 add MAKE_WWN_FROM_NODE_NAME macro 2004-01-23 23:22:35 +00:00
mjacob
26bd0e375e Add firmware major, minor and micro revsions to the ISP_FC_GETHINFO ioctl
structure.
2004-01-23 23:22:11 +00:00
phk
71563bbb0e Make sure to keep track of canceled events.
Submitted by:	Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2004-01-23 21:09:38 +00:00
rwatson
b67d5948b0 Don't grab Giant in crfree(), since prison_free() no longer requires it.
The uidinfo code appears to be MPSAFE, and is referenced without Giant
elsewhere.  While this grab of Giant was only made in fairly rare
circumstances (actually GC'ing on refcount==0), grabbing Giant here
potentially introduces lock order issues with any locks held by the
caller.  So this probably won't help performance much unless you change
credentials a lot in an application, and leave a lot of file descriptors
and cached credentials around.  However, it simplifies locking down
consumers of the credential interfaces.

Bumped into by:	sam
Appeased:	tjr
2004-01-23 21:07:52 +00:00
phk
ea0214f2de Add KASSERTS.
Submitted by:	Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2004-01-23 21:02:49 +00:00
rwatson
97a5db182a Defer the vrele() on a jail's root vnode reference from prison_free()
to a new prison_complete() task run by a task queue.  This removes
a requirement for grabbing Giant in crfree().  Embed the 'struct task'
in 'struct prison' so that we don't have to allocate memory from
prison_free() (which means we also defer the FREE()).

With this change, I believe grabbing Giant from crfree() can now be
removed, but need to check the uidinfo code paths.

To avoid header pollution, move the definition of 'struct task'
to _task.h, and recursively include from taskqueue.h and jail.h; much
preferably to all files including jail.h picking up a requirement to
include taskqueue.h.

Bumped into by:	sam
Reviewed by:	bde, tjr
2004-01-23 20:44:26 +00:00
phk
7782df8c6c Plug an insignificant memoryleak.
Submitted by:	Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2004-01-23 20:40:25 +00:00
phk
712a3d18ad Add missing newline in printf.
Submitted by:	Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2004-01-23 20:36:21 +00:00
philip
6e713af31f Add missing options from pcvt_conf.h to options.i386. This
allows the kernel build to survive config when these options
are specified in the config file.

Reviewed by:	hm
Approved by:	njl (mentor)
2004-01-23 20:30:52 +00:00
simokawa
97a674e005 * fwohci_pci.c
Improve error message for attach failure.

* sbp_targ.c
	- Add speed in struct sbp_targ_login.
	- Remove unnecessary htonl().
2004-01-23 17:37:09 +00:00
matk
1f7db19e1f Sync with DFBSD v.1.16. Add new codecs IDs, fix some spelling.
Approved by:    des (interim mentor)
2004-01-23 16:38:54 +00:00
ru
cf95d60f83 Don't panic if there are more than 255 interfaces in the system. 2004-01-23 15:53:23 +00:00
ru
76d4144ef1 Allow the socket buffer sizes to be controlled via sysctl(8).
MFC after:	3 days
2004-01-23 14:35:44 +00:00
phk
77d9c1adaf Remove the MD5_KEY debugging tool 2004-01-23 11:47:06 +00:00
phk
ede043f345 Remove no longer necessary debug printfs 2004-01-23 10:56:16 +00:00
sos
b8aca7db9f Fix breakage in PIO multisector support. 2004-01-23 10:38:56 +00:00
ache
758ae341ba Copy comment about caller check from ffs_read to ffs_extread, don't
check for uio_resid < 0 here too.
2004-01-23 06:00:41 +00:00
ache
cc92519b78 Fix various panic() strings to reflect true function name to allow
easy grep.
Small code reorganization to look more logic.
Copy ffs_write check from prev. commit to ffs_extwrite.
2004-01-23 05:52:31 +00:00
ache
2dced4deb9 ffs_read:
Replace wrong check returned EFBIG with EOVERFLOW handling from POSIX:

36708 [EOVERFLOW] The file is a regular file, nbyte is greater than 0, the
starting position is before the end-of-file, and the starting position is
greater than or equal to the offset maximum established in the open file
description associated with fildes.

ffs_write:
Replace u_int64_t cast with uoff_t cast which is more natural for types
used.

ffs_write & ffs_read:
Remove uio_offset and uio_resid checks for negative values, the caller
supposed to do it already. Add comments about it.

Reviewed by:    bde
2004-01-23 05:38:02 +00:00
andre
f727af1913 Remove leftover FREE() from changes in rev 1.50.
Noticed by:	Jun Kuriyama <kuriyama@imgsrc.co.jp>
2004-01-23 01:39:12 +00:00
peter
5366ff9a03 Unbreak amd64: Rename calls from panic to __panic 2004-01-23 01:04:28 +00:00
andre
b18b764f58 Split the overloaded variable 'win' into two for their specific purposes:
recwin and sendwin.  This removes a big source of confusion and makes
following the code much easier.

Reviewed by:	sam (mentor)
Obtained from:	DragonFlyBSD rev 1.6 (hsu)
2004-01-22 23:22:14 +00:00
andre
54fd37f35d Move the reduction by one of the syncache limit after the zone has been
allocated.

Reviewed by:    sam (mentor)
Obtained from:  DragonFlyBSD rev 1.6 (hsu)
2004-01-22 23:14:48 +00:00
andre
e4fc02a1bf Remove an unused variable and put the sockaddr_in6 onto the stack instead
of malloc'ing it.

Reviewed by:	sam (mentor)
Obtained from:	DragonFlyBSD rev 1.6 (hsu)
2004-01-22 23:10:11 +00:00
phk
083a677018 Write 100 times for tomorrow:
"Always print time_t as %jd, you never know what width it has"
2004-01-22 19:50:06 +00:00
jhb
fe82d4d646 Fix the PCI attach routine to properly setup the IRQ and port resource
rid's and to deallocate resources if a failure occurs during attach.  This
patch also fixes the driver to return failure if bus_alloc_resource() for
the IRQ fails rather than panic'ing on the next line by passing a NULL
resource to bus_setup_intr().  The other attachments already do all this.

Submitted by:	Jun Su <csujun@263.net>
2004-01-22 16:07:03 +00:00
simokawa
9c3cf58a7c Add missing free() in exception handlers.
Reported by:    Stanford Metacompilation research group
2004-01-22 14:41:17 +00:00
rse
809b1aa946 Fix generation of random multicast MAC address.
In case no real/physical IEEE 802 address is available, both the expired
"draft-leach-uuids-guids-01" (section "4. Node IDs when no IEEE 802
network card is available") and RFC 2518 (section "6.4.1 Node Field
Generation Without the IEEE 802 Address") recommend (quoted from RFC
2518):

  "The ideal solution is to obtain a 47 bit cryptographic quality random
  number, and use it as the low 47 bits of the node ID, with the _most_
  significant bit of the first octet of the node ID set to 1. This bit
  is the unicast/multicast bit, which will never be set in IEEE 802
  addresses obtained from network cards; hence, there can never be a
  conflict between UUIDs generated by machines with and without network
  cards."

Unfortunately, this incorrectly explains how to implement this and
the FreeBSD UUID generator code inherited this generation bug from
the broken reference code in the standards draft. They should instead
specify the "_least_ significant bit of the first octet of the node ID"
as the multicast bit in a memory and hexadecimal string representation
of a 48-bit IEEE 802 MAC address.

This standards bug arised from a false interpretation, as the multicast
bit is actually the _most_ significant bit in IEEE 802.3 (Ethernet)
_transmission order_ of an IEEE 802 MAC address. The standards authors
forgot that the bitwise order of an _octet_ from a MAC address _memory_
and hexadecimal string representation is still always from left (MSB,
bit 7) to right (LSB, bit 0).

Fortunately, this UUID generation bug could have occurred on systems
without any Ethernet NICs only.
2004-01-22 13:34:11 +00:00
ru
e512cf71d1 Only enforce -fno-strict-aliasing for optimization levels that
imply -fstrict-aliasing.

Reviewed by:	bde
2004-01-22 10:01:47 +00:00
grehan
c652e0ed25 Make proc's kg_nice/ki_nice explicitly signed for PPC. This is a
no-op on {i386/alpha/ia64/sparc64} where chars are signed by
default. Should help ARM and S390 which also suffer from this.

Tested on: ppc, i386, objdump disasm before/after diffs
Reviewed by: obrien, bde (a while back)
2004-01-22 06:56:00 +00:00
onoe
c5cd507287 Fix definition of IFM_MODE, which should be refrected the change of
IFM_IEEE80211_ mode.  Also ifconfig(8) must be recompiled.
Pointed out by Sam Leffeler.
2004-01-22 03:23:28 +00:00
wpaul
00bdd194b3 Add suspend and resume methods. I'm not certain this work correctly
since I can't easily test them on my laptop right now, but they
should do the right thing.
2004-01-22 03:00:59 +00:00
wpaul
ea49246bf8 Add support for TCP/IP checksum offload.
No, really.
2004-01-22 02:36:34 +00:00
jhb
3ba56a401e If a transfer to or from a floppy disk crosses a 64k boundary, we have to
use a bounce buffer for the actual transfer to avoid crossing a 64k
boundary.  To do this, we malloc a buffer twice as big as we need and then
find an aligned block within that buffer to do the transfer.  The check
to see which part of the block we use used the wrong variable for part of
the condition meaning that in certain edge cases we would ask the BIOS to
cross a 64k boundary.  The BIOS request would then fail resulting in file
transfers that just magically fail in the middle without any apparent
reason.  Specifically, my tests for the splitfs boot floppies managed to
trigger this edge case.

MFC after:	1 week
X-MFC-info:	along with fixes to libstand filesystems
2004-01-21 23:22:29 +00:00
wpaul
173987bd4f Fix multicast and promiscuous mode handling for Yukon devices.
Submitted by:	Jung-uk Kim <jkim@niksun.com>
2004-01-21 22:32:15 +00:00
wpaul
27cac97bcf Calculate the right register offset when clearing TX buffer pointer
registers in rl_stop().

PR:		kern/60250
2004-01-21 22:29:51 +00:00
wpaul
42ba2206d2 Add structures and definitions for task offload (TCP/IP checksum,
IPSec, TCP large send).
2004-01-21 21:09:09 +00:00
phk
25628e44b9 Add a sysctl (default: off) which enables a log(LOG_INFO...) warning
if the clock is stepped.
2004-01-21 21:05:40 +00:00
phk
7188ab8aaf Simplify timing gymnastics a bit. 2004-01-21 19:20:57 +00:00
wpaul
a07dd1ff5f Make sure to trap failures correctly in ndis_get_info() and ndis_set_info(). 2004-01-21 19:14:52 +00:00
phk
7d8e400e71 Remove #ifdef for ancient source FreeBSD compat. 2004-01-21 19:02:02 +00:00
brooks
e916d7fb52 Don't leak softc's when destroying interfaces.
Init the softc list when loaded.

Noticed by:	Maurycy Pawlowski-Wieronski <maurycy at fouk dot org>
2004-01-21 18:05:38 +00:00
cperciva
aed4043dc1 Fix style(9) of my previous commit.
Noticed by: nate
Approved by: nate, rwatson (mentor)
2004-01-21 18:03:54 +00:00
rwatson
eb2019485b Reduce gratuitous includes: don't include jail.h if it's not needed.
Presumably, at some point, you had to include jail.h if you included
proc.h, but that is no longer required.

Result of:	self injury involving adding something to struct prison
2004-01-21 17:10:47 +00:00
cperciva
d8735de7ac Allow devfs path rules to work on directories. Without this fix,
devfs rule add path fd unhide
is a no-op, while it should unhide the fd subdirectory.

Approved by: phk, rwatson (mentor)
PR: kern/60897
2004-01-21 16:43:29 +00:00
nyan
6faa305fec MFi386: revisions from 1.1116 to 1.1119.
Remove NEWCARD related devices.
2004-01-21 16:28:19 +00:00
nyan
bfb36a1d62 Merged from sys/dev/sio/sio.c revision 1.418. 2004-01-21 16:12:29 +00:00
ume
cd3d56c01e Sync to pccarddevs 1.81. 2004-01-21 16:03:40 +00:00
ume
8c11532daa There is PANASONIC KXLC005 which has another product id. 2004-01-21 16:02:20 +00:00
cognet
1fed0ce2bd Setting pccb->ccb_h.status to CAM_REQ_CMP one time is enough. 2004-01-21 10:49:42 +00:00
ru
310e217f08 The gdbinit.${MACHINE_ARCH} script may not exist. 2004-01-21 08:23:46 +00:00
grehan
87cb3a2ede Add syscons options and enable USB, since there is no conflict between
the OpenFirmware console and the syscons console when using a USB
keyboard.
2004-01-21 05:22:53 +00:00
grehan
400183983b Add required GFB options as well as one for ofw/syscons. 2004-01-21 05:20:58 +00:00
grehan
c371c1646f Add syscons files, and also generate a syscons font since Apple
SVGA adapters don't have one available in their ROMs.
2004-01-21 05:19:59 +00:00
grehan
d7a8e22689 - Catch up with panic __LINE__/__FILE__ changes by moving panic calls
out of asm.
- remove some long-dead code from machdep.c
2004-01-21 05:18:08 +00:00
grehan
c42e61c247 A syscons implementation using the 8-bit framebuffer set up by
OpenFirmware. Not at all optimized, but provides a PC-style
user-experience.

Tested on revA imac, B&W G3, 2k iBook, and G4 eMac.
2004-01-21 05:16:23 +00:00
grehan
353682a237 __powerpc__ conditional code for the syscons OpenFirmware/PPC framebuffer.
Took the opportunity to reduce

 __i386__ || __ia64__ || __amd64__ || __sparc64__ || __powerpc__

 to

 !__alpha__

reviewed by: gallatin
2004-01-21 05:08:51 +00:00
grehan
14dded4776 Update 128-bit long double constants to match what is expected
by libc
2004-01-21 04:56:39 +00:00
sam
5db0bebd8b Fix ipip_output() to always set *mp to NULL on failure, even if 'm'
is NULL, otherwise ipsec4_process_packet() may try to m_freem() a
bad pointer.

In ipsec4_process_packet(), don't try to m_freem() 'm' twice; ipip_output()
already did it.

Obtained from:	netbsd
2004-01-20 22:45:10 +00:00
sam
0a7f2d6b23 fix build after KAME changes 2004-01-20 22:44:21 +00:00
hsu
8ce4d37463 Merge from DragonFlyBSD rev 1.10:
date: 2003/09/02 10:04:47;  author: hsu;  state: Exp;  lines: +5 -6
Account for when Limited Transmit is not congestion window limited.

Obtained from:	DragonFlyBSD
2004-01-20 21:40:25 +00:00
jhb
f2414d2e7d Use getenv_int() rather than reimplementing it. 2004-01-20 21:38:48 +00:00
rwatson
4c7d3f7221 Pay attention to mac_portacl_enabled.
Submitted by:   simon
2004-01-20 18:33:02 +00:00
sos
8714c421ef Update the support for the VIA 8237 southbridge. 2004-01-20 16:51:02 +00:00
wpaul
38c277ac0d Correct instances of mtx_lock()/mtx_unlock() that should have been
mtx_pool_lock()/mtx_pool_unlock().
2004-01-20 08:19:42 +00:00
matk
cae2dd9dfc Reduce latency when using the SNDCTL_DSP_RESET ioctl by calling
chn_resetbuf().

Submited by:	Pyun YongHyeon <yongari@kt-is.co.kr>
Approved by:	tanimura (mentor)
2004-01-20 05:30:09 +00:00
obrien
22ae961cfd Fix sort misordering. 2004-01-20 04:37:07 +00:00
matk
68e191220f Fix a panic when kldloading a sound driver. Do this by replacing the
link-list of dev_t's with named variables.  Remove used code.

Approved by:		tanimura (mentor)
2004-01-20 03:58:57 +00:00
marcel
7976ad15f4 Fix handling of FP traps:
o  For traps, the cr.iip register points to the next instruction to
   execute on interrupt return (modulo slot). Since we need to get
   the bundle of the instruction that caused the FP fault/trap, make
   sure we fetch the previous bundle if the next instruction is in
   fact the first in a bundle.
o  When we call the FPSWA handler, we need to tell it whether it's
   a trap or a fault (first argument). This was hardcoded to mean a
   fault.

Also, for FP faults, when a fault is converted to a trap, adjust the
cr.iip and cr.ipsr registers to point to the next instruction. This
makes sure that the SIGFPE handler gets a consistent state.
2004-01-20 03:29:24 +00:00
marcel
891fa7305a s/framep/tf/g -- this normalizes on the use of tf to point to the
trapframe and improves grep-ability.
2004-01-20 02:35:46 +00:00
ache
f8d77065a1 pread/pwrite:
follow lseek spirit - return EINVAL on negative offset for non-VCHR
2004-01-20 01:27:42 +00:00
phk
4967bebd9f Add linenumber and source filename to panic(9) output.
Ideally a traceback should be printed too, any takers ?
2004-01-19 21:27:11 +00:00
kan
c07707f652 One more instance of magic number used in place of IO_SEQSHIFT.
Submitted by:	alc
2004-01-19 20:45:43 +00:00
wpaul
f4a5240952 Add WDM major/minor #defines. 2004-01-19 20:45:27 +00:00
kan
e53fbb6fd0 Spell magic '16' number as IO_SEQSHIFT. 2004-01-19 20:03:43 +00:00
wpaul
07d0b99afb Implement IofCompleteRequest() and IoIsWdmVersionAvailable().
Correct IofCallDriver(): it's fastcall, not stdcall.
Add vector to vsprintf().
2004-01-19 19:57:00 +00:00
wpaul
ccf46b8e18 Implement atoi() and atol(). Some drivers appear to need these. Note
that like most C library routines, these appear to be _cdecl in Windows.
2004-01-19 19:21:25 +00:00
wpaul
57bc78f16a Eliminate some code duplication: since ndis_runq() and ndis_intq() were
basically the same function, compact them into a single loop which can
be used for both threads.
2004-01-19 18:56:31 +00:00
sos
dac2f84bef Fix breakage on timeout/retries. The bug cause a sema to be leaked so
that the calling process would newer wakeup.
2004-01-19 15:20:00 +00:00
ru
5cbb91d47e Removed custom "load" and "unload" targets.
Removed "deinstall" targets -- the idea is to provide the standard
"deinstall" target.
2004-01-19 14:00:26 +00:00
sanpei
9ef3bb51aa Sync to 1.159 of usbdevs 2004-01-19 12:53:23 +00:00
sanpei
141aa40b5f Add support IO-data DVD Multi-plus unit iU-CD2
PR:		kern/61578
Submitted by:	Masaharu FUJITA <m@fjts.org>
MFC after:	1 week
2004-01-19 12:51:40 +00:00
ru
da72c0aa01 Normalize SUBDIR. 2004-01-19 12:36:08 +00:00
wpaul
1dbcf6178b Properly program the multicast filter in ndis_setmulti(),
and fix promisc mode in ndis_ioctl().
2004-01-19 07:03:46 +00:00
onoe
ab19a1bdfc Change WI_RID_SCAN_RES compatibility interface to return the result after
active scan is completed just as WI_RID_READ_APS.
This fixes wicontrol -L for ath(4) and awi(4) to have results even if
the driver cannot associate any APs.
2004-01-19 05:25:43 +00:00
bde
33623bc000 Fixed misplacement and bitrot in the cy driver's configuration in
rev.1.1040.  It is a miscellaneous isa+pci driver, but came back
described as a pci-only driver and placed in an i4b pci subsection
after its migration to /sys/conf/NOTES.  Put it back where it used to
be, fully unsorted in the `Miscellaneous hardware' section.  Reduced
nearby disorder in this section by moving configuration of the digi
driver to where it was for the old digiboard drivers, so that the
order at least matches the order in the table of contents.
2004-01-19 02:18:34 +00:00
bde
215ace9622 Removed some garbage comments:
- references to removed math emulators for NPX_DEBUG
- header for the null set of mandatory devices
- reference to the removed (and bogus when it existed) sysctl
  kern.timecounter.method.
2004-01-19 01:44:06 +00:00
bde
6c3cf41f0a Fixed formatting of sentence breaks. Use 2 spaces for all of them instead
of for about 3/4 of them.
2004-01-19 01:26:59 +00:00
bde
e5d5f09b33 FIxed unsorting in previous commit (description of CPU_ENABLE_TCC).
FIxed some nearby disorder (descriptions of CPU_BLUELIGHTNING_3X,
CPU_DIRECT_MAPPED_CACHE, CPU_DISABLE_CMPXCHG, CPU_DISABLE_SSE,
CPU_ELAN_XTAL and CPU_SOEKRIS, and options for all of these except
CPU_DIRECT_MAPPED_CACHE).
2004-01-19 01:07:18 +00:00
wpaul
19d2a7df56 Convert from using taskqueue_swi to using private kernel threads. The
problem with using taskqueue_swi is that some of the things we defer
into threads might block for up to several seconds. This is an unfriendly
thing to do to taskqueue_swi, since it is assumed the taskqueue threads
will execute fairly quickly once a task is submitted. Reorganized the
locking in if_ndis.c in the process.

Cleaned up ndis_write_cfg() and ndis_decode_parm() a little.
2004-01-18 22:57:11 +00:00
sobomax
daf3a7d64a Add new CPU_ENABLE_TCC option, from NOTES:
CPU_ENABLE_TCC enables Thermal Control Circuitry (TCC) found in some
Pentium(tm) 4 and (possibly) later CPUs. When enabled and detected,
TCC allows to restrict power consumption by using machdep.cpuperf*
sysctls. This operates independently of SpeedStep and is useful on
systems where other mechanisms such as apm(4) or acpi(4) don't work.

Given the fact that many, even modern, notebooks don't work properly
with Intel ACPI, this is indeed very useful option for notebook owners.

Obtained from:  OpenBSD
MFC after:      2 weeks
2004-01-18 21:18:00 +00:00
sobomax
1f751fbafc Add new CPU_ENABLE_TCC option, from NOTES:
CPU_ENABLE_TCC enables Thermal Control Circuitry (TCC) found in some
Pentium(tm) 4 and (possibly) later CPUs. When enabled and detected,
TCC allows to restrict power consumption by using machdep.cpuperf*
sysctls. This operates independently of SpeedStep and is useful on
systems where other mechanisms such as apm(4) or acpi(4) don't work.

Given the fact that many, even modern, notebooks don't work properly
with Intel ACPI, this is indeed very useful option for notebook owners.

Obtained from:	OpenBSD
MFC after:	2 weeks
2004-01-18 21:06:56 +00:00
yar
c85bf5a4fa A network interface driver can support IFCAP_VLAN_MTU only,
without IFCAP_VLAN_HWTAGGING.  The previous version of the
leading comment in this file could lead to the opposite conclusion.

Fix some typos in the comment as well.
2004-01-18 19:29:04 +00:00
ru
21300c6270 Fixed a memory leak.
Reported by:	Stanford Metacompilation research group
Reviewed by:	scottl
2004-01-18 17:34:11 +00:00
ru
8423745834 Fixed a memory leak. 2004-01-18 17:21:15 +00:00
ru
2df9a9f9a1 Fixed a memory leak.
Reported by:	Stanford Metacompilation research group
2004-01-18 16:55:01 +00:00
sos
fa4ebea462 Fix botch in last commit. 2004-01-18 15:58:30 +00:00
ru
fec9fbbb06 Since "m" is not part of the "mp" chain, need to free() it.
Reported by:	Stanford Metacompilation research group
2004-01-18 14:02:53 +00:00
ru
91ef1185f7 Apparently there's a good reason why M_WAITOK malloc() is done before
xpt_create_path().
2004-01-18 13:09:38 +00:00
ru
7b8210b267 Fixed a memory leak.
Reported by:	Stanford Metacompilation research group
2004-01-18 12:49:36 +00:00
sanpei
ba843e3612 Empty vendor string overrides knowndevs
ubd_devinfo_vp() is getting an empty string from its  usbd_get_string()
call on the vendor, instead of NULL.  This means usb_knowndevs in not
consulted.

Add lines between grabbing those char *s and the USBVERBOSE ifdef to
set vendor to NULL if it is the empty string (similarly for product).

This causes vendor to be filled-out, although the product name read
overrules usb_knowndevs (this appears to be a conscience decision made
by the NetBSD folks):

PR:		kern/56097
Submitted by:	Hal Burch <hburch@lumeta.com>
MFC after:	1 week
2004-01-18 12:46:19 +00:00
ru
9d56f51fe9 Fixed a memory leak.
Submitted by:	Stanford Metacompilation research group
2004-01-18 12:32:06 +00:00
ru
ef58cf1027 Fixed a memory leak.
Submitted by:	Stanford Metacompilation research group
2004-01-18 12:26:33 +00:00
sos
bc6a26c12e Add missing free's. 2004-01-18 10:50:40 +00:00
yar
5fdf04cb71 Avoid overwriting capability bits marked earlier
when setting HW checksum offload bits.

Enable available capabilities properly.

Reviewed by:	sam
2004-01-18 10:15:48 +00:00
sanpei
3cbe1565b2 Pay attention to the timeout value passed down by the upper layer.
(NetBSD src/sys/dev/usb/umass.c rev.1.67)

PR:		kern/58649 (Problem 1)
Submitted by:	SAKIYAMA Nobuo <sakichan@sakichan.org>
MFC after:	1 week
2004-01-18 09:19:53 +00:00
sanpei
409b2941ad Sync to 1.158 of usbdevs 2004-01-18 09:04:57 +00:00
sanpei
6f59db79d4 add device id for PANASONIC KXLRW32AN(USB CD-R/RW,not yet support) 2004-01-18 08:02:34 +00:00
alc
089a949ad2 Increase UMA_BOOT_PAGES because of changes to pv entry initialization in
revision 1.457 of i386/i386/pmap.c.
2004-01-18 05:51:06 +00:00
nyan
27d1312c0c PC98 uses the different frame code. 2004-01-18 04:13:27 +00:00
nyan
689b60477a Fix to support KANA and graphics characters which code are over 0x80. 2004-01-18 04:10:45 +00:00
alc
2e3a70948a Don't acquire Giant in vm_object_deallocate() unless the object is vnode-
backed.
2004-01-18 03:44:14 +00:00
johan
e71e28a601 Fix type in comment, 's/writtent/written/'
PR:		56954
Submitted by:	Dan Langille <dan@langille.org>
2004-01-18 00:17:14 +00:00
sos
8967aea5ee Add support for the Silicon Image 3114 4 channel SATA controller. 2004-01-17 23:34:13 +00:00
imp
9ec815064d It appears that the changes in the resources allocated is causing much
pain and suffering.  Attempt to back it out by removing the 'if the
requested range is larger than the window, clip to the window' code.
This is a band-aide until the issues are better understood and the
issues with the lazy allocation patches are resolved.
2004-01-17 21:54:04 +00:00
alfred
5e14c5bad6 Don't panic because of RPC proto mismatches. Whitespace cleanup.
Submitted by: Jim Rees <rees@umich.edu>
2004-01-17 21:25:05 +00:00
gallatin
131dce5e56 Handle sf_buf_alloc() returning null. This can happen if the
process takes a signal while waiting for an sf_buf to become available.

Reviewed by: alc
2004-01-17 21:16:51 +00:00
phk
57f01cb35a remove elan_mmcr, I'm not sure I understand what it did here in the
first place.
2004-01-17 13:13:48 +00:00
phk
4a6ef983f5 Mostly mechanical rework of libalias:
Makes it possible to have multiple packet aliasing instances in a
single process by moving all static and global variables into an
instance structure called "struct libalias".

Redefine a new API based on s/PacketAlias/LibAlias/g

Add new "instance" argument to all functions in the new API.

Implement old API in terms of the new API.
2004-01-17 10:52:21 +00:00
phk
73ce23450f Make sure set the media type in the phy, we cannot trust it to have chosen
the type we happen to want.

Bug triggered by net-booting soekris hardware which comes up in 10/hdx mode
by default.
2004-01-17 10:44:39 +00:00
phk
5837c7acf0 As previously announced: discontinue use of makedev() call in soundcode.
This takes us a lot closer to refcounting dev_t.

This patch originally by cg@ with a few minor changes by me.

It is largely untested, but has been HEADSUP'ed twice, so presumably
people have not found any issues with it.

Submitted by:	cg@
2004-01-17 10:37:11 +00:00
mdodd
75e887d6d9 - Handle failure of cam_sim_alloc().
This prevents xpt_bus_register() from dereferencing NULL.
- Assign pointer to NULL after cam_sim_free().

Submitted by:	 Paul Twohey <twohey@CS.Stanford.EDU>
2004-01-17 05:57:52 +00:00
ru
4c377a2b8f Replaced outdated comment. 2004-01-17 03:28:27 +00:00
des
822486f5f8 Restore correct semantics for F_DUPFD fcntl. This should fix the errors
people have been getting with configure scripts.
2004-01-17 00:59:04 +00:00
green
7eafc3027a Do not allow operations which cause known file-system corruption. 2004-01-16 22:55:25 +00:00
green
290b9d4cfa Remove a warning. 2004-01-16 22:54:33 +00:00
des
7da0ef215b WITNESS won't let us hold two filedesc locks at the same time, so juggle
fdp and newfdp around a bit.
2004-01-16 21:54:56 +00:00
rwatson
cd9e066806 KASSERT() that initproc->p_pid is 1. Very bad things happen if init's
pid isn't 1, and it can actually occur if kthread_create() is called
before SUB_SI_CREATE_INIT without RFHIGHPID.

Discussed with:	jhb
2004-01-16 20:29:23 +00:00
green
1d16492387 Fix an upper-vnode leak created in revision 1.52. When an upper-layer
file has been removed, it should be purged from the cache, but it need
not be removed from the directory stack causing corruption; instead,
it will simply be removed once the last references and holds on it
are dropped at the end of the unlink/rmdir system calls, and the
normal !UN_CACHED VOP_INACTIVE() handler for unionfs finishes it off.

This is easily reproduced by repeated "echo >file; rm file" on a
unionfs mount.  Strangely, "echo -n >file; rm file" didn't make
it happen.
2004-01-16 16:31:01 +00:00
ru
566138655d - Build things in pure alphabetical dictionary order.
- Unify the conditional assignments section so that architectural
  exclusions come first, sorted, then options and !options, sorted
  by the option name, also in directory order, then architecture
  specific sections, sorted by the architecture name, with i386
  being a traditional exception.

Prodded by:	bde
2004-01-16 15:55:29 +00:00
sanpei
1e27106cc3 Sync to 1.157 of usbdevs 2004-01-16 15:31:20 +00:00
sanpei
33566aef0e Add support SUNTAC U-Cable type A3(AS64LX)
Submitted by:	TAKAHASHI Daisuke <takaha@mue.biglobe.ne.jp> [FreeBSD-users-jp 72475]
		and MIZUTANI Masaki <m-saki@rr.iij4u.or.jp>
MFC after:	1 week
2004-01-16 15:29:27 +00:00
des
71e88c7424 Remove two KASSERTs which were overly paranoid. 2004-01-16 08:45:56 +00:00
obrien
1432ab7b7e The ndis_kspin_lock type is called KSPIN_LOCK in MS-Windows.
According to the Windows DDK header files, KSPIN_LOCK is defined like this:
	typedef ULONG_PTR KSPIN_LOCK;

From basetsd.h (SDK, Feb. 2003):
	typedef [public] unsigned __int3264 ULONG_PTR, *PULONG_PTR;
	typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;
	typedef _W64 unsigned long ULONG_PTR, *PULONG_PTR;

The keyword __int3264 specifies an integral type that has the following
properties:
 + It is 32-bit on 32-bit platforms
 + It is 64-bit on 64-bit platforms
 + It is 32-bit on the wire for backward compatibility.
   It gets truncated on the sending side and extended appropriately
   (signed or unsigned) on the receiving side.

Thus register_t seems the proper mapping onto FreeBSD for spin locks.
2004-01-16 02:07:04 +00:00
grehan
37e1e5e54c Catch up with ATA UMA changes 2004-01-15 23:52:32 +00:00
wpaul
954acff77b The definition for __stdcall logically belongs in pe_var.h, but
the definitions for NDIS_BUS_SPACE_IO and NDIS_BUS_SPACE_MEM logically
belong in hal_var.h. At least, that's my story, and I'm sticking to it.

Also, remove definition of __stdcall from if_ndis.c now that it's pulled
in from pe_var.h.
2004-01-15 21:31:49 +00:00
obrien
b9de95c25e Create NDIS_BUS_SPACE_{IO,MEM} to abstract MD BUS_SPACE macros.
Provide appropriate definitions for i386 and AMD64.
2004-01-15 19:34:56 +00:00
des
7b61601242 Take care to drop locks when calling malloc() 2004-01-15 18:50:11 +00:00
onoe
24883f9f8e Correct beacon (src/bssid) for hostap and adhoc mode. 2004-01-15 13:30:06 +00:00
des
9bddb39d40 New file descriptor allocation code, derived from similar code introduced
in OpenBSD by Niels Provos.  The patch introduces a bitmap of allocated
file descriptors which is used to locate available descriptors when a new
one is needed.  It also moves the task of growing the file descriptor table
out of fdalloc(), reducing complexity in both fdalloc() and do_dup().

Debts of gratitude are owed to tjr@ (who provided the original patch on
which this work is based), grog@ (for the gdb(4) man page) and rwatson@
(for assistance with pxeboot(8)).
2004-01-15 10:15:04 +00:00
onoe
f6975b5f8c Use generic net80211 framework for awi driver.
Restore awi to be workable again; it was broken..
XXX: The initialization is still unreliable yet, it sometimes fails on
     some card.
2004-01-15 10:04:21 +00:00
onoe
7c01403c73 Add support for FH phy, which will be used by awi driver.
Also some if_media constants to indicate operational mode are changed
to bitmasks to reduce diffs from NetBSD.
2004-01-15 08:44:27 +00:00
grehan
22b6fd9348 - add openpic macio and psim/iobus attachments
- alpha sort powermac files
2004-01-15 08:43:46 +00:00
wpaul
e28e2ff574 Implement NdisCopyFromPacketToPacket() and NdisCopyFromPacketToPacketSafe().
I only have one driver that references this routine (for the 3Com 3cR990)
and it never gets called, but just in case, here it is.
2004-01-15 07:42:26 +00:00
mdodd
5e9b6fc531 Add a per controller IOCTL interface. 2004-01-15 06:37:52 +00:00