Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
ioc4_serial.c File Reference
#include <linux/errno.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/serial.h>
#include <linux/circ_buf.h>
#include <linux/serial_reg.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/ioc4.h>
#include <linux/serial_core.h>
#include <linux/slab.h>

Go to the source code of this file.

Data Structures

struct  ioc4_serialregs
 
struct  ioc4_uartregs
 
struct  ioc4_serial
 
struct  ioc4_control
 
struct  ioc4_soft
 
struct  ioc4_soft::ioc4_intr_type
 
struct  ioc4_soft::ioc4_intr_type::ioc4_intr_info
 
struct  ioc4_port
 
struct  hooks
 
struct  ring_entry
 
struct  ring
 
struct  ring_buffer
 

Macros

#define IOC4_NUM_SERIAL_PORTS   4 /* max ports per card */
 
#define IOC4_NUM_CARDS   8 /* max cards per partition */
 
#define GET_SIO_IR(_n)
 
#define GET_OTHER_IR(_n)
 
#define IOC4_PCI_ERR_ADDR_L   0x000 /* Low Error Address */
 
#define IOC4_PCI_ERR_ADDR_VLD   (0x1 << 0)
 
#define IOC4_PCI_ERR_ADDR_MST_ID_MSK   (0xf << 1)
 
#define IOC4_PCI_ERR_ADDR_MST_NUM_MSK   (0xe << 1)
 
#define IOC4_PCI_ERR_ADDR_MST_TYP_MSK   (0x1 << 1)
 
#define IOC4_PCI_ERR_ADDR_MUL_ERR   (0x1 << 5)
 
#define IOC4_PCI_ERR_ADDR_ADDR_MSK   (0x3ffffff << 6)
 
#define IOC4_SIO_INTR_TYPE   0
 
#define IOC4_OTHER_INTR_TYPE   1
 
#define IOC4_NUM_INTR_TYPES   2
 
#define IOC4_SIO_IR_S0_TX_MT   0x00000001 /* Serial port 0 TX empty */
 
#define IOC4_SIO_IR_S0_RX_FULL   0x00000002 /* Port 0 RX buf full */
 
#define IOC4_SIO_IR_S0_RX_HIGH   0x00000004 /* Port 0 RX hiwat */
 
#define IOC4_SIO_IR_S0_RX_TIMER   0x00000008 /* Port 0 RX timeout */
 
#define IOC4_SIO_IR_S0_DELTA_DCD   0x00000010 /* Port 0 delta DCD */
 
#define IOC4_SIO_IR_S0_DELTA_CTS   0x00000020 /* Port 0 delta CTS */
 
#define IOC4_SIO_IR_S0_INT   0x00000040 /* Port 0 pass-thru intr */
 
#define IOC4_SIO_IR_S0_TX_EXPLICIT   0x00000080 /* Port 0 explicit TX thru */
 
#define IOC4_SIO_IR_S1_TX_MT   0x00000100 /* Serial port 1 */
 
#define IOC4_SIO_IR_S1_RX_FULL   0x00000200 /* */
 
#define IOC4_SIO_IR_S1_RX_HIGH   0x00000400 /* */
 
#define IOC4_SIO_IR_S1_RX_TIMER   0x00000800 /* */
 
#define IOC4_SIO_IR_S1_DELTA_DCD   0x00001000 /* */
 
#define IOC4_SIO_IR_S1_DELTA_CTS   0x00002000 /* */
 
#define IOC4_SIO_IR_S1_INT   0x00004000 /* */
 
#define IOC4_SIO_IR_S1_TX_EXPLICIT   0x00008000 /* */
 
#define IOC4_SIO_IR_S2_TX_MT   0x00010000 /* Serial port 2 */
 
#define IOC4_SIO_IR_S2_RX_FULL   0x00020000 /* */
 
#define IOC4_SIO_IR_S2_RX_HIGH   0x00040000 /* */
 
#define IOC4_SIO_IR_S2_RX_TIMER   0x00080000 /* */
 
#define IOC4_SIO_IR_S2_DELTA_DCD   0x00100000 /* */
 
#define IOC4_SIO_IR_S2_DELTA_CTS   0x00200000 /* */
 
#define IOC4_SIO_IR_S2_INT   0x00400000 /* */
 
#define IOC4_SIO_IR_S2_TX_EXPLICIT   0x00800000 /* */
 
#define IOC4_SIO_IR_S3_TX_MT   0x01000000 /* Serial port 3 */
 
#define IOC4_SIO_IR_S3_RX_FULL   0x02000000 /* */
 
#define IOC4_SIO_IR_S3_RX_HIGH   0x04000000 /* */
 
#define IOC4_SIO_IR_S3_RX_TIMER   0x08000000 /* */
 
#define IOC4_SIO_IR_S3_DELTA_DCD   0x10000000 /* */
 
#define IOC4_SIO_IR_S3_DELTA_CTS   0x20000000 /* */
 
#define IOC4_SIO_IR_S3_INT   0x40000000 /* */
 
#define IOC4_SIO_IR_S3_TX_EXPLICIT   0x80000000 /* */
 
#define IOC4_SIO_IR_S0
 
#define IOC4_SIO_IR_S1
 
#define IOC4_SIO_IR_S2
 
#define IOC4_SIO_IR_S3
 
#define IOC4_OTHER_IR_ATA_INT   0x00000001 /* ATAPI intr pass-thru */
 
#define IOC4_OTHER_IR_ATA_MEMERR   0x00000002 /* ATAPI DMA PCI error */
 
#define IOC4_OTHER_IR_S0_MEMERR   0x00000004 /* Port 0 PCI error */
 
#define IOC4_OTHER_IR_S1_MEMERR   0x00000008 /* Port 1 PCI error */
 
#define IOC4_OTHER_IR_S2_MEMERR   0x00000010 /* Port 2 PCI error */
 
