aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/atm/solos-pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/atm/solos-pci.c')
-rw-r--r--drivers/atm/solos-pci.c51
1 files changed, 25 insertions, 26 deletions
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index 7c26bd2ac113..eef920a9c448 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -314,14 +314,16 @@ static char *next_string(struct sk_buff *skb)
314 * for the information therein. Fields are.... 314 * for the information therein. Fields are....
315 * 315 *
316 * packet version 316 * packet version
317 * TxBitRate (version >= 1)
318 * RxBitRate (version >= 1) 317 * RxBitRate (version >= 1)
318 * TxBitRate (version >= 1)
319 * State (version >= 1) 319 * State (version >= 1)
320 * LocalSNRMargin (version >= 1)
321 * LocalLineAttn (version >= 1)
320 */ 322 */
321static int process_status(struct solos_card *card, int port, struct sk_buff *skb) 323static int process_status(struct solos_card *card, int port, struct sk_buff *skb)
322{ 324{
323 char *str, *end, *state_str; 325 char *str, *end, *state_str, *snr, *attn;
324 int ver, rate_up, rate_down, state; 326 int ver, rate_up, rate_down;
325 327
326 if (!card->atmdev[port]) 328 if (!card->atmdev[port])
327 return -ENODEV; 329 return -ENODEV;
@@ -346,45 +348,42 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
346 return 0; 348 return 0;
347 } 349 }
348 350
349 rate_up = simple_strtol(str, &end, 10); 351 rate_down = simple_strtol(str, &end, 10);
350 if (*end) 352 if (*end)
351 return -EIO; 353 return -EIO;
352 354
353 str = next_string(skb); 355 str = next_string(skb);
354 if (!str) 356 if (!str)
355 return -EIO; 357 return -EIO;
356 rate_down = simple_strtol(str, &end, 10); 358 rate_up = simple_strtol(str, &end, 10);
357 if (*end) 359 if (*end)
358 return -EIO; 360 return -EIO;
359 361
360 state_str = next_string(skb); 362 state_str = next_string(skb);
361 if (!state_str) 363 if (!state_str)
362 return -EIO; 364 return -EIO;
363 if (!strcmp(state_str, "Showtime")) 365
364 state = ATM_PHY_SIG_FOUND; 366 /* Anything but 'Showtime' is down */
365 else { 367 if (strcmp(state_str, "Showtime")) {
366 state = ATM_PHY_SIG_LOST; 368 card->atmdev[port]->signal = ATM_PHY_SIG_LOST;
367 release_vccs(card->atmdev[port]); 369 release_vccs(card->atmdev[port]);
370 dev_info(&card->dev->dev, "Port %d: %s\n", port, state_str);
371 return 0;
368 } 372 }
369 373
370 if (state == ATM_PHY_SIG_LOST) { 374 snr = next_string(skb);
371 dev_info(&card->dev->dev, "Port %d: %s\n", port, state_str); 375 if (!str)
372 } else { 376 return -EIO;
373 char *snr, *attn; 377 attn = next_string(skb);
374 378 if (!attn)
375 snr = next_string(skb); 379 return -EIO;
376 if (!str) 380
377 return -EIO; 381 dev_info(&card->dev->dev, "Port %d: %s @%d/%d kb/s%s%s%s%s\n",
378 attn = next_string(skb); 382 port, state_str, rate_down/1000, rate_up/1000,
379 if (!attn) 383 snr[0]?", SNR ":"", snr, attn[0]?", Attn ":"", attn);
380 return -EIO; 384
381
382 dev_info(&card->dev->dev, "Port %d: %s @%d/%d kb/s%s%s%s%s\n",
383 port, state_str, rate_down/1000, rate_up/1000,
384 snr[0]?", SNR ":"", snr, attn[0]?", Attn ":"", attn);
385 }
386 card->atmdev[port]->link_rate = rate_down / 424; 385 card->atmdev[port]->link_rate = rate_down / 424;
387 card->atmdev[port]->signal = state; 386 card->atmdev[port]->signal = ATM_PHY_SIG_FOUND;
388 387
389 return 0; 388 return 0;
390} 389}