Commit Graph

631 Commits

Author SHA1 Message Date
Bill Paul 7d8b3c341b Modify the xl_mediacheck() routine to also test for the case where the
XCVR value read from the EEPROM is completely wrong. I've had one report
of a 3c900 card that returns an xcvr value of 14, which is impossible
(the manual states that all vales above 8 are reserved). If the value
is out of the expe

Add PCI vendor ID for the 3c980-TX server adapter card, which apparently
also uses the cyclone chip. Graciously supplied Mats O Jansson
<maja@cntw.com>.

Also noted by Mats, the 10mpbs cyclone adapters should be named 3c900B,
not 3c905B. I haven't actually encountered a 10mbps only cyclone adapter
yet, nor anybody who has one, but this makes sense given the naming
scheme used for the older boomerang adapters.
1998-09-04 16:22:15 +00:00
Bill Paul 5ca6331a4c "xl%d: chip is is in D%d power mode " -> "xl%d: chip is in D%d power mode " 1998-09-01 21:32:04 +00:00
Søren Schmidt f90ea9ee53 Fixed bug in Miro Tuner detection. Missing Goto.
Removed Hauppauge EEPROM 0x10 detection as I think 0x10 should be a
PAL tuner, not NTSC.
Reinstated some Tuner Guesswork code from 1.27

Submitted by:	Roger Hardiman <roger@cs.strath.ac.uk>
1998-08-31 18:37:19 +00:00
Søren Schmidt 58dde31aeb Renamed BT848[SG]CAPAREA to BT848_[SG]CAPAREA.
Added PR kern/7177 for SECAM Video Highway Xtreme with single crystal
PLL configuration submitted by Vsevolod Lobko <seva@alex-ua.com>.
In kernel configuration file add
options OVERRIDE_CARD=2
options OVERRIDE_TUNER=11
options BKTR_USE_PLL

Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>
1998-08-31 18:35:06 +00:00
Søren Schmidt 5d0c8abac1 Added Capture Area ioctl - BT848[SG]CAPAREA.
Normally the full 640x480 (768x576 PAL) image is grabbed. This ioctl
allows a smaller area  from anywhere within the video image to be
grabbed, eg a 400x300 image from (50,10).
See restrictions in BT848SCAPAREA.

Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>
1998-08-31 18:31:36 +00:00
Bill Paul cdb5ef5fba Fix handling of ENOBUFS condition. During reception, the filled mbuf
cluster from the RX descriptor is passed up to the higher layers and
replaced with an empty buffer for the next time the descriptor comes
up in the RX ring. The xl_newbuf() routine returns ENOBUFS if it can't
obtain a new mbuf cluster, but this return value was being ignored.
Now, if buffer allocation fails, we leave the old one in place and
drop the packet. This is rude, but there's not much else that can be
done in this situation.

Without this, the driver can cause a panic if the system runs out of
MBUF clusters. Now it will complain loudly, but it shouldn't cause a
panic.

Also added another pair of missing newlines to some printf()s.
1998-08-31 15:26:09 +00:00
Bill Paul 11f73a416e Change the autonegotiation waiting period from 3 seconds to 5. This
delay controls how long the driver waits for autonegotiation to
complete after setting the 'autoneg restart bit' in a PHY. In some
cases, it seems 3 seconds is not long enough: with 3c905-TX cards
(external PHY), you sometimes see 'autoneg not complete; no carrier'
errors due to the timeout being too short. (3c905B adapters seem to
be happy with 3 seconds though.)
1998-08-30 22:24:18 +00:00
Bill Paul 128a646cd1 - #define mask of enabled interrupts/indications in if_xlreg.h instead of
constructing local copy in xl_init()
- disable interrupts on entry to xl_intr(), re-enable them on exit.
- fix a few typos in some comments
1998-08-24 17:51:38 +00:00
Bill Paul ea9c501856 Increase the number of descriptors (and, as a consequence, the number
of associated mbuf clusters) in the RX ring from 4 to 16. On my
really fast PI 400Mhz test machines, 4 descriptors (and associated
mbuf clusters) is enough to achieve decent performance without any
RX overruns. However, one person reported problems with the following
scenario:

- P90 system running FreeBSD with a 3c905B-TX adapter, slow IDE hard
  disk (Quantum Bigfoot?)
- PII 266 with SCSI disks running LoseNT and also with a 3c905B-TX
- Both machines connected together via crossover cable at 100Mbps
  full-duplex
