From 4c8ec346c37b4e89be57a88234cc8f9aaee197b7 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Mon, 26 Nov 2007 15:59:54 +0000 Subject: drive port probes from the scsi midlayer now that it will ask the adapter if a device is there before doing any scsi commands. also implement a free path for when devices are detached. software hotplug has been tested on sili, and ahci is still working according to claudio@ --- sys/dev/ic/sili.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'sys/dev/ic') diff --git a/sys/dev/ic/sili.c b/sys/dev/ic/sili.c index 0d309d1239b..4e544cd8ce7 100644 --- a/sys/dev/ic/sili.c +++ b/sys/dev/ic/sili.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sili.c,v 1.37 2007/11/23 18:26:03 kettenis Exp $ */ +/* $OpenBSD: sili.c,v 1.38 2007/11/26 15:59:53 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne @@ -159,12 +159,14 @@ u_int32_t sili_port_intr(struct sili_port *, int); /* atascsi interface */ int sili_ata_probe(void *, int); +void sili_ata_free(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_free, sili_ata_get_xfer, sili_ata_cmd }; @@ -794,6 +796,18 @@ sili_ata_probe(void *xsc, int port) return (port_type); } +void +sili_ata_free(void *xsc, int port) +{ + struct sili_softc *sc = xsc; + struct sili_port *sp = &sc->sc_ports[port]; + + if (sp->sp_ccbs != NULL) + sili_ccb_free(sp); + + /* XXX we should do more here */ +} + int sili_ata_cmd(struct ata_xfer *xa) { -- cgit v1.2.3