Commit Graph

1775 Commits

Author SHA1 Message Date
Alfred Perlstein
69a3693f3e catch up with mextadd callback taking a void argument instead of a caddr_t. 2002-06-29 01:49:22 +00:00
Alfred Perlstein
64f0b9d749 remove or replace caddr_t with void.
make the mbuf external free function take a void * rather than caddr_t.
2002-06-28 23:48:23 +00:00
Kenneth D. Merry
98cb733c67 At long last, commit the zero copy sockets code.
MAKEDEV:	Add MAKEDEV glue for the ti(4) device nodes.

ti.4:		Update the ti(4) man page to include information on the
		TI_JUMBO_HDRSPLIT and TI_PRIVATE_JUMBOS kernel options,
		and also include information about the new character
		device interface and the associated ioctls.

man9/Makefile:	Add jumbo.9 and zero_copy.9 man pages and associated
		links.

jumbo.9:	New man page describing the jumbo buffer allocator
		interface and operation.

zero_copy.9:	New man page describing the general characteristics of
		the zero copy send and receive code, and what an
		application author should do to take advantage of the
		zero copy functionality.

NOTES:		Add entries for ZERO_COPY_SOCKETS, TI_PRIVATE_JUMBOS,
		TI_JUMBO_HDRSPLIT, MSIZE, and MCLSHIFT.

conf/files:	Add uipc_jumbo.c and uipc_cow.c.

conf/options:	Add the 5 options mentioned above.

kern_subr.c:	Receive side zero copy implementation.  This takes
		"disposable" pages attached to an mbuf, gives them to
		a user process, and then recycles the user's page.
		This is only active when ZERO_COPY_SOCKETS is turned on
		and the kern.ipc.zero_copy.receive sysctl variable is
		set to 1.

uipc_cow.c:	Send side zero copy functions.  Takes a page written
		by the user and maps it copy on write and assigns it
		kernel virtual address space.  Removes copy on write
		mapping once the buffer has been freed by the network
		stack.

uipc_jumbo.c:	Jumbo disposable page allocator code.  This allocates
		(optionally) disposable pages for network drivers that
		want to give the user the option of doing zero copy
		receive.

uipc_socket.c:	Add kern.ipc.zero_copy.{send,receive} sysctls that are
		enabled if ZERO_COPY_SOCKETS is turned on.

		Add zero copy send support to sosend() -- pages get
		mapped into the kernel instead of getting copied if
		they meet size and alignment restrictions.

uipc_syscalls.c:Un-staticize some of the sf* functions so that they
		can be used elsewhere.  (uipc_cow.c)

if_media.c:	In the SIOCGIFMEDIA ioctl in ifmedia_ioctl(), avoid
		calling malloc() with M_WAITOK.  Return an error if
		the M_NOWAIT malloc fails.

		The ti(4) driver and the wi(4) driver, at least, call
		this with a mutex held.  This causes witness warnings
		for 'ifconfig -a' with a wi(4) or ti(4) board in the
		system.  (I've only verified for ti(4)).

ip_output.c:	Fragment large datagrams so that each segment contains
		a multiple of PAGE_SIZE amount of data plus headers.
		This allows the receiver to potentially do page
		flipping on receives.

if_ti.c:	Add zero copy receive support to the ti(4) driver.  If
		TI_PRIVATE_JUMBOS is not defined, it now uses the
		jumbo(9) buffer allocator for jumbo receive buffers.

		Add a new character device interface for the ti(4)
		driver for the new debugging interface.  This allows
		(a patched version of) gdb to talk to the Tigon board
		and debug the firmware.  There are also a few additional
		debugging ioctls available through this interface.

		Add header splitting support to the ti(4) driver.

		Tweak some of the default interrupt coalescing
		parameters to more useful defaults.

		Add hooks for supporting transmit flow control, but
		leave it turned off with a comment describing why it
		is turned off.

if_tireg.h:	Change the firmware rev to 12.4.11, since we're really
		at 12.4.11 plus fixes from 12.4.13.

		Add defines needed for debugging.

		Remove the ti_stats structure, it is now defined in
		sys/tiio.h.

ti_fw.h:	12.4.11 firmware.

ti_fw2.h:	12.4.11 firmware, plus selected fixes from 12.4.13,
		and my header splitting patches.  Revision 12.4.13
		doesn't handle 10/100 negotiation properly.  (This
		firmware is the same as what was in the tree previously,
		with the addition of header splitting support.)

sys/jumbo.h:	Jumbo buffer allocator interface.

sys/mbuf.h:	Add a new external mbuf type, EXT_DISPOSABLE, to
		indicate that the payload buffer can be thrown away /
		flipped to a userland process.