- LoseNT machine writing largs amounts of data (2.5 GB work of
  files each in the neighborhood of 1 to 2 MB in size) via samba to
  the FreeBSD machine

In this case, the LoseNT machine is sending data very fast. Apparently
there weren't any problems initially because the user was writing to
one particular disk which was relatively fast, however after this disk
filled up and the user started writing to the second slower disk, RX
overruns would occur and sometimes the RX DMA engine would stall after
a 100 to 500MB had been transfered. The xl_rxeof() handler is supposed
to detect this condition and restart the upload engine; I'm not sure
why it doesn't, unless interrupts are being lost and the rx handler
isn't getting called.

This is still an improvement over the Linux driver, which uses 32
descriptors in its receive ring. :)

Problem reported by: Heiko Schaefer <hschaefer@fto.de>
1998-08-21 16:58:48 +00:00
Bill Paul 98fd9b6126 Fix small printf() bogon (forgot newline, and the message was longer that
80 cols).
1998-08-20 14:48:58 +00:00
Bill Paul 4b5709adb1 Make two changes:
If I'm reading the manual correctly, the 3c905B actually loses its
PCI configuration during the transition from D3(hot) back to D0, not
during the transition from D0 to D3(hot). This means it should be possible
to save the existing PCI settings, restet the power state, then restore
the PCI settings afterwards. Changed xl_attach() to attempt this first
thing before the normal PCI setup. I'm not certain this will work correctly,
but it shouldn't hurt.

If xl_init() is called while an autoneg session is in progress, the
autoneg timeout and chip state will get clobbered. Try to avoid this
by checking sc->xl_autoneg at the start of xl_init() and defer
the initialization until later if it's set. (xl_init() is always called
at the end of an autoneg session by xl_autoneg_mii().)

Problem pointed out by: Larry Baird <lab@gta.com>
1998-08-19 15:07:46 +00:00
Bruce Evans 18df27bda2 Fixed printf format errors. 1998-08-18 00:32:50 +00:00
Bruce Evans bbd6948a3c Fixed printf format errors (none detected in GENERIC again). 1998-08-17 19:06:47 +00:00
Bill Paul e30938ce3a Import the (Fast) Etherlink XL driver. I'm reasonally confident in its
stability now. ALso modify /sys/conf/files, /sys/i386/conf/GENERIC
and /sys/i386/conf/LINT to add entries for the XL driver. Deactivate
support for the XL adapters in the vortex driver. LAstly, add a man
page.

(Also added an MLINKS entry for the ThunderLAN man page which I forgot
previously.)
1998-08-16 17:14:59 +00:00
Bruce Evans 86a14a7a0a Use [u]intptr_t instead of [u_]long for casts between pointers and
integers.  Don't forget to cast to (void *) as well.
1998-08-16 01:21:52 +00:00
Justin T. Gibbs 188fafbc3f Use "baseclass" instead of "class" for storing the contents of PCI register
0xB so that C++ programs can use the PCI conf interface.
1998-08-13 19:12:20 +00:00
Bruce Evans b97fc94873 Use [u]intptr_t instead of [unsigned] long to convert and/or represent
pointers.

This finishes fixing conversions between pointers and integers of
possibly different sizes in GENERIC.
1998-08-10 17:21:49 +00:00
Bruce Evans c41141b002 Fixed the formatting of some tables (mainly the one produced by ps
in ddb) which I broke by changing %8[l]x to %8p.  Hacked the central
printf routine to not add an "0x" prefix for %p formats if the field
width is nonzero.  The tables are still horribly misformatted on
64-bit machines.

Use %p instead of %8p to print pointers when the field width isn't
important.
1998-08-10 14:27:34 +00:00
Søren Schmidt 1ae0c4bba2 Support the PAL version of the BT878 based Haupauge WinTV/PCI.
Submitted by: Matthias Scheler <tron@netbsd.org>
1998-08-10 06:39:33 +00:00
Jordan K. Hubbard afc2d1c74e A few misc changes to get the spigot and meteor board working in 3.0.
Submitted by:	Jim Lowe <james@miller.cs.uwm.edu>
1998-08-08 19:26:08 +00:00
Søren Schmidt 4c6d55f0fb Updated Hauppauge detection code for Tuner ID 0x0a for newer NTSC
WinCastTV 404 with Bt878 chipset.  Tidied up PAL default in video_open()

Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>
1998-08-08 07:15:16 +00:00
Doug Rabson 8b761c8004 Remove a stupid hack of mine which prevented PCI io memory access on the alpha. 1998-08-07 08:20:36 +00:00
Eivind Eklund b755b88510 Update DPT driver from 1.4.3 to 1.4.5
Submitted by: Simon Shapiro <shimon@simon-shapiro.org>
1998-08-05 00:54:38 +00:00
David Greenman 3114fdb4c0 Implemented a more sophisticated mechanism for handling transmitter
interrupts which now defers them until the transmit queue if filled
up with completed buffers. This has two advantages: first, it reduces
the number of transmitter interrupts to just 1/120th of the rate
that they occured previously, and two, running down many buffers
at once has much improved cache effects.
1998-08-04 08:53:12 +00:00
Bill Paul 33e929e1c4 Fix this thing to work properly with multiple tlan adapters; increment
unit count correctly.