#define IOC4_OTHER_IR_S3_MEMERR   0x00000020 /* Port 3 PCI error */
 
#define IOC4_OTHER_IR_KBD_INT   0x00000040 /* Keyboard/mouse */
 
#define IOC4_OTHER_IR_RESERVED   0x007fff80 /* Reserved */
 
#define IOC4_OTHER_IR_RT_INT   0x00800000 /* INT_OUT section output */
 
#define IOC4_OTHER_IR_GEN_INT   0xff000000 /* Generic pins */
 
#define IOC4_OTHER_IR_SER_MEMERR
 
#define IOC4_SIO_CR_CMD_PULSE_SHIFT   0 /* byte bus strobe shift */
 
#define IOC4_SIO_CR_ARB_DIAG_TX0   0x00000000
 
#define IOC4_SIO_CR_ARB_DIAG_RX0   0x00000010
 
#define IOC4_SIO_CR_ARB_DIAG_TX1   0x00000020
 
#define IOC4_SIO_CR_ARB_DIAG_RX1   0x00000030
 
#define IOC4_SIO_CR_ARB_DIAG_TX2   0x00000040
 
#define IOC4_SIO_CR_ARB_DIAG_RX2   0x00000050
 
#define IOC4_SIO_CR_ARB_DIAG_TX3   0x00000060
 
#define IOC4_SIO_CR_ARB_DIAG_RX3   0x00000070
 
#define IOC4_SIO_CR_SIO_DIAG_IDLE
 
#define IOC4_GPCR_UART0_MODESEL
 
#define IOC4_GPCR_UART1_MODESEL
 
#define IOC4_GPCR_UART2_MODESEL
 
#define IOC4_GPCR_UART3_MODESEL
 
#define IOC4_GPPR_UART0_MODESEL_PIN
 
#define IOC4_GPPR_UART1_MODESEL_PIN
 
#define IOC4_GPPR_UART2_MODESEL_PIN
 
#define IOC4_GPPR_UART3_MODESEL_PIN
 
#define IOC4_RXSB_OVERRUN   0x01 /* Char(s) lost */
 
#define IOC4_RXSB_PAR_ERR   0x02 /* Parity error */
 
#define IOC4_RXSB_FRAME_ERR   0x04 /* Framing error */
 
#define IOC4_RXSB_BREAK   0x08 /* Break character */
 
#define IOC4_RXSB_CTS   0x10 /* State of CTS */
 
#define IOC4_RXSB_DCD   0x20 /* State of DCD */
 
#define IOC4_RXSB_MODEM_VALID   0x40 /* DCD, CTS, and OVERRUN are valid */
 
#define IOC4_RXSB_DATA_VALID
 
#define IOC4_TXCB_INT_WHEN_DONE   0x20 /* Interrupt after this byte is sent */
 
#define IOC4_TXCB_INVALID   0x00 /* Byte is invalid */
 
#define IOC4_TXCB_VALID   0x40 /* Byte is valid */
 
#define IOC4_TXCB_MCR   0x80 /* Data<7:0> to modem control reg */
 
#define IOC4_TXCB_DELAY   0xc0 /* Delay data<7:0> mSec */
 
#define IOC4_SBBR_L_SIZE   0x00000001 /* 0 == 1KB rings, 1 == 4KB rings */
 
#define IOC4_SSCR_RX_THRESHOLD   0x000001ff /* Hiwater mark */
 
#define IOC4_SSCR_TX_TIMER_BUSY   0x00010000 /* TX timer in progress */
 
#define IOC4_SSCR_HFC_EN   0x00020000 /* Hardware flow control enabled */
 
#define IOC4_SSCR_RX_RING_DCD   0x00040000 /* Post RX record on delta-DCD */
 
#define IOC4_SSCR_RX_RING_CTS   0x00080000 /* Post RX record on delta-CTS */
 
#define IOC4_SSCR_DIAG   0x00200000 /* Bypass clock divider for sim */
 
#define IOC4_SSCR_RX_DRAIN   0x08000000 /* Drain RX buffer to memory */
 
#define IOC4_SSCR_DMA_EN   0x10000000 /* Enable ring buffer DMA */
 
#define IOC4_SSCR_DMA_PAUSE   0x20000000 /* Pause DMA */
 
#define IOC4_SSCR_PAUSE_STATE   0x40000000 /* Sets when PAUSE takes effect */
 
#define IOC4_SSCR_RESET   0x80000000 /* Reset DMA channels */
 
#define IOC4_PROD_CONS_PTR_4K   0x00000ff8 /* For 4K buffers */
 
#define IOC4_PROD_CONS_PTR_1K   0x000003f8 /* For 1K buffers */
 
#define IOC4_PROD_CONS_PTR_OFF   3
 
#define IOC4_SRCIR_ARM   0x80000000 /* Arm RX timer */
 
#define IOC4_SHADOW_DR   0x00000001 /* Data ready */
 
#define IOC4_SHADOW_OE   0x00000002 /* Overrun error */
 
#define IOC4_SHADOW_PE   0x00000004 /* Parity error */
 
#define IOC4_SHADOW_FE   0x00000008 /* Framing error */
 
#define IOC4_SHADOW_BI   0x00000010 /* Break interrupt */
 
#define IOC4_SHADOW_THRE   0x00000020 /* Xmit holding register empty */
 
#define IOC4_SHADOW_TEMT   0x00000040 /* Xmit shift register empty */
 
#define IOC4_SHADOW_RFCE   0x00000080 /* Char in RX fifo has an error */
 
#define IOC4_SHADOW_DCTS   0x00010000 /* Delta clear to send */
 
#define IOC4_SHADOW_DDCD   0x00080000 /* Delta data carrier detect */
 
#define IOC4_SHADOW_CTS   0x00100000 /* Clear to send */
 
#define IOC4_SHADOW_DCD   0x00800000 /* Data carrier detect */
 
#define IOC4_SHADOW_DTR   0x01000000 /* Data terminal ready */
 
