aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas/ethtool.c')
-rw-r--r--drivers/net/wireless/libertas/ethtool.c72
1 files changed, 32 insertions, 40 deletions
diff --git a/drivers/net/wireless/libertas/ethtool.c b/drivers/net/wireless/libertas/ethtool.c
index d793d843f7d5..3dae15211b6a 100644
--- a/drivers/net/wireless/libertas/ethtool.c
+++ b/drivers/net/wireless/libertas/ethtool.c
@@ -109,29 +109,8 @@ static void libertas_ethtool_get_stats(struct net_device * dev,
109 struct ethtool_stats * stats, u64 * data) 109 struct ethtool_stats * stats, u64 * data)
110{ 110{
111 wlan_private *priv = dev->priv; 111 wlan_private *priv = dev->priv;
112
113 lbs_deb_enter(LBS_DEB_ETHTOOL);
114
115 stats->cmd = ETHTOOL_GSTATS;
116 BUG_ON(stats->n_stats != MESH_STATS_NUM);
117
118 data[0] = priv->mstats.fwd_drop_rbt;
119 data[1] = priv->mstats.fwd_drop_ttl;
120 data[2] = priv->mstats.fwd_drop_noroute;
121 data[3] = priv->mstats.fwd_drop_nobuf;
122 data[4] = priv->mstats.fwd_unicast_cnt;
123 data[5] = priv->mstats.fwd_bcast_cnt;
124 data[6] = priv->mstats.drop_blind;
125 data[7] = priv->mstats.tx_failed_cnt;
126
127 lbs_deb_enter(LBS_DEB_ETHTOOL);
128}
129
130static int libertas_ethtool_get_stats_count(struct net_device * dev)
131{
132 int ret;
133 wlan_private *priv = dev->priv;
134 struct cmd_ds_mesh_access mesh_access; 112 struct cmd_ds_mesh_access mesh_access;
113 int ret;
135 114
136 lbs_deb_enter(LBS_DEB_ETHTOOL); 115 lbs_deb_enter(LBS_DEB_ETHTOOL);
137 116
@@ -140,25 +119,38 @@ static int libertas_ethtool_get_stats_count(struct net_device * dev)
140 CMD_MESH_ACCESS, CMD_ACT_MESH_GET_STATS, 119 CMD_MESH_ACCESS, CMD_ACT_MESH_GET_STATS,
141 CMD_OPTION_WAITFORRSP, 0, &mesh_access); 120 CMD_OPTION_WAITFORRSP, 0, &mesh_access);
142 121
143 if (ret) { 122 if (ret)
144 ret = 0; 123 return;
145 goto done; 124
146 } 125 priv->mstats.fwd_drop_rbt = le32_to_cpu(mesh_access.data[0]);
147 126 priv->mstats.fwd_drop_ttl = le32_to_cpu(mesh_access.data[1]);
148 priv->mstats.fwd_drop_rbt = le32_to_cpu(mesh_access.data[0]); 127 priv->mstats.fwd_drop_noroute = le32_to_cpu(mesh_access.data[2]);
149 priv->mstats.fwd_drop_ttl = le32_to_cpu(mesh_access.data[1]); 128 priv->mstats.fwd_drop_nobuf = le32_to_cpu(mesh_access.data[3]);
150 priv->mstats.fwd_drop_noroute = le32_to_cpu(mesh_access.data[2]); 129 priv->mstats.fwd_unicast_cnt = le32_to_cpu(mesh_access.data[4]);
151 priv->mstats.fwd_drop_nobuf = le32_to_cpu(mesh_access.data[3]); 130 priv->mstats.fwd_bcast_cnt = le32_to_cpu(mesh_access.data[5]);
152 priv->mstats.fwd_unicast_cnt = le32_to_cpu(mesh_access.data[4]); 131 priv->mstats.drop_blind = le32_to_cpu(mesh_access.data[6]);
153 priv->mstats.fwd_bcast_cnt = le32_to_cpu(mesh_access.data[5]); 132 priv->mstats.tx_failed_cnt = le32_to_cpu(mesh_access.data[7]);
154 priv->mstats.drop_blind = le32_to_cpu(mesh_access.data[6]); 133
155 priv->mstats.tx_failed_cnt = le32_to_cpu(mesh_access.data[7]); 134 data[0] = priv->mstats.fwd_drop_rbt;
135 data[1] = priv->mstats.fwd_drop_ttl;
136 data[2] = priv->mstats.fwd_drop_noroute;
137 data[3] = priv->mstats.fwd_drop_nobuf;
138 data[4] = priv->mstats.fwd_unicast_cnt;
139 data[5] = priv->mstats.fwd_bcast_cnt;
140 data[6] = priv->mstats.drop_blind;
141 data[7] = priv->mstats.tx_failed_cnt;
156 142
157 ret = MESH_STATS_NUM; 143 lbs_deb_enter(LBS_DEB_ETHTOOL);
144}
158 145
159done: 146static int libertas_ethtool_get_sset_count(struct net_device * dev, int sset)
160 lbs_deb_enter_args(LBS_DEB_ETHTOOL, "ret %d", ret); 147{
161 return ret; 148 switch (sset) {
149 case ETH_SS_STATS:
150 return MESH_STATS_NUM;
151 default:
152 return -EOPNOTSUPP;
153 }
162} 154}
163 155
164static void libertas_ethtool_get_strings (struct net_device * dev, 156static void libertas_ethtool_get_strings (struct net_device * dev,
@@ -185,7 +177,7 @@ struct ethtool_ops libertas_ethtool_ops = {
185 .get_drvinfo = libertas_ethtool_get_drvinfo, 177 .get_drvinfo = libertas_ethtool_get_drvinfo,
186 .get_eeprom = libertas_ethtool_get_eeprom, 178 .get_eeprom = libertas_ethtool_get_eeprom,
187 .get_eeprom_len = libertas_ethtool_get_eeprom_len, 179 .get_eeprom_len = libertas_ethtool_get_eeprom_len,
188 .get_stats_count = libertas_ethtool_get_stats_count, 180 .get_sset_count = libertas_ethtool_get_sset_count,
189 .get_ethtool_stats = libertas_ethtool_get_stats, 181 .get_ethtool_stats = libertas_ethtool_get_stats,
190 .get_strings = libertas_ethtool_get_strings, 182 .get_strings = libertas_ethtool_get_strings,
191}; 183};