diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2000-04-19 07:27:44 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2000-04-19 07:27:44 +0000 |
commit | 91d241b80cd868605f04af7ed72c5511c9bd01dd (patch) | |
tree | aaf63131c7db9c045df26fc6474b008d828fc492 | |
parent | cf3bcc8a0b3856a7af0422b83d0bf6efbf507b62 (diff) |
Fix a bug introduced after cardbus commit where uart16550a was
being detected as uart16450 as side effect. This also corrects the
posibility of misdetection of vadem controllers.
-rw-r--r-- | sys/dev/ic/i82365.c | 28 | ||||
-rw-r--r-- | sys/dev/ic/i82365var.h | 4 |
2 files changed, 16 insertions, 16 deletions
diff --git a/sys/dev/ic/i82365.c b/sys/dev/ic/i82365.c index b2d74edd8a7..791e28f10e8 100644 --- a/sys/dev/ic/i82365.c +++ b/sys/dev/ic/i82365.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i82365.c,v 1.11 2000/04/08 05:50:50 aaron Exp $ */ +/* $OpenBSD: i82365.c,v 1.12 2000/04/19 07:27:42 fgsch Exp $ */ /* $NetBSD: i82365.c,v 1.10 1998/06/09 07:36:55 thorpej Exp $ */ /* @@ -105,7 +105,7 @@ void pcic_queue_event __P((struct pcic_handle *, int)); void pcic_wait_ready __P((struct pcic_handle *)); u_int8_t st_pcic_read __P((struct pcic_handle *, int)); -void st_pcic_write __P((struct pcic_handle *, int, u_int8_t)); +void st_pcic_write __P((struct pcic_handle *, int, int)); struct cfdriver pcic_cd = { NULL, "pcic", DV_DULL @@ -1358,8 +1358,8 @@ pcic_chip_socket_enable(pch) */ delay((100 + 20 + 200) * 1000); - pcic_write(h, PCIC_PWRCTL, PCIC_PWRCTL_DISABLE_RESETDRV | PCIC_PWRCTL_OE - | PCIC_PWRCTL_PWR_ENABLE); + pcic_write(h, PCIC_PWRCTL, PCIC_PWRCTL_DISABLE_RESETDRV | + PCIC_PWRCTL_OE | PCIC_PWRCTL_PWR_ENABLE); pcic_write(h, PCIC_INTR, 0); /* @@ -1440,10 +1440,9 @@ st_pcic_read(h, idx) struct pcic_handle *h; int idx; { - if (idx != -1) { - bus_space_write_1(h->ph_bus_t, h->ph_bus_h, PCIC_REG_INDEX, h->sock + idx); - } - + if (idx != -1) + bus_space_write_1(h->ph_bus_t, h->ph_bus_h, PCIC_REG_INDEX, + h->sock + idx); return bus_space_read_1(h->ph_bus_t, h->ph_bus_h, PCIC_REG_DATA); } @@ -1451,11 +1450,12 @@ void st_pcic_write(h, idx, data) struct pcic_handle *h; int idx; - u_int8_t data; + int data; { - if (idx != -1) { - bus_space_write_1(h->ph_bus_t, h->ph_bus_h, PCIC_REG_INDEX, h->sock + idx); - } - - bus_space_write_1(h->ph_bus_t, h->ph_bus_h, PCIC_REG_DATA, data); + if (idx != -1) + bus_space_write_1(h->ph_bus_t, h->ph_bus_h, PCIC_REG_INDEX, + h->sock + idx); + if (data != -1) + bus_space_write_1(h->ph_bus_t, h->ph_bus_h, PCIC_REG_DATA, + data); } diff --git a/sys/dev/ic/i82365var.h b/sys/dev/ic/i82365var.h index 72792836c86..4758d925da7 100644 --- a/sys/dev/ic/i82365var.h +++ b/sys/dev/ic/i82365var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: i82365var.h,v 1.6 2000/04/08 05:50:50 aaron Exp $ */ +/* $OpenBSD: i82365var.h,v 1.7 2000/04/19 07:27:43 fgsch Exp $ */ /* $NetBSD: i82365var.h,v 1.4 1998/05/23 18:32:29 matt Exp $ */ /* @@ -53,7 +53,7 @@ struct pcic_handle { bus_space_tag_t ph_bus_t; bus_space_handle_t ph_bus_h; u_int8_t (*ph_read) __P((struct pcic_handle *, int)); - void (*ph_write) __P((struct pcic_handle *, int, u_int8_t)); + void (*ph_write) __P((struct pcic_handle *, int, int)); int vendor; int sock; |