diff options
Diffstat (limited to '')
-rw-r--r-- | drivers/isdn/sc/ioctl.c | 220 |
1 files changed, 110 insertions, 110 deletions
diff --git a/drivers/isdn/sc/ioctl.c b/drivers/isdn/sc/ioctl.c index 4cfdbe08ffd1..e63983aa1d27 100644 --- a/drivers/isdn/sc/ioctl.c +++ b/drivers/isdn/sc/ioctl.c @@ -30,11 +30,11 @@ int sc_ioctl(int card, scs_ioctl *data) if (!rcvmsg) return -ENOMEM; - switch(data->command) { + switch (data->command) { case SCIOCRESET: /* Perform a hard reset of the adapter */ { pr_debug("%s: SCIOCRESET: ioctl received\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); sc_adapter[card]->StartOnReset = 0; kfree(rcvmsg); return reset(card); @@ -50,10 +50,10 @@ int sc_ioctl(int card, scs_ioctl *data) return -ENOMEM; } pr_debug("%s: SCIOLOAD: ioctl received\n", - sc_adapter[card]->devicename); - if(sc_adapter[card]->EngineUp) { + sc_adapter[card]->devicename); + if (sc_adapter[card]->EngineUp) { pr_debug("%s: SCIOCLOAD: command failed, LoadProc while engine running.\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); kfree(rcvmsg); kfree(srec); return -1; @@ -69,18 +69,18 @@ int sc_ioctl(int card, scs_ioctl *data) } status = send_and_receive(card, CMPID, cmReqType2, cmReqClass0, cmReqLoadProc, - 0, SCIOC_SRECSIZE, srec, rcvmsg, SAR_TIMEOUT); + 0, SCIOC_SRECSIZE, srec, rcvmsg, SAR_TIMEOUT); kfree(rcvmsg); kfree(srec); - if(status) { - pr_debug("%s: SCIOCLOAD: command failed, status = %d\n", - sc_adapter[card]->devicename, status); + if (status) { + pr_debug("%s: SCIOCLOAD: command failed, status = %d\n", + sc_adapter[card]->devicename, status); return -1; } else { pr_debug("%s: SCIOCLOAD: command successful\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); return 0; } } @@ -89,10 +89,10 @@ int sc_ioctl(int card, scs_ioctl *data) { kfree(rcvmsg); pr_debug("%s: SCIOSTART: ioctl received\n", - sc_adapter[card]->devicename); - if(sc_adapter[card]->EngineUp) { + sc_adapter[card]->devicename); + if (sc_adapter[card]->EngineUp) { pr_debug("%s: SCIOCSTART: command failed, engine already running.\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); return -1; } @@ -104,7 +104,7 @@ int sc_ioctl(int card, scs_ioctl *data) case SCIOCSETSWITCH: { pr_debug("%s: SCIOSETSWITCH: ioctl received\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); /* * Get the switch type from user space @@ -115,41 +115,41 @@ int sc_ioctl(int card, scs_ioctl *data) } pr_debug("%s: SCIOCSETSWITCH: setting switch type to %d\n", - sc_adapter[card]->devicename, - switchtype); + sc_adapter[card]->devicename, + switchtype); status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallSetSwitchType, - 0, sizeof(char),&switchtype, rcvmsg, SAR_TIMEOUT); - if(!status && !(rcvmsg->rsp_status)) { + 0, sizeof(char), &switchtype, rcvmsg, SAR_TIMEOUT); + if (!status && !(rcvmsg->rsp_status)) { pr_debug("%s: SCIOCSETSWITCH: command successful\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); kfree(rcvmsg); return 0; } else { pr_debug("%s: SCIOCSETSWITCH: command failed (status = %d)\n", - sc_adapter[card]->devicename, status); + sc_adapter[card]->devicename, status); kfree(rcvmsg); return status; } } - + case SCIOCGETSWITCH: { pr_debug("%s: SCIOGETSWITCH: ioctl received\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); /* * Get the switch type from the board */ - status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, - ceReqCallGetSwitchType, 0, 0, NULL, rcvmsg, SAR_TIMEOUT); + status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, + ceReqCallGetSwitchType, 0, 0, NULL, rcvmsg, SAR_TIMEOUT); if (!status && !(rcvmsg->rsp_status)) { pr_debug("%s: SCIOCGETSWITCH: command successful\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); } else { pr_debug("%s: SCIOCGETSWITCH: command failed (status = %d)\n", - sc_adapter[card]->devicename, status); + sc_adapter[card]->devicename, status); kfree(rcvmsg); return status; } @@ -172,7 +172,7 @@ int sc_ioctl(int card, scs_ioctl *data) case SCIOCGETSPID: { pr_debug("%s: SCIOGETSPID: ioctl received\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); spid = kzalloc(SCIOC_SPIDSIZE, GFP_KERNEL); if (!spid) { @@ -183,13 +183,13 @@ int sc_ioctl(int card, scs_ioctl *data) * Get the spid from the board */ status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetSPID, - data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT); + data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT); if (!status) { pr_debug("%s: SCIOCGETSPID: command successful\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); } else { pr_debug("%s: SCIOCGETSPID: command failed (status = %d)\n", - sc_adapter[card]->devicename, status); + sc_adapter[card]->devicename, status); kfree(spid); kfree(rcvmsg); return status; @@ -208,12 +208,12 @@ int sc_ioctl(int card, scs_ioctl *data) kfree(spid); kfree(rcvmsg); return 0; - } + } case SCIOCSETSPID: { pr_debug("%s: DCBIOSETSPID: ioctl received\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); /* * Get the spid from user space @@ -224,21 +224,21 @@ int sc_ioctl(int card, scs_ioctl *data) return PTR_ERR(spid); } - pr_debug("%s: SCIOCSETSPID: setting channel %d spid to %s\n", - sc_adapter[card]->devicename, data->channel, spid); - status = send_and_receive(card, CEPID, ceReqTypeCall, - ceReqClass0, ceReqCallSetSPID, data->channel, - strlen(spid), spid, rcvmsg, SAR_TIMEOUT); - if(!status && !(rcvmsg->rsp_status)) { - pr_debug("%s: SCIOCSETSPID: command successful\n", - sc_adapter[card]->devicename); + pr_debug("%s: SCIOCSETSPID: setting channel %d spid to %s\n", + sc_adapter[card]->devicename, data->channel, spid); + status = send_and_receive(card, CEPID, ceReqTypeCall, + ceReqClass0, ceReqCallSetSPID, data->channel, + strlen(spid), spid, rcvmsg, SAR_TIMEOUT); + if (!status && !(rcvmsg->rsp_status)) { + pr_debug("%s: SCIOCSETSPID: command successful\n", + sc_adapter[card]->devicename); kfree(rcvmsg); kfree(spid); return 0; } else { pr_debug("%s: SCIOCSETSPID: command failed (status = %d)\n", - sc_adapter[card]->devicename, status); + sc_adapter[card]->devicename, status); kfree(rcvmsg); kfree(spid); return status; @@ -248,20 +248,20 @@ int sc_ioctl(int card, scs_ioctl *data) case SCIOCGETDN: { pr_debug("%s: SCIOGETDN: ioctl received\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); /* * Get the dn from the board */ status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetMyNumber, - data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT); + data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT); if (!status) { pr_debug("%s: SCIOCGETDN: command successful\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); } else { pr_debug("%s: SCIOCGETDN: command failed (status = %d)\n", - sc_adapter[card]->devicename, status); + sc_adapter[card]->devicename, status); kfree(rcvmsg); return status; } @@ -283,12 +283,12 @@ int sc_ioctl(int card, scs_ioctl *data) } kfree(dn); return 0; - } + } case SCIOCSETDN: { pr_debug("%s: SCIOSETDN: ioctl received\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); /* * Get the spid from user space @@ -299,21 +299,21 @@ int sc_ioctl(int card, scs_ioctl *data) return PTR_ERR(dn); } - pr_debug("%s: SCIOCSETDN: setting channel %d dn to %s\n", - sc_adapter[card]->devicename, data->channel, dn); - status = send_and_receive(card, CEPID, ceReqTypeCall, - ceReqClass0, ceReqCallSetMyNumber, data->channel, - strlen(dn),dn,rcvmsg, SAR_TIMEOUT); - if(!status && !(rcvmsg->rsp_status)) { - pr_debug("%s: SCIOCSETDN: command successful\n", - sc_adapter[card]->devicename); + pr_debug("%s: SCIOCSETDN: setting channel %d dn to %s\n", + sc_adapter[card]->devicename, data->channel, dn); + status = send_and_receive(card, CEPID, ceReqTypeCall, + ceReqClass0, ceReqCallSetMyNumber, data->channel, + strlen(dn), dn, rcvmsg, SAR_TIMEOUT); + if (!status && !(rcvmsg->rsp_status)) { + pr_debug("%s: SCIOCSETDN: command successful\n", + sc_adapter[card]->devicename); kfree(rcvmsg); kfree(dn); return 0; } else { pr_debug("%s: SCIOCSETDN: command failed (status = %d)\n", - sc_adapter[card]->devicename, status); + sc_adapter[card]->devicename, status); kfree(rcvmsg); kfree(dn); return status; @@ -323,11 +323,11 @@ int sc_ioctl(int card, scs_ioctl *data) case SCIOCTRACE: pr_debug("%s: SCIOTRACE: ioctl received\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); /* sc_adapter[card]->trace = !sc_adapter[card]->trace; pr_debug("%s: SCIOCTRACE: tracing turned %s\n", - sc_adapter[card]->devicename, - sc_adapter[card]->trace ? "ON" : "OFF"); */ + sc_adapter[card]->devicename, + sc_adapter[card]->trace ? "ON" : "OFF"); */ break; case SCIOCSTAT: @@ -335,7 +335,7 @@ int sc_ioctl(int card, scs_ioctl *data) boardInfo *bi; pr_debug("%s: SCIOSTAT: ioctl received\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); bi = kzalloc(sizeof(boardInfo), GFP_KERNEL); if (!bi) { @@ -358,20 +358,20 @@ int sc_ioctl(int card, scs_ioctl *data) case SCIOCGETSPEED: { pr_debug("%s: SCIOGETSPEED: ioctl received\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); /* * Get the speed from the board */ - status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, - ceReqCallGetCallType, data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT); + status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, + ceReqCallGetCallType, data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT); if (!status && !(rcvmsg->rsp_status)) { pr_debug("%s: SCIOCGETSPEED: command successful\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); } else { pr_debug("%s: SCIOCGETSPEED: command failed (status = %d)\n", - sc_adapter[card]->devicename, status); + sc_adapter[card]->devicename, status); kfree(rcvmsg); return status; } @@ -392,12 +392,12 @@ int sc_ioctl(int card, scs_ioctl *data) case SCIOCSETSPEED: pr_debug("%s: SCIOCSETSPEED: ioctl received\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); break; case SCIOCLOOPTST: pr_debug("%s: SCIOCLOOPTST: ioctl received\n", - sc_adapter[card]->devicename); + sc_adapter[card]->devicename); break; default: @@ -432,32 +432,32 @@ static int GetStatus(int card, boardInfo *bi) * Get the current PhyStats and LnkStats */ status = send_and_receive(card, CEPID, ceReqTypePhy, ceReqClass2, - ceReqPhyStatus, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT); - if(!status) { - if(sc_adapter[card]->model < PRI_BOARD) { + ceReqPhyStatus, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT); + if (!status) { + if (sc_adapter[card]->model < PRI_BOARD) { bi->l1_status = rcvmsg.msg_data.byte_array[2]; - for(i = 0 ; i < BRI_CHANNELS ; i++) + for (i = 0; i < BRI_CHANNELS; i++) bi->status.bristats[i].phy_stat = rcvmsg.msg_data.byte_array[i]; } else { bi->l1_status = rcvmsg.msg_data.byte_array[0]; bi->l2_status = rcvmsg.msg_data.byte_array[1]; - for(i = 0 ; i < PRI_CHANNELS ; i++) - bi->status.pristats[i].phy_stat = - rcvmsg.msg_data.byte_array[i+2]; + for (i = 0; i < PRI_CHANNELS; i++) + bi->status.pristats[i].phy_stat = + rcvmsg.msg_data.byte_array[i + 2]; } } - + /* * Get the call types for each channel */ - for (i = 0 ; i < sc_adapter[card]->nChannels ; i++) { + for (i = 0; i < sc_adapter[card]->nChannels; i++) { status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, - ceReqCallGetCallType, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT); - if(!status) { + ceReqCallGetCallType, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT); + if (!status) { if (sc_adapter[card]->model == PRI_BOARD) { - bi->status.pristats[i].call_type = + bi->status.pristats[i].call_type = rcvmsg.msg_data.byte_array[0]; } else { @@ -466,7 +466,7 @@ static int GetStatus(int card, boardInfo *bi) } } } - + /* * If PRI, get the call states and service states for each channel */ @@ -475,10 +475,10 @@ static int GetStatus(int card, boardInfo *bi) * Get the call states */ status = send_and_receive(card, CEPID, ceReqTypeStat, ceReqClass2, - ceReqPhyChCallState, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT); - if(!status) { - for( i = 0 ; i < PRI_CHANNELS ; i++ ) - bi->status.pristats[i].call_state = + ceReqPhyChCallState, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT); + if (!status) { + for (i = 0; i < PRI_CHANNELS; i++) + bi->status.pristats[i].call_state = rcvmsg.msg_data.byte_array[i]; } @@ -486,27 +486,27 @@ static int GetStatus(int card, boardInfo *bi) * Get the service states */ status = send_and_receive(card, CEPID, ceReqTypeStat, ceReqClass2, - ceReqPhyChServState, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT); - if(!status) { - for( i = 0 ; i < PRI_CHANNELS ; i++ ) - bi->status.pristats[i].serv_state = + ceReqPhyChServState, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT); + if (!status) { + for (i = 0; i < PRI_CHANNELS; i++) + bi->status.pristats[i].serv_state = rcvmsg.msg_data.byte_array[i]; } /* * Get the link stats for the channels */ - for (i = 1 ; i <= PRI_CHANNELS ; i++) { + for (i = 1; i <= PRI_CHANNELS; i++) { status = send_and_receive(card, CEPID, ceReqTypeLnk, ceReqClass0, - ceReqLnkGetStats, i, 0, NULL, &rcvmsg, SAR_TIMEOUT); + ceReqLnkGetStats, i, 0, NULL, &rcvmsg, SAR_TIMEOUT); if (!status) { - bi->status.pristats[i-1].link_stats.tx_good = + bi->status.pristats[i - 1].link_stats.tx_good = (unsigned long)rcvmsg.msg_data.byte_array[0]; - bi->status.pristats[i-1].link_stats.tx_bad = + bi->status.pristats[i - 1].link_stats.tx_bad = (unsigned long)rcvmsg.msg_data.byte_array[4]; - bi->status.pristats[i-1].link_stats.rx_good = + bi->status.pristats[i - 1].link_stats.rx_good = (unsigned long)rcvmsg.msg_data.byte_array[8]; - bi->status.pristats[i-1].link_stats.rx_bad = + bi->status.pristats[i - 1].link_stats.rx_bad = (unsigned long)rcvmsg.msg_data.byte_array[12]; } } @@ -515,7 +515,7 @@ static int GetStatus(int card, boardInfo *bi) * Link stats for the D channel */ status = send_and_receive(card, CEPID, ceReqTypeLnk, ceReqClass0, - ceReqLnkGetStats, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT); + ceReqLnkGetStats, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT); if (!status) { bi->dch_stats.tx_good = (unsigned long)rcvmsg.msg_data.byte_array[0]; bi->dch_stats.tx_bad = (unsigned long)rcvmsg.msg_data.byte_array[4]; @@ -534,49 +534,49 @@ static int GetStatus(int card, boardInfo *bi) * Get the link stats for the channels */ status = send_and_receive(card, CEPID, ceReqTypeLnk, ceReqClass0, - ceReqLnkGetStats, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT); + ceReqLnkGetStats, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT); if (!status) { bi->dch_stats.tx_good = (unsigned long)rcvmsg.msg_data.byte_array[0]; bi->dch_stats.tx_bad = (unsigned long)rcvmsg.msg_data.byte_array[4]; bi->dch_stats.rx_good = (unsigned long)rcvmsg.msg_data.byte_array[8]; bi->dch_stats.rx_bad = (unsigned long)rcvmsg.msg_data.byte_array[12]; - bi->status.bristats[0].link_stats.tx_good = + bi->status.bristats[0].link_stats.tx_good = (unsigned long)rcvmsg.msg_data.byte_array[16]; - bi->status.bristats[0].link_stats.tx_bad = + bi->status.bristats[0].link_stats.tx_bad = (unsigned long)rcvmsg.msg_data.byte_array[20]; - bi->status.bristats[0].link_stats.rx_good = + bi->status.bristats[0].link_stats.rx_good = (unsigned long)rcvmsg.msg_data.byte_array[24]; - bi->status.bristats[0].link_stats.rx_bad = + bi->status.bristats[0].link_stats.rx_bad = (unsigned long)rcvmsg.msg_data.byte_array[28]; - bi->status.bristats[1].link_stats.tx_good = + bi->status.bristats[1].link_stats.tx_good = (unsigned long)rcvmsg.msg_data.byte_array[32]; - bi->status.bristats[1].link_stats.tx_bad = + bi->status.bristats[1].link_stats.tx_bad = (unsigned long)rcvmsg.msg_data.byte_array[36]; - bi->status.bristats[1].link_stats.rx_good = + bi->status.bristats[1].link_stats.rx_good = (unsigned long)rcvmsg.msg_data.byte_array[40]; - bi->status.bristats[1].link_stats.rx_bad = + bi->status.bristats[1].link_stats.rx_bad = (unsigned long)rcvmsg.msg_data.byte_array[44]; } /* * Get the SPIDs */ - for (i = 0 ; i < BRI_CHANNELS ; i++) { + for (i = 0; i < BRI_CHANNELS; i++) { status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, - ceReqCallGetSPID, i+1, 0, NULL, &rcvmsg, SAR_TIMEOUT); + ceReqCallGetSPID, i + 1, 0, NULL, &rcvmsg, SAR_TIMEOUT); if (!status) strcpy(bi->status.bristats[i].spid, rcvmsg.msg_data.byte_array); } - + /* * Get the DNs */ - for (i = 0 ; i < BRI_CHANNELS ; i++) { + for (i = 0; i < BRI_CHANNELS; i++) { status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, - ceReqCallGetMyNumber, i+1, 0, NULL, &rcvmsg, SAR_TIMEOUT); + ceReqCallGetMyNumber, i + 1, 0, NULL, &rcvmsg, SAR_TIMEOUT); if (!status) strcpy(bi->status.bristats[i].dn, rcvmsg.msg_data.byte_array); } - + return 0; } |