aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2000-11-25 03:36:09 +0000
committerPeter Wemm <peter@FreeBSD.org>2000-11-25 03:36:09 +0000
commitb3d39a56aecc4feb1ea053c7411ce412f07615f1 (patch)
tree54b5d9efc2d4d99f64ef766d3b8ce926138c2210 /sys/dev
parent249849e0b9c06deecaaf74a9d971b37cc85dc86a (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ed/if_ed.c6
-rw-r--r--sys/dev/ed/if_ed_pccard.c31
2 files changed, 35 insertions, 2 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c
index 72fb2ef173ac..a1222b4096ae 100644
--- a/sys/dev/ed/if_ed.c
+++ b/sys/dev/ed/if_ed.c
@@ -1590,16 +1590,22 @@ ed_release_resources(dev)
struct ed_softc *sc = device_get_softc(dev);
if (sc->port_res) {
+ bus_deactivate_resource(dev, SYS_RES_IOPORT,
+ sc->port_rid, sc->port_res);
bus_release_resource(dev, SYS_RES_IOPORT,
sc->port_rid, sc->port_res);
sc->port_res = 0;
}
if (sc->mem_res) {
+ bus_deactivate_resource(dev, SYS_RES_MEMORY,
+ sc->mem_rid, sc->mem_res);
bus_release_resource(dev, SYS_RES_MEMORY,
sc->mem_rid, sc->mem_res);
sc->mem_res = 0;
}
if (sc->irq_res) {
+ bus_deactivate_resource(dev, SYS_RES_IRQ,
+ sc->irq_rid, sc->irq_res);
bus_release_resource(dev, SYS_RES_IRQ,
sc->irq_rid, sc->irq_res);
sc->irq_res = 0;
diff --git a/sys/dev/ed/if_ed_pccard.c b/sys/dev/ed/if_ed_pccard.c
index 68b17a7f0499..86549128b39d 100644
--- a/sys/dev/ed/if_ed_pccard.c
+++ b/sys/dev/ed/if_ed_pccard.c
@@ -49,11 +49,14 @@
#include <dev/ed/if_edreg.h>
#include <dev/ed/if_edvar.h>
#include <dev/pccard/pccardvar.h>
+#include <dev/pccard/pccarddevs.h>
+
#include "card_if.h"
/*
* PC-Card (PCMCIA) specific code.
*/
+static int ed_pccard_match(device_t);
static int ed_pccard_probe(device_t);
static int ed_pccard_attach(device_t);
static int ed_pccard_detach(device_t);
@@ -64,10 +67,14 @@ static int linksys;
static device_method_t ed_pccard_methods[] = {
/* Device interface */
- DEVMETHOD(device_probe, ed_pccard_probe),
- DEVMETHOD(device_attach, ed_pccard_attach),
+ DEVMETHOD(device_probe, pccard_compat_probe),
+ DEVMETHOD(device_attach, pccard_compat_attach),
DEVMETHOD(device_detach, ed_pccard_detach),
+ /* Card interface */
+ DEVMETHOD(card_compat_match, ed_pccard_match),
+ DEVMETHOD(card_compat_probe, ed_pccard_probe),
+ DEVMETHOD(card_compat_attach, ed_pccard_attach),
{ 0, 0 }
};
@@ -109,6 +116,25 @@ ed_pccard_detach(device_t dev)
return (0);
}
+const struct pccard_product sn_pccard_products[] = {
+ { PCCARD_STR_KINGSTON_KNE2, PCCARD_VENDOR_KINGSTON,
+ PCCARD_PRODUCT_KINGSTON_KNE2, 0, NULL, NULL },
+ { NULL }
+};
+
+static int
+ed_pccard_match(device_t dev)
+{
+ const struct pccard_product *pp;
+
+ if ((pp = pccard_product_lookup(dev, sn_pccard_products,
+ sizeof(sn_pccard_products[0]), NULL)) != NULL) {
+ device_set_desc(dev, pp->pp_name);
+ return 0;
+ }
+ return EIO;
+}
+
/*
* Probe framework for pccards. Replicates the standard framework,
* minus the pccard driver registration and ignores the ether address
@@ -269,6 +295,7 @@ ed_pccard_memwrite(device_t dev, off_t offset, u_char byte)
bus_space_write_1(rman_get_bustag(cis), rman_get_bushandle(cis), offset, byte);
+ bus_deactivate_resource(dev, SYS_RES_MEMORY, cis_rid, cis);
bus_release_resource(dev, SYS_RES_MEMORY, cis_rid, cis);
return (0);