Commit Graph

585 Commits

Author SHA1 Message Date
Stefan Eßer
6d529e4303 Remove two features that have been reported to cause problems with
certain variants of the NCR chip from FE_CACHE_SET: FE_CLSE (enable
cache-line size register) and FE_ERMP (enable read-multiple). They
will be re-enabled, if a fix for the underlying problem (a restriction
in the memory to memory move logic of some chips) has been implemented.
1997-08-06 20:25:54 +00:00
Peter Wemm
a7065bd54f Merge Matt's if_de.c changes in. 1997-08-03 13:00:42 +00:00
Peter Wemm
fd03752a5d Import Matt's if_de driver 970703 release. This (apparently) supports
some newer Cogent (Adaptec) cards and has some other internal changes.
1997-08-03 12:17:39 +00:00
Peter Wemm
7658bc7e94 This commit was generated by cvs2svn to compensate for changes in r27859,
which included commits to RCS files with non-trunk default branches.
1997-08-03 12:17:39 +00:00
Bruce Evans
1fd0b0588f Removed unused #includes. 1997-08-02 14:33:27 +00:00
Stefan Eßer
5a6006b912 Fix problem caused by a chunk of the previous patch having been
applied to the wrong source code lines (non-fatal, since it just
made an auto variable become visible at the global level).
1997-07-29 21:50:04 +00:00
Søren Schmidt
8b8a0b53b1 Add support for busmaster DMA on some PCI IDE chipsets.
I changed a few bits here and there, mainly renaming wd82371.c
to ide_pci.c now that it's supposed to handle different chipsets.

It runs on my P6 natoma board with two Maxtor drives, and also
on a Fujitsu machine I have at work with an Opti chipset and
a Quantum drive.

Submitted by:cgull@smoke.marlboro.vt.us <John Hood>

Original readme:

*** WARNING ***

This code has so far been tested on exactly one motherboard with two
identical drives known for their good DMA support.

This code, in the right circumstances, could corrupt data subtly,
silently, and invisibly, in much the same way that older PCI IDE
controllers do.  It's ALPHA-quality code; there's one or two major
gaps in my understanding of PCI IDE still.  Don't use this code on any
system with data that you care about; it's only good for hack boxes.
Expect that any data may be silently and randomly corrupted at any
moment.  It's a disk driver.  It has bugs.  Disk drivers with bugs
munch data.  It's a fact of life.

I also *STRONGLY* recommend getting a copy of your chipset's manual
and the ATA-2 or ATA-3 spec and making sure that timing modes on your
disk drives and IDE controller are being setup correctly by the BIOS--
because the driver makes only the lamest of attempts to do this just
now.

*** END WARNING ***

that said, i happen to think the code is working pretty well...

WHAT IT DOES:

this code adds support to the wd driver for bus mastering PCI IDE
controllers that follow the SFF-8038 standard.  (all the bus mastering
PCI IDE controllers i've seen so far do follow this standard.)  it
should provide busmastering on nearly any current P5 or P6 chipset,
specifically including any Intel chipset using one of the PIIX south
bridges-- this includes the '430FX, '430VX, '430HX, '430TX, '440LX,
and (i think) the Orion '450GX chipsets.  specific support is also
included for the VIA Apollo VP-1 chipset, as it appears in the
relabeled "HXPro" incarnation seen on cheap US$70 taiwanese
motherboards (that's what's in my development machine).  it works out
of the box on controllers that do DMA mode2; if my understanding is
correct, it'll probably work on Ultra-DMA33 controllers as well.
it'll probably work on busmastering IDE controllers in PCI slots, too,
but this is an area i am less sure about.

it cuts CPU usage considerably and improves drive performance
slightly.  usable numbers are difficult to come by with existing
benchmark tools, but experimentation on my K5-P90 system, with VIA
VP-1 chipset and Quantum Fireball 1080 drives, shows that disk i/o on
raw partitions imposes perhaps 5% cpu load.  cpu load during
filesystem i/o drops a lot, from near 100% to anywhere between 30% and
70%.  (the improvement may not be as large on an Intel chipset; from
what i can tell, the VIA VP-1 may not be very efficient with PCI I/O.)
disk performance improves by 5% or 10% with these drives.

real, visible, end-user performance improvement on a single user
machine is about nil. :) a kernel compile was sped up by a whole three
seconds.  it *does* feel a bit better-behaved when the system is
swapping heavily, but a better disk driver is not the fix for *that*
problem.

THE CODE:

this code is a patch to wd.c and wd82371.c, and associated header
files.  it should be considered alpha code; more work needs to be
done.

wd.c has fairly clean patches to add calls to busmaster code, as
implemented in wd82371.c and potentially elsewhere (one could imagine,
say, a Mac having a different DMA controller).

wd82371.c has been considerably reworked: the wddma interface that it
presents has been changed (expect more changes), many bugs have been
fixed, a new internal interface has been added for supporting
different chipsets, and the PCI probe has been considerably extended.

the interface between wd82371.c and wd.c is still fairly clean, but
i'm not sure it's in the right place.  there's a mess of issues around
ATA/ATAPI that need to be sorted out, including ATAPI support, CD-ROM
support, tape support, LS-120/Zip support, SFF-8038i DMA, UltraDMA,
PCI IDE controllers, bus probes, buggy controllers, controller timing
setup, drive timing setup, world peace and kitchen sinks.  whatever
happens with all this and however it gets partitioned, it is fairly
clear that wd.c needs some significant rework-- probably a complete
rewrite.

timing setup on disk controllers is something i've entirely punted on.
on my development machine, it appears that the BIOS does at least some
of the necessary timing setup.  i chose to restrict operation to
drives that are already configured for Mode4 PIO and Mode2 multiword
DMA, since the timing is essentially the same and many if not most
chipsets use the same control registers for DMA and PIO timing.

does anybody *know* whether BIOSes are required to do timing setup for
DMA modes on drives under their care?

error recovery is probably weak.  early on in development, i was
getting drive errors induced by bugs in the driver; i used these to
flush out the worst of the bugs in the driver's error handling, but
problems may remain.  i haven't got a drive with bad sectors i can
watch the driver flail on.

complaints about how wd82371.c has been reindented will be ignored
until the FreeBSD project has a real style policy, there is a
mechanism for individual authors to match it (indent flags or an emacs
c-mode or whatever), and it is enforced.  if i'm going to use a source
style i don't like, it would help if i could figure out what it *is*
(style(9) is about half of a policy), and a way to reasonably
duplicate it.  i ended up wasting a while trying to figure out what
the right thing to do was before deciding reformatting the whole thing
was the worst possible thing to do, except for all the other
possibilities.

i have maintained wd.c's indentation; that was not too hard,
fortunately.

TO INSTALL:

my dev box is freebsd 2.2.2 release.  fortunately, wd.c is a living
fossil, and has diverged very little recently.  included in this
tarball is a patch file, 'otherdiffs', for all files except wd82371.c,
my edited wd82371.c, a patch file, 'wd82371.c-diff-exact', against the
2.2.2 dist of 82371.c, and another patch file,
'wd82371.c-diff-whitespace', generated with diff -b (ignore
whitespace).  most of you not using 2.2.2 will probably have to use
this last patchfile with 'patch --ignore-whitespace'.  apply from the
kernel source tree root. as far as i can tell, this should apply
cleanly on anything from -current back to 2.2.2 and probably back to
2.2.0.  you, the kernel hacker, can figure out what to do from here.
if you need more specific directions, you probably should not be
experimenting with this code yet.

to enable DMA support, set flag 0x2000 for that drive in your config
file or in userconfig, as you would the 32-bit-PIO flag.  the driver
will then turn on DMA support if your drive and controller pass its
tests.  it's a bit picky, probably.  on discovering DMA mode failures
or disk errors or transfers that the DMA controller can't deal with,
the driver will fall back to PIO, so it is wise to setup the flags as
if PIO were still important.

'controller wdc0 at isa? port "IO_WD1" bio irq 14 flags 0xa0ffa0ff
vector wdintr' should work with nearly any PCI IDE controller.

i would *strongly* suggest booting single-user at first, and thrashing
the drive a bit while it's still mounted read-only.  this should be
fairly safe, even if the driver goes completely out to lunch.  it
might save you a reinstall.

