Commit Graph

57478 Commits

Author SHA1 Message Date
Florent Thoumie
fa9d414d41 Add Product IDs :
- Sandisk Cruzer Micro 128MB [5]
- DANE-ELEC zMate 512MB USB flash drive [7]
- Attache 256MB USB 2.0 Flash Drive [8]
- Sandisk Cruzer Micro 256MB [9]

Add scsi_da.c quirks :
- Samsung USB key 128Mb [1]
- Kingston DataTraveler 2.0 [2]
- Creative MuVo Slim [3]
- United MP 5512 Portable MP3 Player [4]
- Sandisk Cruzer Micro 128MB [5], [9]
- PNY USB Flash keys [6], [7], [8]

Add umass.c quirks :
- Sandisk Cruzer Micro 128MB [5]
- DANE-ELEC zMate 512MB USB flash drive [7]
- Attache 256MB USB 2.0 Flash Drive [8]
- Sandisk Cruzer Micro 256MB [9]

PR:		usb/90081 [1],
		usb/89196 [2],
		kern/86131 [3],
		usb/80487 [4],
		usb/75970 [5],
		usb/75578 [6],
		usb/72344 [7],
		usb/65436 [8],
		usb/70835 [9]
Submitted by:	Henri-Pierre CHARLES <hpc@prism.uvsq.fr> [1],
		Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua> [2],
		Erich Rickheit KSC <rickheit-fbp@numachi.com> [3],
		tnu@chania.di.uoa.gr [4],
		Bram Abbekerk <bram@abbekerk.demon.nl> [5],
		Thomas Pornin <pornin@bolet.org> [6],
		parv <parv@pair.com> [7],
		Peter D. Quilty <pdquilty@adelphia.net> [8],
		Raymundo M. Vega <rvega@ms-smtp-03-eri0.socal.rr.com> [9]
Approved by:	iedowse
MFC after:	3 days
2006-01-26 00:35:54 +00:00
Søren Schmidt
797c12eed9 Add support for the JMicron JMB360 SATAII controller.
Thanks to JMicron for providing needed info.

HW donated by:	Ralf Folkerts
2006-01-25 23:07:42 +00:00
Joel Dahl
da8623eca0 Fix typos and clean up some comments.
Approved by:	ariff
2006-01-25 21:13:46 +00:00
Doug Ambrisko
ccaf930cfd Tie the amr_linux module into the build for i386 & amd64 2006-01-25 18:11:59 +00:00
John Baldwin
6b81555744 Axe KTR_ALQ_MASK now that KTR_WITNESS is off unless you hack an #ifdef
in subr_witness.c.  I did add a comment in subr_witness.c noting that
KTR_WITNESS is incompatible with KTR_ALQ.
2006-01-25 14:57:23 +00:00
John Baldwin
98355c9451 The UPCI 32 rp(4) card uses BAR 2 like the UPCI 80 card.
Submitted by:	Vitaliy Skakun vit dot ska at gmail dot com
MFC after:	3 days
2006-01-25 14:55:11 +00:00
Colin Percival
02d4ab93fb Make sure buffers in if_bridge are fully initialized before copying
them to userland.

Security:	FreeBSD-SA-06:06.kmem
2006-01-25 10:00:40 +00:00
Jeff Roberson
df59a0fee7 - Avoid calling vm_object_backing_scan() when collapsing an object when
the resident page count matches the object size.  We know it fully backs
   its parent in this case.

Reviewed by:	acl, tegge
Sponsored by:	Isilon Systems, Inc.
2006-01-25 08:42:58 +00:00
Hajimu UMEMOTO
411babc618 don't embed scope id before running packet filters.
Reported by:	YAMAMOTO Takashi <yamt__at__mwd.biglobe.ne.jp>
Obtained from:	NetBSD
MFC after:	1 week
2006-01-25 08:17:02 +00:00
Alan Cox
0883c2d739 The previous revision incorrectly changed a switch statement into an if
statement.  Specifically, a break statement that previously broke out of
the enclosing switch was not changed.  Consequently, the enclosing loop
terminated prematurely.

This could result in "vm_page_insert: page already inserted" panics.

Submitted by: tegge
2006-01-25 06:45:57 +00:00
Stephan Uphoff
6807424d19 Back out changes made in rev. 1.151.
They were bogus.

Cluebat applied by: jhb@
2006-01-25 02:05:47 +00:00
Don Lewis
f4af687a3b Touch all the pages wired by sysctl_wire_old_buffer() to avoid PTE
modified bit emulation traps on Alpha while holding locks in the
sysctl handler.

A better solution would be to pass a hint to the Alpha pmap code to
tell mark these pages as modified when they as they are being wired,
but that appears to be more difficult to implement.

Suggested by: jhb
MFC after:	3 days
2006-01-25 01:03:34 +00:00
John Baldwin
67f7fe8c01 Whitespace fix. 2006-01-24 22:24:05 +00:00
John Baldwin
2b604e82b2 - Add a new KTR_SUBSYS in place of KTR_SPARE1 to serve as a subsystem
placeholder similar to KTR_DEV.  Explain the use of KTR_DEV and
  KTR_SUBSYS in a comment as well.
