Commit Graph

992 Commits

Author SHA1 Message Date
Nick Sayer
db49f041ae Import PCI pccard bridge chip probing from PAO. Hopeful prelude for
broadening chipset support in -current.

Reviewed by:	joerg
Obtained from:	PAO
1999-04-01 15:28:10 +00:00
Bill Paul
8919d7d4e7 Make the Macronix driver work on FreeBSD/alpha and add to GENERIC.
Like the PNIC, we have to copy packet headers in the receive handler
because the chip will only DMA to longword aligned buffers.

Also do some mindor cleanups.
1999-04-01 02:09:37 +00:00
Bill Paul
11ebc6f0fa Shorten device names so that the pci probe lines don't exceed 80 chars
and wrap to a second line.

Put 'command never completed' message inside #ifdef DIAGNOSTIC/#endif to
stop people worrying about it (it's harmless).
1999-03-31 15:45:15 +00:00
Nick Sayer
4db9b34751 Add support for bridging to if_tx.c
PR:		10534
Submitted by:	nsayer
1999-03-31 13:50:52 +00:00
Bill Paul
25223996f1 Insert ifmedia_set() that I forgot and put in the vtophys() hack for
the alpha. Now the ThunderLAN driver works on the alpha (both my
sample cards check out.) Update the alpha GENERIC config to include
ThunderLAN driver now that I've tested it.
1999-03-31 04:04:14 +00:00
Bill Paul
5563ee5462 Fix a line wrap bogon. 1999-03-30 19:33:47 +00:00
Bill Paul
85c47a212e Various updates for the ThunderLAN driver:
- When trying to map ports, if mapping TL_PCI_LOIO or TL_PCI_LOMEM fails,
  try mapping the other one. Apparently, some ThunderLAN parts swap these
  two registers while others don't.

- Add support for bitrate (non-MII) PHYs. If no MII-based PHY is found,
  program the chip for bitrate mode. This is required for the TNETE110
  part, which doesn't have MII support. (It's also obsolete, but there
  are still some people out there who have them.) With this change and the
  change above, the Compaq Netflex-3/P 10baseT/BNC board works correctly.
  (Thanks to Matthew Dodd for getting me one of these cards.)

- Convert to bus_space_foo() for register accesses.

- Add changes to support FreeBSD/Alpha. I still have to actually test
  this in my Alpha box so I'm not going to update /sys/alpha/conf/GENERIC
  yet.
1999-03-30 17:07:20 +00:00
Greg Lehey
89d8b5e853 Add support for SiS 5591/5595 chipset.
Contributed-by: "Richard Seaman, Jr." <dick@tar.com>

Tested-by:	Chris Piazza <cpiazza@home.net>
		Tugrul Galatali <tugrul@ianai.BlackSun.org>
		grog

This code includes lots of stuff for verbose probing.  I'm not 100%
sure that the output of the verbose probe is correct, but everything
else works fine, and -CURRENT was broken for the 5591 before, so I'm
committing it anyway.
1999-03-28 05:05:12 +00:00
Nick Hibma
e1c81f1d94 Cleaning up of code, remove unneeded cruft and make
code more compact.
1999-03-27 23:08:44 +00:00
Bill Paul
8fe2c75e31 Make the xl and pn drivers work on FreeBSD/alpha and add them to
sys/alpha/conf/GENERIC.

Note: the PNIC ignores the lower few bits of the RX buffer DMA address,
which means we have to add yet another kludge to make it happy. Since
we can't offset the packet data, we copy the first few bytes of the
received data into a separate mbuf with proper alignment. This puts
the IP header where it needs to be to prevent unaligned accesses.

Also modified the PNIC driver to use a non-interrupt driven TX
strategy. This improves performance somewhat on x86/SMP systems where
interrupt delivery doesn't seem to be as fast with an SMP kernel as
with a UP kernel.
1999-03-27 20:41:25 +00:00
Matt Jacob
92c49d78da enable 1080 LVD support 1999-03-25 22:53:56 +00:00
Nick Hibma
d0ef08ba15 Check whether the PIRQD enable bit is set in LegSup and if not, set it.
On my PIIX4 chip rev 1 this is required. Have not had any complaints from
other people so it might be a problem with this stepping.
1999-03-23 21:37:45 +00:00
Justin T. Gibbs
73c9c6dd62 Add support for the 3950U2B controller.
Recognize aic7895 controllers that have been "acquired" by a RAIDPort
card as normal aic7895s.

Recognize the aic7815 Raid Parity/Memory controller chip and notify
the user that it's RAID functionality will be ignored.
1999-03-23 07:26:41 +00:00
Wes Peters
df373873b5 Turn on PCI bus mastering in driver attach routine
to avoid hanging the system if the BIOS has not
initialized the interface.

PR:		10150
Reviewed by:	dg
1999-03-20 04:51:25 +00:00
Luigi Rizzo
ab090e5b4e MF22... add bridging support to the device drivers. Without this
bridging cannot work on -current/releng3!
1999-03-17 16:44:53 +00:00
Matt Jacob
d59bd46908 Prep for 1080/1240 support. Those fine h/w engineers at Qlogic
gave yet another internal register layout model for what is
*still* the same architecture. I hope they saved billyuns of gates
'coz otherwise this is *really* annoying.
1999-03-17 05:07:18 +00:00
Peter Wemm
ac3101276b Merge NetBSD 1.80->1.82 changes from vendor branch into mainline. 1999-03-14 08:32:52 +00:00
Semen Ustimenko
29563129dd Implemented workaround for EPIC's Application Note 7-15 (concerning
chip int. and ext. clock synchronisation). Fixed workaround for
transmit threshold underrun. Added volatile keyword to CSR_READ_* and
CSR_WRITE_* macroses. Added DELAYs to eliminate randomness caused
by processor speed. Fixed all TXCON and RXCON registers to be accessed
only when chip is idle, as manual told. Changed epic_init_phy to
drop link by isolating and going loopback, should should force link
partner to restart autonegotiation.

PR: kern/10535,	kern/9742, kern/10575
Submitted by:	Peter Jeremy, David Greenman
1999-03-14 08:30:23 +00:00
Peter Wemm
3b419f5843 set if_snd.ifq_maxlen to something reasonable - note that if_de.c has
a wierd double-queue arrangement..  It always empties the if_snd queue
then puts the transmit packets into a different queue that is limited
by the number of TX descriptors and does it's own discards...
This should stop the boot-time XXX warning anyway.
1999-03-13 09:21:27 +00:00
Poul-Henning Kamp
68f6066e6b Fix Typo. 1999-03-12 11:09:18 +00:00
Poul-Henning Kamp
32c203577a Make even more of the PPSAPI implementations generic.
FLL support in hardpps()

Various magic shuffles and improved comments