one way to tell whether the driver is really using DMA is to check the
interrupt count during disk i/o with vmstat; DMA mode will add an
extremely low number of interrupts, as compared to even multi-sector
PIO.

boot -v will give you a copious register dump of timing-related info
on Intel and VIAtech chipsets, as well as PIO/DMA mode information on
all hard drives.  refer to your ATA and chipset documentation to
interpret these.

WHAT I'D LIKE FROM YOU and THINGS TO TEST:

reports.  success reports, failure reports, any kind of reports. :)
send them to cgull+ide@smoke.marlboro.vt.us.

i'd also like to see the kernel messages from various BIOSes (boot -v;
dmesg), along with info on the motherboard and BIOS on that machine.

i'm especially interested in reports on how this code works on the
various Intel chipsets, and whether the register dump works
correctly.  i'm also interested in hearing about other chipsets.

i'm especially interested in hearing success/failure reports for PCI
IDE controllers on cards, such as CMD's or Promise's new busmastering
IDE controllers.

UltraDMA-33 reports.

interoperation with ATAPI peripherals-- FreeBSD doesn't work with my
old Hitachi IDE CDROM, so i can't tell if I've broken anything. :)

i'd especially like to hear how the drive copes in DMA operation on
drives with bad sectors.  i haven't been able to find any such yet.

success/failure reports on older IDE drives with early support for DMA
modes-- those introduced between 1.5 and 3 years ago, typically
ranging from perhaps 400MB to 1.6GB.

failure reports on operation with more than one drive would be
appreciated.  the driver was developed with two drives on one
controller, the worst-case situation, and has been tested with one
drive on each controller, but you never know...

any reports of messages from the driver during normal operation,
especially "reverting to PIO mode", or "dmaverify odd vaddr or length"
(the DMA controller is strongly halfword oriented, and i'm curious to
know if any FreeBSD usage actually needs misaligned transfers).

performance reports.  beware that bonnie's CPU usage reporting is
useless for IDE drives; the best test i've found has been to run a
program that runs a spin loop at an idle priority and reports how many
iterations it manages, and even that sometimes produces numbers i
don't believe.  performance reports of multi-drive operation are
especially interesting; my system cannot sustain full throughput on
two drives on separate controllers, but that may just be a lame
motherboard.

THINGS I'M STILL MISSING CLUE ON:

* who's responsible for configuring DMA timing modes on IDE drives?
the BIOS or the driver?

* is there a spec for dealing with Ultra-DMA extensions?

* are there any chipsets or with bugs relating to DMA transfer that
should be blacklisted?

* are there any ATA interfaces that use some other kind of DMA
controller in conjunction with standard ATA protocol?

FINAL NOTE:

after having looked at the ATA-3 spec, all i can say is, "it's ugly".
*especially* electrically.  the IDE bus is best modeled as an
unterminated transmission line, these days.

for maximum reliability, keep your IDE cables as short as possible and
as few as possible.  from what i can tell, most current chipsets have
both IDE ports wired into a single buss, to a greater or lesser
degree.  using two cables means you double the length of this bus.

SCSI may have its warts, but at least the basic analog design of the
bus is still somewhat reasonable.  IDE passed beyond the veil two
years ago.

  --John Hood, cgull@smoke.marlboro.vt.us
1997-07-29 12:57:25 +00:00
Stefan Eßer
3334aa04d9 Add support for loading the SCRIPTS microcode into the on-chip RAM
of the Symbios 53c825A, 53c875 and 53c895 SCSI chips.

Submitted by:	Gerard Roudier <groudier@club-internet.fr>
1997-07-28 21:32:05 +00:00
David Greenman
dd0ebb7f08 Added support for the Seeq 80c24 PHY; does nothing except disable the
unsupported warning message for it.
1997-07-25 23:41:12 +00:00
Stefan Eßer
c6d84f7c3e Add Ultra-SCSI support and enable more features for advanced
Symbios/NCR SCSI chips (no-flush option, large fifo, ...).

Submitted by:	Gerard Roudier <groudier@club-internet.fr>
1997-07-25 20:45:09 +00:00
Stefan Eßer
478f9549f4 Assign correct chip set register dump functions to Triton II device IDs.
PR:		i386/4092
Submitted by:	Steve Bauer <sbauer@rock.sdsmt.edu>
1997-07-18 19:47:23 +00:00
Stefan Eßer
01cb2f9493 Fix "unexpected phase change" interrupt handler: Do not access the
dstat register twice, pass the value read the first time to the fixup
code instead.

Submitted by:	Gerard Roudier <groudier@club-internet.fr>
1997-07-18 19:33:56 +00:00
Bruce Evans
48792cfc18 Don't cast function pointers to (void *). This will cause warnings.
They should be fixed when similar warnings for the general interrupt
attach routines are fixed.

Removed unused #include.
1997-07-01 00:45:45 +00:00
Justin T. Gibbs
d144ffea1f Modify my copyright notice to allow the sequencer to be used with GPLed
software (aka Linux).
1997-06-27 19:39:34 +00:00
Steve Passe
91f7398bca Modified to use renamed get_pci_apic_irq() -> pci_apic_pin() function. 1997-06-25 20:56:29 +00:00
Peter Wemm
2adb88c953 Superceded by dc21040reg.h 1997-06-22 09:50:09 +00:00
Peter Wemm
12e96047fa Initial set of patches to get it to compile on >= 3.0. Most of the
changes relative to the 2.2 compatable version are include file
related, the new multicast interface (!) and the new PCI interface.

This should work "as-is" but has not been tested (I have not been able
to get a dc21x4x based card for testing).
1997-06-22 09:48:42 +00:00
Peter Wemm
e5d6c2c9e7 Clean import of if_de.c as of 970513, if_de.c rev 1.86. This should
have optional if_media support.

Obtained from: Matt Thomas via http://www.3am-software.com/
1997-06-22 09:36:50 +00:00
Peter Wemm
172d6524df This commit was generated by cvs2svn to compensate for changes in r26790,
which included commits to RCS files with non-trunk default branches.
1997-06-22 09:32:32 +00:00
Peter Wemm
cb031f1c21 Clean import of Matt Thomas's if_de.c driver as of 970508, rev 1.85. The
slightly later one with optional if_media will be imported shortly as well.

Obtained from: Matt Thomas via http://www.3am-software.com/
1997-06-22 09:32:32 +00:00
David Greenman
3729f8481a Minor optimization in fxp_intr. 1997-06-16 04:45:57 +00:00
Steve Passe
cc81bca6be Added 2 new defines:
- OVERRIDE_TUNER: allows you to manually choose the tuner type for those
                   cards that fail to probe properly.  See source for legal
                   values.
 - OVERRIDE_DBX:   allows you to manually choose DBX or NO DBX for those
                   cards that fail to probe properly.
                   0 == no DBX circuit present, 1 == DBX circuit present.
1997-06-14 19:10:53 +00:00
David Greenman
854d14213e Added support for the Intel 82555 PHY chip which is being used on newer
Pro/100B cards. Full duplex should work now, although it hasn't been
tested.
1997-06-13 22:34:52 +00:00
Stefan Eßer
9744aa88bd Add device IDs for new Symbios SCSI chips (53c875J,885,895,896), which
should work with no driver changes, though not all features are currently
used.

Remove code that was conditional on NEW_SCSICONF not being defined. This
was temporary code, that at a time got excluded correctly, until the new
scsiconf became the default, and NEW_SCSICONF was no longer specified.

