Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev centralize the dialout/call unit macros.
details: https://anonhg.NetBSD.org/src/rev/b0996928d884
branches: trunk
changeset: 333751:b0996928d884
user: christos <christos%NetBSD.org@localhost>
date: Sat Nov 15 19:18:18 2014 +0000
description:
centralize the dialout/call unit macros.
diffstat:
sys/dev/ic/cd18xxvar.h | 10 +++++-----
sys/dev/ic/clmpcc.c | 10 +++++-----
sys/dev/ic/com.c | 13 ++++++-------
sys/dev/ic/cy.c | 10 +++++-----
sys/dev/ic/z8530tty.c | 8 ++++----
sys/dev/marvell/gtmpsc.c | 11 ++++-------
sys/dev/mii/files.mii | 8 +++++++-
sys/dev/pci/cz.c | 11 +++++------
sys/dev/sbus/magmareg.h | 10 +++++-----
sys/dev/sbus/spifreg.h | 10 +++++-----
sys/dev/usb/ucom.c | 16 ++++++++--------
sys/dev/usb/ucycom.c | 16 ++++++++--------
sys/dev/usb/uhso.c | 18 +++++++++---------
13 files changed, 76 insertions(+), 75 deletions(-)
diffs (truncated from 432 to 300 lines):
diff -r 48800a893df2 -r b0996928d884 sys/dev/ic/cd18xxvar.h
--- a/sys/dev/ic/cd18xxvar.h Sat Nov 15 19:17:05 2014 +0000
+++ b/sys/dev/ic/cd18xxvar.h Sat Nov 15 19:18:18 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cd18xxvar.h,v 1.4 2012/10/27 17:18:19 chs Exp $ */
+/* $NetBSD: cd18xxvar.h,v 1.5 2014/11/15 19:18:18 christos Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@@ -150,10 +150,10 @@
* the first 3 bits of the unit are the channel number inside a single
* cd18xx instance, and the remaining bits indicate the instance number.
*/
-#define CD18XX_TTY(x) (minor(x) & 0x7ffff)
-#define CD18XX_CHANNEL(x) (minor(x) & 7)
-#define CD18XX_INSTANCE(x) ((minor(x) >> 3) & 0xffff)
-#define CD18XX_DIALOUT(x) ((minor(x) & 0x80000) != 0)
+#define CD18XX_TTY(x) TTUNIT(x)
+#define CD18XX_CHANNEL(x) (TTUNIT(x) & 7)
+#define CD18XX_INSTANCE(x) (TTUNIT(x) >> 3)
+#define CD18XX_DIALOUT(x) TTDIALOUT(x)
/* short helpers for read/write */
#define cd18xx_read(sc, o) \
diff -r 48800a893df2 -r b0996928d884 sys/dev/ic/clmpcc.c
--- a/sys/dev/ic/clmpcc.c Sat Nov 15 19:17:05 2014 +0000
+++ b/sys/dev/ic/clmpcc.c Sat Nov 15 19:18:18 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: clmpcc.c,v 1.50 2014/10/18 08:33:27 snj Exp $ */
+/* $NetBSD: clmpcc.c,v 1.51 2014/11/15 19:18:18 christos Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clmpcc.c,v 1.50 2014/10/18 08:33:27 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clmpcc.c,v 1.51 2014/11/15 19:18:18 christos Exp $");
#include "opt_ddb.h"
@@ -75,9 +75,9 @@
static void clmpcc_start(struct tty *);
static int clmpcc_modem_control(struct clmpcc_chan *, int, int);
-#define CLMPCCUNIT(x) (minor(x) & 0x7fffc)
-#define CLMPCCCHAN(x) (minor(x) & 0x00003)
-#define CLMPCCDIALOUT(x) (minor(x) & 0x80000)
+#define CLMPCCUNIT(x) (TTUNIT(x) & ~0x3) // XXX >> 2?
+#define CLMPCCCHAN(x) (TTUNIT(x) & 0x3)
+#define CLMPCCDIALOUT(x) TTDIALOUT(x)
/*
* These should be in a header file somewhere...
diff -r 48800a893df2 -r b0996928d884 sys/dev/ic/com.c
--- a/sys/dev/ic/com.c Sat Nov 15 19:17:05 2014 +0000
+++ b/sys/dev/ic/com.c Sat Nov 15 19:18:18 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.327 2014/08/10 16:44:35 tls Exp $ */
+/* $NetBSD: com.c,v 1.328 2014/11/15 19:18:18 christos Exp $ */
/*-
* Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.327 2014/08/10 16:44:35 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.328 2014/11/15 19:18:18 christos Exp $");
#include "opt_com.h"
#include "opt_ddb.h"
@@ -270,11 +270,10 @@
#endif /* COM_16750 */
#endif /* COM_REGMAP */
-#define COMUNIT_MASK 0x7ffff
-#define COMDIALOUT_MASK 0x80000
-
-#define COMUNIT(x) (minor(x) & COMUNIT_MASK)
-#define COMDIALOUT(x) (minor(x) & COMDIALOUT_MASK)
+#define COMDIALOUT_MASK TTDIALOUT_MASK
+
+#define COMUNIT(x) TTUNIT(x)
+#define COMDIALOUT(x) TTDIALOUT(x)
#define COM_ISALIVE(sc) ((sc)->enabled != 0 && \
device_is_active((sc)->sc_dev))
diff -r 48800a893df2 -r b0996928d884 sys/dev/ic/cy.c
--- a/sys/dev/ic/cy.c Sat Nov 15 19:17:05 2014 +0000
+++ b/sys/dev/ic/cy.c Sat Nov 15 19:18:18 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cy.c,v 1.59 2014/07/25 08:10:37 dholland Exp $ */
+/* $NetBSD: cy.c,v 1.60 2014/11/15 19:18:18 christos Exp $ */
/*
* cy.c
@@ -16,7 +16,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cy.c,v 1.59 2014/07/25 08:10:37 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cy.c,v 1.60 2014/11/15 19:18:18 christos Exp $");
#include <sys/param.h>
#include <sys/ioctl.h>
@@ -246,8 +246,8 @@
CY_CLEAR_INTR << sc->sc_bustype, 0);
}
-#define CYDIALOUT_MASK 0x80000
-#define CY_DIALOUT(dev) (minor(dev) & CYDIALOUT_MASK)
+#define CY_UNIT(dev) TTUNIT(dev)
+#define CY_DIALOUT(dev) TTDIALOUT(dev)
#define CY_PORT(dev) cy_getport((dev))
#define CY_BOARD(cy) ((cy)->cy_softc)
@@ -255,7 +255,7 @@
static struct cy_port *
cy_getport(dev_t dev)
{
- int i, j, k, u = minor(dev) & ~CYDIALOUT_MASK;
+ int i, j, k, u = CY_UNIT(dev);
struct cy_softc *sc;
for (i = 0, j = 0; i < cy_cd.cd_ndevs; i++) {
diff -r 48800a893df2 -r b0996928d884 sys/dev/ic/z8530tty.c
--- a/sys/dev/ic/z8530tty.c Sat Nov 15 19:17:05 2014 +0000
+++ b/sys/dev/ic/z8530tty.c Sat Nov 15 19:18:18 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: z8530tty.c,v 1.130 2014/07/25 08:10:37 dholland Exp $ */
+/* $NetBSD: z8530tty.c,v 1.131 2014/11/15 19:18:18 christos Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998, 1999
@@ -137,7 +137,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: z8530tty.c,v 1.130 2014/07/25 08:10:37 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: z8530tty.c,v 1.131 2014/11/15 19:18:18 christos Exp $");
#include "opt_kgdb.h"
#include "opt_ntp.h"
@@ -285,8 +285,8 @@
static void zstty_softint(struct zs_chanstate *);
static void zstty_softint1(struct zs_chanstate *);
-#define ZSUNIT(x) (minor(x) & 0x7ffff)
-#define ZSDIALOUT(x) (minor(x) & 0x80000)
+#define ZSUNIT(x) TTUNIT(x)
+#define ZSDIALOUT(x) TTDIALOUT(x)
struct tty *zstty_get_tty_from_dev(device_t);
diff -r 48800a893df2 -r b0996928d884 sys/dev/marvell/gtmpsc.c
--- a/sys/dev/marvell/gtmpsc.c Sat Nov 15 19:17:05 2014 +0000
+++ b/sys/dev/marvell/gtmpsc.c Sat Nov 15 19:18:18 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gtmpsc.c,v 1.45 2014/07/25 08:10:37 dholland Exp $ */
+/* $NetBSD: gtmpsc.c,v 1.46 2014/11/15 19:18:18 christos 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.45 2014/07/25 08:10:37 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtmpsc.c,v 1.46 2014/11/15 19:18:18 christos Exp $");
#include "opt_kgdb.h"
@@ -82,11 +82,8 @@
# define DPRINTF(x)
#endif
-#define GTMPSCUNIT_MASK 0x7ffff
-#define GTMPSCDIALOUT_MASK 0x80000
-
-#define GTMPSCUNIT(x) (minor(x) & GTMPSCUNIT_MASK)
-#define GTMPSCDIALOUT(x) (minor(x) & GTMPSCDIALOUT_MASK)
+#define GTMPSCUNIT(x) TTUNIT(x)
+#define GTMPSCDIALOUT(x) TTDIALOUT(x)
#define CLEANUP_AND_RETURN_RXDMA(sc, ix) \
do { \
diff -r 48800a893df2 -r b0996928d884 sys/dev/mii/files.mii
--- a/sys/dev/mii/files.mii Sat Nov 15 19:17:05 2014 +0000
+++ b/sys/dev/mii/files.mii Sat Nov 15 19:18:18 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.mii,v 1.49 2014/02/26 04:13:44 ozaki-r Exp $
+# $NetBSD: files.mii,v 1.50 2014/11/15 19:18:18 christos Exp $
defflag opt_mii.h MIIVERBOSE
@@ -77,10 +77,16 @@
attach lxtphy at mii
file dev/mii/lxtphy.c lxtphy
+# Old
device makphy: mii_phy
attach makphy at mii
file dev/mii/makphy.c makphy
+# New
+device e1000phy: mii_phy
+attach e1000phy at mii
+file dev/mii/e1000phy.c e1000phy
+
device icsphy: mii_phy
attach icsphy at mii
file dev/mii/icsphy.c icsphy
diff -r 48800a893df2 -r b0996928d884 sys/dev/pci/cz.c
--- a/sys/dev/pci/cz.c Sat Nov 15 19:17:05 2014 +0000
+++ b/sys/dev/pci/cz.c Sat Nov 15 19:18:18 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cz.c,v 1.60 2014/07/25 08:10:38 dholland Exp $ */
+/* $NetBSD: cz.c,v 1.61 2014/11/15 19:18:19 christos Exp $ */
/*-
* Copyright (c) 2000 Zembu Labs, Inc.
@@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cz.c,v 1.60 2014/07/25 08:10:38 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cz.c,v 1.61 2014/11/15 19:18:19 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -846,9 +846,8 @@
* Cyclades-Z TTY code starts here...
*****************************************************************************/
-#define CZTTYDIALOUT_MASK 0x80000
-
-#define CZTTY_DIALOUT(dev) (minor((dev)) & CZTTYDIALOUT_MASK)
+#define CZTTY_DIALOUT(dev) TTDIALOUT(dev)
+#define CZTTY_UNIT(dev) TTUNIT(dev)
#define CZTTY_CZ(sc) ((sc)->sc_parent)
#define CZTTY_SOFTC(dev) cztty_getttysoftc(dev)
@@ -856,7 +855,7 @@
static struct cztty_softc *
cztty_getttysoftc(dev_t dev)
{
- int i, j, k = 0, u = minor(dev) & ~CZTTYDIALOUT_MASK;
+ int i, j, k = 0, u = CZTTY_UNIT(dev);
struct cz_softc *cz = NULL;
for (i = 0, j = 0; i < cz_cd.cd_ndevs; i++) {
diff -r 48800a893df2 -r b0996928d884 sys/dev/sbus/magmareg.h
--- a/sys/dev/sbus/magmareg.h Sat Nov 15 19:17:05 2014 +0000
+++ b/sys/dev/sbus/magmareg.h Sat Nov 15 19:18:18 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: magmareg.h,v 1.17 2012/10/27 17:18:37 chs Exp $ */
+/* $NetBSD: magmareg.h,v 1.18 2014/11/15 19:18:19 christos Exp $ */
/*-
* Copyright (c) 1998 Iain Hibbert
@@ -40,7 +40,7 @@
* | | | | | | | |
* | | | | +---+---+---+---> port number
* | | | |
- * | | | +-------------------> dialout (on tty ports)
+ * | | | +-------------------> unused
* | | |
* | | +-----------------------> unused
* | |
@@ -54,10 +54,10 @@
#define MAGMA_MAX_CD1400 4
#define MAGMA_MAX_CD1190 2
-#define MAGMA_CARD(x) ((minor(x) >> 6) & 0x03)
-#define MAGMA_PORT(x) (minor(x) & 0x0f)
+#define MAGMA_CARD(x) ((TTUNIT(x) >> 6) & 0x03)
+#define MAGMA_PORT(x) (TTUNIT(x) & 0x0f)
-#define MTTY_DIALOUT(x) (minor(x) & 0x10)
+#define MTTY_DIALOUT(x) TTDIALOUT(x)
/*
* Supported Card Types
diff -r 48800a893df2 -r b0996928d884 sys/dev/sbus/spifreg.h
--- a/sys/dev/sbus/spifreg.h Sat Nov 15 19:17:05 2014 +0000
+++ b/sys/dev/sbus/spifreg.h Sat Nov 15 19:18:18 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spifreg.h,v 1.4 2009/05/12 14:43:59 cegger Exp $ */
+/* $NetBSD: spifreg.h,v 1.5 2014/11/15 19:18:19 christos Exp $ */
/* $OpenBSD: spifreg.h,v 1.5 2003/06/02 18:32:41 jason Exp $ */
/*
@@ -325,7 +325,7 @@
* | | | | |
* | | | | +---------------> unused
* | | | |
- * | | | +-------------------> dialout (on tty ports)
+ * | | | +-------------------> unused
Home |
Main Index |
Thread Index |
Old Index