Commit Graph

2109 Commits

Author SHA1 Message Date
Max Laier
e3dbc2ddcd Unbreak DEVICE_POLLING build / LINT. Sorry!
Submitted by:	roam
2004-08-02 10:08:28 +00:00
Max Laier
154b8df2ed Second part of ALTQ driver modifications, covering:
an(4), ath(4), hme(4), ndis(4), vr(4) and wi(4)

Please help testing: http://people.freebsd.org/~mlaier/ALTQ_driver/

Tested by:	Vaidas Damosevicius (an, ath, wi)
		Roman Divacky (vr)
Submitted by:	yongari (hme)
2004-08-01 23:58:04 +00:00
Marcel Moolenaar
32240d082c Update for the KDB framework:
o  Call kdb_enter() instead of Debugger().
2004-07-10 21:47:53 +00:00
Bruce M Simpson
69599f22f0 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
Bruce M Simpson
63dff30ee7 Apply the long-overdue hatchet of style(9) death to this file. 2004-07-09 02:19:07 +00:00
Bruce M Simpson
d911052d10 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
Bruce M Simpson
ee06f01331 Add a 'suspended' flag to softc so that we can avoid races on detach. 2004-07-09 00:12:41 +00:00
Bruce M Simpson
c73a317e98 Actually turn on driver locking in xl(4). 2004-07-09 00:11:25 +00:00
Bruce M Simpson
cdeef8e7f3 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
Bruce M Simpson
b4e8c523d0 Whitespace nit 2004-07-05 22:52:01 +00:00
Bruce M Simpson
244f35108f Eliminate redundant return keywords. 2004-07-05 22:50:52 +00:00
Bruce M Simpson
140c64b1fc Whitespace pass. 2004-07-05 22:46:28 +00:00
Bruce M Simpson
03b37a461e style(9):
- Space before bracketized non-void function returns.
 - Space before condition for conditional blocks.
2004-07-05 22:42:07 +00:00
Bruce M Simpson
fb7411a6c9 Eliminate redundant return keywords. 2004-07-05 22:36:48 +00:00
Bruce M Simpson
fdafab8443 Whitespace nits 2004-07-05 22:35:18 +00:00
Bruce M Simpson
892b9d7758 style(9) pass on prototypes. 2004-07-05 22:27:26 +00:00
Bruce M Simpson
8e798292c9 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
Bruce M Simpson
573eefe98f 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
Bruce M Simpson
7f8851d0b9 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
Bruce M Simpson
f1aeae1b95 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
Bruce M Simpson
2cf7254e65 ANSIfy function definitions.
Remove unnecessary return keywords.
Other minor stylistic changes.
2004-07-04 23:31:28 +00:00
Bruce M Simpson
6776cbbd07 Fix whitespace, indentation, long line wrapping and comments. 2004-07-04 22:20:52 +00:00
Bruce M Simpson
16a649385e Fix whitespace and comments. 2004-07-04 22:19:50 +00:00
Stefan Farfeleder
5908d366fb 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
Bruce M Simpson
968bc43646 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
Bruce M Simpson
ca83b553e6 - Another whitespace pass; make locking calls more obvious.
- Use C99 types for vr_miibus_readreg().
2004-07-03 02:52:32 +00:00
Bruce M Simpson
e37a7c5f5a 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
Max Laier
7929aa036c 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
John Baldwin
b68c582ef8 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
Warner Losh
2756272aea Remove saved_* from dc_softc. They are now no longer needed.
Submitted by: Marius Strobl
2004-06-29 20:38:44 +00:00
Warner Losh
c3e7434f34 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
Poul-Henning Kamp
879a220ec4 Be BURN_BRIDGES compliant. 2004-06-21 21:57:31 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Poul-Henning Kamp
39a105ba4c Use NG_FREE_MSG() instead of FREE(). 2004-06-13 17:15:05 +00:00
Christian Weisgerber
0e939c0cea Replace handrolled CRC calculation with ether_crc32_[lb]e(). 2004-06-09 14:34:04 +00:00
Poul-Henning Kamp
f11d01c3bc Add missing <sys/module.h> includes 2004-05-30 20:00:41 +00:00
Poul-Henning Kamp
41ee9f1c69 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 Elischer
f8aae7776f 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
John Baldwin
9930009eb6 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
Robert Watson
baad32ada6 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
Yaroslav Tykhiy
25fbb2c38c 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
Maxime Henrion
e0026a65f9 Use __FBSDID. 2004-05-23 10:57:11 +00:00
Maxime Henrion
eb3259747a 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
Maxime Henrion
d8a821e8cf 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
Maxime Henrion
27d8bee2a7 Plug three lock leaks. 2004-05-22 00:44:08 +00:00
Eric Anholt
f4078c527f 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
Warner Losh
092d0b6b38 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
John Baldwin
92cb9c9b67 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
Bruce Evans
b3f32d172b 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
Alan Cox
7ef6ba5d27 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