Add support for quirks defined in scsiconf.c. For now only the HP3724/5
needs an entry, since that drive can't be used with tags.
1997-06-11 22:36:02 +00:00
Stefan Eßer
1a26f4c024 Move call of pci_addcfg() before test of cfg->subordinatebus, since the
device probe of a host to PCI bridge may modify that value, based on
its knowledge of device specific registers. This makes the Intel XXpress
work, as verified by: Terje Marthinussen <terjem@cc.uit.no>.
1997-06-02 19:59:01 +00:00
Peter Wemm
2ac7b161fb PCI_CLASS_MASS_STORAGE (under PCI_COMPAT) was used in a driver in LINT
still (stallion.c).
1997-06-01 16:00:43 +00:00
Stefan Eßer
8e1b97b626 Add code to correctly probe all buses on the Intel XXPRESS motherboard.
Add a few Intel PCI chip-set names (VX) and fix Orion entries.
1997-05-30 21:01:47 +00:00
Stefan Eßer
575d95316f Remove use of intrec*, use void* instead.
Disable test entries for wired PCI devices on bus 1.
1997-05-30 20:58:04 +00:00
Stefan Eßer
b9d14bed1d Add one more compatibility define to make the Adaptec driver compile
with option AHC_ALLOW_MEMIO again ....
1997-05-28 20:37:19 +00:00
Stefan Eßer
903f376ec8 Define command register enable bits, which are required for a consitency
test added to pci_compat.c
1997-05-28 11:15:18 +00:00
Stefan Eßer
8ae85778a3 Add consistency check to the functions that map port or memory ranges:
Return failure, if the enable bit corresponding to the map type has not
been set in the command register. This feature was requested by Justin
Gibbs, who pointed out that some early PCI to PCI bridges do not correctly
support memory windows (I assume because of the risk of deadlocks that
have been taken care of in the PCI 2.2 spec) and that some BIOS clears
the memory address decode enable bit in the command register of the PCI
device, if it finds them behind such a bridge.
1997-05-28 10:10:02 +00:00
Stefan Eßer
a9ad937362 Two minor changes to the code that builds the pci map array:
1) Stop at the first map register that contains a zero value.
2) When testing for the map size work up from low values, since
   this works around a bug in some BusLogic SCSI card, which has
   the 16 upper port base address bits hardwired to zero.

The config register dump printed in the bootverbose case has
been slightly rearranged.
1997-05-28 10:01:03 +00:00
Steve Passe
6ef807e505 Minor cleanup of APIC_IO code.
Submitted by:	Stefan Esser <se@freebsd.org>
1997-05-27 19:24:36 +00:00
Steve Passe
ce595b36d5 Add support for APIC_IO to pci IRQ configuration.
The support for APIC_IO was lost in the new set of pci modules.  This patch
restores the ability to build SMP/APIC_IO kernels.
1997-05-27 04:09:01 +00:00
Stefan Eßer
cd46d00ca6 This file has been made obsolete by the new PCI code. 1997-05-26 15:15:59 +00:00
Stefan Eßer
5bec615793 Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .

The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...

This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.

A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:

1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
   and are probed like any "standard" PCI device.

The following features are currently missing, but will be added back,
soon:

1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets

This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).
1997-05-26 15:08:43 +00:00
Kenjiro Cho
413fe3928f import Chuck Cranor's ATM driver 1997-05-09 07:48:14 +00:00
John-Mark Gurney
dc01e23eda use frames instead of fields, and restore full meteor compatibility for
generalized pixel support.

Submitted by: Amancio Hasty
1997-05-05 20:54:54 +00:00
Poul-Henning Kamp
b038679c5c Initialize PCI/CardBus bridges.
Tested on:	HP Omnibook 800 / TI PCI1130
Reviewed by:	se
1997-05-03 13:52:29 +00:00
Steve Passe
8e19a74e8d Fixed omission of reference to ioctl_bt848.h when installing on 2.2. 1997-05-01 00:42:54 +00:00
Steve Passe
044768d848 1.15 4/18/97 John-Mark Gurney <gurney_j@resnet.uoregon.edu>
Added [SR]RGBMASKs ioctl for byte swapping.

 1.16          4/20/97    Randall Hopper <rhh@ct.picker.com>
                          Generalized RGBMASK ioctls for general pixel
                          format setting [SG]ACTPIXFMT, and added query API
                          to return driver-supported pix fmts GSUPPIXFMT.

 1.17          4/21/97    hasty@rah.star-gate.com
                          Clipping support added.

 1.18          4/23/97    Clean up after failed CAP_SINGLEs where bt
                          interrupt isn't delivered, and fixed fixing
                          CAP_SINGLEs that for ODD_ONLY fields.

Submitted by:   individuals in above log messages.
1997-05-01 00:16:31 +00:00
Stefan Eßer
862b403b04 Move CMD640 option from kernel Makefile into opt_wd.h
Submitted by:		Wolfgang Helbig <helbig@mx.ba-stuttgart.de>
1997-04-28 19:26:18 +00:00
Peter Wemm
477a642cee Man the liferafts! Here comes the long awaited SMP -> -current merge!
There are various options documented in i386/conf/LINT, there is more to
come over the next few days.

The kernel should run pretty much "as before" without the options to
activate SMP mode.

There are a handful of known "loose ends" that need to be fixed, but
have been put off since the SMP kernel is in a moderately good condition
at the moment.

This commit is the result of the tinkering and testing over the last 14
months by many people.  A special thanks to Steve Passe for implementing
the APIC code!
1997-04-26 11:46:25 +00:00
Stefan Eßer
760b5bf213 Add definition of PCI_SUBID_REG2, the subvendor/device ID for
a header type 2 device.
1997-04-24 08:03:31 +00:00
Stefan Eßer
7cb74fcfa2 Add preliminary support for PCI config header type 2:
Fetch subvendor/device ID from config space register 0x40.
1997-04-23 19:43:20 +00:00
David Greenman
0633918017 Check that the received packet length indicated by the card is at least
large enough to contain the ethernet header. There appears to be a
condition where the card can return "0" in some failure cases, and this
causes bad things to happen (a panic).
1997-04-23 01:44:30 +00:00
Bruce Evans
7f10528533 Fixed the type of timeout functions and removed casts that hid the
type mismatches.  There was no problem in practice (at least on 386's).

Removed NetBSD-related TIMEOUT macro.  NetBSD uses the same BSD4.4Lite
timeout interface as FreeBSD.  As a concession to portability, declare
the timeout function without using the FreeBSD timeout_t typedef.
1997-04-20 15:48:17 +00:00
Poul-Henning Kamp
e4ccad941f The bit of the cardbus bridge support code se and I have been able to agree
on so far... :-)
Reviewed by:	se
1997-04-20 06:57:43 +00:00
David Nugent
a473e68b78 Rearrange pci network card identification for easier additions.
Added KTI NE2000 clone.
1997-04-18 04:44:37 +00:00
Steve Passe
5f59489519 Amancio:
This patch fixes the problem of vic only capturing an even or odd frame plus
the my early patch for missing frames with resolutions higher than 320x240
in rgb mode.

The yuv422 patch introduces a minor bug in that a green line appears at the
bottom of the captured window . There is no easy work around for this right
now.

Reviewed by:	various bt848 hackers
Submitted by:	Amancio Hasty <hasty@rah.star-gate.com>
1997-04-17 22:33:16 +00:00
Poul-Henning Kamp
35e68428eb Recognize ZNYX 314 cards that have a MAC address with the low bit set. 1997-04-05 07:59:41 +00:00
KATO Takenori
30a6636553 Deleted <pc98/pc98/pc98_device.h>. 1997-04-04 16:44:52 +00:00
Steve Passe
938401213d PAL support: magic numbers moved into format_params structure.
Revised AFC interface.
Fixed DMA_PROG_ALLOC size misdefinition.

Submitted by:	richard@cogsci.ed.ac.uk (Richard Tobin)
1997-04-02 01:48:39 +00:00
Poul-Henning Kamp
5482a9c5ca Don't break the nice symmetry of these messages with undue '>' chars. 1997-03-28 18:40:24 +00:00
Stefan Eßer
6072387d65 Fix printing of map sizes: large numbers got a negative sign before. 1997-03-25 19:12:08 +00:00
Stefan Eßer
af78f012fd Improve probe message for generic PCI->xxx bridge chips.
Submitted by:	phk
1997-03-25 19:03:04 +00:00
Stefan Eßer
ee88645781 Add a few vendor IDs and class and sub-class encodings.
Submitted by:	phk
1997-03-25 19:01:46 +00:00
David Greenman
6318197e68 Made a couple of minor optimizations that improve performance of the
common case of the interrupt routine by about 20%.
1997-03-25 14:54:38 +00:00
Steve Passe
2fab5f6edd "Louis A. Mamakos" <louie@TransSys.COM> new bt848 struct
Randall Hopper <rhh@ct.picker.com> GHUE/GBRIGHT bug
Louis Mamakos made a new bt848 struct, including massive changes to the entire
body of code, substituting array offsets with struct members.

