Commit Graph

44489 Commits

Author SHA1 Message Date
Yoshihiro Takahashi
6c021e3150 MFi386: revision 1.583. 2004-01-11 09:18:33 +00:00
Yoshihiro Takahashi
8d6649fef6 The ida module is not needed for pc98. 2004-01-11 09:15:13 +00:00
Matthew N. Dodd
99e5f60af4 ida(4) module. PCI only for now. 2004-01-11 07:01:30 +00:00
Alan Cox
0e88a71798 Remove long dead code, specifically, code related to munmapfd().
(See also vm/vm_mmap.c revision 1.173.)
2004-01-11 06:59:21 +00:00
Warner Losh
e4b59fc500 Add support for subtractive decoding bridges. These bridges pass all
signals to addresses to the child busses.  Typically, ProgIf of 1
means a subtractive bridge.  However, Intel has a whole lot of ones
with a ProgIf of 80 that are also subtractive.  We cope with these
bridges too.  This eliminates hw.pci.allow_unsupported_io_range
because that had almost the same effect as these patches (almost means
'buggy').  Remove the bogus checks for ISA bus locations: these cycles
aren't special and are only passed by transparent bridges.

We allow any range to succeed.  If the range is a superset of the
range that's decoded, trim the resource to that range.  Otherwise,
pass the range unchanged.  This will change the location that PC Card
and CardBus cards are attached.  This might bogusly cause some
overlapping allocation that wasn't present before, but the overlapping
fixes need to be in the pci level.

There's also a few formatting changes here.
2004-01-11 06:52:31 +00:00
Robert Watson
c370f01276 Release audit device major number reservation. The new audit
implementation writes directly to a file, similar to the Darwin,
Solaris, and whoever else implementations, rather than buffering
through a pseudo-device.
2004-01-11 06:24:34 +00:00
David E. O'Brien
076fcd1776 This commit was generated by cvs2svn to compensate for changes in r124361,
which included commits to RCS files with non-trunk default branches.
2004-01-11 03:34:02 +00:00
David E. O'Brien
fbee6927b8 Vendor import emu10k1.h from version 1.0.1 of the ALSA driver.
ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.1.tar.bz2
  or http://www.alsa-project.org/alsa/cvs/alsa-kernel/include/emu10k1.h
2004-01-11 03:34:02 +00:00
Alan Cox
7fac6d07f6 Include "opt_cpu.h" and related #ifdef's for SSE so that pagezero()
actually includes the call to sse2_pagezero().
2004-01-11 03:02:25 +00:00
Robert Watson
def055686c When not creating a core dump due to resource limits specifying
a maximum dump size of 0, return a size-related error, rather
than returning success.  Otherwise, waitpid() will incorrectly
return a status indicating that a core dump was created.  Note
that the specific error doesn't actually matter, since it's lost.

MFC after:	2 weeks
PR:		60367
Submitted by:	Valentin Nechayev <netch@netch.kiev.ua>
2004-01-11 02:28:06 +00:00
David E. O'Brien
c1d6534deb Remove EMUDEBUG [un]def. This should be done in the Makefile. 2004-01-11 01:34:41 +00:00
Warner Losh
28c30c8315 MF-p4/diff reduction:
Eliminate trailing blank line in this file.
2004-01-11 00:18:03 +00:00
Alan Cox
baadec0711 - Unmanage pages allocated by contigmalloc1(). (There is no point in
having PV entries for these pages.)
 - Remove splvm() and splx() calls.
2004-01-10 21:17:53 +00:00
Jens Schweikhardt
85495c72ff s/Muliple/Multiple
Removed whitespace at EOL and EOF.
2004-01-10 18:34:01 +00:00
Dag-Erling Smørgrav
d41457da80 More unparenthesized return values. 2004-01-10 17:14:53 +00:00
Ruslan Ermilov
6c3d1bdfa3 Properly fix the FreeBSD copyright.
Pointed by:	scottl
2004-01-10 16:24:22 +00:00
Ruslan Ermilov
ab8de8b9d7 s/FreeBSD Inc./The FreeBSD Foundation/g 2004-01-10 15:38:47 +00:00
Dag-Erling Smørgrav
b91a599717 Style: parenthesize return values. 2004-01-10 13:03:43 +00:00
Hajimu UMEMOTO
803434325e try rtinit() only when the route is not installed.
this allows, e.g., duplicated attempts of 'ifconfig lo0 ::1'
like for IPv4.

Obtained from:	KAME
MFC after:	1 week
2004-01-10 08:59:21 +00:00
Don Lewis
e29ef13f6c Check that sa_len is the appropriate value in tcp_usr_bind(),
tcp6_usr_bind(), tcp_usr_connect(), and tcp6_usr_connect() before checking
to see whether the address is multicast so that the proper errno value
will be returned if sa_len is incorrect.  The checks are identical to the
ones in in_pcbbind_setup(), in6_pcbbind(), and in6_pcbladdr(), which are
called after the multicast address check passes.

MFC after:	30 days
2004-01-10 08:53:00 +00:00
Don Lewis
2b77864f1e Add a somewhat redundant check on the len arguement to getsockaddr() to
avoid relying on the minimum memory allocation size to avoid problems.
The check is somewhat redundant because the consumers of the returned
structure will check that sa_len is a protocol-specific larger size.

Submitted by:	Matthew Dillon <dillon@apollo.backplane.com>
Reviewed by:	nectar
MFC after:	30 days
2004-01-10 08:28:54 +00:00
Don Lewis
3f02eaf396 Don't execute the code in in6_ifdetach() that removes the link-local
allnodes multicast route if the routing table has not been initialized.
This avoids a panic during boot if an interface detaches before the
routing table is initialized.

Submitted by:	sam
2004-01-10 08:14:27 +00:00
Hajimu UMEMOTO
5fac41781b in set{peer, sock}addr, do not convert the unspecified
address (::) to the mapped address form.

