Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/marvell Add macro MVA_{UNIT, OFFSET, IRQ}_DEFAULT.



details:   https://anonhg.NetBSD.org/src/rev/e3f36d4036b8
branches:  trunk
changeset: 756296:e3f36d4036b8
user:      kiyohara <kiyohara%NetBSD.org@localhost>
date:      Sun Jul 11 08:43:36 2010 +0000

description:
Add macro MVA_{UNIT,OFFSET,IRQ}_DEFAULT.

diffstat:

 sys/dev/marvell/gt.c         |  16 ++++++++--------
 sys/dev/marvell/gtidmac.c    |   8 ++++----
 sys/dev/marvell/gtmpsc.c     |  10 +++++-----
 sys/dev/marvell/gtpci.c      |  12 ++++++------
 sys/dev/marvell/gttwsi.c     |   8 ++++----
 sys/dev/marvell/if_gfe.c     |   6 +++---
 sys/dev/marvell/if_mvgbe.c   |   6 +++---
 sys/dev/marvell/marvellvar.h |   9 ++++++++-
 sys/dev/marvell/obio.c       |   6 +++---
 9 files changed, 44 insertions(+), 37 deletions(-)

diffs (truncated from 304 to 300 lines):

diff -r e821692a9977 -r e3f36d4036b8 sys/dev/marvell/gt.c
--- a/sys/dev/marvell/gt.c      Sun Jul 11 08:34:57 2010 +0000
+++ b/sys/dev/marvell/gt.c      Sun Jul 11 08:43:36 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gt.c,v 1.24 2010/06/09 02:19:51 kiyohara Exp $ */
+/*     $NetBSD: gt.c,v 1.25 2010/07/11 08:43:36 kiyohara Exp $ */
 
 /*
  * Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gt.c,v 1.24 2010/06/09 02:19:51 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gt.c,v 1.25 2010/07/11 08:43:36 kiyohara Exp $");
 
 #include "opt_marvell.h"
 #include "gtmpsc.h"
@@ -110,8 +110,8 @@
 #endif
 
 
-#define OFFSET_DEFAULT GTCF_OFFSET_DEFAULT
-#define IRQ_DEFAULT    GTCF_IRQ_DEFAULT
+#define OFFSET_DEFAULT MVA_OFFSET_DEFAULT
+#define IRQ_DEFAULT    MVA_IRQ_DEFAULT
 static const struct gt_dev {
        int model;
        const char *name;
@@ -159,15 +159,15 @@
                aprint_normal("%s at %s unit %d",
                    mva->mva_name, pnp, mva->mva_unit);
        else {
-               if (mva->mva_unit != GTCF_UNIT_DEFAULT)
+               if (mva->mva_unit != MVA_UNIT_DEFAULT)
                        aprint_normal(" unit %d", mva->mva_unit);
-               if (mva->mva_offset != GTCF_OFFSET_DEFAULT) {
+               if (mva->mva_offset != MVA_OFFSET_DEFAULT) {
                        aprint_normal(" offset 0x%04x", mva->mva_offset);
                        if (mva->mva_size > 0)
                                aprint_normal("-0x%04x",
                                    mva->mva_offset + mva->mva_size - 1);
                }
-               if (mva->mva_irq != GTCF_IRQ_DEFAULT)
+               if (mva->mva_irq != MVA_IRQ_DEFAULT)
                        aprint_normal(" irq %d", mva->mva_irq);
        }
 
@@ -181,7 +181,7 @@
 {
        struct marvell_attach_args *mva = aux;
 
-       if (cf->cf_loc[GTCF_IRQ] != GTCF_IRQ_DEFAULT)
+       if (cf->cf_loc[GTCF_IRQ] != MVA_IRQ_DEFAULT)
                mva->mva_irq = cf->cf_loc[GTCF_IRQ];
 
        return config_match(parent, cf, aux);
diff -r e821692a9977 -r e3f36d4036b8 sys/dev/marvell/gtidmac.c
--- a/sys/dev/marvell/gtidmac.c Sun Jul 11 08:34:57 2010 +0000
+++ b/sys/dev/marvell/gtidmac.c Sun Jul 11 08:43:36 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gtidmac.c,v 1.3 2010/06/04 06:31:50 kiyohara Exp $     */
+/*     $NetBSD: gtidmac.c,v 1.4 2010/07/11 08:43:36 kiyohara Exp $     */
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gtidmac.c,v 1.3 2010/06/04 06:31:50 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtidmac.c,v 1.4 2010/07/11 08:43:36 kiyohara Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -289,8 +289,8 @@
        if (mva->mva_model == MARVELL_ORION_1_88F6082)
                return 0;
 
-       if (mva->mva_offset == GTCF_OFFSET_DEFAULT ||
-           mva->mva_irq == GTCF_IRQ_DEFAULT)
+       if (mva->mva_offset == MVA_OFFSET_DEFAULT ||
+           mva->mva_irq == MVA_IRQ_DEFAULT)
                return 0;
 
        mva->mva_size = GTIDMAC_SIZE;
