Commit Graph

2112 Commits

Author SHA1 Message Date
marcel
2dc1cdfe05 Update for the KDB framework:
o  Call kdb_enter() instead of Debugger().
2004-07-10 21:47:53 +00:00
bms
55f022a9b2 Further improve locking in xl(4):
- Avoid an additional lock acquire/release when leaving xl_intr(), by
   changing xl_start*() to xl_start*_locked(), and calling the appropriate
   routine by chip revision (as the DMA descriptors are different).

 - Simplify the appropriate routines now that they are called with the
   lock held.

This should save a significant amount of CPU cycles spent on servicing
each interrupt for both UP and SMP whilst remaining MPSAFE.

Tested by:	rwatson
2004-07-09 02:28:23 +00:00
bms
6cb6d1bbcd Apply the long-overdue hatchet of style(9) death to this file. 2004-07-09 02:19:07 +00:00
bms
c21379ea20 Further locking improvements for vr(4):
- Add *_locked() entry points as needed to avoid unnecessary lock thrashing.
 - Use these entry points wisely.
 - Only acquire the lock once when servicing an interrupt.
 - Check 'suspended' on interrupt to avoid racing detach.
 - Correct a mis-spelled comment.
 - Don't take the lock in vr_reset() to avoid lock thrashing in attach.
  - Comment this.

Reviewed by:	-net (silence)
2004-07-09 00:17:14 +00:00
bms
8661f63341 Add a 'suspended' flag to softc so that we can avoid races on detach. 2004-07-09 00:12:41 +00:00
bms
a157b010f3 Actually turn on driver locking in xl(4). 2004-07-09 00:11:25 +00:00
bms
06a37782bc Further rl(4) locking improvements:
- Avoid unnecessary re-acquisition elsewhere by adding *_locked()
   entry points as needed.
 - Correct locking for the DEVICE_POLLING case.
 - Hold the driver lock for the entire duration of interrupt servicing,
   to avoid unneeded, expensive re-acquisition; use *_locked() entry
   points as needed.

Reviewed by:	-net (silence)
2004-07-09 00:07:06 +00:00
bms
42d395e031 Whitespace nit 2004-07-05 22:52:01 +00:00
bms
f6892f6625 Eliminate redundant return keywords. 2004-07-05 22:50:52 +00:00
bms
831eb25765 Whitespace pass. 2004-07-05 22:46:28 +00:00
bms
a4ed8073e8 style(9):
- Space before bracketized non-void function returns.
 - Space before condition for conditional blocks.
2004-07-05 22:42:07 +00:00
bms
a9fffb5465 Eliminate redundant return keywords. 2004-07-05 22:36:48 +00:00
bms
5ffe5e7984 Whitespace nits 2004-07-05 22:35:18 +00:00
bms
22344583d0 style(9) pass on prototypes. 2004-07-05 22:27:26 +00:00
bms
abd96c3dcf Locking cleanup for rl(4).
- Eliminate the use of a recursive mutex.
 - Mark the driver INTR_MPSAFE.

This work is incomplete and will be refined in a future commit.
 - Most notably, _locked() variants of entry points need to be introduced.
 - The mii upcall/downcall may still be racy.
 - Add a stubbed-out guard against racing rl_detach() for the time being.

Tested on:	UP, debug.mpsafenet && !debug.mpsafenet
Reviewed by:	silence on -net
2004-07-05 02:51:32 +00:00
bms
969da655b8 style(9) and whitespace cleanup.
Use C99 types. Use ANSI function definitions. Sort prototypes.
Split long lines correctly. Punctuate/wordsmith comments.
Use device_printf()/if_printf() where possible.

Reviewed by:	-net (silence)
2004-07-05 02:46:42 +00:00
bms
c14613165e Reintroduce and clean up locking in xl(4).
- Eliminate the use of a recursive mutex.
 - Mark the driver as INTR_MPSAFE.
 - Split the default media choice code out into xl_choose_media() to
   avoid making poor assumptions about the state of the lock during attach.
 - The miibus upcall/downcall paths may still be racy.
   Change to commented-out locking assertions there for now.
 - Tested with nfsclient, routed, ssh, ntp, dhclient and quagga bgpd.
 - This needs SMP test coverage. I do not have such resources.