- Retire KTR_WITNESS and instead have KTR_WITNESS default to off but use
  KTR_SUBSYS if it is enabled.
2006-01-24 22:23:45 +00:00
Doug Ambrisko
084500bc13 Add in the Linux IOCTL shim and create the megadev0 device so
Linux LSI MegaRaid tools can run on FreeBSD until Linux emulation.

Add in the Linux IOCTL shim and create the megadev0 device so
Linux LSI MegaRaid tools can run on FreeBSD until Linux emulation.

Add glue to build the modules but don't tie it into the build
yet until I test it from the CVS repo. via the mirror on an
amd64 machine.

Tie this into the Linux32 emulation on amd64 so the tools can
run on amd64 kernel.

Cleaned up by:	ps (amr_linux.c)
2006-01-24 21:13:50 +00:00
Alan Cox
39fd9b639f With the recent changes to the implementation of page coloring, the
the option PQ_NOOPT is used exclusively by vm_pageq.c.  Thus, the
include of opt_vmpage.h can be removed from vm_page.h.
2006-01-24 19:24:54 +00:00
Andre Oppermann
ab48768b20 When doing IP forwarding with [FAST_]IPSEC compiled into the kernel
ip_forward() would report back a zero MTU in ICMP needfrag messages
because on a IPSEC SP lookup failure no MTU got computed.

Fix this by changing the logic to compute a new MTU in any case if
IPSEC didn't do it.

Change MTU computation logic to use egress interface MTU if available
or the next smaller MTU compared to the current packet size instead
of falling back to a very small fixed MTU.

Fix associated comment.

PR:		kern/91412
MFC after:	3 days
2006-01-24 17:57:19 +00:00
Andre Oppermann
1dec73a153 In ip_mdq() compute the TV_DELTA the correct way around.
PR:		kern/91851
Submitted by:	SAKAI Hiroaki <sakai.hiroaki-at-jp.fujitsu.com>
MFC after:	3 days
2006-01-24 17:09:12 +00:00
Andre Oppermann
31343a3da2 In in_control() remove the temporary in_ifaddr structure from the
ia_hash only if it actually is an AF_INET address.  All other places
test for sa_family == AF_INET but this one.

PR:		kern/92091
Submitted by:	Seth Kingsley <sethk-at-meowfishies.com>
MFC after:	3 days
2006-01-24 16:19:31 +00:00
Oleg Bulyzhin
44a515834f Fix minor bug in uRPF:
If net.link.ether.inet.useloopback=1 and we send broadcast packet using our
  own source ip address it may be rejected by uRPF rules.

  Same bug was fixed for IPv6 in rev. 1.115 by suz.

PR:		kern/76971
Approved by:	glebius (mentor)
MFC after:	3 days
2006-01-24 13:38:06 +00:00
Søren Schmidt
634c377652 Do not test for DMA status on legacy ATA devices. This has the unfortunate
side effect that legacy ATA controllers at irq14 and irq15 cannot share
interrupts with anything else without major problems.
This fixes the ATAPI DMA problems some systems/devices have seen.
2006-01-24 12:34:56 +00:00
Gleb Smirnoff
0b4ae859ac Implement 'ipfw fwd laddr,port' feature for UDP. According to ipfw(8)
it should work, however it never did. People expect it to work.

PR:		kern/90834
2006-01-24 09:08:54 +00:00
David Xu
1aa4c324ee Add locking annotation and comments about socket, pipe, fifo problem.
Temporarily fix a locking problem for socket I/O.
2006-01-24 07:24:24 +00:00
Alan Cox
fc3c1bc471 In vm_page_set_invalid() invalidate all of the page's mappings as soon as
any part of the page's contents is invalidated.

Submitted by: tegge
2006-01-24 07:21:38 +00:00
David Xu
e6bdc05ff7 Er, rescure a deleted comment line. 2006-01-24 02:50:42 +00:00
David Xu
bd793be3c6 More cleanup for aio code:
1) unregsiter kqueue filter for EVFILT_LIO.
2) free uma_zones.
3) call setsid directly to enter another session rather than
   implementing by itself.

Submitted by: jhb
2006-01-24 02:46:15 +00:00
Ariff Abdullah
14665331ab channel.c:
(1) Fix DMA alignment, based on bytes per sample.

