Commit Graph

58112 Commits

Author SHA1 Message Date
John Baldwin
9be0993cdb Add device-id for the Neteasy DRP-32TXD cardbus 10/100 card. It's another
ADMTek AN985 clone.

MFC after:	3 days
Tested by:	Lila liladude at aruba dot it
2006-03-16 20:00:39 +00:00
Maksim Yevmenkin
a9e17e2e05 Add kqueue(2) support on if_tap(4) interfaces. While I'm here, replace
K&R style function declarations with ANSI style. Also fix endian bugs
accessing ioctl arguments that are passed by value.

PR:		kern/93897
Submitted by:	Vilmos Nebehaj < vili at huwico dot hu >
MFC after:	1 week
2006-03-16 18:22:01 +00:00
Joseph Koshy
9d0a2685e4 When compiled with -DDEBUG, only print the old value of a PMC in a
debugging message if the flag PMC_F_OLDVALUE was specified in the
PMC_OP_RW request being acted upon.  This should fix Coverity bug
CID 671.

Found by:	Coverity Prevent
MFC after:	3 weeks
2006-03-16 16:32:56 +00:00
Ruslan Ermilov
d1e9def254 NO_MAN is not needed here. 2006-03-16 15:18:17 +00:00
Poul-Henning Kamp
cc548bd9fb Remove nested includes of <sys/_lock.h> and <sys/_mutex.h> which spill into
userland.  The comment indicated that something in userland needed them, but
make universe can't seem to find any traces of it.

Move <sys/queue.h> include up.
2006-03-16 11:19:36 +00:00
Alan Cox
41634e2e8d Correct two vm object reference leaks in error cases.
Submitted by: davidxu
2006-03-16 08:51:59 +00:00
Ariff Abdullah
945510a039 Restore CHN_F_BUSY flag which was removed accidentally in previous commit. 2006-03-16 08:01:10 +00:00
Robert Watson
92c07a345e Change soabort() from returning int to returning void, since all
consumers ignore the return value, soabort() is required to succeed,
and protocols produce errors here to report multiple freeing of the
pcb, which we hope to eliminate.
2006-03-16 07:03:14 +00:00
Ariff Abdullah
7982e7a465 Fix severe 8bit integer overflow during channel creation and destruction,
especially for vchans. It turns out that channel numbering always depend
on d->devcount counter (which keep increasing), while PCMMKMINOR() truncate
everything to 8bit length. At some point the truncation cause the newly
created character device overlapped with the existence one, causing erratic
overall system behaviour and panic. Easily reproduce with something like:

	(Luckily, only root can reproduce this)

	while : ; do
		sysctl hw.snd.pcm0.vchans=200
		sysctl hw.snd.pcm0.vchans=100
	done

- Enforce channel/chardev numbering within 8bit boundary. Return E2BIG
  if necessary.
- Traverse d->channels SLIST and try to reclaim "free" counter during channel
  creation. Don't rely on d->devcount at all.
- Destroy vchans in reverse order.

Anyway, this is not the fault of vchans. It is just that vchans are so cute
and begging to be abused ;) . Don't blame her.

Old, hidden bugs.. sigh..

MFC after:	3 days
2006-03-16 04:12:49 +00:00
David Xu
795a11d049 Fix a race between file operations and rfork(RFCFDG) by parking
all other threads at user boundary, the race can crash kernel
under stress testing.

Reviewed by: jhb
MFC after: 3 days
2006-03-15 23:24:14 +00:00
Sam Leffler
83a244dbe0 when doing s/w crypto make sure work is done w/ a writable mbuf chain;
this corrects problems with drivers that rely on the host to do
crypto (iwi, ipw, ral, ural, wi (hostap), awi)

Hard work by:	luigi, mlaier
Reviewed by:	luigi, mlaier
MFC after:	1 week
2006-03-15 21:27:08 +00:00
Sam Leffler
47e2996e8b promote fast ipsec's m_clone routine for public use; it is renamed
m_unshare and the caller can now control how mbufs are allocated

Reviewed by:	andre, luigi, mlaier
MFC after:	1 week
2006-03-15 21:11:11 +00:00
Damien Bergamini
b4c31113a1 build ipw(4) and iwi(4) modules on i386 and amd64 only. 2006-03-15 20:58:44 +00:00
Robert Watson
a5c0b80e37 Back out accidentally committed protosw.h:1.49. One of those days. It
will be recommitted with the remainder of the change in the next day or
two.

Submitted by:	thompsa
2006-03-15 20:41:15 +00:00
Poul-Henning Kamp
590487078f Disable the "cputick increased..." message now that the dust has settled. 2006-03-15 20:22:32 +00:00
Andre Oppermann
b1955eecdd Add definitions for MD5_BLOCK_LENGTH, MD5_DIGEST_LENGTH and
MD5_DIGEST_STRING_LENGTH.

