centralize the dialout/call unit macros.
This commit is contained in:
parent
cf8ac13ddd
commit
6ca6d5d665
@ -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 @@ void cd18xx_attach(struct cd18xx_softc *);
|
||||
* 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) \
|
||||
|
@ -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_set_params(struct clmpcc_chan *);
|
||||
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...
|
||||
|
@ -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 @@ const bus_size_t com_std_map[16] = COM_REG_16550;
|
||||
#endif /* COM_16750 */
|
||||
#endif /* COM_REGMAP */
|
||||
|
||||
#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))
|
||||
|
@ -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_attach(struct cy_softc *sc)
|
||||
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 @@ cy_attach(struct cy_softc *sc)
|
||||
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++) {
|
||||
|
@ -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_txint (struct zs_chanstate *);
|
||||
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);
|
||||
|
||||
|
@ -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 @@ unsigned int gtmpsc_debug = 0;
|
||||
# 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 { \
|
||||
|
@ -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 @@ device lxtphy: mii_phy, ukphy_subr
|
||||
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
|
||||
|
@ -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 @@ cz_wait_pci_doorbell(struct cz_softc *cz, const char *wstring)
|
||||
* 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 @@ cz_wait_pci_doorbell(struct cz_softc *cz, const char *wstring)
|
||||
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++) {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
* | | |
|
||||
* | | +-----------------------> unused
|
||||
* | |
|
||||
@ -339,9 +339,9 @@
|
||||
/*
|
||||
* device selectors
|
||||
*/
|
||||
#define SPIF_CARD(x) ((minor(x) >> 6) & 0x03)
|
||||
#define SPIF_PORT(x) (minor(x) & 0x07)
|
||||
#define STTY_DIALOUT(x) (minor(x) & 0x10)
|
||||
#define SPIF_CARD(x) ((TTUNIT(x) >> 6) & 0x03)
|
||||
#define SPIF_PORT(x) (TTUNIT(x) & 0x07)
|
||||
#define STTY_DIALOUT(x) TTDIALOUT(x)
|
||||
|
||||
#define STTY_RX_FIFO_THRESHOLD 4
|
||||
#define STTY_RX_DTR_THRESHOLD 7
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ucom.c,v 1.107 2014/08/10 16:44:36 tls Exp $ */
|
||||
/* $NetBSD: ucom.c,v 1.108 2014/11/15 19:18:19 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
@ -34,7 +34,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.107 2014/08/10 16:44:36 tls Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.108 2014/11/15 19:18:19 christos Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -76,13 +76,13 @@ int ucomdebug = 0;
|
||||
#endif
|
||||
#define DPRINTF(x) DPRINTFN(0, x)
|
||||
|
||||
#define UCOMUNIT_MASK 0x3ffff
|
||||
#define UCOMDIALOUT_MASK 0x80000
|
||||
#define UCOMCALLUNIT_MASK 0x40000
|
||||
#define UCOMCALLUNIT_MASK TTCALLUNIT_MASK
|
||||
#define UCOMUNIT_MASK TTUNIT_MASK
|
||||
#define UCOMDIALOUT_MASK TTDIALOUT_MASK
|
||||
|
||||
#define UCOMUNIT(x) (minor(x) & UCOMUNIT_MASK)
|
||||
#define UCOMDIALOUT(x) (minor(x) & UCOMDIALOUT_MASK)
|
||||
#define UCOMCALLUNIT(x) (minor(x) & UCOMCALLUNIT_MASK)
|
||||
#define UCOMCALLUNIT(x) TTCALLUNIT(x)
|
||||
#define UCOMUNIT(x) TTUNIT(x)
|
||||
#define UCOMDIALOUT(x) TTDIALOUT(x)
|
||||
|
||||
/*
|
||||
* XXX: We can submit multiple input/output buffers to the usb stack
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ucycom.c,v 1.39 2014/07/25 08:10:39 dholland Exp $ */
|
||||
/* $NetBSD: ucycom.c,v 1.40 2014/11/15 19:18:19 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005 The NetBSD Foundation, Inc.
|
||||
@ -38,7 +38,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ucycom.c,v 1.39 2014/07/25 08:10:39 dholland Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ucycom.c,v 1.40 2014/11/15 19:18:19 christos Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -74,13 +74,13 @@ int ucycomdebug = 20;
|
||||
#endif
|
||||
|
||||
|
||||
#define UCYCOMUNIT_MASK 0x3ffff
|
||||
#define UCYCOMDIALOUT_MASK 0x80000
|
||||
#define UCYCOMCALLUNIT_MASK 0x40000
|
||||
#define UCYCCALLUNIT_MASK TTCALLUNIT_MASK
|
||||
#define UCYCUNIT_MASK TTUNIT_MASK
|
||||
#define UCYCDIALOUT_MASK TTDIALOUT_MASK
|
||||
|
||||
#define UCYCOMUNIT(x) (minor(x) & UCYCOMUNIT_MASK)
|
||||
#define UCYCOMDIALOUT(x) (minor(x) & UCYCOMDIALOUT_MASK)
|
||||
#define UCYCOMCALLUNIT(x) (minor(x) & UCYCOMCALLUNIT_MASK)
|
||||
#define UCYCCALLUNIT(x) TTCALLUNIT(x)
|
||||
#define UCYCUNIT(x) TTUNIT(x)
|
||||
#define UCYCDIALOUT(x) TTDIALOUT(x)
|
||||
|
||||
/* Configuration Byte */
|
||||
#define UCYCOM_RESET 0x80
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: uhso.c,v 1.16 2014/07/25 08:10:39 dholland Exp $ */
|
||||
/* $NetBSD: uhso.c,v 1.17 2014/11/15 19:18:19 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2009 Iain Hibbert
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: uhso.c,v 1.16 2014/07/25 08:10:39 dholland Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: uhso.c,v 1.17 2014/11/15 19:18:19 christos Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_inet.h"
|
||||
@ -400,14 +400,14 @@ Static void uhso_tty_start(struct tty *);
|
||||
Static int uhso_tty_param(struct tty *, struct termios *);
|
||||
Static int uhso_tty_control(struct uhso_port *, u_long, int);
|
||||
|
||||
#define UHSO_UNIT_MASK 0x0fff0
|
||||
#define UHSO_UNIT_MASK TTUNIT_MASK
|
||||
#define UHSO_PORT_MASK 0x0000f
|
||||
#define UHSO_DIALOUT_MASK 0x80000
|
||||
#define UHSO_CALLUNIT_MASK 0x40000
|
||||
#define UHSO_DIALOUT_MASK TTDIALOUT_MASK
|
||||
#define UHSO_CALLUNIT_MASK TTCALLUNIT_MASK
|
||||
|
||||
#define UHSOUNIT(x) ((minor(x) & UHSO_UNIT_MASK) >> 4)
|
||||
#define UHSOPORT(x) (minor(x) & UHSO_PORT_MASK)
|
||||
#define UHSODIALOUT(x) (minor(x) & UHSO_DIALOUT_MASK)
|
||||
#define UHSOUNIT(x) (TTUNIT(x) >> 4)
|
||||
#define UHSOPORT(x) (TTUNIT(x) & UHSO_PORT_MASK)
|
||||
#define UHSODIALOUT(x) TTDIALOUT(x)
|
||||
#define UHSOMINOR(u, p) ((((u) << 4) & UHSO_UNIT_MASK) | ((p) & UHSO_UNIT_MASK))
|
||||
|
||||
Static void uhso_ifnet_attach(struct uhso_softc *, usbd_interface_handle, int);
|
||||
|
Loading…
Reference in New Issue
Block a user