summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/wext.c
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2008-03-17 12:45:58 +0100
committerJohn W. Linville <linville@tuxdriver.com>2008-03-25 16:41:48 -0400
commitc49c3b77c8c611f562ca4e201d88d3e69465f928 (patch)
tree937308f8020b0e9437cdf8b9e8f6a43f10a26282 /drivers/net/wireless/libertas/wext.c
parentc97329e21fc487ebf251c920d46537ff5fb4d8a7 (diff)
libertas: convert GET_LOG to a direct command
Now uses __lbs_cmd() to get the "log" (it's actually more a snapshot of various counters, not a sequential log). Besides the "mechanical" convertion the patch add the following logical changes: * Removes the priv->logmsg variable, it was only used in one place anyway, also don't blindly get the counters when associating. Getting the counters then the user asks via WEXT for them is good enought. * don't set wstats.discard.fragment with log.rxfrag, because the latter is a counter for successfully received packets, not for fragmented packets. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/wext.c')
-rw-r--r--drivers/net/wireless/libertas/wext.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index cded4bb6916..5ccb4e0c8d6 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -820,6 +820,7 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev)
int stats_valid = 0;
u8 rssi;
u32 tx_retries;
+ struct cmd_ds_802_11_get_log log;
lbs_deb_enter(LBS_DEB_WEXT);
@@ -863,7 +864,11 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev)
/* Quality by TX errors */
priv->wstats.discard.retries = priv->stats.tx_errors;
- tx_retries = le32_to_cpu(priv->logmsg.retry);
+ memset(&log, 0, sizeof(log));
+ log.hdr.size = cpu_to_le16(sizeof(log));
+ lbs_cmd_with_response(priv, CMD_802_11_GET_LOG, &log);
+
+ tx_retries = le32_to_cpu(log.retry);
if (tx_retries > 75)
tx_qual = (90 - tx_retries) * POOR / 15;
@@ -879,10 +884,9 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev)
(PERFECT - VERY_GOOD) / 50 + VERY_GOOD;
quality = min(quality, tx_qual);
- priv->wstats.discard.code = le32_to_cpu(priv->logmsg.wepundecryptable);
- priv->wstats.discard.fragment = le32_to_cpu(priv->logmsg.rxfrag);
+ priv->wstats.discard.code = le32_to_cpu(log.wepundecryptable);
priv->wstats.discard.retries = tx_retries;
- priv->wstats.discard.misc = le32_to_cpu(priv->logmsg.ackfailure);
+ priv->wstats.discard.misc = le32_to_cpu(log.ackfailure);
/* Calculate quality */
priv->wstats.qual.qual = min_t(u8, quality, 100);
@@ -892,8 +896,6 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev)
/* update stats asynchronously for future calls */
lbs_prepare_and_send_command(priv, CMD_802_11_RSSI, 0,
0, 0, NULL);
- lbs_prepare_and_send_command(priv, CMD_802_11_GET_LOG, 0,
- 0, 0, NULL);
out:
if (!stats_valid) {
priv->wstats.miss.beacon = 0;