Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
ioc3_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/serial_core.h>
#include <linux/ioc3.h>
#include <linux/slab.h>

Go to the source code of this file.

Data Structures

struct  ioc3_card
 
struct  ioc3_port
 
struct  port_hooks
 
struct  ring_entry
 
struct  ring
 
struct  ring_buffer
 

Macros

#define LOGICAL_PORTS   2 /* rs232(0) and rs422(1) */
 
#define PORTS_PER_CARD   2
 
#define LOGICAL_PORTS_PER_CARD   (PORTS_PER_CARD * LOGICAL_PORTS)
 
#define MAX_CARDS   8
 
#define MAX_LOGICAL_PORTS   (LOGICAL_PORTS_PER_CARD * MAX_CARDS)
 
#define GET_PORT_FROM_SIO_IR(_x)   (_x & SIO_IR_SA) ? 0 : 1
 
#define GET_PHYSICAL_PORT(_x)   ((_x) >> 1)
 
#define GET_LOGICAL_PORT(_x)   ((_x) & 1)
 
#define IS_PHYSICAL_PORT(_x)   !((_x) & 1)
 
#define IS_RS232(_x)   !((_x) & 1)
 
#define DPRINT_CONFIG(_x...)   ;
 
#define NOT_PROGRESS()   ;
 
#define MAX_CHARS   256
 
#define FIFO_SIZE   (MAX_CHARS-1) /* it's a uchar */
 
#define DEVICE_NAME   "ttySIOC"
 
#define DEVICE_MAJOR   204
 
#define DEVICE_MINOR   116
 
#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   0
 
#define PROTO_RS422   1
 
#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
 
#define N_ALL
 
#define SER_CLK_SPEED(prediv)   ((22000000 << 1) / prediv)
 
#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(_a, _p)   (readl(&(_p)->vma->sio_ir) & (_a)->ic_enable)
 
#define RING_BUF_SIZE   4096
 
#define BUF_SIZE_BIT   SBBR_L_SIZE
 
#define PROD_CONS_MASK   PROD_CONS_PTR_4K
 
#define TOTAL_RING_BUF_SIZE   (RING_BUF_SIZE * 4)
 
#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 INPUT_ENABLE   0x10
 
#define RING_ANY_VALID   ((uint32_t)(RXSB_MODEM_VALID | 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
 

Functions

 module_init (ioc3uart_init)
 
 module_exit (ioc3uart_exit)
 
 MODULE_AUTHOR ("Pat Gefre - Silicon Graphics Inc. (SGI) <[email protected]>")
 
 MODULE_DESCRIPTION ("Serial PCI driver module for SGI IOC3 card")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define BUF_SIZE_BIT   SBBR_L_SIZE

Definition at line 117 of file ioc3_serial.c.

#define DCD_ON   0x02

Definition at line 192 of file ioc3_serial.c.

#define DEVICE_MAJOR   204

Definition at line 65 of file ioc3_serial.c.

#define DEVICE_MINOR   116

Definition at line 66 of file ioc3_serial.c.

#define DEVICE_NAME   "ttySIOC"

Definition at line 64 of file ioc3_serial.c.

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

Definition at line 107 of file ioc3_serial.c.

#define DPRINT_CONFIG (   _x...)    ;

Definition at line 54 of file ioc3_serial.c.

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

Definition at line 281 of file ioc3_serial.c.

#define FIFO_SIZE   (MAX_CHARS-1) /* it's a uchar */

Definition at line 61 of file ioc3_serial.c.

#define GET_LOGICAL_PORT (   _x)    ((_x) & 1)

Definition at line 45 of file ioc3_serial.c.

#define GET_PHYSICAL_PORT (   _x)    ((_x) >> 1)

Definition at line 44 of file ioc3_serial.c.

#define GET_PORT_FROM_SIO_IR (   _x)    (_x & SIO_IR_SA) ? 0 : 1

Definition at line 37 of file ioc3_serial.c.

#define INPUT_ENABLE   0x10

Definition at line 199 of file ioc3_serial.c.

#define INPUT_HIGH   0x01

Definition at line 187 of file ioc3_serial.c.

#define IS_PHYSICAL_PORT (   _x)    !((_x) & 1)

Definition at line 46 of file ioc3_serial.c.

#define IS_RS232 (   _x)    !((_x) & 1)

Definition at line 47 of file ioc3_serial.c.

#define LCR_MASK_BITS_CHAR
Value:

Definition at line 110 of file ioc3_serial.c.

#define LCR_MASK_STOP_BITS   (UART_LCR_STOP)

Definition at line 112 of file ioc3_serial.c.

#define LOGICAL_PORTS   2 /* rs232(0) and rs422(1) */

Definition at line 30 of file ioc3_serial.c.

