diff options
Diffstat (limited to 'drivers/isdn/sc/command.c')
-rw-r--r-- | drivers/isdn/sc/command.c | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/drivers/isdn/sc/command.c b/drivers/isdn/sc/command.c index 0e4969c2ef95..4a4e66152ce7 100644 --- a/drivers/isdn/sc/command.c +++ b/drivers/isdn/sc/command.c @@ -69,14 +69,14 @@ int get_card_from_id(int driver) { int i; - for(i = 0 ; i < cinst ; i++) { - if(sc_adapter[i]->driverId == driver) + for (i = 0; i < cinst; i++) { + if (sc_adapter[i]->driverId == driver) return i; } return -ENODEV; } -/* +/* * command */ @@ -85,7 +85,7 @@ int command(isdn_ctrl *cmd) int card; card = get_card_from_id(cmd->driver); - if(!IS_VALID_CARD(card)) { + if (!IS_VALID_CARD(card)) { pr_debug("Invalid param: %d is not a valid card id\n", card); return -ENODEV; } @@ -93,17 +93,17 @@ int command(isdn_ctrl *cmd) /* * Dispatch the command */ - switch(cmd->command) { + switch (cmd->command) { case ISDN_CMD_IOCTL: { - unsigned long cmdptr; + unsigned long cmdptr; scs_ioctl ioc; 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%lx\n", - sc_adapter[card]->devicename, cmdptr); + sc_adapter[card]->devicename, cmdptr); return -EFAULT; } return sc_ioctl(card, &ioc); @@ -133,76 +133,76 @@ int command(isdn_ctrl *cmd) /* * start the onboard firmware */ -int startproc(int card) +int startproc(int card) { int status; - if(!IS_VALID_CARD(card)) { + if (!IS_VALID_CARD(card)) { pr_debug("Invalid param: %d is not a valid card id\n", card); return -ENODEV; } /* - * send start msg + * send start msg */ - status = sendmessage(card, CMPID,cmReqType2, - cmReqClass0, - cmReqStartProc, - 0,0,NULL); + status = sendmessage(card, CMPID, cmReqType2, + cmReqClass0, + cmReqStartProc, + 0, 0, NULL); pr_debug("%s: Sent startProc\n", sc_adapter[card]->devicename); - + return status; } /* - * Dials the number passed in + * Dials the number passed in */ static int dial(int card, unsigned long channel, setup_parm setup) { int status; char Phone[48]; - - if(!IS_VALID_CARD(card)) { + + if (!IS_VALID_CARD(card)) { pr_debug("Invalid param: %d is not a valid card id\n", card); return -ENODEV; } - /*extract ISDN number to dial from eaz/msn string*/ - strcpy(Phone,setup.phone); + /*extract ISDN number to dial from eaz/msn string*/ + strcpy(Phone, setup.phone); /*send the connection message*/ - status = sendmessage(card, CEPID,ceReqTypePhy, - ceReqClass1, - ceReqPhyConnect, - (unsigned char) channel+1, - strlen(Phone), - (unsigned int *) Phone); + status = sendmessage(card, CEPID, ceReqTypePhy, + ceReqClass1, + ceReqPhyConnect, + (unsigned char)channel + 1, + strlen(Phone), + (unsigned int *)Phone); pr_debug("%s: Dialing %s on channel %lu\n", - sc_adapter[card]->devicename, Phone, channel+1); - + sc_adapter[card]->devicename, Phone, channel + 1); + return status; } /* - * Answer an incoming call + * Answer an incoming call */ static int answer(int card, unsigned long channel) { - if(!IS_VALID_CARD(card)) { + if (!IS_VALID_CARD(card)) { pr_debug("Invalid param: %d is not a valid card id\n", card); return -ENODEV; } - if(setup_buffers(card, channel+1)) { - hangup(card, channel+1); + if (setup_buffers(card, channel + 1)) { + hangup(card, channel + 1); return -ENOBUFS; } - indicate_status(card, ISDN_STAT_BCONN,channel,NULL); + indicate_status(card, ISDN_STAT_BCONN, channel, NULL); pr_debug("%s: Answered incoming call on channel %lu\n", - sc_adapter[card]->devicename, channel+1); + sc_adapter[card]->devicename, channel + 1); return 0; } @@ -213,19 +213,19 @@ static int hangup(int card, unsigned long channel) { int status; - if(!IS_VALID_CARD(card)) { + if (!IS_VALID_CARD(card)) { pr_debug("Invalid param: %d is not a valid card id\n", card); return -ENODEV; } status = sendmessage(card, CEPID, ceReqTypePhy, - ceReqClass1, - ceReqPhyDisconnect, - (unsigned char) channel+1, - 0, - NULL); + ceReqClass1, + ceReqPhyDisconnect, + (unsigned char)channel + 1, + 0, + NULL); pr_debug("%s: Sent HANGUP message to channel %lu\n", - sc_adapter[card]->devicename, channel+1); + sc_adapter[card]->devicename, channel + 1); return status; } @@ -234,10 +234,10 @@ static int hangup(int card, unsigned long channel) */ static int setl2(int card, unsigned long arg) { - int status =0; - int protocol,channel; + int status = 0; + int protocol, channel; - if(!IS_VALID_CARD(card)) { + if (!IS_VALID_CARD(card)) { pr_debug("Invalid param: %d is not a valid card id\n", card); return -ENODEV; } @@ -249,14 +249,14 @@ static int setl2(int card, unsigned long arg) * check that the adapter is also set to the correct protocol */ pr_debug("%s: Sending GetFrameFormat for channel %d\n", - sc_adapter[card]->devicename, channel+1); + sc_adapter[card]->devicename, channel + 1); status = sendmessage(card, CEPID, ceReqTypeCall, - ceReqClass0, - ceReqCallGetFrameFormat, - (unsigned char)channel+1, - 1, - (unsigned int *) protocol); - if(status) + ceReqClass0, + ceReqCallGetFrameFormat, + (unsigned char)channel + 1, + 1, + (unsigned int *)protocol); + if (status) return status; return 0; } @@ -268,7 +268,7 @@ static int setl3(int card, unsigned long channel) { int protocol = channel >> 8; - if(!IS_VALID_CARD(card)) { + if (!IS_VALID_CARD(card)) { pr_debug("Invalid param: %d is not a valid card id\n", card); return -ENODEV; } @@ -279,26 +279,26 @@ static int setl3(int card, unsigned long channel) static int acceptb(int card, unsigned long channel) { - if(!IS_VALID_CARD(card)) { + if (!IS_VALID_CARD(card)) { pr_debug("Invalid param: %d is not a valid card id\n", card); return -ENODEV; } - if(setup_buffers(card, channel+1)) + if (setup_buffers(card, channel + 1)) { - hangup(card, channel+1); + hangup(card, channel + 1); return -ENOBUFS; } pr_debug("%s: B-Channel connection accepted on channel %lu\n", - sc_adapter[card]->devicename, channel+1); + sc_adapter[card]->devicename, channel + 1); indicate_status(card, ISDN_STAT_BCONN, channel, NULL); return 0; } static int clreaz(int card, unsigned long arg) { - if(!IS_VALID_CARD(card)) { + if (!IS_VALID_CARD(card)) { pr_debug("Invalid param: %d is not a valid card id\n", card); return -ENODEV; } @@ -306,13 +306,13 @@ static 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 %lu\n", - sc_adapter[card]->devicename, arg+1); + sc_adapter[card]->devicename, arg + 1); return 0; } static int seteaz(int card, unsigned long arg, char *num) { - if(!IS_VALID_CARD(card)) { + if (!IS_VALID_CARD(card)) { pr_debug("Invalid param: %d is not a valid card id\n", card); return -ENODEV; } @@ -320,8 +320,8 @@ static 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 %lu set to: %s\n", - sc_adapter[card]->devicename, arg+1, - sc_adapter[card]->channel[arg].eazlist); + sc_adapter[card]->devicename, arg + 1, + sc_adapter[card]->channel[arg].eazlist); return 0; } @@ -329,14 +329,14 @@ int reset(int card) { unsigned long flags; - if(!IS_VALID_CARD(card)) { + if (!IS_VALID_CARD(card)) { pr_debug("Invalid param: %d is not a valid card id\n", card); return -ENODEV; } indicate_status(card, ISDN_STAT_STOP, 0, NULL); - if(sc_adapter[card]->EngineUp) { + if (sc_adapter[card]->EngineUp) { del_timer(&sc_adapter[card]->stat_timer); } @@ -350,14 +350,14 @@ int reset(int card) add_timer(&sc_adapter[card]->reset_timer); spin_unlock_irqrestore(&sc_adapter[card]->lock, flags); - outb(0x1,sc_adapter[card]->ioport[SFT_RESET]); + outb(0x1, sc_adapter[card]->ioport[SFT_RESET]); pr_debug("%s: Adapter Reset\n", sc_adapter[card]->devicename); return 0; } -void flushreadfifo (int card) +void flushreadfifo(int card) { - while(inb(sc_adapter[card]->ioport[FIFO_STATUS]) & RF_HAS_DATA) + while (inb(sc_adapter[card]->ioport[FIFO_STATUS]) & RF_HAS_DATA) inb(sc_adapter[card]->ioport[FIFO_READ]); } |