Commit Graph

200 Commits

Author SHA1 Message Date
Warner Losh
47c6e6e849 Fix pccard ed driver, I think.
o Expose ed_stop and call it early to shutdown the hardware.
o When releasing the interrupt, pass the cookie for the irq, not
  a pointer to the cookie (this is the base problem).
o Release other resources used, just like the ep driver
1999-12-10 07:22:53 +00:00
Warner Losh
e09f49b6fa Fix the hang on card eject problem and maybe the hang on suspend
problem.

o Create new timeout routine so we don't detach the card inside a ISR
  but instead drop back to spl0 via a timeout of 0.
o Actually delete the child of the pccard device rather than just faking
  it badly.
o Fix sio, ed and ep to have pccard detach routines that are int rather
  than void.
o Fix ep and ed pccard detach routines to use if_detach rather than just
  if_down.  if_detach destroys the device, while if_down just marks it
  down.  In this incarnation of the pccard things, we map the disable
  the slot action to detach the driver, which removes the driver from the
  device tree.  When that is done, a panic would soon follow as the
  ifconfig tried to down the device.

Didn't fix:
o Should cache the pccard dev child's pointer in struct slot
o remove now unused parts of struct slot
o Any driver using softc after detach has been called.  sio's softc used
  to be statically allocated, so you could check sc->gone, but that is
  now gone.
o Didn't remove gone from softc of drivers that use the old pccard method.

Didn't test:
o ed driver changes
o sio driver changes on pccards
o suspend (no laptop or apm support on my desktop)
1999-12-01 07:38:54 +00:00
Matthew N. Dodd
cb5d0c333f I forgot to remove the "NCARD == 0" hacks that kept this driver
from blowing up on PCMCIA systems.  The hack isn't needed anymore.

Reminded by: Blaz Zupan <blaz@gold.amis.net>
1999-11-20 09:28:01 +00:00
Warner Losh
b1ef7ecbc7 Kill unneeded #includes. They were left over from the short period of
time when a strcmp against the device name was required.  Sio patches
sent to peter for review.
1999-11-20 05:16:14 +00:00
Yoshihiro Takahashi
663631a5eb Set port_used and mem_used to the resource size instead of 1.
Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
1999-11-18 14:18:19 +00:00
Jonathan M. Bresler
aab735d218 fix misordering of two lines in this file. 1999-11-02 02:19:24 +00:00
Jonathan M. Bresler
4b9943106b rearrange order of tests for NE1000, NE2000, and Linksys
cards.   previous order caused computers with NE2000 cards
        to hang during boot.
1999-11-01 01:16:56 +00:00
Yoshihiro Takahashi
b81cbfc4af Change Linksys registers base/offset.
On NEC PC-98, asic_addr != nic_addr + 0x10.

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
1999-10-31 09:05:20 +00:00
Warner Losh
806338b15d Last change to pccard_nbk now obviates the need to check the name of
the device in question.
Also fix warnings on if_ep_pccard.c
1999-10-28 05:06:14 +00:00
Warner Losh
12e0beb470 Add comments to Linksys probe code.
Add another OUI to those acceptible to linksys (this check may need to
be removed).
A couple of style(9) nits.
1999-10-28 04:53:46 +00:00
Jonathan M. Bresler
6d193c9936 add support for LinkSys 10/100 cards
new code is conditionalized by the vendor's ethernet OUI

Obtained from:	PAO Project
1999-10-26 23:03:45 +00:00
Warner Losh
99ad33d010 Have only one attach routine, rather than two.
Remove debug printfs.

This should allow the ed driver to work when memory mapping works again.
1999-10-25 06:15:45 +00:00
Warner Losh
e3132c8373 Add pccard attachment. This won't work with memory mapped ed devices
yet, but that should be resolved shortly.  Non memory mapped ed
devices should work, but I cannot test this since my only ed card is
memory mapped.

Submitted by: Matt Dodd <mdodd@freebsd.org>
1999-10-25 02:55:14 +00:00
Matthew N. Dodd
e3f7c52da1 Fix compiling PCCARD kernels.
This is a hack and I don't like it.

Hopefully the new PCCARD stuff should be in working order in a day or so.
1999-10-24 07:17:26 +00:00
Matthew N. Dodd
c769df5b65 This fixes the problem with SMC NE2000 cards hanging the box on
bootup.  Somehow my backout of an abortaive attempt at shared
memory autoconfiguration included this line:

        sc->mem_shared = 1;