Tested on:	UP, !debug.mpsafenet && debug.mpsafenet
Hardware:	3C905B-TX (0x905510b7)
2004-07-05 02:34:35 +00:00
bms
1d6488a23b Use if_printf() and device_printf() where appropriate, i.e.:
- Use device_printf() during device probe/attach.
 - Move if_xname initialization to before xl_reset() is called.
 - Use if_printf() at all other times after struct ifnet has been
   initialized.
2004-07-05 00:15:23 +00:00
bms
5314858731 ANSIfy function definitions.
Remove unnecessary return keywords.
Other minor stylistic changes.
2004-07-04 23:31:28 +00:00
bms
6d6fe5f2fb Fix whitespace, indentation, long line wrapping and comments. 2004-07-04 22:20:52 +00:00
bms
a655d45529 Fix whitespace and comments. 2004-07-04 22:19:50 +00:00
stefanf
31ea8f589c Consistently use __inline instead of __inline__ as the former is an empty macro
in <sys/cdefs.h> for compilers without support for inline.
2004-07-04 16:11:03 +00:00
bms
03e7de7ada SMPng locking cleanup for vr(4).
- Remove recursive locking situations. Remove the MTX_RECURSE bit.
 - Take the lock for any routine which is not called from within if_vr.c
   itself; this includes entry points called by newbus, ifnet, callout,
   ifmedia, and polling subsystems.
 - Remove spl references from the code added to miibus callbacks in rev 1.60.
 - Add the INTR_MPSAFE bit.
 - Tidy up some assignments; locks are not needed for taking the address
   of something at a known offset, for example.
 - Tested on the machine this was committed from.

Tested on:	UP only, !debug.mpsafenet && debug.mpsafenet
Reviewed by:	rwatson
2004-07-03 02:59:02 +00:00
bms
a0411a5267 - Another whitespace pass; make locking calls more obvious.
- Use C99 types for vr_miibus_readreg().
2004-07-03 02:52:32 +00:00
bms
d1f222698b style(9) compliance.
Put some braces around the busy-wait loop in vr_rxeoc() to make the
no-op semicolon more obvious.
No functional changes.
Running on the machine I am committing from without problems.

Reviewed by:	jmallett
2004-07-02 23:51:44 +00:00
mlaier
c34a683385 Bring in the first chunk of altq driver modifications. This covers the
following drivers: bfe(4), em(4), fxp(4), lnc(4), tun(4), de(4) rl(4),
sis(4) and xl(4)

More patches are pending on: http://peoples.freebsd.org/~mlaier/ Please take
a look and tell me if "your" driver is missing, so I can fix this.

Tested-by:	many
No-objection:	-current, -net
2004-07-02 12:16:02 +00:00
jhb
73bf321f26 Add support for the VIA Apollo KT400/400A/600 AGP host bridges which use
the VIA v3 register offsets.

PR:		68545
Submitted by:	Ariff Abdullah <skywizard@mybsd.org.my>
2004-07-02 03:39:33 +00:00
imp
1527a97bc4 Remove saved_* from dc_softc. They are now no longer needed.
Submitted by: Marius Strobl
2004-06-29 20:38:44 +00:00
imp
c9cb153d7e Remove burn bridges code that saved/restored the pci config registers
that are now handled in the pci bus layer.  They are no longer
necessary.
2004-06-28 20:07:03 +00:00
phk
4f816974c0 Be BURN_BRIDGES compliant. 2004-06-21 21:57:31 +00:00
phk
70c86a601e Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
phk
11198bcd80 Use NG_FREE_MSG() instead of FREE(). 2004-06-13 17:15:05 +00:00
naddy
52e18c6c23 Replace handrolled CRC calculation with ether_crc32_[lb]e(). 2004-06-09 14:34:04 +00:00
phk
a7800f65a8 Add missing <sys/module.h> includes 2004-05-30 20:00:41 +00:00
phk
503f5f6026 Add some missing <sys/module.h> includes which are masked by the
one on death-row in <sys/kernel.h>
2004-05-30 17:57:46 +00:00
julian
9e1beeb165 Switch to using C99 sparse initialisers for the type methods array.
Should make no binary difference.