Problem reported by Larry Baird <lab@gta.com>.
1998-08-04 01:38:52 +00:00
Bill Paul c3ed41584c Updates for the ThunderLAN driver:
- probe for PHYs by checking the BMSR (phy status) register instead
  of the vendor ID register.

- fix the autonegotiation routine so that it figures out the autonegotiated
  modes correctly.

- add tweaks to support the Olicom OC-2326 now that I've actually had
  a chance to test one

	o Olicom appears to encode the ethernet address in the EEPROM
	  in 16-bit chunks in network byte order. If we detect an
	  Olicom card (based on the PCI vendor ID), byte-swap the station
	  address accordingly.

	  XXX The Linux driver does not do this. I find this odd since
	  the README from the Linux driver indicates that patches to
	  support the Olicom cards came from somebody at Olicom; you'd
	  think if anyone would get that right, it'd be them. Regardless,
	  I accepted the word of the disgnoatic program that came bundled
	  with the card as gospel and fixed the attach routine to make
	  the station address match what it says.

	o The version of the 2326 card that I got for testing is a
	  strange beast: the card does not look like the picture on
	  the box in which it was packed. For one thing, the picture
	  shows what looks like an external NS 83840A PHY, but the
	  actual card doesn't have one. The card has a TNETE100APCM
	  chip, which appears to have not only the usual internal
	  tlan 10Mbps PHY at MII address 32, but also a 10/100 PHY
	  at MII address 0. Curiously, this PHY's vendor and device ID
	  registers always return 0x0000. I suspect that this is
	  a mutant version of the ThunderLAN chip with 100Mbps support.
	  This combination behaves a little strangely and required the
	  following changes:

		- The internal PHY has to be enabled in tl_softreset().
		- The internal PHY doesn't seem to come to life after
		  detecting the 100Mbps PHY unless it's reset twice.
		- If you want to use 100Mbps modes, you have to isolate
		  the internal PHY.
		- If you want to use 10Mbps modes, you have to un-isolate
		  the internal PHY.

	The latter two changes are handled at the end of tl_init(): if
	the PHY vendor ID is 0x0000 (which should not be possible if we
	have a real external PHY), then tl_init() forces the internal
	PHY's BMCR register to the proper values.
1998-08-03 01:33:12 +00:00
David Greenman 35517ab7e8 Added 82555B support for media status. 1998-08-02 00:33:38 +00:00
David Greenman 3614387536 Reordered fxp_softc for optimal cacheline behavior. 1998-08-02 00:29:15 +00:00
David Greenman b63e51cae4 Killed unused variable/assignment. 1998-08-02 00:28:45 +00:00
Doug Rabson e8669bcd43 Add a call to a platform-specific irq remapping function for alpha platforms
which don't record the correct irqs in PCI config space.

Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-07-22 08:40:46 +00:00
Doug Rabson df9efa9a8b On the alpha, ports may be allocated above 64k.
Change the port address argument to pci_map_port to pci_port_t* which is
defined as u_int on the alpha, u_short on i386.  This is a stopgap with a
hopefully limited lifetime.

Discussed with: Stefan Esser <se@freebsd.org>
1998-07-22 08:39:08 +00:00
Mike Smith 2512c3e67b Add support for PCNet PCI chips that only work when we talk to them as ISA
devices. Specifically fix the case for the Hitachi version as used in
their VisionBook models.

