summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-02-21 20:41:11 +0000
committerphk <phk@FreeBSD.org>2004-02-21 20:41:11 +0000
commitfcf7e634fb12f16e5d5a0b3ee3cfafda001a303c (patch)
treeb4c7c5f55a2681dc99feaf813fae3d32fabd502e /sys/dev
parent32b7c9a433930842533064d829ba214aadf6a67d (diff)
downloadFreeBSD-src-fcf7e634fb12f16e5d5a0b3ee3cfafda001a303c.zip
FreeBSD-src-fcf7e634fb12f16e5d5a0b3ee3cfafda001a303c.tar.gz
Device megapatch 3/6:
Add missing D_TTY flags to various drivers. Complete asserts that dev_t's passed to ttyread(), ttywrite(), ttypoll() and ttykqwrite() have (d_flags & D_TTY) and a struct tty pointer. Make ttyread(), ttywrite(), ttypoll() and ttykqwrite() the default cdevsw methods for D_TTY drivers and remove the explicit initializations in various drivers cdevsw structures.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cx/if_cx.c1
-rw-r--r--sys/dev/cy/cy.c3
-rw-r--r--sys/dev/cy/cy_isa.c3
-rw-r--r--sys/dev/dcons/dcons.c4
-rw-r--r--sys/dev/digi/digi.c2
-rw-r--r--sys/dev/nmdm/nmdm.c1
-rw-r--r--sys/dev/ofw/ofw_console.c4
-rw-r--r--sys/dev/rc/rc.c4
-rw-r--r--sys/dev/rp/rp.c2
-rw-r--r--sys/dev/sab/sab.c4
-rw-r--r--sys/dev/si/si.c3
-rw-r--r--sys/dev/sio/sio.c2
-rw-r--r--sys/dev/syscons/syscons.c3
-rw-r--r--sys/dev/syscons/sysmouse.c2
-rw-r--r--sys/dev/uart/uart_tty.c4
-rw-r--r--sys/dev/usb/ucom.c2
-rw-r--r--sys/dev/zs/zs.c4
17 files changed, 2 insertions, 46 deletions
diff --git a/sys/dev/cx/if_cx.c b/sys/dev/cx/if_cx.c
index 7fb4247..52fc80d 100644
--- a/sys/dev/cx/if_cx.c
+++ b/sys/dev/cx/if_cx.c
@@ -2555,7 +2555,6 @@ static struct cdevsw cx_cdevsw = {
.d_read = cx_read,
.d_write = cx_write,
.d_ioctl = cx_ioctl,
- .d_poll = ttypoll,
.d_name = "cx",
.d_maj = CDEV_MAJOR,
.d_flags = D_TTY,
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index 4351a30..2a715c0 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -388,13 +388,10 @@ static d_ioctl_t sioioctl;
static struct cdevsw sio_cdevsw = {
.d_open = sioopen,
.d_close = sioclose,
- .d_read = ttyread,
.d_write = siowrite,
.d_ioctl = sioioctl,
- .d_poll = ttypoll,
.d_name = driver_name,
.d_flags = D_TTY,
- .d_kqfilter = ttykqfilter,
};
static int comconsole = -1;
diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c
index 4351a30..2a715c0 100644
--- a/sys/dev/cy/cy_isa.c
+++ b/sys/dev/cy/cy_isa.c
@@ -388,13 +388,10 @@ static d_ioctl_t sioioctl;
static struct cdevsw sio_cdevsw = {
.d_open = sioopen,
.d_close = sioclose,
- .d_read = ttyread,
.d_write = siowrite,
.d_ioctl = sioioctl,
- .d_poll = ttypoll,
.d_name = driver_name,
.d_flags = D_TTY,
- .d_kqfilter = ttykqfilter,
};
static int comconsole = -1;
diff --git a/sys/dev/dcons/dcons.c b/sys/dev/dcons/dcons.c
index 04d7549..8e67326 100644
--- a/sys/dev/dcons/dcons.c
+++ b/sys/dev/dcons/dcons.c
@@ -90,11 +90,9 @@ static struct cdevsw dcons_cdevsw = {
#if __FreeBSD_version >= 500104
.d_open = dcons_open,
.d_close = dcons_close,
- .d_read = ttyread,
- .d_write = ttywrite,
.d_ioctl = dcons_ioctl,
- .d_poll = ttypoll,
.d_name = "dcons",
+ .d_flags = D_TTY,
#else
/* open */ dcons_open,
/* close */ dcons_close,
diff --git a/sys/dev/digi/digi.c b/sys/dev/digi/digi.c
index f1bc670..87ebbef 100644
--- a/sys/dev/digi/digi.c
+++ b/sys/dev/digi/digi.c
@@ -147,10 +147,8 @@ static struct cdevsw digi_sw = {
.d_read = digiread,
.d_write = digiwrite,
.d_ioctl = digiioctl,
- .d_poll = ttypoll,
.d_name = driver_name,
.d_flags = D_TTY,
- .d_kqfilter = ttykqfilter
};
static void
diff --git a/sys/dev/nmdm/nmdm.c b/sys/dev/nmdm/nmdm.c
index f3440dd..2762506 100644
--- a/sys/dev/nmdm/nmdm.c
+++ b/sys/dev/nmdm/nmdm.c
@@ -77,7 +77,6 @@ static struct cdevsw nmdm_cdevsw = {
.d_read = nmdmread,
.d_write = nmdmwrite,
.d_ioctl = nmdmioctl,
- .d_poll = ttypoll,
.d_name = "nmdm",
.d_flags = D_TTY | D_PSEUDO,
};
diff --git a/sys/dev/ofw/ofw_console.c b/sys/dev/ofw/ofw_console.c
index a4b5c8f..dd55376 100644
--- a/sys/dev/ofw/ofw_console.c
+++ b/sys/dev/ofw/ofw_console.c
@@ -55,11 +55,9 @@ static d_ioctl_t ofw_dev_ioctl;
static struct cdevsw ofw_cdevsw = {
.d_open = ofw_dev_open,
.d_close = ofw_dev_close,
- .d_read = ttyread,
- .d_write = ttywrite,
.d_ioctl = ofw_dev_ioctl,
- .d_poll = ttypoll,
.d_name = "ofw",
+ .d_flags = D_TTY,
};
static struct tty *ofw_tp = NULL;
diff --git a/sys/dev/rc/rc.c b/sys/dev/rc/rc.c
index f11537c..e519177 100644
--- a/sys/dev/rc/rc.c
+++ b/sys/dev/rc/rc.c
@@ -149,13 +149,9 @@ static d_ioctl_t rcioctl;
static struct cdevsw rc_cdevsw = {
.d_open = rcopen,
.d_close = rcclose,
- .d_read = ttyread,
- .d_write = ttywrite,
.d_ioctl = rcioctl,
- .d_poll = ttypoll,
.d_name = "rc",
.d_flags = D_TTY,
- .d_kqfilter = ttykqfilter,
};
static devclass_t rc_devclass;
diff --git a/sys/dev/rp/rp.c b/sys/dev/rp/rp.c
index 98ae4a7..1088de2 100644
--- a/sys/dev/rp/rp.c
+++ b/sys/dev/rp/rp.c
@@ -574,10 +574,8 @@ static d_ioctl_t rpioctl;
struct cdevsw rp_cdevsw = {
.d_open = rpopen,
.d_close = rpclose,
- .d_read = ttyread,
.d_write = rpwrite,
.d_ioctl = rpioctl,
- .d_poll = ttypoll,
.d_name = "rp",
.d_flags = D_TTY,
};
diff --git a/sys/dev/sab/sab.c b/sys/dev/sab/sab.c
index aea2e16..36b6c1f 100644
--- a/sys/dev/sab/sab.c
+++ b/sys/dev/sab/sab.c
@@ -163,13 +163,9 @@ static int sabttyparam(struct tty *tp, struct termios *t);
static struct cdevsw sabtty_cdevsw = {
.d_open = sabttyopen,
.d_close = sabttyclose,
- .d_read = ttyread,
- .d_write = ttywrite,
.d_ioctl = sabttyioctl,
- .d_poll = ttypoll,
.d_name = "sabtty",
.d_flags = D_TTY,
- .d_kqfilter = ttykqfilter,
};
static device_method_t sab_methods[] = {
diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c
index a3fd213..fa0d9db 100644
--- a/sys/dev/si/si.c
+++ b/sys/dev/si/si.c
@@ -120,13 +120,10 @@ static d_ioctl_t siioctl;
static struct cdevsw si_cdevsw = {
.d_open = siopen,
.d_close = siclose,
- .d_read = ttyread,
.d_write = siwrite,
.d_ioctl = siioctl,
- .d_poll = ttypoll,
.d_name = "si",
.d_flags = D_TTY,
- .d_kqfilter = ttykqfilter,
};
static int si_Nports;
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index 571265d..42c78b6 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -328,10 +328,8 @@ static struct cdevsw sio_cdevsw = {
.d_read = sioread,
.d_write = siowrite,
.d_ioctl = sioioctl,
- .d_poll = ttypoll,
.d_name = sio_driver_name,
.d_flags = D_TTY,
- .d_kqfilter = ttykqfilter,
};
int comconsole = -1;
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index 88c6ade..f05de84 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -221,14 +221,11 @@ static struct cdevsw sc_cdevsw = {
.d_open = scopen,
.d_close = scclose,
.d_read = scread,
- .d_write = ttywrite,
.d_ioctl = scioctl,
- .d_poll = ttypoll,
.d_mmap = scmmap,
.d_name = "sc",
.d_maj = CDEV_MAJOR,
.d_flags = D_TTY,
- .d_kqfilter = ttykqfilter
};
int
diff --git a/sys/dev/syscons/sysmouse.c b/sys/dev/syscons/sysmouse.c
index a7cff80..08847a0 100644
--- a/sys/dev/syscons/sysmouse.c
+++ b/sys/dev/syscons/sysmouse.c
@@ -51,9 +51,7 @@ static d_ioctl_t smioctl;
static struct cdevsw sm_cdevsw = {
.d_open = smopen,
.d_close = smclose,
- .d_read = ttyread,
.d_ioctl = smioctl,
- .d_poll = ttypoll,
.d_name = "sysmouse",
.d_flags = D_TTY,
};
diff --git a/sys/dev/uart/uart_tty.c b/sys/dev/uart/uart_tty.c
index 6724ba7..66ce716 100644
--- a/sys/dev/uart/uart_tty.c
+++ b/sys/dev/uart/uart_tty.c
@@ -69,13 +69,9 @@ static d_ioctl_t uart_tty_ioctl;
static struct cdevsw uart_cdevsw = {
.d_open = uart_tty_open,
.d_close = uart_tty_close,
- .d_read = ttyread,
- .d_write = ttywrite,
.d_ioctl = uart_tty_ioctl,
- .d_poll = ttypoll,
.d_name = uart_driver_name,
.d_flags = D_TTY,
- .d_kqfilter = ttykqfilter,
};
static struct uart_devinfo uart_console;
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c
index 9298d08..ad0a3d1 100644
--- a/sys/dev/usb/ucom.c
+++ b/sys/dev/usb/ucom.c
@@ -133,13 +133,11 @@ static struct cdevsw ucom_cdevsw = {
.d_read = ucomread,
.d_write = ucomwrite,
.d_ioctl = ucomioctl,
- .d_poll = ttypoll,
.d_name = "ucom",
.d_flags = D_TTY,
#if __FreeBSD_version < 500014
.d_bmaj = -1,
#endif
- .d_kqfilter = ttykqfilter,
};
Static void ucom_cleanup(struct ucom_softc *);
diff --git a/sys/dev/zs/zs.c b/sys/dev/zs/zs.c
index a6e398f..c3895a6 100644
--- a/sys/dev/zs/zs.c
+++ b/sys/dev/zs/zs.c
@@ -154,13 +154,9 @@ static int zsttyparam(struct tty *tp, struct termios *t);
static struct cdevsw zstty_cdevsw = {
.d_open = zsttyopen,
.d_close = zsttyclose,
- .d_read = ttyread,
- .d_write = ttywrite,
.d_ioctl = zsttyioctl,
- .d_poll = ttypoll,
.d_name = "zstty",
.d_flags = D_TTY,
- .d_kqfilter = ttykqfilter,
};
static struct zstty_softc *zstty_cons;
OpenPOWER on IntegriCloud