Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
capiutil.c File Reference
#include <linux/module.h>
#include <linux/string.h>
#include <linux/ctype.h>
#include <linux/stddef.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/isdn/capiutil.h>
#include <linux/slab.h>

Go to the source code of this file.

Data Structures

struct  _cdef
 

Macros

#define _CBYTE   1
 
#define _CWORD   2
 
#define _CDWORD   3
 
#define _CSTRUCT   4
 
#define _CMSTRUCT   5
 
#define _CEND   6
 
#define byteTLcpy(x, y)   *(u8 *)(x) = *(u8 *)(y);
 
#define wordTLcpy(x, y)   *(u16 *)(x) = *(u16 *)(y);
 
#define dwordTLcpy(x, y)   memcpy(x, y, 4);
 
#define structTLcpy(x, y, l)   memcpy(x, y, l)
 
#define structTLcpyovl(x, y, l)   memmove(x, y, l)
 
#define byteTRcpy(x, y)   *(u8 *)(y) = *(u8 *)(x);
 
#define wordTRcpy(x, y)   *(u16 *)(y) = *(u16 *)(x);
 
#define dwordTRcpy(x, y)   memcpy(y, x, 4);
 
#define structTRcpy(x, y, l)   memcpy(y, x, l)
 
#define structTRcpyovl(x, y, l)   memmove(y, x, l)
 
#define TYP   (cdef[cmsg->par[cmsg->p]].typ)
 
#define OFF   (((u8 *)cmsg) + cdef[cmsg->par[cmsg->p]].off)
 

Functions

charcapi_info2str (u16 reason)
 
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_cmd2str (u8 cmd, u8 subcmd)
 
_cdebbufcapi_message2str (u8 *msg)
 
_cdebbufcapi_cmsg2str (_cmsg *cmsg)
 
void cdebbuf_free (_cdebbuf *cdb)
 
int __init cdebug_init (void)
 
void __exit cdebug_exit (void)
 
 EXPORT_SYMBOL (cdebbuf_free)
 
 EXPORT_SYMBOL (capi_cmsg2message)
 
 EXPORT_SYMBOL (capi_message2cmsg)
 
 EXPORT_SYMBOL (capi_cmsg_header)
 
 EXPORT_SYMBOL (capi_cmd2str)
 
 EXPORT_SYMBOL (capi_cmsg2str)
 
 EXPORT_SYMBOL (capi_message2str)
 
 EXPORT_SYMBOL (capi_info2str)
 

Macro Definition Documentation

#define _CBYTE   1

Definition at line 229 of file capiutil.c.

#define _CDWORD   3

Definition at line 231 of file capiutil.c.

#define _CEND   6

Definition at line 234 of file capiutil.c.

#define _CMSTRUCT   5

Definition at line 233 of file capiutil.c.

#define _CSTRUCT   4

Definition at line 232 of file capiutil.c.

#define _CWORD   2

Definition at line 230 of file capiutil.c.

#define byteTLcpy (   x,
  y 
)    *(u8 *)(x) = *(u8 *)(y);

Definition at line 390 of file capiutil.c.

#define byteTRcpy (   x,
  y 
)    *(u8 *)(y) = *(u8 *)(x);

Definition at line 396 of file capiutil.c.

#define dwordTLcpy (   x,
  y 
)    memcpy(x, y, 4);

Definition at line 392 of file capiutil.c.

#define dwordTRcpy (   x,
  y 
)    memcpy(y, x, 4);

Definition at line 398 of file capiutil.c.

#define OFF   (((u8 *)cmsg) + cdef[cmsg->par[cmsg->p]].off)

Definition at line 417 of file capiutil.c.

#define structTLcpy (   x,
  y,
  l 
)    memcpy(x, y, l)

Definition at line 393 of file capiutil.c.

#define structTLcpyovl (   x,
  y,
  l 
)    memmove(x, y, l)

Definition at line 394 of file capiutil.c.

#define structTRcpy (   x,
  y,
  l 
)    memcpy(y, x, l)

Definition at line 399 of file capiutil.c.

#define structTRcpyovl (   x,
  y,
  l 
)    memmove(y, x, l)

Definition at line 400 of file capiutil.c.

#define TYP   (cdef[cmsg->par[cmsg->p]].typ)

Definition at line 416 of file capiutil.c.

#define wordTLcpy (   x,
  y 
)    *(u16 *)(x) = *(u16 *)(y);

Definition at line 391 of file capiutil.c.

#define wordTRcpy (   x,
  y 
)    *(u16 *)(y) = *(u16 *)(x);

Definition at line 397 of file capiutil.c.

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 __exit cdebug_exit ( void  )

Definition at line 1063 of file capiutil.c.

int __init cdebug_init ( void  )

Definition at line 1058 of file capiutil.c.

EXPORT_SYMBOL ( cdebbuf_free  )
EXPORT_SYMBOL ( capi_cmsg2message  )
EXPORT_SYMBOL ( capi_message2cmsg  )
EXPORT_SYMBOL ( capi_cmsg_header  )
EXPORT_SYMBOL ( capi_cmd2str  )
EXPORT_SYMBOL ( capi_cmsg2str  )
EXPORT_SYMBOL ( capi_message2str  )
EXPORT_SYMBOL ( capi_info2str  )