Define the tty methods as typedefs.
Change the return type for t_break to void. Add t_ioctl (more about this later).
This commit is contained in:
parent
e23137428c
commit
309dbc34d2
@ -79,7 +79,7 @@ static d_write_t digiwrite;
|
||||
static d_ioctl_t digiioctl;
|
||||
|
||||
static void digistop(struct tty *tp, int rw);
|
||||
static int digibreak(struct tty *tp, int brk);
|
||||
static void digibreak(struct tty *tp, int brk);
|
||||
static int digimodem(struct tty *tp, int sigon, int sigoff);
|
||||
static void digi_poll(void *ptr);
|
||||
static void digi_freemoduledata(struct digi_softc *);
|
||||
@ -1308,7 +1308,7 @@ digiioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *t
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
static void
|
||||
digibreak(struct tty *tp, int brk)
|
||||
{
|
||||
int mynor;
|
||||
@ -1332,7 +1332,6 @@ digibreak(struct tty *tp, int brk)
|
||||
*/
|
||||
if (brk)
|
||||
fepcmd_w(port, SENDBREAK, 400, 10);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -124,7 +124,7 @@ struct rc_softc {
|
||||
};
|
||||
|
||||
/* Static prototypes */
|
||||
static int rc_break(struct tty *, int);
|
||||
static void rc_break(struct tty *, int);
|
||||
static void rc_release_resources(device_t dev);
|
||||
static void rc_intr(void *);
|
||||
static void rc_hwreset(struct rc_softc *, unsigned int);
|
||||
@ -1287,7 +1287,7 @@ rc_modem(struct tty *tp, int biton, int bitoff)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
static void
|
||||
rc_break(struct tty *tp, int brk)
|
||||
{
|
||||
struct rc_chans *rc;
|
||||
@ -1298,7 +1298,6 @@ rc_break(struct tty *tp, int brk)
|
||||
rc->rc_pendcmd = CD180_C_SBRK;
|
||||
else
|
||||
rc->rc_pendcmd = CD180_C_EBRK;
|
||||
return (0);
|
||||
}
|
||||
|
||||
#define ERR(s) do { \
|
||||
|
@ -283,7 +283,7 @@ struct com_s {
|
||||
static int espattach(struct com_s *com, Port_t esp_port);
|
||||
#endif
|
||||
|
||||
static int combreak(struct tty *tp, int sig);
|
||||
static void combreak(struct tty *tp, int sig);
|
||||
static timeout_t siobusycheck;
|
||||
static u_int siodivisor(u_long rclk, speed_t speed);
|
||||
static timeout_t siodtrwakeup;
|
||||
@ -2211,7 +2211,7 @@ siopoll(void *dummy)
|
||||
goto repeat;
|
||||
}
|
||||
|
||||
static int
|
||||
static void
|
||||
combreak(tp, sig)
|
||||
struct tty *tp;
|
||||
int sig;
|
||||
@ -2224,7 +2224,6 @@ combreak(tp, sig)
|
||||
sio_setreg(com, com_cfcr, com->cfcr_image |= CFCR_SBREAK);
|
||||
else
|
||||
sio_setreg(com, com_cfcr, com->cfcr_image &= ~CFCR_SBREAK);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -251,14 +251,13 @@ uart_tty_modem(struct tty *tp, int biton, int bitoff)
|
||||
return (sc->sc_hwsig);
|
||||
}
|
||||
|
||||
static int
|
||||
static void
|
||||
uart_tty_break(struct tty *tp, int state)
|
||||
{
|
||||
struct uart_softc *sc;
|
||||
|
||||
sc = tp->t_dev->si_drv1;
|
||||
UART_IOCTL(sc, UART_IOCTL_BREAK, state);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -65,6 +65,14 @@ struct clist {
|
||||
char *c_cl; /* Pointer to the last cblock. */
|
||||
};
|
||||
|
||||
typedef void t_oproc_t(struct tty *);
|
||||
typedef void t_stop_t(struct tty *, int);
|
||||
typedef int t_param_t(struct tty *, struct termios *);
|
||||
typedef int t_modem_t(struct tty *, int, int);
|
||||
typedef void t_break_t(struct tty *, int);
|
||||
typedef int t_ioctl_t(struct tty *, u_long cmd, void * data,
|
||||
int fflag, struct thread *td);
|
||||
|
||||
/*
|
||||
* Per-tty structure.
|
||||
*
|
||||
@ -91,17 +99,7 @@ struct tty {
|
||||
struct selinfo t_wsel; /* Tty write select. */
|
||||
struct termios t_termios; /* Termios state. */
|
||||
struct winsize t_winsize; /* Window size. */
|
||||
/* Start output. */
|
||||
void (*t_oproc)(struct tty *);
|
||||
/* Stop output. */
|
||||
void (*t_stop)(struct tty *, int);
|
||||
/* Set hardware state. */
|
||||
int (*t_param)(struct tty *, struct termios *);
|
||||
/* Set modem state */
|
||||
int (*t_modem)(struct tty *, int, int);
|
||||
/* Set break state */
|
||||
int (*t_break)(struct tty *, int);
|
||||
void *t_sc; /* XXX: net/if_sl.c:sl_softc. */
|
||||
void *t_sc; /* driver private softc pointer. */
|
||||
int t_column; /* Tty output column. */
|
||||
int t_rocount, t_rocol; /* Tty. */
|
||||
int t_ififosize; /* Total size of upstream fifos. */
|
||||
@ -117,6 +115,14 @@ struct tty {
|
||||
struct mtx t_mtx;
|
||||
int t_refcnt;
|
||||
int t_hotchar; /* linedisc preferred hot char */
|
||||
|
||||
/* Driver supplied methods */
|
||||
t_oproc_t *t_oproc; /* Start output. */
|
||||
t_stop_t *t_stop; /* Stop output. */
|
||||
t_param_t *t_param; /* Set parameters. */
|
||||
t_modem_t *t_modem; /* Set modem state (optional). */
|
||||
t_break_t *t_break; /* Set break state (optional). */
|
||||
t_ioctl_t *t_ioctl; /* Set ioctl handling (optional). */
|
||||
};
|
||||
|
||||
#define t_cc t_termios.c_cc
|
||||
|
Loading…
Reference in New Issue
Block a user