Submitted by:	Gleb Smirnoff <glebius@cell.sick.ru>
Reviewed by:	Harti Brandt <harti@freebsd.org>
MFC after:	1 week
2004-05-29 00:51:19 +00:00
jhb
2b267531e1 Wrap the code to save/restore PCI config registers on suspend/resume in
#ifndef BURN_BRIDGES.

Noticed by:	phk
2004-05-24 19:39:23 +00:00
rwatson
c790eb37e9 Only initialize the if_sis callout as MPSAFE if debug.mpsafenet is set
true.  Otherwise, assertion checks for Giant in the network stack will
fail causing a panic.

Reported by:	simon
2004-05-23 22:22:29 +00:00
yar
c163c38af6 A handler for ioctl(SIOCSIFCAP) should not alter a bit in
if_capenable unless the interface driver is actually able
to toggle the respective capability on and off.

Reviewed by:	ru
2004-05-23 21:05:08 +00:00
mux
a8d09a406c Use __FBSDID. 2004-05-23 10:57:11 +00:00
mux
c1d4e13c6b In agp_generic_bind_memory(), grab the needed pages before acquiring
the agp mutex.  We do this because vm_page_grab() called with the
VM_ALLOC_RETRY flag can sleep.

Pointed out by:	alc
2004-05-23 00:00:10 +00:00
mux
782691f64c Get rid of a lockmgr consumer by making agp(4) use a standard mutex,
since it's always acquiring the lock exclusively.  This was tested
with X on an SMP box, with and without WITNESS.
2004-05-22 13:06:38 +00:00
mux
d0d77b9978 Plug three lock leaks. 2004-05-22 00:44:08 +00:00
anholt
486cc0f941 Add explicit list of SiS AGP chipsets based on Linux kernel's list.
Prompted by:	i386/59503
2004-05-19 05:25:31 +00:00
imp
0ff8841c51 Replace the lame big endian crc with wpaul's standard big endian crc
algorithm, supplied by wpaul himself.  The lame one has an origin
that's been called into question, so rather than argue about that (one
could make an excellent fair use argument), replace it with better
code since that's what FreeBSD is about.

Submitted by: wpaul[1], Klaus Klein

[1] Bill called this a silly bikeshed.  Maybe his is not incorrect.
2004-05-19 02:16:46 +00:00
jhb
30499f45c6 Different VIA host bridges use different offsets to their AGP config
registers, so add a register offset array to the softc.  We key off the
device ID to determine which set of register offsets.  Currently the 8385
host bridge used on amd64 is the only bridge to use the AGP3_VIA_*
register offsets and all other bridges use the AGP_VIA_* offsets.  It is
currently unclear if the AGP3_VIA_* offsets are for VIA bridges that
implement AGP 3.0 bridges or just for amd64 bridges.

Submitted by:	Kenneth Culver culverk at sweetdreamsracing dot biz
2004-05-13 20:05:42 +00:00
bde
5bfd2a373b Remove old cy driver files. They have been repo-copied to sys/dev/cy and
sys/dev/ic and adjusted to work there.
2004-05-02 05:38:49 +00:00
alc
744efee59e Push down the responsibility for zeroing a physical page from the
caller to vm_page_grab().  Although this gives VM_ALLOC_ZERO a
different meaning for vm_page_grab() than for vm_page_alloc(), I feel
such change is necessary to accomplish other goals.  Specifically, I
want to make the PG_ZERO flag immutable between the time it is
allocated by vm_page_alloc() and freed by vm_page_free() or
vm_page_free_zero() to avoid locking overheads.  Once we gave up on
the ability to automatically recognize a zeroed page upon entry to
vm_page_free(), the ability to mutate the PG_ZERO flag became useless.
Instead, I would like to say that "Once a page becomes valid, its
PG_ZERO flag must be ignored."
2004-04-24 20:53:55 +00:00
obrien
c79cdd9352 Add support for the AMD 8111. 2004-04-20 13:36:44 +00:00
obrien
463baa5dc7 Use BSD spelling, no SysV. 2004-04-19 18:44:04 +00:00