feeder_rate.c:
	Handle strayed bytes (mostly caused by #1) better.

This DMA alignment issues are extremely hard to reproduce unless
the user happen to have a 32bit capable soundcards (ATI IXP) and
knowledgeable enough to force it to operate under pure 32bit
operations on both record and play directions.
2006-01-24 01:10:07 +00:00
David Xu
7f34b521c7 Add bracket. 2006-01-23 23:46:30 +00:00
John Baldwin
704c9f00fb Fix a vnode reference leak in the ktrace code. We always grab a reference
to the vnode at the start of ktr_writerequest() but were missing the
corresponding vrele() after we finished the write operation.

Reported by:	jasone
2006-01-23 21:45:32 +00:00
Tom Rhodes
129518ec2c Revert my previous commit.
Proved I'm not that bright at times:	jhb
2006-01-23 21:06:22 +00:00
Sam Leffler
e99662a623 s/w beacon miss facility; need to add knobs to fiddle with the settings
MFC after:	2 weeks
2006-01-23 21:02:49 +00:00
Sam Leffler
b99190971f track bmiss threshold change from time to frame count 2006-01-23 20:58:05 +00:00
Sam Leffler
233e00212e switch beacon miss threshold from a time to the number of beacon
frames; the time value was implicitly based on the beacon interval
but never being updated so wrong when the negotiated beacon interval
was not 100 TU
2006-01-23 20:57:30 +00:00
Gleb Smirnoff
1c0b0f523d Fix build. 2006-01-23 20:10:49 +00:00
Sam Leffler
336ec6a116 bounds check each ie's length when parsing
Obtained from:	madwifi
MFC after:	1 week
2006-01-23 19:31:00 +00:00
Stephan Uphoff
03001f59c8 Hopefully fix the "calcru: runtime went backwards from ..." problem by
keeping the resource values locked (where needed) while we use them
for calculations.

MFC after:	3 days
2006-01-23 19:15:13 +00:00
Tom Rhodes
9fc31f8a5f Update incorrect comments here, there should not be a call to panic()
over fs corruption.

Discussed with:	alfred, phk
2006-01-23 17:45:57 +00:00
Tom Rhodes
cb5c1ec725 Fix indentation.
Prodded by:	stefanf, ru, njl (in that order)
2006-01-23 17:41:43 +00:00
Andre Oppermann
06003a1e7c Simplify ip_next_mtu() and make its logic more easy to see while
silencing code analysis tools.

Found by:	Coverity Prevent(tm)
Coverity ID:	CID341
Sponsored by:	TCP/IP Optimization Fundraise 2005
2006-01-23 17:06:32 +00:00
Gleb Smirnoff
c3a5675226 Use m_getcl() instead of getting mbuf, and then getting a cluster. 2006-01-23 15:57:02 +00:00
Andre Oppermann
fd2413398c In mb_zinit_pack() explicitly ignore the return value of uma_zalloc_arg().
The success of the cluster allocation is checked through a field in the
mbuf structure.  This change is non-functional but properly silences code
inspection tools.

Found by:	Coverity Prevent(tm)
Coverity ID:	CID807
Sponsored by:	TCP/IP Optimization Fundraise 2005
2006-01-23 15:49:01 +00:00
Stephan Uphoff
3753c2c3f1 Fix race conditions.
Tested by:	kris@
MFC after:      3 days
2006-01-23 15:46:09 +00:00
Olivier Houchard
2eff8c6814 Donc recompute the io port address if it's already the good one. 2006-01-23 14:03:14 +00:00
Joel Dahl
ae75448fcd Sort list of modules.
Approved by:	ariff
2006-01-23 11:58:01 +00:00
Yaroslav Tykhiy
83ec464f61 Be consistent in checking ifa->ifa_addr for NULL.
Found by:	Coverity Prevent (tm)
MFC after:	3 days
2006-01-23 10:30:34 +00:00
Gleb Smirnoff
205aefa363 Simplify ng_source_send() removing temporary queue and merging two
cycles into one.
2006-01-23 10:28:04 +00:00
David Xu
68d7111884 Verify all supported notification types. 2006-01-23 10:27:15 +00:00
Søren Schmidt
247c37e782 Update copyright header to match rest of ATA. 2006-01-23 08:49:50 +00:00
Matt Jacob
e526523707 First of several commits as this driver is dusted off and maybe brought
up to date.  Principle changes for this reelase is to support 2K Port Login
firmware. This allows us to support the 2322 (and 2422 4Gb) cards which only
come with the 2K Port Login firmware. The 2322 should now work- but we don't
have firmware sets for it in ispfw (as the change to load 2K Port Login f/w
hasn't been made- that f/w is so big it has to be loaded in more than one
chunk).

Other changes are the beginnings of cleaning up some long standing target
mode issues. The next changes here will incorporate a lot of bug fixes
from others.

Finally, some copyright cleanup and attempts to make the parts of the
driver that are FreeBSD specific start conforming more to FreeBSD style.

MFC after:	1 month
2006-01-23 06:23:37 +00:00
David Xu
a9bf5e37ae 1) Merge _aio_aqueue and aio_aqueue, check quota in aio_aqueue,
so that lio_listio won't exceed the quota.
2) Remove lio_ref_count, it is no longer used.
2006-01-23 02:49:34 +00:00
Alan Cox
bb53e2bf27 Remove an unnecessary call to pmap_remove_all(). The given page is not
mapped because its contents are invalid.

Reviewed by: tegge
2006-01-23 00:00:45 +00:00
Alan Cox
02dd83311a Make vm_object_vndeallocate() static. The external calls to it were
eliminated in ufs/ffs/ffs_vnops.c's revision 1.125.
2006-01-22 23:56:20 +00:00
Max Khon
710a9accfe Do not assume that `char direntry::deExtension[3]' starts right after
`char direntry::deName[8]' and access deExtension[] explicitly.