PR:		kern/22868
Obtained from:	KAME
MFC after:	3 days
2004-01-10 08:11:51 +00:00
Tim J. Robbins
835fb61618 Restore closing of SMB find handle in smbfs_close(). 2004-01-10 03:45:30 +00:00
Doug Ambrisko
e2297e59c8 Remove the HACK section it breaks the older firmware and doesn't totally
fix the new firmware so remove it.
2004-01-10 03:02:04 +00:00
Alfred Perlstein
3f5c95f772 Fix a panic when attempting a v4 op against a v3/v2-only server.
It happens because rpcclnt_request is incorrectly returning 0 in the case
of an rpc mismatch or auth error.

Submitted by: Jim Rees <rees@umich.edu>
2004-01-10 02:59:54 +00:00
Alan Cox
37d44833d5 Unmanage pages allocated by kmem_alloc(). (There is no point in having PV
entries for these pages.)
2004-01-10 00:22:33 +00:00
Olivier Houchard
5cded90454 Prevent a race condition between fork1() and whatever changes the pgrp by
setting the new process' p_pgrp again before inserting it in the p_pglist.
Without it we can get the new process to be inserted in a different p_pglist
than the one p2->p_pgrp points to, and this is not something we want to happen.
This is not a fix, merely a bandaid, but it will work until someone finds a
better way to do it.

Discussed with: 	jhb (a long time ago)
2004-01-09 23:42:36 +00:00
Olivier Houchard
63bfa8ba2c Remove duplicate __FBSDID().
Mark trm as depending on cam.
2004-01-09 23:30:31 +00:00
Nate Lawson
2ccd1cac95 Clean up the acpi announce message of trailing spaces. 2004-01-09 21:04:28 +00:00
Nate Lawson
25611cfe97 Expand the check for overriding the OS name to override _OS* (including
_OS_, _OS, and _OSI).  This should fix this option for people who reported
it not changing anything.
2004-01-09 20:01:42 +00:00
Scott Long
6d38a06c85 Disable the APIC when selecting the 'Safe Mode' option of the loader. This
will disable both APIC interrupt routing and SMP.
2004-01-09 19:20:47 +00:00
Jacques Vidrine
e4dc8baa84 Provide sysarch(2) prototypes in the MD sysarch.h headers. While I'm
at it, use the ANSI C generic pointer type for the second argument,
thus matching the documentation.

Remove the now extraneous (and now conflicting) function declarations
in various libc sources.  Remove now unnecessary casts.

Reviewed by:	bde
2004-01-09 16:52:09 +00:00
Poul-Henning Kamp
cfa35456ca KASSERT against no-op access requests.
Submitted by:	Pawel Jakub Dawidek <nick@garage.freebsd.pl>
2004-01-09 16:10:32 +00:00
Andre Oppermann
1ddc17c1d5 Reduce TCP_MINMSS default to 216. The AX.25 protocol (packet radio)
is frequently used with an MTU of 256 because of slow speeds and a
high packet loss rate.
2004-01-09 14:14:10 +00:00
Hartmut Brandt
5361744dfa Fix a warning when NATM is not defined. In this case s is not used. 2004-01-09 11:25:14 +00:00
Bill Paul
e6003d0862 The private data section of ndis_packets has a 'packet flags' byte
which has two important flags in it: the 'allocated by NDIS' flag
and the 'media specific info present' flag. There are two Windows macros
for getting/setting media specific info fields within the ndis_packet
structure which can behave improperly if these flags are not initialized
correctly when a packet is allocated. It seems the correct thing
to do is always set the NDIS_PACKET_ALLOCATED_BY_NDIS flag on
all newly allocated packets.

This fixes the crashes with the Intel Centrino wireless driver.
My sample card now seems to work correctly.

Also, fix a potential LOR involving ndis_txeof() in if_ndis.c.
2004-01-09 06:53:49 +00:00
David E. O'Brien
2511c244ad Sync with Creative's 8010.h rev 1.51. 2004-01-09 06:38:11 +00:00
David E. O'Brien
a554deb2a8 Dike out some very Linux-specific parts that we can't compile with.
Also protect AC97_MUTE which is also defined in our own ac97.h.
2004-01-09 05:08:32 +00:00
David E. O'Brien
fca6c85647 Vendor import revision 1.9 of ac97_codec.h (we renamed the file) from
http://cvs.sourceforge.net/viewcvs.py/emu10k1/emu10k1/ac97_codec.h
2004-01-09 05:05:04 +00:00
David E. O'Brien
03adcebca3 This commit was generated by cvs2svn to compensate for changes in r124273,
which included commits to RCS files with non-trunk default branches.
2004-01-09 05:05:04 +00:00
Bill Paul
431b5bd6e7 Implement NdisOpenFile()/NdisCloseFile()/NdisMapFile()/NdisUnmapFile().
By default, we search for files in /compat/ndis. This can be changed with
a systcl. These routines are used by some drivers which need to download
firmware or microcode into their respective devices during initialization.

Also, remove extraneous newlines from the 'built-in' sysctl/registry
variables.
2004-01-09 03:57:00 +00:00
Brian Feldman
b712e9ec66 Also, don't crash in the netgraph disconnect node if the interface is
detached from the other direction.
2004-01-09 02:03:24 +00:00
Brian Feldman
018df1c369 Don't try to ifpromisc() on an interface that's deleted already. 2004-01-09 00:41:45 +00:00
Robert Watson
07eacae0d2 Improve the expressiveness of ttyinfo (^T) when dealing with threads
in slightly less usual states:

  If the thread is on a run queue, display "running" if the thread is
  actually running, otherwise, "runnable".

  If the thread is sleeping, and it's on a sleep queue, display the
  name of the queue, otherwise "unknown" -- previously, in this situation
  we would display "iowait".

  If the thread is waiting on a lock, display *lockname.

  If the thread is suspended, display "suspended" -- previously, in
  this situation we would display "iowait".

  If the thread is waiting for an interrupt, display "intrwait" --
  previously, in this situation we would display "iowait".

  If the thread is in a state not handled by the above, display
  "unknown" -- previously, we would print "iowait".

Among other things, this avoids displaying "iowait" when the foreground
process turns out to be suspended waiting for a debugger to properly
attach.
2004-01-08 22:49:23 +00:00
Robert Watson
047aa39b25 Drop the sigacts mutex around calls to stopevent() to avoid sleeping
holding the mutex.  Because the sigacts pointer can't change while
the process is "live" (proc locking (x)), we know our pointer is still
valid.