Which is fairly important as it turns out.

Since I performed my pre-commit testing on a different box with a generic
NE2000 I didn't catch this.  Pointy hat.
1999-10-18 04:27:33 +00:00
Matthew N. Dodd
14bacef14e - Remove the ISA, PCI, and PCCARD specific code from if_ed.c; it
now lives in the respective bus front end files.
- Add various function prototypes to if_edvar.h
- Clean up some debugging code that snuck into if_ed_isa.c
- Turn on the right bits in files.i386
1999-10-15 03:12:48 +00:00
Matthew N. Dodd
9b63938369 Break out the bus front end code into separate files.
Note that these haven't been turned on nor has the old code
been removed from if_ed.c.  The next commit will address that.
1999-10-15 01:28:04 +00:00
Doug Rabson
25afb89b1c * Add struct resource_list* argument to resource_list_alloc and
resource_list_release. This removes the dependancy on the
  layout of ivars.

* Move set_resource, get_resource and delete_resource from
  isa_if.m to bus_if.m.

* Simplify driver code by providing wrappers to those methods:

     bus_set_resource(dev, type, rid, start, count);
     bus_get_resource(dev, type, rid, startp, countp);
     bus_get_resource_start(dev, type, rid);
     bus_get_resource_count(dev, type, rid);
     bus_delete_resource(dev, type, rid);

* Delete isa_get_rsrc and use bus_get_resource_start instead.

* Fix a stupid typo in isa_alloc_resource reported by Takahashi
  Yoshihiro <nyan@FreeBSD.org>.

* Print a diagnostic message if we can't assign resources to a PnP
  device.

* Change device_print_prettyname() so that it doesn't print
  "(no driver assigned)-1" for anonymous devices.
1999-10-12 21:35:51 +00:00
Poul-Henning Kamp
46783fb897 Remove NBPF conditionality of bpf calls in most of our network drivers.
This means that we will not have to have a bpf and a non-bpf version
of our driver modules.

This does not open any security hole, because the bpf core isn't loadable

The drivers left unchanged are the "cross platform" drivers where the respective
maintainers are urged to DTRT, whatever that may be.

Add a couple of missing FreeBSD tags.
1999-09-25 12:06:01 +00:00
Peter Wemm
814e16091b Make if_ed work again on pci, isa, isapnp. The hack to make it work on
PCCARD is pretty revolting but should buy us time while the pccard driver
angle is sorted out.  A commit for the MCA ed attachment will follow
shortly.
1999-09-20 05:48:16 +00:00
Peter Wemm
0e27edc0e2 The sense of probes has inverted. They return an error, rather than
true/false.  Fix ed_probe_HP_pclanp() so that it doesn't "succeed" on
non-existing hardware.

Submitted by:	Mark Hittinger <bugs@freebsd.netcom.com>
1999-09-13 19:14:43 +00:00
Doug Rabson
062acdb7e7 Change isa_get/set_flags() to device_get/set_flags(). 1999-09-07 08:42:49 +00:00
Peter Wemm
3ca1647688 $Id$ -> $FreeBSD$ 1999-09-05 15:21:05 +00:00
Peter Wemm
599d7638dd Commit a checkpoint of an updated if_ed driver. This is pretty much
Doug Rabson's work, with a few tweaks from Warner Losh and I.  There are
still some quirks to resolve, but the old driver is presently breaking
the build.
1999-09-03 19:10:56 +00:00
KATO Takenori
8b18acc0df - Added new macros ED_P1_MAR(i) and ED_P1_PAR(i) that replace
`ED_P1_MAR + i' and `ED_P1_PAR + i', respectively.
- convert ED_PC_RESET and ED_PC_MISC into relative offset from
  ED_PC_ASIC_OFFSET (those macros are not used in current source).

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
1999-09-02 15:06:23 +00:00
KATO Takenori
c322fa140e The ed_probe_Novell should not clear id_maddr when it fails to probe.
This fixes potential panic by kvtop at addr == 0.

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
1999-09-02 15:01:56 +00:00
Doug Rabson
f6b6a3497c This is part of an untested set of changes to the ed driver to support
the new PnP code. Since the bulk of the driver changes are not being
committed at this time, it will not affect the driver. The code is being
committed early to allow others synchronise changes.
1999-09-01 21:21:03 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Dag-Erling Smørgrav
6b5ca0d83e Rename bpfilter to bpf. 1999-07-06 19:23:32 +00:00
Peter Wemm
9929d2a045 Eliminate a bunch of #include "pci.h" and #if NPCI > 0 around entire
files.  config will leave the whole file out if configured to do so.
1999-07-03 20:17:08 +00:00
Peter Wemm
87e37dccb6 #ifdef BRIDGE around a goto label used by the bridge code to silcence a
warning.
1999-05-09 23:24:47 +00:00
Peter Wemm
579f45fa60 Simplify the COMPAT_PCI_DRIVER/DATA_SET hack. We can add:
#define COMPAT_PCI_DRIVER(name,data) DATA_SET(pcidevice_set,data)
.. to 2.2.x and 3.x if people think it's worth it.  Driver writers can do
this if it's not defined.  (The reason for this is that I'm trying to
progressively eliminate use of linker_sets where it hurts modularity and
runtime load capability, and these DATA_SET's keep getting in the way.)
1999-05-09 17:07:30 +00:00
Peter Wemm
96b3554e5c Use COMPAT_PCI_DRIVER() for registration if it exists. This shouldn't
hurt the driver portability to 3.x too much for where drivers are shared.
1999-04-24 20:17:05 +00:00
Peter Wemm
6182fdbda8 Bring the 'new-bus' to the i386. This extensively changes the way the
i386 platform boots, it is no longer ISA-centric, and is fully dynamic.
Most old drivers compile and run without modification via 'compatability
shims' to enable a smoother transition.  eisa, isapnp and pccard* are
not yet using the new resource manager.  Once fully converted, all drivers
will be loadable, including PCI and ISA.

