keep track of the enabled state of a socket

This commit is contained in:
chopps 2000-02-04 08:42:07 +00:00
parent f6ba8482dd
commit d344dd94ab
2 changed files with 12 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: i82365.c,v 1.40 2000/02/03 09:00:39 enami Exp $ */
/* $NetBSD: i82365.c,v 1.41 2000/02/04 08:42:07 chopps Exp $ */
#define PCICDEBUG
@ -1334,6 +1334,11 @@ pcic_chip_socket_enable(pch)
int reg;
#endif
#ifdef DIAGNOSTIC
if (h->flags & PCIC_FLAG_ENABLED)
printf("pcic_chip_socket_enable: enabling twice");
#endif
/* disable interrupts */
intr = pcic_read(h, PCIC_INTR);
intr &= ~(PCIC_INTR_IRQ_MASK | PCIC_INTR_ENABLE);
@ -1422,6 +1427,8 @@ pcic_chip_socket_enable(pch)
if (h->ioalloc & (1 << win))
pcic_chip_do_io_map(h, win);
h->flags |= PCIC_FLAG_ENABLED;
/* finally enable the interrupt */
intr |= h->ih_irq;
pcic_write(h, PCIC_INTR, intr);
@ -1443,6 +1450,8 @@ pcic_chip_socket_disable(pch)
/* power down the socket */
pcic_write(h, PCIC_PWRCTL, 0);
h->flags &= ~PCIC_FLAG_ENABLED;
}
static u_int8_t

View File

@ -1,4 +1,4 @@
/* $NetBSD: i82365var.h,v 1.10 2000/02/02 10:19:51 enami Exp $ */
/* $NetBSD: i82365var.h,v 1.11 2000/02/04 08:42:07 chopps Exp $ */
/*
* Copyright (c) 1997 Marc Horowitz. All rights reserved.
@ -82,6 +82,7 @@ struct pcic_handle {
#define PCIC_FLAG_SOCKETP 0x0001
#define PCIC_FLAG_CARDP 0x0002
#define PCIC_FLAG_ENABLED 0x0004
#define PCIC_LASTSTATE_PRESENT 0x0002
#define PCIC_LASTSTATE_HALF 0x0001