centralize the call unit / dialout macros

This commit is contained in:
christos 2014-11-15 19:20:01 +00:00
parent 6ca6d5d665
commit a0a6c85f4d
18 changed files with 76 additions and 103 deletions

View File

@ -1,5 +1,5 @@
/* $Id: at91dbgu.c,v 1.12 2014/08/10 16:44:33 tls Exp $ */
/* $NetBSD: at91dbgu.c,v 1.12 2014/08/10 16:44:33 tls Exp $ */
/* $Id: at91dbgu.c,v 1.13 2014/11/15 19:20:01 christos Exp $ */
/* $NetBSD: at91dbgu.c,v 1.13 2014/11/15 19:20:01 christos Exp $ */
/*
*
@ -83,7 +83,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: at91dbgu.c,v 1.12 2014/08/10 16:44:33 tls Exp $");
__KERNEL_RCSID(0, "$NetBSD: at91dbgu.c,v 1.13 2014/11/15 19:20:01 christos Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -205,11 +205,8 @@ struct consdev at91dbgu_cons = {
#define DEFAULT_COMSPEED 115200
#endif
#define COMUNIT_MASK 0x7ffff
#define COMDIALOUT_MASK 0x80000
#define COMUNIT(x) (minor(x) & COMUNIT_MASK)
#define COMDIALOUT(x) (minor(x) & COMDIALOUT_MASK)
#define COMUNIT(x) TTUNIT(x)
#define COMDIALOUT(x) TTDIALOUT(x)
#define COM_ISALIVE(sc) ((sc)->enabled != 0 && device_is_active((sc)->sc_dev))

View File

@ -1,5 +1,5 @@
/* $Id: at91usart.c,v 1.11 2014/08/10 16:44:33 tls Exp $ */
/* $NetBSD: at91usart.c,v 1.11 2014/08/10 16:44:33 tls Exp $ */
/* $Id: at91usart.c,v 1.12 2014/11/15 19:20:01 christos Exp $ */
/* $NetBSD: at91usart.c,v 1.12 2014/11/15 19:20:01 christos Exp $ */
/*
* Copyright (c) 2007 Embedtronics Oy. All rights reserved.
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: at91usart.c,v 1.11 2014/08/10 16:44:33 tls Exp $");
__KERNEL_RCSID(0, "$NetBSD: at91usart.c,v 1.12 2014/11/15 19:20:01 christos Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -210,11 +210,8 @@ struct consdev at91usart_cons = {
#define DEFAULT_COMSPEED 115200
#endif
#define COMUNIT_MASK 0x7ffff
#define COMDIALOUT_MASK 0x80000
#define COMUNIT(x) (minor(x) & COMUNIT_MASK)
#define COMDIALOUT(x) (minor(x) & COMDIALOUT_MASK)
#define COMUNIT(x) TTUNIT(x)
#define COMDIALOUT(x) TTDIALOUT(x)
#define COM_ISALIVE(sc) ((sc)->enabled != 0 && device_is_active((sc)->sc_dev))

View File

@ -1,4 +1,4 @@
/* $NetBSD: clpscom.c,v 1.4 2014/08/10 16:44:33 tls Exp $ */
/* $NetBSD: clpscom.c,v 1.5 2014/11/15 19:20:01 christos Exp $ */
/*
* Copyright (c) 2013 KIYOHARA Takashi
* All rights reserved.
@ -25,7 +25,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: clpscom.c,v 1.4 2014/08/10 16:44:33 tls Exp $");
__KERNEL_RCSID(0, "$NetBSD: clpscom.c,v 1.5 2014/11/15 19:20:01 christos Exp $");
#include "rnd.h"
@ -56,11 +56,8 @@ __KERNEL_RCSID(0, "$NetBSD: clpscom.c,v 1.4 2014/08/10 16:44:33 tls Exp $");
#include "ioconf.h"
#include "locators.h"
#define COMUNIT_MASK 0x7ffff
#define COMDIALOUT_MASK 0x80000
#define COMUNIT(x) (minor(x) & COMUNIT_MASK)
#define COMDIALOUT(x) (minor(x) & COMDIALOUT_MASK)
#define COMUNIT(x) TTUNIT(x)
#define COMDIALOUT(x) TTDIALOUT(x)
#define CLPSCOM_RING_SIZE 2048
#define UART_FIFO_SIZE 16

View File

@ -1,4 +1,4 @@
/* $NetBSD: epcom.c,v 1.28 2014/08/10 16:44:33 tls Exp $ */
/* $NetBSD: epcom.c,v 1.29 2014/11/15 19:20:01 christos Exp $ */
/*
* Copyright (c) 1998, 1999, 2001, 2002, 2004 The NetBSD Foundation, Inc.
* All rights reserved.
@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: epcom.c,v 1.28 2014/08/10 16:44:33 tls Exp $");
__KERNEL_RCSID(0, "$NetBSD: epcom.c,v 1.29 2014/11/15 19:20:01 christos Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -185,11 +185,8 @@ struct consdev epcomcons = {
#define DEFAULT_COMSPEED 115200
#endif
#define COMUNIT_MASK 0x7ffff
#define COMDIALOUT_MASK 0x80000
#define COMUNIT(x) (minor(x) & COMUNIT_MASK)
#define COMDIALOUT(x) (minor(x) & COMDIALOUT_MASK)
#define COMUNIT(x) TTUNIT(x)
#define COMDIALOUT(x) TTDIALOUT(x)
#define COM_ISALIVE(sc) ((sc)->enabled != 0 && \
device_is_active((sc)->sc_dev))

View File

@ -1,4 +1,4 @@
/* $NetBSD: imxuart.c,v 1.15 2014/09/25 05:05:28 ryo Exp $ */
/* $NetBSD: imxuart.c,v 1.16 2014/11/15 19:20:01 christos Exp $ */
/*
* Copyright (c) 2009, 2010 Genetec Corporation. All rights reserved.
@ -96,7 +96,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: imxuart.c,v 1.15 2014/09/25 05:05:28 ryo Exp $");
__KERNEL_RCSID(0, "$NetBSD: imxuart.c,v 1.16 2014/11/15 19:20:01 christos Exp $");
#include "opt_imxuart.h"
#include "opt_ddb.h"
@ -382,11 +382,10 @@ int imxuart_kgdb_getc(void *);
void imxuart_kgdb_putc(void *, int);
#endif /* KGDB */
#define IMXUART_UNIT_MASK 0x7ffff
#define IMXUART_DIALOUT_MASK 0x80000
#define IMXUART_DIALOUT_MASK TTDIALOUT_MASK
#define IMXUART_UNIT(x) (minor(x) & IMXUART_UNIT_MASK)
#define IMXUART_DIALOUT(x) (minor(x) & IMXUART_DIALOUT_MASK)
#define IMXUART_UNIT(x) TTUNIT(x)
#define IMXUART_DIALOUT(x) TTDIALOUT(x)
#define IMXUART_ISALIVE(sc) ((sc)->enabled != 0 && \
device_is_active((sc)->sc_dev))

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixp12x0_com.c,v 1.45 2014/08/10 16:44:33 tls Exp $ */
/* $NetBSD: ixp12x0_com.c,v 1.46 2014/11/15 19:20:01 christos Exp $ */
/*
* Copyright (c) 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
* All rights reserved.
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ixp12x0_com.c,v 1.45 2014/08/10 16:44:33 tls Exp $");
__KERNEL_RCSID(0, "$NetBSD: ixp12x0_com.c,v 1.46 2014/11/15 19:20:01 christos Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -174,11 +174,8 @@ struct consdev ixpcomcons = {
#define DEFAULT_COMSPEED 38400
#endif
#define COMUNIT_MASK 0x7ffff
#define COMDIALOUT_MASK 0x80000
#define COMUNIT(x) (minor(x) & COMUNIT_MASK)
#define COMDIALOUT(x) (minor(x) & COMDIALOUT_MASK)
#define COMUNIT(x) TTUNIT(x)
#define COMDIALOUT(x) TTDIALOUT(x)
#define COM_ISALIVE(sc) ((sc)->enabled != 0 && \
device_is_active((sc)->sc_dev))

View File

@ -1,4 +1,4 @@
/* $NetBSD: sa11x0_com.c,v 1.53 2014/08/10 16:44:33 tls Exp $ */
/* $NetBSD: sa11x0_com.c,v 1.54 2014/11/15 19:20:01 christos Exp $ */
/*-
* Copyright (c) 1998, 1999, 2001 The NetBSD Foundation, Inc.
@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.53 2014/08/10 16:44:33 tls Exp $");
__KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.54 2014/11/15 19:20:01 christos Exp $");
#include "opt_com.h"
#include "opt_ddb.h"
@ -172,11 +172,10 @@ static inline void sacom_schedrx(struct sacom_softc *);
static void sacom_j720_init(device_t, device_t);
#endif
#define COMUNIT_MASK 0x7ffff
#define COMDIALOUT_MASK 0x80000
#define COMDIALOUT_MASK TTDIALOUT_MASK
#define COMUNIT(x) (minor(x) & COMUNIT_MASK)
#define COMDIALOUT(x) (minor(x) & COMDIALOUT_MASK)
#define COMUNIT(x) TTUNIT(x)
#define COMDIALOUT(x) TTDIALOUT(x)
#define COM_ISALIVE(sc) ((sc)->enabled != 0 && \
device_is_active((sc)->sc_dev))

View File

@ -1,4 +1,4 @@
/* $NetBSD: ser.c,v 1.55 2014/07/25 08:10:32 dholland Exp $ */
/* $NetBSD: ser.c,v 1.56 2014/11/15 19:20:01 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -93,7 +93,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.55 2014/07/25 08:10:32 dholland Exp $");
__KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.56 2014/11/15 19:20:01 christos Exp $");
#include "opt_ddb.h"
#include "opt_mbtype.h"
@ -144,8 +144,8 @@ __KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.55 2014/07/25 08:10:32 dholland Exp $");
/* #define SER_DEBUG */
#define SERUNIT(x) (minor(x) & 0x7ffff)
#define SERDIALOUT(x) (minor(x) & 0x80000)
#define SERUNIT(x) TTUNIT(x)
#define SERDIALOUT(x) TTDIALOUT(x)
/* XXX */
#define CONSBAUD 9600

