]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
19 years agoCheck in ntoskrnl_var.h, which should have been included in the
wpaul [Sun, 27 Mar 2005 10:16:45 +0000 (10:16 +0000)]
Check in ntoskrnl_var.h, which should have been included in the
previous commit.

19 years agoFinally bring an end to the great "make the Atheros NDIS driver
wpaul [Sun, 27 Mar 2005 10:14:36 +0000 (10:14 +0000)]
Finally bring an end to the great "make the Atheros NDIS driver
work on SMP" saga. After several weeks and much gnashing of teeth,
I have finally tracked down all the problems, despite their best
efforts to confound and annoy me.

Problem nunmber one: the Atheros windows driver is _NOT_ a de-serialized
miniport! It used to be that NDIS drivers relied on the NDIS library
itself for all their locking and serialization needs. Transmit packet
queues were all handled internally by NDIS, and all calls to
MiniportXXX() routines were guaranteed to be appropriately serialized.
This proved to be a performance problem however, and Microsoft
introduced de-serialized miniports with the NDIS 5.x spec. Microsoft
still supports serialized miniports, but recommends that all new drivers
written for Windows XP and later be deserialized. Apparently Atheros
wasn't listening when they said this.

This means (among other things) that we have to serialize calls to
MiniportSendPackets(). We also have to serialize calls to MiniportTimer()
that are triggered via the NdisMInitializeTimer() routine. It finally
dawned on me why NdisMInitializeTimer() takes a special
NDIS_MINIPORT_TIMER structure and a pointer to the miniport block:
the timer callback must be serialized, and it's only by saving the
miniport block handle that we can get access to the serialization
lock during the timer callback.

Problem number two: haunted hardware. The thing that was _really_
driving me absolutely bonkers for the longest time is that, for some
reason I couldn't understand, my test machine would occasionally freeze
or more frustratingly, reset completely. That's reset and in *pow!*
back to the BIOS startup. No panic, no crashdump, just a reset. This
appeared to happen most often when MiniportReset() was called. (As
to why MiniportReset() was being called, see problem three below.)
I thought maybe I had created some sort of horrible deadlock
condition in the process of adding the serialization, but after three
weeks, at least 6 different locking implementations and heroic efforts
to debug the spinlock code, the machine still kept resetting. Finally,
I started single stepping through the MiniportReset() routine in
the driver using the kernel debugger, and this ultimately led me to
the source of the problem.

One of the last things the Atheros MiniportReset() routine does is
call NdisReadPciSlotInformation() several times to inspect a portion
of the device's PCI config space. It reads the same chunk of config
space repeatedly, in rapid succession. Presumeably, it's polling
the hardware for some sort of event. The reset occurs partway through
this process. I discovered that when I single-stepped through this
portion of the routine, the reset didn't occur. So I inserted a 1
microsecond delay into the read loop in NdisReadPciSlotInformation().
Suddenly, the reset was gone!!

