Skip to content

Commit

Permalink
solos: Tidy up status interrupt handling, cope with 'ERROR' status
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jan 30, 2009
1 parent cc3657e commit 95852f4
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions drivers/atm/solos-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,12 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
str = next_string(skb);
if (!str)
return -EIO;
if (!strcmp(str, "ERROR")) {
dev_dbg(&card->dev->dev, "Status packet indicated Solos error on port %d (starting up?)\n",
port);
return 0;
}

rate_up = simple_strtol(str, &end, 10);
if (*end)
return -EIO;
Expand All @@ -362,8 +368,7 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
}

if (state == ATM_PHY_SIG_LOST) {
dev_info(&card->dev->dev, "Port %d ATM state: %s\n",
port, state_str);
dev_info(&card->dev->dev, "Port %d: %s\n", port, state_str);
} else {
char *snr, *attn;

Expand All @@ -374,7 +379,7 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
if (!attn)
return -EIO;

dev_info(&card->dev->dev, "Port %d: %s (%d/%d kb/s%s%s%s%s)\n",
dev_info(&card->dev->dev, "Port %d: %s @%d/%d kb/s%s%s%s%s\n",
port, state_str, rate_down/1000, rate_up/1000,
snr[0]?", SNR ":"", snr, attn[0]?", Attn ":"", attn);
}
Expand Down Expand Up @@ -663,7 +668,11 @@ void solos_bh(unsigned long card_arg)
break;

case PKT_STATUS:
process_status(card, port, skb);
if (process_status(card, port, skb) &&
net_ratelimit()) {
dev_warn(&card->dev->dev, "Bad status packet of %d bytes on port %d:\n", skb->len, port);
print_buffer(skb);
}
dev_kfree_skb_any(skb);
break;

Expand Down

0 comments on commit 95852f4

Please sign in to comment.