Skip to content

Commit

Permalink
isdn: kerneldoc for capiutil.c
Browse files Browse the repository at this point in the history
Add kerneldoc comments for the exported funtions in capiutil.c.

Impact: documentation
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tilman Schmidt authored and David S. Miller committed Jun 8, 2009
1 parent 4e32997 commit 4793d15
Showing 1 changed file with 62 additions and 3 deletions.
65 changes: 62 additions & 3 deletions drivers/isdn/capi/capiutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
cmsg->m = msg;
Expand Down Expand Up @@ -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)
{
memset(cmsg, 0, sizeof(_cmsg));
Expand All @@ -573,7 +587,18 @@ unsigned capi_message2cmsg(_cmsg * cmsg, u8 * msg)
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,
u8 _Command, u8 _Subcommand,
u16 _Messagenumber, u32 _Controller)
Expand Down Expand Up @@ -641,6 +666,14 @@ static char *mnames[] =
[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)
{
return mnames[command_2_index(cmd, subcmd)];
Expand Down Expand Up @@ -879,6 +912,11 @@ static _cdebbuf *cdebbuf_alloc(void)
return cdb;
}

/**
* cdebbuf_free() - free CAPI debug buffer
* @cdb: buffer to free
*/

void cdebbuf_free(_cdebbuf *cdb)
{
if (likely(cdb == g_debbuf)) {
Expand All @@ -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 *cdb;
Expand Down Expand Up @@ -926,6 +974,17 @@ _cdebbuf *capi_message2str(u8 * msg)
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 *cdb;
Expand Down

0 comments on commit 4793d15

Please sign in to comment.