#define IOC4_SHADOW_RTS   0x02000000 /* Request to send */
 
#define IOC4_SHADOW_OUT1   0x04000000 /* 16550 OUT1 bit */
 
#define IOC4_SHADOW_OUT2   0x08000000 /* 16550 OUT2 bit */
 
#define IOC4_SHADOW_LOOP   0x10000000 /* Loopback enabled */
 
#define IOC4_SRTR_CNT   0x00000fff /* Reload value for RX timer */
 
#define IOC4_SRTR_CNT_VAL   0x0fff0000 /* Current value of RX timer */
 
#define IOC4_SRTR_CNT_VAL_SHIFT   16
 
#define IOC4_SRTR_HZ   16000 /* SRTR clock frequency */
 
#define i4u_dll   u1.dll
 
#define i4u_ier   u2.ier
 
#define i4u_dlm   u2.dlm
 
#define i4u_fcr   u3.fcr
 
#define IOC4_SER_XIN_CLK_66   66666667
 
#define IOC4_SER_XIN_CLK_33   33333333
 
#define IOC4_W_IES   0
 
#define IOC4_W_IEC   1
 
#define DPRINT_CONFIG(_x...)   ;
 
#define WAKEUP_CHARS   256
 
#define IOC4_MAX_CHARS   256
 
#define IOC4_FIFO_CHARS   255
 
#define DEVICE_NAME_RS232   "ttyIOC"
 
#define DEVICE_NAME_RS422   "ttyAIOC"
 
#define DEVICE_MAJOR   204
 
#define DEVICE_MINOR_RS232   50
 
#define DEVICE_MINOR_RS422   84
 
#define IOC4_SERIAL_OFFSET   0x300
 
#define NCS_BREAK   0x1
 
#define NCS_PARITY   0x2
 
#define NCS_FRAMING   0x4
 
#define NCS_OVERRUN   0x8
 
#define MIN_BAUD_SUPPORTED   1200
 
#define MAX_BAUD_SUPPORTED   115200
 
#define PROTO_RS232   3
 
#define PROTO_RS422   7
 
#define N_DATA_READY   0x01
 
#define N_OUTPUT_LOWAT   0x02
 
#define N_BREAK   0x04
 
#define N_PARITY_ERROR   0x08
 
#define N_FRAMING_ERROR   0x10
 
#define N_OVERRUN_ERROR   0x20
 
#define N_DDCD   0x40
 
#define N_DCTS   0x80
 
#define N_ALL_INPUT
 
#define N_ALL_OUTPUT   N_OUTPUT_LOWAT
 
#define N_ALL_ERRORS   (N_PARITY_ERROR | N_FRAMING_ERROR | N_OVERRUN_ERROR)
 
#define N_ALL
 
#define SER_DIVISOR(_x, clk)   (((clk) + (_x) * 8) / ((_x) * 16))
 
#define DIVISOR_TO_BAUD(div, clk)   ((clk) / 16 / (div))
 
#define LCR_MASK_BITS_CHAR
 
#define LCR_MASK_STOP_BITS   (UART_LCR_STOP)
 
#define PENDING(_p)   (readl(&(_p)->ip_mem->sio_ir.raw) & _p->ip_ienb)
 
#define READ_SIO_IR(_p)   readl(&(_p)->ip_mem->sio_ir.raw)
 
#define RING_BUF_SIZE   4096
 
#define IOC4_BUF_SIZE_BIT   IOC4_SBBR_L_SIZE
 
#define PROD_CONS_MASK   IOC4_PROD_CONS_PTR_4K
 
#define TOTAL_RING_BUF_SIZE   (RING_BUF_SIZE * 4)
 
#define UART_PORT_MIN   0
 
#define UART_PORT_RS232   UART_PORT_MIN
 
#define UART_PORT_RS422   1
 
#define UART_PORT_COUNT   2 /* one for each mode */
 
#define MAX_IOC4_INTR_ENTS   (8 * sizeof(uint32_t))
 
#define TX_LOWAT_LATENCY   1000
 
#define TX_LOWAT_HZ   (1000000 / TX_LOWAT_LATENCY)
 
#define TX_LOWAT_CHARS(baud)   (baud / 10 / TX_LOWAT_HZ)
 
#define INPUT_HIGH   0x01
 
#define DCD_ON   0x02
 
#define LOWAT_WRITTEN   0x04
 
#define READ_ABORTED   0x08
 
#define PORT_ACTIVE   0x10
 
#define PORT_INACTIVE   0 /* This is the value when "off" */
 
#define RING_ANY_VALID   ((uint32_t)(IOC4_RXSB_MODEM_VALID | IOC4_RXSB_DATA_VALID) * 0x01010101)
 
#define ring_sc   u.s.sc
 
#define ring_data   u.s.data
 
#define ring_allsc   u.all.allsc
 
#define ENTRIES_PER_RING   (RING_BUF_SIZE / (int) sizeof(struct ring_entry))
 
#define RING(_p, _wh)   &(((struct ring_buffer *)((_p)->ip_cpu_ringbuf))->_wh)
 
#define MAXITER   10000000
 

Typedefs

typedef void ioc4_intr_func_f (void *, uint32_t)
 
typedef ioc4_intr_func_fioc4_intr_func_t
 

Functions

int ioc4_serial_attach_one (struct ioc4_driver_data *idd)
 
 late_initcall (ioc4_serial_init)
 
 module_exit (ioc4_serial_exit)
 
 MODULE_AUTHOR ("Pat Gefre - Silicon Graphics Inc. (SGI) <[email protected]>")
 
 MODULE_DESCRIPTION ("Serial PCI driver module for SGI IOC4 Base-IO Card")
 
 MODULE_LICENSE ("GPL")
 

Variables

struct ioc4_serial ioc4_serial
 

Macro Definition Documentation

#define DCD_ON   0x02

