fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / isdn / sc / command.c
index b2c4eac..04b8a58 100644 (file)
 #include "card.h"
 #include "scioc.h"
 
-int dial(int card, unsigned long channel, setup_parm setup);
-int hangup(int card, unsigned long channel);
-int answer(int card, unsigned long channel);
-int clreaz(int card, unsigned long channel);
-int seteaz(int card, unsigned long channel, char *);
-int setl2(int card, unsigned long arg);
-int setl3(int card, unsigned long arg);
-int acceptb(int card, unsigned long channel);
+static int dial(int card, unsigned long channel, setup_parm setup);
+static int hangup(int card, unsigned long channel);
+static int answer(int card, unsigned long channel);
+static int clreaz(int card, unsigned long channel);
+static int seteaz(int card, unsigned long channel, char *);
+static int setl2(int card, unsigned long arg);
+static int setl3(int card, unsigned long arg);
+static int acceptb(int card, unsigned long channel);
 
 extern int cinst;
 extern board *sc_adapter[];
@@ -43,7 +43,6 @@ extern int send_and_receive(int, unsigned int, unsigned char, unsigned char,
                 RspMessage *, int);
 extern int sendmessage(int, unsigned int, unsigned int, unsigned int,
                 unsigned int, unsigned int, unsigned int, unsigned int *);
-extern inline void pullphone(char *, char *);
 
 #ifdef DEBUG
 /*
@@ -104,9 +103,6 @@ int command(isdn_ctrl *cmd)
                return -ENODEV;
        }
 
-       pr_debug("%s: Received %s command from Link Layer\n",
-               sc_adapter[card]->devicename, commands[cmd->command]);
-
        /*
         * Dispatch the command
         */
@@ -119,7 +115,7 @@ int command(isdn_ctrl *cmd)
                memcpy(&cmdptr, cmd->parm.num, sizeof(unsigned long));
                if (copy_from_user(&ioc, (scs_ioctl __user *)cmdptr,
                                   sizeof(scs_ioctl))) {
-                       pr_debug("%s: Failed to verify user space 0x%x\n",
+                       pr_debug("%s: Failed to verify user space 0x%lx\n",
                                sc_adapter[card]->devicename, cmdptr);
                        return -EFAULT;
                }
@@ -147,56 +143,6 @@ int command(isdn_ctrl *cmd)
        return 0;
 }
 
-/*
- * Confirm our ability to communicate with the board.  This test assumes no
- * other message activity is present
- */
-int loopback(int card) 
-{
-
-       int status;
-       static char testmsg[] = "Test Message";
-       RspMessage rspmsg;
-
-       if(!IS_VALID_CARD(card)) {
-               pr_debug("Invalid param: %d is not a valid card id\n", card);
-               return -ENODEV;
-       }
-
-       pr_debug("%s: Sending loopback message\n",
-               sc_adapter[card]->devicename);
-
-       /*
-        * Send the loopback message to confirm that memory transfer is
-        * operational
-        */
-       status = send_and_receive(card, CMPID, cmReqType1,
-                                 cmReqClass0,
-                                 cmReqMsgLpbk,
-                                 0,
-                                 (unsigned char) strlen(testmsg),
-                                 (unsigned char *)testmsg,
-                                 &rspmsg, SAR_TIMEOUT);
-
-
-       if (!status) {
-               pr_debug("%s: Loopback message successfully sent\n",
-                       sc_adapter[card]->devicename);
-               if(strcmp(rspmsg.msg_data.byte_array, testmsg)) {
-                       pr_debug("%s: Loopback return != sent\n",
-                               sc_adapter[card]->devicename);
-                       return -EIO;
-               }
-               return 0;
-       }
-       else {
-               pr_debug("%s: Send loopback message failed\n",
-                       sc_adapter[card]->devicename);
-               return -EIO;
-       }
-
-}
-
 /*
  * start the onboard firmware
  */
@@ -222,16 +168,10 @@ int startproc(int card)
 }
 
 
-int loadproc(int card, char *data) 
-{
-       return -1;
-}
-
-
 /*
  * Dials the number passed in 
  */
-int dial(int card, unsigned long channel, setup_parm setup) 
+static int dial(int card, unsigned long channel, setup_parm setup)
 {
        int status;
        char Phone[48];
@@ -252,7 +192,7 @@ int dial(int card, unsigned long channel, setup_parm setup)
                                strlen(Phone),
                                (unsigned int *) Phone);
 
