aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/sc/ioctl.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-02-19 22:52:38 -0500
committerJoe Perches <joe@perches.com>2012-02-21 12:04:01 -0500
commit475be4d85a274d0961593db41cf85689db1d583c (patch)
treeb2b8931eb747794730522c3cf1898e46948527b9 /drivers/isdn/sc/ioctl.c
parent0b0a635f79f91f3755b6518627ea06dd0dbfd523 (diff)
isdn: whitespace coding style cleanup
isdn source code uses a not-current coding style. Update the coding style used on a per-line basis so that git diff -w shows only elided blank lines at EOF. Done with emacs and some scripts and some typing. Built x86 allyesconfig. No detected change in objdump -d or size. Signed-off-by: Joe Perches <joe@perches.com>
Diffstat (limited to 'drivers/isdn/sc/ioctl.c')
-rw-r--r--drivers/isdn/sc/ioctl.c220
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)
30 if (!rcvmsg) 30 if (!rcvmsg)
31 return -ENOMEM; 31 return -ENOMEM;
32 32
33 switch(data->command) { 33 switch (data->command) {
34 case SCIOCRESET: /* Perform a hard reset of the adapter */ 34 case SCIOCRESET: /* Perform a hard reset of the adapter */
35 { 35 {
36 pr_debug("%s: SCIOCRESET: ioctl received\n", 36 pr_debug("%s: SCIOCRESET: ioctl received\n",
37 sc_adapter[card]->devicename); 37 sc_adapter[card]->devicename);
38 sc_adapter[card]->StartOnReset = 0; 38 sc_adapter[card]->StartOnReset = 0;
39 kfree(rcvmsg); 39 kfree(rcvmsg);
40 return reset(card); 40 return reset(card);
@@ -50,10 +50,10 @@ int sc_ioctl(int card, scs_ioctl *data)
50 return -ENOMEM; 50 return -ENOMEM;
51 } 51 }
52 pr_debug("%s: SCIOLOAD: ioctl received\n", 52 pr_debug("%s: SCIOLOAD: ioctl received\n",
53 sc_adapter[card]->devicename); 53 sc_adapter[card]->devicename);
54 if(sc_adapter[card]->EngineUp) { 54 if (sc_adapter[card]->EngineUp) {
55 pr_debug("%s: SCIOCLOAD: command failed, LoadProc while engine running.\n", 55 pr_debug("%s: SCIOCLOAD: command failed, LoadProc while engine running.\n",
56 sc_adapter[card]->devicename); 56 sc_adapter[card]->devicename);
57 kfree(rcvmsg); 57 kfree(rcvmsg);
58 kfree(srec); 58 kfree(srec);
59 return -1; 59 return -1;
@@ -69,18 +69,18 @@ int sc_ioctl(int card, scs_ioctl *data)
69 } 69 }
70 70
71 status = send_and_receive(card, CMPID, cmReqType2, cmReqClass0, cmReqLoadProc, 71 status = send_and_receive(card, CMPID, cmReqType2, cmReqClass0, cmReqLoadProc,
72 0, SCIOC_SRECSIZE, srec, rcvmsg, SAR_TIMEOUT); 72 0, SCIOC_SRECSIZE, srec, rcvmsg, SAR_TIMEOUT);
73 kfree(rcvmsg); 73 kfree(rcvmsg);
74 kfree(srec); 74 kfree(srec);
75 75
76 if(status) { 76 if (status) {
77 pr_debug("%s: SCIOCLOAD: command failed, status = %d\n", 77 pr_debug("%s: SCIOCLOAD: command failed, status = %d\n",
78 sc_adapter[card]->devicename, status); 78 sc_adapter[card]->devicename, status);
79 return -1; 79 return -1;
80 } 80 }
81 else { 81 else {
82 pr_debug("%s: SCIOCLOAD: command successful\n", 82 pr_debug("%s: SCIOCLOAD: command successful\n",
83 sc_adapter[card]->devicename); 83 sc_adapter[card]->devicename);
84 return 0; 84 return 0;
85 } 85 }
86 } 86 }
@@ -89,10 +89,10 @@ int sc_ioctl(int card, scs_ioctl *data)
89 { 89 {
90 kfree(rcvmsg); 90 kfree(rcvmsg);
91 pr_debug("%s: SCIOSTART: ioctl received\n", 91 pr_debug("%s: SCIOSTART: ioctl received\n",
92 sc_adapter[card]->devicename); 92 sc_adapter[card]->devicename);
93 if(sc_adapter[card]->EngineUp) { 93 if (sc_adapter[card]->EngineUp) {
94 pr_debug("%s: SCIOCSTART: command failed, engine already running.\n", 94 pr_debug("%s: SCIOCSTART: command failed, engine already running.\n",
95 sc_adapter[card]->devicename); 95 sc_adapter[card]->devicename);
96 return -1; 96 return -1;
97 } 97 }
98 98
@@ -104,7 +104,7 @@ int sc_ioctl(int card, scs_ioctl *data)
104 case SCIOCSETSWITCH: 104 case SCIOCSETSWITCH:
105 { 105 {
106 pr_debug("%s: SCIOSETSWITCH: ioctl received\n", 106 pr_debug("%s: SCIOSETSWITCH: ioctl received\n",
107 sc_adapter[card]->devicename); 107 sc_adapter[card]->devicename);
108 108
109 /* 109 /*
110 * Get the switch type from user space 110 * Get the switch type from user space
@@ -115,41 +115,41 @@ int sc_ioctl(int card, scs_ioctl *data)
115 } 115 }
116 116
117 pr_debug("%s: SCIOCSETSWITCH: setting switch type to %d\n", 117 pr_debug("%s: SCIOCSETSWITCH: setting switch type to %d\n",
118 sc_adapter[card]->devicename, 118 sc_adapter[card]->devicename,
119 switchtype); 119 switchtype);
120 status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallSetSwitchType, 120 status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallSetSwitchType,
121 0, sizeof(char),&switchtype, rcvmsg, SAR_TIMEOUT); 121 0, sizeof(char), &switchtype, rcvmsg, SAR_TIMEOUT);
122 if(!status && !(rcvmsg->rsp_status)) { 122 if (!status && !(rcvmsg->rsp_status)) {
123 pr_debug("%s: SCIOCSETSWITCH: command successful\n", 123 pr_debug("%s: SCIOCSETSWITCH: command successful\n",
124 sc_adapter[card]->devicename); 124 sc_adapter[card]->devicename);
125 kfree(rcvmsg); 125 kfree(rcvmsg);
126 return 0; 126 return 0;
127 } 127 }
128 else { 128 else {
129 pr_debug("%s: SCIOCSETSWITCH: command failed (status = %d)\n", 129 pr_debug("%s: SCIOCSETSWITCH: command failed (status = %d)\n",
130 sc_adapter[card]->devicename, status); 130 sc_adapter[card]->devicename, status);
131 kfree(rcvmsg); 131 kfree(rcvmsg);
132 return status; 132 return status;
133 } 133 }
134 } 134 }
135 135
136 case SCIOCGETSWITCH: 136 case SCIOCGETSWITCH:
137 { 137 {
138 pr_debug("%s: SCIOGETSWITCH: ioctl received\n", 138 pr_debug("%s: SCIOGETSWITCH: ioctl received\n",
139 sc_adapter[card]->devicename); 139 sc_adapter[card]->devicename);
140 140
141 /* 141 /*
142 * Get the switch type from the board 142 * Get the switch type from the board
143 */ 143 */
144 status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, 144 status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0,
145 ceReqCallGetSwitchType, 0, 0, NULL, rcvmsg, SAR_TIMEOUT); 145 ceReqCallGetSwitchType, 0, 0, NULL, rcvmsg, SAR_TIMEOUT);
146 if (!status && !(rcvmsg->rsp_status)) { 146 if (!status && !(rcvmsg->rsp_status)) {
147 pr_debug("%s: SCIOCGETSWITCH: command successful\n", 147 pr_debug("%s: SCIOCGETSWITCH: command successful\n",
148 sc_adapter[card]->devicename); 148 sc_adapter[card]->devicename);
149 } 149 }
150 else { 150 else {
151 pr_debug("%s: SCIOCGETSWITCH: command failed (status = %d)\n", 151 pr_debug("%s: SCIOCGETSWITCH: command failed (status = %d)\n",
152 sc_adapter[card]->devicename, status); 152 sc_adapter[card]->devicename, status);
153 kfree(rcvmsg); 153 kfree(rcvmsg);
154 return status; 154 return status;
155 } 155 }
@@ -172,7 +172,7 @@ int sc_ioctl(int card, scs_ioctl *data)
172 case SCIOCGETSPID: 172 case SCIOCGETSPID:
173 { 173 {
174 pr_debug("%s: SCIOGETSPID: ioctl received\n", 174 pr_debug("%s: SCIOGETSPID: ioctl received\n",
175 sc_adapter[card]->devicename); 175 sc_adapter[card]->devicename);
176 176
177 spid = kzalloc(SCIOC_SPIDSIZE, GFP_KERNEL); 177 spid = kzalloc(SCIOC_SPIDSIZE, GFP_KERNEL);
178 if (!spid) { 178 if (!spid) {
@@ -183,13 +183,13 @@ int sc_ioctl(int card, scs_ioctl *data)
183 * Get the spid from the board 183 * Get the spid from the board
184 */ 184 */
185 status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetSPID, 185 status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetSPID,
186 data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT); 186 data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT);
187 if (!status) { 187 if (!status) {
188 pr_debug("%s: SCIOCGETSPID: command successful\n", 188 pr_debug("%s: SCIOCGETSPID: command successful\n",
189 sc_adapter[card]->devicename); 189 sc_adapter[card]->devicename);
190 } else { 190 } else {
191 pr_debug("%s: SCIOCGETSPID: command failed (status = %d)\n", 191 pr_debug("%s: SCIOCGETSPID: command failed (status = %d)\n",
192 sc_adapter[card]->devicename, status); 192 sc_adapter[card]->devicename, status);
193 kfree(spid); 193 kfree(spid);
194 kfree(rcvmsg); 194 kfree(rcvmsg);
195 return status; 195 return status;
@@ -208,12 +208,12 @@ int sc_ioctl(int card, scs_ioctl *data)
208 kfree(spid); 208 kfree(spid);
209 kfree(rcvmsg); 209 kfree(rcvmsg);
210 return 0; 210 return 0;
211 } 211 }
212 212
213 case SCIOCSETSPID: 213 case SCIOCSETSPID:
214 { 214 {
215 pr_debug("%s: DCBIOSETSPID: ioctl received\n", 215 pr_debug("%s: DCBIOSETSPID: ioctl received\n",
216 sc_adapter[card]->devicename); 216 sc_adapter[card]->devicename);
217 217
218 /* 218 /*
219 * Get the spid from user space 219 * Get the spid from user space
@@ -224,21 +224,21 @@ int sc_ioctl(int card, scs_ioctl *data)
224 return PTR_ERR(spid); 224 return PTR_ERR(spid);
225 } 225 }
226 226
227 pr_debug("%s: SCIOCSETSPID: setting channel %d spid to %s\n", 227 pr_debug("%s: SCIOCSETSPID: setting channel %d spid to %s\n",
228 sc_adapter[card]->devicename, data->channel, spid); 228 sc_adapter[card]->devicename, data->channel, spid);
229 status = send_and_receive(card, CEPID, ceReqTypeCall, 229 status = send_and_receive(card, CEPID, ceReqTypeCall,
230 ceReqClass0, ceReqCallSetSPID, data->channel, 230 ceReqClass0, ceReqCallSetSPID, data->channel,
231 strlen(spid), spid, rcvmsg, SAR_TIMEOUT); 231 strlen(spid), spid, rcvmsg, SAR_TIMEOUT);
232 if(!status && !(rcvmsg->rsp_status)) { 232 if (!status && !(rcvmsg->rsp_status)) {
233 pr_debug("%s: SCIOCSETSPID: command successful\n", 233 pr_debug("%s: SCIOCSETSPID: command successful\n",
234 sc_adapter[card]->devicename); 234 sc_adapter[card]->devicename);
235 kfree(rcvmsg); 235 kfree(rcvmsg);
236 kfree(spid); 236 kfree(spid);
237 return 0; 237 return 0;
238 } 238 }
239 else { 239 else {
240 pr_debug("%s: SCIOCSETSPID: command failed (status = %d)\n", 240 pr_debug("%s: SCIOCSETSPID: command failed (status = %d)\n",
241 sc_adapter[card]->devicename, status); 241 sc_adapter[card]->devicename, status);
242 kfree(rcvmsg); 242 kfree(rcvmsg);
243 kfree(spid); 243 kfree(spid);
244 return status; 244 return status;
@@ -248,20 +248,20 @@ int sc_ioctl(int card, scs_ioctl *data)
248 case SCIOCGETDN: 248 case SCIOCGETDN:
249 { 249 {
250 pr_debug("%s: SCIOGETDN: ioctl received\n", 250 pr_debug("%s: SCIOGETDN: ioctl received\n",
251 sc_adapter[card]->devicename); 251 sc_adapter[card]->devicename);
252 252
253 /* 253 /*
254 * Get the dn from the board 254 * Get the dn from the board
255 */ 255 */
256 status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetMyNumber, 256 status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetMyNumber,
257 data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT); 257 data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT);
258 if (!status) { 258 if (!status) {
259 pr_debug("%s: SCIOCGETDN: command successful\n", 259 pr_debug("%s: SCIOCGETDN: command successful\n",
260 sc_adapter[card]->devicename); 260 sc_adapter[card]->devicename);
261 } 261 }
262 else { 262 else {
263 pr_debug("%s: SCIOCGETDN: command failed (status = %d)\n", 263 pr_debug("%s: SCIOCGETDN: command failed (status = %d)\n",
264 sc_adapter[card]->devicename, status); 264 sc_adapter[card]->devicename, status);
265 kfree(rcvmsg); 265 kfree(rcvmsg);
266 return status; 266 return status;
267 } 267 }
@@ -283,12 +283,12 @@ int sc_ioctl(int card, scs_ioctl *data)
283 } 283 }
284 kfree(dn); 284 kfree(dn);
285 return 0; 285 return 0;
286 } 286 }
287 287
288 case SCIOCSETDN: 288 case SCIOCSETDN:
289 { 289 {
290 pr_debug("%s: SCIOSETDN: ioctl received\n", 290 pr_debug("%s: SCIOSETDN: ioctl received\n",
291 sc_adapter[card]->devicename); 291 sc_adapter[card]->devicename);
292 292
293 /* 293 /*
294 * Get the spid from user space 294 * Get the spid from user space
@@ -299,21 +299,21 @@ int sc_ioctl(int card, scs_ioctl *data)
299 return PTR_ERR(dn); 299 return PTR_ERR(dn);
300 } 300 }
301 301
302 pr_debug("%s: SCIOCSETDN: setting channel %d dn to %s\n", 302 pr_debug("%s: SCIOCSETDN: setting channel %d dn to %s\n",
303 sc_adapter[card]->devicename, data->channel, dn); 303 sc_adapter[card]->devicename, data->channel, dn);
304 status = send_and_receive(card, CEPID, ceReqTypeCall, 304 status = send_and_receive(card, CEPID, ceReqTypeCall,
305 ceReqClass0, ceReqCallSetMyNumber, data->channel, 305 ceReqClass0, ceReqCallSetMyNumber, data->channel,
306 strlen(dn),dn,rcvmsg, SAR_TIMEOUT); 306 strlen(dn), dn, rcvmsg, SAR_TIMEOUT);
307 if(!status && !(rcvmsg->rsp_status)) { 307 if (!status && !(rcvmsg->rsp_status)) {
308 pr_debug("%s: SCIOCSETDN: command successful\n", 308 pr_debug("%s: SCIOCSETDN: command successful\n",
309 sc_adapter[card]->devicename); 309 sc_adapter[card]->devicename);
310 kfree(rcvmsg); 310 kfree(rcvmsg);
311 kfree(dn); 311 kfree(dn);
312 return 0; 312 return 0;
313 } 313 }
314 else { 314 else {
315 pr_debug("%s: SCIOCSETDN: command failed (status = %d)\n", 315 pr_debug("%s: SCIOCSETDN: command failed (status = %d)\n",
316 sc_adapter[card]->devicename, status); 316 sc_adapter[card]->devicename, status);
317 kfree(rcvmsg); 317 kfree(rcvmsg);
318 kfree(dn); 318 kfree(dn);
319 return status; 319 return status;
@@ -323,11 +323,11 @@ int sc_ioctl(int card, scs_ioctl *data)
323 case SCIOCTRACE: 323 case SCIOCTRACE:
324 324
325 pr_debug("%s: SCIOTRACE: ioctl received\n", 325 pr_debug("%s: SCIOTRACE: ioctl received\n",
326 sc_adapter[card]->devicename); 326 sc_adapter[card]->devicename);
327/* sc_adapter[card]->trace = !sc_adapter[card]->trace; 327/* sc_adapter[card]->trace = !sc_adapter[card]->trace;
328 pr_debug("%s: SCIOCTRACE: tracing turned %s\n", 328 pr_debug("%s: SCIOCTRACE: tracing turned %s\n",
329 sc_adapter[card]->devicename, 329 sc_adapter[card]->devicename,
330 sc_adapter[card]->trace ? "ON" : "OFF"); */ 330 sc_adapter[card]->trace ? "ON" : "OFF"); */
331 break; 331 break;
332 332
333 case SCIOCSTAT: 333 case SCIOCSTAT:
@@ -335,7 +335,7 @@ int sc_ioctl(int card, scs_ioctl *data)
335 boardInfo *bi; 335 boardInfo *bi;
336 336
337 pr_debug("%s: SCIOSTAT: ioctl received\n", 337 pr_debug("%s: SCIOSTAT: ioctl received\n",
338 sc_adapter[card]->devicename); 338 sc_adapter[card]->devicename);
339 339
340 bi = kzalloc(sizeof(boardInfo), GFP_KERNEL); 340 bi = kzalloc(sizeof(boardInfo), GFP_KERNEL);
341 if (!bi) { 341 if (!bi) {
@@ -358,20 +358,20 @@ int sc_ioctl(int card, scs_ioctl *data)
358 case SCIOCGETSPEED: 358 case SCIOCGETSPEED:
359 { 359 {
360 pr_debug("%s: SCIOGETSPEED: ioctl received\n", 360 pr_debug("%s: SCIOGETSPEED: ioctl received\n",
361 sc_adapter[card]->devicename); 361 sc_adapter[card]->devicename);
362 362
363 /* 363 /*
364 * Get the speed from the board 364 * Get the speed from the board
365 */ 365 */
366 status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, 366 status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0,
367 ceReqCallGetCallType, data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT); 367 ceReqCallGetCallType, data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT);
368 if (!status && !(rcvmsg->rsp_status)) { 368 if (!status && !(rcvmsg->rsp_status)) {
369 pr_debug("%s: SCIOCGETSPEED: command successful\n", 369 pr_debug("%s: SCIOCGETSPEED: command successful\n",
370 sc_adapter[card]->devicename); 370 sc_adapter[card]->devicename);
371 } 371 }
372 else { 372 else {
373 pr_debug("%s: SCIOCGETSPEED: command failed (status = %d)\n", 373 pr_debug("%s: SCIOCGETSPEED: command failed (status = %d)\n",
374 sc_adapter[card]->devicename, status); 374 sc_adapter[card]->devicename, status);
375 kfree(rcvmsg); 375 kfree(rcvmsg);
376 return status; 376 return status;
377 } 377 }
@@ -392,12 +392,12 @@ int sc_ioctl(int card, scs_ioctl *data)
392 392
393 case SCIOCSETSPEED: 393 case SCIOCSETSPEED:
394 pr_debug("%s: SCIOCSETSPEED: ioctl received\n", 394 pr_debug("%s: SCIOCSETSPEED: ioctl received\n",
395 sc_adapter[card]->devicename); 395 sc_adapter[card]->devicename);
396 break; 396 break;
397 397
398 case SCIOCLOOPTST: 398 case SCIOCLOOPTST:
399 pr_debug("%s: SCIOCLOOPTST: ioctl received\n", 399 pr_debug("%s: SCIOCLOOPTST: ioctl received\n",
400 sc_adapter[card]->devicename); 400 sc_adapter[card]->devicename);
401 break; 401 break;
402 402
403 default: 403 default:
@@ -432,32 +432,32 @@ static int GetStatus(int card, boardInfo *bi)
432 * Get the current PhyStats and LnkStats 432 * Get the current PhyStats and LnkStats
433 */ 433 */
434 status = send_and_receive(card, CEPID, ceReqTypePhy, ceReqClass2, 434 status = send_and_receive(card, CEPID, ceReqTypePhy, ceReqClass2,
435 ceReqPhyStatus, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT); 435 ceReqPhyStatus, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT);
436 if(!status) { 436 if (!status) {
437 if(sc_adapter[card]->model < PRI_BOARD) { 437 if (sc_adapter[card]->model < PRI_BOARD) {
438 bi->l1_status = rcvmsg.msg_data.byte_array[2]; 438 bi->l1_status = rcvmsg.msg_data.byte_array[2];
439 for(i = 0 ; i < BRI_CHANNELS ; i++) 439 for (i = 0; i < BRI_CHANNELS; i++)
440 bi->status.bristats[i].phy_stat = 440 bi->status.bristats[i].phy_stat =
441 rcvmsg.msg_data.byte_array[i]; 441 rcvmsg.msg_data.byte_array[i];
442 } 442 }
443 else { 443 else {
444 bi->l1_status = rcvmsg.msg_data.byte_array[0]; 444 bi->l1_status = rcvmsg.msg_data.byte_array[0];
445 bi->l2_status = rcvmsg.msg_data.byte_array[1]; 445 bi->l2_status = rcvmsg.msg_data.byte_array[1];
446 for(i = 0 ; i < PRI_CHANNELS ; i++) 446 for (i = 0; i < PRI_CHANNELS; i++)
447 bi->status.pristats[i].phy_stat = 447 bi->status.pristats[i].phy_stat =
448 rcvmsg.msg_data.byte_array[i+2]; 448 rcvmsg.msg_data.byte_array[i + 2];
449 } 449 }
450 } 450 }
451 451
452 /* 452 /*
453 * Get the call types for each channel 453 * Get the call types for each channel
454 */ 454 */
455 for (i = 0 ; i < sc_adapter[card]->nChannels ; i++) { 455 for (i = 0; i < sc_adapter[card]->nChannels; i++) {
456 status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, 456 status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0,
457 ceReqCallGetCallType, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT); 457 ceReqCallGetCallType, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT);
458 if(!status) { 458 if (!status) {
459 if (sc_adapter[card]->model == PRI_BOARD) { 459 if (sc_adapter[card]->model == PRI_BOARD) {
460 bi->status.pristats[i].call_type = 460 bi->status.pristats[i].call_type =
461 rcvmsg.msg_data.byte_array[0]; 461 rcvmsg.msg_data.byte_array[0];
462 } 462 }
463 else { 463 else {
@@ -466,7 +466,7 @@ static int GetStatus(int card, boardInfo *bi)
466 } 466 }
467 } 467 }
468 } 468 }
469 469
470 /* 470 /*
471 * If PRI, get the call states and service states for each channel 471 * If PRI, get the call states and service states for each channel
472 */ 472 */
@@ -475,10 +475,10 @@ static int GetStatus(int card, boardInfo *bi)
475 * Get the call states 475 * Get the call states
476 */ 476 */
477 status = send_and_receive(card, CEPID, ceReqTypeStat, ceReqClass2, 477 status = send_and_receive(card, CEPID, ceReqTypeStat, ceReqClass2,
478 ceReqPhyChCallState, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT); 478 ceReqPhyChCallState, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT);
479 if(!status) { 479 if (!status) {
480 for( i = 0 ; i < PRI_CHANNELS ; i++ ) 480 for (i = 0; i < PRI_CHANNELS; i++)
481 bi->status.pristats[i].call_state = 481 bi->status.pristats[i].call_state =
482 rcvmsg.msg_data.byte_array[i]; 482 rcvmsg.msg_data.byte_array[i];
483 } 483 }
484 484
@@ -486,27 +486,27 @@ static int GetStatus(int card, boardInfo *bi)
486 * Get the service states 486 * Get the service states
487 */ 487 */
488 status = send_and_receive(card, CEPID, ceReqTypeStat, ceReqClass2, 488 status = send_and_receive(card, CEPID, ceReqTypeStat, ceReqClass2,
489 ceReqPhyChServState, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT); 489 ceReqPhyChServState, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT);
490 if(!status) { 490 if (!status) {
491 for( i = 0 ; i < PRI_CHANNELS ; i++ ) 491 for (i = 0; i < PRI_CHANNELS; i++)
492 bi->status.pristats[i].serv_state = 492 bi->status.pristats[i].serv_state =
493 rcvmsg.msg_data.byte_array[i]; 493 rcvmsg.msg_data.byte_array[i];
494 } 494 }
495 495
496 /* 496 /*
497 * Get the link stats for the channels 497 * Get the link stats for the channels
498 */ 498 */
499 for (i = 1 ; i <= PRI_CHANNELS ; i++) { 499 for (i = 1; i <= PRI_CHANNELS; i++) {
500 status = send_and_receive(card, CEPID, ceReqTypeLnk, ceReqClass0, 500 status = send_and_receive(card, CEPID, ceReqTypeLnk, ceReqClass0,
501 ceReqLnkGetStats, i, 0, NULL, &rcvmsg, SAR_TIMEOUT); 501 ceReqLnkGetStats, i, 0, NULL, &rcvmsg, SAR_TIMEOUT);
502 if (!status) { 502 if (!status) {
503 bi->status.pristats[i-1].link_stats.tx_good = 503 bi->status.pristats[i - 1].link_stats.tx_good =
504 (unsigned long)rcvmsg.msg_data.byte_array[0]; 504 (unsigned long)rcvmsg.msg_data.byte_array[0];
505 bi->status.pristats[i-1].link_stats.tx_bad = 505 bi->status.pristats[i - 1].link_stats.tx_bad =
506 (unsigned long)rcvmsg.msg_data.byte_array[4]; 506 (unsigned long)rcvmsg.msg_data.byte_array[4];
507 bi->status.pristats[i-1].link_stats.rx_good = 507 bi->status.pristats[i - 1].link_stats.rx_good =
508 (unsigned long)rcvmsg.msg_data.byte_array[8]; 508 (unsigned long)rcvmsg.msg_data.byte_array[8];
509 bi->status.pristats[i-1].link_stats.rx_bad = 509 bi->status.pristats[i - 1].link_stats.rx_bad =
510 (unsigned long)rcvmsg.msg_data.byte_array[12]; 510 (unsigned long)rcvmsg.msg_data.byte_array[12];
511 } 511 }
512 } 512 }
@@ -515,7 +515,7 @@ static int GetStatus(int card, boardInfo *bi)
515 * Link stats for the D channel 515 * Link stats for the D channel
516 */ 516 */
517 status = send_and_receive(card, CEPID, ceReqTypeLnk, ceReqClass0, 517 status = send_and_receive(card, CEPID, ceReqTypeLnk, ceReqClass0,
518 ceReqLnkGetStats, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT); 518 ceReqLnkGetStats, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT);
519 if (!status) { 519 if (!status) {
520 bi->dch_stats.tx_good = (unsigned long)rcvmsg.msg_data.byte_array[0]; 520 bi->dch_stats.tx_good = (unsigned long)rcvmsg.msg_data.byte_array[0];
521 bi->dch_stats.tx_bad = (unsigned long)rcvmsg.msg_data.byte_array[4]; 521 bi->dch_stats.tx_bad = (unsigned long)rcvmsg.msg_data.byte_array[4];
@@ -534,49 +534,49 @@ static int GetStatus(int card, boardInfo *bi)
534 * Get the link stats for the channels 534 * Get the link stats for the channels
535 */ 535 */
536 status = send_and_receive(card, CEPID, ceReqTypeLnk, ceReqClass0, 536 status = send_and_receive(card, CEPID, ceReqTypeLnk, ceReqClass0,
537 ceReqLnkGetStats, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT); 537 ceReqLnkGetStats, 0, 0, NULL, &rcvmsg, SAR_TIMEOUT);
538 if (!status) { 538 if (!status) {
539 bi->dch_stats.tx_good = (unsigned long)rcvmsg.msg_data.byte_array[0]; 539 bi->dch_stats.tx_good = (unsigned long)rcvmsg.msg_data.byte_array[0];
540 bi->dch_stats.tx_bad = (unsigned long)rcvmsg.msg_data.byte_array[4]; 540 bi->dch_stats.tx_bad = (unsigned long)rcvmsg.msg_data.byte_array[4];
541 bi->dch_stats.rx_good = (unsigned long)rcvmsg.msg_data.byte_array[8]; 541 bi->dch_stats.rx_good = (unsigned long)rcvmsg.msg_data.byte_array[8];
542 bi->dch_stats.rx_bad = (unsigned long)rcvmsg.msg_data.byte_array[12]; 542 bi->dch_stats.rx_bad = (unsigned long)rcvmsg.msg_data.byte_array[12];
543 bi->status.bristats[0].link_stats.tx_good = 543 bi->status.bristats[0].link_stats.tx_good =
544 (unsigned long)rcvmsg.msg_data.byte_array[16]; 544 (unsigned long)rcvmsg.msg_data.byte_array[16];
545 bi->status.bristats[0].link_stats.tx_bad = 545 bi->status.bristats[0].link_stats.tx_bad =
546 (unsigned long)rcvmsg.msg_data.byte_array[20]; 546 (unsigned long)rcvmsg.msg_data.byte_array[20];
547 bi->status.bristats[0].link_stats.rx_good = 547 bi->status.bristats[0].link_stats.rx_good =
548 (unsigned long)rcvmsg.msg_data.byte_array[24]; 548 (unsigned long)rcvmsg.msg_data.byte_array[24];
549 bi->status.bristats[0].link_stats.rx_bad = 549 bi->status.bristats[0].link_stats.rx_bad =
550 (unsigned long)rcvmsg.msg_data.byte_array[28]; 550 (unsigned long)rcvmsg.msg_data.byte_array[28];
551 bi->status.bristats[1].link_stats.tx_good = 551 bi->status.bristats[1].link_stats.tx_good =
552 (unsigned long)rcvmsg.msg_data.byte_array[32]; 552 (unsigned long)rcvmsg.msg_data.byte_array[32];
553 bi->status.bristats[1].link_stats.tx_bad = 553 bi->status.bristats[1].link_stats.tx_bad =
554 (unsigned long)rcvmsg.msg_data.byte_array[36]; 554 (unsigned long)rcvmsg.msg_data.byte_array[36];
555 bi->status.bristats[1].link_stats.rx_good = 555 bi->status.bristats[1].link_stats.rx_good =
556 (unsigned long)rcvmsg.msg_data.byte_array[40]; 556 (unsigned long)rcvmsg.msg_data.byte_array[40];
557 bi->status.bristats[1].link_stats.rx_bad = 557 bi->status.bristats[1].link_stats.rx_bad =
558 (unsigned long)rcvmsg.msg_data.byte_array[44]; 558 (unsigned long)rcvmsg.msg_data.byte_array[44];
559 } 559 }
560 560
561 /* 561 /*
562 * Get the SPIDs 562 * Get the SPIDs
563 */ 563 */
564 for (i = 0 ; i < BRI_CHANNELS ; i++) { 564 for (i = 0; i < BRI_CHANNELS; i++) {
565 status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, 565 status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0,
566 ceReqCallGetSPID, i+1, 0, NULL, &rcvmsg, SAR_TIMEOUT); 566 ceReqCallGetSPID, i + 1, 0, NULL, &rcvmsg, SAR_TIMEOUT);
567 if (!status) 567 if (!status)
568 strcpy(bi->status.bristats[i].spid, rcvmsg.msg_data.byte_array); 568 strcpy(bi->status.bristats[i].spid, rcvmsg.msg_data.byte_array);
569 } 569 }
570 570
571 /* 571 /*
572 * Get the DNs 572 * Get the DNs
573 */ 573 */
574 for (i = 0 ; i < BRI_CHANNELS ; i++) { 574 for (i = 0; i < BRI_CHANNELS; i++) {
575 status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, 575 status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0,
576 ceReqCallGetMyNumber, i+1, 0, NULL, &rcvmsg, SAR_TIMEOUT); 576 ceReqCallGetMyNumber, i + 1, 0, NULL, &rcvmsg, SAR_TIMEOUT);
577 if (!status) 577 if (!status)
578 strcpy(bi->status.bristats[i].dn, rcvmsg.msg_data.byte_array); 578 strcpy(bi->status.bristats[i].dn, rcvmsg.msg_data.byte_array);
579 } 579 }
580 580
581 return 0; 581 return 0;
582} 582}