Linux Kernel
3.7.1
|
#include <linux/types.h>
#include <linux/wait.h>
#include <linux/semaphore.h>
#include <linux/tty.h>
#include "digirp.h"
Go to the source code of this file.
Data Structures | |
struct | un_struct |
struct | ch_struct |
struct | nd_struct |
Macros | |
#define | CHAN_MAX 64 /* Max # ports per server */ |
#define | SEQ_MAX 128 /* Max # transmit sequences (2^n) */ |
#define | SEQ_MASK (SEQ_MAX-1) /* Sequence buffer modulus mask */ |
#define | TBUF_MAX 4096 /* Size of transmit buffer (2^n) */ |
#define | RBUF_MAX 4096 /* Size of receive buffer (2^n) */ |
#define | TBUF_MASK (TBUF_MAX-1) /* Transmit buffer modulus mask */ |
#define | RBUF_MASK (RBUF_MAX-1) /* Receive buffer modulus mask */ |
#define | TBUF_LOW 1000 /* Transmit low water mark */ |
#define | UIO_BASE 1000 /* Base for write operations */ |
#define | UIO_MIN 2000 /* Minimum size application buffer */ |
#define | UIO_MAX 8100 /* Unix I/O buffer size */ |
#define | MON_MAX 65536 /* Monitor buffer size (2^n) */ |
#define | MON_MASK (MON_MAX-1) /* Monitor wrap mask */ |
#define | DPA_MAX 65536 /* DPA buffer size (2^n) */ |
#define | DPA_MASK (DPA_MAX-1) /* DPA wrap mask */ |
#define | DPA_HIGH_WATER |
#define | IDLE_MAX (20 * HZ) /* Max TCP link idle time */ |
#define | MAX_DESC_LEN |
#define | WRITEBUFLEN ((4096) + 4) /* 4 extra for alignment play space */ |
#define | VPDSIZE 512 |
#define | PORT_NUM(dev) ((dev) & 0x3f) |
#define | OPEN_CATEGORY(dev) ((((dev) & 0x80) & 0x40)) |
#define | IS_PRINT(dev) (((dev) & 0xff) >= 0x80) |
#define | OPEN_WAIT_AVAIL(cat) (((cat) & 0x40) == 0x000) |
#define | OPEN_WAIT_CARRIER(cat) (((cat) & 0x40) == 0x000) |
#define | OPEN_FORCES_CARRIER(cat) (((cat) & 0x40) != 0x000) |
#define | DM_DTR 0x01 |
#define | DM_RTS 0x02 |
#define | DM_RTS_TOGGLE 0x04 |
#define | DM_OUT1 0x04 |
#define | DM_OUT2 0x08 |
#define | DM_CTS 0x10 |
#define | DM_DSR 0x20 |
#define | DM_RI 0x40 |
#define | DM_CD 0x80 /* This is the DCD flag */ |
#define | EV_OPU 0x0001 /* Ouput paused by client */ |
#define | EV_OPS 0x0002 /* Output paused by XOFF */ |
#define | EV_OPX 0x0004 /* Output paused by XXOFF */ |
#define | EV_OPH 0x0008 /* Output paused by MFLOW */ |
#define | EV_IPU 0x0010 /* Input paused by client */ |
#define | EV_IPS 0x0020 /* Input paused by hi/low water */ |
#define | EV_TXB 0x0040 /* Transmit break pending */ |
#define | EV_TXI 0x0080 /* Transmit immediate pending */ |
#define | EV_TXF 0x0100 /* Transmit flow control pending */ |
#define | EV_RXB 0x0200 /* Break received */ |
#define | CF_CS5 0x0000 /* 5 bit characters */ |
#define | CF_CS6 0x0010 /* 6 bit characters */ |
#define | CF_CS7 0x0020 /* 7 bit characters */ |
#define | CF_CS8 0x0030 /* 8 bit characters */ |
#define | CF_CSIZE 0x0030 /* Character size */ |
#define | CF_CSTOPB 0x0040 /* Two stop bits */ |
#define | CF_CREAD 0x0080 /* Enable receiver */ |
#define | CF_PARENB 0x0100 /* Enable parity */ |
#define | CF_PARODD 0x0200 /* Odd parity */ |
#define | CF_HUPCL 0x0400 /* Drop DTR on close */ |
#define | XF_XPAR 0x0001 /* Enable Mark/Space Parity */ |
#define | XF_XMODEM 0x0002 /* Enable in-band modem signalling */ |
#define | XF_XCASE 0x0004 /* Convert special characters */ |
#define | XF_XEDATA 0x0008 /* Error data in stream */ |
#define | XF_XTOSS 0x0010 /* Toss IXANY characters */ |
#define | XF_XIXON 0x0020 /* xxon/xxoff enable */ |
#define | IF_IGNBRK 0x0001 /* Ignore input break */ |
#define | IF_BRKINT 0x0002 /* Break interrupt */ |
#define | IF_IGNPAR 0x0004 /* Ignore error characters */ |
#define | IF_PARMRK 0x0008 /* Error chars marked with 0xff */ |
#define | IF_INPCK 0x0010 /* Input parity checking enabled */ |
#define | IF_ISTRIP 0x0020 /* Input chars masked with 0x7F */ |
#define | IF_IXON 0x0400 /* Output software flow control */ |
#define | IF_IXANY 0x0800 /* Restart output on any char */ |
#define | IF_IXOFF 0x1000 /* Input software flow control */ |
#define | IF_DOSMODE 0x8000 /* 16450-compatible errors */ |
#define | OF_OLCUC 0x0002 /* Map lower to upper case */ |
#define | OF_ONLCR 0x0004 /* Map NL to CR-NL */ |
#define | OF_OCRNL 0x0008 /* Map CR to NL */ |
#define | OF_ONOCR 0x0010 /* No CR output at column 0 */ |
#define | OF_ONLRET 0x0020 /* Assume NL does NL/CR */ |
#define | OF_TAB3 0x1800 /* Tabs expand to 8 spaces */ |
#define | OF_TABDLY 0x1800 /* Tab delay */ |
#define | UN_EXCL 0x00010000 /* Exclusive open */ |
#define | UN_STICKY 0x00020000 /* TTY Settings are now sticky */ |
#define | UN_BUSY 0x00040000 /* Some work this channel */ |
#define | UN_PWAIT 0x00080000 /* Printer waiting for terminal */ |
#define | UN_TIME 0x00100000 /* Waiting on time */ |
#define | UN_EMPTY 0x00200000 /* Waiting output queue empty */ |
#define | UN_LOW 0x00400000 /* Waiting output low water */ |
#define | UN_DIGI_MASK 0x00FF0000 /* Waiting output low water */ |
#define | UN_HUP_NOTIFY |
#define | UN_FOURPORT 0x0002 /* Set OU1, OUT2 per AST Fourport settings */ |
#define | UN_SAK 0x0004 /* Secure Attention Key (Orange book) */ |
#define | UN_SPLIT_TERMIOS 0x0008 /* Separate termios for dialin/callout */ |
#define | UN_SPD_MASK 0x0030 |
#define | UN_SPD_HI 0x0010 /* Use 56000 instead of 38400 bps */ |
#define | UN_SPD_VHI 0x0020 /* Use 115200 instead of 38400 bps */ |
#define | UN_SPD_CUST 0x0030 /* Use user-specified divisor */ |
#define | UN_SKIP_TEST 0x0040 /* Skip UART test during autoconfiguration */ |
#define | UN_AUTO_IRQ 0x0080 /* Do automatic IRQ during autoconfiguration */ |
#define | UN_SESSION_LOCKOUT 0x0100 /* Lock out cua opens based on session */ |
#define | UN_PGRP_LOCKOUT 0x0200 /* Lock out cua opens based on pgrp */ |
#define | UN_CALLOUT_NOHUP 0x0400 /* Don't do hangups for cua device */ |
#define | UN_FLAGS 0x0FFF /* Possible legal async flags */ |
#define | UN_USR_MASK |
#define | UN_INITIALIZED 0x80000000 /* Serial port was initialized */ |
#define | UN_CALLOUT_ACTIVE 0x40000000 /* Call out device is active */ |
#define | UN_NORMAL_ACTIVE 0x20000000 /* Normal device is active */ |
#define | UN_BOOT_AUTOCONF 0x10000000 /* Autoconfigure port on bootup */ |
#define | UN_CLOSING 0x08000000 /* Serial port is closing */ |
#define | UN_CTS_FLOW 0x04000000 /* Do CTS flow control */ |
#define | UN_CHECK_CD 0x02000000 /* i.e., CLOCAL */ |
#define | UN_SHARE_IRQ 0x01000000 /* for multifunction cards */ |
#define | CH_HANGUP 0x00002 /* Server port ready to close */ |
#define | CH_VIRT_CD 0x00004 /* Carrier was virtually present */ |
#define | CH_PHYS_CD 0x00008 /* Carrier was physically present */ |
#define | CH_CLOCAL 0x00010 /* CLOCAL set in cflags */ |
#define | CH_BAUD0 0x00020 /* Baud rate zero hangup */ |
#define | CH_FAST_READ 0x00040 /* Fast reads are enabled */ |
#define | CH_FAST_WRITE 0x00080 /* Fast writes are enabled */ |
#define | CH_PRON 0x00100 /* Printer on string active */ |
#define | CH_RX_FLUSH 0x00200 /* Flushing receive data */ |
#define | CH_LOW 0x00400 /* Thread waiting for LOW water */ |
#define | CH_EMPTY 0x00800 /* Thread waiting for EMPTY */ |
#define | CH_DRAIN 0x01000 /* Close is waiting to drain */ |
#define | CH_INPUT 0x02000 /* Thread waiting for INPUT */ |
#define | CH_RXSTOP 0x04000 /* Stop output to ldisc */ |
#define | CH_PARAM 0x08000 /* A parameter was updated */ |
#define | CH_WAITING_SYNC |
#define | CH_PORT_GONE 0x20000 /* Port has disappeared */ |
#define | CH_TX_BREAK |
#define | OTYPE_IMMEDIATE 0 /* Immediate Open */ |
#define | OTYPE_PERSISTENT 1 /* Persistent Open */ |
#define | OTYPE_INCOMING 2 /* Incoming Open */ |
#define | RR_SEQUENCE 0x0001 /* Get server RLAST, TIN */ |
#define | RR_STATUS 0x0002 /* Get server MINT, EINT */ |
#define | RR_BUFFER 0x0004 /* Get server RSIZE, TSIZE */ |
#define | RR_CAPABILITY 0x0008 /* Get server port capabilities */ |
#define | RR_TX_FLUSH 0x0040 /* Flush output buffers */ |
#define | RR_RX_FLUSH 0x0080 /* Flush input buffers */ |
#define | RR_TX_STOP 0x0100 /* Pause output */ |
#define | RR_RX_STOP 0x0200 /* Pause input */ |
#define | RR_TX_START 0x0400 /* Start output */ |
#define | RR_RX_START 0x0800 /* Start input */ |
#define | RR_TX_BREAK 0x1000 /* Send BREAK */ |
#define | RR_TX_ICHAR 0x2000 /* Send character immediate */ |
#define | ND_STATE_STR(x) |
#define | ND_SELECT 0x0001 /* Multiple net read selects */ |
#define | ND_DEB_WAIT 0x0002 /* Debug Device waiting */ |
#define | MON_WAIT_DATA 0x0001 /* Waiting for buffer data */ |
#define | MON_WAIT_SPACE 0x0002 /* Waiting for buffer space */ |
#define | DPA_WAIT_DATA 0x0001 /* Waiting for buffer data */ |
#define | DPA_WAIT_SPACE 0x0002 /* Waiting for buffer space */ |
#define | RPDUMP_MAGIC "Digi-RealPort-1.0" |
#define | RPDUMP_MESSAGE 0xE2 /* Descriptive message */ |
#define | RPDUMP_RESET 0xE7 /* Connection reset */ |
#define | RPDUMP_CLIENT 0xE8 /* Client data */ |
#define | RPDUMP_SERVER 0xE9 /* Server data */ |
#define | NR_ECHO 0x0001 /* Server echo packet */ |
#define | NR_IDENT 0x0002 /* Server Product ID */ |
#define | NR_CAPABILITY 0x0004 /* Server Capabilties */ |
#define | NR_VPD 0x0008 /* Server VPD, if any */ |
#define | NR_PASSWORD 0x0010 /* Server Password */ |
#define | SERIAL_TTDRV_REG 0x0001 /* nd_serial_ttdriver registered */ |
#define | CALLOUT_TTDRV_REG 0x0002 /* nd_callout_ttdriver registered */ |
#define | XPRINT_TTDRV_REG 0x0004 /* nd_xprint_ttdriver registered */ |
Enumerations | |
enum | dgrp_ch_state_t { CS_IDLE = 0, CS_WAIT_OPEN = 1, CS_WAIT_CANCEL = 2, CS_WAIT_FAIL = 3, CS_SEND_QUERY = 4, CS_WAIT_QUERY = 5, CS_READY = 6, CS_SEND_CLOSE = 7, CS_WAIT_CLOSE = 8 } |
enum | dgrp_nd_state_t { NS_CLOSED = 0, NS_IDLE = 1, NS_SEND_QUERY = 2, NS_WAIT_QUERY = 3, NS_READY = 4, NS_SEND_ERROR = 5 } |
#define CALLOUT_TTDRV_REG 0x0002 /* nd_callout_ttdriver registered */ |
#define CH_PHYS_CD 0x00008 /* Carrier was physically present */ |
#define CH_TX_BREAK |
#define CH_VIRT_CD 0x00004 /* Carrier was virtually present */ |
#define CH_WAITING_SYNC |
#define DPA_HIGH_WATER |
#define MAX_DESC_LEN |
#define ND_STATE_STR | ( | x | ) |
#define RR_CAPABILITY 0x0008 /* Get server port capabilities */ |
#define SERIAL_TTDRV_REG 0x0001 /* nd_serial_ttdriver registered */ |
#define UIO_MIN 2000 /* Minimum size application buffer */ |
#define UN_AUTO_IRQ 0x0080 /* Do automatic IRQ during autoconfiguration */ |
#define UN_BOOT_AUTOCONF 0x10000000 /* Autoconfigure port on bootup */ |
#define UN_CALLOUT_ACTIVE 0x40000000 /* Call out device is active */ |
#define UN_CALLOUT_NOHUP 0x0400 /* Don't do hangups for cua device */ |
#define UN_DIGI_MASK 0x00FF0000 /* Waiting output low water */ |
#define UN_FOURPORT 0x0002 /* Set OU1, OUT2 per AST Fourport settings */ |
#define UN_HUP_NOTIFY |
#define UN_INITIALIZED 0x80000000 /* Serial port was initialized */ |
#define UN_NORMAL_ACTIVE 0x20000000 /* Normal device is active */ |
#define UN_PGRP_LOCKOUT 0x0200 /* Lock out cua opens based on pgrp */ |
#define UN_PWAIT 0x00080000 /* Printer waiting for terminal */ |
#define UN_SAK 0x0004 /* Secure Attention Key (Orange book) */ |
#define UN_SESSION_LOCKOUT 0x0100 /* Lock out cua opens based on session */ |
#define UN_SKIP_TEST 0x0040 /* Skip UART test during autoconfiguration */ |
#define UN_SPD_VHI 0x0020 /* Use 115200 instead of 38400 bps */ |
#define UN_SPLIT_TERMIOS 0x0008 /* Separate termios for dialin/callout */ |
#define UN_STICKY 0x00020000 /* TTY Settings are now sticky */ |
#define UN_USR_MASK |
#define XF_XMODEM 0x0002 /* Enable in-band modem signalling */ |
#define XPRINT_TTDRV_REG 0x0004 /* nd_xprint_ttdriver registered */ |
enum dgrp_ch_state_t |
enum dgrp_nd_state_t |