Commit f87b2ed2 authored by David Woodhouse's avatar David Woodhouse

solos: Swap upstream/downstream rates in status packet, clean up some more

Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent eab50f73
...@@ -314,14 +314,16 @@ static char *next_string(struct sk_buff *skb) ...@@ -314,14 +314,16 @@ static char *next_string(struct sk_buff *skb)
* for the information therein. Fields are.... * for the information therein. Fields are....
* *
* packet version * packet version
* TxBitRate (version >= 1)
* RxBitRate (version >= 1) * RxBitRate (version >= 1)
* TxBitRate (version >= 1)
* State (version >= 1) * State (version >= 1)
* LocalSNRMargin (version >= 1)
* LocalLineAttn (version >= 1)
*/ */
static int process_status(struct solos_card *card, int port, struct sk_buff *skb) static int process_status(struct solos_card *card, int port, struct sk_buff *skb)
{ {
char *str, *end, *state_str; char *str, *end, *state_str, *snr, *attn;
int ver, rate_up, rate_down, state; int ver, rate_up, rate_down;
if (!card->atmdev[port]) if (!card->atmdev[port])
return -ENODEV; return -ENODEV;
...@@ -346,45 +348,42 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb ...@@ -346,45 +348,42 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
return 0; return 0;
} }
rate_up = simple_strtol(str, &end, 10); rate_down = simple_strtol(str, &end, 10);
if (*end) if (*end)
return -EIO; return -EIO;
str = next_string(skb); str = next_string(skb);
if (!str) if (!str)
return -EIO; return -EIO;
rate_down = simple_strtol(str, &end, 10); rate_up = simple_strtol(str, &end, 10);
if (*end) if (*end)
return -EIO; return -EIO;
state_str = next_string(skb); state_str = next_string(skb);
if (!state_str) if (!state_str)
return -EIO; return -EIO;
if (!strcmp(state_str, "Showtime"))
state = ATM_PHY_SIG_FOUND; /* Anything but 'Showtime' is down */
else { if (strcmp(state_str, "Showtime")) {
state = ATM_PHY_SIG_LOST; card->atmdev[port]->signal = ATM_PHY_SIG_LOST;
release_vccs(card->atmdev[port]); release_vccs(card->atmdev[port]);
dev_info(&card->dev->dev, "Port %d: %s\n", port, state_str);
return 0;
} }
if (state == ATM_PHY_SIG_LOST) { snr = next_string(skb);
dev_info(&card->dev->dev, "Port %d: %s\n", port, state_str); if (!str)
} else { return -EIO;
char *snr, *attn; attn = next_string(skb);
if (!attn)
snr = next_string(skb); return -EIO;
if (!str)
return -EIO; dev_info(&card->dev->dev, "Port %d: %s @%d/%d kb/s%s%s%s%s\n",
attn = next_string(skb); port, state_str, rate_down/1000, rate_up/1000,
if (!attn) snr[0]?", SNR ":"", snr, attn[0]?", Attn ":"", attn);
return -EIO;
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);
}
card->atmdev[port]->link_rate = rate_down / 424; card->atmdev[port]->link_rate = rate_down / 424;
card->atmdev[port]->signal = state; card->atmdev[port]->signal = ATM_PHY_SIG_FOUND;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment