summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2009-05-10 12:48:25 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2009-05-10 12:48:25 +0000
commitda12ece13ca7f672d0684397783a2e461122cfaa (patch)
tree53c9dd8f364e7d7363fc6b6009a70986e7887933 /sys/arch/sparc64
parent80456b3dab6d46705e8788be2b9539bbe115337e (diff)
Handle devices with multiple ports.
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/dev/cbus.c17
-rw-r--r--sys/arch/sparc64/dev/cbusvar.h8
2 files changed, 17 insertions, 8 deletions
diff --git a/sys/arch/sparc64/dev/cbus.c b/sys/arch/sparc64/dev/cbus.c
index a08d55819fb..97975a79681 100644
--- a/sys/arch/sparc64/dev/cbus.c
+++ b/sys/arch/sparc64/dev/cbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cbus.c,v 1.5 2009/04/12 14:53:15 kettenis Exp $ */
+/* $OpenBSD: cbus.c,v 1.6 2009/05/10 12:48:24 kettenis Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis
*
@@ -180,7 +180,7 @@ cbus_intr_ack(struct intrhand *ih)
uint64_t devhandle = INTIGN(ih->ih_number);
uint64_t devino = INTINO(ih->ih_number);
- hv_vintr_setstate(devhandle, devino, INTR_IDLE);
+ hv_vintr_setstate(devhandle, devino, INTR_IDLE);
}
bus_space_tag_t
@@ -221,6 +221,16 @@ cbus_get_channel_endpoint(struct cbus_softc *sc, struct cbus_attach_args *ca)
elem = (struct md_element *)(mdesc + sizeof(struct md_header));
name_blk = mdesc + sizeof(struct md_header) + hdr->node_blk_sz;
+ ca->ca_idx = idx;
+
+ ca->ca_id = -1;
+ ca->ca_tx_ino = -1;
+ ca->ca_rx_ino = -1;
+
+ if (strcmp(ca->ca_name, "disk") != 0 &&
+ strcmp(ca->ca_name, "network") != 0)
+ return (0);
+
for (; elem[idx].tag != 'E'; idx++) {
str = name_blk + elem[idx].name_offset;
if (elem[idx].tag != 'a' || strcmp(str, "fwd") != 0)
@@ -241,8 +251,5 @@ cbus_get_channel_endpoint(struct cbus_softc *sc, struct cbus_attach_args *ca)
}
}
- ca->ca_id = -1;
- ca->ca_tx_ino = -1;
- ca->ca_rx_ino = -1;
return (0);
}
diff --git a/sys/arch/sparc64/dev/cbusvar.h b/sys/arch/sparc64/dev/cbusvar.h
index 014bae856de..d222c361b83 100644
--- a/sys/arch/sparc64/dev/cbusvar.h
+++ b/sys/arch/sparc64/dev/cbusvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cbusvar.h,v 1.2 2009/01/01 23:24:59 kettenis Exp $ */
+/* $OpenBSD: cbusvar.h,v 1.3 2009/05/10 12:48:24 kettenis Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis
*
@@ -19,8 +19,9 @@
#define _SPARC64_DEV_CBUSVAR_H_
struct cbus_attach_args {
- char *ca_name;
+ const char *ca_name;
int ca_node;
+ int ca_idx;
bus_space_tag_t ca_bustag;
bus_dma_tag_t ca_dmatag;
@@ -33,6 +34,7 @@ struct cbus_attach_args {
u_int64_t ca_rx_ino;
};
-int cbus_intr_map(int, int, uint64_t *);
+int cbus_print(void *, const char *);
+int cbus_intr_map(int, int, uint64_t *);
#endif