In communication with:	truckman
Reviewed by:		jhb
2004-01-08 22:44:54 +00:00
Alan Cox
65bae14d77 - Enable recursive acquisition of the mutex synchronizing access to the
free pages queue.  This is presently needed by contigmalloc1().
 - Move a sanity check against attempted double allocation of two pages
   to the same vm object offset from vm_page_alloc() to vm_page_insert().
   This provides better protection because double allocation could occur
   through a direct call to vm_page_insert(), such as that by
   vm_page_rename().
 - Modify contigmalloc1() to hold the mutex synchronizing access to the
   free pages queue while it scans vm_page_array in search of free pages.
 - Correct a potential leak of pages by contigmalloc1() that I introduced
   in revision 1.20: We must convert all cache queue pages to free pages
   before we begin removing free pages from the free queue.  Otherwise,
   if we have to restart the scan because we are unable to acquire the
   vm object lock that is necessary to convert a cache queue page to a
   free page, we leak those free pages already removed from the free queue.
2004-01-08 20:48:26 +00:00
Søren Schmidt
986a964900 Use the saved params for LBA-CHS conversion. Fixes PC98 bug. 2004-01-08 19:17:16 +00:00
Maxime Henrion
ec6a729924 Some integrated Davicom cards in sparc64 boxes have an all zeros
MAC address in the EEPROM, and we need to get it from OpenFirmware.
This isn't very pretty but time is lacking to do this in a better
way this near 5.2-RELEASE.  This is a RELENG_5_2 candidate.

Original version by:	Marius Strobl <marius@alchemy.franken.de>
Tested by:		Pete Bentley <pete@sorted.org>
Reviewed by:		jake
2004-01-08 19:08:27 +00:00
Andre Oppermann
53369ac9bb Limiters and sanity checks for TCP MSS (maximum segement size)
resource exhaustion attacks.

For network link optimization TCP can adjust its MSS and thus
packet size according to the observed path MTU.  This is done
dynamically based on feedback from the remote host and network
components along the packet path.  This information can be
abused to pretend an extremely low path MTU.

The resource exhaustion works in two ways:

 o during tcp connection setup the advertized local MSS is
   exchanged between the endpoints.  The remote endpoint can
   set this arbitrarily low (except for a minimum MTU of 64
   octets enforced in the BSD code).  When the local host is
   sending data it is forced to send many small IP packets
   instead of a large one.

   For example instead of the normal TCP payload size of 1448
   it forces TCP payload size of 12 (MTU 64) and thus we have
   a 120 times increase in workload and packets. On fast links
   this quickly saturates the local CPU and may also hit pps
   processing limites of network components along the path.

   This type of attack is particularly effective for servers
   where the attacker can download large files (WWW and FTP).

   We mitigate it by enforcing a minimum MTU settable by sysctl
   net.inet.tcp.minmss defaulting to 256 octets.

 o the local host is reveiving data on a TCP connection from
   the remote host.  The local host has no control over the
   packet size the remote host is sending.  The remote host
   may chose to do what is described in the first attack and
   send the data in packets with an TCP payload of at least
   one byte.  For each packet the tcp_input() function will
   be entered, the packet is processed and a sowakeup() is
   signalled to the connected process.

   For example an attack with 2 Mbit/s gives 4716 packets per
   second and the same amount of sowakeup()s to the process
   (and context switches).

   This type of attack is particularly effective for servers
   where the attacker can upload large amounts of data.
   Normally this is the case with WWW server where large POSTs
   can be made.

   We mitigate this by calculating the average MSS payload per
   second.  If it goes below 'net.inet.tcp.minmss' and the pps
   rate is above 'net.inet.tcp.minmssoverload' defaulting to
   1000 this particular TCP connection is resetted and dropped.

MITRE CVE:	CAN-2004-0002
Reviewed by:	sam (mentor)
MFC after:	1 day
2004-01-08 17:40:07 +00:00
Bill Paul
2aae662479 Add the PCI ID for yet another bge chip: the Altima 1002.
Submitted by: Pavel Gubin <pg@rainbow.ie.tusur.ru>
2004-01-08 17:19:11 +00:00
Bill Paul
8d1da39d69 Add the NDISAPI option. 2004-01-08 17:13:10 +00:00
Nate Lawson
9bb87cde3e Always clean all files, including ones under ACPI_DEBUG when doing a
"make clean".
2004-01-08 16:38:32 +00:00
Hidetoshi Shimokawa
11fe249262 * firewire
Add tcode_str[] and improve debug message.
* sbp
	If max_speed is negative, use the maximum speed which the
	ohci chip supports.  The default max_speed is -1.
* if_fwe
	If tx_speed is negative, use the maximum speed which the
	ohci chip supports.  The default tx_speed is 2.
2004-01-08 14:58:09 +00:00
Andre Oppermann
bf87c82ebb If path mtu discovery is enabled set the DF bit in all cases we
send packets on a tcp connection.

PR:		kern/60889
Tested by:	Richard Wendland <richard@wendland.org.uk>
Approved by:	re (scottl)
2004-01-08 11:17:11 +00:00
Andre Oppermann
e0f630ea7a Do not set the ip_id to zero when DF is set on packet and
restore the general pre-randomid behaviour.

Setting the ip_id to zero causes several problems with
packet reassembly when a device along the path removes
the DF bit for some reason.

Other BSD and Linux have found and fixed the same issues.

PR:		kern/60889
Tested by:	Richard Wendland <richard@wendland.org.uk>
Approved by:	re (scottl)
2004-01-08 11:13:40 +00:00
Bill Paul
3e1b0c31a1 Correct the definition of the ndis_miniport_interrupt structure:
the ni_dpccountlock member is an ndis_kspin_lock, not an
ndis_spin_lock (the latter is too big).

Run if_ndis.c:ndis_tick() via taskqueue_schedule(). Also run
ndis_start() via taskqueue in certain circumstances.

