From b74cd21dd67661ec78aa874b0703af9abd95872f Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Wed, 3 Dec 2014 04:33:07 +0000 Subject: Turn ahci port start into a callback so sxiahci can do some magic to setup dma. Modified version of a patch from Edwin Amsler which was based on changes made in Bitrig by Artturi Alm. ok dlg@ --- sys/dev/ic/ahci.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sys/dev/ic/ahci.c') diff --git a/sys/dev/ic/ahci.c b/sys/dev/ic/ahci.c index 680dae6f7fb..db893ab3ef1 100644 --- a/sys/dev/ic/ahci.c +++ b/sys/dev/ic/ahci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ahci.c,v 1.16 2014/07/13 23:10:23 deraadt Exp $ */ +/* $OpenBSD: ahci.c,v 1.17 2014/12/03 04:33:06 jsg Exp $ */ /* * Copyright (c) 2006 David Gwynne @@ -75,7 +75,7 @@ int ahci_port_alloc(struct ahci_softc *, u_int); void ahci_port_free(struct ahci_softc *, u_int); int ahci_port_init(struct ahci_softc *, u_int); -int ahci_port_start(struct ahci_port *, int); +int ahci_default_port_start(struct ahci_port *, int); int ahci_port_stop(struct ahci_port *, int); int ahci_port_clo(struct ahci_port *); int ahci_port_softreset(struct ahci_port *); @@ -175,6 +175,9 @@ ahci_attach(struct ahci_softc *sc) u_int32_t pi; int i; + if (sc->sc_port_start == NULL) + sc->sc_port_start = ahci_default_port_start; + if (ahci_init(sc) != 0) { /* error already printed by ahci_init */ goto unmap; @@ -832,7 +835,7 @@ reterr: } int -ahci_port_start(struct ahci_port *ap, int fre_only) +ahci_default_port_start(struct ahci_port *ap, int fre_only) { u_int32_t r; -- cgit v1.2.3