aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ehea/ehea_ethtool.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-29 13:48:48 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-29 13:48:48 -0400
commite389f9aec689209724105ae80a6c91fd2e747bc9 (patch)
tree3cc88a3e785e4f2ffeaa9dad0da695cfa437d4fe /drivers/net/ehea/ehea_ethtool.c
parentf73b0a08eae0e28c50db5dd5ab8245546918bfb6 (diff)
parentb4cf205846463a0a23a917bb18ad833bc9a8c0bb (diff)
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (107 commits) smc911x: fix compilation breakage wjen debug is on [netdrvr] eexpress: minor corrections add NAPI support to sb1250-mac.c ixgb: ROUND_UP macro cleanup in drivers/net/ixgb e1000: ROUND_UP macro cleanup in drivers/net/e1000 Generic HDLC sparse annotations e100: Optionally use I/O mode only to access register space e100: allow bad MAC address when running with invalid eeprom csum ehea: fix for dlpar support ehea: fix for sysfs entries 3C509: Remove unnecessary include of <linux/pm_legacy.h> NetXen: Fix for vmalloc issues NetXen: Fixes for Power PC architecture NetXen: Port swap feature for multi port cards NetXen: Removal of redundant macros NetXen: Multi PCI support for Quad cards NetXen: Removal of redundant argument passing NetXen: Use multiple PCI functions [netdrvr e100] experiment with doing RX in a similar manner to eepro100 [PATCH] ieee80211: add missing global needed by IEEE80211_DEBUG_XXXX ...
Diffstat (limited to 'drivers/net/ehea/ehea_ethtool.c')
-rw-r--r--drivers/net/ehea/ehea_ethtool.c115
1 files changed, 43 insertions, 72 deletions
diff --git a/drivers/net/ehea/ehea_ethtool.c b/drivers/net/ehea/ehea_ethtool.c
index 9f57c2e78ced..decec8cfe96b 100644
--- a/drivers/net/ehea/ehea_ethtool.c
+++ b/drivers/net/ehea/ehea_ethtool.c
@@ -144,8 +144,8 @@ static int ehea_nway_reset(struct net_device *dev)
144static void ehea_get_drvinfo(struct net_device *dev, 144static void ehea_get_drvinfo(struct net_device *dev,
145 struct ethtool_drvinfo *info) 145 struct ethtool_drvinfo *info)
146{ 146{
147 strlcpy(info->driver, DRV_NAME, sizeof(info->driver) - 1); 147 strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
148 strlcpy(info->version, DRV_VERSION, sizeof(info->version) - 1); 148 strlcpy(info->version, DRV_VERSION, sizeof(info->version));
149} 149}
150 150
151static u32 ehea_get_msglevel(struct net_device *dev) 151static u32 ehea_get_msglevel(struct net_device *dev)
@@ -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 = {