diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2007-03-31 03:59:54 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2007-03-31 03:59:54 +0000 |
commit | f930473c79a3e69c9d2c176f5d472d6fc112ee19 (patch) | |
tree | 2d33a1bcf1bd805cf262cdb8c157d3fd5bdb3dfd /sys/dev | |
parent | f500abba89c808c5070362134072310a4703180f (diff) |
initial atascsi glue.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/sili.c | 45 | ||||
-rw-r--r-- | sys/dev/ic/silireg.h | 4 | ||||
-rw-r--r-- | sys/dev/ic/silivar.h | 3 |
3 files changed, 49 insertions, 3 deletions
diff --git a/sys/dev/ic/sili.c b/sys/dev/ic/sili.c index 71b8c548d4c..a473b8bf795 100644 --- a/sys/dev/ic/sili.c +++ b/sys/dev/ic/sili.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sili.c,v 1.4 2007/03/31 03:11:38 dlg Exp $ */ +/* $OpenBSD: sili.c,v 1.5 2007/03/31 03:59:53 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -48,9 +48,23 @@ void sili_write(struct sili_softc *, bus_size_t, u_int32_t); u_int32_t sili_pread(struct sili_port *, bus_size_t); void sili_pwrite(struct sili_port *, bus_size_t, u_int32_t); +/* atascsi interface */ +int sili_ata_probe(void *, int); +struct ata_xfer *sili_ata_get_xfer(void *, int); +void sili_ata_put_xfer(struct ata_xfer *); +int sili_ata_cmd(struct ata_xfer *); + +struct atascsi_methods sili_atascsi_methods = { + sili_ata_probe, + sili_ata_get_xfer, + sili_ata_cmd +}; + int sili_attach(struct sili_softc *sc) { + struct atascsi_attach_args aaa; + printf("\n"); if (sili_ports_alloc(sc) != 0) { @@ -58,6 +72,17 @@ sili_attach(struct sili_softc *sc) return (1); } + sili_write(sc, SILI_REG_GC, 0x0); + + bzero(&aaa, sizeof(aaa)); + aaa.aaa_cookie = sc; + aaa.aaa_methods = &sili_atascsi_methods; + aaa.aaa_minphys = minphys; + aaa.aaa_nports = sc->sc_nports; + aaa.aaa_ncmds = SILI_MAX_CMDS; + + sc->sc_atascsi = atascsi_attach(&sc->sc_dev, &aaa); + return (0); } @@ -155,3 +180,21 @@ sili_pwrite(struct sili_port *sp, bus_size_t r, u_int32_t v) bus_space_barrier(sp->sp_sc->sc_iot_port, sp->sp_ioh, r, 4, BUS_SPACE_BARRIER_WRITE); } + +int +sili_ata_probe(void *xsc, int port) +{ + return (ATA_PORT_T_NONE); +} + +int +sili_ata_cmd(struct ata_xfer *xa) +{ + return (ATA_ERROR); +} + +struct ata_xfer * +sili_ata_get_xfer(void *xsc, int port) +{ + return (NULL); +} diff --git a/sys/dev/ic/silireg.h b/sys/dev/ic/silireg.h index 0ee77611bce..903026397cb 100644 --- a/sys/dev/ic/silireg.h +++ b/sys/dev/ic/silireg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: silireg.h,v 1.8 2007/03/30 04:45:30 dlg Exp $ */ +/* $OpenBSD: silireg.h,v 1.9 2007/03/31 03:59:53 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -81,3 +81,5 @@ #define SILI_PREG_SERR 0x1f08 /* SError */ #define SILI_PREG_SACT 0x1f0c /* SActive */ + +#define SILI_MAX_CMDS 31 diff --git a/sys/dev/ic/silivar.h b/sys/dev/ic/silivar.h index 5d7704b3ffa..fb34621683e 100644 --- a/sys/dev/ic/silivar.h +++ b/sys/dev/ic/silivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: silivar.h,v 1.3 2007/03/30 04:50:54 dlg Exp $ */ +/* $OpenBSD: silivar.h,v 1.4 2007/03/31 03:59:53 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -34,6 +34,7 @@ struct sili_softc { u_int sc_nports; struct sili_port *sc_ports; + struct atascsi *sc_atascsi; }; #define DEVNAME(_sc) ((_sc)->sc_dev.dv_xname) |