summaryrefslogtreecommitdiffstats
path: root/drivers/atm
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2009-01-30 14:31:36 +1100
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-01-30 14:57:48 +1100
commitf87b2ed225c002ea1b1b9994c6608d8b202f865e (patch)
tree50d59178599749751d83c6788b6a0e7d510097a7 /drivers/atm
parenteab50f73ca51384d8f17886edc7bbc9969b91c0e (diff)
downloadlinux-f87b2ed225c002ea1b1b9994c6608d8b202f865e.tar.gz
linux-f87b2ed225c002ea1b1b9994c6608d8b202f865e.tar.bz2
linux-f87b2ed225c002ea1b1b9994c6608d8b202f865e.zip
solos: Swap upstream/downstream rates in status packet, clean up some more
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/atm')
-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)
* for the information therein. Fields are....
*
* packet version
- * TxBitRate (version >= 1)
* RxBitRate (version >= 1)
+ * TxBitRate (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)
{
- char *str, *end, *state_str;
- int ver, rate_up, rate_down, state;
+ char *str, *end, *state_str, *snr, *attn;
+ int ver, rate_up, rate_down;
if (!card->atmdev[port])
return -ENODEV;
@@ -346,45 +348,42 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
return 0;
}
- rate_up = simple_strtol(str, &end, 10);
+ rate_down = simple_strtol(str, &end, 10);
if (*end)
return -EIO;
str = next_string(skb);
if (!str)
return -EIO;
- rate_down = simple_strtol(str, &end, 10);
+ rate_up = simple_strtol(str, &end, 10);
if (*end)
return -EIO;
state_str = next_string(skb);
if (!state_str)
return -EIO;
- if (!strcmp(state_str, "Showtime"))
- state = ATM_PHY_SIG_FOUND;
- else {
- state = ATM_PHY_SIG_LOST;
+
+ /* Anything but 'Showtime' is down */
+ if (strcmp(state_str, "Showtime")) {
+ card->atmdev[port]->signal = ATM_PHY_SIG_LOST;
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) {
- dev_info(&card->dev->dev, "Port %d: %s\n", port, state_str);
- } else {
- char *snr, *attn;
-
- snr = next_string(skb);
- if (!str)
- return -EIO;
- attn = next_string(skb);
- if (!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);
- }
+ snr = next_string(skb);
+ if (!str)
+ return -EIO;
+ attn = next_string(skb);
+ if (!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]->signal = state;
+ card->atmdev[port]->signal = ATM_PHY_SIG_FOUND;
return 0;
}