Randall Hopper aadded fixes of BT848_GHUE & BT848_GBRIG.

I (fsmp):
  added polled hardware i2c routines,
  removed all existing software i2c routines.
  added  eeprom support.
1997-03-25 04:18:24 +00:00
Bruce Evans
51a534883a Don't include <sys/ioctl.h> in the kernel. Stage 2: include
<sys/sockio.h> instead of <sys/ioctl.h> in network files.
1997-03-24 11:33:46 +00:00
Bruce Evans
fce002fdef Don't include <sys/ioctl.h> in the kernel. Stage 1: don't include
it when it is not used.  In most cases, the reasons for including it
went away when the special ioctl headers became self-sufficient.
1997-03-24 11:25:10 +00:00
KATO Takenori
14667a26c6 Added Accton EN1207-TX support. 1997-03-23 05:10:14 +00:00
Bruce Evans
3c81694426 Fixed some invalid (non-atomic) accesses to `time', mostly ones of the
form `tv = time'.  Use a new function gettime().  The current version
just forces atomicicity without fixing precision or efficiency bugs.
Simplified some related valid accesses by using the central function.
1997-03-22 06:53:45 +00:00
Steve Passe
e75839864d Submitted by: Michael Petry <petry@netwolf.NetMasters.com>
Michael submitted code to activate the audio muxes.

fsmp:
 extended those changes for different boards.
 auto-detection of board types.
 auto-detection of tuner types.
 auto-detection of stereo option.
1997-03-21 17:33:03 +00:00
David Greenman
6ebc315326 Added support for newer cards that have the DP83840A PHY chip.
Fixed a bug in fxp_mdi_write - a hex number was missing a preceding 0x
and this was causing the routine to not wait for a PHY write to complete.
Added support for link0, link1, and link2 flags to toggle auto-
negotiation, 10/100, and half/full duplex:

link0	disable auto-negotiation

	When set, these flags then have meaning:

	-link1	10Mbps
	link1	100Mbps
	-link2	half duplex
	link2	full duplex

...needs a manual page.
1997-03-21 08:00:13 +00:00
KATO Takenori
0908b6ff4a Added Allied Telesis CenterCOM LA100-PCI support. Currently, full
duplex mode doesn't work.
1997-03-20 07:25:22 +00:00
Steve Passe
0f4a397771 additions for table-driven frequency calculation.
addition of colorbar ioctl.
removed unneeded disable_intr()/enable_intr() wrappers in i2c code.
minor cleanup.
1997-03-19 19:10:45 +00:00
Steve Passe
ba2c23286f Submitted by: Doug White <dwhite@gdi.uoregon.edu>
I broke the cable tuning with my 'TEST_A' code.  Remove TEST_A define
till I finish this change for both tuning modes.  Note that this
will effectively break the new TVTUNER_SETFREQ/TVTUNER_GETFREQ ioctl()s.
These aren't used by anyone but me yet (attempt to provide full resolution
fine tuning for "fringe" stations) so it should be no problem
1997-03-17 17:41:24 +00:00
David Greenman
dccee1a193 Fixed two deficiencies in the driver that have existed since it was
written:

1) Full duplex mode is now supported (and works!)
2) The 10Mbps-only PCI Pro/10 should now work (untested, however)

Thanks to Justin Gibbs for providing a PCI bus analyzer trace while the
Intel Windows driver was configuring the board...this made it possible
to figure out the mystery bit that I wasn't setting in the PHY for full
duplex to work.
1997-03-17 11:08:16 +00:00
Steve Passe
55566fdc2f Submitted by: Amancio Hasty <hasty@rah.star-gate.com>
addition of bt848 specific ioctl()s for hue/bright/contrast/satu/satv.

patches by Amancio Hasty to fix "screen freeze" problem.
1997-03-16 07:37:23 +00:00
Justin T. Gibbs
4a2a38f682 The register definitions are now in the compile directory. 1997-03-16 07:12:36 +00:00
Stefan Eßer
e93e9e7392 Add support for the buggy CMD640B PCI EIDE controller chip, which
can't perform overlapping commands on both of its channels.

To enable the CMD640B work-around, the kernel must be compiled with
"options CMD640". Without that option there should be no difference
in the code produced compared to the previous revision of wd.c.

Submitted by:	Wolfgang Helbig <helbig@ba-stuttgart.de>
1997-03-11 23:17:28 +00:00
Mark Murray
51e053d6cc Initial import of the Brooktree PCI-TV drivers. I have not tested
these, they may not even compile. I am importing them on behalf
of the submitters.
Submitted by:	amancio, smp
1997-03-10 06:38:26 +00:00
Justin T. Gibbs
3aaa276222 Make it clearer how the termination settings from the PCI probe are used by
the ahc_init routine.
1997-02-25 03:06:19 +00:00
Joerg Wunsch
ec65be11ef Add support for the SMC9332BDT that's using the DE21140A chip. This
is merely a stop-gap measure until we can import an upgraded driver
from Matt Thomas.

Closes PR # 2696, and most likely also 2767.

OKed by:	core
1997-02-23 10:57:30 +00:00
Peter Wemm
6875d25465 Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.
1997-02-22 09:48:43 +00:00
Justin T. Gibbs
62e2cfe42e ULTRAENB->FAST20 1997-02-09 03:27:09 +00:00
David Greenman
3b576b3e5e Fixed missing ioport offset from the reading/updating of the PLX
interrupt control/status register.

Submitted by:	Brian McGovern <bmcgover@cisco.com>
1997-02-05 22:19:18 +00:00
Andrey A. Chernov
1963788476 Fix misspelled variable name, -current build stopper 1997-02-05 07:23:56 +00:00
Stefan Eßer
cfc23ad40c Add interface revision field to pci_register_lkm parameter list.pci.c pcibus.h
This parameter is intended to allow new kernels to work with old LKM binaries,
provided the revision ID is incremented whenever the PCI LKM interface is
changed. The revision ID does not at all protect against changes in data
structures accesses by the driver.
1997-02-04 18:31:57 +00:00
David Greenman
001696da5b Changed several configuration options:
Disabled the DMA byte counters - I had it this way originally and this is
the recommended setting.
Set crscdt to CRS only (0) since this is what it should be for an MII PHY.
Also fixed some comments.
1997-02-04 11:44:15 +00:00
David Greenman
33d14d8671 Do "selective" reset rather than full reset...the manual specifically
says not to do the full reset because it can lock up the PCI bus if the
chip is active. Added various PORT command definitions to facilitate
this.
1997-02-04 10:53:12 +00:00
David Greenman
6e39e59963 Don't include the short-frames counter in with the input errors. This
counter is incremented on all short frames, including those that are
the result of collisions.
1997-02-04 07:39:28 +00:00
Justin T. Gibbs
9d5e1d812d Add 1997 to my copyright.
Change the autotermination code slightly to be more careful on narrow
adapters.
1997-01-29 05:28:21 +00:00
Stefan Eßer
80432747dc Remove element pb_maxirq from struct pcibus. 1997-01-25 02:22:34 +00:00
Stefan Eßer
e8bfed6d98 Improve on previous fix: Clean up getirq() as well, and remove redundant
warning messages.
1997-01-25 01:57:30 +00:00
Justin T. Gibbs
09e505318a Add the definition for the CFAUTOTERM bit in the aic78xx SEEPROM.
Add auto-termination support as well as support for setting the high byte
termination.  Booting with '-v' will display the settings that the driver
chose.  If you stick narrow devices onto the external wide port, you had
better make sure that your converter cable terminates the bus, you have a
wide device on there that terminates the bus, or you manually set the
termination properly in SCSI-Select instead of using "Automatic".  The
code will get the setting right regardless if you *don't* have internal
wide devices in this type of configuration.  Unfortunatly this is a limitation
of the design of the Adaptec cards.
1997-01-24 22:04:14 +00:00
Stefan Eßer
a67fa10338 Make IRQ 0 invalid in pci_map_int(), since it is hardwired to the
programmable interval timer chip in PC systems.
1997-01-23 22:58:03 +00:00
Justin T. Gibbs
5ea6dc36ff Be smarter about enabling memory mapped I/O. The AHC_ALLOW_MEMIO option
should not be required anymore.