I'm still very puzzled by the whole thing. What I suspect is happening
is that reading the PCI config space so quickly is causing a severe
PCI bus error. My test system is a Sun w2100z dual Opteron system,
and the NIC is a miniPCI card mounted in a miniPCI-to-PCI carrier card,
plugged into a 100Mhz PCI slot. It's possible that this combination of
hardware causes a bus protocol violation in this scenario which leads
to a fatal machine check. This is pure speculation though. Really all I
know for sure is that inserting the delay makes the problem go away.
(To quote Homer Simpson: "I don't know how it works, but fire makes
it good!")

Problem number three: NdisAllocatePacket() needs to make sure to
initialize the npp_validcounts field in the 'private' section of
the NDIS_PACKET structure. The reason if_ndis was calling the
MiniportReset() routine in the first place is that packet transmits
were sometimes hanging. When sending a packet, an NDIS driver will
call NdisQueryPacket() to learn how many physical buffers the packet
resides in. NdisQueryPacket() is actually a macro, which traverses
the NDIS_BUFFER list attached to the NDIS_PACKET and stashes some
of the results in the 'private' section of the NDIS_PACKET. It also
sets the npp_validcounts field to TRUE To indicate that the results are
now valid. The problem is, now that if_ndis creates a pool of transmit
packets via NdisAllocatePacketPool(), it's important that each time
a new packet is allocated via NdisAllocatePacket() that validcounts
be initialized to FALSE. If it isn't, and a previously transmitted
NDIS_PACKET is pulled out of the pool, it may contain stale data
from a previous transmission which won't get updated by NdisQueryPacket().
This would cause the driver to miscompute the number of fragments
for a given packet, and botch the transmission.

Fixing these three problems seems to make the Atheros driver happy
on SMP, which hopefully means other serialized miniports will be
happy too.

And there was much rejoicing.

Other stuff fixed along the way:

- Modified ndis_thsuspend() to take a mutex as an argument. This
  allows KeWaitForSingleObject() and KeWaitForMultipleObjects() to
  avoid any possible race conditions with other routines that
  use the dispatcher lock.

- Fixed KeCancelTimer() so that it returns the correct value for
  'pending' according to the Microsoft documentation

- Modfied NdisGetSystemUpTime() to use ticks and hz rather than
  calling nanouptime(). Also added comment that this routine wraps
  after 49.7 days.

- Added macros for KeAcquireSpinLock()/KeReleaseSpinLock() to hide
  all the MSCALL() goop.

- For x86, KeAcquireSpinLockRaiseToDpc() needs to be a separate
  function. This is because it's supposed to be _stdcall on the x86
  arch, whereas KeAcquireSpinLock() is supposed to be _fastcall.
  On amd64, all routines use the same calling convention so we can
  just map KeAcquireSpinLockRaiseToDpc() directly to KfAcquireSpinLock()
  and it will work. (The _fastcall attribute is a no-op on amd64.)

- Implement and use IoInitializeDpcRequest() and IoRequestDpc() (they're
  just macros) and use them for interrupt handling. This allows us to
  move the ndis_intrtask() routine from if_ndis.c to kern_ndis.c.

- Fix the MmInitializeMdl() macro so that is uses sizeof(vm_offset_t)
  when computing mdl_size instead of uint32_t, so that it matches the
  MmSizeOfMdl() routine.

- Change a could of M_WAITOKs to M_NOWAITs in the unicode routines in
  subr_ndis.c.

- Use the dispatcher lock a little more consistently in subr_ntoskrnl.c.

- Get rid of the "wait for link event" hack in ndis_init(). Now that
  I fixed NdisReadPciSlotInformation(), it seems I don't need it anymore.
  This should fix the witness panic a couple of people have reported.

- Use MSCALL1() when calling the MiniportHangCheck() function in
  ndis_ticktask(). I accidentally missed this one when adding the
  wrapping for amd64.

19 years agoRemove another ';' after if().
phk [Sun, 27 Mar 2005 07:53:13 +0000 (07:53 +0000)]
Remove another ';' after if().

Also spotted by: bz

19 years agoRemove extra ; at end of if().
phk [Sun, 27 Mar 2005 07:52:12 +0000 (07:52 +0000)]
Remove extra ; at end of if().

Found by: bz

19 years agoIf a device_add_child fails (i.e. low memory situation), be sure to free
njl [Sun, 27 Mar 2005 03:37:43 +0000 (03:37 +0000)]
If a device_add_child fails (i.e. low memory situation), be sure to free
the unused ivars also.

Submitted by: pjd
Obtained from: Coverity Prevent analysis

19 years agocheck copyin+copyout return values when processing TWA_IOCTL_GET_LOCK
sam [Sun, 27 Mar 2005 00:29:37 +0000 (00:29 +0000)]
check copyin+copyout return values when processing TWA_IOCTL_GET_LOCK

Noticed by: Coverity Prevent analysis tool

19 years agopurge dead code
sam [Sat, 26 Mar 2005 23:51:39 +0000 (23:51 +0000)]
purge dead code

Noticed by: Coverity Prevent analysis tool

19 years agocorrect logic so we recognize timeout on alloc
sam [Sat, 26 Mar 2005 23:43:54 +0000 (23:43 +0000)]
correct logic so we recognize timeout on alloc

Noticed by: Coverity Prevent analysis tool

19 years agopurge dead code
sam [Sat, 26 Mar 2005 23:37:54 +0000 (23:37 +0000)]
purge dead code

Noticed by: Coverity Prevent analysis tool

19 years agodeal with malloc failure when setting up the multicast filter
sam [Sat, 26 Mar 2005 23:26:49 +0000 (23:26 +0000)]
deal with malloc failure when setting up the multicast filter

Noticed by: Coverity Prevent analysis tool

19 years agohandle malloc failure and sk_vpd_prodname potentially being null for
sam [Sat, 26 Mar 2005 22:57:28 +0000 (22:57 +0000)]
handle malloc failure and sk_vpd_prodname potentially being null for
other reasons

Noticed by: Coverity Prevent analysis tool
Reviewed by: bz, jmg

19 years agodeal with malloc failures
sam [Sat, 26 Mar 2005 22:20:22 +0000 (22:20 +0000)]
deal with malloc failures

Noticed by: Coverity Prevent analysis tool
Together with: mdodd

19 years agofix a copy/paste typo for scanner/gameport...
jmg [Sat, 26 Mar 2005 22:17:48 +0000 (22:17 +0000)]
fix a copy/paste typo for scanner/gameport...

Spotted by: Michal Mertl <mime@traveller.cz>

19 years agoDon't call mlx_free() i mlx_attach() in case of failure. Doing so
phk [Sat, 26 Mar 2005 21:58:09 +0000 (21:58 +0000)]
Don't call mlx_free() i mlx_attach() in case of failure.  Doing so
in mlx_attach_pci() is much cleaner.

Inspired by: Coverity

19 years agort_newaddrmsg will blow up if given something other than RTM_ADD
sam [Sat, 26 Mar 2005 21:49:43 +0000 (21:49 +0000)]
rt_newaddrmsg will blow up if given something other than RTM_ADD
or RTM_DELETE; add an assertion, may want to do something more
heavyhanded in the future

Noticed by: Coverity Prevent analysis tool
Reviewed by: mdodd

19 years agodeal with malloc failure
sam [Sat, 26 Mar 2005 21:34:12 +0000 (21:34 +0000)]
deal with malloc failure

Noticed by: Coverity Prevent analysis tool

19 years agodeal with failed malloc calls
sam [Sat, 26 Mar 2005 21:30:49 +0000 (21:30 +0000)]
deal with failed malloc calls

Noticed by: Coverity Prevent analysis tool
Glanced at by: mdodd

19 years agofix a "modify after free" bug which is practically impossible to
phk [Sat, 26 Mar 2005 21:07:35 +0000 (21:07 +0000)]
fix a "modify after free" bug which is practically impossible to
experience.

Found by: Coverity (id #540 #541)

19 years agoadd some additional pci classes and sub-classes..
jmg [Sat, 26 Mar 2005 20:31:09 +0000 (20:31 +0000)]
add some additional pci classes and sub-classes..

Reviewed by: imp (almost 6 months ago)

19 years agoxl(4) meets polling(4). Hardware for this work kindly provided by
ru [Sat, 26 Mar 2005 20:22:58 +0000 (20:22 +0000)]
xl(4) meets polling(4).  Hardware for this work kindly provided by
Eric Masson.

MFC after: 3 weeks

19 years agoMake (some) serial ports implement the PPS-API again. This change
phk [Sat, 26 Mar 2005 20:12:39 +0000 (20:12 +0000)]
Make (some) serial ports implement the PPS-API again.  This change
appearantly fell out during the tty code cleanup.

19 years agonetstart is now obsoleted by /etc/rc.d/*, not by /etc/rc.network.
cperciva [Sat, 26 Mar 2005 20:10:24 +0000 (20:10 +0000)]
netstart is now obsoleted by /etc/rc.d/*, not by /etc/rc.network.

Reported by: Martin Jakob, on freebsd-stable@
MFC after: 1 month

19 years agos/ENOTTY/ENOIOCTL/
phk [Sat, 26 Mar 2005 20:04:28 +0000 (20:04 +0000)]
s/ENOTTY/ENOIOCTL/

19 years agoderef correct mbuf ptr to collect any vlan tag
sam [Sat, 26 Mar 2005 18:47:17 +0000 (18:47 +0000)]
deref correct mbuf ptr to collect any vlan tag

Noticed by: Coverity Prevent analysis tool

19 years agoeliminate double free when sym_cam_attach fails
sam [Sat, 26 Mar 2005 18:17:58 +0000 (18:17 +0000)]
eliminate double free when sym_cam_attach fails

Noticed by: Coverity Prevent analysis tool

19 years agocheck copyin return values when loading pallete
sam [Sat, 26 Mar 2005 18:01:35 +0000 (18:01 +0000)]
check copyin return values when loading pallete

Noticed by: Coverity Prevent analysis tool

19 years agoCheck for invalid frequencies after parsing the package. Keep a running
njl [Sat, 26 Mar 2005 17:30:34 +0000 (17:30 +0000)]
Check for invalid frequencies after parsing the package.  Keep a running
count of valid frequencies and use that as the final package count, don't
give up when the first invalid state is found.  Also, add 0x9999 and expand
our upper check to >= 0xffff Mhz [2].

Submitted by: Bruno Ducrot, Jung-uk Kim [2]

19 years agoIf an error occurs, clean up before returning from g_raid3_connect_disk().
pjd [Sat, 26 Mar 2005 17:24:19 +0000 (17:24 +0000)]
If an error occurs, clean up before returning from g_raid3_connect_disk().

19 years agoMake the code more obvious - when an error occurs in g_mirror_connect_disk(),
pjd [Sat, 26 Mar 2005 17:23:01 +0000 (17:23 +0000)]
Make the code more obvious - when an error occurs in g_mirror_connect_disk(),
detach and destroy consumer before returning.

19 years agoCheck for return values.
pjd [Sat, 26 Mar 2005 16:51:19 +0000 (16:51 +0000)]
Check for return values.

Submitted by: sam
Found by: Coverity Prevent analysis tool

19 years agoDo not do write gathering for NFSv3, since it makes no sense unless
delphij [Sat, 26 Mar 2005 11:29:02 +0000 (11:29 +0000)]
Do not do write gathering for NFSv3, since it makes no sense unless
the client is broken and does sync writes all the time.

Obtained from: NetBSD (sys/nfs/nfs_syscalls.c,v 1.44)
Reviewed by: -arch (bde)

19 years agoTeach libstdc++ about frexpl() and ldexpl().
das [Sat, 26 Mar 2005 08:27:53 +0000 (08:27 +0000)]
Teach libstdc++ about frexpl() and ldexpl().

19 years agowhen WPA is enabled discard association requests w/o a WPA ie
sam [Sat, 26 Mar 2005 07:15:34 +0000 (07:15 +0000)]
when WPA is enabled discard association requests w/o a WPA ie

Submitted by: Divy Le Ray

19 years agodon't include wme ie in probe request frames; it was meant for probe response
sam [Sat, 26 Mar 2005 07:11:31 +0000 (07:11 +0000)]
don't include wme ie in probe request frames; it was meant for probe response
frames--move it there

Noticed by: Ghislain Mary
Submitted by: Michael Wong

19 years agoFix a problem with the cd(4) driver -- the CAMGETPASSTHRU ioctl wouldn't
ken [Sat, 26 Mar 2005 06:05:06 +0000 (06:05 +0000)]
Fix a problem with the cd(4) driver -- the CAMGETPASSTHRU ioctl wouldn't
succeed if there was no media in the drive.

This was broken in rev 1.72 when the media check was added to cdioctl().

For now, check the ioctl group to decide whether to check for media or not.
(We only need to check for media on CD-specific ioctls.)

Reported by: bland
MFC after: 3 days

19 years agoAdd "report only" functionality to 'camcontrol format', so users can get a
ken [Sat, 26 Mar 2005 05:34:54 +0000 (05:34 +0000)]
Add "report only" functionality to 'camcontrol format', so users can get a
report on the status of a format already running on a drive.

Fix status reporting for 'camcontrol format'.  This was broken in rev 1.34
of camcontrol.c, almost 4 years ago!

Submitted by: joerg (most of the reportonly changes)
MFC after: 3 days

19 years agoWhen executing mount_foo, pass "mount_foo" as argv[0] instead of "foo".
cperciva [Sat, 26 Mar 2005 04:45:53 +0000 (04:45 +0000)]
When executing mount_foo, pass "mount_foo" as argv[0] instead of "foo".
This unbreaks "/rescue/mount -t foo" -- previously it was necessary to
explicitly call "/rescue/mount_foo".

Hints from: gordon
X-MFC after: 3 days (if approved by re@)

19 years agoFix a place where we were referencing a pointer after it had been freed.
ken [Sat, 26 Mar 2005 04:21:11 +0000 (04:21 +0000)]
Fix a place where we were referencing a pointer after it had been freed.

Submitted by: "Henry Miller" <hank@blackhole.com>
MFC after: 3 days

19 years agoRemove bogus (but harmless) -I.. from CFLAGS. It makes no difference to
brooks [Fri, 25 Mar 2005 22:08:59 +0000 (22:08 +0000)]
Remove bogus (but harmless) -I.. from CFLAGS.  It makes no difference to
.depends other then the commant line.

Also remove -g from CFLAGS.  The user should add it to CFLAGS if they
desire debug support.

Reviewed by: ru (in concept)
MFC After: 7 days

19 years agoComment out rue_miibus_statchg() function. Using trial-and-error approach I
sobomax [Fri, 25 Mar 2005 20:19:18 +0000 (20:19 +0000)]
Comment out rue_miibus_statchg() function. Using trial-and-error approach I
found it guilty in putting the card into unusable state after UP->DOWN->UP
media status change.

Looks like some of register writes in this functions mess up PHY interface.

No visible regressions has been found after commenting this code out -
the card properly handles forceful local mode changes and auto-detects changes
made remotely (tested with Auto, 10HD, 10FD, 100HD, 100FD).

Sponsored by: PBXpress Inc.
MFC after: 3 days

19 years agoWhen the softupdates worklist gets too long, threads that attempt to
das [Fri, 25 Mar 2005 17:30:31 +0000 (17:30 +0000)]
When the softupdates worklist gets too long, threads that attempt to
add more work are forced to process two worklist items first.
However, processing an item may generate additional work, causing the
unlucky thread to recursively process the worklist.  Add a per-thread
flag to detect this situation and avoid the recursion.  This should
fix the stack overflows that could occur while removing large
directory trees.

Tested by: kris
Reviewed by: mckusick

19 years agoRevert bogus += -g change. I needed it to debug the problem.
imp [Fri, 25 Mar 2005 17:30:20 +0000 (17:30 +0000)]
Revert bogus += -g change.  I needed it to debug the problem.

Noticed by: njl, Andrej Tobola

19 years agoremove unimplemented part of the interface..
jmg [Fri, 25 Mar 2005 16:23:48 +0000 (16:23 +0000)]
remove unimplemented part of the interface..

MFC after: 3 days

19 years agoZero the reserved fields of the header, as per rfc 2734. This change
gallatin [Fri, 25 Mar 2005 16:05:42 +0000 (16:05 +0000)]
Zero the reserved fields of the header, as per rfc 2734.  This change
results in connectivty to MacOSX hosts via fwip.

Thanks to Apple's Arulchandran Paramasivam <arulchandranp@apple.com> for
letting us know what we were doing wrong.

Reviewed by: dfr
MFC After: 7 days

19 years agoAdd code to read the primary PCI bus number out of the Compaq/HP 6010
jhb [Fri, 25 Mar 2005 14:18:50 +0000 (14:18 +0000)]
Add code to read the primary PCI bus number out of the Compaq/HP 6010
hotplug Host to PCI bridge.  This is only needed for the non-ACPI case
as the BIOS includes a proper _BBN method in ACPI.

19 years agoAdd /* _FOO_H_ */ after the final #endif to make danfe happy.
sobomax [Fri, 25 Mar 2005 13:22:58 +0000 (13:22 +0000)]
Add /* _FOO_H_ */ after the final #endif to make danfe happy.

19 years agoFix identation.
sobomax [Fri, 25 Mar 2005 12:55:06 +0000 (12:55 +0000)]
Fix identation.

19 years agoAdd missed KUE_UNLOCK(). This is NOOP yet, but may be handy later on.
sobomax [Fri, 25 Mar 2005 12:53:26 +0000 (12:53 +0000)]
Add missed KUE_UNLOCK(). This is NOOP yet, but may be handy later on.

19 years agoFix breakage in the previous commit caused by the last-minute change.
sobomax [Fri, 25 Mar 2005 12:50:57 +0000 (12:50 +0000)]
Fix breakage in the previous commit caused by the last-minute change.

19 years agoProtect against multiple inclusions.
sobomax [Fri, 25 Mar 2005 12:49:26 +0000 (12:49 +0000)]
Protect against multiple inclusions.

19 years agoMove Rx/Tx lists management routines into central location.
sobomax [Fri, 25 Mar 2005 12:42:30 +0000 (12:42 +0000)]
Move Rx/Tx lists management routines into central location.

19 years ago - Pass LK_EXCLUSIVE as the lock type to vget in vfs_hash_insert().
jeff [Fri, 25 Mar 2005 10:51:55 +0000 (10:51 +0000)]
 - Pass LK_EXCLUSIVE as the lock type to vget in vfs_hash_insert().

19 years agoGC unused fields.
sobomax [Fri, 25 Mar 2005 10:39:23 +0000 (10:39 +0000)]
GC unused fields.

19 years ago - The td_locks check is currently broken with snapshots and possibly
jeff [Fri, 25 Mar 2005 09:56:56 +0000 (09:56 +0000)]
 - The td_locks check is currently broken with snapshots and possibly
   some case in unmount.  Disable the KASSERT until these problems can
   be diagnosed.

Sponsored by: Isilon Systems, Inc.

19 years agoGC unused field.
sobomax [Fri, 25 Mar 2005 09:48:24 +0000 (09:48 +0000)]
GC unused field.

19 years agoRestore the ability to read FreeBSD 1 tapes (and I think any net2
imp [Fri, 25 Mar 2005 07:35:59 +0000 (07:35 +0000)]
Restore the ability to read FreeBSD 1 tapes (and I think any net2
based tapes, but I'm not sure where NFS_MAGIC was introduced after
4.3).  When support for the pre-4.4 format was removed (the ability to
read 4.2 and 4.3 BSD tapes), the old format inode conversion was
junked as well.  However, FreeBSD 1 dump tapes use the NFS_MAGIC
format, but have this inode format.  Before, restore would fail
complaining that '.' wasn't found and the root directory wasn't on
this tape.  Since the conversion from the not so old format is
relatively trivial, restore the code to make that conversion.

FreeBSD 1 dumps are once again readable.

MFC After: a few days

19 years agodcvt is unused since the support for converting pre-4.4 tapes was
imp [Fri, 25 Mar 2005 06:57:50 +0000 (06:57 +0000)]
dcvt is unused since the support for converting pre-4.4 tapes was
removed.  Go ahead and remove it and struct odirent since it too is
unused.

# FreeBSD 1.1.5 tapes are still unreadable, but 2.0 and newer work.

19 years agoA few simple regression tests for remainder(), remainderf(),
das [Fri, 25 Mar 2005 06:24:46 +0000 (06:24 +0000)]
A few simple regression tests for remainder(), remainderf(),
remquo(), and remquof().

19 years agoc_tapea and c_firstrec are used for TS_TAPE blocks, so convert them
imp [Fri, 25 Mar 2005 06:03:11 +0000 (06:03 +0000)]
c_tapea and c_firstrec are used for TS_TAPE blocks, so convert them
for the old (4.4-lite through FreeBSD 4.x and *BSD) format.  It looks
like they aren't used for TS_INODE, but conversion costs so little
there that I've not removed them there (in case my grep was wrong).

This makes at least some of the tapes work for me again.  Now, to
regresion test all my dusty tapes...

19 years ago - Don't recycle vnodes anymore. Free them once they are dead. getnewvnode
jeff [Fri, 25 Mar 2005 05:34:39 +0000 (05:34 +0000)]
 - Don't recycle vnodes anymore.  Free them once they are dead.  getnewvnode
   now always allocates a new vnode.
 - Define a new function, vnlru_free, which frees vnodes from the free list.
   It takes as a parameter the number of vnodes to free, which is
   wantfreevnodes - freevnodes when called from vnlru_proc or 1 when
   called from getnewvnode().  For now, getnewvnode() still tries to reclaim
   a free vnode before creating a new one when we are near the limit.
 - Define a function, vdestroy, which handles the actual release of memory
   and teardown of locks, etc.  This could become a uma_dtor() routine.
 - Get rid of minvnodes.  Now wantfreevnodes is 1/4th the max vnodes.  This
   keeps more unreferenced vnodes around so that files which have only
   been stat'd are less likely to be kicked out of the system before we
   have a chance to read them, etc.  These vnodes may still be freed via
   the normal vnlru_proc() routines which may some day become a real lru.

19 years agoImplement and document remquo() and remquof().
das [Fri, 25 Mar 2005 04:40:44 +0000 (04:40 +0000)]
Implement and document remquo() and remquof().

19 years ago- Use pci_get_device() and pci_get_vendor() when we only want one part
jhb [Fri, 25 Mar 2005 03:10:51 +0000 (03:10 +0000)]
- Use pci_get_device() and pci_get_vendor() when we only want one part
  of the device id.
- Use BAR2 rather than BAR0 for the Rocketport UPCI 8O card.  I suspect
  that other UPCI cards might need to use BAR2 as well.

Tested by: wsk at gddsn dot org dot cn
MFC after: 1 week

19 years agoFix inittodr() invocation. Now that devfs is mounted before the
marcel [Fri, 25 Mar 2005 01:56:12 +0000 (01:56 +0000)]
Fix inittodr() invocation. Now that devfs is mounted before the
actual root file system is mounted, the first entry on the mountlist
is not the root file system and the timestamp for that entry is
typically 0. Passing that to inittodr() caused annoying errors on
alpha and ia64.
So, call inittodr() for all file systems on mountlist, but only when
the timestamp (mnt_time) is non-zero.

19 years agoFix an incorrect NULL argument to usbd_set_interface() associated
iedowse [Fri, 25 Mar 2005 01:47:01 +0000 (01:47 +0000)]
Fix an incorrect NULL argument to usbd_set_interface() associated
with the ALT_IFACE_1 quirk.

PR: usb/79190
Submitted by: Hans Petter Selasky <hselasky@c2i.net>

19 years agoUse usbd_get_string() instead of calling usbd_get_string_desc()
iedowse [Fri, 25 Mar 2005 01:44:38 +0000 (01:44 +0000)]
Use usbd_get_string() instead of calling usbd_get_string_desc()
with the wrong language parameter when retrieving the device serial
number. This invalid request caused some devices not to work at
all.

PR: usb/79190
Submitted by: Hans Petter Selasky <hselasky@c2i.net>

19 years agoMove xxx_newbuf() function, which was the same in all drivers into central
sobomax [Fri, 25 Mar 2005 00:44:21 +0000 (00:44 +0000)]
Move xxx_newbuf() function, which was the same in all drivers into central
location.

19 years agoUse M_NOWAIT when allocating from a callout routine.
iedowse [Fri, 25 Mar 2005 00:38:46 +0000 (00:38 +0000)]
Use M_NOWAIT when allocating from a callout routine.

PR: kern/73295

19 years ago - Add information about the buf lock to db_show_buffer.
jeff [Fri, 25 Mar 2005 00:20:37 +0000 (00:20 +0000)]
 - Add information about the buf lock to db_show_buffer.
 - Add a 'show lockedbufs' command that is similar to show lockedvnods.

Sponsored by: Isilon Systems, Inc.

19 years ago - Restore COUNT() in all of its original glory. Don't make it dependent
jeff [Fri, 25 Mar 2005 00:00:44 +0000 (00:00 +0000)]
 - Restore COUNT() in all of its original glory.  Don't make it dependent
   on DEBUG as ufs will soon grow a dependency on this count.

Discussed with: bde
Sponsored by: Isilon Systems, Inc.

19 years agoUpdate parsing of the ports INDEX file to accomodate some new
kensmith [Thu, 24 Mar 2005 23:03:39 +0000 (23:03 +0000)]
Update parsing of the ports INDEX file to accomodate some new
fields that got added to it recently-ish.  While here document
what each of the fields is based on discussion with portmgr@.

Patch from:     murray (slightly adapted)
MFC after: 1 day

19 years agoMerge from i386:
jhb [Thu, 24 Mar 2005 21:36:15 +0000 (21:36 +0000)]
Merge from i386:
- Add a i8254_pending variable to save some indirections in clkintr().
- Don't bother setting up an IRQ0 handler if we are using the lapic timer.

19 years ago- Don't enable periodic interrupts from the RTC by default in rtc_statusb.
jhb [Thu, 24 Mar 2005 21:34:16 +0000 (21:34 +0000)]
- Don't enable periodic interrupts from the RTC by default in rtc_statusb.
  Instead, explicitly enable them when we setup the interrupt handler.
  Also, move the setting of stathz and profhz down to the same place so
  that the code flow is simpler and easier to follow.
- Don't setup an interrupt handler for IRQ0 if we are using the lapic timer
  as it doesn't do anything productive in that case.

19 years agoDon't set ret_namelen and ret_resnamelen in res_find() unless both the
jhb [Thu, 24 Mar 2005 21:20:25 +0000 (21:20 +0000)]
Don't set ret_namelen and ret_resnamelen in res_find() unless both the
corresponding pointer to the buffer (ret_name and ret_resname) is non-NULL
to avoid possible NULL pointer derefs.

Reported by: Coverity via sam

19 years agoUse device_set_desc_copy() for non-constant strings.
pjd [Thu, 24 Mar 2005 21:07:55 +0000 (21:07 +0000)]
Use device_set_desc_copy() for non-constant strings.

Approved by: njl

19 years agoUse the CTASSERT() macro instead of rolling my own, non-portable one
brooks [Thu, 24 Mar 2005 19:26:50 +0000 (19:26 +0000)]
Use the CTASSERT() macro instead of rolling my own, non-portable one
using #error.

Suggested by: jhb

19 years agoAdd another HID for the Toshiba SPA40 laptop.
jhb [Thu, 24 Mar 2005 19:02:13 +0000 (19:02 +0000)]
Add another HID for the Toshiba SPA40 laptop.

Submitted by: Chris Reece car at crank dot org dot uk
MFC after: 1 week

19 years agoSupport MCP versions 4-11.
obrien [Thu, 24 Mar 2005 18:55:07 +0000 (18:55 +0000)]
Support MCP versions 4-11.

19 years agoMove implementation of hw.bus.rman sysctl to subr_rman.c so that
phk [Thu, 24 Mar 2005 18:13:11 +0000 (18:13 +0000)]
Move implementation of hw.bus.rman sysctl to subr_rman.c so that
subr_bus.c doesn't need to peek inside struct resource.

OK from: imp

19 years agoCompile errors are way more useful then panics later.
brooks [Thu, 24 Mar 2005 17:51:15 +0000 (17:51 +0000)]
Compile errors are way more useful then panics later.

Replace a KASSERT of LINUX_IFNAMSIZ == IFNAMSIZ with a preprocessor
check and #error message.  This will prevent nasty suprises if users
change IFNAMSIZ without updating the linux code appropriatly.

19 years agoUpdate copyright years.
den [Thu, 24 Mar 2005 12:19:46 +0000 (12:19 +0000)]
Update copyright years.

19 years agoIf "dangerous" environment variables (LD_PRELOAD, LD_LIBMAP,
cperciva [Thu, 24 Mar 2005 10:12:29 +0000 (10:12 +0000)]
If "dangerous" environment variables (LD_PRELOAD, LD_LIBMAP,
LD_LIBMAP_DISABLE, LD_LIBRARY_PATH) are used, then make sure the
libraries being loaded aren't on a noexec-mounted filesystem.

This is a compromise position: I'm assuming that nobody will be silly
enough to set the noexec mount flag on part of the default library
path, in order to avoid adding extra overhead into the common case
(where those environment variables aren't used).

Discussed with: csjp, secteam
MFC after: 1 week

19 years ago - Fail an assert if we attempt to return with any lockmgr locks held in
jeff [Thu, 24 Mar 2005 09:35:38 +0000 (09:35 +0000)]
 - Fail an assert if we attempt to return with any lockmgr locks held in
   userret().

Sponsored by: Isilon Systems, Inc.

19 years ago - Complete the implementation of td_locks. Track the number of outstanding
jeff [Thu, 24 Mar 2005 09:35:06 +0000 (09:35 +0000)]
 - Complete the implementation of td_locks.  Track the number of outstanding
   lockmgr locks that this thread owns.  This is complicated due to
   LK_KERNPROC and because lockmgr tolerates unlocking an unlocked lock.

Sponsored by: Isilon Systes, Inc.

19 years ago - Update vfs_root implementations to match the new prototype. None of
jeff [Thu, 24 Mar 2005 07:39:03 +0000 (07:39 +0000)]
 - Update vfs_root implementations to match the new prototype.  None of
   these filesystems will support shared locks until they are explicitly
   modified to do so.  Careful review must be done to ensure that this
   is safe for each individual filesystem.

Sponsored by:   Isilon Systems, Inc.

19 years ago - Update vfs_root implementations to match the new prototype. None of
jeff [Thu, 24 Mar 2005 07:36:16 +0000 (07:36 +0000)]
 - Update vfs_root implementations to match the new prototype.  None of
   these filesystems will support shared locks until they are explicitly
   modified to do so.  Careful review must be done to ensure that this
   is safe for each individual filesystem.

Sponsored by: Isilon Systems, Inc.

19 years ago - Call VFS_ROOT() with LK_EXCLUSIVE.
jeff [Thu, 24 Mar 2005 07:33:45 +0000 (07:33 +0000)]
 - Call VFS_ROOT() with LK_EXCLUSIVE.

Sponsored by: Isilon Systems, Inc.

19 years ago - Update the ufs_root() prototype.
jeff [Thu, 24 Mar 2005 07:32:50 +0000 (07:32 +0000)]
 - Update the ufs_root() prototype.
 - Pass the ufs_root() flags argument to VFS_VGET() to allow callers to
   specify shared locks.

Sponsored by: Isilon Systems, Inc.

19 years ago - Pass LK_EXCLUSIVE to VFS_ROOT() to satisfy the new flags argument. For
jeff [Thu, 24 Mar 2005 07:31:38 +0000 (07:31 +0000)]
 - Pass LK_EXCLUSIVE to VFS_ROOT() to satisfy the new flags argument.  For
   now, all calls to VFS_ROOT() should still acquire exclusive locks.

Sponsored by: Isilon Systems, Inc.

19 years ago - Fixup the default vfs_root function to match the new prototype.
jeff [Thu, 24 Mar 2005 07:30:00 +0000 (07:30 +0000)]
 - Fixup the default vfs_root function to match the new prototype.

Sponsored by: Isilon Systems, Inc.

19 years ago - Add a 'flags' parameter to VFS_ROOT(). This is intended to allow
jeff [Thu, 24 Mar 2005 07:29:23 +0000 (07:29 +0000)]
 - Add a 'flags' parameter to VFS_ROOT().  This is intended to allow
   lookup to do shared locks on the root.  Filesystems are free to ignore
   flags and instead acquire an exclusive lock if they do not support
   shared locks.

Sponsored by: Isilon Systems, Inc.

19 years ago - Grab the lock type that the caller requests in vfs_hash_insert().
jeff [Thu, 24 Mar 2005 06:16:27 +0000 (06:16 +0000)]
 - Grab the lock type that the caller requests in vfs_hash_insert().

Sponsored by: Isilon Systems, Inc.

19 years ago - If vput() is called with a shared lock it must upgrade to an exclusive
jeff [Thu, 24 Mar 2005 06:08:58 +0000 (06:08 +0000)]
 - If vput() is called with a shared lock it must upgrade to an exclusive
   before it can call VOP_INACTIVE().  This must use the EXCLUPGRADE path
   because we may violate some lock order with another locked vnode if
   we drop and reacquire the lock.  If EXCLUPGRADE fails, we mark the
   vnode with VI_OWEINACT.  This case should be very rare.
 - Clear VI_OWEINACT in vinactive() and vbusy().
 - If VI_OWEINACT is set in vgone() do the VOP_INACTIVE call here as well.

Sponsored by: Isilon Systems, Inc.

19 years ago - Remove some long dead LOOKUP_SHARED code that tracked the lock state.
jeff [Thu, 24 Mar 2005 06:04:35 +0000 (06:04 +0000)]
 - Remove some long dead LOOKUP_SHARED code that tracked the lock state.
 - Always pass LOCKSHARED and rely on namei() to ignore it when
   LOOKUP_SHARED is not set.

Sponsored by: Isilon Systems, Inc.

19 years ago - Remove the #ifdef LOOKUP_SHARED from some calls to NDINIT. The
jeff [Thu, 24 Mar 2005 06:03:31 +0000 (06:03 +0000)]
 - Remove the #ifdef LOOKUP_SHARED from some calls to NDINIT.  The
   LOCKSHARED flag is simply ignored in namei() if LOOKUP_SHARED is not
   enabled.

Sponsored by: Isilon Systems, Inc.

19 years ago - Clear LOCKSHARED if LOOKUP_SHARED is not enabled. This is not strictly
jeff [Thu, 24 Mar 2005 06:02:37 +0000 (06:02 +0000)]
 - Clear LOCKSHARED if LOOKUP_SHARED is not enabled.  This is not strictly
   necessary since we disable the shared locks in vfs_cache, but it is
   prefered that the option not leak out into filesystems when it is
   disabled.

Sponsored by: Isilon Systems, Inc.

19 years ago - All of the bugs which lead to the complication of the LOOKUP_SHARED
jeff [Thu, 24 Mar 2005 06:00:45 +0000 (06:00 +0000)]
 - All of the bugs which lead to the complication of the LOOKUP_SHARED
   config option have now been fixed.  All filesystems are properly locked
   and checked via DEBUG_VFS_LOCKS.  Remove the workaround code.

Sponsored by: Isilon Systems, Inc.

19 years agoAdd manual page for snd_via8233(4) and add it to the build.
jcamou [Thu, 24 Mar 2005 04:45:09 +0000 (04:45 +0000)]
Add manual page for snd_via8233(4) and add it to the build.

PR: docs/78322
Submitted by: Joel Dahl <joel@automatvapen.se>
Approved by: trhodes (mentor)

19 years ago- Break after nested switch.
mdodd [Thu, 24 Mar 2005 02:08:22 +0000 (02:08 +0000)]
- Break after nested switch.
- Default returns an error.

19 years agoOffer unhandled IOCTLS to fddi_ioctl().
mdodd [Thu, 24 Mar 2005 01:58:20 +0000 (01:58 +0000)]
Offer unhandled IOCTLS to fddi_ioctl().

19 years agoPOWERSTATECHANGE was misspelled.
mdodd [Thu, 24 Mar 2005 01:26:40 +0000 (01:26 +0000)]
POWERSTATECHANGE was misspelled.