View File

@ -1,4 +1,4 @@
/* $NetBSD: zsvar.h,v 1.16 2010/04/09 17:38:43 tsutsui Exp $ */
/* $NetBSD: zsvar.h,v 1.17 2014/11/15 19:20:01 christos Exp $ */
/*
* Copyright (c) 1992, 1993
@ -179,6 +179,6 @@ struct zs_chanstate {
/*
* Split minor into unit, dialin/dialout & flag nibble.
*/
#define ZS_UNIT(dev) ((minor(dev) >> 4) & 0xf)
#define ZS_FLAGS(dev) (minor(dev) & 0xf)
#define ZS_DIALOUT(dev) (minor(dev) & 0x80000)
#define ZS_UNIT(dev) (TTUNIT(dev) >> 4)
#define ZS_FLAGS(dev) (TTUNIT(dev) & 0xf)
#define ZS_DIALOUT(dev) TTDIALOUT(dev)

View File

@ -1,4 +1,4 @@
/* $NetBSD: wmcom.c,v 1.4 2014/08/10 16:44:33 tls Exp $ */
/* $NetBSD: wmcom.c,v 1.5 2014/11/15 19:20:01 christos Exp $ */
/*
* Copyright (c) 2012 KIYOHARA Takashi
* All rights reserved.
@ -25,7 +25,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wmcom.c,v 1.4 2014/08/10 16:44:33 tls Exp $");
__KERNEL_RCSID(0, "$NetBSD: wmcom.c,v 1.5 2014/11/15 19:20:01 christos Exp $");
#include "rnd.h"
@ -56,11 +56,8 @@ __KERNEL_RCSID(0, "$NetBSD: wmcom.c,v 1.4 2014/08/10 16:44:33 tls Exp $");
#include "ioconf.h"
#include "locators.h"
#define COMUNIT_MASK 0x7ffff
#define COMDIALOUT_MASK 0x80000
#define COMUNIT(x) (minor(x) & COMUNIT_MASK)
#define COMDIALOUT(x) (minor(x) & COMDIALOUT_MASK)
#define COMUNIT(x) TTUNIT(x)
#define COMDIALOUT(x) TTDIALOUT(x)
#define WMCOM_RING_SIZE 2048

View File

@ -1,4 +1,4 @@
/* $NetBSD: plcom.c,v 1.50 2014/08/10 16:44:34 tls Exp $ */
/* $NetBSD: plcom.c,v 1.51 2014/11/15 19:20:01 christos Exp $ */
/*-
* Copyright (c) 2001 ARM Ltd
@ -94,7 +94,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.50 2014/08/10 16:44:34 tls Exp $");
__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.51 2014/11/15 19:20:01 christos Exp $");
#include "opt_plcom.h"
#include "opt_ddb.h"
@ -245,11 +245,10 @@ int plcom_kgdb_getc (void *);
void plcom_kgdb_putc (void *, int);
#endif /* KGDB */
#define PLCOMUNIT_MASK 0x7ffff
#define PLCOMDIALOUT_MASK 0x80000
#define PLCOMDIALOUT_MASK TTDIALOUT_MASK
#define PLCOMUNIT(x) (minor(x) & PLCOMUNIT_MASK)
#define PLCOMDIALOUT(x) (minor(x) & PLCOMDIALOUT_MASK)
#define PLCOMUNIT(x) TTUNIT(x)
#define PLCOMDIALOUT(x) TTDIALOUT(x)
#define PLCOM_ISALIVE(sc) ((sc)->enabled != 0 && \
device_is_active((sc)->sc_dev))