Turn on ULTRA for cards that don't have a BIOS or SEEPROM.
1997-01-22 18:07:15 +00:00
Stefan Eßer
99867152a5 Add PCI LKM support:
The new function pci_register_lkm (struct pci_device *dvp) appends the
driver to the list of known PCI drivers, and initiates a PCI bus rescan.
1997-01-21 23:41:42 +00:00
Stefan Eßer
993dec9d58 Add PCI LKM support. 1997-01-21 23:23:40 +00:00
Joerg Wunsch
e4107dcf00 This mega-merge brings Matt Thomas' 960801 FDDI driver (almost) up
to -current.

Thanks goes to Ulrike Nitzsche <ulrike@ifw-dresden.de> for giving me
a chance to test this.  Only the PCI driver is tested though.

One final patch will follow in a separate commit.  This is so that
everything up to here can be dragged into 2.2, if we decide so.

Reviewed by:	joerg
Submitted by:	Matt Thomas <matt@3am-software.com>
1997-01-17 23:54:45 +00:00
Joerg Wunsch
b05ee6a563 Finally import the 960801 of Matt Thomas' DEC FDDI driver. I'm
importing it onto a vendor branch first, in the hope that this will
make future maintenance easier.

The conflicts are (hopefully) unimportant.  More commits that actually
bring this into the source tree will follow.

Submitted by:	Matt Thomas (thomas@lkg.dec.com)
1997-01-17 23:19:49 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Garrett Wollman
477180fbc8 Use the new if_multiaddrs list for multicast addresses rather than the
previous hackery involving struct in_ifaddr and arpcom.  Get rid of the
abominable multi_kludge.  Update all network interfaces to use the
new machanism.  Distressingly few Ethernet drivers program the multicast
filter properly (assuming the hardware has one, which it usually does).
1997-01-13 21:26:53 +00:00
Søren Schmidt
7c4eadc07b Fix typo.. 1997-01-06 13:51:15 +00:00
Stefan Eßer
4fe8838383 Fix NetBSD pr kern/3067, which also applies to FreeBSD:
NCR driver dies when "xmcd" accesses the CD-ROM drive

Restrict cacheing of INQUIRY results to LUN 0.

Thanks to Dave Huang <khym@bga.com> for reporting the problem
and suggesting a fix, though I chose a slightly different one.
1997-01-05 23:10:23 +00:00
Stefan Eßer
d794fbe35c Add Intel VX chip set specific detection and register dump code.
Submitted by:	brianc@netrover.com (Brian Campbell)
1997-01-02 01:23:17 +00:00
Bruce Evans
0febc3d288 Don't redefine SCSI_NCR_DFLT_TAGS even in if FAILSAFE is defined. 1996-12-23 19:12:29 +00:00
Stefan Eßer
deb4f83f3c Improve negotiation messages:
Print MB/s instead of MHz (now takes WIDE into account).
Remove extranous "\n" from WIDE negotiation messages.
1996-12-21 12:32:34 +00:00
Stefan Eßer
d14302ba21 Add PCI IDs of the ProLAN and Compex PCI NE2000 clones.
Based on information sent by Peter Mutsaers <plm@xs4all.nl>.
1996-12-21 00:04:09 +00:00
Stefan Eßer
edb2a14fa4 Fix bug that would stop probing for SCSI devices
after the first found, if multiple LUNs are tried.
Change probe message to just the SCSI chip id,
similar to what the NCR driver prints.
Change the driver name to "amd" in all places.

Thanks to  Nick Sayer <nsayer@quack.kfu.com> for
doing some debugging, for sending a boot message
log that shows the driver is functional, and for
pointing out there still were places that needed
the driver name to be corrected.
1996-12-20 21:52:11 +00:00
Stefan Eßer
7eda43b2d4 Add include of <vm/pmap.h> to make this driver compile under -current.
Cleanup to make it compile cleanly in LINT.
Submitted by:	bde
1996-12-18 11:41:28 +00:00
Stefan Eßer
b9bffbaea1 Rename DIAGNOSTIC to DMA_DIAGNOSTIC.
Submitted by:	bde
1996-12-18 11:35:12 +00:00
Stefan Eßer
dd0f5b33a3 Add code to fill the EEPROM buffer with default values, if no EEPROM
was found, or if there was a checksum mismatch.
This patch should allow the driver to be used with any AMD 53c974
based SCSI card, or with the AMD SCSI+Ethernet Combo Chip found on
some motherboards.
1996-12-18 01:20:32 +00:00
Stefan Eßer
887819402a Make compile under FreeBSD-current (3.0-DEVELOPMENT). 1996-12-18 01:08:05 +00:00
Stefan Eßer
7abffcc21a Fix "opt_ncr.h" changes:
- put #include into #ifdef KERNEL or ncrcontrol won't build
- rename SCSI_DEBUG_FLAGS to SCSI_NCR_DEBUG
1996-12-16 14:31:45 +00:00
Stefan Eßer
d26d022d05 Tekram supplied driver for their DC390 and DC390T controllers.
These controllers are based on the AMD 53c974, and the driver
does only support those two cards, since it checks for a Tekram
specific configuration EEPROM.
This deficiency (TM) will be fixed soon ... :)

This code is:
	(C)Copyright 1995-1996 Tekram Technology Co., Ltd.

Obtained from:	Tekram
1996-12-15 23:40:48 +00:00
Stefan Eßer
d44022652e Fix typo 1996-12-15 23:25:50 +00:00
Stefan Eßer
a56eccf52b Include "opt_ncr.h" for option settings. 1996-12-15 16:37:17 +00:00
Stefan Eßer
10cffc9fbc Do not limit to 1 LUN if FAILSAVE is set. Seems that CDROM drives
are now only probed for LUN 0, unless there is a specific entry in
scsi_conf.c.
1996-12-15 16:28:24 +00:00
Stefan Eßer
89c1d5dcd9 General cleanup and new features for 53c875 based cards, especially the
Tekram DC390W/U/F, whose config EEPROM can now be dumped, if the kernel
is built with option NCR_TEKRAM_EEPROM.

Other changes:

- add brackets to expansion of OUTB/W/L macro arguments.
- remove unused NCB structure element ns_async
- support sync. SCSI offset of 16 (instead of only 8) on 825A and 875
- correctly identify 53c810A and 53c825A chips
- preserve SCSI BIOS settings of PCI performance options
- remove (already disabled) support for NCR reset because of command timeout
- reverse order of reading of SCSI and DMA specific interrupt cause registers
- add definition of Tekram config EEPROM contents (not currently used)
1996-12-14 13:13:33 +00:00
Jordan K. Hubbard
0b3870cb60 Close PR#2198:
I've added an installation from optical disk drive facility.
	This enables FreeBSD to be installed from an optical disk, which
	may be formatted in "super floppy" style or sliced into MSDOS-FS
	and UFS partitions.

	Note:  ncr.c should be reviewed by Stefan Esser <se@freebsd.org>
	and cd.c by Joerg Wunsch <joerg@freebsd.org> before bringing this
	into 2.2.

Submitted-By: Shunsuke Akiyama <akiyama@kme.mei.co.jp>
1996-12-13 07:55:14 +00:00
David Greenman
fb5831565c 1) Implement SIOCSIFMTU in ether_ioctl(), and change ether_ioctl's return
type to be int so that errors can be returned.
2) Use the new SIOCSIFMTU ether_ioctl support in the few drivers that are
   using ether_ioctl().
3) In if_fxp.c: treat if_bpf as a token, not as a pointer. Don't bother
   testing for FXP_NTXSEG being reached in fxp_start()...just check for
   non-NULL 'm'. Change fxp_ioctl() to use ether_ioctl().
1996-12-10 07:29:50 +00:00
Guido van Rooij
c01cc91938 Some imporvemnets to the vx driver.
1. 'connector_table' is shortened to 'conn_tab'.
2. More reliable connector change code.
3. Display message like "vx0: selected bnc. (link1)"
   when the connector changed by link[012].
4. Handle MII properly.
5. Potentially slightly better performance.
6. Fixed a silly typo.

Submitted by:	Naoki Hamada <nao@sbl.cl.nec.co.jp>
1996-12-02 18:38:37 +00:00
Rodney W. Grimes
79c2a5b3ff Cosmetic code cleanup from Matt's latest driver.
a)  Removal of private typedefs tulip_uint*_t, use standard u_int_*_t.

