summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ed/if_ed.c63
-rw-r--r--sys/dev/ep/if_ep.c36
-rw-r--r--sys/dev/fe/if_fe.c91
-rw-r--r--sys/dev/sio/sio.c56
4 files changed, 66 insertions, 180 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c
index d839eba..83e16bc 100644
--- a/sys/dev/ed/if_ed.c
+++ b/sys/dev/ed/if_ed.c
@@ -191,17 +191,15 @@ static u_long ds_crc(u_char *ep);
/*
* PC-Card (PCMCIA) specific code.
*/
-static int edinit(struct pccard_devinfo *, int); /* init device */
+static int edinit(struct pccard_devinfo *); /* init device */
static void edunload(struct pccard_devinfo *); /* Disable driver */
static int card_intr(struct pccard_devinfo *); /* Interrupt handler */
-static void edsuspend(struct pccard_devinfo *); /* Suspend driver */
static struct pccard_device ed_info = {
"ed",
edinit,
edunload,
card_intr,
- edsuspend,
0, /* Attributes - presently unused */
&net_imask /* Interrupt mask for device */
/* XXX - Should this also include net_imask? */
@@ -209,39 +207,25 @@ static struct pccard_device ed_info = {
/*
* Initialize the device - called from Slot manager.
- *
- * If first is set, then check for the device's existence
- * before initializing it. Once initialized, the device table may
- * be set up.
*/
static int
-edinit(struct pccard_devinfo *devi, int first)
+edinit(struct pccard_devinfo *devi)
{
struct ed_softc *sc = &ed_softc[devi->isahd.id_unit];
/* validate unit number. */
- if (first) {
- if (devi->isahd.id_unit >= NED)
- return(ENODEV);
- /*
- * Probe the device. If a value is returned, the
- * device was found at the location.
- */
- sc->gone = 0;
- if (ed_probe_pccard(&devi->isahd, devi->misc) == 0)
- return(ENXIO);
- if (ed_attach_isa(&devi->isahd) == 0)
- return(ENXIO);
- } else {
- sc->gone = 0; /* reenable after a suspend */
- }
+ if (devi->isahd.id_unit >= NED)
+ return(ENODEV);
/*
- * XXX TODO:
- * If it was initialized before, the device structure
- * should also be initialized. We should
- * reset (and possibly restart) the hardware, but
- * I am not sure of the best way to do this...
+ * Probe the device. If a value is returned, the
+ * device was found at the location.
*/
+ sc->gone = 0;
+ if (ed_probe_pccard(&devi->isahd, devi->misc) == 0)
+ return(ENXIO);
+ if (ed_attach_isa(&devi->isahd) == 0)
+ return(ENXIO);
+
return(0);
}
@@ -280,29 +264,6 @@ card_intr(struct pccard_devinfo *devi)
edintr_sc(&ed_softc[devi->isahd.id_unit]);
return(1);
}
-
-/*
- * Called when a power down is requested. Shuts down the
- * device and configures the device as unavailable (but
- * still loaded...). A resume is done by calling
- * edinit with first = 0. This is called when the user suspends
- * the system, or the APM code suspends the system.
- */
-static void
-edsuspend(struct pccard_devinfo *devi)
-{
- struct ed_softc *sc = &ed_softc[devi->isahd.id_unit];
- /*
- * Some 'ed' cards will generate a interrupt as they go away,
- * and by the time the interrupt handler gets to the card,
- * the interrupt can't be cleared.
- * By setting gone here, we tell the handler to ignore the
- * interrupt when it happens.
- */
- sc->gone = 1; /* avoid spinning endlessly in interrupt handler */
-
- printf("ed%d: suspending\n", devi->isahd.id_unit);
-}
#endif /* NCARD > 0 */
struct isa_driver eddriver = {
diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c
index 84d578e..d840c53 100644
--- a/sys/dev/ep/if_ep.c
+++ b/sys/dev/ep/if_ep.c
@@ -153,18 +153,16 @@ struct isa_driver epdriver = {
/*
* PC-Card (PCMCIA) specific code.
*/
-static int ep_pccard_init __P((struct pccard_devinfo *, int));
+static int ep_pccard_init __P((struct pccard_devinfo *));
static int ep_pccard_attach __P((struct pccard_devinfo *));
static void ep_unload __P((struct pccard_devinfo *));
static int card_intr __P((struct pccard_devinfo *));
-static void ep_suspend __P((struct pccard_devinfo *));
static struct pccard_device ep_info = {
"ep",
ep_pccard_init,
ep_unload,
card_intr,
- ep_suspend,
0, /* Attributes - presently unused */
&net_imask
};
@@ -173,9 +171,8 @@ static struct pccard_device ep_info = {
* Initialize the device - called from Slot manager.
*/
static int
-ep_pccard_init(devi, first)
+ep_pccard_init(devi)
struct pccard_devinfo *devi;
- int first;
{
struct isa_device *is = &devi->isahd;
struct ep_softc *sc = ep_softc[is->id_unit];
@@ -201,10 +198,7 @@ ep_pccard_init(devi, first)
/* 3C589's product id? */
if (epb->prod_id != 0x9058) {
- if (first)
- printf("ep%d: failed to come ready.\n", is->id_unit);
- else
- printf("ep%d: failed to resume.\n", is->id_unit);
+ printf("ep%d: failed to come ready.\n", is->id_unit);
return (ENXIO);
}
@@ -212,15 +206,10 @@ ep_pccard_init(devi, first)
for (i = 0; i < 3; i++)
sc->epb->eth_addr[i] = get_e(sc, EEPROM_NODE_ADDR_0 + i);
- if (first) {
- if (ep_pccard_attach(devi) == 0)
- return (ENXIO);
- sc->arpcom.ac_if.if_snd.ifq_maxlen = ifqmaxlen;
- } else {
- sc->gone = 0;
- printf("ep%d: resumed.\n", is->id_unit);
- epinit(sc);
- }
+ if (ep_pccard_attach(devi) == 0)
+ return (ENXIO);
+
+ sc->arpcom.ac_if.if_snd.ifq_maxlen = ifqmaxlen;
return (0);
}
@@ -284,17 +273,6 @@ card_intr(devi)
epintr(devi->isahd.id_unit);
return(1);
}
-
-/* Resume is done by executing ep_pccard_init(devi, 0). */
-static void
-ep_suspend(devi)
- struct pccard_devinfo *devi;
-{
- struct ep_softc *sc = ep_softc[devi->isahd.id_unit];
-
- printf("ep%d: suspending\n", devi->isahd.id_unit);
- sc->gone = 1;
-}
#endif /* NCARD > 0 */
static int
diff --git a/sys/dev/fe/if_fe.c b/sys/dev/fe/if_fe.c
index 00c1b70..41d10ed 100644
--- a/sys/dev/fe/if_fe.c
+++ b/sys/dev/fe/if_fe.c
@@ -322,17 +322,15 @@ outblk ( struct fe_softc * sc, int offs, u_char const * mem, int len )
/*
* PC-Card (PCMCIA) specific code.
*/
-static int feinit(struct pccard_devinfo *, int); /* init device */
+static int feinit(struct pccard_devinfo *); /* init device */
static void feunload(struct pccard_devinfo *); /* Disable driver */
static int fe_card_intr(struct pccard_devinfo *); /* Interrupt handler */
-static void fesuspend(struct pccard_devinfo *); /* Suspend driver */
static struct pccard_device fe_info = {
"fe",
feinit,
feunload,
fe_card_intr,
- fesuspend,
0, /* Attributes - presently unused */
&net_imask /* Interrupt mask for device */
/* XXX - Should this also include net_imask? */
@@ -340,59 +338,47 @@ static struct pccard_device fe_info = {
/*
* Initialize the device - called from Slot manager.
- *
- * if first is set, then initially check for
- * the device's existence before initializing it.
- * Once initialized, the device table may be set up.
*/
static int
-feinit(struct pccard_devinfo *devi, int first)
+feinit(struct pccard_devinfo *devi)
{
struct fe_softc *sc;
/* validate unit number. */
- if (first) {
- if (devi->isahd.id_unit >= NFE)
- return (ENODEV);
- /*
- * Probe the device. If a value is returned,
- * the device was found at the location.
- */
+ if (devi->isahd.id_unit >= NFE)
+ return (ENODEV);
+ /*
+ * Probe the device. If a value is returned,
+ * the device was found at the location.
+ */
#if FE_DEBUG >= 2
- printf("Start Probe\n");
-#endif
- /* Initialize "minimum" parts of our softc. */
- sc = &fe_softc[devi->isahd.id_unit];
- sc->sc_unit = devi->isahd.id_unit;
- sc->iobase = devi->isahd.id_iobase;
-
- /* Use Ethernet address got from CIS, if one is available. */
- if ((devi->misc[0] & 0x03) == 0x00
- && (devi->misc[0] | devi->misc[1] | devi->misc[2]) != 0) {
- /* Yes, it looks like a valid Ether address. */
- bcopy(devi->misc, sc->sc_enaddr, ETHER_ADDR_LEN);
- } else {
- /* Indicate we have no Ether address in CIS. */
- bzero(sc->sc_enaddr, ETHER_ADDR_LEN);
- }
+ printf("Start Probe\n");
+#endif
+ /* Initialize "minimum" parts of our softc. */
+ sc = &fe_softc[devi->isahd.id_unit];
+ sc->sc_unit = devi->isahd.id_unit;
+ sc->iobase = devi->isahd.id_iobase;
+
+ /* Use Ethernet address got from CIS, if one is available. */
+ if ((devi->misc[0] & 0x03) == 0x00
+ && (devi->misc[0] | devi->misc[1] | devi->misc[2]) != 0) {
+ /* Yes, it looks like a valid Ether address. */
+ bcopy(devi->misc, sc->sc_enaddr, ETHER_ADDR_LEN);
+ } else {
+ /* Indicate we have no Ether address in CIS. */
+ bzero(sc->sc_enaddr, ETHER_ADDR_LEN);
+ }
- /* Probe supported PC card models. */
- if (fe_probe_tdk(&devi->isahd, sc) == 0 &&
- fe_probe_mbh(&devi->isahd, sc) == 0)
- return (ENXIO);
+ /* Probe supported PC card models. */
+ if (fe_probe_tdk(&devi->isahd, sc) == 0 &&
+ fe_probe_mbh(&devi->isahd, sc) == 0)
+ return (ENXIO);
#if FE_DEBUG >= 2
- printf("Start attach\n");
+ printf("Start attach\n");
#endif
- if (fe_attach(&devi->isahd) == 0)
- return (ENXIO);
- }
- /*
- * XXX TODO:
- * If it was initialized before, the device structure
- * should also be initialized. We should
- * reset (and possibly restart) the hardware, but
- * I am not sure of the best way to do this...
- */
+ if (fe_attach(&devi->isahd) == 0)
+ return (ENXIO);
+
return (0);
}
@@ -423,19 +409,6 @@ fe_card_intr(struct pccard_devinfo *devi)
feintr(devi->isahd.id_unit);
return (1);
}
-
-/*
- * Called when a power down is requested. Shuts down the
- * device and configures the device as unavailable (but
- * still loaded...). A resume is done by calling
- * feinit with first=0. This is called when the user suspends
- * the system, or the APM code suspends the system.
- */
-static void
-fesuspend(struct pccard_devinfo *devi)
-{
- printf("fe%d: suspending\n", devi->isahd.id_unit);
-}
#endif /* NCARD > 0 */
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index 9697556..93d147d 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -474,17 +474,15 @@ SYSCTL_PROC(_machdep, OID_AUTO, conspeed, CTLTYPE_INT | CTLFLAG_RW,
/*
* PC-Card (PCMCIA) specific code.
*/
-static int sioinit(struct pccard_devinfo *, int); /* init device */
+static int sioinit(struct pccard_devinfo *); /* init device */
static void siounload(struct pccard_devinfo *); /* Disable driver */
static int card_intr(struct pccard_devinfo *); /* Interrupt handler */
-static void siosuspend(struct pccard_devinfo *); /* Suspend driver */
static struct pccard_device sio_info = {
driver_name,
sioinit,
siounload,
card_intr,
- siosuspend,
0, /* Attributes - presently unused */
&tty_imask /* Interrupt mask for device */
/* XXX - Should this also include net_imask? */
@@ -492,37 +490,26 @@ static struct pccard_device sio_info = {
/*
* Initialize the device - called from Slot manager.
- *
- * If first is set, then check for the device's existence
- * before initializing it. Once initialized, the device table may
- * be set up.
*/
int
-sioinit(struct pccard_devinfo *devi, int first)
+sioinit(struct pccard_devinfo *devi)
{
+
/* validate unit number. */
- if (first) {
- if (devi->isahd.id_unit >= (NSIOTOT))
- return(ENODEV);
- /* Make sure it isn't already probed. */
- if (com_addr(devi->isahd.id_unit))
- return(EBUSY);
- /*
- * Probe the device. If a value is returned, the
- * device was found at the location.
- */
- if (sioprobe(&devi->isahd) == 0)
- return(ENXIO);
- if (sioattach(&devi->isahd) == 0)
- return(ENXIO);
- }
+ if (devi->isahd.id_unit >= (NSIOTOT))
+ return(ENODEV);
+ /* Make sure it isn't already probed. */
+ if (com_addr(devi->isahd.id_unit))
+ return(EBUSY);
/*
- * XXX TODO:
- * If it was initialized before, the device structure
- * should also be initialized. We should
- * reset (and possibly restart) the hardware, but
- * I am not sure of the best way to do this...
+ * Probe the device. If a value is returned, the
+ * device was found at the location.
*/
+ if (sioprobe(&devi->isahd) == 0)
+ return(ENXIO);
+ if (sioattach(&devi->isahd) == 0)
+ return(ENXIO);
+
return(0);
}
@@ -575,19 +562,6 @@ card_intr(struct pccard_devinfo *devi)
COM_UNLOCK();
return(1);
}
-
-/*
- * Called when a power down is requested. Shuts down the
- * device and configures the device as unavailable (but
- * still loaded...). A resume is done by calling
- * sioinit with first=0. This is called when the user suspends
- * the system, or the APM code suspends the system.
- */
-static void
-siosuspend(struct pccard_devinfo *devi)
-{
- printf("sio%d: suspending\n", devi->isahd.id_unit);
-}
#endif /* NCARD > 0 */
static int
OpenPOWER on IntegriCloud