socketvar.h:	Add prototype for socow_setup.

tiio.h:		ioctl interface to the character portion of the ti(4)
		driver, plus associated structure/type definitions.

uio.h:		Change prototype for uiomoveco() so that we'll know
		whether the source page is disposable.

ufs_readwrite.c:Update for new prototype of uiomoveco().

vm_fault.c:	In vm_fault(), check to see whether we need to do a page
		based copy on write fault.

vm_object.c:	Add a new function, vm_object_allocate_wait().  This
		does the same thing that vm_object allocate does, except
		that it gives the caller the opportunity to specify whether
		it should wait on the uma_zalloc() of the object structre.

		This allows vm objects to be allocated while holding a
		mutex.  (Without generating WITNESS warnings.)

		vm_object_allocate() is implemented as a call to
		vm_object_allocate_wait() with the malloc flag set to
		M_WAITOK.

vm_object.h:	Add prototype for vm_object_allocate_wait().

vm_page.c:	Add page-based copy on write setup, clear and fault
		routines.

vm_page.h:	Add page based COW function prototypes and variable in
		the vm_page structure.

Many thanks to Drew Gallatin, who wrote the zero copy send and receive
code, and to all the other folks who have tested and reviewed this code
over the years.
2002-06-26 03:37:47 +00:00
Jens Schweikhardt
21dc7d4f57 Fix typo in the BSD copyright: s/withough/without/
Spotted and suggested by:	des
MFC after:	3 weeks
2002-06-02 20:05:59 +00:00
Mike Silbersack
000c679b3c Enhance the use of the watchdog timer in this driver so that it will
allow recovery from transmission lockups which occur in the middle
of the descriptor list, rather than just at the beginning.

For some unknown reason, Rhine II chips have a tendency to stop
transmitting while under heavy load, possibly due to collisions.
Whether this behavior is due to a hardware bug or a driver glitch
is unknown as of now.

In either case, this change allows the driver to gracefully recover
from such situations.

Special thanks go to The Anarcat <anarcat@anarcat.dyndns.org>, who
bugged me into looking at this and to
Dominic Marks <dominic_marks@btinternet.com>, who performed a great
deal of testing to help characterize this problem.

MFC after:	3 days
2002-05-15 17:05:28 +00:00
John Baldwin
d204693572 Add support for the D-Link DFE-690TXD Cardbus card which has a RealTek 8139
with its own PCI ID.
2002-05-06 13:43:00 +00:00
Mitsuru IWASAKI
e8388e1466 Add suspend/resume code mostly merged from fxp/rl driver.
This is temporary hack, better and generalized solution probably
should be implemented at lower layer(MII or PCI?).
Tested by:	shoko.araki@soliton.co.jp
MFC after:	1 week
2002-05-06 10:55:42 +00:00
Poul-Henning Kamp
9ebe64ca1b Don't grab the lock until somewhat later in attach to avoid a lock
reversal.
2002-05-03 08:44:53 +00:00
Poul-Henning Kamp
45521525a7 Move us yet closer to IFM_* definitions in NetBSD. 2002-04-29 05:32:44 +00:00
Poul-Henning Kamp
b418ad5c2e Follow NetBSD and s/IFM_1000_TX/IFM_1000_T/ 2002-04-28 20:34:20 +00:00
Mike Barcroft
a30d4b3270 Move the new byte order function prototypes from <sys/param.h> to
<sys/endian.h>.  This puts us in line with NetBSD and OpenBSD.
2002-04-26 22:48:23 +00:00
Poul-Henning Kamp
14021ab570 Redo the pps bit to avoid digging into the private bits of the timecounter. 2002-04-26 21:22:02 +00:00
Poul-Henning Kamp
7bf758bff0 Simplify the RFC2783 and PPS_SYNC timestamp collection API. 2002-04-26 20:24:28 +00:00
Semen Ustimenko
9cd64fb3dd Move tx(4) driver to sys/dev/tx. BTW split hardware structures and constants
into if_txreg.h.

MFC after:	1 week
2002-04-19 22:43:57 +00:00
Luigi Rizzo
7632341a30 Add DEVICE_POLLING support to the "rl" driver.
The diffs are very similar to the ones for the "sis" driver.

MFC After: 5 days
2002-04-16 22:03:14 +00:00
Coleman Kane
9264fbc80a Fix some nits in AMD AGP driver. Remove excess malloc and move a bzero
out of the way, so it won't cause trouble.