b)  Change [Dd][Cc]21.4. to just 21.4., seems Dec has done this to all
    of the drivers for all OS's.  (Did they get in trouble with someone?)
    [The few that remain can either not be eliminated, or are waiting for
    additional driver functional changes that will remove them.]

c)  Move some code from dc21040.h into the driver, later a whole block of that
    code and more will move to devar.h, but for now this makes it easier
    to study diffs.

d)  Add a big bold comment to the README.de file about it not reflecting
    reality anymore.

Note that these are all cosmetic changes and should be no functional
change in the driver whatsoever.  If _anyone_ spots a problem introduced
by this please let me know ASAP!
1996-12-01 06:01:00 +00:00
David Greenman
9c7d26071e Fixed obsolete comment. 1996-11-18 02:45:46 +00:00
Justin T. Gibbs
7595de5113 AHC_FORCE_PIO -> AHC_ALLOW_MEMIO 1996-11-16 01:19:50 +00:00
Satoshi Asami
7c219eac8f Some more updates.
wdreg.h: Delete wd_ctlr macro.  PC98 version of wd.c treats it as a
variable.

GENERIC98: Delete ep0 entry. Current ep driver write I/O port 0x100.
This clobbers ICW of i8259, because upper 8bits of address line is not
masked on mother board.

if_fe.c: Merge from revision 1.18 of sys/i386/isa/if_fe.c.

pc98.c: Globalize dmapageport, because SCSI driver use this
variable.

wd82371.c: Yet another merge.

These are 2.2 candidates.

Submitted by:	The FreeBSD(98) Development Team
1996-11-14 08:46:21 +00:00
John Hay
0c064d6185 Oops I forgot to add the official id for this card. 1996-11-13 18:06:52 +00:00
Stefan Eßer
576b74fcc8 Add support for header type == 1 devices (PCI 2.1 compatible PCI to PCI
bridges with support for 64 bit memory addresses and 32 bit I/O addresses).

The code is not complete. It ignores the upper half of the long addresses.
This is not a problem on PC compatible systems, but has to be fixed for
real computers.
1996-11-12 23:18:12 +00:00
Stefan Eßer
c88529d0e9 Fix PCI to PCI bridge register bit field masks.
Thanks to "Mike Durian" <durian@plutotech.com> for the very good
problem report and his support as a beta tester of this patch.
1996-11-12 23:10:24 +00:00
Justin T. Gibbs
ea4f3c468a Clean up the memory mapped/Programmed I/O stuff so that the driver completely
uses one or the other.  This required some changes to the ahc_reset()
function, and how early the probes had to allocate their softc.

Turn the AHC_IN/OUT* macros into inline functions and lowercase their names
to indicate this change.  Geting AHC_OUTSB to work as a macro doing
conditional memory mapped I/O would have been too gross.

Be smart about the STPWEN control bit in SCFRCTL1.  It should only be set
if the low byte of the bus is to be terminated.  We figure this out either
by "caching" the value left over from the BIOS setup before we reset the card
or by using the values stored in the seeprom if it is availible.
1996-11-11 05:26:14 +00:00
David Greenman
d66e3876dd Put the packet error printf inside #ifdef DIAGNOSTIC. 1996-11-10 13:36:46 +00:00
Stefan Eßer
e6f6908163 Only access the specific interrupt status registers if required.
This follows more closely the suggestions in the latest NCR docs, and has
been running on my system for weeks with no problem. It does improve the
quality of diagnostic messages and does allow to better understand the
sequence of events in case of an error.

This should go into 2.2 and 2.1.6.
1996-11-08 23:46:04 +00:00
Justin T. Gibbs
a75528de6b Clean up some code having to do with the 398X cards. We can't rely on the
7810 being either the last of the first device to be probed, so use a counting
scheme instead to determine when one card ends and another begins.  There may
be a better way to do this by decoding the PCI tag, which I will investigate
later.

2.2 Candidate.
1996-11-05 07:59:28 +00:00
Guido van Rooij
b3ac88f13f New vx driver for:
3COM 3C590 Etherlink III PCI,
        3COM 3C595 Fast Etherlink PCI,
        3COM 3C592 Etherlink III EISA,
        3COM 3C590 Fast Etherlink EISA,
        3COM 3C900 Etherlink XL PCI and
        3COM 3C905 Fast Etherlink XL PCI.

This driver is based on OpenBSD's driver. I modified it to run under FreeBSd
and made it actually work usefully.
Afterwards, nao@tom-yam.or.jp (HAMADA Naoki) added EISA support as well as
early support for 3C900 Etherlink XL PCI and 3C905 Fast Etherlink XL PCI.
He also split up the driver in a bus independant and bus dependant parts.

Especially the 3c59X support should be pretty stable now.

Submitted by:	partly nao@tom-yam.or.jp (HAMADA Naoki)
Obtained from:partly OpenBSD
1996-11-04 22:17:20 +00:00
John Hay
ebcdcb982a Add support for the SDL RISCom N2pci cards. Bring in the enhancements
made to the Arnet driver.
1996-10-29 03:53:21 +00:00
Justin T. Gibbs
b36b7d853f Add basic support for the 398X cards as multi-channel SCSI host adapters.
This involves expanding the support of the SEEPROM routines to deal with
the larger SEEPROMs on these cards and providing a mechanism to share
SCB arrays between multiple controllers.

Most of the 398X support came from Dan Eischer.

ahc_data -> ahc_softc

Clean up some more type bogons I missed from the last pass.
1996-10-28 06:10:33 +00:00
Justin T. Gibbs
7491f60b54 - KNF cleanup.
- Add support for memory mapped I/O.
1996-10-25 06:43:10 +00:00
Stefan Eßer
9ac309b8ce Definitions for ioctl() accesses to PCI config space registers.
Submitted by:	wollman
1996-10-22 20:33:19 +00:00
Stefan Eßer
10e966fae4 Add support for ioctl() accesses to PCI config space registers.
Garrett Wollman sent me this code a few weeks ago for review, and I made
some significant changes, which he in turn accepted ...

In order to make use of these changes, a device entry has to added to /dev.

Submitted by:	wollman
1996-10-22 20:20:14 +00:00
Bruce Evans
62c3734cbe Updated #includes to 4.4lite style. 1996-10-15 19:22:46 +00:00
Stefan Eßer
b86a81e448 pci_map_mem() did a too restrictive check on the mapping type:
PCI_MAP_MEMORY_TYPE_32BIT_1M should be accepted as well as
PCI_MAP_MEMORY_TYPE_32BIT (and now is).
(Problem reported by David Greenman.)
1996-10-14 13:04:34 +00:00
Stefan Eßer
b7ccd3dc56 Move the initialization of np->ns_sync and ns_async out of ncr_getclock(),
which does no longer get called for non-Ultra cards.
Fix suggested by Gerard Roudier, slightly modified by me.
1996-10-14 10:09:52 +00:00
David Greenman
3010cd6550 Changes to add support for the PCI version of the Cyclades Cyclom-Y
serial adapter, and support for multiple Cyclom controllers.
1996-10-13 01:09:24 +00:00
Bruce Evans
4458ac71b1 Removed nested include if <sys/socket.h> from <net/if.h> and
<net/if_arp.h> and fixed the things that depended on it.  The nested
include just allowed unportable programs to compile and made my
simple #include checking program report that networking code doesn't
need to include <sys/socket.h>.
1996-10-12 19:49:43 +00:00
Stefan Eßer
bdf9734704 Fix previous commit: The INB/OUTB macros require np->vaddr to be
initialized, or a kernel panic will occur.

Submitted by:	Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
1996-10-12 17:33:48 +00:00
Stefan Eßer
20bc4c3ac1 Improve support of SCSI cards based on the 53c860 and 53c875.
Still no support for Ultra-SCSI and other new features, but the code
should now correctly initialize the clock pre-scaler (based on freqency
measurement results, if necessary).

Fix support of 16 targets for WIDE SCSI.

