aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ehea/ehea_ethtool.c
diff options
context:
space:
mode:
authorJan-Bernd Themann <ossthema@de.ibm.com>2007-03-23 12:18:53 -0400
committerJeff Garzik <jeff@garzik.org>2007-04-28 11:01:02 -0400
commitacbddb591ba76bb20204fd6a407cb87d3f5f751e (patch)
tree008f1965aea9567bfbaeb9f46ab71e44662fd6d7 /drivers/net/ehea/ehea_ethtool.c
parent144213d71ce8b2a1e0740dd25808143e9ace655a (diff)
ehea: removing unused functionality
This patch includes: - removal of unused fields in structs - ethtool statistics cleanup - removes unsed functionality from send path Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ehea/ehea_ethtool.c')
-rw-r--r--drivers/net/ehea/ehea_ethtool.c111
1 files changed, 41 insertions, 70 deletions
diff --git a/drivers/net/ehea/ehea_ethtool.c b/drivers/net/ehea/ehea_ethtool.c
index 19950273ceb9..decec8cfe96b 100644
--- a/drivers/net/ehea/ehea_ethtool.c
+++ b/drivers/net/ehea/ehea_ethtool.c
@@ -166,33 +166,23 @@ static u32 ehea_get_rx_csum(struct net_device *dev)
166} 166}
167 167
168static char ehea_ethtool_stats_keys[][ETH_GSTRING_LEN] = { 168static char ehea_ethtool_stats_keys[][ETH_GSTRING_LEN] = {
169 {"poll_max_processed"},
170 {"queue_stopped"},
171 {"min_swqe_avail"},
172 {"poll_receive_err"},
173 {"pkt_send"},
174 {"pkt_xmit"},
175 {"send_tasklet"},
176 {"ehea_poll"},
177 {"nwqe"},
178 {"swqe_available_0"},
179 {"sig_comp_iv"}, 169 {"sig_comp_iv"},
180 {"swqe_refill_th"}, 170 {"swqe_refill_th"},
181 {"port resets"}, 171 {"port resets"},
182 {"rxo"}, 172 {"Receive errors"},
183 {"rx64"}, 173 {"TCP cksum errors"},
184 {"rx65"}, 174 {"IP cksum errors"},
185 {"rx128"}, 175 {"Frame cksum errors"},
186 {"rx256"}, 176 {"num SQ stopped"},
187 {"rx512"}, 177 {"SQ stopped"},
188 {"rx1024"}, 178 {"PR0 free_swqes"},
189 {"txo"}, 179 {"PR1 free_swqes"},
190 {"tx64"}, 180 {"PR2 free_swqes"},
191 {"tx65"}, 181 {"PR3 free_swqes"},
192 {"tx128"}, 182 {"PR4 free_swqes"},
193 {"tx256"}, 183 {"PR5 free_swqes"},
194 {"tx512"}, 184 {"PR6 free_swqes"},
195 {"tx1024"}, 185 {"PR7 free_swqes"},
196}; 186};
197 187
198static void ehea_get_strings(struct net_device *dev, u32 stringset, u8 *data) 188static void ehea_get_strings(struct net_device *dev, u32 stringset, u8 *data)
@@ -211,63 +201,44 @@ static int ehea_get_stats_count(struct net_device *dev)
211static void ehea_get_ethtool_stats(struct net_device *dev, 201static void ehea_get_ethtool_stats(struct net_device *dev,
212 struct ethtool_stats *stats, u64 *data) 202 struct ethtool_stats *stats, u64 *data)
213{ 203{
214 u64 hret; 204 int i, k, tmp;
215 int i;
216 struct ehea_port *port = netdev_priv(dev); 205 struct ehea_port *port = netdev_priv(dev);
217 struct ehea_adapter *adapter = port->adapter;
218 struct ehea_port_res *pr = &port->port_res[0];
219 struct port_state *p_state = &pr->p_state;
220 struct hcp_ehea_port_cb6 *cb6;
221 206
222 for (i = 0; i < ehea_get_stats_count(dev); i++) 207 for (i = 0; i < ehea_get_stats_count(dev); i++)
223 data[i] = 0; 208 data[i] = 0;
224
225 i = 0; 209 i = 0;
226 210
227 data[i++] = p_state->poll_max_processed;
228 data[i++] = p_state->queue_stopped;
229 data[i++] = p_state->min_swqe_avail;
230 data[i++] = p_state->poll_receive_errors;
231 data[i++] = p_state->pkt_send;
232 data[i++] = p_state->pkt_xmit;
233 data[i++] = p_state->send_tasklet;
234 data[i++] = p_state->ehea_poll;
235 data[i++] = p_state->nwqe;
236 data[i++] = atomic_read(&port->port_res[0].swqe_avail);
237 data[i++] = port->sig_comp_iv; 211 data[i++] = port->sig_comp_iv;
238 data[i++] = port->port_res[0].swqe_refill_th; 212 data[i++] = port->port_res[0].swqe_refill_th;
239 data[i++] = port->resets; 213 data[i++] = port->resets;
240 214
241 cb6 = kzalloc(PAGE_SIZE, GFP_KERNEL); 215 for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++)
242 if (!cb6) { 216 tmp += port->port_res[k].p_stats.poll_receive_errors;
243 ehea_error("no mem for cb6"); 217 data[i++] = tmp;
244 return; 218
245 } 219 for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++)
220 tmp += port->port_res[k].p_stats.err_tcp_cksum;
221 data[i++] = tmp;
222
223 for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++)
224 tmp += port->port_res[k].p_stats.err_ip_cksum;
225 data[i++] = tmp;
226
227 for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++)
228 tmp += port->port_res[k].p_stats.err_frame_crc;
229 data[i++] = tmp;
230
231 for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++)
232 tmp += port->port_res[k].p_stats.queue_stopped;
233 data[i++] = tmp;
234
235 for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++)
236 tmp |= port->port_res[k].queue_stopped;
237 data[i++] = tmp;
238
239 for (k = 0; k < 8; k++)
240 data[i++] = atomic_read(&port->port_res[k].swqe_avail);
246 241
247 hret = ehea_h_query_ehea_port(adapter->handle, port->logical_port_id,
248 H_PORT_CB6, H_PORT_CB6_ALL, cb6);
249 if (netif_msg_hw(port))
250 ehea_dump(cb6, sizeof(*cb6), "ehea_get_ethtool_stats");
251
252 if (hret == H_SUCCESS) {
253 data[i++] = cb6->rxo;
254 data[i++] = cb6->rx64;
255 data[i++] = cb6->rx65;
256 data[i++] = cb6->rx128;
257 data[i++] = cb6->rx256;
258 data[i++] = cb6->rx512;
259 data[i++] = cb6->rx1024;
260 data[i++] = cb6->txo;
261 data[i++] = cb6->tx64;
262 data[i++] = cb6->tx65;
263 data[i++] = cb6->tx128;
264 data[i++] = cb6->tx256;
265 data[i++] = cb6->tx512;
266 data[i++] = cb6->tx1024;
267 } else
268 ehea_error("query_ehea_port failed");
269
270 kfree(cb6);
271} 242}
272 243
273const struct ethtool_ops ehea_ethtool_ops = { 244const struct ethtool_ops ehea_ethtool_ops = {