#define LOGICAL_PORTS_PER_CARD   (PORTS_PER_CARD * LOGICAL_PORTS)

Definition at line 32 of file ioc3_serial.c.

#define LOWAT_WRITTEN   0x04

Definition at line 194 of file ioc3_serial.c.

#define MAX_BAUD_SUPPORTED   115200

Definition at line 76 of file ioc3_serial.c.

#define MAX_CARDS   8

Definition at line 33 of file ioc3_serial.c.

#define MAX_CHARS   256

Definition at line 60 of file ioc3_serial.c.

#define MAX_LOGICAL_PORTS   (LOGICAL_PORTS_PER_CARD * MAX_CARDS)

Definition at line 34 of file ioc3_serial.c.

#define MAXITER   10000000

Definition at line 300 of file ioc3_serial.c.

#define MIN_BAUD_SUPPORTED   1200

Definition at line 75 of file ioc3_serial.c.

#define N_ALL
#define N_ALL_ERRORS
Value:

Definition at line 98 of file ioc3_serial.c.

#define N_ALL_INPUT
Value:

Definition at line 92 of file ioc3_serial.c.

#define N_ALL_OUTPUT   N_OUTPUT_LOWAT

Definition at line 96 of file ioc3_serial.c.

#define N_BREAK   0x04

Definition at line 85 of file ioc3_serial.c.

#define N_DATA_READY   0x01

Definition at line 83 of file ioc3_serial.c.

#define N_DCTS   0x80

Definition at line 90 of file ioc3_serial.c.

#define N_DDCD   0x40

Definition at line 89 of file ioc3_serial.c.

#define N_FRAMING_ERROR   0x10

Definition at line 87 of file ioc3_serial.c.

#define N_OUTPUT_LOWAT   0x02

Definition at line 84 of file ioc3_serial.c.

#define N_OVERRUN_ERROR   0x20

Definition at line 88 of file ioc3_serial.c.

#define N_PARITY_ERROR   0x08

Definition at line 86 of file ioc3_serial.c.

#define NCS_BREAK   0x1

Definition at line 69 of file ioc3_serial.c.

#define NCS_FRAMING   0x4

Definition at line 71 of file ioc3_serial.c.

#define NCS_OVERRUN   0x8

Definition at line 72 of file ioc3_serial.c.

#define NCS_PARITY   0x2

Definition at line 70 of file ioc3_serial.c.

#define NOT_PROGRESS ( )    ;

Definition at line 56 of file ioc3_serial.c.

#define PENDING (   _a,
  _p 
)    (readl(&(_p)->vma->sio_ir) & (_a)->ic_enable)

Definition at line 114 of file ioc3_serial.c.

#define PORTS_PER_CARD   2

Definition at line 31 of file ioc3_serial.c.

#define PROD_CONS_MASK   PROD_CONS_PTR_4K

Definition at line 118 of file ioc3_serial.c.

#define PROTO_RS232   0

Definition at line 79 of file ioc3_serial.c.

#define PROTO_RS422   1

Definition at line 80 of file ioc3_serial.c.

#define READ_ABORTED   0x08

Definition at line 195 of file ioc3_serial.c.

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

Definition at line 297 of file ioc3_serial.c.

#define ring_allsc   u.all.allsc

Definition at line 278 of file ioc3_serial.c.

#define RING_ANY_VALID   ((uint32_t)(RXSB_MODEM_VALID | RXSB_DATA_VALID) * 0x01010101)

Definition at line 273 of file ioc3_serial.c.

#define RING_BUF_SIZE   4096

Definition at line 116 of file ioc3_serial.c.

#define ring_data   u.s.data

Definition at line 277 of file ioc3_serial.c.

#define ring_sc   u.s.sc

Definition at line 276 of file ioc3_serial.c.

#define SER_CLK_SPEED (   prediv)    ((22000000 << 1) / prediv)

Definition at line 105 of file ioc3_serial.c.

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

Definition at line 106 of file ioc3_serial.c.

#define TOTAL_RING_BUF_SIZE   (RING_BUF_SIZE * 4)

Definition at line 120 of file ioc3_serial.c.

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

Definition at line 184 of file ioc3_serial.c.

#define TX_LOWAT_HZ   (1000000 / TX_LOWAT_LATENCY)

Definition at line 183 of file ioc3_serial.c.

#define TX_LOWAT_LATENCY   1000

Definition at line 182 of file ioc3_serial.c.

Function Documentation

MODULE_AUTHOR ( "Pat Gefre - Silicon Graphics Inc. (SGI) <[email protected]>"  )
MODULE_DESCRIPTION ( "Serial PCI driver module for SGI IOC3 card )
module_exit ( ioc3uart_exit  )
module_init ( ioc3uart_init  )
MODULE_LICENSE ( "GPL"  )