Disable bus reset in case no progress is made for too long ("ncr dead"
message), which did not work too well with scanners and other slow devices.
1996-10-11 19:50:12 +00:00
Garrett Wollman
4f02305016 Implement the 802.3 MIB in a way that uses the generic interface
defined in if_mib.h.
1996-10-10 19:44:10 +00:00
Paul Traina
e0c973266d The recent change to clock.h to include opt_cpu.h (bug!!!) uncovered a
compile error in ncrcontrol.c -- ncr.c should not be including clock.h
when not compiled for the kernel.
1996-10-10 04:09:37 +00:00
Justin T. Gibbs
2ea8799246 Bring aic7xxx driver bug fixes from 'SCSI' into current. 1996-10-06 16:38:45 +00:00
David Greenman
8d1005c8c4 Added multicast support (BPF cookie bug was already fixed).
Submitted by:	Steven McCanne <mccanne@cs.berkeley.edu>
1996-10-03 10:47:03 +00:00
David Greenman
78fb85bbf7 Backed out one of my "performance optimizations" as it results in sometimes
not resuming the NIC as required for transmit. Thanks to Alan Cox
<alc@cs.rice.edu> for noticing this.
Added another performance optimization to compensate. :-)

Changed crscdt to 1...strange, but this seems to be needed for some reason
despite what the manual says.
1996-09-29 10:20:45 +00:00
David Greenman
1cd443ace8 Fixed a bug with the management of the pointer to the first TxCB in the
ring that caused wrong things to happen sometimes.
Doubled the number of transmit descriptors to 128 so that the internal
FIFO in the NIC can be fully filled when dealing with small packets.
Several minor performance improvements.
1996-09-22 11:48:54 +00:00
David Greenman
eadd5e3a24 Fixed a bug in the receive buffer allocation code that resulted in a
panic if an mbuf cluster couldn't be allocated. This was caused by a
failure to re-initialize m_data when the old mbuf/mbcluster was recycled.
1996-09-20 11:05:39 +00:00
David Greenman
3163485ccc Add back shutdown support, this time using the at_shutdown() mechanism. 1996-09-20 04:35:15 +00:00
David Greenman
4a684684f4 When the devconf stuff was ripped out of the kernel, the ripper neglected
to deal with the fact that we relied on devconf to do the shutdown
callouts in various drivers. The changes in this commit are to add support
for device shutdown in this driver via the new at_shutdown() mechanism.
Similar changes need to be made to all of the other drivers that need
a shutdown routine called (if_de.c comes to mind immediately).
1996-09-20 04:11:53 +00:00
David Greenman
f9be9005ce Implemented a better, dynamic, mechanism for adjusting the transmit
threshold.
1996-09-19 09:15:20 +00:00
David Greenman
7af18210c3 Increased transmit threshold to 1024 bytes to fix a problem with underruns
on machines with poor PCI performance.
1996-09-18 16:18:05 +00:00
David Greenman
40e4ce5ab9 Updated driver to a newer version from Matt Thomas, preserving our local
changes. This version should fix a number of bugs such as with auto-
speed sensing and at least one known panic.

Submitted by:	Matt Thomas (matt@3am-software.com)
1996-09-18 14:44:31 +00:00
Rodney W. Grimes
7ccde0654a Re-enable conf82371fb2 now that I have verified that it works, even if
it only prints 2 bits out of hundreds.  (Minimizing the diff between
-head and 2.1.5.)
1996-09-16 08:56:39 +00:00
Bruce Evans
b568ea4e01 Removed more devconf leftovers. 1996-09-10 23:31:13 +00:00
Bruce Evans
f313170d3c Updated #includes to 4.4Lite style. 1996-09-10 08:32:01 +00:00
Rodney W. Grimes
8b3cbd0cef Remove the portion of revision 1.36 that added the #ifdef's for CPU
types as per discussions with Stefan Esser.
1996-09-09 06:09:45 +00:00
Poul-Henning Kamp
40f3771f7f Various cleanups for remanents of devconf. 1996-09-08 10:44:18 +00:00
Bruce Evans
ec7ada96e6 Preserve volatility in casts of np->reg. Cosmetic. 1996-09-07 21:27:24 +00:00
Poul-Henning Kamp
bfbb029d87 Remove devconf, it never grew up to be of any use. 1996-09-06 23:09:20 +00:00
Rodney W. Grimes
851790dd27 Partial merge of RELENG_2_1_0 -> HEAD (addition of Intel 82439HX chip text). 1996-09-06 09:21:48 +00:00
Stefan Eßer
c6060a60ef Fix Orion specific code by moving config_orion() to a place where it does
not depend on bootverbose being true.

Include only register specifications for those chip sets that apply to
a cpu that might boot this a particular kernel (ie. make the Saturn code
depend on I486_CPU being defined, the Pentium chip sets on I586_CPU ...)
1996-09-05 21:34:12 +00:00
Stefan Eßer
77b3da75e6 Fix code that deals with multiple host to PCI bridges by making the next
one use the highest seen bus number plus 1 as its starting point.
1996-09-05 21:28:51 +00:00
Stefan Eßer
64dc51ab2e Correct previous Orion specific fix: The configuration register
access function always returns a DWORD aligned DWORD ...
1996-09-02 21:33:41 +00:00
Stefan Eßer
7fa8a688aa Add preliminary support for the Orion PCI chip set. It is special in the
way it attaches multiple PCI buses directly to the CPU, instead of having
them hanging off from PCI to PCI bridges. This code is a hack, and will
be obsoleted by the planned rework of the PCI code, which will change the
dealing with PCI to PCI bridges and other special devices significantly.

The patch also adds a kern_devconf entry for PCI bus 0 which is assumed
to be a child of cpu0. The new PCI code will make it possible to hand out
the kern_devconf structure to a pci device being attached, since this is
(regretably, IMHO) required by a few ISA devices.

