aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/sc/command.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/command.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/command.c')
-rw-r--r--drivers/isdn/sc/command.c132
1 files changed, 66 insertions, 66 deletions
diff --git a/drivers/isdn/sc/command.c b/drivers/isdn/sc/command.c
index 0e4969c2ef9..4a4e66152ce 100644
--- a/drivers/isdn/sc/command.c
+++ b/drivers/isdn/sc/command.c
@@ -69,14 +69,14 @@ int get_card_from_id(int driver)
69{ 69{
70 int i; 70 int i;
71 71
72 for(i = 0 ; i < cinst ; i++) { 72 for (i = 0; i < cinst; i++) {
73 if(sc_adapter[i]->driverId == driver) 73 if (sc_adapter[i]->driverId == driver)
74 return i; 74 return i;
75 } 75 }
76 return -ENODEV; 76 return -ENODEV;
77} 77}
78 78
79/* 79/*
80 * command 80 * command
81 */ 81 */
82 82
@@ -85,7 +85,7 @@ int command(isdn_ctrl *cmd)
85 int card; 85 int card;
86 86
87 card = get_card_from_id(cmd->driver); 87 card = get_card_from_id(cmd->driver);
88 if(!IS_VALID_CARD(card)) { 88 if (!IS_VALID_CARD(card)) {
89 pr_debug("Invalid param: %d is not a valid card id\n", card); 89 pr_debug("Invalid param: %d is not a valid card id\n", card);
90 return -ENODEV; 90 return -ENODEV;
91 } 91 }
@@ -93,17 +93,17 @@ int command(isdn_ctrl *cmd)
93 /* 93 /*
94 * Dispatch the command 94 * Dispatch the command
95 */ 95 */
96 switch(cmd->command) { 96 switch (cmd->command) {
97 case ISDN_CMD_IOCTL: 97 case ISDN_CMD_IOCTL:
98 { 98 {
99 unsigned long cmdptr; 99 unsigned long cmdptr;
100 scs_ioctl ioc; 100 scs_ioctl ioc;
101 101
102 memcpy(&cmdptr, cmd->parm.num, sizeof(unsigned long)); 102 memcpy(&cmdptr, cmd->parm.num, sizeof(unsigned long));
103 if (copy_from_user(&ioc, (scs_ioctl __user *)cmdptr, 103 if (copy_from_user(&ioc, (scs_ioctl __user *)cmdptr,
104 sizeof(scs_ioctl))) { 104 sizeof(scs_ioctl))) {
105 pr_debug("%s: Failed to verify user space 0x%lx\n", 105 pr_debug("%s: Failed to verify user space 0x%lx\n",
106 sc_adapter[card]->devicename, cmdptr); 106 sc_adapter[card]->devicename, cmdptr);
107 return -EFAULT; 107 return -EFAULT;
108 } 108 }
109 return sc_ioctl(card, &ioc); 109 return sc_ioctl(card, &ioc);
@@ -133,76 +133,76 @@ int command(isdn_ctrl *cmd)
133/* 133/*
134 * start the onboard firmware 134 * start the onboard firmware
135 */ 135 */
136int startproc(int card) 136int startproc(int card)
137{ 137{
138 int status; 138 int status;
139 139
140 if(!IS_VALID_CARD(card)) { 140 if (!IS_VALID_CARD(card)) {
141 pr_debug("Invalid param: %d is not a valid card id\n", card); 141 pr_debug("Invalid param: %d is not a valid card id\n", card);
142 return -ENODEV; 142 return -ENODEV;
143 } 143 }
144 144
145 /* 145 /*
146 * send start msg 146 * send start msg
147 */ 147 */
148 status = sendmessage(card, CMPID,cmReqType2, 148 status = sendmessage(card, CMPID, cmReqType2,
149 cmReqClass0, 149 cmReqClass0,
150 cmReqStartProc, 150 cmReqStartProc,
151 0,0,NULL); 151 0, 0, NULL);
152 pr_debug("%s: Sent startProc\n", sc_adapter[card]->devicename); 152 pr_debug("%s: Sent startProc\n", sc_adapter[card]->devicename);
153 153
154 return status; 154 return status;
155} 155}
156 156
157 157
158/* 158/*
159 * Dials the number passed in 159 * Dials the number passed in
160 */ 160 */
161static int dial(int card, unsigned long channel, setup_parm setup) 161static int dial(int card, unsigned long channel, setup_parm setup)
162{ 162{
163 int status; 163 int status;
164 char Phone[48]; 164 char Phone[48];
165 165
166 if(!IS_VALID_CARD(card)) { 166 if (!IS_VALID_CARD(card)) {
167 pr_debug("Invalid param: %d is not a valid card id\n", card); 167 pr_debug("Invalid param: %d is not a valid card id\n", card);
168 return -ENODEV; 168 return -ENODEV;
169 } 169 }
170 170
171 /*extract ISDN number to dial from eaz/msn string*/ 171 /*extract ISDN number to dial from eaz/msn string*/
172 strcpy(Phone,setup.phone); 172 strcpy(Phone, setup.phone);
173 173
174 /*send the connection message*/ 174 /*send the connection message*/
175 status = sendmessage(card, CEPID,ceReqTypePhy, 175 status = sendmessage(card, CEPID, ceReqTypePhy,
176 ceReqClass1, 176 ceReqClass1,
177 ceReqPhyConnect, 177 ceReqPhyConnect,
178 (unsigned char) channel+1, 178 (unsigned char)channel + 1,
179 strlen(Phone), 179 strlen(Phone),
180 (unsigned int *) Phone); 180 (unsigned int *)Phone);
181 181
182 pr_debug("%s: Dialing %s on channel %lu\n", 182 pr_debug("%s: Dialing %s on channel %lu\n",
183 sc_adapter[card]->devicename, Phone, channel+1); 183 sc_adapter[card]->devicename, Phone, channel + 1);
184 184
185 return status; 185 return status;
186} 186}
187 187
188/* 188/*
189 * Answer an incoming call 189 * Answer an incoming call
190 */ 190 */
191static int answer(int card, unsigned long channel) 191static int answer(int card, unsigned long channel)
192{ 192{
193 if(!IS_VALID_CARD(card)) { 193 if (!IS_VALID_CARD(card)) {
194 pr_debug("Invalid param: %d is not a valid card id\n", card); 194 pr_debug("Invalid param: %d is not a valid card id\n", card);
195 return -ENODEV; 195 return -ENODEV;
196 } 196 }
197 197
198 if(setup_buffers(card, channel+1)) { 198 if (setup_buffers(card, channel + 1)) {
199 hangup(card, channel+1); 199 hangup(card, channel + 1);
200 return -ENOBUFS; 200 return -ENOBUFS;
201 } 201 }
202 202
203 indicate_status(card, ISDN_STAT_BCONN,channel,NULL); 203 indicate_status(card, ISDN_STAT_BCONN, channel, NULL);
204 pr_debug("%s: Answered incoming call on channel %lu\n", 204 pr_debug("%s: Answered incoming call on channel %lu\n",
205 sc_adapter[card]->devicename, channel+1); 205 sc_adapter[card]->devicename, channel + 1);
206 return 0; 206 return 0;
207} 207}
208 208
@@ -213,19 +213,19 @@ static int hangup(int card, unsigned long channel)
213{ 213{
214 int status; 214 int status;
215 215
216 if(!IS_VALID_CARD(card)) { 216 if (!IS_VALID_CARD(card)) {
217 pr_debug("Invalid param: %d is not a valid card id\n", card); 217 pr_debug("Invalid param: %d is not a valid card id\n", card);
218 return -ENODEV; 218 return -ENODEV;
219 } 219 }
220 220
221 status = sendmessage(card, CEPID, ceReqTypePhy, 221 status = sendmessage(card, CEPID, ceReqTypePhy,
222 ceReqClass1, 222 ceReqClass1,
223 ceReqPhyDisconnect, 223 ceReqPhyDisconnect,
224 (unsigned char) channel+1, 224 (unsigned char)channel + 1,
225 0, 225 0,
226 NULL); 226 NULL);
227 pr_debug("%s: Sent HANGUP message to channel %lu\n", 227 pr_debug("%s: Sent HANGUP message to channel %lu\n",
228 sc_adapter[card]->devicename, channel+1); 228 sc_adapter[card]->devicename, channel + 1);
229 return status; 229 return status;
230} 230}
231 231
@@ -234,10 +234,10 @@ static int hangup(int card, unsigned long channel)
234 */ 234 */
235static int setl2(int card, unsigned long arg) 235static int setl2(int card, unsigned long arg)
236{ 236{
237 int status =0; 237 int status = 0;
238 int protocol,channel; 238 int protocol, channel;
239 239
240 if(!IS_VALID_CARD(card)) { 240 if (!IS_VALID_CARD(card)) {
241 pr_debug("Invalid param: %d is not a valid card id\n", card); 241 pr_debug("Invalid param: %d is not a valid card id\n", card);
242 return -ENODEV; 242 return -ENODEV;
243 } 243 }
@@ -249,14 +249,14 @@ static int setl2(int card, unsigned long arg)
249 * check that the adapter is also set to the correct protocol 249 * check that the adapter is also set to the correct protocol
250 */ 250 */
251 pr_debug("%s: Sending GetFrameFormat for channel %d\n", 251 pr_debug("%s: Sending GetFrameFormat for channel %d\n",
252 sc_adapter[card]->devicename, channel+1); 252 sc_adapter[card]->devicename, channel + 1);
253 status = sendmessage(card, CEPID, ceReqTypeCall, 253 status = sendmessage(card, CEPID, ceReqTypeCall,
254 ceReqClass0, 254 ceReqClass0,
255 ceReqCallGetFrameFormat, 255 ceReqCallGetFrameFormat,
256 (unsigned char)channel+1, 256 (unsigned char)channel + 1,
257 1, 257 1,
258 (unsigned int *) protocol); 258 (unsigned int *)protocol);
259 if(status) 259 if (status)
260 return status; 260 return status;
261 return 0; 261 return 0;
262} 262}
@@ -268,7 +268,7 @@ static int setl3(int card, unsigned long channel)
268{ 268{
269 int protocol = channel >> 8; 269 int protocol = channel >> 8;
270 270
271 if(!IS_VALID_CARD(card)) { 271 if (!IS_VALID_CARD(card)) {
272 pr_debug("Invalid param: %d is not a valid card id\n", card); 272 pr_debug("Invalid param: %d is not a valid card id\n", card);
273 return -ENODEV; 273 return -ENODEV;
274 } 274 }
@@ -279,26 +279,26 @@ static int setl3(int card, unsigned long channel)
279 279
280static int acceptb(int card, unsigned long channel) 280static int acceptb(int card, unsigned long channel)
281{ 281{
282 if(!IS_VALID_CARD(card)) { 282 if (!IS_VALID_CARD(card)) {
283 pr_debug("Invalid param: %d is not a valid card id\n", card); 283 pr_debug("Invalid param: %d is not a valid card id\n", card);
284 return -ENODEV; 284 return -ENODEV;
285 } 285 }
286 286
287 if(setup_buffers(card, channel+1)) 287 if (setup_buffers(card, channel + 1))
288 { 288 {
289 hangup(card, channel+1); 289 hangup(card, channel + 1);
290 return -ENOBUFS; 290 return -ENOBUFS;
291 } 291 }
292 292
293 pr_debug("%s: B-Channel connection accepted on channel %lu\n", 293 pr_debug("%s: B-Channel connection accepted on channel %lu\n",
294 sc_adapter[card]->devicename, channel+1); 294 sc_adapter[card]->devicename, channel + 1);
295 indicate_status(card, ISDN_STAT_BCONN, channel, NULL); 295 indicate_status(card, ISDN_STAT_BCONN, channel, NULL);
296 return 0; 296 return 0;
297} 297}
298 298
299static int clreaz(int card, unsigned long arg) 299static int clreaz(int card, unsigned long arg)
300{ 300{
301 if(!IS_VALID_CARD(card)) { 301 if (!IS_VALID_CARD(card)) {
302 pr_debug("Invalid param: %d is not a valid card id\n", card); 302 pr_debug("Invalid param: %d is not a valid card id\n", card);
303 return -ENODEV; 303 return -ENODEV;
304 } 304 }
@@ -306,13 +306,13 @@ static int clreaz(int card, unsigned long arg)
306 strcpy(sc_adapter[card]->channel[arg].eazlist, ""); 306 strcpy(sc_adapter[card]->channel[arg].eazlist, "");
307 sc_adapter[card]->channel[arg].eazclear = 1; 307 sc_adapter[card]->channel[arg].eazclear = 1;
308 pr_debug("%s: EAZ List cleared for channel %lu\n", 308 pr_debug("%s: EAZ List cleared for channel %lu\n",
309 sc_adapter[card]->devicename, arg+1); 309 sc_adapter[card]->devicename, arg + 1);
310 return 0; 310 return 0;
311} 311}
312 312
313static int seteaz(int card, unsigned long arg, char *num) 313static int seteaz(int card, unsigned long arg, char *num)
314{ 314{
315 if(!IS_VALID_CARD(card)) { 315 if (!IS_VALID_CARD(card)) {
316 pr_debug("Invalid param: %d is not a valid card id\n", card); 316 pr_debug("Invalid param: %d is not a valid card id\n", card);
317 return -ENODEV; 317 return -ENODEV;
318 } 318 }
@@ -320,8 +320,8 @@ static int seteaz(int card, unsigned long arg, char *num)
320 strcpy(sc_adapter[card]->channel[arg].eazlist, num); 320 strcpy(sc_adapter[card]->channel[arg].eazlist, num);
321 sc_adapter[card]->channel[arg].eazclear = 0; 321 sc_adapter[card]->channel[arg].eazclear = 0;
322 pr_debug("%s: EAZ list for channel %lu set to: %s\n", 322 pr_debug("%s: EAZ list for channel %lu set to: %s\n",
323 sc_adapter[card]->devicename, arg+1, 323 sc_adapter[card]->devicename, arg + 1,
324 sc_adapter[card]->channel[arg].eazlist); 324 sc_adapter[card]->channel[arg].eazlist);
325 return 0; 325 return 0;
326} 326}
327 327
@@ -329,14 +329,14 @@ int reset(int card)
329{ 329{
330 unsigned long flags; 330 unsigned long flags;
331 331
332 if(!IS_VALID_CARD(card)) { 332 if (!IS_VALID_CARD(card)) {
333 pr_debug("Invalid param: %d is not a valid card id\n", card); 333 pr_debug("Invalid param: %d is not a valid card id\n", card);
334 return -ENODEV; 334 return -ENODEV;
335 } 335 }
336 336
337 indicate_status(card, ISDN_STAT_STOP, 0, NULL); 337 indicate_status(card, ISDN_STAT_STOP, 0, NULL);
338 338
339 if(sc_adapter[card]->EngineUp) { 339 if (sc_adapter[card]->EngineUp) {
340 del_timer(&sc_adapter[card]->stat_timer); 340 del_timer(&sc_adapter[card]->stat_timer);
341 } 341 }
342 342
@@ -350,14 +350,14 @@ int reset(int card)
350 add_timer(&sc_adapter[card]->reset_timer); 350 add_timer(&sc_adapter[card]->reset_timer);
351 spin_unlock_irqrestore(&sc_adapter[card]->lock, flags); 351 spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
352 352
353 outb(0x1,sc_adapter[card]->ioport[SFT_RESET]); 353 outb(0x1, sc_adapter[card]->ioport[SFT_RESET]);
354 354
355 pr_debug("%s: Adapter Reset\n", sc_adapter[card]->devicename); 355 pr_debug("%s: Adapter Reset\n", sc_adapter[card]->devicename);
356 return 0; 356 return 0;
357} 357}
358 358
359void flushreadfifo (int card) 359void flushreadfifo(int card)
360{ 360{
361 while(inb(sc_adapter[card]->ioport[FIFO_STATUS]) & RF_HAS_DATA) 361 while (inb(sc_adapter[card]->ioport[FIFO_STATUS]) & RF_HAS_DATA)
362 inb(sc_adapter[card]->ioport[FIFO_READ]); 362 inb(sc_adapter[card]->ioport[FIFO_READ]);
363} 363}