Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
capiutil.h File Reference
#include <asm/types.h>

Go to the source code of this file.

Data Structures

struct  _cmsg
 
struct  _cdebbuf
 

Macros

#define CAPIMSG_BASELEN   8
 
#define CAPIMSG_U8(m, off)   (m[off])
 
#define CAPIMSG_U16(m, off)   (m[off]|(m[(off)+1]<<8))
 
#define CAPIMSG_U32(m, off)   (m[off]|(m[(off)+1]<<8)|(m[(off)+2]<<16)|(m[(off)+3]<<24))
 
#define CAPIMSG_LEN(m)   CAPIMSG_U16(m,0)
 
#define CAPIMSG_APPID(m)   CAPIMSG_U16(m,2)
 
#define CAPIMSG_COMMAND(m)   CAPIMSG_U8(m,4)
 
#define CAPIMSG_SUBCOMMAND(m)   CAPIMSG_U8(m,5)
 
#define CAPIMSG_CMD(m)   (((m[4])<<8)|(m[5]))
 
#define CAPIMSG_MSGID(m)   CAPIMSG_U16(m,6)
 
#define CAPIMSG_CONTROLLER(m)   (m[8] & 0x7f)
 
#define CAPIMSG_CONTROL(m)   CAPIMSG_U32(m, 8)
 
#define CAPIMSG_NCCI(m)   CAPIMSG_CONTROL(m)
 
#define CAPIMSG_DATALEN(m)   CAPIMSG_U16(m,16) /* DATA_B3_REQ */
 
#define CAPIMSG_SETLEN(m, len)   capimsg_setu16(m, 0, len)
 
#define CAPIMSG_SETAPPID(m, applid)   capimsg_setu16(m, 2, applid)
 
#define CAPIMSG_SETCOMMAND(m, cmd)   capimsg_setu8(m, 4, cmd)
 
#define CAPIMSG_SETSUBCOMMAND(m, cmd)   capimsg_setu8(m, 5, cmd)
 
#define CAPIMSG_SETMSGID(m, msgid)   capimsg_setu16(m, 6, msgid)
 
#define CAPIMSG_SETCONTROL(m, contr)   capimsg_setu32(m, 8, contr)
 
#define CAPIMSG_SETDATALEN(m, len)   capimsg_setu16(m, 16, len)
 
#define CDEBUG_SIZE   1024
 
#define CDEBUG_GSIZE   4096
 

Typedefs

typedef __u8_cstruct
 

Enumerations

enum  _cmstruct { CAPI_COMPOSE, CAPI_DEFAULT }
 

Functions

unsigned capi_cmsg2message (_cmsg *cmsg, __u8 *msg)
 
unsigned capi_message2cmsg (_cmsg *cmsg, __u8 *msg)
 
unsigned capi_cmsg_header (_cmsg *cmsg, __u16 _ApplId, __u8 _Command, __u8 _Subcommand, __u16 _Messagenumber, __u32 _Controller)
 
charcapi_info2str (__u16 reason)
 
charcapi_cmd2str (__u8 cmd, __u8 subcmd)
 
void cdebbuf_free (_cdebbuf *cdb)
 
int cdebug_init (void)
 
void cdebug_exit (void)
 
_cdebbufcapi_cmsg2str (_cmsg *cmsg)
 
_cdebbufcapi_message2str (__u8 *msg)
 

Macro Definition Documentation

#define CAPIMSG_APPID (   m)    CAPIMSG_U16(m,2)

Definition at line 23 of file capiutil.h.

#define CAPIMSG_BASELEN   8

Definition at line 18 of file capiutil.h.

#define CAPIMSG_CMD (   m)    (((m[4])<<8)|(m[5]))

Definition at line 26 of file capiutil.h.

#define CAPIMSG_COMMAND (   m)    CAPIMSG_U8(m,4)

Definition at line 24 of file capiutil.h.

#define CAPIMSG_CONTROL (   m)    CAPIMSG_U32(m, 8)

Definition at line 29 of file capiutil.h.

#define CAPIMSG_CONTROLLER (   m)    (m[8] & 0x7f)

Definition at line 28 of file capiutil.h.

#define CAPIMSG_DATALEN (   m)    CAPIMSG_U16(m,16) /* DATA_B3_REQ */

Definition at line 31 of file capiutil.h.

#define CAPIMSG_LEN (   m)    CAPIMSG_U16(m,0)

Definition at line 22 of file capiutil.h.