Finally there are new PCI ids for some Intel chip set devices, which had
already been known to 2.1.5R, but did not make it into -current. This closes
"kern/1558: PCI probe seems to have lost a device in -current".
1996-09-02 21:23:06 +00:00
Bruce Evans
2bc27032c2 Use "" instead of <> for a header in the current directory.
Don't #include an unused header from i386/isa.  Headers from there
shouldn't be included in "isa-independent" files anyway.
1996-08-28 18:54:26 +00:00
Stefan Eßer
ad873e05e4 Put back the initialization of the time constants of the SCSI and Sync.
logic clock signal, which had been erroneously commented out by the
previous commit. This will re-enable support for sync. transfer negotiation,
which depends on one of those values.
1996-08-27 20:41:02 +00:00
Stefan Eßer
23da20014a Set clock prescale based on BIOS supplied value instead of trying to
calculate an optimum value from (constant) parameters.
This should set the SCNTL3 register of the 53c860 and 53c875 to twice
the divider it used to be, since cards based on those chips seem to use
an 80MHz clock instead of the Clock Doubler feature and a 40MHz clock.
1996-08-26 22:38:07 +00:00
Poul-Henning Kamp
26a8b0bf7e Megacommit to straigthen out ETHER_ mess.
I'm pretty convinced after looking at this that the majority of our
drivers are confused about the in/exclusion of ETHER_CRC_LEN :-(
1996-08-06 21:14:36 +00:00
Poul-Henning Kamp
590dbfbf6a Use ether_ioctl() to do a lot of grunt work. 1996-08-06 21:09:25 +00:00
Stefan Eßer
d8a8289c5a Send out a period of "0" if negotiating asynchronous transfers (offset = 0).
A value of "255" used to be sent, and though it should not matter, there
appear to be a few devices that want both values to be zero for asynch.
1996-08-05 19:39:51 +00:00
Stefan Eßer
c268c94f6b FINALLY: PCI support for the Lance Ethernet driver.
This code applies to several systems with integrated Ethernet
chip, for example from HP or Compaq. It should also support
PCI Ethernet cards based on the AMD PCI Lance chip.

This code has been reviewed (visually) by Paul Richards and
tested (using an ISA Lance board) by Joerg Wunsch.
Since the parameters to nearly each and every single function
had to be changed (generally from unit number to lnc_soft*),
there is some potential for buglets having crept in ...

BEWARE: If you had lnc0 configured to have the ISA probe find
your PCI Lance, then it should now be found by the PCI probe,
and should be automatically configured as pci1 (!!! note the "1").

Reviewed by:	paul, joerg
1996-07-18 22:03:47 +00:00
Bruce Evans
6ab46d52a5 Don't use NULL in non-pointer contexts. 1996-07-12 04:12:25 +00:00
Bruce Evans
9b2b0822b7 Removed unused #includes of <i386/isa/icu.h> and <i386/isa/icu.h>. icu.h
is only used by the icu support modules and by a few drivers that know
too much about the icu (most only use it to convert `n' to `IRQn').  isa.h
is only used by ioconf.c and by a few drivers that know too much about
isa addresses (a few have to, because config is deficient).
1996-06-18 01:22:40 +00:00
Satoshi Asami
ad63a118b2 The Great PC98 Merge.
All new code is "#ifdef PC98"ed so this should make no difference to
PC/AT (and its clones) users.

Ok'd by:	core
Submitted by:	FreeBSD(98) development team
1996-06-14 11:02:28 +00:00
David Greenman
0648f71275 Updated this driver to a newer version from Matt. This should fix several
bugs related to support of dc21041 chips and other problems.

Submitted by:	Matt Thomas <matt@3am-software.com>
1996-06-14 05:25:32 +00:00
Gary Palmer
c23670e294 Clean up -Wunused warnings.
Reviewed by:		bde
1996-06-12 05:11:41 +00:00
Alexander Langer
7966b47a3e Detach the device at shutdown.
Add a prototype for ed_attach_NE2000_pci (this really belongs somewhere
else, but where?).
1996-06-11 00:51:49 +00:00
Satoshi Asami
58e025d580 Scan PCI buses in order the BIOS has assigned them. This is sometimes
necessary to boot from a SCSI disk connected to a twin-channel adapter,
and you have multiple of them (disks and adapters).

Reviewed by:	se
1996-06-09 11:58:19 +00:00
Justin T. Gibbs
43ebe040fe Only assume the scratch ram is valid (we were initialized by the BIOS)
if SCSIID is something other than 0.
1996-06-08 06:55:55 +00:00
Jordan K. Hubbard
068439339a Here is a patch that fix a few problems with the RGB version of
the meteor card.
Submitted-by: james
1996-06-07 03:03:25 +00:00
Gary Palmer
a330e1f1a5 Set ifnet.baudrate for ethernet / FDDI interfaces too. Makes
SNMP slightly more informative

Reviewed by: Garrett Wollman
1996-06-01 23:25:10 +00:00
Justin T. Gibbs
c2d50bea44 Merge in changes for NetBSD/OpenBSD.
NetBSD/OpenBSD support Submitted by:Noriyuki Soda <soda@sra.co.jp>,
				    Pete Bentley <pete@demon.net>,
				    Charles M. Hannum <mycroft@mit.edu>,
				    Theo de Raadt <deraadt@theos.com>
1996-05-30 07:20:17 +00:00
Justin T. Gibbs
087b79e649 Correct a botched commit from yesturday. It helps to bring over the
right patch file.<sigh>
1996-05-23 15:02:18 +00:00
Garrett Wollman
1608c58429 Let the user know what errors are experienced on received packets.
I spent the better part of a day trying to figure out why my
experiment didn't work the way I expected, only to find out that
the router was dropping huge numbers of packets because of PCI bus
priblems.  This does not fix the bug that errors are counted as
input packets because my patch doesn't apply cleanly.
1996-05-21 19:05:31 +00:00
Justin T. Gibbs
0d12199628 It seems that the aic78X0 chips will either have their scratch ram
as all 0s or all 1s after POST if there is no BIOS installed.
1996-05-21 18:38:41 +00:00
Stefan Eßer
8408422768 Add support for NE2000 compatible PCI Ethernet cards. The PCI probe
is enabled by having an "device ed0 at isa? [...]" config line.
The first PCI card will get a unit number one higher than the highest
defined for any ISA card of the ED type, e.g. if ed0 and ed1 are
configured, then the PCI cards will be ed2, ed3, ...

BEWARE: If you have configured your kernel as ed0 with the port address
as assigned by the PCI BIOS, then your card will be found by both the
PCI and ISA probes, and bad things may happen. Make sure to restore
the original port address form the GENERIC kernel for the ed0 device!

Reviewed by:	davidg
1996-05-18 17:56:42 +00:00
Stefan Eßer
4beaf036a6 Fix range check to actually test the variable that will be used as
an index later.

Submitted by:	Erich Stefan Boleyn <erich@uruk.org>
1996-05-18 17:32:20 +00:00
Jordan K. Hubbard
734d08a223 A patch for the meteor device driver. It fixes:
1) A spelling error pointed out by Paco Hope.
       2) A bug in the range checking routing pointed out by Jim Bray.
       3) Enables the setting of frames per second.
Submitted-By: Jim Lowe <james@miller.cs.uwm.edu>
1996-05-17 09:43:15 +00:00
Justin T. Gibbs
58efe44318 Fix a brain-o. The scratch ram on aic78X0 controllers is initialized to 0x00
not 0xff after POST, so test for that when trying to determine if a BIOS
intialized the card for us.
1996-05-12 16:25:32 +00:00
Justin T. Gibbs
8d92e174b9 Free our device information in one error case in the driver probe. 1996-05-12 01:50:33 +00:00
Justin T. Gibbs
cba01a3fa6 Add missing '+ io_port' to two outbs.
Add missing splx() in one error case during probes.
Remove unnecessary return and break.

Submitted by: Noriyuki Soda <soda@sra.co.jp>
1996-05-12 01:46:11 +00:00
Justin T. Gibbs
33cb7dbb53 The aic78X0 cards have 0xff in all bytes of scratch ram after POST. If
a BIOS was not installed, this will still be true by the time we probe
the chip.  We use this heuristic to determine if we should use the left
over scratch ram target settings for controllers that don't have an
SEEPROM.  We also "snapshot" the host adapter SCSI id and whether ultra
is enabled or not and use these values if a BIOS was installed.  The card
will act as if a BIOS was installed even if there wasn't one if you warm
reboot, but since the scratch ram area is still valid in this case, its
hardly worth the effort of writing a shutdown routing that clears out
the scratch ram.  This should make users of motherboard controllers
happy.
1996-05-10 16:26:41 +00:00
Poul-Henning Kamp
aa8de40ae5 Another sweep over the pmap/vm macros, this time with more focus on
the usage.  I'm not satisfied with the naming, but now at least there is
less bogus stuff around.
1996-05-03 21:01:54 +00:00
Poul-Henning Kamp
a01e236e9a Removed $Log$ 1996-05-02 14:58:15 +00:00
Poul-Henning Kamp
e911eafcba removed:
CLBYTES PD_SHIFT PGSHIFT NBPG PGOFSET CLSIZELOG2 CLSIZE pdei()
        ptei() kvtopte() ptetov() ispt() ptetoav() &c &c
new:
        NPDEPG

Major macro cleanup.
1996-05-02 14:21:14 +00:00
Satoshi Asami
f8176d838c Fix logic bug in pci bridge code. For a PCI-PCI bridge, secondary
should be <= than subordinate, not the other way around.

They are both true if the bridge is not cascaded (i.e., twin-channel
scsi/e-net adapters won't be affected by this bug), which is probably why
it was unnoticed until today.
1996-04-25 06:04:27 +00:00
Justin T. Gibbs
bb0877f67f Add PCI IDs for the aic7860 (basically an aic7850 Ultra) and the aic7855
(HP motherboard aic7850 controllers).

Properly handle 4 bit controller SCSI IDs.

Update my copyright.
1996-04-20 21:31:27 +00:00
Stefan Eßer
68159c8901 Update PCI bus code from my current sources:
- always use pci_conf_read() and pci_conf_write(). (This is required to
  simulate non-existant devices in my system for PCI bridge code tests.)

- reorder some functions (put the main functions at the end).

- correct off by one bug in the code dealing with unitialized PCI to PCI
  bridge chips. (Bug found by ASAMI Satoshi.)

- print function number for multi-function devices.
1996-04-14 20:14:36 +00:00
David Greenman
58b248e254 Removed sections 3 and 4 from my copyright. 1996-04-08 01:31:42 +00:00
Bruce Evans
6ffde942bf Removed never-used #includes of <machine/cpu.h>. Many were apparently
copied from bad examples.
1996-04-07 17:39:28 +00:00
Bruce Evans
3157adc8af Removed now-unused #includes of <machine/cpu.h>. They were for bootverbose
being declared in the wrong place.
1996-04-07 17:32:42 +00:00