Found by:	Coverity Prevent(tm)
CID:		350, 351, 352
2006-01-22 21:09:38 +00:00
Don Lewis
1dd5fc0fde Tweak previous vfs_lookup.c commit to return an EINVAL error from
lookup() instead of EPERM when a DELETE or RENAME operation is
attempted on "..".

In kern_unlink(), remap EINVAL errors returned from namei() to EPERM
to match existing (and POSIX required) behaviour.

Discussed with:	bde
MFC after:	3 days
2006-01-22 19:37:02 +00:00
Max Khon
3795fc308f Rename geom_uzip class to g_uzip in order to be consistent with the naming
of other GEOM modules.

PR:		89998
2006-01-22 15:35:14 +00:00
Ariff Abdullah
d9bd844573 Various fixups:
feeder.h:
 feeder.c:
	- Implement scoring mechanisme to select best format for conversion.
	  This is actually part of newer format chaining procedures which
	  will be commited someday. Confusion during chaining process solved
	  by this scoring since it will try to reduce list of from/to formats
	  to a single, best format.
	  Related PR:	kern/91683
channel.c:
	- Simplify feeder building process since we have smarter format
	  chaining.

feeder_fmt.c:
	- Add few more sign conversion feeders for 24 and 32 bit format.

feeder_rate.c:
	- Force buffer / bytes allignment. Unaligned buffer may cause
	  panics during recording on pure 32bit sample format if it
	  involves feeder_rate as part of feeders chain.
	  Tested on: ATI IXP, force 32bit recording.

MFC after:	5 days
2006-01-22 15:06:49 +00:00
David Xu
8c0d9af5bf Fix a bogus panic. 2006-01-22 09:39:59 +00:00
David Xu
9b84335c84 Decrease kaio_active_count first, because user process may go away
after we notified it.
2006-01-22 09:25:52 +00:00
David Xu
4ca4c9ee68 Regen. 2006-01-22 06:01:48 +00:00
David Xu
1ce9182407 Make aio code MP safe. 2006-01-22 05:59:27 +00:00
Robert Watson
9f8a02f168 Convert in6_cksum() to ANSI C function declaration.
MFC after:	1 week
2006-01-22 01:17:57 +00:00
Robert Watson
136d4f1cf2 Convert remaining functions to ANSI C function declarations; remove
'register' where present.

MFC after:	1 week
2006-01-22 01:16:25 +00:00
Robert Watson
d0c75d36b9 Convert last remaining function in ip_gre.c to ANSI C function
declaration.

MFC after:	1 week
2006-01-22 01:08:30 +00:00
Robert Watson
ed75546c77 Convert to ANSI C function declarations.
MFC after:	1 week
2006-01-22 01:07:11 +00:00
Maxime Henrion
b337232591 Fix a race condition by initializing the taskqueue before registering
the fast interrupt handler that uses it.  This fixes a panic at boot
time when em_intr_fast() calls taskqueue_enqueue().
2006-01-22 01:06:55 +00:00
Nate Lawson
a2b31c5b4f Add a devd(8) event that is sent after the system resumes. This can be
used by utilities to reset moused(8), for example.  The syntax is:

    !system=kern subsystem=power type=resume

Note that it would be nice to have notification of suspend, but it's more
difficult since there would have to be a method of doing request/ack
to userland and automatically timing out if no response.  apm(4) has a
similar mechanism.

MFC after:	2 weeks
2006-01-22 01:06:25 +00:00
Robert Watson
899cff457e Convert function declarations to ANSI C.
MFC after:	1 week
2006-01-22 01:04:05 +00:00
Robert Watson
b059cbd3eb Convert function declarations to ANSI C.
MFC after:	1 week
2006-01-22 00:46:40 +00:00
Robert Watson
c1250af683 Convert remaining functions to ANSI C function declarations.
MFC after:	1 week
2006-01-22 00:30:46 +00:00
Alan Cox
e5e6093ba9 Avoid a vm object reference leak in a rarely used code path.
An executable contains at most one PT_INTERP program header.  Therefore,
the loop that searches for it can terminate after it is found rather than
iterating over the entire set of program headers.

Eliminate an unneeded initialization.

Reviewed by: tegge
2006-01-21 20:11:49 +00:00
Robert Watson
291c88bd60 Convert to ANSI C function declarations.
MFC after:	1 week
2006-01-21 20:07:19 +00:00
Don Lewis
bea7a8d75c Return EPERM from lookup() if cn_nameiop is DELETE or RENAME and
the last component of the path name is "..".  This keeps VOP_LOOKUP()
from locking vnodes in reverse order.

Tested by:	Denis Shaposhnikov <dsh AT vlink DOT ru>
MFC after:	3 days
2006-01-21 19:57:56 +00:00
Robert Watson
04fe37f68e Convert iir inlines to ANSI C function declarations.
MFC after:	1 week
2006-01-21 19:56:19 +00:00
Robert Watson
0bdfeca765 Convert last four functions in coda_vnops.c to ANSI C function
declarations.  I knew I would get to fix something in Coda
eventually.