Submitted by:	Ted Faber <faber@isi.edu>
1998-07-20 17:33:01 +00:00
Justin T. Gibbs 47402bab91 Correct SEEPROM checksum calculation when multiple checksum attemps are made.
Pointed out by:	"Jose M. Alcaide" <jose@we.lc.ehu.es>
1998-07-16 19:33:43 +00:00
Bruce Evans a23d65bfc8 Cast pointers to uintptr_t/intptr_t instead of to u_long/long,
respectively.  Most of the longs should probably have been
u_longs, but this changes is just to prevent warnings about
casts between pointers and integers of different sizes, not
to fix poorly chosen types.
1998-07-15 02:32:35 +00:00
Søren Schmidt aad7cac45a Add support for the AVer Media range of cards. 1998-07-14 21:19:58 +00:00
Bruce Evans 88472e74e8 Avoid some casts of pointers to integers (of possibly different sizes). 1998-07-14 11:19:32 +00:00
Amancio Hasty 596e9516c8 I checked in the wrong version yesterday . The correct version is 1.38
Amancio
1998-07-14 07:11:20 +00:00
Bill Paul fb1305c426 Declare pointers to CSR register space to be volatile. This seems to
cure the problems I was having with interrupts not being acknowledged
on time. This fixes a problem I observed where starting two ping -f
processes at 10Mbps would cause an adapter check due to TX GO commands
being issued before TXEOC interrupts were being acked.

Also fix a small problem with tl_start(): the mechanism I was using
to queue new packets onto the TX chain was bogus.

Change adapter check handler so that it resets card state after
tl_softreset() is stored.

Moved all EEPROM-related macro definitions into if_tlreg.h.

Don't allow an autoneg session to start until after the TX queue has
been drained, and don't transmit anything until after the autoneg
session is complete.

Also add support for two more Compaq ThunderLAN-based cards, and three
cards from Olicom which also use the ThunderLAN chip. The only thing
different about the Olicom cards is that they store the station address
at a different location within the EEPROM.
1998-07-13 18:15:48 +00:00
Bruce Evans 9bffbcd4f5 Fixed printf format errors (only 1 left in GENERIC now). 1998-07-13 09:53:11 +00:00
Amancio Hasty 63ca8cabf9 Improved Hauppauge's tuner detection and bt878 support
Amancio
1998-07-13 02:16:34 +00:00
Stefan Eßer e1b7cfe2bf Remove unused member reselet from struct tstamp. 1998-07-12 20:32:52 +00:00
Stefan Eßer e275daef22 Fix size of time stamps (had been time_t before the variable "time" was
hidden). Now "ticks" are used, which are 4 byte, not 8 byte in size.
The size mismatch did not matter due to sufficient padding at the end
of the structure that holds time stamps (there is an unused member).

The fix suggested by Bruce Evans used "sizeof (ticks_t)", but I prefer
to use "sizeof ticks", and didn't seem to object in his last mail on
this topic.

Submitted by:	bde
1998-07-12 20:26:45 +00:00
Bruce Evans ac1e407b32 Fixed printf format errors. 1998-07-11 07:46:16 +00:00
Peter Wemm e77902181c Merge changes from vendor branch. 1998-07-08 01:24:37 +00:00
Bruce Evans 6aa42d9a4e Changed `#if defined(i386)' to `#ifdef __i386__'.
`#if defined(ONE_THING)' is a style bug, and i386 instead of __i386__
is a bug, since i386 is never defined when the kernel is compiled
by with the default flags (`gcc -ansi ...').  Here the bug disabled
the call to pmap_setvidram(), so ISA video memory was not mapped
WC on 686's.  The bug may have been masked by bugs in the committer's
version of gcc - `gcc -ansi' incorrectly defines i386 for gcc = the
version of egcs on the 2.2.6 cdrom.
1998-07-07 05:00:09 +00:00
Justin T. Gibbs 2f333cd887 Attempt to load serial eeprom contents in both 93c46 and 93c56/66 mode before
giving up.

PR: 6966
1998-07-06 18:38:57 +00:00
Semen Ustimenko e3e1bee33a Fix some strange errors of shutting transmitter up when start
transmition after software reset with no link estabilished yet.
Fix TX DMA stop method (queue last packet to stop).

PR:		i386/6578
1998-07-04 08:02:46 +00:00
John-Mark Gurney e261d589ff document PCI_QUIET that prevents pci from compiling in so many strings 1998-06-30 08:13:27 +00:00
Bruce Evans be160d60ab Removed unused includes. 1998-06-21 18:02:50 +00:00
Bruce Evans e5b19842ef Removed unused includes. 1998-06-21 14:53:44 +00:00