Using these tweaks, I can now get the Broadcom BCM5701 NDIS
driver to load and run. Unfortunately, the version I have seems
to suffer from the same bug as the SMC 83820 driver, which is
that it creates a spinlock during its DriverEntry() routine.
I'm still debating the right way to deal with this.
2004-01-08 10:44:37 +00:00
Don Lewis
4ff4a9bee9 The transmit frame status is stored in the last transmit descriptor for the
frame, not the first.  It is probably also not safe to free the mbuf chain
as soon as the OWN bit is cleared on the first descriptor since the chip
may not be done copying the frame into the transmit FIFO.  Revert the part of
of busdma conversion (if_dc.c rev 1.115) which changed dc_txeof() to look for
the status in the first descriptor and free the mbuf chain when processing
the first descriptor for the frame, and revert the matching changes elsewhere
in the driver.  This part of the busdma change caused the driver to report
spurious collisions and output errors, even when running in full-duplex mode.
Reverting the mbuf chain handling slightly complicates dc_dma_map_txbuf(),
since it is responsible for setting the OWN bits on the descriptors, but does
not normally have direct access to the mbuf chain.

Tested by:
  Dejan Lesjak <dejan.lesjak at ijs.si>  alpha/<Intel 21143 10/100BaseTX>
  "Xin LI" <delphij at frontfree.net>    i386/<Macronix 98713 10/100BaseTX>
  Wiktor Niesiobedzki <bsd at w.evip.pl> i386/<3Com OfficeConnect 10/100B>

Reviewed by:	mux
2004-01-08 06:22:15 +00:00
Sam Leffler
d4b2657f98 Remove extraneous unlock. This fixes a panic seen when manipulating static
entries in the ARP table.
2004-01-07 23:42:21 +00:00
John Baldwin
ed91a3d95a Comsetic tweaks: use PCPU_GET(cpumask) and CPU_ABSENT().
Tested by:	Dejan Lesjak <dejan.lesjak@ijs.si>
2004-01-07 23:00:20 +00:00
Bill Paul
0fba60013b Correct and simplify the implementation of RtlEqualUnicodeString(). 2004-01-07 20:31:51 +00:00
Bill Paul
9163fadb70 It appears drivers may call NdisWriteErrorLogEntry() with locks
held. However, if we need to translate a unicode message table message,
ndis_unicode_to_ascii() might malloc() some memory, which causes
a warning from witness. Avoid this by using some stack space to hold
the translated message. (Also bounds check to make sure we don't
overrun the stack buffer.)
2004-01-07 19:26:47 +00:00
Sam Leffler
23428eafa0 When draining the tx queue reclaim any node references held in packets.
This fixes a problem when operating as an AP where clients would get
stuck in the node table because the reference count never went to zero.
2004-01-07 19:16:49 +00:00
Sam Leffler
a9c0425768 When ath_hal_stoptxdma returns an error dma is still likely stopped
so don't just stop trying to send a beacon frame or we'll be more likely
to lose sync.  This only seems to happen on some older chips.
2004-01-07 19:11:11 +00:00
Sam Leffler
7bbf937701 use ath_reset instead of ath_init when recovering from a watchdog timeout:
resetting the hardware is sufficient, no need to reset the 802.11 fsm
2004-01-07 19:07:41 +00:00
Sam Leffler
f3be79561f make hw.ath.debug a tunable 2004-01-07 19:05:35 +00:00
Sam Leffler
8c0370b75d make hw.ath.outdoor and hw.ath.countrycode tunables 2004-01-07 19:04:42 +00:00
Sam Leffler
e325e53069 split debugging messages up into classes;
ah_debug is now treated as a bit vector
2004-01-07 18:57:38 +00:00
Robert Watson
1f1ca35f69 Lock p->p_textvp before calling vn_fullpath() on it. Note the
potential lock order concern due to the vnode lock held
simultaneously by the caller into procfs.

Reported by:	kuriyama
Approved by:	des
2004-01-07 17:58:51 +00:00
Joerg Wunsch
d93dea685d Fix a long-standing bug that had been introduced in rev 1.24 with the
replacement of struct proc by struct thread.  This bug could cause a
NULL pointer dereferencation under certain circumstances (e. g. while
running /etc/rc.d/pcvt).
2004-01-07 10:12:59 +00:00
Bill Paul
e157128762 Use atomic ops for the interlocked increment and decrement routines
in subr_ndis and subr_ntoskrnl. This is faster and avoids potential
LOR whinage from witness (an LOR couldn't happen with the old code
since the interlocked inc/dec routines could not sleep with a lock
held, but this will keep witness happy and it's more efficient
anyway. I think.)
2004-01-07 07:29:27 +00:00
Bill Paul
e3c8d8194c In subr_ndis.c: correct ndis_interlock_inc() and ndis_interlock_dec()
so we increment the right thing. (All work and not enough parens
make Bill something something...) This makes the RealTek 8139C+
driver work correctly.

Also fix some mtx_lock_spin()s and mtx_unlock_spin()s that should
have been just plain mtx_lock()s and mtx_unlock()s.

In kern_ndis.c: remove duplicate code from ndis_send_packets() and
just call the senddone handler (ndis_txeof()).
2004-01-07 06:15:56 +00:00
Andre Oppermann
dba7bc6a65 Enable the following TCP options by default to give it more exposure:
rfc3042  Limited retransmit
 rfc3390  Increasing TCP's initial congestion Window
 inflight TCP inflight bandwidth limiting

All my production server have it enabled and there have been no
issues.  I am confident about having them on by default and it gives
us better overall TCP performance.

Reviewed by:	sam (mentor)
2004-01-06 23:29:46 +00:00
Andre Oppermann
87c3bd2755 According to RFC1812 we have to ignore ICMP redirects when we
are acting as router (ipforwarding enabled).

This doesn't fix the problem that host routes from ICMP redirects
are never removed from the kernel routing table but removes the
problem for machines doing packet forwarding.

