Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Split device_t/softc. Tested on aic7901A.
details: https://anonhg.NetBSD.org/src/rev/5b22e79f0785
branches: trunk
changeset: 747657:5b22e79f0785
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Sat Sep 26 14:44:10 2009 +0000
description:
Split device_t/softc. Tested on aic7901A.
diffstat:
sys/dev/ic/aic79xx_osm.c | 14 +++++++-------
sys/dev/ic/aic79xx_osm.h | 8 ++++----
sys/dev/ic/aic79xxvar.h | 2 +-
sys/dev/pci/ahd_pci.c | 7 ++++---
4 files changed, 16 insertions(+), 15 deletions(-)
diffs (133 lines):
diff -r ad1b84db5226 -r 5b22e79f0785 sys/dev/ic/aic79xx_osm.c
--- a/sys/dev/ic/aic79xx_osm.c Sat Sep 26 13:58:31 2009 +0000
+++ b/sys/dev/ic/aic79xx_osm.c Sat Sep 26 14:44:10 2009 +0000
@@ -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);
diff -r ad1b84db5226 -r 5b22e79f0785 sys/dev/ic/aic79xx_osm.h
--- a/sys/dev/ic/aic79xx_osm.h Sat Sep 26 13:58:31 2009 +0000
+++ b/sys/dev/ic/aic79xx_osm.h Sat Sep 26 14:44:10 2009 +0000
@@ -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
diff -r ad1b84db5226 -r 5b22e79f0785 sys/dev/ic/aic79xxvar.h
--- a/sys/dev/ic/aic79xxvar.h Sat Sep 26 13:58:31 2009 +0000
+++ b/sys/dev/ic/aic79xxvar.h Sat Sep 26 14:44:10 2009 +0000
@@ -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;
diff -r ad1b84db5226 -r 5b22e79f0785 sys/dev/pci/ahd_pci.c
--- a/sys/dev/pci/ahd_pci.c Sat Sep 26 13:58:31 2009 +0000
+++ b/sys/dev/pci/ahd_pci.c Sat Sep 26 14:44:10 2009 +0000
@@ -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);
/*
Home |
Main Index |
Thread Index |
Old Index