#define CAPIMSG_MSGID (   m)    CAPIMSG_U16(m,6)

Definition at line 27 of file capiutil.h.

#define CAPIMSG_NCCI (   m)    CAPIMSG_CONTROL(m)

Definition at line 30 of file capiutil.h.

#define CAPIMSG_SETAPPID (   m,
  applid 
)    capimsg_setu16(m, 2, applid)

Definition at line 53 of file capiutil.h.

#define CAPIMSG_SETCOMMAND (   m,
  cmd 
)    capimsg_setu8(m, 4, cmd)

Definition at line 54 of file capiutil.h.

#define CAPIMSG_SETCONTROL (   m,
  contr 
)    capimsg_setu32(m, 8, contr)

Definition at line 57 of file capiutil.h.

#define CAPIMSG_SETDATALEN (   m,
  len 
)    capimsg_setu16(m, 16, len)

Definition at line 58 of file capiutil.h.

#define CAPIMSG_SETLEN (   m,
  len 
)    capimsg_setu16(m, 0, len)

Definition at line 52 of file capiutil.h.

#define CAPIMSG_SETMSGID (   m,
  msgid 
)    capimsg_setu16(m, 6, msgid)

Definition at line 56 of file capiutil.h.

#define CAPIMSG_SETSUBCOMMAND (   m,
  cmd 
)    capimsg_setu8(m, 5, cmd)

Definition at line 55 of file capiutil.h.

#define CAPIMSG_SUBCOMMAND (   m)    CAPIMSG_U8(m,5)

Definition at line 25 of file capiutil.h.

#define CAPIMSG_U16 (   m,
  off 
)    (m[off]|(m[(off)+1]<<8))

Definition at line 20 of file capiutil.h.

#define CAPIMSG_U32 (   m,
  off 
)    (m[off]|(m[(off)+1]<<8)|(m[(off)+2]<<16)|(m[(off)+3]<<24))

Definition at line 21 of file capiutil.h.

#define CAPIMSG_U8 (   m,
  off 
)    (m[off])

Definition at line 19 of file capiutil.h.

#define CDEBUG_GSIZE   4096

Definition at line 188 of file capiutil.h.

#define CDEBUG_SIZE   1024

Definition at line 187 of file capiutil.h.

Typedef Documentation

typedef __u8* _cstruct

Definition at line 62 of file capiutil.h.

Enumeration Type Documentation

enum _cmstruct
Enumerator:
CAPI_COMPOSE 
CAPI_DEFAULT 

Definition at line 64 of file capiutil.h.

Function Documentation

char* capi_cmd2str ( u8  cmd,
u8  subcmd 
)

capi_cmd2str() - convert CAPI 2.0 command/subcommand number to name : command number : subcommand number

Return value: static string, NULL if command/subcommand unknown

Definition at line 678 of file capiutil.c.

unsigned capi_cmsg2message ( _cmsg cmsg,
u8 msg 
)

capi_cmsg2message() - assemble CAPI 2.0 message from _cmsg structure : _cmsg structure : buffer for assembled message

Return value: 0 for success

Definition at line 502 of file capiutil.c.

_cdebbuf* capi_cmsg2str ( _cmsg cmsg)

Definition at line 1049 of file capiutil.c.

unsigned capi_cmsg_header ( _cmsg cmsg,
u16  _ApplId,
u8  _Command,
u8  _Subcommand,
u16  _Messagenumber,
u32  _Controller 
)

capi_cmsg_header() - initialize header part of _cmsg structure : _cmsg structure : ApplID field value : Command field value : Subcommand field value : Message Number field value : Controller/PLCI/NCCI field value

Return value: 0 for success

Definition at line 603 of file capiutil.c.

char* capi_info2str ( __u16  reason)

Definition at line 26 of file capiutil.c.

unsigned capi_message2cmsg ( _cmsg cmsg,
u8 msg 
)

capi_message2cmsg() - disassemble CAPI 2.0 message into _cmsg structure : _cmsg structure : buffer for assembled message

Return value: 0 for success

Definition at line 572 of file capiutil.c.

_cdebbuf* capi_message2str ( __u8 msg)

Definition at line 1044 of file capiutil.c.

void cdebbuf_free ( _cdebbuf cdb)

Definition at line 1054 of file capiutil.c.

void cdebug_exit ( void  )

Definition at line 1063 of file capiutil.c.

int cdebug_init ( void  )

Definition at line 1058 of file capiutil.c.