Definition at line 502 of file ioc4_serial.c.

#define DEVICE_MAJOR   204

Definition at line 319 of file ioc4_serial.c.

#define DEVICE_MINOR_RS232   50

Definition at line 320 of file ioc4_serial.c.

#define DEVICE_MINOR_RS422   84

Definition at line 321 of file ioc4_serial.c.

#define DEVICE_NAME_RS232   "ttyIOC"

Definition at line 317 of file ioc4_serial.c.

#define DEVICE_NAME_RS422   "ttyAIOC"

Definition at line 318 of file ioc4_serial.c.

#define DIVISOR_TO_BAUD (   div,
  clk 
)    ((clk) / 16 / (div))

Definition at line 364 of file ioc4_serial.c.

#define DPRINT_CONFIG (   _x...)    ;

Definition at line 306 of file ioc4_serial.c.

#define ENTRIES_PER_RING   (RING_BUF_SIZE / (int) sizeof(struct ring_entry))

Definition at line 603 of file ioc4_serial.c.

#define GET_OTHER_IR (   _n)
Value:

Definition at line 39 of file ioc4_serial.c.

#define GET_SIO_IR (   _n)
Value:
(_n == 0) ? (IOC4_SIO_IR_S0) : \
(_n == 1) ? (IOC4_SIO_IR_S1) : \
(_n == 2) ? (IOC4_SIO_IR_S2) : \

Definition at line 34 of file ioc4_serial.c.

#define i4u_dll   u1.dll

Definition at line 270 of file ioc4_serial.c.

#define i4u_dlm   u2.dlm

Definition at line 272 of file ioc4_serial.c.

#define i4u_fcr   u3.fcr

Definition at line 273 of file ioc4_serial.c.

#define i4u_ier   u2.ier

Definition at line 271 of file ioc4_serial.c.

#define INPUT_HIGH   0x01

Definition at line 501 of file ioc4_serial.c.

#define IOC4_BUF_SIZE_BIT   IOC4_SBBR_L_SIZE

Definition at line 381 of file ioc4_serial.c.

#define IOC4_FIFO_CHARS   255

Definition at line 314 of file ioc4_serial.c.

#define IOC4_GPCR_UART0_MODESEL
Value:
0x10 /* Pin is output to port 0
mode sel */

Definition at line 160 of file ioc4_serial.c.

#define IOC4_GPCR_UART1_MODESEL
Value:
0x20 /* Pin is output to port 1
mode sel */

Definition at line 161 of file ioc4_serial.c.

#define IOC4_GPCR_UART2_MODESEL
Value:
0x40 /* Pin is output to port 2
mode sel */

Definition at line 162 of file ioc4_serial.c.

#define IOC4_GPCR_UART3_MODESEL
Value:
0x80 /* Pin is output to port 3
mode sel */

Definition at line 163 of file ioc4_serial.c.

#define IOC4_GPPR_UART0_MODESEL_PIN
Value:
4 /* GIO pin controlling
uart 0 mode select */

Definition at line 165 of file ioc4_serial.c.

#define IOC4_GPPR_UART1_MODESEL_PIN
Value:
5 /* GIO pin controlling
uart 1 mode select */

Definition at line 166 of file ioc4_serial.c.

#define IOC4_GPPR_UART2_MODESEL_PIN
Value:
6 /* GIO pin controlling
uart 2 mode select */

Definition at line 167 of file ioc4_serial.c.

#define IOC4_GPPR_UART3_MODESEL_PIN
Value:
7 /* GIO pin controlling
uart 3 mode select */

Definition at line 168 of file ioc4_serial.c.

#define IOC4_MAX_CHARS   256

Definition at line 313 of file ioc4_serial.c.

#define IOC4_NUM_CARDS   8 /* max cards per partition */

Definition at line 32 of file ioc4_serial.c.

#define IOC4_NUM_INTR_TYPES   2

Definition at line 63 of file ioc4_serial.c.

#define IOC4_NUM_SERIAL_PORTS   4 /* max ports per card */

Definition at line 31 of file ioc4_serial.c.

#define IOC4_OTHER_INTR_TYPE   1

Definition at line 62 of file ioc4_serial.c.

#define IOC4_OTHER_IR_ATA_INT   0x00000001 /* ATAPI intr pass-thru */

Definition at line 134 of file ioc4_serial.c.

#define IOC4_OTHER_IR_ATA_MEMERR   0x00000002 /* ATAPI DMA PCI error */

Definition at line 135 of file ioc4_serial.c.

#define IOC4_OTHER_IR_GEN_INT   0xff000000 /* Generic pins */

Definition at line 143 of file ioc4_serial.c.

#define IOC4_OTHER_IR_KBD_INT   0x00000040 /* Keyboard/mouse */

Definition at line 140 of file ioc4_serial.c.

#define IOC4_OTHER_IR_RESERVED   0x007fff80 /* Reserved */

Definition at line 141 of file ioc4_serial.c.

#define IOC4_OTHER_IR_RT_INT   0x00800000 /* INT_OUT section output */

Definition at line 142 of file ioc4_serial.c.

#define IOC4_OTHER_IR_S0_MEMERR   0x00000004 /* Port 0 PCI error */

Definition at line 136 of file ioc4_serial.c.

#define IOC4_OTHER_IR_S1_MEMERR   0x00000008 /* Port 1 PCI error */

Definition at line 137 of file ioc4_serial.c.

#define IOC4_OTHER_IR_S2_MEMERR   0x00000010 /* Port 2 PCI error */

Definition at line 138 of file ioc4_serial.c.

#define IOC4_OTHER_IR_S3_MEMERR   0x00000020 /* Port 3 PCI error */

Definition at line 139 of file ioc4_serial.c.

#define IOC4_OTHER_IR_SER_MEMERR
Value:

Definition at line 145 of file ioc4_serial.c.

#define IOC4_PCI_ERR_ADDR_ADDR_MSK   (0x3ffffff << 6)