diff -r e821692a9977 -r e3f36d4036b8 sys/dev/marvell/gtmpsc.c
--- a/sys/dev/marvell/gtmpsc.c  Sun Jul 11 08:34:57 2010 +0000
+++ b/sys/dev/marvell/gtmpsc.c  Sun Jul 11 08:43:36 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gtmpsc.c,v 1.38 2010/04/28 13:51:56 kiyohara Exp $     */
+/*     $NetBSD: gtmpsc.c,v 1.39 2010/07/11 08:43:36 kiyohara Exp $     */
 /*
  * Copyright (c) 2009 KIYOHARA Takashi
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gtmpsc.c,v 1.38 2010/04/28 13:51:56 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtmpsc.c,v 1.39 2010/07/11 08:43:36 kiyohara Exp $");
 
 #include "opt_kgdb.h"
 
@@ -229,8 +229,8 @@
        default:
                return 0;
        }
-       if (mva->mva_offset == GTCF_OFFSET_DEFAULT ||
-           mva->mva_irq == GTCF_IRQ_DEFAULT)
+       if (mva->mva_offset == MVA_OFFSET_DEFAULT ||
+           mva->mva_irq == MVA_IRQ_DEFAULT)
                return 0;
 
        mva->mva_size = GTMPSC_SIZE;
@@ -251,7 +251,7 @@
        aprint_naive("\n");
        aprint_normal(": Multi-Protocol Serial Controller\n");
 
-       if (mva->mva_unit != GTCF_UNIT_DEFAULT)
+       if (mva->mva_unit != MVA_UNIT_DEFAULT)
                unit = mva->mva_unit;
        else
                unit = (mva->mva_offset == GTMPSC_BASE(0)) ? 0 : 1;
diff -r e821692a9977 -r e3f36d4036b8 sys/dev/marvell/gtpci.c
--- a/sys/dev/marvell/gtpci.c   Sun Jul 11 08:34:57 2010 +0000
+++ b/sys/dev/marvell/gtpci.c   Sun Jul 11 08:43:36 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gtpci.c,v 1.25 2010/06/02 06:44:32 kiyohara Exp $      */
+/*     $NetBSD: gtpci.c,v 1.26 2010/07/11 08:43:36 kiyohara Exp $      */
 /*
  * Copyright (c) 2008, 2009 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gtpci.c,v 1.25 2010/06/02 06:44:32 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtpci.c,v 1.26 2010/07/11 08:43:36 kiyohara Exp $");
 
 #include "opt_pci.h"
 #include "pci.h"
@@ -99,8 +99,8 @@
        case MARVELL_DISCOVERY_V:
        case MARVELL_DISCOVERY_VI:
 #endif
-               if (mva->mva_unit == GTCF_UNIT_DEFAULT ||
-                   mva->mva_offset != GTCF_OFFSET_DEFAULT)
+               if (mva->mva_unit == MVA_UNIT_DEFAULT ||
+                   mva->mva_offset != MVA_OFFSET_DEFAULT)
                        return 0;
                break;
 
@@ -109,7 +109,7 @@
        case MARVELL_ORION_1_88F5182:
        case MARVELL_ORION_2_88F5281:
        case MARVELL_ORION_1_88W8660:
-               if (mva->mva_offset == GTCF_OFFSET_DEFAULT)
+               if (mva->mva_offset == MVA_OFFSET_DEFAULT)
                        return 0;
                mva->mva_unit = 0;      /* unit 0 only */
                break;
