diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2006-12-12 02:06:10 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2006-12-12 02:06:10 +0000 |
commit | 36fdd91a757640f79b72e7cfce049b075ff3d924 (patch) | |
tree | 7e9a42cb9ff93909405fcba2e2a59cab8bd72c35 /sys/dev | |
parent | f04168c480f134c1923cf8f1b9eb7613880b49b6 (diff) |
stash the number of commands each port can do in the softc
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/ahci.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/pci/ahci.c b/sys/dev/pci/ahci.c index f48566208e1..16ee5acd54f 100644 --- a/sys/dev/pci/ahci.c +++ b/sys/dev/pci/ahci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ahci.c,v 1.21 2006/12/11 23:42:33 dlg Exp $ */ +/* $OpenBSD: ahci.c,v 1.22 2006/12/12 02:06:09 dlg Exp $ */ /* * Copyright (c) 2006 David Gwynne <dlg@openbsd.org> @@ -179,6 +179,8 @@ struct ahci_softc { bus_space_handle_t sc_ioh; bus_size_t sc_ios; bus_dma_tag_t sc_dmat; + + u_int sc_ncmds; }; #define DEVNAME(_s) ((_s)->sc_dev.dv_xname) @@ -262,7 +264,7 @@ ahci_attach(struct device *parent, struct device *self, void *aux) printf("%s: capabilities: 0x%b ports: %d ncmds: %d gen: %s\n", DEVNAME(sc), reg, AHCI_FMT_CAP, - AHCI_REG_CAP_NP(reg), AHCI_REG_CAP_NCS(reg), gen); + AHCI_REG_CAP_NP(reg), sc->sc_ncmds, gen); } #endif @@ -365,6 +367,9 @@ ahci_init(struct ahci_softc *sc) printf(": AHCI %s", revision); + reg = ahci_read(sc, AHCI_REG_CAP); + sc->sc_ncmds = AHCI_REG_CAP_NCS(reg); + return (0); } |