Definition at line 58 of file ioc4_serial.c.

#define IOC4_PCI_ERR_ADDR_L   0x000 /* Low Error Address */

Definition at line 52 of file ioc4_serial.c.

#define IOC4_PCI_ERR_ADDR_MST_ID_MSK   (0xf << 1)

Definition at line 54 of file ioc4_serial.c.

#define IOC4_PCI_ERR_ADDR_MST_NUM_MSK   (0xe << 1)

Definition at line 55 of file ioc4_serial.c.

#define IOC4_PCI_ERR_ADDR_MST_TYP_MSK   (0x1 << 1)

Definition at line 56 of file ioc4_serial.c.

#define IOC4_PCI_ERR_ADDR_MUL_ERR   (0x1 << 5)

Definition at line 57 of file ioc4_serial.c.

#define IOC4_PCI_ERR_ADDR_VLD   (0x1 << 0)

Definition at line 53 of file ioc4_serial.c.

#define IOC4_PROD_CONS_PTR_1K   0x000003f8 /* For 1K buffers */

Definition at line 205 of file ioc4_serial.c.

#define IOC4_PROD_CONS_PTR_4K   0x00000ff8 /* For 4K buffers */

Definition at line 204 of file ioc4_serial.c.

#define IOC4_PROD_CONS_PTR_OFF   3

Definition at line 206 of file ioc4_serial.c.

#define IOC4_RXSB_BREAK   0x08 /* Break character */

Definition at line 174 of file ioc4_serial.c.

#define IOC4_RXSB_CTS   0x10 /* State of CTS */

Definition at line 175 of file ioc4_serial.c.

#define IOC4_RXSB_DATA_VALID
Value:
0x80 /* Data byte, FRAME_ERR PAR_ERR
* & BREAK valid */

Definition at line 178 of file ioc4_serial.c.

#define IOC4_RXSB_DCD   0x20 /* State of DCD */

Definition at line 176 of file ioc4_serial.c.

#define IOC4_RXSB_FRAME_ERR   0x04 /* Framing error */

Definition at line 173 of file ioc4_serial.c.

#define IOC4_RXSB_MODEM_VALID   0x40 /* DCD, CTS, and OVERRUN are valid */

Definition at line 177 of file ioc4_serial.c.

#define IOC4_RXSB_OVERRUN   0x01 /* Char(s) lost */

Definition at line 171 of file ioc4_serial.c.

#define IOC4_RXSB_PAR_ERR   0x02 /* Parity error */

Definition at line 172 of file ioc4_serial.c.

#define IOC4_SBBR_L_SIZE   0x00000001 /* 0 == 1KB rings, 1 == 4KB rings */

Definition at line 188 of file ioc4_serial.c.

#define IOC4_SER_XIN_CLK_33   33333333

Definition at line 294 of file ioc4_serial.c.

#define IOC4_SER_XIN_CLK_66   66666667

Definition at line 293 of file ioc4_serial.c.

#define IOC4_SERIAL_OFFSET   0x300

Definition at line 325 of file ioc4_serial.c.

#define IOC4_SHADOW_BI   0x00000010 /* Break interrupt */

Definition at line 216 of file ioc4_serial.c.

#define IOC4_SHADOW_CTS   0x00100000 /* Clear to send */

Definition at line 222 of file ioc4_serial.c.

#define IOC4_SHADOW_DCD   0x00800000 /* Data carrier detect */

Definition at line 223 of file ioc4_serial.c.

#define IOC4_SHADOW_DCTS   0x00010000 /* Delta clear to send */

Definition at line 220 of file ioc4_serial.c.

#define IOC4_SHADOW_DDCD   0x00080000 /* Delta data carrier detect */

Definition at line 221 of file ioc4_serial.c.

#define IOC4_SHADOW_DR   0x00000001 /* Data ready */

Definition at line 212 of file ioc4_serial.c.

#define IOC4_SHADOW_DTR   0x01000000 /* Data terminal ready */

Definition at line 224 of file ioc4_serial.c.

#define IOC4_SHADOW_FE   0x00000008 /* Framing error */

Definition at line 215 of file ioc4_serial.c.

#define IOC4_SHADOW_LOOP   0x10000000 /* Loopback enabled */

Definition at line 228 of file ioc4_serial.c.

#define IOC4_SHADOW_OE   0x00000002 /* Overrun error */

Definition at line 213 of file ioc4_serial.c.

#define IOC4_SHADOW_OUT1   0x04000000 /* 16550 OUT1 bit */

Definition at line 226 of file ioc4_serial.c.

#define IOC4_SHADOW_OUT2   0x08000000 /* 16550 OUT2 bit */

Definition at line 227 of file ioc4_serial.c.

#define IOC4_SHADOW_PE   0x00000004 /* Parity error */

Definition at line 214 of file ioc4_serial.c.

#define IOC4_SHADOW_RFCE   0x00000080 /* Char in RX fifo has an error */

Definition at line 219 of file ioc4_serial.c.

#define IOC4_SHADOW_RTS   0x02000000 /* Request to send */

Definition at line 225 of file ioc4_serial.c.

#define IOC4_SHADOW_TEMT   0x00000040 /* Xmit shift register empty */

Definition at line 218 of file ioc4_serial.c.

#define IOC4_SHADOW_THRE   0x00000020 /* Xmit holding register empty */

Definition at line 217 of file ioc4_serial.c.

#define IOC4_SIO_CR_ARB_DIAG_RX0   0x00000010

Definition at line 151 of file ioc4_serial.c.

#define IOC4_SIO_CR_ARB_DIAG_RX1   0x00000030

Definition at line 153 of file ioc4_serial.c.

#define IOC4_SIO_CR_ARB_DIAG_RX2   0x00000050

Definition at line 155 of file ioc4_serial.c.

#define IOC4_SIO_CR_ARB_DIAG_RX3   0x00000070

