Commit 1786384e authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6656: implement get_stats ieee80211_low_level_stats

The driver already report low_level_stats via vnt_interrupt_data.

Allow mac80211 to collect them via vnt_get_stats
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fb3cdd16
...@@ -438,6 +438,7 @@ struct vnt_private { ...@@ -438,6 +438,7 @@ struct vnt_private {
u8 byChannelSwitchCount; u8 byChannelSwitchCount;
struct iw_statistics wstats; /* wireless stats */ struct iw_statistics wstats; /* wireless stats */
struct ieee80211_low_level_stats low_stats;
}; };
#define ADD_ONE_WITH_WRAP_AROUND(uVar, uModulo) { \ #define ADD_ONE_WITH_WRAP_AROUND(uVar, uModulo) { \
......
...@@ -79,6 +79,7 @@ void INTnsProcessData(struct vnt_private *priv) ...@@ -79,6 +79,7 @@ void INTnsProcessData(struct vnt_private *priv)
{ {
struct vnt_interrupt_data *int_data; struct vnt_interrupt_data *int_data;
struct net_device_stats *stats = &priv->stats; struct net_device_stats *stats = &priv->stats;
struct ieee80211_low_level_stats *low_stats = &priv->low_stats;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsInterruptProcessData\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsInterruptProcessData\n");
...@@ -133,6 +134,11 @@ void INTnsProcessData(struct vnt_private *priv) ...@@ -133,6 +134,11 @@ void INTnsProcessData(struct vnt_private *priv)
#endif #endif
} }
priv->qwCurrTSF = le64_to_cpu(int_data->tsf); priv->qwCurrTSF = le64_to_cpu(int_data->tsf);
low_stats->dot11RTSSuccessCount += int_data->rts_success;
low_stats->dot11RTSFailureCount += int_data->rts_fail;
low_stats->dot11ACKFailureCount += int_data->ack_fail;
low_stats->dot11FCSErrorCount += int_data->fcs_err;
} }
if (int_data->isr1 != 0) if (int_data->isr1 != 0)
......
...@@ -1006,6 +1006,16 @@ static void vnt_sw_scan_complete(struct ieee80211_hw *hw) ...@@ -1006,6 +1006,16 @@ static void vnt_sw_scan_complete(struct ieee80211_hw *hw)
BBvUpdatePreEDThreshold(priv, false); BBvUpdatePreEDThreshold(priv, false);
} }
static int vnt_get_stats(struct ieee80211_hw *hw,
struct ieee80211_low_level_stats *stats)
{
struct vnt_private *priv = hw->priv;
memcpy(stats, &priv->low_stats, sizeof(*stats));
return 0;
}
static u64 vnt_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif) static u64 vnt_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{ {
struct vnt_private *priv = hw->priv; struct vnt_private *priv = hw->priv;
...@@ -1043,6 +1053,7 @@ static const struct ieee80211_ops vnt_mac_ops = { ...@@ -1043,6 +1053,7 @@ static const struct ieee80211_ops vnt_mac_ops = {
.set_key = vnt_set_key, .set_key = vnt_set_key,
.sw_scan_start = vnt_sw_scan_start, .sw_scan_start = vnt_sw_scan_start,
.sw_scan_complete = vnt_sw_scan_complete, .sw_scan_complete = vnt_sw_scan_complete,
.get_stats = vnt_get_stats,
.get_tsf = vnt_get_tsf, .get_tsf = vnt_get_tsf,
.set_tsf = vnt_set_tsf, .set_tsf = vnt_set_tsf,
.reset_tsf = vnt_reset_tsf, .reset_tsf = vnt_reset_tsf,
......
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