Commit 4793d15b authored by Tilman Schmidt's avatar Tilman Schmidt Committed by David S. Miller

isdn: kerneldoc for capiutil.c

Add kerneldoc comments for the exported funtions in capiutil.c.

Impact: documentation
Signed-off-by: default avatarTilman Schmidt <tilman@imap.cc>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4e329972
...@@ -490,7 +490,14 @@ static void pars_2_message(_cmsg * cmsg) ...@@ -490,7 +490,14 @@ static void pars_2_message(_cmsg * cmsg)
} }
} }
/*-------------------------------------------------------*/ /**
* capi_cmsg2message() - assemble CAPI 2.0 message from _cmsg structure
* @cmsg: _cmsg structure
* @msg: buffer for assembled message
*
* Return value: 0 for success
*/
unsigned capi_cmsg2message(_cmsg * cmsg, u8 * msg) unsigned capi_cmsg2message(_cmsg * cmsg, u8 * msg)
{ {
cmsg->m = msg; cmsg->m = msg;
...@@ -553,7 +560,14 @@ static void message_2_pars(_cmsg * cmsg) ...@@ -553,7 +560,14 @@ static void message_2_pars(_cmsg * cmsg)
} }
} }
/*-------------------------------------------------------*/ /**
* capi_message2cmsg() - disassemble CAPI 2.0 message into _cmsg structure
* @cmsg: _cmsg structure
* @msg: buffer for assembled message
*
* Return value: 0 for success
*/
unsigned capi_message2cmsg(_cmsg * cmsg, u8 * msg) unsigned capi_message2cmsg(_cmsg * cmsg, u8 * msg)
{ {
memset(cmsg, 0, sizeof(_cmsg)); memset(cmsg, 0, sizeof(_cmsg));
...@@ -573,7 +587,18 @@ unsigned capi_message2cmsg(_cmsg * cmsg, u8 * msg) ...@@ -573,7 +587,18 @@ unsigned capi_message2cmsg(_cmsg * cmsg, u8 * msg)
return 0; return 0;
} }
/*-------------------------------------------------------*/ /**
* capi_cmsg_header() - initialize header part of _cmsg structure
* @cmsg: _cmsg structure
* @_ApplId: ApplID field value
* @_Command: Command field value
* @_Subcommand: Subcommand field value
* @_Messagenumber: Message Number field value
* @_Controller: Controller/PLCI/NCCI field value
*
* Return value: 0 for success
*/
unsigned capi_cmsg_header(_cmsg * cmsg, u16 _ApplId, unsigned capi_cmsg_header(_cmsg * cmsg, u16 _ApplId,
u8 _Command, u8 _Subcommand, u8 _Command, u8 _Subcommand,
u16 _Messagenumber, u32 _Controller) u16 _Messagenumber, u32 _Controller)
...@@ -641,6 +666,14 @@ static char *mnames[] = ...@@ -641,6 +666,14 @@ static char *mnames[] =
[0x4e] = "MANUFACTURER_RESP" [0x4e] = "MANUFACTURER_RESP"
}; };
/**
* capi_cmd2str() - convert CAPI 2.0 command/subcommand number to name
* @cmd: command number
* @subcmd: subcommand number
*
* Return value: static string, NULL if command/subcommand unknown
*/
char *capi_cmd2str(u8 cmd, u8 subcmd) char *capi_cmd2str(u8 cmd, u8 subcmd)
{ {
return mnames[command_2_index(cmd, subcmd)]; return mnames[command_2_index(cmd, subcmd)];
...@@ -879,6 +912,11 @@ init: ...@@ -879,6 +912,11 @@ init:
return cdb; return cdb;
} }
/**
* cdebbuf_free() - free CAPI debug buffer
* @cdb: buffer to free
*/
void cdebbuf_free(_cdebbuf *cdb) void cdebbuf_free(_cdebbuf *cdb)
{ {
if (likely(cdb == g_debbuf)) { if (likely(cdb == g_debbuf)) {
...@@ -891,6 +929,16 @@ void cdebbuf_free(_cdebbuf *cdb) ...@@ -891,6 +929,16 @@ void cdebbuf_free(_cdebbuf *cdb)
} }
/**
* capi_message2str() - format CAPI 2.0 message for printing
* @msg: CAPI 2.0 message
*
* Allocates a CAPI debug buffer and fills it with a printable representation
* of the CAPI 2.0 message in @msg.
* Return value: allocated debug buffer, NULL on error
* The returned buffer should be freed by a call to cdebbuf_free() after use.
*/
_cdebbuf *capi_message2str(u8 * msg) _cdebbuf *capi_message2str(u8 * msg)
{ {
_cdebbuf *cdb; _cdebbuf *cdb;
...@@ -926,6 +974,17 @@ _cdebbuf *capi_message2str(u8 * msg) ...@@ -926,6 +974,17 @@ _cdebbuf *capi_message2str(u8 * msg)
return cdb; return cdb;
} }
/**
* capi_cmsg2str() - format _cmsg structure for printing
* @cmsg: _cmsg structure
*
* Allocates a CAPI debug buffer and fills it with a printable representation
* of the CAPI 2.0 message stored in @cmsg by a previous call to
* capi_cmsg2message() or capi_message2cmsg().
* Return value: allocated debug buffer, NULL on error
* The returned buffer should be freed by a call to cdebbuf_free() after use.
*/
_cdebbuf *capi_cmsg2str(_cmsg * cmsg) _cdebbuf *capi_cmsg2str(_cmsg * cmsg)
{ {
_cdebbuf *cdb; _cdebbuf *cdb;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment