Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros
io_ionsp.h File Reference

Go to the source code of this file.

Data Structures

struct  int_status_pkt
 

Macros

#define GET_INT_STATUS_SIZE(NumPorts)   (sizeof(__u16) + (sizeof(__u16) * (NumPorts)))
 
#define IOSP_DATA_HDR_SIZE   2
 
#define IOSP_CMD_HDR_SIZE   2
 
#define IOSP_MAX_DATA_LENGTH   0x0FFF
 
#define IOSP_PORT_MASK   0x07
 
#define IOSP_CMD_STAT_BIT   0x80
 
#define IS_CMD_STAT_HDR(Byte1)   ((Byte1) & IOSP_CMD_STAT_BIT)
 
#define IS_DATA_HDR(Byte1)   (!IS_CMD_STAT_HDR(Byte1))
 
#define IOSP_GET_HDR_PORT(Byte1)   ((__u8) ((Byte1) & IOSP_PORT_MASK))
 
#define IOSP_GET_HDR_DATA_LEN(Byte1, Byte2)   ((__u16) (((__u16)((Byte1) & 0x78)) << 5) | (Byte2))
 
#define IOSP_GET_STATUS_CODE(Byte1)   ((__u8) (((Byte1) & 0x78) >> 3))
 
#define IOSP_BUILD_DATA_HDR1(Port, Len)   ((__u8) (((Port) | ((__u8) (((__u16) (Len)) >> 5) & 0x78))))
 
#define IOSP_BUILD_DATA_HDR2(Port, Len)   ((__u8) (Len))
 
#define IOSP_BUILD_CMD_HDR1(Port, Cmd)   ((__u8) (IOSP_CMD_STAT_BIT | (Port) | ((__u8) ((Cmd) << 3))))
 
#define IOSP_WRITE_UART_REG(n)   ((n) & 0x07)
 
#define IOSP_EXT_CMD   0x09
 
#define IOSP_CMD_OPEN_PORT   0x00
 
#define IOSP_CMD_CLOSE_PORT   0x01
 
#define IOSP_CMD_CHASE_PORT   0x02
 
#define IOSP_CMD_SET_RX_FLOW   0x03
 
#define IOSP_CMD_SET_TX_FLOW   0x04
 
#define IOSP_CMD_SET_XON_CHAR   0x05
 
#define IOSP_CMD_SET_XOFF_CHAR   0x06
 
#define IOSP_CMD_RX_CHECK_REQ   0x07
 
#define IOSP_CMD_SET_BREAK   0x08
 
#define IOSP_CMD_CLEAR_BREAK   0x09
 
#define MAKE_CMD_WRITE_REG(ppBuf, pLen, Port, Reg, Val)
 
#define MAKE_CMD_EXT_CMD(ppBuf, pLen, Port, ExtCmd, Param)
 
#define IOSP_RX_FLOW_RTS   0x01
 
#define IOSP_RX_FLOW_DTR   0x02
 
#define IOSP_RX_FLOW_DSR_SENSITIVITY   0x04
 
#define IOSP_RX_FLOW_XON_XOFF   0x08
 
#define IOSP_TX_FLOW_CTS   0x01
 
#define IOSP_TX_FLOW_DSR   0x02
 
#define IOSP_TX_FLOW_DCD   0x04
 
#define IOSP_TX_FLOW_XON_XOFF   0x08
 
#define IOSP_TX_FLOW_XOFF_CONTINUE   0x10
 
#define IOSP_TX_TOGGLE_RTS   0x20
 
#define IOSP_STATUS_LSR   0x00
 
#define IOSP_STATUS_MSR   0x01
 
#define IOSP_STATUS_LSR_DATA   0x08
 
#define IOSP_EXT_STATUS   0x09
 
#define IOSP_EXT_STATUS_CHASE_RSP   0
 
#define IOSP_EXT_STATUS_CHASE_PASS   0
 
#define IOSP_EXT_STATUS_CHASE_FAIL   1
 
#define IOSP_EXT_STATUS_RX_CHECK_RSP   1
 
#define IOSP_STATUS_OPEN_RSP   0x0A
 
#define GET_TX_BUFFER_SIZE(P2)   (((P2) + 1) * 64)
 
#define IOSP_EXT4_STATUS   0x0C
 
#define IOSP_GET_STATUS_LEN(code)   ((code) < 8 ? 2 : ((code) < 0x0A ? 3 : 4))
 
#define IOSP_STATUS_IS_2BYTE(code)   ((code) < 0x08)
 
#define IOSP_STATUS_IS_3BYTE(code)   (((code) >= 0x08) && ((code) <= 0x0B))
 
#define IOSP_STATUS_IS_4BYTE(code)   (((code) >= 0x0C) && ((code) <= 0x0D))
 

Macro Definition Documentation

#define GET_INT_STATUS_SIZE (   NumPorts)    (sizeof(__u16) + (sizeof(__u16) * (NumPorts)))

Definition at line 99 of file io_ionsp.h.

#define GET_TX_BUFFER_SIZE (   P2)    (((P2) + 1) * 64)

Definition at line 428 of file io_ionsp.h.

#define IOSP_BUILD_CMD_HDR1 (   Port,
  Cmd 
)    ((__u8) (IOSP_CMD_STAT_BIT | (Port) | ((__u8) ((Cmd) << 3))))

Definition at line 135 of file io_ionsp.h.

#define IOSP_BUILD_DATA_HDR1 (   Port,
  Len 
)    ((__u8) (((Port) | ((__u8) (((__u16) (Len)) >> 5) & 0x78))))

Definition at line 128 of file io_ionsp.h.

#define IOSP_BUILD_DATA_HDR2 (   Port,
  Len 
)    ((__u8) (Len))

Definition at line 129 of file io_ionsp.h.

#define IOSP_CMD_CHASE_PORT   0x02

Definition at line 180 of file io_ionsp.h.

#define IOSP_CMD_CLEAR_BREAK   0x09

Definition at line 190 of file io_ionsp.h.

#define IOSP_CMD_CLOSE_PORT   0x01

Definition at line 179 of file io_ionsp.h.

#define IOSP_CMD_HDR_SIZE   2

Definition at line 110 of file io_ionsp.h.

#define IOSP_CMD_OPEN_PORT   0x00

Definition at line 178 of file io_ionsp.h.

#define IOSP_CMD_RX_CHECK_REQ   0x07

Definition at line 185 of file io_ionsp.h.

#define IOSP_CMD_SET_BREAK   0x08

Definition at line 189 of file io_ionsp.h.

#define IOSP_CMD_SET_RX_FLOW   0x03

Definition at line 181 of file io_ionsp.h.

#define IOSP_CMD_SET_TX_FLOW   0x04

Definition at line 182 of file io_ionsp.h.

#define IOSP_CMD_SET_XOFF_CHAR   0x06

Definition at line 184 of file io_ionsp.h.

#define IOSP_CMD_SET_XON_CHAR   0x05

Definition at line 183 of file io_ionsp.h.

#define IOSP_CMD_STAT_BIT   0x80

Definition at line 115 of file io_ionsp.h.

#define IOSP_DATA_HDR_SIZE   2

Definition at line 109 of file io_ionsp.h.

#define IOSP_EXT4_STATUS   0x0C

Definition at line 437 of file io_ionsp.h.

#define IOSP_EXT_CMD   0x09

Definition at line 169 of file io_ionsp.h.

#define IOSP_EXT_STATUS   0x09

Definition at line 406 of file io_ionsp.h.

#define IOSP_EXT_STATUS_CHASE_FAIL   1

Definition at line 413 of file io_ionsp.h.

#define IOSP_EXT_STATUS_CHASE_PASS   0

Definition at line 412 of file io_ionsp.h.

#define IOSP_EXT_STATUS_CHASE_RSP   0

Definition at line 411 of file io_ionsp.h.

#define IOSP_EXT_STATUS_RX_CHECK_RSP   1

Definition at line 417 of file io_ionsp.h.

#define IOSP_GET_HDR_DATA_LEN (   Byte1,
  Byte2 
)    ((__u16) (((__u16)((Byte1) & 0x78)) << 5) | (Byte2))

Definition at line 121 of file io_ionsp.h.

#define IOSP_GET_HDR_PORT (   Byte1)    ((__u8) ((Byte1) & IOSP_PORT_MASK))

Definition at line 120 of file io_ionsp.h.

#define IOSP_GET_STATUS_CODE (   Byte1)    ((__u8) (((Byte1) & 0x78) >> 3))

Definition at line 122 of file io_ionsp.h.

#define IOSP_GET_STATUS_LEN (   code)    ((code) < 8 ? 2 : ((code) < 0x0A ? 3 : 4))

Definition at line 450 of file io_ionsp.h.

#define IOSP_MAX_DATA_LENGTH   0x0FFF

Definition at line 112 of file io_ionsp.h.

#define IOSP_PORT_MASK   0x07

Definition at line 114 of file io_ionsp.h.

#define IOSP_RX_FLOW_DSR_SENSITIVITY   0x04

Definition at line 243 of file io_ionsp.h.

#define IOSP_RX_FLOW_DTR   0x02

Definition at line 242 of file io_ionsp.h.

#define IOSP_RX_FLOW_RTS   0x01

Definition at line 241 of file io_ionsp.h.

#define IOSP_RX_FLOW_XON_XOFF   0x08

Definition at line 246 of file io_ionsp.h.

#define IOSP_STATUS_IS_2BYTE (   code)    ((code) < 0x08)

Definition at line 452 of file io_ionsp.h.

#define IOSP_STATUS_IS_3BYTE (   code)    (((code) >= 0x08) && ((code) <= 0x0B))

Definition at line 453 of file io_ionsp.h.

#define IOSP_STATUS_IS_4BYTE (   code)    (((code) >= 0x0C) && ((code) <= 0x0D))

Definition at line 454 of file io_ionsp.h.

#define IOSP_STATUS_LSR   0x00

Definition at line 370 of file io_ionsp.h.

#define IOSP_STATUS_LSR_DATA   0x08

Definition at line 401 of file io_ionsp.h.

#define IOSP_STATUS_MSR   0x01

Definition at line 381 of file io_ionsp.h.

#define IOSP_STATUS_OPEN_RSP   0x0A

Definition at line 420 of file io_ionsp.h.

#define IOSP_TX_FLOW_CTS   0x01

Definition at line 262 of file io_ionsp.h.

#define IOSP_TX_FLOW_DCD   0x04

Definition at line 264 of file io_ionsp.h.

#define IOSP_TX_FLOW_DSR   0x02

Definition at line 263 of file io_ionsp.h.

#define IOSP_TX_FLOW_XOFF_CONTINUE   0x10

Definition at line 270 of file io_ionsp.h.

#define IOSP_TX_FLOW_XON_XOFF   0x08

Definition at line 265 of file io_ionsp.h.

#define IOSP_TX_TOGGLE_RTS   0x20

Definition at line 278 of file io_ionsp.h.

#define IOSP_WRITE_UART_REG (   n)    ((n) & 0x07)

Definition at line 163 of file io_ionsp.h.

#define IS_CMD_STAT_HDR (   Byte1)    ((Byte1) & IOSP_CMD_STAT_BIT)

Definition at line 117 of file io_ionsp.h.

#define IS_DATA_HDR (   Byte1)    (!IS_CMD_STAT_HDR(Byte1))

Definition at line 118 of file io_ionsp.h.

#define MAKE_CMD_EXT_CMD (   ppBuf,
  pLen,
  Port,
  ExtCmd,
  Param 
)
Value:
do { \
(*(ppBuf))[0] = IOSP_BUILD_CMD_HDR1((Port), IOSP_EXT_CMD); \
(*(ppBuf))[1] = (ExtCmd); \
(*(ppBuf))[2] = (Param); \
\
*ppBuf += 3; \
*pLen += 3; \
} while (0)

Definition at line 207 of file io_ionsp.h.

#define MAKE_CMD_WRITE_REG (   ppBuf,
  pLen,
  Port,
  Reg,
  Val 
)
Value:
do { \
(*(ppBuf))[0] = IOSP_BUILD_CMD_HDR1((Port), \
(*(ppBuf))[1] = (Val); \
\
*ppBuf += 2; \
*pLen += 2; \
} while (0)

Definition at line 197 of file io_ionsp.h.