Definition at line 157 of file ioc4_serial.c.

#define IOC4_SIO_CR_ARB_DIAG_TX0   0x00000000

Definition at line 150 of file ioc4_serial.c.

#define IOC4_SIO_CR_ARB_DIAG_TX1   0x00000020

Definition at line 152 of file ioc4_serial.c.

#define IOC4_SIO_CR_ARB_DIAG_TX2   0x00000040

Definition at line 154 of file ioc4_serial.c.

#define IOC4_SIO_CR_ARB_DIAG_TX3   0x00000060

Definition at line 156 of file ioc4_serial.c.

#define IOC4_SIO_CR_CMD_PULSE_SHIFT   0 /* byte bus strobe shift */

Definition at line 149 of file ioc4_serial.c.

#define IOC4_SIO_CR_SIO_DIAG_IDLE
Value:
0x00000080 /* 0 -> active request among
serial ports (ro) */

Definition at line 158 of file ioc4_serial.c.

#define IOC4_SIO_INTR_TYPE   0

Definition at line 61 of file ioc4_serial.c.

#define IOC4_SIO_IR_S0
Value:
IOC4_SIO_IR_S0_RX_FULL | \
IOC4_SIO_IR_S0_RX_HIGH | \
IOC4_SIO_IR_S0_RX_TIMER | \
IOC4_SIO_IR_S0_DELTA_DCD | \
IOC4_SIO_IR_S0_DELTA_CTS | \
IOC4_SIO_IR_S0_INT | \
IOC4_SIO_IR_S0_TX_EXPLICIT)

Definition at line 100 of file ioc4_serial.c.

#define IOC4_SIO_IR_S0_DELTA_CTS   0x00000020 /* Port 0 delta CTS */

Definition at line 71 of file ioc4_serial.c.

#define IOC4_SIO_IR_S0_DELTA_DCD   0x00000010 /* Port 0 delta DCD */

Definition at line 70 of file ioc4_serial.c.

#define IOC4_SIO_IR_S0_INT   0x00000040 /* Port 0 pass-thru intr */

Definition at line 72 of file ioc4_serial.c.

#define IOC4_SIO_IR_S0_RX_FULL   0x00000002 /* Port 0 RX buf full */

Definition at line 67 of file ioc4_serial.c.

#define IOC4_SIO_IR_S0_RX_HIGH   0x00000004 /* Port 0 RX hiwat */

Definition at line 68 of file ioc4_serial.c.

#define IOC4_SIO_IR_S0_RX_TIMER   0x00000008 /* Port 0 RX timeout */

Definition at line 69 of file ioc4_serial.c.

#define IOC4_SIO_IR_S0_TX_EXPLICIT   0x00000080 /* Port 0 explicit TX thru */

Definition at line 73 of file ioc4_serial.c.

#define IOC4_SIO_IR_S0_TX_MT   0x00000001 /* Serial port 0 TX empty */

Definition at line 66 of file ioc4_serial.c.

#define IOC4_SIO_IR_S1
Value:
IOC4_SIO_IR_S1_RX_FULL | \
IOC4_SIO_IR_S1_RX_HIGH | \
IOC4_SIO_IR_S1_RX_TIMER | \
IOC4_SIO_IR_S1_DELTA_DCD | \
IOC4_SIO_IR_S1_DELTA_CTS | \
IOC4_SIO_IR_S1_INT | \
IOC4_SIO_IR_S1_TX_EXPLICIT)

Definition at line 108 of file ioc4_serial.c.

#define IOC4_SIO_IR_S1_DELTA_CTS   0x00002000 /* */

Definition at line 79 of file ioc4_serial.c.

#define IOC4_SIO_IR_S1_DELTA_DCD   0x00001000 /* */

Definition at line 78 of file ioc4_serial.c.

#define IOC4_SIO_IR_S1_INT   0x00004000 /* */

Definition at line 80 of file ioc4_serial.c.

#define IOC4_SIO_IR_S1_RX_FULL   0x00000200 /* */

Definition at line 75 of file ioc4_serial.c.

#define IOC4_SIO_IR_S1_RX_HIGH   0x00000400 /* */

Definition at line 76 of file ioc4_serial.c.

#define IOC4_SIO_IR_S1_RX_TIMER   0x00000800 /* */

Definition at line 77 of file ioc4_serial.c.

#define IOC4_SIO_IR_S1_TX_EXPLICIT   0x00008000 /* */

Definition at line 81 of file ioc4_serial.c.

#define IOC4_SIO_IR_S1_TX_MT   0x00000100 /* Serial port 1 */

Definition at line 74 of file ioc4_serial.c.

#define IOC4_SIO_IR_S2
Value:
IOC4_SIO_IR_S2_RX_FULL | \
IOC4_SIO_IR_S2_RX_HIGH | \
IOC4_SIO_IR_S2_RX_TIMER | \
IOC4_SIO_IR_S2_DELTA_DCD | \
IOC4_SIO_IR_S2_DELTA_CTS | \
IOC4_SIO_IR_S2_INT | \
IOC4_SIO_IR_S2_TX_EXPLICIT)

Definition at line 116 of file ioc4_serial.c.

#define IOC4_SIO_IR_S2_DELTA_CTS   0x00200000 /* */

Definition at line 87 of file ioc4_serial.c.

#define IOC4_SIO_IR_S2_DELTA_DCD   0x00100000 /* */

Definition at line 86 of file ioc4_serial.c.

#define IOC4_SIO_IR_S2_INT   0x00400000 /* */

Definition at line 88 of file ioc4_serial.c.

#define IOC4_SIO_IR_S2_RX_FULL   0x00020000 /* */

Definition at line 83 of file ioc4_serial.c.

#define IOC4_SIO_IR_S2_RX_HIGH   0x00040000 /* */

Definition at line 84 of file ioc4_serial.c.

#define IOC4_SIO_IR_S2_RX_TIMER   0x00080000 /* */