MFC after:	3 days
2006-03-15 19:47:12 +00:00
Andre Oppermann
e4bd8f103e Add link status descriptions and related structures for userland
applications.

Open[BGP|OSPF]D make use of this to determine the link status of
interfaces to make the right routing descisions.

Obtained from:	OpenBSD
MFC after:	3 days
2006-03-15 19:43:25 +00:00
Andre Oppermann
22cafcf0b8 - Fill in the correct rtm_index for RTM_ADD and RTM_CHANGE messages.
- Allow RTM_CHANGE to change a number of route flags as specified by
  RTF_FMASK.

- The unused rtm_use field in struct rt_msghdr is redesignated as
  rtm_fmask field to communicate route flag changes in RTM_CHANGE
  messages from userland.  The use count of a route was moved to
  rtm_rmx a long time ago.  For source code compatibility reasons
  a define of rtm_use to rtm_fmask is provided.

These changes faciliate running of multiple cooperating routing
daemons at the same time without causing undesired interference.
Open[BGP|OSPF]D make use of these features to have IGP routes
override EGP ones.

Obtained from:	OpenBSD (claudio@)
MFC after:	3 days
2006-03-15 19:39:09 +00:00
Alexander Leidinger
a8f47039c7 Fix memory leak introduced in previous revision.
Discussed with:	phk
2006-03-15 19:23:08 +00:00
Robert Watson
cf4f9f6d81 Correct spelling of 0x4000 in previous commit. This one line change from
a 42k patch seemed easier to retype than apply, but apparently not. :-)

Submitted by:	pjd
2006-03-15 19:02:43 +00:00
Gleb Smirnoff
df7e759cc0 Free private data when deleting hook.
PR:		kern/93952
Submitted by:	Antoine Brodin <antoine.brodin laposte.net>
2006-03-15 15:41:36 +00:00
Robert Watson
93709ad0be As with socket consumer references (so_count), make sofree() return
without GC'ing the socket if a strong protocol reference to the socket
is present (SS_PROTOREF).
2006-03-15 12:45:35 +00:00
Robert Watson
5d511d26c3 Add SS_PROTOREF socket flag, which represents a strong reference by the
protocol to the socket.  Normally protocol references are weak: that is,
the socket layer can tear down the socket (and hence protocol state)
when it finds convenient.  This flag will allow the protocol to
explicitly declare to the socket layer that it is maintaining a
strong reference, rather than the current implicit model associated
with so_pcb pointer values and repeated attempts to possibly free the
socket.
2006-03-15 12:30:06 +00:00
Robert Watson
eca7e73743 Add a_fdidx to comment prototype for fifo_open().
MFC after:	3 days
Submitted by:	Kostik Belousov <kostikbel at gmail dot com>
2006-03-15 10:15:35 +00:00
Takanori Watanabe
3e7c5fe5b9 Add ALPS glide point ID and some compatibility IDs.
PR: kern/75008
2006-03-15 07:04:33 +00:00
Sam Leffler
d66735216f add ath_hal glue
MFC after:	3 days
2006-03-14 22:40:44 +00:00
Robert Watson
945a519a23 If fifo_open() is called with a negative file descriptor, return EINVAL
rather than panicking later.  This can occur if the kernel calls
vn_open() on a fifo, as there will be no associated file descriptor,
and therefore the file descriptor operations cannot be modified to
point to the fifo operation set.

MFC after:	3 days
Reported by:	Martin <nakal at nurfuerspam dot de>
PR:		94278
2006-03-14 19:29:45 +00:00
Jung-uk Kim
07b4d1cc39 Export SMBIOS serial numbers by default. To turn it off, use
'BOOT_HIDE_SERIAL_NUMBERS' knob.

Suggested by:	ceri
2006-03-14 19:02:00 +00:00
John Baldwin
39092e79ed Don't allow userland to set hardware watch points on kernel memory at all.
Previously, we tried to allow this only for root.  However, we were calling
suser() on the *target* process rather than the current process.  This
means that if you can ptrace() a process running as root you can set a
hardware watch point in the kernel.  In practice I think you probably have
to be root in order to pass the p_candebug() checks in ptrace() to attach
to a process running as root anyway.  Rather than fix the suser(), I just
axed the entire idea, as I can't think of any good reason _at all_ for
userland to set hardware watch points for KVM.

MFC after:	3 days
Also thinks hardware watch points on KVM from userland are bad:	bde, rwatson
2006-03-14 16:13:55 +00:00
David Xu
e170bfda56 1. Count last time slice, this intends to fix
"calcru: runtime went backwards" bug for threaded process.
2. Add comment about possible logical problem with scheduler.

