summaryrefslogtreecommitdiffstats
path: root/sys/i4b
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-06-01 08:46:56 +0000
committerphk <phk@FreeBSD.org>1999-06-01 08:46:56 +0000
commita65111acb3160be5e68432a6578b18275bdd4de8 (patch)
treea4c4d0067d80bac162a36ce07306fa156bc4dacb /sys/i4b
parent4b1ce7da0de7c8d73b6062b28913a9383bf9adff (diff)
downloadFreeBSD-src-a65111acb3160be5e68432a6578b18275bdd4de8.zip
FreeBSD-src-a65111acb3160be5e68432a6578b18275bdd4de8.tar.gz
devsw and cdevsw_add() changes for i4b.
Reviewed by: hm
Diffstat (limited to 'sys/i4b')
-rw-r--r--sys/i4b/driver/i4b_ctl.c39
-rw-r--r--sys/i4b/driver/i4b_rbch.c35
-rw-r--r--sys/i4b/driver/i4b_tel.c35
-rw-r--r--sys/i4b/driver/i4b_trace.c36
-rw-r--r--sys/i4b/layer4/i4b_i4bdrv.c40
-rw-r--r--sys/i4b/tina-dd/i4b_tina_dd.c39
6 files changed, 147 insertions, 77 deletions
diff --git a/sys/i4b/driver/i4b_ctl.c b/sys/i4b/driver/i4b_ctl.c
index 37a18a9..aac6f50 100644
--- a/sys/i4b/driver/i4b_ctl.c
+++ b/sys/i4b/driver/i4b_ctl.c
@@ -27,7 +27,7 @@
* i4b_ctl.c - i4b system control port driver
* ------------------------------------------
*
- * $Id: i4b_ctl.c,v 1.20 1999/04/26 10:16:54 hm Exp $
+ * $Id: i4b_ctl.c,v 1.4 1999/05/20 10:08:56 hm Exp $
*
* last edit-date: [Mon Apr 26 11:16:28 1999]
*
@@ -93,17 +93,33 @@ static d_ioctl_t i4bctlioctl;
#ifdef OS_USES_POLL
static d_poll_t i4bctlpoll;
+#define POLLFIELD i4bctlpoll
+#else
+#define POLLFIELD noselect
#endif
#define CDEV_MAJOR 55
-static struct cdevsw i4bctl_cdevsw =
- { i4bctlopen, i4bctlclose, noread, nowrite,
- i4bctlioctl, nostop, nullreset, nodevtotty,
-#ifdef OS_USES_POLL
- i4bctlpoll, nommap, NULL, "i4bctl", NULL, -1 };
-#else
- noselect, nommap, NULL, "i4bctl", NULL, -1 };
-#endif
+static struct cdevsw i4bctl_cdevsw = {
+ /* open */ i4bctlopen,
+ /* close */ i4bctlclose,
+ /* read */ noread,
+ /* write */ nowrite,
+ /* ioctl */ i4bctlioctl,
+ /* stop */ nostop,
+ /* reset */ noreset,
+ /* devtotty */ nodevtotty,
+ /* poll */ POLLFIELD,
+ /* mmap */ nommap,
+ /* strategy */ nostrategy,
+ /* name */ "i4bctl",
+ /* parms */ noparms,
+ /* maj */ CDEV_MAJOR,
+ /* dump */ nodump,
+ /* psize */ nopsize,
+ /* flags */ 0,
+ /* maxio */ 0,
+ /* bmaj */ -1
+};
static void i4bctlattach(void *);
PSEUDO_SET(i4bctlattach, i4b_i4bctldrv);
@@ -134,11 +150,8 @@ int i4bctlioctl __P((dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
static void
i4bctlinit(void *unused)
{
- dev_t dev;
- dev = makedev(CDEV_MAJOR, 0);
-
- cdevsw_add(&dev, &i4bctl_cdevsw, NULL);
+ cdevsw_add(&i4bctl_cdevsw);
}
SYSINIT(i4bctldev, SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR, &i4bctlinit, NULL);
diff --git a/sys/i4b/driver/i4b_rbch.c b/sys/i4b/driver/i4b_rbch.c
index 42a9f0c..e4a5e61 100644
--- a/sys/i4b/driver/i4b_rbch.c
+++ b/sys/i4b/driver/i4b_rbch.c
@@ -27,7 +27,7 @@
* i4b_rbch.c - device driver for raw B channel data
* ---------------------------------------------------
*
- * $Id: i4b_rbch.c,v 1.31 1999/05/06 13:07:59 hm Exp $
+ * $Id: i4b_rbch.c,v 1.3 1999/05/20 10:09:02 hm Exp $
*
* last edit-date: [Thu May 6 13:40:22 1999]
*
@@ -168,19 +168,33 @@ PDEVSTATIC d_ioctl_t i4brbchioctl;
#ifdef OS_USES_POLL
PDEVSTATIC d_poll_t i4brbchpoll;
+#define POLLFIELD i4brbchpoll
#else
PDEVSTATIC d_select_t i4brbchselect;
+#define POLLFIELD i4brbchselect
#endif
#define CDEV_MAJOR 57
static struct cdevsw i4brbch_cdevsw = {
- i4brbchopen, i4brbchclose, i4brbchread, i4brbchwrite,
- i4brbchioctl, nostop, noreset, nodevtotty,
-#ifdef OS_USES_POLL
- i4brbchpoll, nommap, NULL, "i4brbch", NULL, -1
-#else
- i4brbchselect, nommap, NULL, "i4brbch", NULL, -1
-#endif
+ /* open */ i4brbchopen,
+ /* close */ i4brbchclose,
+ /* read */ i4brbchread,
+ /* write */ i4brbchwrite,
+ /* ioctl */ i4brbchioctl,
+ /* stop */ nostop,
+ /* reset */ noreset,
+ /* devtotty */ nodevtotty,
+ /* poll */ POLLFIELD,
+ /* mmap */ nommap,
+ /* strategy */ nostrategy,
+ /* name */ "i4brbch",
+ /* parms */ noparms,
+ /* maj */ CDEV_MAJOR,
+ /* dump */ nodump,
+ /* psize */ nopsize,
+ /* flags */ 0,
+ /* maxio */ 0,
+ /* bmaj */ -1
};
static void i4brbchattach(void *);
@@ -196,11 +210,8 @@ PSEUDO_SET(i4brbchattach, i4b_rbch);
static void
i4brbchinit(void *unused)
{
- dev_t dev;
-
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev, &i4brbch_cdevsw, NULL);
+ cdevsw_add(&i4brbch_cdevsw);
}
SYSINIT(i4brbchdev, SI_SUB_DRIVERS,
diff --git a/sys/i4b/driver/i4b_tel.c b/sys/i4b/driver/i4b_tel.c
index a548338..d681f3b 100644
--- a/sys/i4b/driver/i4b_tel.c
+++ b/sys/i4b/driver/i4b_tel.c
@@ -27,7 +27,7 @@
* i4b_tel.c - device driver for ISDN telephony
* --------------------------------------------
*
- * $Id: i4b_tel.c,v 1.40 1999/05/06 08:24:45 hm Exp $
+ * $Id: i4b_tel.c,v 1.3 1999/05/20 10:09:03 hm Exp $
*
* last edit-date: [Thu May 6 09:30:13 1999]
*
@@ -185,19 +185,33 @@ PDEVSTATIC d_read_t i4btelwrite;
PDEVSTATIC d_ioctl_t i4btelioctl;
#ifdef OS_USES_POLL
PDEVSTATIC d_poll_t i4btelpoll;
+#define POLLFIELD i4btelpoll
#else
PDEVSTATIC d_select_t i4btelsel;
+#define POLLFIELD i4btelsel
#endif
#define CDEV_MAJOR 56
static struct cdevsw i4btel_cdevsw = {
- i4btelopen, i4btelclose, i4btelread, i4btelwrite,
- i4btelioctl, nostop, noreset, nodevtotty,
-#ifdef OS_USES_POLL
- i4btelpoll, nommap, NULL, "i4btel", NULL, -1
-#else
- i4btelsel, nommap, NULL, "i4btel", NULL, -1
-#endif
+ /* open */ i4btelopen,
+ /* close */ i4btelclose,
+ /* read */ i4btelread,
+ /* write */ i4btelwrite,
+ /* ioctl */ i4btelioctl,
+ /* stop */ nostop,
+ /* reset */ noreset,
+ /* devtotty */ nodevtotty,
+ /* poll */ POLLFIELD,
+ /* mmap */ nommap,
+ /* strategy */ nostrategy,
+ /* name */ "i4btel",
+ /* parms */ noparms,
+ /* maj */ CDEV_MAJOR,
+ /* dump */ nodump,
+ /* psize */ nopsize,
+ /* flags */ 0,
+ /* maxio */ 0,
+ /* bmaj */ -1
};
PDEVSTATIC void i4btelinit(void *unused);
@@ -215,11 +229,8 @@ PSEUDO_SET(i4btelattach, i4b_tel);
PDEVSTATIC void
i4btelinit(void *unused)
{
- dev_t dev;
- dev = makedev(CDEV_MAJOR, 0);
-
- cdevsw_add(&dev, &i4btel_cdevsw, NULL);
+ cdevsw_add(&i4btel_cdevsw);
}
SYSINIT(i4bteldev, SI_SUB_DRIVERS,
diff --git a/sys/i4b/driver/i4b_trace.c b/sys/i4b/driver/i4b_trace.c
index fe94d14..b43ce24 100644
--- a/sys/i4b/driver/i4b_trace.c
+++ b/sys/i4b/driver/i4b_trace.c
@@ -27,7 +27,7 @@
* i4btrc - device driver for trace data read device
* ---------------------------------------------------
*
- * $Id: i4b_trace.c,v 1.18 1999/04/28 08:23:21 hm Exp $
+ * $Id: i4b_trace.c,v 1.3 1999/05/20 10:09:05 hm Exp $
*
* last edit-date: [Wed Apr 28 10:21:09 1999]
*
@@ -127,17 +127,32 @@ static d_read_t i4btrcread;
static d_ioctl_t i4btrcioctl;
#ifdef OS_USES_POLL
static d_poll_t i4btrcpoll;
+#define POLLFIELD i4btrcpoll
+#else
+#define POLLFIELD noselect
#endif
#define CDEV_MAJOR 59
static struct cdevsw i4btrc_cdevsw = {
- i4btrcopen, i4btrcclose, i4btrcread, nowrite,
- i4btrcioctl, nostop, noreset, nodevtotty,
-#ifdef OS_USES_POLL
- i4btrcpoll, nommap, NULL, "i4btrc", NULL, -1
-#else
- noselect, nommap, NULL, "i4btrc", NULL, -1
-#endif
+ /* open */ i4btrcopen,
+ /* close */ i4btrcclose,
+ /* read */ i4btrcread,
+ /* write */ nowrite,
+ /* ioctl */ i4btrcioctl,
+ /* stop */ nostop,
+ /* reset */ noreset,
+ /* devtotty */ nodevtotty,
+ /* poll */ POLLFIELD,
+ /* mmap */ nommap,
+ /* strategy */ nostrategy,
+ /* name */ "i4btrc",
+ /* parms */ noparms,
+ /* maj */ CDEV_MAJOR,
+ /* dump */ nodump,
+ /* psize */ nopsize,
+ /* flags */ 0,
+ /* maxio */ 0,
+ /* bmaj */ -1
};
/*---------------------------------------------------------------------------*
@@ -146,11 +161,8 @@ static struct cdevsw i4btrc_cdevsw = {
static
void i4btrcinit(void *unused)
{
- dev_t dev;
-
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev, &i4btrc_cdevsw, NULL);
+ cdevsw_add(&i4btrc_cdevsw);
}
SYSINIT(i4btrcdev, SI_SUB_DRIVERS,
diff --git a/sys/i4b/layer4/i4b_i4bdrv.c b/sys/i4b/layer4/i4b_i4bdrv.c
index a28dd67..4ea26e7 100644
--- a/sys/i4b/layer4/i4b_i4bdrv.c
+++ b/sys/i4b/layer4/i4b_i4bdrv.c
@@ -27,7 +27,7 @@
* i4b_i4bdrv.c - i4b userland interface driver
* --------------------------------------------
*
- * $Id: i4b_i4bdrv.c,v 1.44 1999/05/06 08:24:45 hm Exp $
+ * $Id: i4b_i4bdrv.c,v 1.5 1999/05/20 10:11:20 hm Exp $
*
* last edit-date: [Thu May 6 10:05:01 1999]
*
@@ -140,19 +140,34 @@ PDEVSTATIC d_ioctl_t i4bioctl;
#ifdef OS_USES_POLL
PDEVSTATIC d_poll_t i4bpoll;
+#define POLLFIELD i4bpoll
#else
PDEVSTATIC d_select_t i4bselect;
+#define POLLFIELD i4bselect
#endif
#define CDEV_MAJOR 60
-static struct cdevsw i4b_cdevsw =
- { i4bopen, i4bclose, i4bread, nowrite,
- i4bioctl, nostop, nullreset, nodevtotty,
-#ifdef OS_USES_POLL
- i4bpoll, nommap, NULL, "i4b", NULL, -1 };
-#else
- i4bselect, nommap, NULL, "i4b", NULL, -1 };
-#endif
+static struct cdevsw i4b_cdevsw = {
+ /* open */ i4bopen,
+ /* close */ i4bclose,
+ /* read */ i4bread,
+ /* write */ nowrite,
+ /* ioctl */ i4bioctl,
+ /* stop */ nostop,
+ /* reset */ noreset,
+ /* devtotty */ nodevtotty,
+ /* poll */ POLLFIELD,
+ /* mmap */ nommap,
+ /* strategy */ nostrategy,
+ /* name */ "i4b",
+ /* parms */ noparms,
+ /* maj */ CDEV_MAJOR,
+ /* dump */ nodump,
+ /* psize */ nopsize,
+ /* flags */ 0,
+ /* maxio */ 0,
+ /* bmaj */ -1
+};
PDEVSTATIC void i4battach(void *);
PSEUDO_SET(i4battach, i4b_i4bdrv);
@@ -952,13 +967,8 @@ static int i4b_devsw_installed = 0;
static void
i4b_drvinit(void *unused)
{
- dev_t dev;
- if( ! i4b_devsw_installed ) {
- dev = makedev(CDEV_MAJOR,0);
- cdevsw_add(&dev,&i4b_cdevsw,NULL);
- i4b_devsw_installed = 1;
- }
+ cdevsw_add(&i4b_cdevsw);
}
SYSINIT(i4bdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,i4b_drvinit,NULL)
diff --git a/sys/i4b/tina-dd/i4b_tina_dd.c b/sys/i4b/tina-dd/i4b_tina_dd.c
index e210d00..aba5002 100644
--- a/sys/i4b/tina-dd/i4b_tina_dd.c
+++ b/sys/i4b/tina-dd/i4b_tina_dd.c
@@ -28,7 +28,7 @@
* i4b_tina_dd.c - i4b Stollman Tina-dd control device driver
* ----------------------------------------------------------
*
- * $Id: i4b_tina_dd.c,v 1.1 1998/12/27 21:46:53 phk Exp $
+ * $Id: i4b_tina_dd.c,v 1.2 1999/01/12 11:05:03 eivind Exp $
*
* last edit-date: [Sat Dec 5 18:41:38 1998]
*
@@ -90,17 +90,33 @@ static d_close_t tinaclose;
static d_ioctl_t tinaioctl;
#if defined(__FreeBSD__) && __FreeBSD__ >= 3
static d_poll_t tinapoll;
+#define POLLFIELD tinapoll
+#else
+#define POLLFIELD noselect
#endif
#define CDEV_MAJOR 54
-static struct cdevsw tina_cdevsw =
- { tinaopen, tinaclose, noread, nowrite,
- tinaioctl, nostop, nullreset, nodevtotty,
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
- tinapoll, nommap, NULL, "tina", NULL, -1 };
-#else
- noselect, nommap, NULL, "tina", NULL, -1 };
-#endif
+static struct cdevsw tina_cdevsw = {
+ /* open */ tinaopen,
+ /* close */ tinaclose,
+ /* read */ noread,
+ /* write */ nowrite,
+ /* ioctl */ tinaioctl,
+ /* stop */ nostop,
+ /* reset */ noreset,
+ /* devtotty */ nodevtotty,
+ /* poll */ POLLFIELD,
+ /* mmap */ nommap,
+ /* strategy */ nostrategy,
+ /* name */ "tina",
+ /* parms */ noparms,
+ /* maj */ CDEV_MAJOR,
+ /* dump */ nodump,
+ /* psize */ nopsize,
+ /* flags */ 0,
+ /* maxio */ 0,
+ /* bmaj */ -1
+};
static void setupaddr(unsigned short iobase, unsigned int addr);
static void readblock(unsigned short iobase, unsigned int addr,
@@ -185,11 +201,8 @@ tinaintr(int unit)
static void
tinainit(void *unused)
{
- dev_t dev;
-
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev, &tina_cdevsw, NULL);
+ cdevsw_add(&tina_cdevsw);
}
SYSINIT(tinadev, SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR, &tinainit, NULL);
OpenPOWER on IntegriCloud