-       pr_debug("%s: Dialing %s on channel %d\n",
+       pr_debug("%s: Dialing %s on channel %lu\n",
                sc_adapter[card]->devicename, Phone, channel+1);
        
        return status;
@@ -261,7 +201,7 @@ int dial(int card, unsigned long channel, setup_parm setup)
 /*
  * Answer an incoming call 
  */
-int answer(int card, unsigned long channel) 
+static int answer(int card, unsigned long channel)
 {
        if(!IS_VALID_CARD(card)) {
                pr_debug("Invalid param: %d is not a valid card id\n", card);
@@ -274,7 +214,7 @@ int answer(int card, unsigned long channel)
        }
 
        indicate_status(card, ISDN_STAT_BCONN,channel,NULL);
-       pr_debug("%s: Answered incoming call on channel %s\n",
+       pr_debug("%s: Answered incoming call on channel %lu\n",
                sc_adapter[card]->devicename, channel+1);
        return 0;
 }
@@ -282,7 +222,7 @@ int answer(int card, unsigned long channel)
 /*
  * Hangup up the call on specified channel
  */
-int hangup(int card, unsigned long channel) 
+static int hangup(int card, unsigned long channel)
 {
        int status;
 
@@ -297,7 +237,7 @@ int hangup(int card, unsigned long channel)
                                                 (unsigned char) channel+1,
                                                 0,
                                                 NULL);
-       pr_debug("%s: Sent HANGUP message to channel %d\n",
+       pr_debug("%s: Sent HANGUP message to channel %lu\n",
                sc_adapter[card]->devicename, channel+1);
        return status;
 }
@@ -305,7 +245,7 @@ int hangup(int card, unsigned long channel)
 /*
  * Set the layer 2 protocol (X.25, HDLC, Raw)
  */
-int setl2(int card, unsigned long arg) 
+static int setl2(int card, unsigned long arg)
 {
        int status =0;
        int protocol,channel;
@@ -317,9 +257,6 @@ int setl2(int card, unsigned long arg)
        protocol = arg >> 8;
        channel = arg & 0xff;
        sc_adapter[card]->channel[channel].l2_proto = protocol;
-       pr_debug("%s: Level 2 protocol for channel %d set to %s from %d\n",
-               sc_adapter[card]->devicename, channel+1,
-               l2protos[sc_adapter[card]->channel[channel].l2_proto],protocol);
 
        /*
         * check that the adapter is also set to the correct protocol
@@ -340,7 +277,7 @@ int setl2(int card, unsigned long arg)
 /*
  * Set the layer 3 protocol
  */
-int setl3(int card, unsigned long channel) 
+static int setl3(int card, unsigned long channel)
 {
        int protocol = channel >> 8;
 
@@ -350,12 +287,10 @@ int setl3(int card, unsigned long channel)
        }
 
        sc_adapter[card]->channel[channel].l3_proto = protocol;
-       pr_debug("%s: Level 3 protocol for channel %d set to %s\n",
-               sc_adapter[card]->devicename, channel+1, l3protos[protocol]);
        return 0;
 }
 
-int acceptb(int card, unsigned long channel)
+static int acceptb(int card, unsigned long channel)
 {
        if(!IS_VALID_CARD(card)) {
                pr_debug("Invalid param: %d is not a valid card id\n", card);
@@ -368,13 +303,13 @@ int acceptb(int card, unsigned long channel)
                return -ENOBUFS;
        }
 
-       pr_debug("%s: B-Channel connection accepted on channel %d\n",
+       pr_debug("%s: B-Channel connection accepted on channel %lu\n",
                sc_adapter[card]->devicename, channel+1);
        indicate_status(card, ISDN_STAT_BCONN, channel, NULL);
        return 0;
 }
 
-int clreaz(int card, unsigned long arg)
+static int clreaz(int card, unsigned long arg)
 {
        if(!IS_VALID_CARD(card)) {
                pr_debug("Invalid param: %d is not a valid card id\n", card);
@@ -383,12 +318,12 @@ int clreaz(int card, unsigned long arg)
 
        strcpy(sc_adapter[card]->channel[arg].eazlist, "");
        sc_adapter[card]->channel[arg].eazclear = 1;
-       pr_debug("%s: EAZ List cleared for channel %d\n",
+       pr_debug("%s: EAZ List cleared for channel %lu\n",
                sc_adapter[card]->devicename, arg+1);
        return 0;
 }
 
-int seteaz(int card, unsigned long arg, char *num)
+static int seteaz(int card, unsigned long arg, char *num)
 {
        if(!IS_VALID_CARD(card)) {
                pr_debug("Invalid param: %d is not a valid card id\n", card);
@@ -397,7 +332,7 @@ int seteaz(int card, unsigned long arg, char *num)
 
        strcpy(sc_adapter[card]->channel[arg].eazlist, num);
        sc_adapter[card]->channel[arg].eazclear = 0;
-       pr_debug("%s: EAZ list for channel %d set to: %s\n",
+       pr_debug("%s: EAZ list for channel %lu set to: %s\n",
                sc_adapter[card]->devicename, arg+1,
                sc_adapter[card]->channel[arg].eazlist);
        return 0;