View File

@ -1,4 +1,4 @@
/* $NetBSD: dcm.c,v 1.87 2014/07/25 08:10:33 dholland Exp $ */
/* $NetBSD: dcm.c,v 1.88 2014/11/15 19:20:01 christos Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dcm.c,v 1.87 2014/07/25 08:10:33 dholland Exp $");
__KERNEL_RCSID(0, "$NetBSD: dcm.c,v 1.88 2014/11/15 19:20:01 christos Exp $");
#include "opt_kgdb.h"
@ -191,8 +191,8 @@ struct dcmstats {
};
#endif
#define DCMUNIT(x) (minor(x) & 0x7ffff)
#define DCMDIALOUT(x) (minor(x) & 0x80000)
#define DCMUNIT(x) TTUNIT(x)
#define DCMDIALOUT(x) TTDIALOUT(x)
#define DCMBOARD(x) (((x) >> 2) & 0x3f)
#define DCMPORT(x) ((x) & 3)

View File

@ -1,4 +1,4 @@
/* $NetBSD: txcom.c,v 1.48 2014/07/25 08:10:33 dholland Exp $ */
/* $NetBSD: txcom.c,v 1.49 2014/11/15 19:20:01 christos Exp $ */
/*-
* Copyright (c) 1999, 2000, 2004 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: txcom.c,v 1.48 2014/07/25 08:10:33 dholland Exp $");
__KERNEL_RCSID(0, "$NetBSD: txcom.c,v 1.49 2014/11/15 19:20:01 christos Exp $");
#include "opt_tx39uart_debug.h"
@ -857,7 +857,7 @@ txcomopen(dev_t dev, int flag, int mode, struct lwp *l)
}
splx(s);
#define TXCOMDIALOUT(x) (minor(x) & 0x80000)
#define TXCOMDIALOUT(x) TTDIALOUT(x)
if ((err = ttyopen(tp, TXCOMDIALOUT(dev), ISSET(flag, O_NONBLOCK)))) {
DPRINTF("ttyopen failed\n");
goto out;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbjcnvar.h,v 1.4 2012/02/02 19:43:00 tls Exp $ */
/* $NetBSD: sbjcnvar.h,v 1.5 2014/11/15 19:20:01 christos Exp $ */
/*
* Copyright 2000, 2001
@ -71,9 +71,9 @@
#include <sys/callout.h>
#define SBJCN_CHAN(x) ((minor(x) & 0x00001) >> 0)
#define SBJCN_UNIT(x) ((minor(x) & 0x7fffe) >> 1)
#define SBJCN_DIALOUT(x) ((minor(x) & 0x80000) != 0)
#define SBJCN_CHAN(x) (TTUNIT(x) & 1)
#define SBJCN_UNIT(x) (TTUNIT(x) >> 1)
#define SBJCN_DIALOUT(x) TTDIALOUT(x)
#define SBJCN_TOLERANCE 30 /* baud rate tolerance, in 0.1% units */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbscnvar.h,v 1.6 2012/02/02 19:43:00 tls Exp $ */
/* $NetBSD: sbscnvar.h,v 1.7 2014/11/15 19:20:01 christos Exp $ */
/*
* Copyright 2000, 2001
@ -71,9 +71,9 @@
#include <sys/callout.h>
#define SBSCN_CHAN(x) ((minor(x) & 0x00001) >> 0)
#define SBSCN_UNIT(x) ((minor(x) & 0x7fffe) >> 1)
#define SBSCN_DIALOUT(x) ((minor(x) & 0x80000) != 0)
#define SBSCN_CHAN(x) (TTUNIT(x) & 1)
#define SBSCN_UNIT(x) (TTUNIT(x) >> 1)
#define SBSCN_DIALOUT(x) TTDIALOUT(x)
#define SBSCN_TOLERANCE 30 /* baud rate tolerance, in 0.1% units */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sci.c,v 1.60 2014/07/25 08:10:34 dholland Exp $ */
/* $NetBSD: sci.c,v 1.61 2014/11/15 19:20:01 christos Exp $ */
/*-
* Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu. All rights reserved.
@ -93,7 +93,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sci.c,v 1.60 2014/07/25 08:10:34 dholland Exp $");
__KERNEL_RCSID(0, "$NetBSD: sci.c,v 1.61 2014/11/15 19:20:01 christos Exp $");
#include "opt_kgdb.h"
#include "opt_sci.h"
@ -196,11 +196,8 @@ integrate void sci_stsoft(struct sci_softc *, struct tty *);
integrate void sci_schedrx(struct sci_softc *);
void scidiag(void *);
#define SCIUNIT_MASK 0x7ffff
#define SCIDIALOUT_MASK 0x80000
#define SCIUNIT(x) (minor(x) & SCIUNIT_MASK)
#define SCIDIALOUT(x) (minor(x) & SCIDIALOUT_MASK)
#define SCIUNIT(x) TTUNIT(x)
#define SCIDIALOUT(x) TTDIALOUT(x)
/* Hardware flag masks */
#define SCI_HW_NOIEN 0x01