Reviewed by:	sam (mentor)
2004-01-06 23:20:07 +00:00
Alan Cox
c020e821c7 Don't bother clearing PG_ZERO in contigmalloc1(), kmem_alloc(), or
kmem_malloc().  It serves no purpose.
2004-01-06 20:52:55 +00:00
Jacques Vidrine
3f6f39ff54 Remove `static' prototype from header file. 2004-01-06 20:36:21 +00:00
John Baldwin
c8d7ed0d05 - Use i8259A register defines from shared sys/dev/ic/i8259.h rather than
from the i386-specific icu.h.
- Replace PC98 magic numbers with equivalent register define values along
  with comments about PC-98 "quirks".
2004-01-06 19:07:08 +00:00
John Baldwin
1e4cad1384 Use i8259A register defines from shared header sys/dev/ic/i8259.h instead
of from the amd64-specific icu.h.
2004-01-06 19:05:25 +00:00
John Baldwin
b733b2545b Add a header for the i8259A register definitions. This is based on
additions to sys/amd64/isa/icu.h from PIIX4 and other datasheets.  I
tweaked a few comments based on the NetBSD header of the same name when I
merged the constants to sys/i386/isa/icu.h, but the vast majority of this
file was created independently by Peter and not taken from any existing
files.

Submitted by:	peter
2004-01-06 18:59:37 +00:00
John Baldwin
b277f64b8b Remove the AUTO_EOI_2 option for PC-98 as it has never done anything anyway
and was even commented out in NOTES.
2004-01-06 18:51:14 +00:00
Jacques Vidrine
1d0342a3d5 Use ANSI C function definition for _mcount' and remove static'
prototype from header file.

Discussed with:	bde, maybe one year ago
2004-01-06 18:49:54 +00:00
David E. O'Brien
b06cf654be Allow one to specify the com port settings for boot0sio. 2004-01-06 18:46:35 +00:00
Bill Paul
1cfaf27e2b Clean up pe_get_message(). Allow the caller to obtain the resource
flag so that it can see if the message string is unicode or not and
do the conversion itself rather than doing it in subr_pe.c. This
prevents subr_pe.c from being dependent on subr_ndis.c.
2004-01-06 18:06:54 +00:00
Hidetoshi Shimokawa
d09a5d6fce Remove __P(). 2004-01-06 14:30:47 +00:00
Hidetoshi Shimokawa
c3e840a89b Fix register mis-alignment introduced in rev1.12. 2004-01-06 14:24:01 +00:00
Bill Paul
09bebfadee - Add pe_get_message() and pe_get_messagetable() for processing
the RT_MESSAGETABLE resources that some driver binaries have.
  This allows us to print error messages in ndis_syslog().

- Correct the implementation of InterlockedIncrement() and
  InterlockedDecrement() -- they return uint32_t, not void.

- Correct the declarations of the 64-bit arithmetic shift
  routines in subr_ntoskrnl.c (_allshr, allshl, etc...). These
  do not follow the _stdcall convention: instead, they appear
  to be __attribute__((regparm(3)).

- Change the implementation of KeInitializeSpinLock(). There is
  no complementary KeFreeSpinLock() function, so creating a new
  mutex on each call to KeInitializeSpinLock() leaks resources
  when a driver is unloaded. For now, KeInitializeSpinLock()
  returns a handle to the ntoskrnl interlock mutex.

- Use a driver's MiniportDisableInterrupt() and MiniportEnableInterrupt()
  routines if they exist. I'm not sure if I'm doing this right
  yet, but at the very least this shouldn't break any currently
  working drivers, and it makes the Intel PRO/1000 driver work.

- In ndis_register_intr(), save some state that might be needed
  later, and save a pointer to the driver's interrupt structure
  in the ndis_miniport_block.

- Save a pointer to the driver image for use by ndis_syslog()
  when it calls pe_get_message().
2004-01-06 07:09:26 +00:00
Eric Anholt
f25a19f66f Merge from DRI CVS. No longer maps the framebuffer into KVA on radeon, r128,
and mga.  MTRR code cleanups.  Includes new Radeon and Rage 128 PCI IDs.
2004-01-06 04:34:53 +00:00
Alexander Kabaev
c969c60c60 Add pid to the info printed in lockmgr_printinfo. This makes VFS
diagnostic messages slightly more useful.
2004-01-06 04:34:13 +00:00
Alexander Kabaev
580ddfa64b More style fixes.
Obtained from:	bde
2004-01-05 23:40:46 +00:00
John Baldwin
eac097962f - Allow mtx_trylock() to recurse on a recursive mutex. Attempts to recurse
on a non-recursive mutex will fail but will not trigger any assertions.
- Add an assertion to mtx_lock() that one never recurses on a non-recursive
  mutex.  This is mostly useful for the non-WITNESS case.

Requested by:	deischen, julian, others (1)
2004-01-05 23:09:51 +00:00
Alexander Kabaev
b0fdf71656 style(9):
Add empty line before first code line in functions with no local
variables.
Properly terminate comment sentences.
Indent lines which are longer that 80 characters.
Move v_addpollinfo closer to the rest of poll-related functions.
Move DEBUG_VFS_LOCKS ifdefed block to the end of file.

Obtained from:	bde (partly)
2004-01-05 19:04:29 +00:00
Alexander Kabaev
64f4c8e8e0 Properly ifdef support for vfs locking assertions based on DEBUG_VFS_LOCKS.
Obtained from: bde
2004-01-05 18:04:02 +00:00
Alexander Kabaev
89144d1a8b Style fixes:
Remove double empty lines.
	Add tab after #define's.
	Properly terminate sentences in comments.

Obtained from:	bde (mostly).
2004-01-05 16:48:18 +00:00
Hidetoshi Shimokawa
5b50d9ade7 MFp4:
* firewire
	- Remove pending list.
	- Ignore timeout for the FWXF_START state.
	- Define M_FWMEM for debugging.
	- Comment out DELAY() in fw_asybusy().
	- Improve debugging messages
* sbp
	- Freeze simq while bus reset.
2004-01-05 14:21:18 +00:00
Poul-Henning Kamp
883bd55abd Add struct definition of the Elan MMCR registers (from jb@)
Put a CTASSERT() on the size of the struct.

Use the struct where it is easy to do so in elan_mmcr.c

Add the Elan specific hardware reset code (also from jb@).
2004-01-05 12:00:59 +00:00
MIHIRA Sanpei Yoshiro
c2f1dd4d71 Sync to 1.154 of usbdevs 2004-01-05 09:53:19 +00:00
MIHIRA Sanpei Yoshiro
15e718175b fix CANOSCAN -> CanoScan
Submitted by:	 MIYAO Akio <miyao@affrc.go.jp>
2004-01-05 09:50:33 +00:00
David E. O'Brien
c53cdbeb95 Attempt to make the proper changes here for the proc.h commit:
Make sigaltstack as per-threaded, because per-process sigaltstack state
  is useless for threaded programs, multiple threads can not share same
  stack.
  The alternative signal stack is private for thread, no lock is needed,
  the orignal P_ALTSTACK is now moved into td_pflags and renamed to
  TDP_ALTSTACK.
  For single thread or Linux clone() based threaded program, there is no
  semantic changed, because those programs only have one kernel thread
  in every process.

which left out SVR4 bits.
2004-01-05 00:29:00 +00:00
David E. O'Brien
c990f469a7 Convert to __FBSDID. 2004-01-04 23:30:47 +00:00
David E. O'Brien
bd506e2a3a Convert to __FBSDID. 2004-01-04 23:21:18 +00:00
Warner Losh
9a6fdece27 MFp4:
o O2Micro OZ711e1 is now recognized (note: I don't have one, and the current
  owner of the Dell laptop is reporting problems).
o minor nits wrt copyright date.
2004-01-04 22:10:00 +00:00
Bill Paul
137bcec3f9 Modify if_ndis.c so that the MiniportISR function runs in ndis_intr()
and MiniportHandleInterrupt() is fired off later via a task queue in
ndis_intrtask(). This more accurately follows the NDIS interrupt handling
model, where the ISR does a minimal amount of work in interrupt context
and the handler is defered and run at a lower priority.

Create a separate ndis_intrmtx mutex just for the guarding the ISR.

Modify NdisSynchronizeWithInterrupt() to aquire the ndis_intrmtx
mutex before invoking the synchronized procedure. (The purpose of
this function is to provide mutual exclusion for code that shares
variables with the ISR.)

Modify NdisMRegisterInterrupt() to save a pointer to the miniport
block in the ndis_miniport_interrupt structure so that
NdisSynchronizeWithInterrupt() can grab it later and derive
ndis_intrmtx from it.
2004-01-04 21:22:25 +00:00
Alan Cox
2f7af3db57 Simplify the various pager allocation routines by computing the desired
object size once and assigning that value to a local variable.
2004-01-04 20:55:15 +00:00
Bill Paul
209dd08745 Implement NdisScheduleWorkItem() and RtlCompareMemory().
Also, call the libinit and libfini routines from the modevent
handler in kern_ndis.c. This simplifies the initialization a little.
2004-01-04 07:47:33 +00:00
Nate Lawson
59cb1d160c Fix for "UtAllocate: Attempt to allocate zero bytes" warnings on Dell
laptops that resulted in problems reading battery status.  Don't
copy Buffers, Packages, or Regions in DsStoreObjectToLocal().

Tested by:	scottl, sam
Submitted by:	Luming Yu (Intel)
2004-01-04 06:35:01 +00:00
Nate Lawson
9ca39f70b1 This commit was generated by cvs2svn to compensate for changes in r124120,
which included commits to RCS files with non-trunk default branches.
2004-01-04 06:35:01 +00:00
Alexander Kabaev
291027ce9c Avoid calling vprint on a vnode while holding its interlock mutex.
Move diagnostic printf after vget. This might delay the debug
output some, but at least it keeps kernel from exploding if
DEBUG_VFS_LOCKS is in effect.
2004-01-04 04:08:34 +00:00
Alexander Kabaev
3ff1b7c23f Cosmetics: strip '\n' from a string passed to Debugger(). 2004-01-04 03:42:20 +00:00
Alan Cox
a67048571f Eliminate the acquisition and release of Giant from vnode_pager_alloc().
The vm object and vnode locking should suffice.

Discussed with:	jeff
2004-01-04 03:18:24 +00:00
Bill Paul
8bf6313448 In ndis_attach(), report the NDIS API level that the Windows miniport
driver was compiled with.

Remove debug printf from ndis_assicn_pcirsc(). It doesn't serve
much purpose.

Implement NdisMIndicateStatus() and NdisMIndicateStatusComplete()
as functions in subr_ndis.c. In NDIS 4.0, they were functions. In
NDIS 5.0 and later, they're just macros.

Allocate a few extra packets/buffers beyond what the driver asks
for since sometimes it seems they can lie about how many they really
need, and some extra stupid ones don't check to see if NdisAllocatePacket()
and/or NdisAllocateBuffer() actually succeed.
2004-01-04 03:00:21 +00:00
Tim J. Robbins
208a7a97a3 In smbfs_inactive(), only invalidate the node's attribute cache if we
had to send a file close request to the server.
2004-01-04 00:57:22 +00:00
David Xu
51362c2d8a Make sigaltstack as per-threaded, because per-process sigaltstack state
is useless for threaded programs, multiple threads can not share same
stack.
The alternative signal stack is private for thread, no lock is needed,
the orignal P_ALTSTACK is now moved into td_pflags and renamed to
TDP_ALTSTACK.
For single thread or Linux clone() based threaded program, there is no
semantic changed, because those programs only have one kernel thread
in every process.
2004-01-03 23:36:31 +00:00
David Xu
9b778a1611 Make sigaltstack as per-threaded, because per-process sigaltstack state
is useless for threaded programs, multiple threads can not share same
stack.
The alternative signal stack is private for thread, no lock is needed,
the orignal P_ALTSTACK is now moved into td_pflags and renamed to
TDP_ALTSTACK.
For single thread or Linux clone() based threaded program, there is no
semantic changed, because those programs only have one kernel thread
in every process.
2004-01-03 23:31:29 +00:00
MIHIRA Sanpei Yoshiro
ba94ce12a7 Sync to 1.153 of usbdevs 2004-01-03 23:06:08 +00:00
MIHIRA Sanpei Yoshiro
a77a8c3ddd Add some ids(not yet support)
[1] EMS PSX Gun controller converter
	[2] CSR USB Bluetooth Device

PR:	kern/60378	[1]
Submitted by:	Samuel Tardieu <sam@rfc1149.net>	[1]
		<jps@scxnet.de>				[2]
2004-01-03 23:04:31 +00:00
Alan Cox
e793b7797d Reduce the scope of Giant in swap_pager_alloc(). 2004-01-03 20:02:17 +00:00
Warner Losh
e342346255 Define KERNBUILDDIR again. The RELENG_5_2 tree is stable enough that
we can turn this back on to start to resolve the issues with the
release process.

Approved by: scottl
2004-01-03 19:03:28 +00:00
Poul-Henning Kamp
c991bedb18 Hook the CPU_GEODE option up.
This option is mandatory on platforms like the Soekris 4801 because the
i8254 hardware is buggy.
2004-01-03 18:43:37 +00:00
MIHIRA Sanpei Yoshiro
6ce0b433a1 Add support Sony CLIE PEG-S500C(Palm OS 3.5)
Submitted by:	Hiroaki Satoh <hsato@iwate-u.ac.jp> [FreeBSD-users-jp 76073]
2004-01-03 15:30:11 +00:00
MIHIRA Sanpei Yoshiro
d9494ca3c1 Sync to 1.152 of usbdevs 2004-01-03 15:03:09 +00:00
MIHIRA Sanpei Yoshiro
31b073a02e Add support SUN TYPE 6 USB KEYBOARD
Submitted by:	<schley@cf-wnd.de>
2004-01-03 15:01:04 +00:00
MIHIRA Sanpei Yoshiro
b124b5e8b3 Fix Scanlogic SL11R usb-ide protocol and quirks
PR:		kern/60389
Submitted by:	Sang Woo Shim <ssw@swoo.org>
2004-01-03 13:52:44 +00:00
MIHIRA Sanpei Yoshiro
7cb5c8a6cb Add the MMC commands to umass_atapi_transform. It seems to work
unmodified for ATAPI type devices with ports/sysutils/cdrtools.
(But we need timeout routine which was in kern/58649 for fixate, I think.)

PR:		kern/58649
Submitted by:	SAKIYAMA Nobuo <sakichan@sakichan.org>
2004-01-03 13:30:19 +00:00
Bill Paul
3f4ea6aea4 In if_ndis.c:ndis_attach(), temporarily set the IFF_UP flag while
calling the haltfunc. If an interrupt is triggered by the init
or halt func, the IFF_UP flag must be set in order for us to be able
to service it.

In kern_ndis.c: implement a handler for NdisMSendResourcesAvailable()
(currently does nothing since we don't really need it).

In subr_ndis.c:
	- Correct ndis_init_string() and ndis_unicode_to_ansi(),
	  which were both horribly broken.
        - Implement NdisImmediateReadPciSlotInformation() and
	  NdisImmediateWritePciSlotInformation().
	- Implement NdisBufferLength().
	- Work around my first confirmed NDIS driver bug.
	  The SMC 9462 gigE driver (natsemi 83820-based copper)
	  incorrectly creates a spinlock in its DriverEntry()
	  routine and then destroys it in its MiniportHalt()
	  handler. This is wrong: spinlocks should be created
	  in MiniportInit(). In a Windows environment, this is
	  often not a problem because DriverEntry()/MiniportInit()
	  are called once when the system boots and MiniportHalt()
	  or the shutdown handler is called when the system halts.

With this stuff in place, this driver now seems to work:

ndis0: <SMC EZ Card 1000> port 0xe000-0xe0ff mem 0xda000000-0xda000fff irq 10 at device 9.0 on pci0
ndis0: assign PCI resources...
ndis_open_file("FLASH9.hex", 18446744073709551615)
ndis0: Ethernet address: 00:04:e2:0e:d3:f0
2004-01-03 13:20:30 +00:00
MIHIRA Sanpei Yoshiro
7e277e1fcb Sync to 1.151 of usbdevs 2004-01-03 12:54:04 +00:00
MIHIRA Sanpei Yoshiro
bab0ca7f3a Add support
- Canon USB Scanner N676U	[1]
	- Canon USB Scanner N1220U	[2]

PR:		misc/40280		[1]

Submitted by:	[1] Yasue Koichi / StarRing <starring@fscn.ne.jp>
		[2] MIYAO Akio <miyao@affrc.go.jp> [FreeBSD-users-jp 74516]
2004-01-03 12:51:59 +00:00
Bill Paul
6fc4b10f58 subr_hal.c: implement WRITE_PORT_BUFFER_xxx() and READ_PORT_BUFFER_xxx()
subr_ndis.c: implement NdisDprAllocatePacket() and NdisDprFreePacket()
(which are aliased to NdisAllocatePacket() and NdisFreePacket()), and
bump the value we return in ndis_mapreg_cnt() to something ridiculously
large, since some drivers apparently expect to be able to allocate
way more than just 64.

These changes allow the Level 1 1000baseSX driver to work for
the following card:

ndis0: <SMC TigerCard 1000 Adapter> port 0xe000-0xe0ff mem 0xda004000-0xda0043ff irq 10 at device 9.0 on pci0
ndis0: Ethernet address: 00:e0:29:6f:cc:04

This is already supported by the lge(4) driver, but I decided
to take a try at making the Windows driver that came with it work too,
since I still had the floppy diskette for it lying around.
2004-01-03 09:20:48 +00:00
Sam Leffler
5016de40e1 backout the switch to use a zone for vlan tags; this requires
vlans be present if any driver with h/w vlan tagging is configured
2004-01-03 03:33:39 +00:00
Bill Paul
0a9e1a08a1 Tweak ndiscvt to support yet another flavor of .INF files (look for
the NTx86 section decoration).

subr_ndis.c: correct the behavior of ndis_query_resources(): if the
caller doesn't provide enough space to return the resources, tell it
how much it needs to provide and return an error.

subr_hal.c & subr_ntoskrnl.c: implement/stub a bunch of new routines;

ntoskrnl:

KefAcquireSpinLockAtDpcLevel
KefReleaseSpinLockFromDpcLevel
MmMapLockedPages
InterlockedDecrement
InterlockedIncrement
IoFreeMdl
KeInitializeSpinLock

HAL:

KfReleaseSpinLock
KeGetCurrentIrql
KfAcquireSpinLock

Lastly, correct spelling of "_aullshr" in the ntoskrnl functable.
2004-01-03 02:25:21 +00:00
David Xu
a30ec4b99c Make sigaltstack as per-threaded, because per-process sigaltstack state
is useless for threaded programs, multiple threads can not share same
stack.
The alternative signal stack is private for thread, no lock is needed,
the orignal P_ALTSTACK is now moved into td_pflags and renamed to
TDP_ALTSTACK.
For single thread or Linux clone() based threaded program, there is no
semantic changed, because those programs only have one kernel thread
in every process.

Reviewed by: deischen, dfr
2004-01-03 02:02:26 +00:00
Nate Lawson
16844a97c8 Delete the region we are passed if that is the requested operation.
This should fix the problem with removing an address space handler
although we don't currently use that capability so it's unlikely anyone
saw this problem.
2004-01-03 02:01:39 +00:00
Tim J. Robbins
00fff2c71a Pass ACL, extended attribute and MAC vnode ops down the vnode stack. 2004-01-03 00:36:46 +00:00
Tim J. Robbins
190b2c4f8a Add support for SMB request signing, which prevents "man in the middle"
attacks and is required to connect to Windows 2003 servers in their
default configuration. This adds an extra field to the SMB header
containing the truncated 64-bit MD5 digest of a key (a function of the
user's password and the server's authentication challenge), an implicit
sequence number, and the message data itself. As signing each message
imposes a significant performance penalty, we only enable it if the
server will not let us connect without it; this should eventually become
an option to mount_smbfs.
2004-01-02 22:38:42 +00:00
Alan Cox
d0058957b5 Revision 1.74 of vm_meter.c ("Avoid lock-order reversal") makes the release
and subsequent reacquisition of the same vm object lock in
vm_object_collapse() unnecessary.
2004-01-02 19:57:45 +00:00
Alan Cox
e0ba75dd78 Avoid lock-order reversal between the vm object list mutex and the vm
object mutex.
2004-01-02 19:38:25 +00:00
Alan Cox
277b62040d Lock the traversal of the vm object list. Use TAILQ_FOREACH consistently. 2004-01-02 19:29:31 +00:00
Poul-Henning Kamp
49e9fc0a0d Improve on POLA by populating DEVFS before doing devfs(8) rule ioctls.
PR:	60687
Spotted by:	Colin Percival <cperciva@daemonology.net>
2004-01-02 19:02:28 +00:00
Nate Lawson
44bb5f52d3 Move the kernel power change printf under bootverbose since the
power_profile script now duplicates the message via syslog.
2004-01-02 18:24:13 +00:00
Sam Leffler
dfffd5d472 switch vlan packet tag allocation to use a private zone 2004-01-02 17:31:51 +00:00
Sam Leffler
4f9f9cf3a4 m_tag fixups in preparation for heavier use:
o promote several m_tag_* routines to inline
o add an m_tag_setup inline to set the fixed fields in a packet tag
o add an m_tag_free method pointer to each mtag to support, for example,
  allocating tags from zones
o have m_tag_find check if the tag list is not empty before calling
  m_tag_locate to search

Reviewed by:	brooks, silence from others
2004-01-02 17:27:39 +00:00
Bill Paul
a06598ec58 Fix detection of RealTek 8129 PCI cards. Apparently, these cards
report a hardware rev of 0x00000000. Sadly, the 8169 gigE MAC
also reports 0x00000000, so testing against this for exclusion
results in both cards being skipped by rl_probe(). Make the 8169
test more specific by matching against both the hwrev and the PCI
ID for this chip.

PR: kern/60824
2004-01-02 17:22:12 +00:00
David E. O'Brien
2affa9f7b1 Don't confuse NULL with 0. 2004-01-02 10:46:38 +00:00
Warner Losh
65a690ef74 It appears that we don't need sys/vnode.h, which is a layering violation... 2004-01-02 05:16:01 +00:00
Bill Paul
f07cc658a4 Clean up ndiscvt a bit (leaving out the -i flag didn't work) and add
copyrights to the inf parser files.

Add a -n flag to ndiscvt to allow the user to override the default
device name of NDIS devices. Instead of "ndis0, ndis1, etc..."
you can have "foo0, foo1, etc..." This allows you to have more than
one kind of NDIS device in the kernel at the same time.

Convert from printf() to device_printf() in if_ndis.c, kern_ndis.c
and subr_ndis.c.

Create UMA zones for ndis_packet and ndis_buffer structs allocated
on transmit. The zones are created and destroyed in the modevent
handler in kern_ndis.c.

printf() and UMA changes submitted by green@freebsd.org
2004-01-02 04:31:06 +00:00
Nate Lawson
0906e0c58f Use <machine/asmacros.h> since <machine/asm.h> is a userland-only header
and gives very wrong macros for ENTRY(), etc. for kernel programs.

PR:
Suggested by:	bde
Reviewed by:
Approved by:
Obtained from:
MFC after:
2004-01-01 22:57:22 +00:00
Alan Cox
ff5dcf2546 - Increase the scope of the kmem_object's lock in kmem_malloc(). Add a
comment explaining why a further increase is not possible.
2004-01-01 19:48:56 +00:00
Martin Blapp
aa8689ef95 The reset_type should not be 0x80, it should be set to zero.
0x80 can cause the command to be rejected as invalid. This bug
exists also in the Linux IPS ffdc code.

Submitted by:	David Jeffery
MFC after:	1 week
2004-01-01 10:22:10 +00:00
Alan Cox
f79f3abcbf - Use pagezero() instead of bzero() in pmap_pinit(). (pagezero() is much
faster.)
MFi386:
 - Don't bother clearing PG_ZERO on the page table page in
   _pmap_allocpte(); it serves no purpose.
 - Don't bother clearing and setting PG_BUSY on page table directory pages.
2004-01-01 07:08:52 +00:00
Warner Losh
fa37a995f2 Happy 2004!
I know this is a little early for the US, but it isn't for Japan :-).
This year I thought I'd bump the copyright odometer when it was new
years there.
2003-12-31 22:27:51 +00:00
Nate Lawson
3fb343ac12 Use the appropriate values for the notifies. No change in behavior
since both notifies result in the same function being called.

Found by:	documenting the code
2003-12-31 19:11:19 +00:00