Module Name:    src
Committed By:   tsutsui
Date:           Sat Sep 26 14:44:11 UTC 2009

Modified Files:
        src/sys/dev/ic: aic79xx_osm.c aic79xx_osm.h aic79xxvar.h
        src/sys/dev/pci: ahd_pci.c

Log Message:
Split device_t/softc. Tested on aic7901A.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/ic/aic79xx_osm.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/ic/aic79xx_osm.h
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/ic/aic79xxvar.h
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/pci/ahd_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/aic79xx_osm.c
diff -u src/sys/dev/ic/aic79xx_osm.c:1.28 src/sys/dev/ic/aic79xx_osm.c:1.29
--- src/sys/dev/ic/aic79xx_osm.c:1.28	Sat Sep  5 12:50:53 2009
+++ src/sys/dev/ic/aic79xx_osm.c	Sat Sep 26 14:44:10 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic79xx_osm.c,v 1.28 2009/09/05 12:50:53 tsutsui Exp $	*/
+/*	$NetBSD: aic79xx_osm.c,v 1.29 2009/09/26 14:44:10 tsutsui Exp $	*/
 
 /*
  * Bus independent NetBSD shim for the aic7xxx based adaptec SCSI controllers
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic79xx_osm.c,v 1.28 2009/09/05 12:50:53 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic79xx_osm.c,v 1.29 2009/09/26 14:44:10 tsutsui Exp $");
 
 #include <dev/ic/aic79xx_osm.h>
 #include <dev/ic/aic79xx_inline.h>
@@ -82,7 +82,7 @@
 
 	ahd_lock(ahd, &s);
 
-	ahd->sc_adapter.adapt_dev = &ahd->sc_dev;
+	ahd->sc_adapter.adapt_dev = ahd->sc_dev;
 	ahd->sc_adapter.adapt_nchannels = 1;
 
 	ahd->sc_adapter.adapt_openings = ahd->scb_data.numscbs - 1;
@@ -100,16 +100,16 @@
 	ahd->sc_channel.chan_id = ahd->our_id;
 	ahd->sc_channel.chan_flags |= SCSIPI_CHAN_CANGROW;
 
-	ahd->sc_child = config_found(&ahd->sc_dev, &ahd->sc_channel, scsiprint);
+	ahd->sc_child = config_found(ahd->sc_dev, &ahd->sc_channel, scsiprint);
 
 	ahd_intr_enable(ahd, TRUE);
 
 	if (ahd->flags & AHD_RESET_BUS_A)
 		ahd_reset_channel(ahd, 'A', TRUE);
 
-	if (!pmf_device_register1(&ahd->sc_dev,
+	if (!pmf_device_register1(ahd->sc_dev,
 	    ahd_pmf_suspend, ahd_pmf_resume, ahd_pmf_shutdown))
-		aprint_error_dev(&ahd->sc_dev,
+		aprint_error_dev(ahd->sc_dev,
 		    "couldn't establish power handler\n");
 
 	ahd_unlock(ahd, &s);
@@ -811,7 +811,7 @@
 	if (ahd->sc_child != NULL)
 		rv = config_detach(ahd->sc_child, flags);
 
-	pmf_device_deregister(&ahd->sc_dev);
+	pmf_device_deregister(ahd->sc_dev);
 
 	ahd_free(ahd);
 

Index: src/sys/dev/ic/aic79xx_osm.h
diff -u src/sys/dev/ic/aic79xx_osm.h:1.19 src/sys/dev/ic/aic79xx_osm.h:1.20
--- src/sys/dev/ic/aic79xx_osm.h:1.19	Sat Sep  5 12:50:53 2009
+++ src/sys/dev/ic/aic79xx_osm.h	Sat Sep 26 14:44:10 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic79xx_osm.h,v 1.19 2009/09/05 12:50:53 tsutsui Exp $	*/
+/*	$NetBSD: aic79xx_osm.h,v 1.20 2009/09/26 14:44:10 tsutsui Exp $	*/
 
 /*
  * NetBSD platform specific driver option settings, data structures,
@@ -32,9 +32,9 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $NetBSD: aic79xx_osm.h,v 1.19 2009/09/05 12:50:53 tsutsui Exp $
+ * $NetBSD: aic79xx_osm.h,v 1.20 2009/09/26 14:44:10 tsutsui Exp $
  *
- * //depot/aic7xxx/freebsd/dev/aic7xxx/aic79xx_osm.h#19 $$NetBSD: aic79xx_osm.h,v 1.19 2009/09/05 12:50:53 tsutsui Exp $
+ * //depot/aic7xxx/freebsd/dev/aic7xxx/aic79xx_osm.h#19 $$NetBSD: aic79xx_osm.h,v 1.20 2009/09/26 14:44:10 tsutsui Exp $
  *
  * $FreeBSD: src/sys/dev/aic7xxx/aic79xx_osm.h,v 1.9 2003/05/26 21:43:29 gibbs Exp $
  */
@@ -529,7 +529,7 @@
 static __inline void
 ahd_print_path(struct ahd_softc *ahd, struct scb *scb)
 {
-	printf("%s:", device_xname(&ahd->sc_dev));
+	printf("%s:", device_xname(ahd->sc_dev));
 }
 
 static __inline void

Index: src/sys/dev/ic/aic79xxvar.h
diff -u src/sys/dev/ic/aic79xxvar.h:1.26 src/sys/dev/ic/aic79xxvar.h:1.27
--- src/sys/dev/ic/aic79xxvar.h:1.26	Thu Sep  3 14:55:29 2009
+++ src/sys/dev/ic/aic79xxvar.h	Sat Sep 26 14:44:11 2009
@@ -1062,7 +1062,7 @@
 typedef void ahd_callback_t (void *);
 
 struct ahd_softc {
-	struct device 		  sc_dev;
+	device_t 		  sc_dev;
 
 	struct scsipi_channel	  sc_channel;
 	device_t 		  sc_child;

Index: src/sys/dev/pci/ahd_pci.c
diff -u src/sys/dev/pci/ahd_pci.c:1.30 src/sys/dev/pci/ahd_pci.c:1.31
--- src/sys/dev/pci/ahd_pci.c:1.30	Sat Sep  5 12:59:24 2009
+++ src/sys/dev/pci/ahd_pci.c	Sat Sep 26 14:44:11 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahd_pci.c,v 1.30 2009/09/05 12:59:24 tsutsui Exp $	*/
+/*	$NetBSD: ahd_pci.c,v 1.31 2009/09/26 14:44:11 tsutsui Exp $	*/
 
 /*
  * Product specific probe and attach routines for:
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahd_pci.c,v 1.30 2009/09/05 12:59:24 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahd_pci.c,v 1.31 2009/09/26 14:44:11 tsutsui Exp $");
 
 #define AHD_PCI_IOADDR	PCI_MAPREG_START	/* I/O Address */
 #define AHD_PCI_MEMADDR	(PCI_MAPREG_START + 4)	/* Mem I/O Address */
@@ -318,6 +318,7 @@
 	const char         	*intrstr;
 	struct ahd_pci_busdata 	*bd;
 
+	ahd->sc_dev = self;
 	ahd_set_name(ahd, device_xname(self));
 	ahd->parent_dmat = pa->pa_dmat;
 
@@ -568,7 +569,7 @@
 	ahd_attach(ahd);
 }
 
-CFATTACH_DECL(ahd_pci, sizeof(struct ahd_softc),
+CFATTACH_DECL_NEW(ahd_pci, sizeof(struct ahd_softc),
     ahd_pci_probe, ahd_pci_attach, NULL, NULL);
 
 /*

Reply via email to