@@ -206,7 +206,7 @@
        sc->sc_unit = mva->mva_unit;
        sc->sc_iot = mva->mva_iot;
        if (bus_space_subregion(mva->mva_iot, mva->mva_ioh,
-           (mva->mva_offset != GTCF_OFFSET_DEFAULT) ? mva->mva_offset : 0,
+           (mva->mva_offset != MVA_OFFSET_DEFAULT) ? mva->mva_offset : 0,
            mva->mva_size, &sc->sc_ioh)) {
                aprint_error_dev(self, "can't map registers\n");
                return;
diff -r e821692a9977 -r e3f36d4036b8 sys/dev/marvell/gttwsi.c
--- a/sys/dev/marvell/gttwsi.c  Sun Jul 11 08:34:57 2010 +0000
+++ b/sys/dev/marvell/gttwsi.c  Sun Jul 11 08:43:36 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gttwsi.c,v 1.1 2010/04/28 13:51:56 kiyohara Exp $      */
+/*     $NetBSD: gttwsi.c,v 1.2 2010/07/11 08:43:36 kiyohara Exp $      */
 /*
  * Copyright (c) 2008 Eiji Kawauchi.
  * All rights reserved.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gttwsi.c,v 1.1 2010/04/28 13:51:56 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gttwsi.c,v 1.2 2010/07/11 08:43:36 kiyohara Exp $");
 #include "locators.h"
 
 #include <sys/param.h>
@@ -158,8 +158,8 @@
        if (strcmp(mva->mva_name, match->cf_name) != 0)
                return 0;
 
-       if (mva->mva_offset == GTCF_OFFSET_DEFAULT ||
-           mva->mva_irq == GTCF_IRQ_DEFAULT)
+       if (mva->mva_offset == MVA_OFFSET_DEFAULT ||
+           mva->mva_irq == MVA_IRQ_DEFAULT)
                return 0;
 
        mva->mva_size = GTTWSI_SIZE;
diff -r e821692a9977 -r e3f36d4036b8 sys/dev/marvell/if_gfe.c
--- a/sys/dev/marvell/if_gfe.c  Sun Jul 11 08:34:57 2010 +0000
+++ b/sys/dev/marvell/if_gfe.c  Sun Jul 11 08:43:36 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_gfe.c,v 1.36 2010/04/28 13:51:56 kiyohara Exp $     */
+/*     $NetBSD: if_gfe.c,v 1.37 2010/07/11 08:43:36 kiyohara Exp $     */
 
 /*
  * Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.36 2010/04/28 13:51:56 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.37 2010/07/11 08:43:36 kiyohara Exp $");
 
 #include "opt_inet.h"
 #include "rnd.h"
@@ -226,7 +226,7 @@
        default:
                return 0;
        }
-       if (mva->mva_offset == GTCF_OFFSET_DEFAULT)
+       if (mva->mva_offset == MVA_OFFSET_DEFAULT)
                return 0;
 
        mva->mva_size = ETHC_SIZE;
diff -r e821692a9977 -r e3f36d4036b8 sys/dev/marvell/if_mvgbe.c
--- a/sys/dev/marvell/if_mvgbe.c        Sun Jul 11 08:34:57 2010 +0000
+++ b/sys/dev/marvell/if_mvgbe.c        Sun Jul 11 08:43:36 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_mvgbe.c,v 1.1 2010/06/02 06:18:11 kiyohara Exp $    */
+/*     $NetBSD: if_mvgbe.c,v 1.2 2010/07/11 08:43:36 kiyohara Exp $    */
 /*
  * Copyright (c) 2007, 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.1 2010/06/02 06:18:11 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.2 2010/07/11 08:43:36 kiyohara Exp $");
 
 #include "rnd.h"
 
@@ -297,7 +297,7 @@
        if (strcmp(mva->mva_name, match->cf_name) != 0)
                return 0;
 
-       if (mva->mva_offset == GTCF_OFFSET_DEFAULT)
+       if (mva->mva_offset == MVA_OFFSET_DEFAULT)
                return 0;
 
        for (i = 0; i < __arraycount(mvgbe_ports); i++)
diff -r e821692a9977 -r e3f36d4036b8 sys/dev/marvell/marvellvar.h
--- a/sys/dev/marvell/marvellvar.h      Sun Jul 11 08:34:57 2010 +0000
+++ b/sys/dev/marvell/marvellvar.h      Sun Jul 11 08:43:36 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: marvellvar.h,v 1.1 2010/04/28 13:51:56 kiyohara Exp $  */
+/*     $NetBSD: marvellvar.h,v 1.2 2010/07/11 08:43:36 kiyohara Exp $  */
 /*
  * Copyright (c) 2009 KIYOHARA Takashi
  * All rights reserved.
@@ -54,6 +54,13 @@
        int mva_irq;
 };
 
+#include "locators.h"
+
+#define MVA_UNIT_DEFAULT       GTCF_UNIT_DEFAULT
+#define MVA_OFFSET_DEFAULT     GTCF_OFFSET_DEFAULT
+#define MVA_IRQ_DEFAULT                GTCF_IRQ_DEFAULT
+
+
 void *marvell_intr_establish(int, int, int (*)(void *), void *);
 int marvell_winparams_by_tag(device_t, int, int *, int *, uint64_t *,
                             uint32_t *);
diff -r e821692a9977 -r e3f36d4036b8 sys/dev/marvell/obio.c
--- a/sys/dev/marvell/obio.c    Sun Jul 11 08:34:57 2010 +0000
+++ b/sys/dev/marvell/obio.c    Sun Jul 11 08:43:36 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: obio.c,v 1.14 2010/06/02 05:59:36 kiyohara Exp $       */
+/*     $NetBSD: obio.c,v 1.15 2010/07/11 08:43:36 kiyohara Exp $       */
 
 /*
  * Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.14 2010/06/02 05:59:36 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.15 2010/07/11 08:43:36 kiyohara Exp $");
 
 #include "opt_marvell.h"
 
@@ -89,7 +89,7 @@
                return 0;
 
 #define NUM_OBIO       5
-       if (mva->mva_unit == GTCF_UNIT_DEFAULT ||



Home | Main Index | Thread Index | Old Index