(Some other changes appear to have snuck in, including a port of Soren's
 ATA driver to the Alpha.  Soren, back this out if you need to.)

This is a checkpoint of work-in-progress, but is quite functional.

The bulk of the work was done over the last few years by Doug Rabson and
Garrett Wollman.

Approved by:	core
1999-04-16 21:22:55 +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
Matthew Dillon
0a5e03dda5 Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile
1999-01-28 01:59:53 +00:00
Peter Wemm
d17e4ee67d Update the pccard hooks to use a module style declaration instead. 1999-01-19 00:21:53 +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
Eivind Eklund
b3a941181e Remove warning introduced by the last committer. 1998-12-13 23:00:48 +00:00
Bruce Evans
fe310de802 Initialize isa_devtab entries for interrupt handlers in individual
device drivers, not in ioconf.c.  Use a different hack in isa_device.h
so that a new config(8) is not required yet.

pc98 parts approved by: kato
1998-10-22 05:58:45 +00:00
KATO Takenori
0dce060dd6 Discard previous commit. 1998-10-08 17:20:58 +00:00
KATO Takenori
bb168650e8 Add SMC EtherEZ98 support to ed driver (PC-98).
Reviewed by:	kato
Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
1998-10-08 17:04:59 +00:00
Eivind Eklund
dfef928b1c Support PnP compatibility IDs. This allow e.g. the ed driver to pick
up any PnP NE2000 compatible card, instead of forcing us to always
update ID lists.

Submitted by:	Ugo Paternostro <paterno@dsi.unifi.it>
1998-09-13 22:15:44 +00:00
Bruce Evans
00671271c3 Fixed printf format errors. Only one left in LINT on i386's. 1998-08-24 02:28:16 +00:00
Bruce Evans
be160d60ab Removed unused includes. 1998-06-21 18:02:50 +00:00
Bruce Evans
f878d7eebd Include <i386/isa/pnp.h> after including its prerequisite
<i386/isa/isa_device.h> - don't depend on pollution in <sys/conf.h>
including the prerequisite earlier.
1998-06-17 14:01:00 +00:00
Doug Rabson
ecbb00a262 This commit fixes various 64bit portability problems required for
FreeBSD/alpha.  The most significant item is to change the command
argument to ioctl functions from int to u_long.  This change brings us
inline with various other BSD versions.  Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.

The prototype FreeBSD/alpha machdep will follow in a couple of days
time.
1998-06-07 17:13:14 +00:00
Dag-Erling Smørgrav
dc73342347 Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108. 1998-04-17 22:37:19 +00:00
Bruce Evans
c1087c1324 Support compiling with `gcc -ansi'. 1998-04-15 17:47:40 +00:00
Eivind Eklund
0fd9336b7e Don't use fast interrupts when initialized through PnP. if_ed does
not support fast interrupts.

Noticed by:	bde
1998-03-29 03:22:19 +00:00