Definition at line 85 of file ioc4_serial.c.

#define IOC4_SIO_IR_S2_TX_EXPLICIT   0x00800000 /* */

Definition at line 89 of file ioc4_serial.c.

#define IOC4_SIO_IR_S2_TX_MT   0x00010000 /* Serial port 2 */

Definition at line 82 of file ioc4_serial.c.

#define IOC4_SIO_IR_S3
Value:
IOC4_SIO_IR_S3_RX_FULL | \
IOC4_SIO_IR_S3_RX_HIGH | \
IOC4_SIO_IR_S3_RX_TIMER | \
IOC4_SIO_IR_S3_DELTA_DCD | \
IOC4_SIO_IR_S3_DELTA_CTS | \
IOC4_SIO_IR_S3_INT | \
IOC4_SIO_IR_S3_TX_EXPLICIT)

Definition at line 124 of file ioc4_serial.c.

#define IOC4_SIO_IR_S3_DELTA_CTS   0x20000000 /* */

Definition at line 95 of file ioc4_serial.c.

#define IOC4_SIO_IR_S3_DELTA_DCD   0x10000000 /* */

Definition at line 94 of file ioc4_serial.c.

#define IOC4_SIO_IR_S3_INT   0x40000000 /* */

Definition at line 96 of file ioc4_serial.c.

#define IOC4_SIO_IR_S3_RX_FULL   0x02000000 /* */

Definition at line 91 of file ioc4_serial.c.

#define IOC4_SIO_IR_S3_RX_HIGH   0x04000000 /* */

Definition at line 92 of file ioc4_serial.c.

#define IOC4_SIO_IR_S3_RX_TIMER   0x08000000 /* */

Definition at line 93 of file ioc4_serial.c.

#define IOC4_SIO_IR_S3_TX_EXPLICIT   0x80000000 /* */

Definition at line 97 of file ioc4_serial.c.

#define IOC4_SIO_IR_S3_TX_MT   0x01000000 /* Serial port 3 */

Definition at line 90 of file ioc4_serial.c.

#define IOC4_SRCIR_ARM   0x80000000 /* Arm RX timer */

Definition at line 209 of file ioc4_serial.c.

#define IOC4_SRTR_CNT   0x00000fff /* Reload value for RX timer */

Definition at line 231 of file ioc4_serial.c.

#define IOC4_SRTR_CNT_VAL   0x0fff0000 /* Current value of RX timer */

Definition at line 232 of file ioc4_serial.c.

#define IOC4_SRTR_CNT_VAL_SHIFT   16

Definition at line 233 of file ioc4_serial.c.

#define IOC4_SRTR_HZ   16000 /* SRTR clock frequency */

Definition at line 234 of file ioc4_serial.c.

#define IOC4_SSCR_DIAG   0x00200000 /* Bypass clock divider for sim */

Definition at line 196 of file ioc4_serial.c.

#define IOC4_SSCR_DMA_EN   0x10000000 /* Enable ring buffer DMA */

Definition at line 198 of file ioc4_serial.c.

#define IOC4_SSCR_DMA_PAUSE   0x20000000 /* Pause DMA */

Definition at line 199 of file ioc4_serial.c.

#define IOC4_SSCR_HFC_EN   0x00020000 /* Hardware flow control enabled */

Definition at line 193 of file ioc4_serial.c.

#define IOC4_SSCR_PAUSE_STATE   0x40000000 /* Sets when PAUSE takes effect */

Definition at line 200 of file ioc4_serial.c.

#define IOC4_SSCR_RESET   0x80000000 /* Reset DMA channels */

Definition at line 201 of file ioc4_serial.c.

#define IOC4_SSCR_RX_DRAIN   0x08000000 /* Drain RX buffer to memory */

Definition at line 197 of file ioc4_serial.c.

#define IOC4_SSCR_RX_RING_CTS   0x00080000 /* Post RX record on delta-CTS */

Definition at line 195 of file ioc4_serial.c.

#define IOC4_SSCR_RX_RING_DCD   0x00040000 /* Post RX record on delta-DCD */

Definition at line 194 of file ioc4_serial.c.

#define IOC4_SSCR_RX_THRESHOLD   0x000001ff /* Hiwater mark */

Definition at line 191 of file ioc4_serial.c.

#define IOC4_SSCR_TX_TIMER_BUSY   0x00010000 /* TX timer in progress */

Definition at line 192 of file ioc4_serial.c.

#define IOC4_TXCB_DELAY   0xc0 /* Delay data<7:0> mSec */

Definition at line 185 of file ioc4_serial.c.

#define IOC4_TXCB_INT_WHEN_DONE   0x20 /* Interrupt after this byte is sent */

Definition at line 181 of file ioc4_serial.c.

#define IOC4_TXCB_INVALID   0x00 /* Byte is invalid */

Definition at line 182 of file ioc4_serial.c.

#define IOC4_TXCB_MCR   0x80 /* Data<7:0> to modem control reg */

Definition at line 184 of file ioc4_serial.c.

#define IOC4_TXCB_VALID   0x40 /* Byte is valid */

Definition at line 183 of file ioc4_serial.c.

#define IOC4_W_IEC   1

Definition at line 297 of file ioc4_serial.c.

#define IOC4_W_IES   0

Definition at line 296 of file ioc4_serial.c.

#define LCR_MASK_BITS_CHAR
Value:

Definition at line 367 of file ioc4_serial.c.

#define LCR_MASK_STOP_BITS   (UART_LCR_STOP)

Definition at line 369 of file ioc4_serial.c.

#define LOWAT_WRITTEN   0x04

Definition at line 503 of file ioc4_serial.c.

#define MAX_BAUD_SUPPORTED   115200

Definition at line 335 of file ioc4_serial.c.

#define MAX_IOC4_INTR_ENTS   (8 * sizeof(uint32_t))

Definition at line 410 of file ioc4_serial.c.