View File

@ -1,4 +1,4 @@
/* $NetBSD: scif.c,v 1.64 2014/07/25 08:10:34 dholland Exp $ */
/* $NetBSD: scif.c,v 1.65 2014/11/15 19:20:01 christos Exp $ */
/*-
* Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu. All rights reserved.
@ -93,7 +93,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.64 2014/07/25 08:10:34 dholland Exp $");
__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.65 2014/11/15 19:20:01 christos Exp $");
#include "opt_kgdb.h"
#include "opt_scif.h"
@ -187,11 +187,8 @@ static int scif_attached = 0; /* XXX: FIXME: don't limit to just one! */
extern struct cfdriver scif_cd;
#define SCIFUNIT_MASK 0x7ffff
#define SCIFDIALOUT_MASK 0x80000
#define SCIFUNIT(x) (minor(x) & SCIFUNIT_MASK)
#define SCIFDIALOUT(x) (minor(x) & SCIFDIALOUT_MASK)
#define SCIFUNIT(x) TTUNIT(x)
#define SCIFDIALOUT(x) TTDIALOUT(x)
/* console */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sab.c,v 1.53 2014/11/01 16:45:16 nakayama Exp $ */
/* $NetBSD: sab.c,v 1.54 2014/11/15 19:20:02 christos Exp $ */
/* $OpenBSD: sab.c,v 1.7 2002/04/08 17:49:42 jason Exp $ */
/*
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.53 2014/11/01 16:45:16 nakayama Exp $");
__KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.54 2014/11/15 19:20:02 christos Exp $");
#include "opt_kgdb.h"
#include <sys/types.h>
@ -71,8 +71,8 @@ __KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.53 2014/11/01 16:45:16 nakayama Exp $");
#include "locators.h"
#define SABUNIT(x) (minor(x) & 0x7ffff)
#define SABDIALOUT(x) (minor(x) & 0x80000)
#define SABUNIT(x) TTUNIT(x)
#define SABDIALOUT(x) TTDIALOUT(x)
#define SABTTY_RBUF_SIZE 1024 /* must be divisible by 2 */