MFC after: 3 days
2006-03-14 04:00:21 +00:00
John-Mark Gurney
45e0d0aa30 spell pdata correctly, we now will only dump maxlen of each mbuf in the
chain, instead of the entire mbuf...  This should probably be reworked
so that it prints at max maxlen bytes for the entire chain...
2006-03-14 00:22:10 +00:00
Peter Wemm
8d0593f54e Merge/sync with i386: various cosmetic tweaks 2006-03-14 00:01:56 +00:00
Peter Wemm
cfa7ffb1d7 MFi386: The SIGFPE macros were moved to signal.h (FPE_INTOVF etc) 2006-03-14 00:01:22 +00:00
Peter Wemm
31b2d08a2d MFi386: rename pcib_devclass to hostb_devclass (cosmetic here) 2006-03-13 23:58:40 +00:00
Peter Wemm
c8df689359 MFi386: add a TRAP_INTERRUPT case 2006-03-13 23:56:44 +00:00
Peter Wemm
29e9282e2e Cosmetic sync with i386 2006-03-13 23:55:31 +00:00
Joerg Wunsch
f7d5a5328f When encountering a ISO_SUSP_CFLAG_ROOT element in Rock Ridge
processing, this actually means there's a double slash recorded in the
symbolic link's path name.  We used to start over from / then, which
caused link targets like ../../bsdi.1.0/include//pathnames.h to be
interpreted as /pathnahes.h.  This is both contradictionary to our
conventional slash interpretation, as well as potentially dangerous.

The right thing to do is (obviously) to just ignore that element.

bde once pointed out that mistake when he noticed it on the
4.4BSD-Lite2 CD-ROM, and asked me for help.

Reviewed by:	bde (about half a year ago)
MFC after:	3 days
2006-03-13 22:32:33 +00:00
Joerg Wunsch
0f9f3dd16b Add the TOSHIBA TransMemory USB sticks to the list of devices that
hate "Synchronize cache" commands.

MFC after:	1 day
2006-03-13 22:26:33 +00:00
Damien Bergamini
f3268efa7f Don't read channel list from EEPROM since we were already scanning all
802.11b channels (1-14) regardless of what EEPROM says.
2006-03-13 20:05:32 +00:00
Ruslan Ermilov
ad5722357f Fix a typo. 2006-03-13 14:59:57 +00:00
Ruslan Ermilov
936ddefcd6 The mount(8) manpage says: "In case of conflicting options being
specified, the rightmost option takes effect."  Fix code to obey
this.  This makes e.g. "mount -r /usr" or "mount -ar" actually
mount file systems read-only.
2006-03-13 14:58:37 +00:00
Ruslan Ermilov
ef25813de6 Fix build on 64-bit platforms. 2006-03-13 14:48:45 +00:00
Søren Schmidt
0118b48b7e Add support for the JMicron JMB361, 365 and 366 chips.
HW and documentation kindly provided by JMicron.
2006-03-13 14:01:37 +00:00
Søren Schmidt
124902face Put autosense data in the right place (needs a 4pos left shift). 2006-03-13 14:00:08 +00:00
David Xu
28e989e9ca Remove unused code. 2006-03-13 10:37:25 +00:00
Paul Saab
12aff6461c Fix the format/display descriptor of vm.kmem_size and vm.kmem_free
to be 'long' instead of 'int' so that sysctl(8) correctly displays
the 8 returned bytes as a single 'long' instead of two 'int' values.

Submitted by:	peter
2006-03-13 08:13:37 +00:00
Ruslan Ermilov
7e18aa79f8 Quote ${CC} when passing it in environment.
Submitted by:	bde
2006-03-13 06:38:22 +00:00
Pawel Jakub Dawidek
3650be51e2 - Reimplement I/O data allocation to prevent deadlocks.
Submitted by:	green

- Speed up synchronization process by using configurable number of I/O
  requests in parallel.
  + Add kern.geom.raid3.sync_requests tunable which defines how many parallel
    I/O requests should be used.
  + Retire kern.geom.raid3.reqs_per_sync and kern.geom.raid3.syncs_per_sec
    sysctls.
- Fix race between regular and synchronization requests.
- Reimplement raid3's data synchronization - do not use the topology lock
  for this purpose, as it may case deadlocks.
- Stop synchronization from pre-sync hook.
- Fix some other minor issues.

Tested by:	Mike Tancsa <mike@sentex.net>
MFC after:	3 days
2006-03-13 01:03:18 +00:00
Pawel Jakub Dawidek
855761d5db - Speed up synchronization process by using configurable number of I/O
requests in parallel.
  + Add kern.geom.mirror.sync_requests tunable which defines how many parallel
    I/O requests should be used.
  + Retire kern.geom.mirror.reqs_per_sync and kern.geom.mirror.syncs_per_sec
    sysctls.
- Fix race between regular and synchronization requests.
- Reimplement mirror's data synchronization - do not use the topology lock
  for this purpose, as it may case deadlocks.
- Stop synchronization from pre-sync hook.
- Fix some other minor issues.

MFC after:	3 days
2006-03-13 00:58:41 +00:00
Daniel Eischen
51f38c318b Add macros for generating symbol version assembler opcodes. 2006-03-13 00:49:28 +00:00