#define MAXITER   10000000

Definition at line 623 of file ioc4_serial.c.

#define MIN_BAUD_SUPPORTED   1200

Definition at line 334 of file ioc4_serial.c.

#define N_ALL
Value:
N_PARITY_ERROR | N_FRAMING_ERROR | \
N_OVERRUN_ERROR | N_DDCD | N_DCTS)

Definition at line 359 of file ioc4_serial.c.

#define N_ALL_ERRORS   (N_PARITY_ERROR | N_FRAMING_ERROR | N_OVERRUN_ERROR)

Definition at line 357 of file ioc4_serial.c.

#define N_ALL_INPUT
Value:
N_PARITY_ERROR | N_FRAMING_ERROR | \
N_OVERRUN_ERROR | N_DDCD | N_DCTS)

Definition at line 351 of file ioc4_serial.c.

#define N_ALL_OUTPUT   N_OUTPUT_LOWAT

Definition at line 355 of file ioc4_serial.c.

#define N_BREAK   0x04

Definition at line 344 of file ioc4_serial.c.

#define N_DATA_READY   0x01

Definition at line 342 of file ioc4_serial.c.

#define N_DCTS   0x80

Definition at line 349 of file ioc4_serial.c.

#define N_DDCD   0x40

Definition at line 348 of file ioc4_serial.c.

#define N_FRAMING_ERROR   0x10

Definition at line 346 of file ioc4_serial.c.

#define N_OUTPUT_LOWAT   0x02

Definition at line 343 of file ioc4_serial.c.

#define N_OVERRUN_ERROR   0x20

Definition at line 347 of file ioc4_serial.c.

#define N_PARITY_ERROR   0x08

Definition at line 345 of file ioc4_serial.c.

#define NCS_BREAK   0x1

Definition at line 328 of file ioc4_serial.c.

#define NCS_FRAMING   0x4

Definition at line 330 of file ioc4_serial.c.

#define NCS_OVERRUN   0x8

Definition at line 331 of file ioc4_serial.c.

#define NCS_PARITY   0x2

Definition at line 329 of file ioc4_serial.c.

#define PENDING (   _p)    (readl(&(_p)->ip_mem->sio_ir.raw) & _p->ip_ienb)

Definition at line 371 of file ioc4_serial.c.

#define PORT_ACTIVE   0x10

Definition at line 505 of file ioc4_serial.c.

#define PORT_INACTIVE   0 /* This is the value when "off" */

Definition at line 506 of file ioc4_serial.c.

#define PROD_CONS_MASK   IOC4_PROD_CONS_PTR_4K

Definition at line 382 of file ioc4_serial.c.

#define PROTO_RS232   3

Definition at line 338 of file ioc4_serial.c.

#define PROTO_RS422   7

Definition at line 339 of file ioc4_serial.c.

#define READ_ABORTED   0x08

Definition at line 504 of file ioc4_serial.c.

#define READ_SIO_IR (   _p)    readl(&(_p)->ip_mem->sio_ir.raw)

Definition at line 372 of file ioc4_serial.c.

#define RING (   _p,
  _wh 
)    &(((struct ring_buffer *)((_p)->ip_cpu_ringbuf))->_wh)

Definition at line 619 of file ioc4_serial.c.

#define ring_allsc   u.all.allsc

Definition at line 600 of file ioc4_serial.c.

#define RING_ANY_VALID   ((uint32_t)(IOC4_RXSB_MODEM_VALID | IOC4_RXSB_DATA_VALID) * 0x01010101)

Definition at line 595 of file ioc4_serial.c.

#define RING_BUF_SIZE   4096

Definition at line 380 of file ioc4_serial.c.

#define ring_data   u.s.data

Definition at line 599 of file ioc4_serial.c.

#define ring_sc   u.s.sc

Definition at line 598 of file ioc4_serial.c.

#define SER_DIVISOR (   _x,
  clk 
)    (((clk) + (_x) * 8) / ((_x) * 16))

Definition at line 363 of file ioc4_serial.c.

#define TOTAL_RING_BUF_SIZE   (RING_BUF_SIZE * 4)

Definition at line 385 of file ioc4_serial.c.

#define TX_LOWAT_CHARS (   baud)    (baud / 10 / TX_LOWAT_HZ)

Definition at line 498 of file ioc4_serial.c.

#define TX_LOWAT_HZ   (1000000 / TX_LOWAT_LATENCY)

Definition at line 497 of file ioc4_serial.c.

#define TX_LOWAT_LATENCY   1000

Definition at line 496 of file ioc4_serial.c.

#define UART_PORT_COUNT   2 /* one for each mode */

Definition at line 394 of file ioc4_serial.c.

#define UART_PORT_MIN   0

Definition at line 391 of file ioc4_serial.c.

#define UART_PORT_RS232   UART_PORT_MIN

Definition at line 392 of file ioc4_serial.c.

#define UART_PORT_RS422   1

Definition at line 393 of file ioc4_serial.c.

#define WAKEUP_CHARS   256

Definition at line 310 of file ioc4_serial.c.

Typedef Documentation

typedef void ioc4_intr_func_f(void *, uint32_t)

Definition at line 299 of file ioc4_serial.c.

Definition at line 300 of file ioc4_serial.c.

Function Documentation

int ioc4_serial_attach_one ( struct ioc4_driver_data idd)

ioc4_serial_attach_one - register attach function called per card found from IOC4 master module. : Master module data for this IOC4

Definition at line 2765 of file ioc4_serial.c.

late_initcall ( ioc4_serial_init  )
MODULE_AUTHOR ( "Pat Gefre - Silicon Graphics Inc. (SGI) <[email protected]>"  )
MODULE_DESCRIPTION ( "Serial PCI driver module for SGI IOC4 Base-IO Card"  )
module_exit ( ioc4_serial_exit  )
MODULE_LICENSE ( "GPL"  )

Variable Documentation