aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/capi
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2009-06-07 05:09:23 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-08 03:45:50 -0400
commit4793d15b25821003486bb11b54eaf2f3130ecacd (patch)
tree2283e30056a537b343e2c1d39431457b9bc82b73 /drivers/isdn/capi
parent4e329972052c3649367b91de783f6293b8653cb2 (diff)
isdn: kerneldoc for capiutil.c
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>
Diffstat (limited to 'drivers/isdn/capi')
-rw-r--r--drivers/isdn/capi/capiutil.c65
1 files changed, 62 insertions, 3 deletions
diff --git a/drivers/isdn/capi/capiutil.c b/drivers/isdn/capi/capiutil.c
index 29419a8d31dc..c7c29022a23a 100644
--- a/drivers/isdn/capi/capiutil.c
+++ b/drivers/isdn/capi/capiutil.c
@@ -490,7 +490,14 @@ static void pars_2_message(_cmsg * cmsg)
490 } 490 }
491} 491}
492 492
493/*-------------------------------------------------------*/ 493/**
494 * capi_cmsg2message() - assemble CAPI 2.0 message from _cmsg structure
495 * @cmsg: _cmsg structure
496 * @msg: buffer for assembled message
497 *
498 * Return value: 0 for success
499 */
500
494unsigned capi_cmsg2message(_cmsg * cmsg, u8 * msg) 501unsigned capi_cmsg2message(_cmsg * cmsg, u8 * msg)
495{ 502{
496 cmsg->m = msg; 503 cmsg->m = msg;
@@ -553,7 +560,14 @@ static void message_2_pars(_cmsg * cmsg)
553 } 560 }
554} 561}
555 562
556/*-------------------------------------------------------*/ 563/**
564 * capi_message2cmsg() - disassemble CAPI 2.0 message into _cmsg structure
565 * @cmsg: _cmsg structure
566 * @msg: buffer for assembled message
567 *
568 * Return value: 0 for success
569 */
570
557unsigned capi_message2cmsg(_cmsg * cmsg, u8 * msg) 571unsigned capi_message2cmsg(_cmsg * cmsg, u8 * msg)
558{ 572{
559 memset(cmsg, 0, sizeof(_cmsg)); 573 memset(cmsg, 0, sizeof(_cmsg));
@@ -573,7 +587,18 @@ unsigned capi_message2cmsg(_cmsg * cmsg, u8 * msg)
573 return 0; 587 return 0;
574} 588}
575 589
576/*-------------------------------------------------------*/ 590/**
591 * capi_cmsg_header() - initialize header part of _cmsg structure
592 * @cmsg: _cmsg structure
593 * @_ApplId: ApplID field value
594 * @_Command: Command field value
595 * @_Subcommand: Subcommand field value
596 * @_Messagenumber: Message Number field value
597 * @_Controller: Controller/PLCI/NCCI field value
598 *
599 * Return value: 0 for success
600 */
601
577unsigned capi_cmsg_header(_cmsg * cmsg, u16 _ApplId, 602unsigned capi_cmsg_header(_cmsg * cmsg, u16 _ApplId,
578 u8 _Command, u8 _Subcommand, 603 u8 _Command, u8 _Subcommand,
579 u16 _Messagenumber, u32 _Controller) 604 u16 _Messagenumber, u32 _Controller)
@@ -641,6 +666,14 @@ static char *mnames[] =
641 [0x4e] = "MANUFACTURER_RESP" 666 [0x4e] = "MANUFACTURER_RESP"
642}; 667};
643 668
669/**
670 * capi_cmd2str() - convert CAPI 2.0 command/subcommand number to name
671 * @cmd: command number
672 * @subcmd: subcommand number
673 *
674 * Return value: static string, NULL if command/subcommand unknown
675 */
676
644char *capi_cmd2str(u8 cmd, u8 subcmd) 677char *capi_cmd2str(u8 cmd, u8 subcmd)
645{ 678{
646 return mnames[command_2_index(cmd, subcmd)]; 679 return mnames[command_2_index(cmd, subcmd)];
@@ -879,6 +912,11 @@ init:
879 return cdb; 912 return cdb;
880} 913}
881 914
915/**
916 * cdebbuf_free() - free CAPI debug buffer
917 * @cdb: buffer to free
918 */
919
882void cdebbuf_free(_cdebbuf *cdb) 920void cdebbuf_free(_cdebbuf *cdb)
883{ 921{
884 if (likely(cdb == g_debbuf)) { 922 if (likely(cdb == g_debbuf)) {
@@ -891,6 +929,16 @@ void cdebbuf_free(_cdebbuf *cdb)
891} 929}
892 930
893 931
932/**
933 * capi_message2str() - format CAPI 2.0 message for printing
934 * @msg: CAPI 2.0 message
935 *
936 * Allocates a CAPI debug buffer and fills it with a printable representation
937 * of the CAPI 2.0 message in @msg.
938 * Return value: allocated debug buffer, NULL on error
939 * The returned buffer should be freed by a call to cdebbuf_free() after use.
940 */
941
894_cdebbuf *capi_message2str(u8 * msg) 942_cdebbuf *capi_message2str(u8 * msg)
895{ 943{
896 _cdebbuf *cdb; 944 _cdebbuf *cdb;
@@ -926,6 +974,17 @@ _cdebbuf *capi_message2str(u8 * msg)
926 return cdb; 974 return cdb;
927} 975}
928 976
977/**
978 * capi_cmsg2str() - format _cmsg structure for printing
979 * @cmsg: _cmsg structure
980 *
981 * Allocates a CAPI debug buffer and fills it with a printable representation
982 * of the CAPI 2.0 message stored in @cmsg by a previous call to
983 * capi_cmsg2message() or capi_message2cmsg().
984 * Return value: allocated debug buffer, NULL on error
985 * The returned buffer should be freed by a call to cdebbuf_free() after use.
986 */
987
929_cdebbuf *capi_cmsg2str(_cmsg * cmsg) 988_cdebbuf *capi_cmsg2str(_cmsg * cmsg)
930{ 989{
931 _cdebbuf *cdb; 990 _cdebbuf *cdb;