FreeBSD kernel kern code
tty_compat.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/ioctl_compat.h>
#include <sys/tty.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
Include dependency graph for tty_compat.c:

Go to the source code of this file.

Data Structures

struct  speedtab
 

Macros

#define MAX_SPEED   17
 

Functions

 __FBSDID ("$FreeBSD$")
 
static int ttcompatgetflags (struct tty *tp)
 
static void ttcompatsetflags (struct tty *tp, struct termios *t)
 
static void ttcompatsetlflags (struct tty *tp, struct termios *t)
 
static int ttcompatspeedtab (int speed, struct speedtab *table)
 
 SYSCTL_INT (_debug, OID_AUTO, ttydebug, CTLFLAG_RW, &ttydebug, 0, "")
 
static int ttsetcompat (struct tty *tp, u_long *com, caddr_t data, struct termios *term)
 
int tty_ioctl_compat (struct tty *tp, u_long com, caddr_t data, int fflag, struct thread *td)
 

Variables

static int ttydebug = 0
 
static struct speedtab compatspeeds []
 
static int compatspcodes []
 

Macro Definition Documentation

◆ MAX_SPEED

#define MAX_SPEED   17

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ SYSCTL_INT()

SYSCTL_INT ( _debug  ,
OID_AUTO  ,
ttydebug  ,
CTLFLAG_RW  ,
ttydebug,
,
""   
)

◆ ttcompatgetflags()

static int ttcompatgetflags ( struct tty *  tp)
static

Definition at line 276 of file tty_compat.c.

References flags, printf(), and ttydebug.

Referenced by ttsetcompat(), and tty_ioctl_compat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ttcompatsetflags()

static void ttcompatsetflags ( struct tty *  tp,
struct termios *  t 
)
static

Definition at line 336 of file tty_compat.c.

References flags.

Referenced by ttsetcompat().

Here is the caller graph for this function:

◆ ttcompatsetlflags()

static void ttcompatsetlflags ( struct tty *  tp,
struct termios *  t 
)
static

Definition at line 413 of file tty_compat.c.

References flags.

Referenced by ttsetcompat().

Here is the caller graph for this function:

◆ ttcompatspeedtab()

static int ttcompatspeedtab ( int  speed,
struct speedtab table 
)
static

Definition at line 89 of file tty_compat.c.

References speedtab::sp_code, and speedtab::sp_speed.

Referenced by ttsetcompat(), and tty_ioctl_compat().

Here is the caller graph for this function:

◆ ttsetcompat()

static int ttsetcompat ( struct tty *  tp,
u_long *  com,
caddr_t  data,
struct termios *  term 
)
static

Definition at line 100 of file tty_compat.c.

References compatspcodes, compatspeeds, data, MAX_SPEED, ttcompatgetflags(), ttcompatsetflags(), ttcompatsetlflags(), and ttcompatspeedtab().

Referenced by tty_ioctl_compat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tty_ioctl_compat()

int tty_ioctl_compat ( struct tty *  tp,
u_long  com,
caddr_t  data,
int  fflag,
struct thread *  td 
)

Definition at line 183 of file tty_compat.c.

References compatspeeds, data, printf(), ttcompatgetflags(), ttcompatspeedtab(), ttsetcompat(), tty_ioctl(), and ttydebug.

Referenced by tty_generic_ioctl().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ compatspcodes

int compatspcodes[]
static
Initial value:
= {
0, 50, 75, 110, 134, 150, 200, 300, 600, 1200,
1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200,
}

Definition at line 83 of file tty_compat.c.

Referenced by ttsetcompat().

◆ compatspeeds

struct speedtab compatspeeds[]
static
Initial value:
= {
#define MAX_SPEED
{ 115200, 17 },
{ 57600, 16 },
{ 38400, 15 },
{ 19200, 14 },
{ 9600, 13 },
{ 4800, 12 },
{ 2400, 11 },
{ 1800, 10 },
{ 1200, 9 },
{ 600, 8 },
{ 300, 7 },
{ 200, 6 },
{ 150, 5 },
{ 134, 4 },
{ 110, 3 },
{ 75, 2 },
{ 50, 1 },
{ 0, 0 },
{ -1, -1 },
}

Definition at line 61 of file tty_compat.c.

Referenced by ttsetcompat(), and tty_ioctl_compat().

◆ ttydebug

int ttydebug = 0
static

Definition at line 58 of file tty_compat.c.

Referenced by ttcompatgetflags(), and tty_ioctl_compat().