MFC after:	1 week
2006-01-21 19:51:47 +00:00
Robert Watson
6be2c41a22 Convert remaining functions in vfs_subr.c from K&R prototypes to ANSI C
prototypes, as the majority of new functions added have been in this
style.  Changing prototype style now results in gcc noticing that the
implementation of vn_pollrecord() has a 'short' argument instead of
'int' as prototyped in vnode.h, so correct that definition.  In practice
this didn't matter as only poll flags in the lower 16 bits are used.

MFC after:	1 week
2006-01-21 19:42:10 +00:00
Søren Schmidt
669367a9a1 Fix panic on boot due to not all SATA chipsets having SSTATUS registeri
resources set.
2006-01-21 17:38:10 +00:00
Alexander Leidinger
5f35685cc2 Backput the "Dell ID" part of the last commit, it was already tried in
the past but didn't worked.

Noticed by:	Gavin Atkinson <gavin.atkinson@ury.york.ac.uk>
2006-01-21 16:21:06 +00:00
Alexander Leidinger
30baa78df4 Merge rev. 1.5 and 1.6 from DFly:
- Add PCI identifier to match against a Dell OEM version of the SB Live!
 - Fix spurious warning about ANSI trigraphs

Obtained from:	DragonFlyBSD
2006-01-21 15:23:15 +00:00
Damien Bergamini
f014cff4cd account tx retry-fail errors in if_oerrors. 2006-01-21 12:46:57 +00:00
Marius Strobl
a5f92d5a54 Remove the commented out entry of the old ISA-only le(4) driver which
was retired 22 months ago.

MFC after:	1 day
2006-01-21 12:38:35 +00:00
Tom Rhodes
9c013503bb Remove some dead code.
Found with:     Coverity Prevent(tm)
2006-01-21 12:10:33 +00:00
Alexander Leidinger
a7571c3f6b Prevent dereferencing a NULL pointer if the malloc() fails.
CID:		219
Found with:	Coverity Prevent(tm)
2006-01-21 11:50:56 +00:00
Damien Bergamini
e97333cbc4 Adjust tx power based on user preferences. 2006-01-21 10:45:07 +00:00
Bjoern A. Zeeb
3f2e28fe9f Fix stack corruptions on amd64.
Vararg functions have a different calling convention than regular
functions on amd64. Casting a varag function to a regular one to
match the function pointer declaration will hide the varargs from
the caller and we will end up with an incorrectly setup stack.

Entirely remove the varargs from these functions and change the
functions to match the declaration of the function pointers.
Remove the now unnecessary casts.