Style fixes from Bruce.
1999-03-11 15:09:51 +00:00
Andreas Klemm
1853e64dca Fix from author of the driver:
The i++ loop from 1..1000 is too small on very fast machines like
PII 450 MHz. Increasing the loop from 1..100000 lets the machine
access PHY. After this patch it's possible to use a SMC PCI card
on a HP Kayak XA series PC Workstation. Workaround until this fix
was to enable debugging in the driver (#define EPIC_DEBUG 1).

Without that patch you get an undefined state:
while true
do
ifconfig -a | grep status:
done
The status messages flaps between twwo values, but not
"connected".

Obtained from:	Ustimenko Semen <semen@iclub.nsu.ru>
1999-03-09 17:30:12 +00:00
Justin T. Gibbs
b08ce6a386 Add untested code to support the aha2930U2W.
Modify to deal with changes in the storage of user negotiation settings.
1999-03-05 23:28:36 +00:00
Luigi Rizzo
d560f7208b Fix handling of IFF_ALLMULTI. The code did not call
tulip_addr_filter() on SIOCSIFFLAGS, and was nuking the IFF_ALLMULTI
on entering tulip_addr_filter(). As a result it was impossible to run
a multicast router on a machine with a "de" interface.
1999-03-01 16:54:28 +00:00
Bill Paul
69807449d7 Remove call to DELAY() from xl_wait(), since xl_wait() is in the
interrupt handler codepath. Having the delay there didn't really
accomplish much anyway.
1999-02-26 08:39:24 +00:00
Bill Paul
46d13fc612 Add PCI device ID for the PNIC II. 1999-02-26 07:50:53 +00:00
Roger Hardiman
efe3a31e73 My changes:
Added autodetection of MMAC Osprey 100 card for
Jan Schmidt <mmedia@rz.uni-greifswald.de>. The MMAC card has an EEPROM
which contains an ASCII string beginning with "MMAC".
Corrected Hauppauge Audio Mux Mute value from 0x01 to 0x04.
Fixed a typo.

Sumitted change:
Added ALPS Tuner Type submitted by Hiroki Mori <mori@infocity.co.jp>

Submitted by:	Roger Hardiman and Hiroki Mori <mori@infocity.co.jp>
1999-02-25 07:45:47 +00:00
Bill Paul
141ae16656 Add support for still more cheapo 10/100 cards: Delta Electronics and
Addtron appear to have their own VIA Rhine II and RealTek 8139 boards
with custom PCI vendor and device IDs. This commit updates the PCI
vendor and device lists in the vr and rl drivers so that we can probe
the additional devices.

Found by: nosing around the PCI vendor and device code list at:
	http://www.halcyon.com/scripts/jboemler/pci/pcicode
1999-02-23 15:38:25 +00:00
Bill Paul
e945f65af7 Dangit... made a typo in the NEXPTR register definition (0x55 -> 0x45). 1999-02-23 02:00:06 +00:00
Bill Paul
4bfc6cc972 Minor updates for the ASIX AX88141, which is a newer version of the
AX88140A with power management and magic packet support. Correct the
addresses of the PCI power management registers and add some code to
detect the revision ID of the AX88141 and identify it in the probe
messages.

No other changes are needed since the AX88141 is functionally
identical to the AX88140A.
1999-02-23 01:52:42 +00:00
Doug Rabson
7845080b68 Add support for Compaq ProLiant 1200 host to PCI bridge.
Obtained from: 2.2 branch
Reviewed by: Benjamin Lewis <bhlewis@gte.net>
1999-02-21 11:39:37 +00:00
Nick Hibma
fe5ba84529 Moved [uo]hci_pci.c from /sys/dev/pci to /sys/pci after Soren
threatened to send Bruce. These files are no longer shared
   with NetBSD anyway.

   Requires a config and make depend.
1999-02-18 21:42:19 +00:00
Nick Hibma
47fd282734 Undo Nicolas' changes (1.91->1.92, added USB controller in pcisupport.c).
Please don't.
1999-02-18 18:48:01 +00:00
Nicolas Souchu
5ca2e94010 Add alpm.c, Aladdin Power Management SMBus support for the SMBus framework.
Update pcisupport.c with NALPM and Aladdin USB detection printf.
1999-02-13 17:51:46 +00:00
Julian Elischer
a728078455 Improved reporting of autodetected speed and duplex.
Now should be able to report speed for cards using NatSemi PHY.
(if you have one please let me know if it works as I
only have the Intel version)

Reviewed by: David Greenman <dg@root.com>
1999-02-12 17:56:23 +00:00
Bill Paul
021f8bcb89 Do not issue RX and TX reset commands in xl_stop() and xl_init(). On the
3c905B, the RX and TX reset commands also reset the cyclone chip's internal
PHY, which causes it to restart its autonegotiation session. This takes a
second or two to complete, which makes the interface seem to stop responding
for a few seconds every time you do something that reinitializes it.

Issuing the RX and TX resets on the older 3c905 boomerang adapters doesn't
cause any delay because the boomerang chip requires an external PHY.

This should fix the problem where people doing network installs via 3c905B
cards experience a delay after the interface is first initialized, among
other things.
1999-02-11 23:59:29 +00:00
Julian Elischer
da15ec8bf7 Define more registers and fix incorrect (but unused) register bit definitions. 1999-02-11 23:41:21 +00:00
Julian Elischer
f1bf08c22e Define more registers in the PHY unit and use them to report back
the result of the media auto negotiation.

Reviewed by: David Greenman <dg@freebsd.org>
1999-02-11 21:47:10 +00:00
Roger Hardiman
f02529f9b2 Added ioctl REMOTE_GETKEY for Hauppauge Infra-Red Remote Control.
Submitted by Roger Hardiman.

Added ioctl TVTUNER_GETCHANSET to discover which regions the bktr driver
supports. Submitted by Vsevolod Lobko <seva@alex-ua.com>

Added BT848_GPIO_SET_EN,BT848_GPIO_SET_DATA (and GETs) to allow user land
control of the GPIO pins. This allows a Radio module on the GPIO port
to be controlled. Submitted by Vsevolod Lobko <seva@alex-ua.com>
The kernel option BKTR_GPIO_ACCESS must be used to enable the GPIO ioctls.

Submitted by:	Roger Hardiman and Vsevolod Lobko <seva@alex-ua.com>
1999-02-11 10:22:30 +00:00
Justin T. Gibbs
957fea92f0 Set the ultra enable bits in the adaptor's scratch ram area only after
we finish modifying our in kernel version during seeprom configuration.
1999-02-11 07:12:16 +00:00
Matt Jacob
d951bbca48 Cleanup. Set all PCI parameters of importance. Set a define that will
allow us via config options prefer mem space to I/O space.
1999-02-09 01:12:52 +00:00
Roger Hardiman
08d8a5b841 Added detection for bt848a chips 1999-02-08 11:55:30 +00:00
Roger Hardiman
a3869d3479 Added check to bktr_mmap() from OpenBSD driver.
Improved MSP34xx reset for bt848 Hauppauge boards.
Added detection for Bt848a.
Vsevolod Lobko<seva@sevasoft.alex-ua.com> added more XUSSR channels.
Submitted by:	parts from Vsevolod Lobko<seva@sevasoft.alex-ua.com>
Obtained from:  parts from OpenBSD
1999-02-08 11:53:05 +00:00
Peter Wemm
811d024014 Back out rev 1.89. The #include is necessary for the #if that tests
the value that config(8) provides when intpm is configured.  It seems
that somebody forgot to rerun config at the time and commented this out
instead.
1999-02-06 02:28:52 +00:00
Bill Paul
e8354668bd Remember to initialize ifp->if_snd.ifq_maxlen. 1999-02-01 21:25:52 +00:00
Matt Jacob
1d74fa4ca5 roll internal release tag 1999-01-30 07:08:55 +00:00
Bruce Evans
d12895f90b Removed a bogus cast to v_caddr_t. This is part of terminating
v_caddr_t with extreme prejudice.  Here the bogons were originally
the same as for c_caddr_t (half-baked K&R support), but rev.1.95
changed one wrong cast and one harmless cast to 2 wrong casts,
and rev.1.96 only fixed the originally wrong cast.
1999-01-29 11:31:45 +00:00
Bruce Evans
9e26dd2a54 Removed bogus casts to c_caddr_t. This is part of terminating
c_caddr_t with extreme prejudice.  Here the original casts to
caddr_t were to support K&R compilers (or missing prototypes),
but the relevant source files require an ANSI compiler.
1999-01-29 08:29:05 +00:00
Roger Hardiman
f60cbfffac Support for MSP3410D / MSP3415D Stereo/Mono audio using the audio format
Auto Detection Mode. This leaves MSP3400C owners still unsupported.
Thanks to Gerd Knorr <kraxel@cs.tu-berlin.de> for providing some early
assistance and sample code in the linux bttv driver.
Nicolas Souchu <nsouch@freebsd.org> ported the msp_read/write/reset
functions to smbus/iicbus.

METEOR_INPUT_DEV2 now selects a composite camera on the SVIDEO port.
For true SVIDEO, use METEOR_INPUT_DEV_SVIDEO.
If you get a monochrome image from the SVIDEO port, you have
seleted the wrong input type.

Tested by:      Johan Larsson<gozer@ludd.luth.se>
1999-01-28 17:47:47 +00:00
Matthew Dillon
697457a133 Fix warnings related to -Wall -Wcast-qual 1999-01-28 17:32:05 +00:00
Matthew Dillon
8aef171243 Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile
1999-01-28 00:57:57 +00:00
Matthew Dillon
fe08c21a53 Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile.

    This commit includes significant work to proper handle const arguments
    for the DDB symbol routines.
1999-01-27 23:45:44 +00:00
Matthew Dillon
b4e36adf1c Fix warnings preparing for -Wall -Wcast-qual
Also disable one usb module in LINT due to fatal compilation errors,
    temporary.
1999-01-27 20:09:21 +00:00
Matthew Dillon
cc6e054933 Add missing declarations to fix error with LINT compile 1999-01-27 18:36:49 +00:00
Bill Paul
d5901891f4 When selecting the correct EEPROM offset to use for probing the station
address, account for cards which report the Texas Instruments PCI vendor ID
in addition to Compaq and Olicom. (I don't actually have a card that
reports the TI vendor/device ID, but it appears that some Racore adapters
work this way, and failing to account for it when we have the ID listed
in the supported devices list is a bug.)
1999-01-26 15:18:26 +00:00
Peter Wemm
5581e43bbf Check if the intpm controller is configured first before stopping
recognition of the 82371AB device.
1999-01-26 04:54:38 +00:00
Nicolas Souchu
04fb1490a0 Terminate commit for the Intel PIIX4 SMBus support. Already committed files
are sys/pci/intpm*

Submitted by: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>
1999-01-25 19:34:27 +00:00
Torsten Blum
de6f543955 Identify the TI1250 PCMCIA/CardBus bridge. It seems that it's compatible
to the TI1131. At least it works in my Compaq Armada 7800.
1999-01-25 12:59:31 +00:00
Nicolas Souchu
7c7545e182 SMBus support for the Intel PIIX4 power management unit. See smbus(4),
iicbus(4) and smb(4).

User programs are available to retrieve SDRAM and sensor info, contact
the author.

Submitted by: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>
Reviewed by: Mike Smith <msmith@freebsd.org>
1999-01-24 18:13:31 +00:00
Roger Hardiman
2c401a831e Added detection of Hauppauge IR remote control.
and MSP34xx Audio chip. Fixed i2c read error.
Hauppauge supplied details of new Tuner Types.
Added tuner type 0x1a.
Danny Braniss <danny@cs.huji.ac.il> submitted Bt878
AverMedia detection with PCI subsystem vendor id.
1999-01-23 11:32:06 +00:00
Roger Hardiman
d3697a3ac3 Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>
Updated to support Hauppauge IR Remote Control
1999-01-23 11:28:16 +00:00
Bill Paul
2008c8087c Multicast code isn't quite correct. The RealTek wants the upper six bits
of the CRC as the multicast hash table bit, not the lower six bits. Plus
we have to flip on all bits in the table for multicast mode.

Pointed out by: Kazushi SUGYO <k-sugyou@nwsl.mesh.ad.jp>
1999-01-22 15:25:04 +00:00
Stefan Eßer
441e39d74a Fix problem with zero valued map registers followed by valid map entries.
The previous code just ignored the invalid map register, but this gave
surprising results because of the way pci_map_port() associated the map
register offset supplied with a map entry in the map array.
1999-01-19 23:29:20 +00:00
Bruce Evans
555421cf40 Pass the unit number to the DMA cookie lookup routine and use it
to look up cookies properly, at least for standard controllers.
Cookies are used so that we don't have to pass around lots of args.
All of the dmainit functions use the unit number so it is essential
that we pass them a cookie with the correct unit number.

This may break working configurations if there are bugs in the
dmainit functions like the ones I just fixed for VIA chipsets.

Broken in:	rev 1.4 of ide_pci.c and rev.1.139 of wd.c.
1999-01-17 05:46:25 +00:00
Bruce Evans
0abd520152 Fixed a 2-bit error in initializing MWDMA mode for VIA chipsets.
Prefetch/postwrite was enabled for the wrong controller.  (VIA
is bitwise big endian and we confused ourself by shifting left
instead of right.)

Extracted from:	last set of patches from the author
		(john hood <cgull@smoke.marlboro.vt.us>) on 7 Feb 1998
1999-01-17 05:18:54 +00:00
Bill Paul
d4a2465595 Small cosmetic tweak: in rl_rxeof(), use the constant RX_CMD_EMPTY_RXBUF
instead of the magic number 1.
1999-01-16 21:03:57 +00:00
Bill Paul
1851594ca0 Remove the code that manually pads frames to at least 60 bytes;
the ASIX chip supports auto-padding.
1999-01-16 20:40:52 +00:00
Bruce Evans
0c63b25bd1 Fixed a 1-bit error in initializing UDMA mode for VIA chipsets.
Instead of initializing UDMA mode, we turned it off and made sure that
it stays off by turning on the "UDMA enable by SET FEATURES" disable.

The damage was limited by bugs in cookie lookup, and suitable
initialization by some BIOSes.  The cookie list has slaves before
masters, and the unit number is ignored when cookies are looked up,
so cookie lookup always finds cookies for slaves and the bug only
clobbers slaves, so the bug was harmless for common configurations
with no slaves or only non-UDMA slaves.  UDMA initialization for
masters actually worked if the BIOS turns on the UDMA mode bit and
turns off the "UDMA enable by SET FEATURES" disable.
1999-01-16 19:48:01 +00:00
Bill Paul
e4d0044c3a Stability fixes:
- In wb_rxeof(), if the received packet is less than MINCLSIZE bytes,
  copy it to an mbuf chain so as to be more frugal in our use of mbuf
  clusters.

- The Winbond chip, like the ASIX, wants the 'TX interrupt request'
  bit set in the _first_ fragment of a transmitted frame, not the
  last. (At least the Winbond manual states this unambiguously; too
  bad I wasn't paying attention when I read it the first time.)

- Turn off the transmit threshold mechanism (initialize the threshold
  to 0). This effectively puts the chip in 'store and forward' mode
  which seems to cut down on transmit errors a little. It may also
  reduce transmit performace a bit, but I'm willing to do that if it
  means better reliability.
1999-01-16 06:25:59 +00:00
Bill Paul
51b875b355 Fix some stability problems:
- Normally, the driver allocates an mbuf cluster for each receive
  descriptor. This is because we have to be prepared to accomodate up to
  1500 bytes (a cluster buffer can hold up to 2K). However, using up a
  whole cluster buffer for a tiny packet is a bit of a waste. Also,
  it seems to me that sometimes mbufs will linger in the kernel for
  a while after being passed out of the driver, which means we might
  drain the mbuf cluster pool. The cluster pool is smaller than the
  mbuf pool in general, so we do the following: if the packet is less
  that MINCLSIZE bytes, then we copy it into a small mbuf chain and
  leave the mbuf cluster in place for another go-round. This saves
  mbuf clusters in some cases while still allowing them to be used
  for heavy traffic exchanges with lots of full-sized frames.

- The transmit descriptor has a bit in the control word which allows
  the driver to request that a 'TX OK' interrupt be generated when
  a frame has been completed. Sometimes, a frame can be fragmented
  across several descriptors. The manual for the real DEC 21140A says
  that if this happens, the 'TX interrupt request' bit is only valid
  in the descriptor of the last fragment. With the ASIX chip, it seems
  the 'TX interrupt request' bit is only valid in the descriptor of
  the _first_ fragment. Actually, the manual contains conflicting
  information, but I think it's supposed to be the first fragment.
  To play it safe, set the bit in both the first and last fragment to
  be sure that we get a TX OK interrupt. Without this fix, the driver
  can sometimes be late in releasing mbufs from the transmit queue
  after transmission.
1999-01-16 06:19:38 +00:00
Mike Smith
d387675c42 Spell "ctlr" consistently. 1999-01-16 03:55:46 +00:00
Mike Smith
38c9282d5c Fix breakage in rev 1.19; the second argument to ide_pci_candma is a
controller number, not a unit number.  Make this clear.
1999-01-16 00:36:53 +00:00
Bruce Evans
b8cf6ea776 Use a fast interrupt handler for the PCI version of the cy driver
if option CY_PCI_FASTINTR is configured and mapping the irq to a
fastintr is possible.  Unfortunately, this has to be optional because
pci_map_int_right() doesn't handle the INTR_EXCL flag right --
INTR_EXCL is honoured even if the interrupt needs to be non-exclusive
for other devices to work.
1999-01-15 10:00:12 +00:00
John Polstra
0ec81012da Replace includes of <sys/kernel.h> with includes of
<sys/linker_set.h> in those files that use only the linker set
definitions.
1999-01-14 06:22:10 +00:00
Bruce Evans
92e81ca475 Let drivers specify interrupt flags (INTR_EXCL and/or INTR_FAST)
using the new pci_map_int_right() variant of pci_map_int().  Fast
interrupts work for PCI devices if and only if they are exclusive.
(The PCI interrupt mux doesn't support fast interrupts and can't
support a mixture of fast and slow interrupts even in principle.)

Don't assume that intrmask_t == unsigned in pci_map_int().
1999-01-13 04:59:19 +00:00
Julian Elischer
38ffc07d37 Add support for the ACER LABS Aladin chipset UDMA controller.
Submitted by: Lee Cremeans <lee@st-lcremean.tidalwave.net>
1999-01-13 04:40:50 +00:00
Eivind Eklund
685df2085d Switch type of vxintr instead of using the previous casts.
Requested by:	bde
1999-01-12 02:09:33 +00:00
Eivind Eklund
44b74eef5c Remove 'pci_bridgeto' - it was just an empty placeholder. 1999-01-12 01:44:42 +00:00
Eivind Eklund
06abe70e82 Remove unused variable. 1999-01-12 01:42:43 +00:00
Eivind Eklund
e7ece43271 Silence warning by casting vxintr to correct type 1999-01-12 01:42:01 +00:00
Eivind Eklund
38acda90ba Clean out warnings introduced in last commit. 1999-01-12 01:36:46 +00:00
Bruce Evans
8ff0acffb3 Fixed minor style bugs in previous commit. 1999-01-11 23:43:54 +00:00
Bruce Evans
443f91618b Updated for not-so-new version of Cyclom-Y PCI boards (with a custom
register for the PLX id).  Merge the vendor's modification of the 2.2.*
release version into -current for reference.  Will be cleaned up in next
commit.

Obtained from:	ftp://ftp.cyclades.com/pub/cyclades/cyclom-y/freebsd/3.0/cyy30.tar.gz
1999-01-11 23:35:01 +00:00
Julian Elischer
29a32fb6de remove some unused variables 1999-01-11 22:49:16 +00:00
Julian Elischer
8cc777e336 Add support for the Cyrix Cx5530 PCI/ISA bridge which also includes
a PCI UDMA IDE controller.
1999-01-11 22:14:23 +00:00
Bill Paul
6c70e5b472 Tweak the vr_start() and vr_rxeof() routines a little to improve
performance and reliability a little. There was a condition before
where transmission would stall during periods of heavy traffic
exchange between two hosts. Also set the 'want interrupt' bit in
receive descriptor control words.
1999-01-10 18:51:49 +00:00
Matt Jacob
285e230daf Amazingly stupid forgetfullness had me forgetting to turn on FIFO bursts
for the 1XX0 cards. That cost > 50% performance.
1999-01-10 02:45:51 +00:00
Bill Paul
31188d61c1 Add driver support (and man page) for PCI fast ethernet cards based
on the ASIX AX88140A chip. Update /sys/conf/files, RELNOTES.TXT,
/sys/i388/i386/userconfig.c, sysinstall/devices.c, GENERIC and LINT
accordingly.

For now, the only board that I know of that uses this chip is the
Alfa Inc. GFC2204. (Its predecessor, the GFC2202, was a DEC tulip card.)
Thanks again to Ulf for obtaining the board for me. If anyone runs
across another, please feel free to update the man page and/or the
release notes. (The same applies for the other drivers.)

FreeBSD should now have support for all of the DEC tulip workalike
chipsets currently on the market (Macronix, Lite-On, Winbond, ASIX).
And unless I'm mistaken, it should also have support for all PCI fast
ethernet chipsets in general (except maybe the SMC FEAST chip, which
nobody seems to ever use, including SMC). Now if only we could convince
3Com, Intel or whoever to cough up some documentation for gigabit
ethernet hardware.

Also updated RELNOTEX.TXT to mention that the SVEC PN102TX is supported
by the Macronix driver (assuming you actually have an SVEC PN102TX with
a Macronix chip on it; I tried to order a PN102TX once and got a box
labeled 'Hawking Technology PN102TX' that had a VIA Rhine board inside
it).
1999-01-09 18:12:08 +00:00
Kenjiro Cho
1e7bb3a362 cleanup: remove part of the code for 2.1.
add two functions to get the MAC address of the card.

Obtained from: ALTQ
1999-01-09 12:56:17 +00:00
Bill Paul
fae0c289fb Add some tweaks to mx_mii_readreg(), mx_phy_readreg(), mx_phy_writereg()
and mx_setcfg() so that we can read the internal MII registers on the
MX98713 chip correctly. With these changes, media autoselection now
works correctly on the original 98713. All Macronix chips should now
be properly supported (unless there's a surprise waiting in the 98725).

Thanks to Ulf Zimmermann for providing a 98713 board.
1999-01-06 17:30:06 +00:00
Bill Paul
6985d23298 GRRRR! Apparently, the promiscuous mode chip bug which I thought was
isolated to revision 33 PNIC chips is also present in revision 32 chips.
Cards with rev. 32 chips include the LinkSys LNE100TX and the Matrox
FastNIC 10/100. This accounts for all the cards that I have to test
with.

(I was never able to personally trip the bug on this chip rev, but today
one of the guys in the lab did it with the software they're working on
for their cellular IP project, which uses BPF and promiscuous mode
extensively.)

This commit enables the promiscuous mode software workaround code for
both revison 32 and revision 33 chips. It's possible all of the PNIC
chips suffer from this bug, but these are the only two revs where I
know for a fact it exists.
1999-01-05 00:59:08 +00:00
Bill Paul
57ff492d3e Minor bug: in the case where allocating a fresh mbuf for the receive ring
fails, we need to set the descriptor status word so that the 'OWN' bit
is set again so that the chip can reuse it. Previously, this wasn't being
done.
1999-01-03 02:05:21 +00:00
Bill Paul
d1b5b058f7 This commit adds a software workaround for a hardware bug in certain PNIC
chip revisions. (A buggy taiwanese chip? I'm just shocked; shocked I tell
you.) So far I have only observed the anomalous behavior on board with
PCI revision 33 chips. At the moment, this seems to include only the
Netgear FA310-TX rev D1 boards with chips labeled NGMC169B. (Possibly this
means it's an 82c169B part from Lite-On.)

The bug only manifests itself in promiscuous mode, and usually only at
10Mbps half-duplex. (I have not observed the problem in full-duplex mode,
and I don't think it ever happens at 100Mbps.) The bug appears to be in
the receiver DMA engine. Normally, the chip is programmed with a linked
list of receiver descriptors, each with a receive buffer capable of holding
a complete full-sized ethernet frame. During periods of heavy traffic
(i.e. ping -c 100 -f 8100 <otherhost>), the receiver will sometimes appear
to upload its entire FIFO memory contents instead of just uploading the
desired received frame. The uploaded data will span several receive
buffers, in spite of the fact that the chip has been told to only use
one descriptor per frame, and appears to consist of previously transmitted
frames with the correct received frame appended to the end.

Unfortunately, there is no way to determine exactly how much data is
uploaded when this happens; the chip doesn't tell you anything except the
size of the desired received frame, and the amount of bogus data varies.
Sometimes, the desired frame is also split across multiple buffers.

The workaround is ugly and nasty. The driver assembles all of the data
from the bogus frames into a single buffer. The receive buffers are always
zeroed out, and we program the chip to always include the receive CRC
at the end of each frame. We therefore know that we can start from the
end of the buffer and scan back until we encounter a non-zero data byte,
and say conclusively that this is the end of the desired frame. We can
then subtract the frame length from this address to determine the real
start of the frame, and copy it into an mbuf and pass it on.

This is kludgy and time consuming, but it's better than dropping frames.
It's not too bad since the problem only happens at 10Mbps.

The workaround is only enabled for chips with PCI revision == 33. The
LinkSys LNE100TX and Matrox FastNIC 10/100 cards use a revision 32 chip
and work fine in promiscuous mode. Netgear support has confirmed that
they "have some previous knowledge of problems in promiscuous mode" but
didn't have a workaround. The people at Lite-On who would be able to
suggest a possible fix are on vacation. So, I decided to implement a
workaround of my own until I hear from them. I suppose this problem made
it through Netgear's QA department since Windows doesn't normally use
promiscuous mode, and if Windows doesn't need the feature than it can't
possibly be important, right? Grrr.
1998-12-31 17:19:21 +00:00
Luigi Rizzo
e987b015bd Add Joachim Kuebart's ES1370 driver. With my Shuttle HOT-255 card,
this has a problem with capture but i am not sure if it is related
to the mixer or what else.
But in the meantime, this is ok to listen to mpegs.

I also have a much simpler version of the driver in the works which
reuses a lot more of the existing "pcm" routines.  Next year...
1998-12-31 08:14:27 +00:00
Tim Vanderhoek
dea9268b70 Silence -Wtrigraph.
Submitted by:	Bradley Dunn <bradley@dunn.org>  (pr: kern/8817)
1998-12-30 00:37:44 +00:00
Bill Paul
8964eeb288 Fix the tl_start() routine; sometimes the tl_tx_tail pointer was not
being updated correctly.
1998-12-29 15:39:35 +00:00
Matt Jacob
17e318c604 clarify headers;ansify 1998-12-28 19:24:23 +00:00
Foxfair Hu
c78e2203d9 Turn the VIA chipset ,<<IDE/USB>> controller probing off.
It might cause some problem and something like USB has its
own driver.
1998-12-27 07:59:25 +00:00
Bill Paul
d2555c56aa One more time: another case where we need to trim the CRC manually. 1998-12-24 19:10:05 +00:00
Bill Paul
1b2d762ecc Grrrr... The RealTek 8139 is yet another chip that includes the ethernet
CRC in received frames, which we need to trim manually.
1998-12-24 18:39:48 +00:00
Bill Paul
d482d37e81 The VIA Rhine appears to be yet another chip that always includes the
ethernet CRC in received frames and has no option to turn this behavior
off. Trim the CRC off manually in vr_rxeof().
1998-12-24 18:03:17 +00:00
Bill Paul
7ceecbe4ef Fix a small bug in xl_start(): when queuing a packet onto the end of
an existing chain, don't forget to move xl_tx_tail to point to the new
tail end.
1998-12-24 17:50:34 +00:00
Foxfair Hu
b7f854eed2 Add Matrox Mystique 1064/1164SG chips info. By the datasheet from Matrox,
they use the same value in the VID register.

PR		kern/9137: Matrox Mystique chip name typo error
Submitted by:	Alex D. Chen <dhchen@Canvas.dorm7.nccu.edu.tw>
1998-12-23 14:28:37 +00:00
Justin T. Gibbs
b2608b2c73 Staticize the overrun buffer so that they are not shared between
cards of different bus types as each bus type may have a different
bus mapping.

Submitted by:	Eivind Eklund <eivind@yes.no>
1998-12-22 18:14:15 +00:00
Mike Smith
fc28edf53e Check for DMA capbility is against unit,not controller.
Submitted by:	Lee Cremeans <lee@st-lcremean.tidalwave.net>
1998-12-21 08:55:56 +00:00
Bruce Evans
16cb3b5e57 Remove a vestige of the amd driver.
Forgotten by:	msmith
1998-12-20 15:26:02 +00:00
Foxfair Hu
dc0ba36f4d Add more non-Intel family ((new)) chipset, just like VIA technology MVP3
AcerLabs Aladdin-V. It makes the PCI probing work when system booting. I
will try to merge some additional funtion(i.e. wdc1 problem cause tons of
PR appear :<) ASAP if I could.

Remind me if something wrong after committing, thanks!
1998-12-19 16:05:19 +00:00
Julian Elischer
57b59a8762 Remove the bogus charracters "42" from the beginning of the first line.
looks like "editor turd".
1998-12-19 08:35:30 +00:00
Bill Paul
368a6b0214 Trim the ethernet CRC from received frames manually in wb_rxeof().
The Winbond chip always includes the CRC with every received frame,
and I can't find anything in the Winbond manual that indicates you can
program it not to do this.
1998-12-19 04:19:44 +00:00
Mike Smith
6417da252f Fix for bogus BIOS configuration of the 450NX PCI interface on some
systems (eg. Dell 6300).

PR:		kern/8928
Submitted by:	David Malone <dwmalone@maths.tcd.ie>
1998-12-19 02:58:29 +00:00
Mike Smith
02489dd737 Support for Intel 450NX-based systems with more than one PCI bus (ie.
most of them).

Many thanks to Kevin Van Maren for the work here, Intel for lending us
a 450NX system to work this out on, and several other folks for testing
the patches.  See the PR for an extensive discussion of the nature of
the problem and resolution.

PR:		kern/8928
Submitted by:	Kevin Van Maren <vanmaren@fast.cs.utah.edu>
1998-12-19 02:51:22 +00:00
Bill Paul
f52393a257 Correct the definition for PN_NETCFG_NO_RXCRC: it's 0x20000000, not
0x02000000. This error was causing the chip to always include the
ethernet CRC along with every received frame (the driver turns on
PN_NETCFG_NO_RXCRC, but it was frobbing the wrong bit).
1998-12-18 18:31:34 +00:00
Eivind Eklund
fcfdc24dd2 vxalloc() can return NULL. Deal with it. 1998-12-16 00:38:57 +00:00
Justin T. Gibbs
41faa7d374 Pull in new ccb_hdr list types. 1998-12-15 08:24:45 +00:00
Nick Hibma
527e2883c3 Removed probe for VIA 82C586B OHCI controller (is done in ohci_pci.c now) 1998-12-14 09:46:31 +00:00
Matthew Dillon
2cbe36f725 probe function changed from returning char * to const char *. 1998-12-14 06:37:37 +00:00
Matthew Dillon
9334c514ff Fix uninitialized variable warning by preinitializing 'class' to 0. This
wasn't a bug, just added to silence a warning.
1998-12-14 05:49:04 +00:00
Matthew Dillon
35f069d08b pci_device pd_probe function changed from returning char * to returning
const char *.  Originally I was going to add casts from const char * to
    char * in some of the pci device drivers, but the reality is that the
    pci device probes return constant quoted strings.
1998-12-14 05:47:29 +00:00
Bill Paul
a43b75fe5e Silence gcc -Wall -ansi -pedantic.
Pointed out by: Eivind
1998-12-10 19:02:07 +00:00
Bill Paul
6ab0ab275d Silence gcc -Wall -ansi -pedantic and fix minor bug in xl_txeof().
Pointed out by: Eivind
1998-12-10 16:18:43 +00:00
Archie Cobbs
ec42b6caff Eliminate compiler warning. 1998-12-10 02:02:30 +00:00
Archie Cobbs
bd3d61e39f Eliminate compiler warning. 1998-12-10 01:52:16 +00:00
Eivind Eklund
cd0f360aeb Check return value of malloc. 1998-12-09 01:33:03 +00:00
Eivind Eklund
626bfed6f6 Bailing out when malloc returns != NULL will not help anybody. 1998-12-09 01:27:29 +00:00
Eivind Eklund
761d24ba21 Adjust prototype to match definition (by adding a 'const'). 1998-12-09 01:12:18 +00:00
Archie Cobbs
f1d19042b0 The "easy" fixes for compiling the kernel -Wunused: remove unreferenced static
and local variables, goto labels, and functions declared but not defined.
1998-12-07 21:58:50 +00:00
Bill Paul
989c9647f2 if_rl.c: make a small tweak to properly handle the Accton MPX 5030/5038
as a RealTek 8139
if_rlreg.h: use bus_space_read_X() in CSR_READ_X() macros instead of
            directly calling inb()/outb() etc...
rl.4 + RELNOTES.TXT: mention that SMC EtherEZ PCI 1211-TX is supported
                     by the RealTek driver
1998-12-07 00:35:06 +00:00
Bill Paul
f5c444e19e Add sanity check to foo_start() routines: in the unlikely (though
apparently possible) event that the transmit start routine is
called with and empty if_snd queue, bail out instead of dereferencing
unilitialized transmit list pointers and panicking.
1998-12-05 02:21:44 +00:00
Matt Jacob
2fa86a2b83 trivial header fix 1998-12-05 00:07:04 +00:00
Archie Cobbs
2127f26023 Examine all occurrences of sprintf(), strcat(), and str[n]cpy()
for possible buffer overflow problems. Replaced most sprintf()'s
with snprintf(); for others cases, added terminating NUL bytes where
appropriate, replaced constants like "16" with sizeof(), etc.

These changes include several bug fixes, but most changes are for
maintainability's sake. Any instance where it wasn't "immediately
obvious" that a buffer overflow could not occur was made safer.

Reviewed by:	Bruce Evans <bde@zeta.org.au>
Reviewed by:	Matthew Dillon <dillon@apollo.backplane.com>
Reviewed by:	Mike Spengler <mks@networkcs.com>
1998-12-04 22:54:57 +00:00
Bill Paul
c13be48aee Put back some missing chip identification code that got lost somehow
during a trek through RCS. The Macronix 98713 and 98713A both have the
same PCI device ID but different revision numbers, and we need to be
able to tell one from the other. The 98715 and 98715A chips have the
same device ID as the 98725 chip but different revision numbers, however
we lump them into the same category except when identifying them during
the PCI probe output.

The main reason we need tell the chips apart is that the Macronix app
notes say you have to write a special magic number into one of the
registers in order to put the chip in normal operating mode. The 98713
requires one magic value, while all the others require a different one.
1998-12-04 21:48:12 +00:00
Archie Cobbs
03ba67cd99 Fix typo: expression needs parentheses
PR:             8280 (3/3 patches contained in this PR)
Submitted by:   Sakari Jalovaara <sja@tekla.fi>
1998-12-04 21:41:18 +00:00
Bill Paul
726ff6a158 An early Christmas present: add driver support for a whole bunch of
PCI fast ethernet adapters, plus man pages.

if_pn.c: Netgear FA310TX model D1, LinkSys LNE100TX, Matrox FastNIC 10/100,
         various other PNIC devices

if_mx.c: NDC Communications SOHOware SFA100 (Macronix 98713A), various
         other boards based on the Macronix 98713, 98713A, 98715, 98715A
         and 98725 chips

if_vr.c: D-Link DFE530-TX, other boards based on the VIA Rhine and
         Rhine II chips (note: the D-Link and certain other cards
         that actually use a Rhine II chip still return the PCI
         device ID of the Rhine I. I don't know why, and it doesn't
         really matter since the driver treats both chips the same
         anyway.)

if_wb.c: Trendware TE100-PCIE and various other cards based on the
         Winbond W89C840F chip (the Trendware card is identical to
         the sample boards Winbond sent me, so who knows how many
         clones there are running around)

All drivers include support for ifmedia, BPF and hardware multicast
filtering.

Also updated GENERIC, LINT, RELNOTES.TXT, userconfig and
sysinstall device list.

I also have a driver for the ASIX AX88140A in the works.
1998-12-04 18:01:24 +00:00
Søren Schmidt
e4ef2ec1ed The Neomagic chip is a 2160 not a 3160. 1998-12-01 21:50:58 +00:00
Mike Smith
49b41a660f Alias Adaptec as a vendor of Cogent NICs. 1998-11-28 00:25:32 +00:00
Nick Hibma
48ecb15bdc Removed probes for USB chips 82371xB (done in dev/pci/uhci_pci.c) 1998-11-26 21:57:52 +00:00
Bill Paul
36c84dd2b3 Add missing return statement to rl_phy_writereg(). This bug didn't actually
hurt anything, but it's still a bug.

Pointed out by: Jason Wright <jason@thought.net>
1998-11-20 19:26:37 +00:00
Bill Paul
552a0ec7c3 The Accton 1207D adapter uses a chip called the MXP 5030 (or 5038)
which is either a RealTek 8139 in disguise or a RealTek workalike.
This commit fixes the PCI vendor/device ID for this device
and updates the description string to reflect the actual identity
of the device.

I also changed the transmit encapsulation routine to always to
buffer copies on transmit. We end up doing this 99% of the time
anyway. I also tweaked the code that pads packets out to the minimum
length (60) bytes. I was fixing up the m_pkthdr.len value but not
m_len. I don't think this makes that much difference in the grand
scheme of things, but it makes me feel better.
1998-11-18 21:03:58 +00:00
Bill Paul
eb90b606c2 Fix a minor bug in xl_attach() where the list buffer region is rounded
to a longword boundary.

Noticed by: Jason Wright <jason@thought.net>
1998-11-18 16:46:53 +00:00
Mike Smith
aafbf5d3c5 Consign the 'amd' driver to the Attic. 1998-11-11 21:32:56 +00:00
Justin T. Gibbs
4ff057c7b0 Convert to change in ISA compatiblity port handling in the base bt driver. 1998-11-10 06:45:14 +00:00
Peter Wemm
dfab6b6416 ifioctl takes a u_long rather than an int on 3.0 1998-11-09 09:34:00 +00:00
Peter Wemm
96fca41fcf s/%#p/%p/ to fix a warning. This looks like a leftover of once being
%#x, which causes a leading 0x to be prepended. %p has this by default
and the '#' is ignored by the kernel prinf code for %p.
1998-11-09 08:08:06 +00:00
Peter Wemm
dd31125d72 Fix a warning (#include the apic_next_irq() prototype for APIC_IO) 1998-11-09 08:03:01 +00:00
Doug Rabson
7095ee912b * Fix a couple of places in the device pager where an address was
truncated to 32 bits.
* Change the calling convention of the device mmap entry point to
  pass a vm_offset_t instead of an int for the offset allowing
  devices with a larger memory map than (1<<32) to be supported
  on the alpha (/dev/mem is one such).

These changes are required to allow the X server to mmap the various
I/O regions used for device port and memory access on the alpha.
1998-11-08 12:39:07 +00:00
Nicolas Souchu
dec0ec9e81 Return to previous check_for_i2c_devices() behaviour.
Cast the cmd parameter to unsigned char in every smbus call.

Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>
1998-11-07 14:30:48 +00:00
Peter Wemm
cf3e757633 If this is going to have checks for kernel versions, it might as well
do it so that it works.  This code should run on 2.2.x now.
1998-11-06 02:13:14 +00:00
Julian Elischer
cd8ab93c90 In the cyrix Cx5530, there are null (empty) Base address registers before the
base register that controls Ultra-DMA, so we need to examine all possible
base registers instead of just giving up at the first empty one.
Also, looking at the source code to the BIOS, I see that they are also
checking for 0xffffffff as an invalid value so do the same. Stefan may like
to clean this up, but at least now I can find my PCI IDE registers.
1998-11-03 08:47:29 +00:00
Semen Ustimenko
5fabcd1a00 Ported to OpenBSD. sys/pci/smc83c170.h renamed to sys/pci/if_txvar.h to be
like others.
1998-11-01 07:44:33 +00:00
Bill Paul
1b2451269c Increase the size of the tx and rx rings from 10 to 20 descriptors
and increase the tx interrupt threshold to 4. This fixes performance
problems on slower systems.

Also fix a mind-o in the rx ring init routine: I used the TX
constant instead of the RX. This isn't a problem as long as the
rings are the same size, but if they aren't hijinx will ensue.
1998-10-31 17:23:48 +00:00
Nicolas Souchu
fbd78b40dd Brooktree driver ported to the new I2C framework. See iicbus(4) for more info. 1998-10-31 11:26:38 +00:00
Doug Rabson
57250ffb42 * Fix vga_probe() so that it doesn't report a non-vga display adapter as
a vga.
* Fix broken logic in syscons for a failed probe.
* Fix AlphaStation 500/600 so that non-serial consoles are supported.

Submitted by: Thomas Valentino Crimi <tcrimi+@andrew.cmu.edu> (vga bits),
	      Andrew Gallatin <gallatin@cs.duke.edu> (AS500/AS600)
1998-10-31 10:35:24 +00:00
Justin T. Gibbs
400ea5dc6a Do not disable the ISA compatibility window if it is the same value as
that set for our PCI IO address space.  This can happen on the BT-946.
1998-10-30 02:06:44 +00:00
Poul-Henning Kamp
842426555a Update and add timekeeping code. 1998-10-24 19:47:42 +00:00
Bill Paul
c044afa986 Close PR #8409:
Fix syntax errors inside #ifdef FORCE_AUTONEG_TFOUR.
1998-10-22 16:46:26 +00:00
Bill Paul
447c20659b Close PR #8384:
Revert the transmission packet queueing strategy changes. Clearly I missed
something while debugging this, although I never encountered any problems
on my test machines.

Also make one other minor change: jack up the TX reclaim threshold for
3c90xB adapters in order to stave off 'transmission error: 82' errors.

Document the existence of the tx reclaim register (for inspecting the
current reclaim threshold) in register window 5 (if_xlreg.h).
1998-10-22 15:52:25 +00:00
David Greenman
c8cc6fca3c Defer rundown (m_freem) of completed transmit buffers for no longer
than 1 second.
1998-10-22 02:00:49 +00:00
Bill Paul
1c403cb2b6 Modify the transmit packet queuing strategy a bit to be a little less
agressive. With the old code, if a descriptor chain was already on its
way to the chip, xl_start() would try to splice new chains onto the end
of the current chain by stopping the transmitter, modifying the tail
pointer of the current chain to point to the head of the new chain, then
restart the transmitter. The manual says you're allowed to do this and
it works, but I'm not too keen on it anymore.

The new code waits until the eixsting chain has been sent and then
queues the next waiting chain in the 'transmit ok' handler.

Performance still looks good one way or the other.
1998-10-19 22:08:56 +00:00
Bill Paul
589e38a609 Add driver support for PCI fast ethernet adapters based on the
RealTek 8129/8139 chipset like I've been threatening. Update kernel
configs, userconfig.c, relnotes and sysinstall. No man page yet;
comming soon.

I consider this driver stable enough that I want to give it some
exposure in -current.
1998-10-18 16:24:34 +00:00
Justin T. Gibbs
0a42741c4a Honor CAM_TAG_ACTION_NONE. 1998-10-15 23:17:58 +00:00
Peter Wemm
4650c37fce Revert part of previous commit. vaddr_t doesn't exist on FreeBSD. This
didn't affect the x86 kernel due to #ifdefs.  It broke FreeBSD/Alpha
kernel compiles though.
1998-10-14 08:31:27 +00:00
Peter Wemm
38c2b6942a Update from NetBSD if_de.c 1.72 to 1.80. This is mostly bugfixes, and
looks like it will have most effect on decoding device capabilities and
configuration.

Approved by: jkh
1998-10-13 09:05:58 +00:00
David Greenman
91aa9f9055 Clear out transmit descriptor memory in fxp_attach when it's malloced.
fxp_stop is called as the first thing in fxp_init, and if the tx desc
list has junk in it, the system may panic. This bug showed up as a side
effect of the changes in rev 1.56, but has been in the code since the
beginning.
1998-10-11 06:28:54 +00:00
David Greenman
da91462d5e Fixed mbuf leak in fxp_stop(). 1998-10-10 19:26:40 +00:00
Peter Wemm
c9a5e21100 Attempt to work around the page fault in tulip_txput(). I've been running
this myself for ages, but wasn't able to get any feedback from the people
that I sent it to for testing.

Guy Helmer <ghelmer@scl.ameslab.gov> has given it a shot (before getting on
a plane, thanks!) and it appears to stop his reproducable page fault panic
in the testing he was able to do.
1998-10-10 02:44:53 +00:00
Bill Paul
62034864f7 Add support for yet another "cyclone" board, with PCI device id 0x905A.
This is a 100BaseFX board with SC fiber media connectors. I don't actually
have one of these but I've been told it works with the xl driver.

Submitted by: Jason Wright from the openbsd group
1998-10-09 03:59:24 +00:00
Bill Paul
3aff6980c6 Correctly update the tail pointer of the transmit queue in tl_start()
(one-liner). I have yet to actually encounter any problems due to this
bug, but why take chances.
1998-10-08 15:45:36 +00:00
Justin T. Gibbs
6405ed07d7 ahc_pci.c:
Disable DPARCKEN in the DSCOMMAND0 register on the aic7890/91/96/97.
	Parity checking is broken for some chip/MB combinations and this
	is the work around recommended by Adaptec.

dpt_pci.c:
	Remove a superflous '{' that prevented DPT_ALLOW_MEMIO from working.

pcireg.h:
	Add a definition for Parity Error Reponse bit in the PCI Space
	command register.
1998-10-07 03:40:51 +00:00
Justin T. Gibbs
85186e4602 Add support for the ASC3550 AdvanSys SCSI Host Controller (aka 940UW). 1998-10-07 03:20:52 +00:00
Doug Rabson
a0ab71761c Add functions for accessing dense and bwx memory for pci devices. These
routines are necessary to allow the use of certain types of hardware on
the alpha, particularly a Myrinet card.

Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-10-06 14:18:40 +00:00
Bill Paul
9624d2cdc2 Force the ThunderLAN driver to use PIO mode by default instead of
memory mapped mode. There are some laptop docking stations with
built-in tlan chips where memory mapped mode doesn't work correctly.

Pointed out by: jmb
1998-10-04 18:47:38 +00:00
Søren Schmidt
6f83a5f331 Oops, forgot /* */ around Id string 1998-10-01 09:35:48 +00:00
Søren Schmidt
2a4070eb7c Hauppauge Tech Support confirmed all Hauppauge 878 PAL/SECAM boards
will use PLL mode.  Added to card probe. Thanks to Ken and Fred.

Submitted by:   Roger Hardiman <roger@cs.strath.ac.uk>
1998-09-30 21:06:55 +00:00
Søren Schmidt
dd32a6ad67 Hauppauge Tech Support confirmed all Hauppauge 878 PAL/SECAM boards
will use PLL mode.  Added to card probe. Thanks to Ken and Fred.

Submitted by:   Roger Hardiman <roger@cs.strath.ac.uk>
1998-09-30 20:58:09 +00:00
Søren Schmidt
ff2c4726bc Changed tuner code to autodetect tuner i2c address.
Addresses were incorrectly hardcoded.

Submitted by:   Roger Hardiman <roger@cs.strath.ac.uk>
1998-09-30 20:43:25 +00:00
Bruce Evans
894e2bd49e FIxed printf format errors (an new one that is only detected on systems
with pointers smaller than u_longs, and 2 possibly-truncating casts in
the same printf).
1998-09-29 09:14:52 +00:00
Doug Rabson
63bbbfc70e Update SimOS scsi driver to use CAM. 1998-09-26 14:49:26 +00:00
Doug Rabson
e37c045536 Add hooks so that the alpha can detect which disk has the root partition. 1998-09-26 14:37:49 +00:00
Doug Rabson
fb44081bd0 Don't set script to vaddr2 on the alpha - it can't access scripts in device
memory using simple pointers.
1998-09-26 14:29:59 +00:00
Bill Paul
97e28a9d67 Apply patch graciously provided by Jason Wright <jason@thought.net> from
the OpenBSD group to fix a problem with the default ifmedia not being
set properly in some cases with a 3c905B, leading to a panic in ifmedia_set().

Also apply a patch to force the transmit start routine to check the
transmitter to make sure it isn't wedged if the outbound tx queue appears
full. This seems to cure some problems with 'watchdog timeout' errors
cropping up in some cases. I tried to do this before by checking for the
IFF_OACTIVE flag on entry to xl_start(), but if the IFF_OACTIVE flag is
set, ether_output() won't even call xl_start(). It should work now.

Lastly, increase the size of the TX queue from 10 descriptors to 16 to
hopefully make it less likely that the TX queue will fill up.
1998-09-25 17:34:19 +00:00
Bill Paul
9460731153 Small tweak: force another reset of the adapter after probing for all the
PHYs in tl_attach(). This is mainly to suck away any possible stray
interrupts.

This prevents an intermittent problem on some systems where the adapter
probes correctly but yields a device timeout (and possible subsequent adapter
check) when configured. When I originally tested the driver, I ifconfig'ed
the interface after the system had already been booted and didn't notice
any problems, but when configuring the interface immediately at startup,
it would occasionally timeout and hang, until an adapter check interrupt
came along and reset things again. I'm not exactly sure if this is a
general problem of just something peculiar to this hardware (there are
three devices, including the tlan, all on IRQ 11) but the extra reset
shouldn't hurt anything. (It works fine with my 100Mbps Olicom adapter too.)

Thanks to Mark Taylor from Cybernet (mtaylor@cybernet.com) for allowing
me remote access to a Compaq system for debugging purposes.
1998-09-24 17:14:23 +00:00
Peter Wemm
05209199cf Minimal change for #if __FreeBSD__ >= 3 to check __FreeBSD_version instead. 1998-09-24 16:00:30 +00:00
Peter Wemm
de77c42832 Change #if __FreeBSD__ >= 3 to #if __FreeBSD_version >= 300000 to aid
bootstrapping from a 2.2.x system.
1998-09-24 13:31:01 +00:00
Bill Paul
b078a935b6 Overhaul the ThunderLAN driver. This update includes the following
changes:

- Cleaned up register access macros so that they work like the XL
  driver macros (you can switch from PIO to memory-mapped mode
  using a single #define -- default is still memory mapped mode).
  The old 'struct overlayed onto the memory mapped register space'
  cruft has been removed.

- Improved multicast filter code. The ThunderLAN has four entry
  perfect filter table in addition to the 64-bit hash table: we need
  one of the perfect filter entries for the station address, but we
  can use the other three for multicast filtering. We arrange to put
  the first three multicast group addresses in the perfect filter
  slots so that commonly joined groups like the all hosts group and
  the all routers group can be filtered without using up bits in the
  hash table.

  Note: in FreeBSD 3.0, multicast groups are stored in a doubly
  linked list, however new entries are added at the head of the list
  (thereby pushing existing entries down towards the tail). We want
  to update the filter starting from the oldest entry to the newest
  since the all hosts group is always joined first. This means we
  really want to start from the tail of the list, not the head, but
  to find the tail we first have to traverse the list all the way to
  the end and then add entries working backwards. This is a bit of a
  kludge and could be inefficient if the list is long.

- Cleaned up autonegotiation code: tl_autoneg() wasn't always setting
  modes correctly.

- Cleaned up ifmedia update and status routines as well.

- Added tl_hardreset() routine to initialize the internal PHY according
  to the ThunderLAN manual.

- Did away with the kludge where PHYs were treated as separate logical
  interfaces. This didn't really work, especially in the case of the
  newer Olicom 2326 adapters which use a Micro Linear ML6692 PHY which
  provides only 100Mbps support, relying on the internal PHY for 10Mbps
  support (both PHYs share the RJ45 port, with the 6692 doing all the
  autonegotiation work). This kludge resulted from my misunderstanding
  of the operation of the Compaq Netelligent Dual Port card (the tlan
  manual mentions multiple channels, but in a different context; this
  got me a little confused). The driver has been reported to work
  correctly with the dual port card.

- Added dio_getbit/dio_setbit/dio_read/dio_write functions which carefully
  set the ThunderLAN's indirectly accessed internal registers. This makes
  the EEPROM reading code more reliable.

Hopefully I won't have to touch this again before 3.0 goes out the door.
I plan to import the 2.2.x version sometime this week.

Approved-by: jkh
1998-09-23 05:08:54 +00:00
Kenneth D. Merry
aec4b791c5 A fix from Justin for the NCR bug that caused panics on 875 (and possibly
other) chips.

The script pointer was getting set to NULL instead of the right value.

Submitted by:	gibbs
1998-09-22 21:42:46 +00:00
Justin T. Gibbs
6d21c6f373 Bring back the cleanups from revs 1.121 and rev.1.122 of ncr.c.
Noticed by: bde
1998-09-22 04:56:08 +00:00
Kenneth D. Merry
8dc6f245bc Alpha patches for the NCR driver from Doug Rabson. I've tested these on an
NCR 810a, and they seem to work fine on the i386 as well.

Reviewed by:	gibbs
Submitted by:	dfr
1998-09-20 22:54:28 +00:00
Justin T. Gibbs
0532933e60 Set QUIRK_NOMSG for all devices as was the case in the non-CAM version
of the driver.  Why this is necessary (and how identify message handling
is performed when this is set) I don't comprehend...
1998-09-18 22:41:12 +00:00
Matt Jacob
3dd37e4387 (requested by gibbs) Remove the SCSI_CAM option (and rework the isp driver
that had depended on it for compilation within or without CAM to use
__FreeBSD_version instead).
1998-09-18 00:46:42 +00:00
Justin T. Gibbs
761fe626ea Really correct ncr_freeze_devq now. We scan backwards from the current
insertion point into the start queue looking for entries to remove and
mark them with the 'skip' address, recording the entry furthest from the
insertion point that needs to be removed.  We then go through a second
loop starting at the furthest entry to be removed and compress the start
queue.  The old algorithm started at (old insert point + 1) and wrapped
through the whole queue which would end up moving the start position in
the queue out from under the nose of the scrip processor.
1998-09-17 22:29:02 +00:00
Matt Jacob
4873663cf8 A major amount of cleaning up:
+ Change some messages about CCB memory allocation
	+ Turn a failure to DMA map all of a transaction due to lack of
	  ISP queue entries into a requeue operation (instead of the
	  case where it had been treated the same as a DMA too big
	  operation).
	+ put back splsoftvm around bus_dmamap_load calls.
	+ cleanup (and fix a glaring bug) in the and of the dma setup
	  routine. Also, the dma setup routines either return CMD_QUEUED
	  (for success) or CMD_COMPLETE (for failure) or CMD_EAGAIN
	  (for requeuing for resource shortage reasons).
1998-09-17 21:11:21 +00:00
Justin T. Gibbs
c2921d36a9 Use %p with (void *) casts to print pointers with printf. 1998-09-17 00:08:29 +00:00
Justin T. Gibbs
fb268fece4 Fix a regression that caused the script to spam itself by copying something
of size sizeof(struct timeval) that is really of size sizeof(ticks).

Make another attempt at fixing the queue full case.
1998-09-16 22:46:04 +00:00
Mike Smith
85dc1320dc Add 450NX chipset components. 1998-09-16 20:29:22 +00:00
Justin T. Gibbs
348811e078 Fix a bug in ncr_freeze_devq() which is called when we see a queue
full condition or other error which requires us to purge the
controller's start queue of transactions for a particular device.
We were relying on the NCR CCB's program address to cause the
script engine to skip to the next entry in the queue even though
the CCB is freed (and its program address switched to the idle
loop) by this action.  We now set the address in the start queue
to be the "skip" function directly.
1998-09-16 17:11:59 +00:00
Matt Jacob
a185f9b1c3 Alpha port related fixes from Doug Rabson.
Submitted by:	dfr
1998-09-16 16:43:17 +00:00
Doug Rabson
98ffb0c4f2 Some workarounds for a common DEC pci-pci bridge found on alphas.
Fix printf format errors which show up on the alpha.
1998-09-16 08:28:11 +00:00
Doug Rabson
88f92aec2c Port de driver to alpha. 1998-09-16 08:27:07 +00:00
Justin T. Gibbs
5ee58402df Correct printf format bugs. 1998-09-15 22:05:44 +00:00
Justin T. Gibbs
bd9d336e40 Obsoleted by CAM. 1998-09-15 10:40:55 +00:00