summaryrefslogtreecommitdiffstats
path: root/sys/pccard
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1997-09-21 22:02:25 +0000
committergibbs <gibbs@FreeBSD.org>1997-09-21 22:02:25 +0000
commita415512fd4b3c95c87808401c97e649c8ac7f41e (patch)
tree8463ee0d001498dfdefc34fc8911c491b2f0ecf0 /sys/pccard
parent52ace446d29ab170f74f1db02832f24b01e04f20 (diff)
downloadFreeBSD-src-a415512fd4b3c95c87808401c97e649c8ac7f41e.zip
FreeBSD-src-a415512fd4b3c95c87808401c97e649c8ac7f41e.tar.gz
Update for new callout interface.
Diffstat (limited to 'sys/pccard')
-rw-r--r--sys/pccard/pccard.c13
-rw-r--r--sys/pccard/pcic.c8
-rw-r--r--sys/pccard/slot.h2
3 files changed, 14 insertions, 9 deletions
diff --git a/sys/pccard/pccard.c b/sys/pccard/pccard.c
index 7383566..a8b2646 100644
--- a/sys/pccard/pccard.c
+++ b/sys/pccard/pccard.c
@@ -218,7 +218,7 @@ pccard_remove_controller(struct slot_ctrl *cp)
if (sp->ctrl == cp) {
pccard_slots[sp->slot] = 0;
if (sp->insert_seq)
- untimeout(inserted, (void *)sp);
+ untimeout(inserted, (void *)sp, sp->insert_ch);
/*
* Unload the drivers attached to this slot.
*/
@@ -318,7 +318,7 @@ disable_slot(struct slot *sp)
}
}
/* Power off the slot 1/2 second after remove of the card */
- timeout(power_off_slot, (caddr_t)sp, hz / 2);
+ sp->poff_ch = timeout(power_off_slot, (caddr_t)sp, hz / 2);
sp->pwr_off_pending = 1;
/* De-activate all contexts. */
@@ -626,9 +626,10 @@ inserted(void *arg)
*/
sp->pwr.vcc = 50;
sp->pwr.vpp = 0;
- untimeout(power_off_slot, (caddr_t)sp);
- if (sp->pwr_off_pending)
+ if (sp->pwr_off_pending) {
+ untimeout(power_off_slot, (caddr_t)sp, sp->poff_ch);
sp->ctrl->disable(sp);
+ }
sp->pwr_off_pending = 0;
sp->ctrl->power(sp);
printf("Card inserted, slot %d\n", sp->slot);
@@ -663,7 +664,7 @@ pccard_event(struct slot *sp, enum card_event event)
if (sp->insert_seq) {
sp->insert_seq = 0;
- untimeout(inserted, (void *)sp);
+ untimeout(inserted, (void *)sp, sp->insert_ch);
}
switch(event) {
case card_removed:
@@ -686,7 +687,7 @@ pccard_event(struct slot *sp, enum card_event event)
break;
case card_inserted:
sp->insert_seq = 1;
- timeout(inserted, (void *)sp, hz/4);
+ sp->insert_ch = timeout(inserted, (void *)sp, hz/4);
if (beepok)
sysbeep(PCCARD_BEEP_PITCH0, PCCARD_BEEP_DURATION0);
beepok = 0;
diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c
index a30b0e4..368c4f2 100644
--- a/sys/pccard/pcic.c
+++ b/sys/pccard/pcic.c
@@ -128,6 +128,8 @@ static void pcic_resume(struct slot *);
static void pcic_disable __P((struct slot *));
static void pcic_mapirq __P((struct slot *, int));
static timeout_t pcictimeout;
+static struct callout_handle pcictimeout_ch
+ = CALLOUT_HANDLE_INITIALIZER(&pcictimeout_ch);
#ifdef LKM
static int pcic_handle __P((struct lkm_table *lkmtp, int cmd));
#endif
@@ -307,7 +309,7 @@ pcic_unload(struct lkm_table *lkmtp, int cmd)
int slot;
struct pcic_slot *sp = pcic_slots;
- untimeout(pcictimeout,0);
+ untimeout(pcictimeout,0, pcictimeout_ch);
if (pcic_irq) {
for (slot = 0; slot < PCIC_MAX_SLOTS; slot++, sp++) {
if (sp->slotp)
@@ -848,7 +850,7 @@ pcic_probe(void)
}
#endif /* PC98 */
if (validslots)
- timeout(pcictimeout,0,hz/2);
+ pcictimeout_ch = timeout(pcictimeout,0,hz/2);
return(validslots);
}
@@ -1109,7 +1111,7 @@ pcic_disable(struct slot *slotp)
static void
pcictimeout(void *chan)
{
- timeout(pcictimeout,0,hz/2);
+ pcictimeout_ch = timeout(pcictimeout,0,hz/2);
pcicintr(0);
}
diff --git a/sys/pccard/slot.h b/sys/pccard/slot.h
index f9181d8..38e64ea 100644
--- a/sys/pccard/slot.h
+++ b/sys/pccard/slot.h
@@ -120,6 +120,8 @@ struct slot {
* flags.
*/
unsigned int insert_seq; /* Firing up under the card */
+ struct callout_handle insert_ch;/* Insert event timeout handle */
+ struct callout_handle poff_ch; /* Power Off timeout handle */
enum cardstate state, laststate; /* Current/last card states */
struct selinfo selp; /* Info for select */
OpenPOWER on IntegriCloud