Lots of explanations and help from:     peter
Reviewed by:                            peter
PR:                                     amd64/89261
MFC after:                              6 days
2006-01-21 10:44:34 +00:00
Damien Bergamini
25227ab8c5 o fix initialization sequence.
o re-enable ural_disable_rf_tune().
2006-01-21 10:25:51 +00:00
Gleb Smirnoff
78178cd132 Check for BGE_RXBDFLAG_IP_CSUM flag before marking mbuf as with valid
checksum. This fixes operation of PPPoE and other non-IP Ethernet
protocols.
2006-01-21 09:54:32 +00:00
Damien Bergamini
1749c2163b Add two new ural(4) product ids.
Obtained from:	OpenBSD
2006-01-21 09:53:11 +00:00
Damien Bergamini
86d55f61a5 sync w/ openbsd:
o fix contention window
o silently discard received frames that are too short
o simplify lookup of 802.11a channels (we know they exist)
o fix short preamble support
o add short slot support
o fix eifs settings
o many consistency tweaks
2006-01-21 09:37:51 +00:00
Joel Dahl
16451fc93a Remove unused pointer.
Approved by:	ariff
2006-01-21 09:05:13 +00:00
Damien Bergamini
beee67e182 Fix computation of the tx retry count in AMRR. 2006-01-21 08:58:03 +00:00
Gleb Smirnoff
7762e8c630 - Remove debugging printfs.
- Add some ktr(4) debugging.
- Whitespaces at eols.
- Tidy up comments.
- u_intXX -> uintXX
2006-01-21 08:13:19 +00:00
Matt Jacob
9de3c85c24 Rev MPI spec to 1.05.09 level in preparation for SAS support.
MFC after:	1 month
2006-01-21 00:29:52 +00:00
John Baldwin
14450110f3 Make the ACPI and OpenFirmware PCI bus drivers subclasses of the generic
PCI bus driver.
2006-01-20 22:01:34 +00:00
John Baldwin
5aa58b3e8f Make the 'pci_devclass' pointer variable private (drivers really shouldn't
share devclass pointers, a mistake I've encouraged in the past) and
move the declaration of the pci_driver kobj class from cardbus.c to
pci_private.h so that other drivers can inherit from pci_driver.
2006-01-20 22:00:50 +00:00
John Baldwin
267ec43593 When loading a driver that is a subclass of another driver don't set the
devclass's parent pointer if the two drivers share the same devclass.  This
can happen if the drivers use the same new-bus name.  For example, we
currently have 3 drivers that use the name "pci": the generic PCI bus
driver, the ACPI PCI bus driver, and the OpenFirmware PCI bus driver.  If
the ACPI PCI bus driver was defined as a subclass of the generic PCI bus
driver, then without this check the "pci" devclass would point to itself
as its parent and device_probe_child() would spin forever when it
encountered the first PCI device that did have a matching driver.

Reviewed by:	dfr, imp, new-bus@
2006-01-20 21:59:13 +00:00
Doug Ambrisko
f06b864361 Fix the build. When I added the lutimes the futimes definitions
went away in the generated files?  This didn't happen on my amd64
test machine but did when I committed it on my other i386 machine.
I need to figure this out since a regen on the amd64 doesn't fix it
now.  For now make the build work again.  Matt caught this before
my local mirror caught up.
2006-01-20 20:51:27 +00:00
Ariff Abdullah
8815a86933 Turn on native 32bit recording (at 48000hz).
It works perfectly on my Compaq Presario M2000Z, but my last attempt
on Acer Ferrari 4000 only produce garbled sound.

MFC after:	3 days
2006-01-20 19:35:44 +00:00
Matt Jacob
c4270cb6d7 CAM_NEW_TRAN_CODE placeholders for SAS support.
Reviewed by:	nate, ken, justin
MFC after:	1 month
2006-01-20 19:21:38 +00:00
Doug Ambrisko
cac2fa646c Regen. 2006-01-20 16:22:37 +00:00
Doug Ambrisko
08a3081da8 Add 32bit version of lutimes so untar doesn't mess up sym-links on amd64. 2006-01-20 16:22:06 +00:00
Jim Rees
23350221ac Fix up some cut-n-paste damage and some out-of-date comments.
No code changes.

Submitted by:	cel@citi.umich.edu
2006-01-20 15:20:41 +00:00
Jim Rees
c99880b289 Use thread0 instead of user's thread for sobind.
This fixes reconnect after, for example, tcp idle disconnection.
Previously this would fail if a normal user tried to bind to a privileged
port.

Submitted by:	cel@citi.umich.edu
MFC after:	1 week
2006-01-20 15:17:46 +00:00
Jim Rees
4b81d0eb0f Don't log an error on tcp connection reset, even if we don't get ECONNRESET.
Submitted by:	cel@citi.umich.edu
2006-01-20 15:07:18 +00:00
Andre Oppermann
6c68d7b1ec Fix m_getjcl() the right way this time.
Submitted by:	glebius
Pointy hat to:	andre
2006-01-20 13:43:11 +00:00
Andre Oppermann
f33bf4a394 m_getjcl() should return the address of the mbuf, not the
cluster.

Found by:	glebius
2006-01-20 13:06:22 +00:00
Gleb Smirnoff
5eb5c9639a An attemp to make driver more readable and attaractive for further
hacking:
  - Remove all spaces at eol.
  - Improve style(9) in most frequently edited functions.
  - In em_encap() push variables for 82544 workaround in the block
    where they are only used.
  - In em_get_buf() remove unused variable.
2006-01-20 11:38:25 +00:00
Christian S.J. Peron
9c57c204be - Change the return type for init_tables from void to int so we can propagate
errors from rn_inithead back to the ipfw initialization function.
- Check return value of rn_inithead for failure, if table allocation has
  failed for any reason, free up any tables we have created and return ENOMEM
- In ipfw_init check the return value of init_tables and free up any mutexes or
  UMA zones which may have been created.
- Assert that the supplied table is not NULL before attempting to dereference.

This fixes panics which were a result of invalid memory accesses due to failed
table allocation. This is an issue mainly because the R_Zalloc function is a
malloc(M_NOWAIT) wrapper, thus making it possible for allocations to fail.

Found by:	Coverity Prevent (tm)
Coverity ID:	CID79
MFC after:	1 week
2006-01-20 05:35:27 +00:00
Ariff Abdullah
9ca45dd7dc Ruthless vchan speed workaround against the dreaded sb16 / sb16x. It appear
that nothing else using this weird 45k / 49k speed upper limit.
2006-01-20 03:46:02 +00:00
Christian S.J. Peron
e9186cb94b Destroy the dynamic rule zone in the event that we fail to insert the
initial default rule.

MFC after:	1 week
2006-01-20 03:21:25 +00:00
Olivier Houchard
0e187240e1 Build a minimal pagetables, with only section mappings, mapped write through,
to speed up the decompression.
2006-01-20 00:46:44 +00:00
Jim Rees
c1f097baba Use nfs4_disconnect for connections opened with nfs4_connect.
Submitted by:	cel@citi.umich.edu
MFC after:	1 week
2006-01-19 22:48:31 +00:00
Daniel Hartmeier
31f9d10a77 fix a bug in the fragment cache (used for 'scrub fragment crop/drop-ovl',
but not 'fragment reassemble'), which can cause some fragments to get
inserted into the cache twice, thereby violating an invariant, and panic-
ing the system subsequently.

Reviewed by:	mlaier
MFC after:	1 day
2006-01-19 11:46:45 +00:00
Jason Evans
d72cd77975 Add the RB_PROTOTYPE_STATIC and RB_GENERATE_STATIC macros.
Approved by:	markm (mentor)
2006-01-19 07:20:20 +00:00
Sam Leffler
239cc3b6ce Rev ioctl to get scan results:
o lock the list walk
o malloc a results buffer instead of copying out one result at a time
  using an on-stack buffer
o fix definition of ieee80211req_scan_result so size of variable-length
  information elements is large enough to hold all possible ie's
  (still only return wpa+wme, at some point may return all)
o make rssi+noise data signed; they should've been so all along
o add a bit more padding for future additions while we're here
o define a new ioctl for new api and add compat code for old ioctl
  under COMPAT_FREEBSD6 (temporarily enabled local to the file)

Reviewed by:	Scott Long
MFC after:	2 weeks
2006-01-18 22:17:50 +00:00
Pawel Jakub Dawidek
4f9bcb9f4f Fix bio leak in case of malloc(9) failure.
Found by:	Coverity Prevent(tm)
Coverity ID:	CID794
MFC after:	3 days
2006-01-18 21:44:57 +00:00
Pawel Jakub Dawidek
e9b936c73c Remove dead code.
Found by:	Coverity Prevent(tm)
Coverity ID:	CID105
MFC after:	3 days
2006-01-18 21:43:27 +00:00
Pawel Jakub Dawidek
a49c0bd40a Remove dead code.
Found by:	Coverity Prevent(tm)
Coverity ID:	CID104
MFC after:	3 days
2006-01-18 21:42:19 +00:00
Julian Elischer
11f4763dd4 Return the thread name in the kinfo_proc structure.
Also correct the comment describing what the value is.
2006-01-18 20:27:43 +00:00
Julian Elischer
e1189b25d4 Duh! put the thread name into the section that is zero'd on allocation
(by default there is no name)
2006-01-18 20:18:40 +00:00
Julian Elischer
2c9a55e142 Congratulations, we now have a place for a thread to store its name.
Will be needed when we start using real threads in the kernel instead
of whole pseudo-processes.
2006-01-18 20:12:14 +00:00
Sam Leffler
a1a5050276 bump the scan generation number before iterating so we're guaranteed
to have a value that's not been used before; this fixes the problem
where the first traversal of the scan list did nothing because the
entries were initialized with the current generation number (a
separate issue)

MFC after:	1 week
2006-01-18 19:56:17 +00:00
Andre Oppermann
0270746230 Do not derefence the ip header pointer in the IPv6 case.
This fixes a bug in the previous commit.

Found by:	Coverity Prevent(tm)
Coverity ID:	CID253
Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	3 days
2006-01-18 18:59:30 +00:00
Marcel Moolenaar
383bd4fd1e Remove ELF dynamic tag definitions that aren't used. Ideally,
those that are used should come from <machine/elf.h>.
2006-01-18 18:49:25 +00:00
Andre Oppermann
8f8d29f686 In in_delayed_cksum() we can't perform a m_pullup() as it may
change the mbuf pointer and we don't have any way of passing
it back to the callers.  Instead just fail silently without
updating the checksum but leaving the mbuf+chain intact.

A search in our GNATS database did not turn up any match for
the existing warning message when this case is encountered.

Found by:	Coverity Prevent(tm)
Coverity ID:	CID779
Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	3 days
2006-01-18 18:49:16 +00:00
Andre Oppermann
79eb490467 In syncache_expand() insert a proper syncache_free() to fix a case
that currently can't be triggered.  But better be safe than sorry
later on.  Additionally it properly silences Coverity Prevent for
future tests.

Found by:	Coverity Prevent(tm)
Coverity ID:	CID802
Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	3 days
2006-01-18 18:25:03 +00:00
John Baldwin
25e498b4b0 Always include the lock_classes[] array in the kernel. The
"is it a spinlock" test in mtx_destroy() needs it even in non-debug
kernels.

Reported by:	danfe
2006-01-18 18:02:50 +00:00
Ruslan Ermilov
4006cd2b3f Fix two accesses to uninitialized variables that a revision 1.27
has introduced.

Found with:	Coverity Prevent(tm)
2006-01-18 16:09:00 +00:00
Andre Oppermann
39550088cf Prevent dereferencing a NULL route pointer when trying to update the
route MTU.

This bug is very difficult to reach and not remotely exploitable.

Found by:	Coverity Prevent(tm)
Coverity ID:	CID162
Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	3 days
2006-01-18 15:05:05 +00:00
Gleb Smirnoff
4e7ba1ab94 Be ready to a case when not a constant number of segments is returned
by bus_dmamap_load_mbuf_sg() on jumbo buffer allocation.

Reviewed by:	scottl, gallatin
2006-01-18 14:31:21 +00:00
Andre Oppermann
5d691e6da8 Return mbuf pointer or NULL from ip_fastforward() as the mbuf pointer
may have changed by m_pullup() during fastforward processing.

While this is a bug it is actually never triggered in real world
situations and it is not remotely exploitable.

Found by:	Coverity Prevent(tm)
Coverity ID:	CID780
Sponsored by:	TCP/IP Optimization Fundraise 2005
2006-01-18 14:24:39 +00:00
Søren Schmidt
b258da4ee8 Correct two promise entries, these are only 2port SATA. 2006-01-18 13:34:28 +00:00
Søren Schmidt
8453acf105 Whitespace cleanup. 2006-01-18 13:10:17 +00:00
Pawel Jakub Dawidek
481b55b1e3 Style cleanups.
X-MFC-after:	Already MFCed to RELENG_6 by accident.
2006-01-18 11:03:20 +00:00
Søren Schmidt
ac1731fb20 Properly report SATA connection speed. 2006-01-18 10:02:23 +00:00
Gleb Smirnoff
8d6b240b0d Check ifp before dereferencing it in xl_detach(). xl_detach() can be called
from xl_attach(), when ifp is not defined yet.

Found with:	Coverity Prevent(tm)
2006-01-18 09:42:21 +00:00
Søren Schmidt
f5f55db308 Add support for using DMA on dump, greatly speeds up the dump process.
Add dump support in ataraid.
2006-01-18 09:14:55 +00:00
Colin Percival
9238d0aff6 Correct a buffer overflow when scanning for 802.11 wireless networks.
Security:	FreeBSD-SA-06:05.80211
2006-01-18 09:03:15 +00:00
Matt Jacob
fba92123ac Fix ioctl to not get swallowed by ioctl code (i.e., make sure the darned
code sticks within 8 bits)

MFC after:	1 week
2006-01-18 08:37:27 +00:00
David Xu
74bcd9d280 Eliminate a stale instruction introduced in revision 1.136. 2006-01-18 06:42:42 +00:00
Marcel Moolenaar
7ee3d29ed6 o Add missing relocations.
o  Minor white-space fixups.
2006-01-18 01:45:57 +00:00
Ariff Abdullah
4aee05133b Remove Giant / busdma_lock_mutex from busdma_tag_create(). 2006-01-18 01:01:37 +00:00
Oleg Bulyzhin
6fb34dd2ed - Count packets discarded by RX/TX MAC (cause of FIFO overflow, etc)
as input/output interface errors.
 - Keep values of rx/tx discards & tx collisions inside struct bge_softc.
   So we can keep statistic across ifconfig down/up runs (cause bringing
   bge up will reset chip).

Approved by:	glebius (mentor)
MFC after:	1 week
2006-01-17 23:01:58 +00:00
Marcel Moolenaar
853b7411b6 s/R_IA64_/R_IA_64_/g as per the ia64 psABI. 2006-01-17 21:03:22 +00:00
Juli Mallett
b241b0a239 Since p_cansee will end up dereferencing p_ucred, don't check for p_ucred
equal to NULL several times later.  p_ucred "should probably not" be NULL
if the process isn't PRS_NEW anyway.  This is strongly reinforced by the fact
that we don't see frequent crashes here.  Remove the checks after p_cansee and
add a KASSERT right before it.

Found by:	Coverity Prevent (tm)

Also trim one nearby trailing space.
2006-01-17 20:25:01 +00:00
Alfred Perlstein
92e73f5711 I ran into an nfs client panic a couple of times in a row over the
last few days.  I tracked it down to the fact that nfs_reclaim()
is setting vp->v_data to NULL _before_ calling vnode_destroy_object().
After silence from the mailing list I checked further and discovered
that ufs_reclaim() is unique among FreeBSD filesystems for calling
vnode_destroy_object() early, long before tossing v_data or much
of anything else, for that matter.  The rest, including NFS, appear
to be identical, as if they were just clones of one original routine.

The enclosed patch fixes all file systems in essentially the same
way, by moving the call to vnode_destroy_object() to early in the
routine (before the call to vfs_hash_remove(), if any).  I have
only tested NFS, but I've now run for over eighteen hours with the
patch where I wouldn't get past four or five without it.

Submitted by: Frank Mayhar
Requested by: Mohan Srinivasan
MFC After: 1 week
2006-01-17 17:29:03 +00:00
John Baldwin
2971d7ab9b Fix a memory leak I introduced with the hostb/vgapci stuff.
Reported by:	Coverity (via dfr's clue-bat)
2006-01-17 17:02:45 +00:00
John Baldwin
6ef970a972 Bah. Fix 'show lock' to actually be compiled in. I had just fixed this in
p4 but had an older subr_lock.c on the machine I committed to CVS from.
2006-01-17 16:58:32 +00:00
John Baldwin
83a81bcb14 Add a new file (kern/subr_lock.c) for holding code related to struct
lock_obj objects:
- Add new lock_init() and lock_destroy() functions to setup and teardown
  lock_object objects including KTR logging and registering with WITNESS.
- Move all the handling of LO_INITIALIZED out of witness and the various
  lock init functions into lock_init() and lock_destroy().
- Remove the constants for static indices into the lock_classes[] array
  and change the code outside of subr_lock.c to use LOCK_CLASS to compare
  against a known lock class.
- Move the 'show lock' ddb function and lock_classes[] array out of
  kern_mutex.c over to subr_lock.c.
2006-01-17 16:55:17 +00:00
Joseph Koshy
2b01a08446 Fix a memory leak.
Found by:	Coverity
2006-01-17 16:53:50 +00:00
John Baldwin
550d1c9392 Initialize thread0.td_contested in init_turnstiles() rather than
mutex_init() as it is used by the turnstile code and is not mutex-specific.
2006-01-17 16:47:42 +00:00