Submitted by:	Frank Mayher <frank@exit.com>
MFC after: 1 week
2002-04-15 18:57:26 +00:00
Bill Paul
9a29439fb9 Nortel Networks sells a RealTek 8139-based NIC that's basically
the same thing as the SMC 1211, but with their own vendor ID.
Update the device list to support this NIC. (Discovered these
cards lying around the lab at work.)
2002-04-11 06:12:51 +00:00
Bill Paul
a72c060fb0 Teach the rlphy driver how to do parallel link detection. If the link partner
doesn't support NWAY, the RealTek PHY (both the integrated ones on 8139
chips and the RTL8201L 10/100 PHY) will not report the link speed via
the ANLPAR or BMSR registers. For the 8201L, we need to look in magic
vendor-specific PHY register 0x19. For the 8139 MAC+PHY combo, we have
to be able to test the RL_MEDIASTAT register.

The changes to rlphy.c are based largely on the patch from PR 30836,
however I tried to eliminate some magic numbers by creating an entry
for the 8201 PHY in miidevs.

Also updated if_rl.c to allow the rlphy driver to read the RL_MEDIASTAT
register via the rl_miibus_readreg() routine.
2002-04-07 20:55:50 +00:00
John Baldwin
6008862bc2 Change callers of mtx_init() to pass in an appropriate lock type name. In
most cases NULL is passed, but in some cases such as network driver locks
(which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.

Tested on:	i386, alpha, sparc64
2002-04-04 21:03:38 +00:00
Nicolas Souchu
e1e245b7a5 smbus_alloc_bus is not part of the smbus interface anymore 2002-03-23 18:27:16 +00:00
Nicolas Souchu
c17d43407f Major rework of the iicbus/smbus framework:
- VIA chipset SMBus controllers added
	- alpm driver updated
	- Support for dynamic modules added
	- bktr FreeBSD smbus updated but not tested
	- cleanup
2002-03-23 15:49:15 +00:00
Alfred Perlstein
e51a25f850 Remove __P. 2002-03-20 02:08:01 +00:00
Peter Wemm
1a8f253b64 Cast pointers to uintptr_t rather than u_int32_t. This doesn't work too
well on machines with 64 bit pointers.
2002-03-19 23:28:35 +00:00
Bruce Evans
eabfc7877d Work around a PLX9050 bug that causes system lockup in certain systems,
depending on the MMIO addresses allocated to the board.

PR:		30965, 20845 (maybe)
Submitted by:	Daniela Squassoni <daniela@cyclades.com>
Tested by:	Arjan Knepper <arjan@jak.nl>
		Scott Klement <klemscot@klements.com>
2002-03-17 04:10:38 +00:00
Peter Wemm
0574a5a746 Fix warning; amdsmb_abort() is not used. 2002-02-26 01:04:58 +00:00
Josef Karthauser
a10b07e4ec Fix a formatting error. 2002-02-17 12:41:50 +00:00
Josef Karthauser
97e5881fe1 KNF style the code, ready for an MFC. 2002-02-17 12:29:39 +00:00
Josef Karthauser
1b262fd0c5 KNF style the code, ready for an MFC. 2002-02-17 11:58:58 +00:00
Mike Silbersack
27d5f39f68 Remove mbuf exhaustion warning messages; these are handled by the
mbuf system in a rate-limited fashion now.

MFC after:	3 days
2002-02-11 23:38:30 +00:00
Josef Karthauser
d740688b87 Fix some bugs in the ohci driver with respect to irq setup failure.
Submitted by:	nyan
2002-02-11 14:39:57 +00:00
Luigi Rizzo
273b222cdb Use ETHER_CRC_LEN instead of SIS_CRC_SIZE
Suggested-by: Archie, Doug Ambrisko
2002-02-07 08:04:24 +00:00
Luigi Rizzo
254d9d5f73 Fix a bug in the driver -- the chip will always include the CRC
in the received packet size, but the upper level routines want
the length without it.

Reported-by: Doug Ambrisko, ambrisko@freebsd.org
2002-02-07 07:47:00 +00:00
Doug Ambrisko
4c2380660a Fix support for 630ET support. We don't need the Linux part to set the
mii access mode.  Fix the device ID and make it read the mac via sis_read_mac.

Reviewed by: 	imp
MFC after:	1 week
2002-02-06 22:06:47 +00:00
Benno Rice
64eecf3a43 Correctly identify the Intel 82830 AGP bridge. 2002-02-05 23:13:25 +00:00
Bruce Evans
3230a24cb4 Merged cy_pcireg.h into the one file that uses it (cy_pci.c). 2002-02-02 02:22:51 +00:00
Bruce Evans
7e8c3cecdf Fixed breakage of interrupt setup in previous commit. It used an
uninitialized variable in the !CY_PCI_FASTINTR case (*blush*).
2002-02-02 02:05:44 +00:00
Doug Ambrisko
45fe21a0a2 Forgot one part of the VLAN support for the dc(4) driver.
Pointed out by: Shin-ichi YOSHIMOTO <yosimoto@waishi.jp>
2002-01-16 21:34:11 +00:00
Doug Ambrisko
db40c1aef4 Add VLAN for the dc(4) driver (ie long frame). The patch is 2 parts.
One to notify the system that the MTU for VLAN can be 1500 so the vlan
will automatically be configured with a 1500 MTU the other is to ignore
the error case if the received frame is to long.

The frame size notification came from code in the SIS driver, and
the support for long frames derived from the NetBSD Tulip driver.

Tested on:	4 port D-Link adapter DFE-570TX 4 Intel 21143
		Netgear card with 82c169 PNIC 10/100BaseTX

Reviewed by:	ru (manpage), wpaul (not objected to), archie
Approved by:	imp
Obtained from:	NetBSD
2002-01-16 16:33:58 +00:00
Bill Paul
ff6f796866 Fix mind-o: compare sc->sis_rev instead of 'command' when trying to
decide how to read the station address.
2002-01-14 20:52:31 +00:00
Bill Paul
07c006c6fb Add support for newer integrated SiS 900 controllers on the 635 and 735
motherboard chipsets. We need to force the chip to reload its MAC address
into the receive filter, and enable software access mode for the PHY.

PR:		kern/33294
2002-01-12 21:12:17 +00:00
Jim Pirzyk
417c87d137 Add support for the Intel 82443MX chipset
PR:		kern/33032
MFC after:	1 month
2001-12-21 01:28:59 +00:00
Bill Paul
29a2220a5c Fix the "conexant chips don't work in full duplexmode" problem. According
to Phil Kernick:

"The problem is that in full duplex mode, the Conexant chip always reports a
carrier lost error, even when the frame is successfully sent.  So, if we
have a Conexant chip, then ignore carrier lost when in full duplex
mode."

Since the Xircom chips seem to have the same issue and since we already
have a workaround for this, just expand the workaround test to also
check for DC_IS_CONEXANT().
2001-12-19 18:23:45 +00:00
Bill Paul
d9700bb5b5 Fix compiler warning in dc_intr(): if the only code that does a "goto"
to a label is inside an #ifdef block, then the label should *also* be
inside an #ifdef block. Hide the "done:" label which is only used if
DEVICE_POLLING is enabled under #ifdef DEVICE_POLLING.
2001-12-19 18:13:44 +00:00
Matthew N. Dodd
fe7075481b Allow retrieval of the virtual address of the AGP aperture
using agp_get_info().

MFC after:	1 week
2001-12-19 08:54:29 +00:00
Mike Silbersack
dcf11ee64e Fix a problem where stats overflow interrupts would cause
a major slowdown, and re-enable stats overflow interrupts.

For future reference, the bug was in our code, and not
some bug in the 3com chips.

Reviewed by:	wpaul
MFC after:	2 days
2001-12-17 22:24:19 +00:00
Archie Cobbs
5c2c21f4a9 Fix access-after-free bug added in revision 1.31.
Detected by:	INVARIANTS
MFC after:	2 days
2001-12-15 19:59:28 +00:00
Peter Wemm
80c706c80e Patch up some existing style bugs and some that crept in with the
DEVICE_POLLING stuff.
2001-12-15 02:51:21 +00:00
Luigi Rizzo
e4fc250c15 Device Polling code for -current.
Non-SMP, i386-only, no polling in the idle loop at the moment.

To use this code you must compile a kernel with

        options DEVICE_POLLING

and at runtime enable polling with

        sysctl kern.polling.enable=1

The percentage of CPU reserved to userland can be set with

        sysctl kern.polling.user_frac=NN (default is 50)

while the remainder is used by polling device drivers and netisr's.
These are the only two variables that you should need to touch. There
are a few more parameters in kern.polling but the default values
are adequate for all purposes. See the code in kern_poll.c for
more details on them.

Polling in the idle loop will be implemented shortly by introducing
a kernel thread which does the job. Until then, the amount of CPU
dedicated to polling will never exceed (100-user_frac).
The equivalent (actually, better) code for -stable is at

	http://info.iet.unipi.it/~luigi/polling/

and also supports polling in the idle loop.

NOTE to Alpha developers:
There is really nothing in this code that is i386-specific.
If you move the 2 lines supporting the new option from
sys/conf/{files,options}.i386 to sys/conf/{files,options} I am
pretty sure that this should work on the Alpha as well, just that
I do not have a suitable test box to try it. If someone feels like
trying it, I would appreciate it.

NOTE to other developers:
sure some things could be done better, and as always I am open to
constructive criticism, which a few of you have already given and
I greatly appreciated.
However, before proposing radical architectural changes, please
take some time to possibly try out this code, or at the very least
read the comments in kern_poll.c, especially re. the reason why I
am using a soft netisr and cannot (I believe) replace it with a
simple timeout.

Quick description of files touched by this commit:

sys/conf/files.i386
        new file kern/kern_poll.c
sys/conf/options.i386
        new option
sys/i386/i386/trap.c
        poll in trap (disabled by default)
sys/kern/kern_clock.c
        initialization and hardclock hooks.
sys/kern/kern_intr.c
        minor swi_net changes
sys/kern/kern_poll.c
        the bulk of the code.
sys/net/if.h
        new flag
sys/net/if_var.h
        declaration for functions used in device drivers.
sys/net/netisr.h
        NETISR_POLL
sys/dev/fxp/if_fxp.c
sys/dev/fxp/if_fxpvar.h
sys/pci/if_dc.c
sys/pci/if_dcreg.h
sys/pci/if_sis.c
sys/pci/if_sisreg.h
        device driver modifications
2001-12-14 17:56:12 +00:00
Luigi Rizzo
268cc03905 Remove printf's on mbuf/cluster allocation failures. There are now
equivalent and less dangerous (rate limited) messages in
the mbuf allocation code.

MFC after: 3 days
2001-12-14 05:56:35 +00:00
Luigi Rizzo
2dfc960a5b Avoid an unnecessary copy of a packet if it is already in a single mbuf.
Introduce an additional device flag for those NICs which require the
transmit buffers to be aligned to 32-bit boundaries.

(the equivalen fix for STABLE is slightly simpler because there are
no supported chips which require this alignment there.)
2001-12-11 02:47:53 +00:00
David E. O'Brien
6e551fb628 Update to C99, s/__FUNCTION__/__func__/,
also don't use ANSI string concatenation.
2001-12-10 08:09:49 +00:00
Coleman Kane
a28920935a This patch will fix the lockups associated with AMD 751,761,762 based AGP
controllers. There still seems to be some issues with the DRI copying code
for some adapters, at least it doesn't hang the system now. Input would be
appreciated.

PR: 32301
Obtained from:	Eric Anhlot <eanholt@gladstone.uoregon.edu>, Joe <joeo@nks.net>
2001-12-07 05:41:26 +00:00
Peter Wemm
341538b884 MFS (merge from stable): rev 1.13.4.13, fix ordering of IFF_RUNNING mods.
The reason we are required to commit to -current first is so that later
MFC's do not risk the loss of existing bug fixes.  Even if this was not
strictly required in -current, it should still be fixed there too.
2001-12-07 00:58:37 +00:00
Peter Wemm
3b3ec2004a MFS (merge from stable): rev 1.9.2.28, fix ordering of IFF_RUNNING mods.
The reason we are required to commit to -current first is so that later
MFC's do not risk the loss of existing bug fixes.  Even if this was not
strictly required in -current, it should still be fixed there too.
2001-12-07 00:57:57 +00:00
Guido van Rooij
7145906dd6 Add suspend/resume hooks to this driver; necessary to overcome
problems on HP Omnibook 500.

MFC after:	1 week
2001-12-05 10:34:07 +00:00
John Hay
16cba1662f Add VLAN support.
MFC after:	7 days
2001-12-05 09:34:28 +00:00
Luigi Rizzo
40129585e3 Remove error messages on mbuf allocation failures, now
this is done more safely in kern/subr_mbuf.c

Two-days'-delay-thanks-to: @home shutting down service
2001-12-04 02:30:53 +00:00
Brooks Davis
437e48e931 Don't pass an interface pointer to VLAN_INPUT{,_TAG}. Get it from the
mbuf instead.

Suggested by:	fenner
2001-12-03 17:28:27 +00:00
Luigi Rizzo
aec846d484 Per jlemon request, reintroduce some printf() when an
mbuf allocation fails, and fix (i hope) a couple of style bugs.

I believe these printf() are extremely dangerous because now they can
occur on every incoming packet and are not rate limited. They were
meant to warn the sysadmin about lack of resources, but now they
can become a nice way to panic your system under load.

Other drivers (e.g. the fxp driver) have nothing like this.

There is a pending discussion on putting this kind of warnings
elsewhere, and I hope we can fix this soon.
2001-11-29 23:47:47 +00:00
Luigi Rizzo
01faf54bb0 For i386 architecture, remove an expensive m_devget() (and the
underlying unaligned bcopy) on incoming packets that are already
available (albeit unaligned) in a buffer.
The performance improvement varies, depending on CPU and memory
speed, but can be quite large especially on slow CPUs. I have seen
over 50% increase on forwarding speed on the sis driver for the
486/133 (embedded systems), which does exactly the same thing.

The behaviour is controlled by a sysctl variable, hw.dc_quick which
defaults to 1. Set it to 0 to restore the old behaviour.

After running a few experiments (in userland, though) I am convinced
that doing the m_devget() is detrimental to performance in almost
all cases.

Even if your CPU has degraded performance with misaligned data,
the bcopy() in the driver has the same overhead due to misaligment
as the one that you save in the uiomove(), plus you do one extra
copy and pollute the cache.

But more often than not, you do not even have to touch the payload,
e.g. when you are forwarding packets, and even in the often-cited
case of NFS, you often end up passing a pointer to the payload to
the disk controller.

In any case, you can play with the sysctl variable to toggle between
the two behaviours, and see if it makes a difference.

MFC-after: 3 days
2001-11-29 22:46:48 +00:00
Luigi Rizzo
920dcd3fcb Remove the need for an expensive m_devget on the i386, which does not
have alignment problems.

On small boxes (e.g. the net4501 from Soekris, featuring a 486/133)
this provides huge performance benefits: the peak forwarding rate
with avg.sized packets goes up by 50-70% because of this change
alone. Faster CPUs might benefit less from this change, but in any
case the CPU has better things to do than waste time on useless
memory-to-memory copies.

Several drivers (for Tulip-like cards) might benefit from a similar
change.

Right now the new behaviour is controlled by a sysctl variable,
hw.sis_quick which defaults to 1 (on), you can set it to 0 to
reintroduce the old behaviour (and compare the results).  The
variable is only there to show how much you can gain with this
change, it will go away soon.

Also, slightly simplify the code to initialize the ring buffers,
and remove a couple of dangerous printf's which could trigger on
any packet in case of mbuf shortage.

MFC-after: 3 days
2001-11-28 16:10:37 +00:00
Luigi Rizzo
49a79b6661 Fix a bug in the driver -- under load, the receive unit could become
idle and the driver would not detect the event, requiring userland
to cycle the interface to bring it up again.
The fix consists in adding SIS_IMR_RX_IDLE to the interrupt mask and
add a command in sis_intr() to restart the receiver when this happens.

While at it, make the test of status bits more efficient.
2001-11-27 16:29:11 +00:00
Ruslan Ermilov
3e0cee70d7 Don't automatically unbind/deallocate memory when releasing.
This fixes the VT switching problem with the i810 X driver.

Explained by:	David Dawes <dawes@XFree86.Org>
Reviewed by:	dfr
2001-11-27 14:12:21 +00:00
Mitsuru IWASAKI
0c66d318dd Add suspend/resume code mostly merged from fxp driver. 2001-11-23 14:27:33 +00:00
John Baldwin
99efe4f0f8 Remove ifnet.if_mpsafe for now. If this is needed, it won't be needed
until much later when the network stack locking is farther along.

Approved by:	jlemon
2001-11-14 18:36:37 +00:00
Jun Kuriyama
6183dc49fb Add support for Intel's i820/i840/i845/i850/i860 chipset.
Submitted by:	nork@cityfujisawa.ne.jp (Norikatsu Shigemura)
PR:		kern/31559, kern/31825
MFC after:	1 week
2001-11-08 16:03:23 +00:00
Peter Wemm
da73fe05e1 Add AMD766 OHCI USB controller. Remove unused VENDORID lists. 2001-11-06 23:44:03 +00:00
Poul-Henning Kamp
45f40c7569 This file was part of something grander, which doesn't seem to be
around anymore.
2001-11-06 07:26:21 +00:00
Poul-Henning Kamp
4bdc9660e5 Remove unneeded call to cdevsw_add() 2001-11-04 08:44:49 +00:00
Peter Wemm
84e5eebd09 No FreeBSD/vax here either. 2001-11-03 08:32:28 +00:00
Peter Wemm
d5f6245f80 Add ICH3 (82801CA/CAM) and 460GX 2001-11-03 05:03:00 +00:00
Luigi Rizzo
935fe01014 Enable round-robin arbitration between transmit and receive unit
in the 21143, instead of giving priority to the receive unit.
This gives a 10-15% performance improvement in the forwarding rate
under heavy load.

Reviewed-by: Bill Paul
2001-10-27 00:59:17 +00:00
Luigi Rizzo
617b3dd758 Defs for three (unused so far) bits in PCI command/status register
were off by one bit.
2001-10-25 17:43:26 +00:00
Alan Cox
eab754b91d Implement TCP/IP checksum off-loading on send for the 3c905B and later
generation cards.
2001-10-22 06:45:42 +00:00
Matt Jacob
f2465b0df3 Remove this driver from FreeBSD.
Jonathon Lemon's driver (gx) is at least as fast and has more features
and is likely to be better supported.

It is also possible that Intel might support this chipset in FreeBSD
with their own driver. Somewhat secretive and furtive rumblings from
certain Yahoo employees have indicated that this might happen soon.

I'm a little unhappy at the lack of discussion on the net list about
this, or on developers, or on hackers, or the lack of mention on
audit. This then leaves me to try and figure out the right thing
to do.

I've concluded that the right thing to do is to remove wx from FreeBSD,
as this is probably best for FreeBSD.
2001-10-20 18:48:45 +00:00
Matt Jacob
819e7ffdf3 Whack on this soon to be deprecated driver.
What the heck, the OpenBSD version will benefit.

1. Add wx_txint_delay as a tunable (defaults to 5000 now, or ~5ms) and switch
to using delayed TXDW interrupts. Since the chip continues to reload the
TIDV with this value for each descriptor written back, this allows continued
deferral of the actual interrupt until the last packet completes (assuming
that 5ms between multiple packets transmitting is reasonable).

2. Add two other SYSCTL entities:

hw.wx.dump_stats
hw.wx.clear_stats

to be used, hackey hackey, to get the watchdog routine to dump/clear
the current softc statistics.

Usage would be:

	sysctl -w hw.wx.dump_stats=UNIT

to cause the current stats to be dumped for UNIT.

3. Attempt to clean up wx_detach routine so we don't panic. Well, things
still panic, but given that the code is just like other NIC drivers,
I suspect it's actually something elsewhere, like e1000phy, that's actually
blowing up.

4. Skip the entire test for runt packets- after doing somet thinking
and experimenting, I believe that the chip only doesn't like it if
the whole frame to xmit is < 16 bytes- each TFD can be some fragment
of that. This should improve performance a chunk because of all of the
(14 byte ETHERHEADER + DATA) mbuf chains.

5. Keep track of total frame length. Try not to xmit an odd byte frame-
this is supposed to get around some dumb Cisco switch problems.

6. On the last packet, also set Interrupt Delay && Report Packet Sent
(see #1 above)

7. Attempt to do xmit garbage collection *first* in order to avoid setting
IFF_OACTIVE if at all possible.

MFC after:	1 week
2001-10-15 06:59:41 +00:00
Matt Jacob
572ce00d3e Note that this driver is soon to be deprecated and removed from FreeBSD. 2001-10-09 00:14:41 +00:00
Matt Jacob
77049e810b Let's not kid ourselves- we don't *really* support jumbframes yet.
We only support the size of frame we are currently allocating, which
is MCLBYTES - sizeof (struct ether_header) usable, so don't set an
MTU that would go over this.
2001-10-02 22:36:49 +00:00
Matt Jacob
1c3903d23f Various fixes and improvements- some from the folks at Sitara Networks (thx) 2001-10-02 22:21:21 +00:00
Matt Jacob
4a5470eebd Remove all OpenBSD/NetBSD code. It was the right place to start from, but
it now really gets in the way.

This allows us to fix several problems- not least of which was problems
of ordering about when you'd have a device softc for an miibus child
available or not. Move some steps of things around.

Put the ifnet/arpcom structure at the head of the softc (PR 29249).

Don't do tx gc in the interrupt service routine- that seems to make
things a bit more efficient.

Enable jumbo support by default- but this version of 'jumbo' is broken
because it really is just using multiple tfd/rfd's to match a packet,
which will never be > CLSIZE anyway.

This should begin the first steps toward cleaning this driver up.

PR:		29249
MFC after:	1 week
2001-10-02 00:13:44 +00:00
Jonathan Lemon
cd62a9cb38 Do not call mii_pollstat() from within device tick routines; the status
information is updated by mii_tick().

Pointed out by: wpaul (a while back)
2001-09-29 19:28:31 +00:00
Luigi Rizzo
88f6feee74 Fix typo in a comment.
MFC-after: 3 days
2001-09-27 12:01:57 +00:00
Alan Cox
391fa6d3d4 Implement TCP/IP checksum off-loading on receive. Announce
rxcsum capabilities.

Reviewed by:	wpaul
2001-09-23 05:13:12 +00:00
Coleman Kane
57110f7604 Add probe line for the AMD 761 northbridge chip. At least it detects now,
seems to set up memory spaces correctly. This change actually did work for
me using -STABLE, XFree86 4.0.3 ~ some snapshot of DRI awhile back. I sent
mail to dfr to no avail, perhaps someone else would like to test it with
DRI.

Anyway, people have been nagging me about this change for awhile, so here's
the commit.
2001-09-20 05:13:12 +00:00
Jonathan Lemon
53de2fb09f Have the driver advertise that it is capable of hardware checksums, and
allow the user to control the setting.  (checksums are enabled by default)
2001-09-18 18:40:22 +00:00
Murray Stokely
c896039b9b SMBus support for the AMD 756 power management unit. See smbus(4),
amdpm(4) and smb(4).

This device can be used with userland programs such as sysutils/lmmon
to retrieve sensor information from the motherboard.

PR:		   kern/23989
Obtained from:	   Matthew C. Forman <mcf@dmu.ac.uk>
Based on:	   alpm(4)
2001-09-16 22:35:07 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Brooks Davis
5c88c82cf3 Update tx(4) to always enable vlan(4) support.
Approved by:		semenu
2001-09-05 23:04:53 +00:00
Brooks Davis
9d4fe4b2b0 Make vlan(4) loadable, unloadable, and clonable. As a side effect,
interfaces must now always enable VLAN support.

Reviewed by:	jlemon
MFC after:	3 weeks
2001-09-05 21:10:28 +00:00
Bill Paul
1af8bec768 Add support for Conexant LANfinity miniPCI controllers. People who have
laptops with this chip should test this and report back as I don't have
access to this hardware myself. People with -stable systems should try
the patch at:

	http://www.freebsd.org/~wpaul/conexant.patch.gz

Submitted by:	Phil Kernick <Phil@Kernick.org>
2001-09-04 17:10:11 +00:00
Søren Schmidt
38090f05c2 Remove long overdue obsolete file ide_pcireg.h 2001-09-04 15:52:00 +00:00
Jonathan Lemon
cf9d4cbfc6 The fxp driver has lived in dev/fxp for some time, remove old files. 2001-08-31 02:21:03 +00:00
Doug Rabson
7e59bf6765 Recognise VIA Apollo KT133A bridge.
PR:	30061
Submitted by:	John Merryweather Cooper <jmcoopr@webmail.bmi.net>
MFC after:	1 week
2001-08-30 14:17:48 +00:00
Bill Paul
d93d282620 Add support for the 3c656B cardbus adapter. This is one half of a
dual function card. It needs pretty much the same flags as the 656C,
except that it seems to need both the INVERT_MII_PWR and INVERT_LED_PWR
flags set. Tested with cardbus in -current as of today.

Also added support for the 3c656, which looks to be the same as
the 656B, except it doesn't need the EEPROM_8BIT flag. I think. This
one is untested, but the added support should not break any of the
other cards.
2001-08-28 00:40:18 +00:00
Matt Jacob
38db9454de John Polstra
bogus additional write to WXREG_IMASK that enabled *all* interrupt causes
while I was trying to disable the chip. Oops.
2001-08-24 23:08:13 +00:00
Bill Paul
645ed1a78b Fix a bug in the ste_setmulti() routine. The NIC has 4 16-bit multicast
hash registers, not 2 32-bit ones. This would prevent the multicasr filter
from being programmed correctly in some cases.
2001-08-23 18:22:55 +00:00
Bill Paul
d3ab0d02cf After one more day of testing, make what I hope are the final tweaks to
prevent/workaround TX lockups in this driver. The secret seems to be to
not let the TX DMA queue become too full. If we have too many packets
in the queue, we should wait for them to drain a bit before trying to
queue more. This should prevent the lockup from occurring, and if it
does occur, there is special code in sf_start() to kick the NIC in the
head and get it going again.

Special thanks to Glen Neff for helping me test this fix.
2001-08-16 20:15:16 +00:00
Bill Paul
fa97ab323c Still more changes to try to prevent TX lockups. Will wait for one more
night of testing before merging to -stable.

Also added to code to detect TX underruns and automatically increase the
TX threshold to avoid them. Carefully placed diagnostig printf() about
this under #ifdef DIAGNOSTIC to avoid getting any panicky e-mails from
confused users, like I always do with the xl and dc drivers.
2001-08-16 00:32:20 +00:00
Bill Paul
0a4b345e9f Tweak the interrupt handler so that we call the txeof handler more often,
to hopefully prevent the TX DMA queue from filling up and never getting
flushed.
2001-08-15 17:46:57 +00:00
Bill Paul
0219a42155 Convert the if_sis and if_rl drivers to use the bus_dma API instead of
calling vtophys() and contigmalloc()/contigfree() directly. Hopefully,
I have shaken out all of the problems with busdma on the alpha now.
(Everything seems to work as expected.)

Also, change the max RX DMA limit to 1024 bytes instead of "unlimited,"
as the latter seems not to work correctly on the alpha that I tested.
(At 100Mbps, all attempts to receive frames yield RX errors.)
2001-08-15 17:38:43 +00:00