blob: 62c4af0578003b2d94806671d61ab15efc9ad8a7 [file] [log] [blame]
Ron Mercerc4e84bd2008-09-18 11:56:28 -04001#include <linux/kernel.h>
2#include <linux/init.h>
3#include <linux/types.h>
4#include <linux/module.h>
5#include <linux/list.h>
6#include <linux/pci.h>
7#include <linux/dma-mapping.h>
8#include <linux/pagemap.h>
9#include <linux/sched.h>
10#include <linux/slab.h>
11#include <linux/dmapool.h>
12#include <linux/mempool.h>
13#include <linux/spinlock.h>
14#include <linux/kthread.h>
15#include <linux/interrupt.h>
16#include <linux/errno.h>
17#include <linux/ioport.h>
18#include <linux/in.h>
19#include <linux/ip.h>
20#include <linux/ipv6.h>
21#include <net/ipv6.h>
22#include <linux/tcp.h>
23#include <linux/udp.h>
24#include <linux/if_arp.h>
25#include <linux/if_ether.h>
26#include <linux/netdevice.h>
27#include <linux/etherdevice.h>
28#include <linux/ethtool.h>
29#include <linux/skbuff.h>
30#include <linux/rtnetlink.h>
31#include <linux/if_vlan.h>
Ron Mercerc4e84bd2008-09-18 11:56:28 -040032#include <linux/delay.h>
33#include <linux/mm.h>
34#include <linux/vmalloc.h>
35
Ron Mercerc4e84bd2008-09-18 11:56:28 -040036
37#include "qlge.h"
38
39static int ql_update_ring_coalescing(struct ql_adapter *qdev)
40{
41 int i, status = 0;
42 struct rx_ring *rx_ring;
43 struct cqicb *cqicb;
44
45 if (!netif_running(qdev->ndev))
46 return status;
47
Ron Mercerc4e84bd2008-09-18 11:56:28 -040048 /* Skip the default queue, and update the outbound handler
49 * queues if they changed.
50 */
Ron Mercerb2014ff2009-08-27 11:02:09 +000051 cqicb = (struct cqicb *)&qdev->rx_ring[qdev->rss_ring_count];
Ron Mercerc4e84bd2008-09-18 11:56:28 -040052 if (le16_to_cpu(cqicb->irq_delay) != qdev->tx_coalesce_usecs ||
Ron Mercerb2014ff2009-08-27 11:02:09 +000053 le16_to_cpu(cqicb->pkt_delay) !=
54 qdev->tx_max_coalesced_frames) {
55 for (i = qdev->rss_ring_count; i < qdev->rx_ring_count; i++) {
Ron Mercerc4e84bd2008-09-18 11:56:28 -040056 rx_ring = &qdev->rx_ring[i];
57 cqicb = (struct cqicb *)rx_ring;
Ron Mercer8306c952009-01-05 18:17:33 -080058 cqicb->irq_delay = cpu_to_le16(qdev->tx_coalesce_usecs);
Ron Mercerc4e84bd2008-09-18 11:56:28 -040059 cqicb->pkt_delay =
Ron Mercer8306c952009-01-05 18:17:33 -080060 cpu_to_le16(qdev->tx_max_coalesced_frames);
Ron Mercerc4e84bd2008-09-18 11:56:28 -040061 cqicb->flags = FLAGS_LI;
Ron Mercere3324712009-07-02 06:06:13 +000062 status = ql_write_cfg(qdev, cqicb, sizeof(*cqicb),
Ron Mercerc4e84bd2008-09-18 11:56:28 -040063 CFG_LCQ, rx_ring->cq_id);
64 if (status) {
65 QPRINTK(qdev, IFUP, ERR,
66 "Failed to load CQICB.\n");
67 goto exit;
68 }
69 }
70 }
71
72 /* Update the inbound (RSS) handler queues if they changed. */
Ron Mercerb2014ff2009-08-27 11:02:09 +000073 cqicb = (struct cqicb *)&qdev->rx_ring[0];
Ron Mercerc4e84bd2008-09-18 11:56:28 -040074 if (le16_to_cpu(cqicb->irq_delay) != qdev->rx_coalesce_usecs ||
Ron Mercerb2014ff2009-08-27 11:02:09 +000075 le16_to_cpu(cqicb->pkt_delay) !=
76 qdev->rx_max_coalesced_frames) {
77 for (i = 0; i < qdev->rss_ring_count; i++, rx_ring++) {
Ron Mercerc4e84bd2008-09-18 11:56:28 -040078 rx_ring = &qdev->rx_ring[i];
79 cqicb = (struct cqicb *)rx_ring;
Ron Mercer8306c952009-01-05 18:17:33 -080080 cqicb->irq_delay = cpu_to_le16(qdev->rx_coalesce_usecs);
Ron Mercerc4e84bd2008-09-18 11:56:28 -040081 cqicb->pkt_delay =
Ron Mercer8306c952009-01-05 18:17:33 -080082 cpu_to_le16(qdev->rx_max_coalesced_frames);
Ron Mercerc4e84bd2008-09-18 11:56:28 -040083 cqicb->flags = FLAGS_LI;
Ron Mercere3324712009-07-02 06:06:13 +000084 status = ql_write_cfg(qdev, cqicb, sizeof(*cqicb),
Ron Mercerc4e84bd2008-09-18 11:56:28 -040085 CFG_LCQ, rx_ring->cq_id);
86 if (status) {
87 QPRINTK(qdev, IFUP, ERR,
88 "Failed to load CQICB.\n");
89 goto exit;
90 }
91 }
92 }
93exit:
Ron Mercerc4e84bd2008-09-18 11:56:28 -040094 return status;
95}
96
Hannes Eder2f22d222008-12-26 00:04:53 -080097static void ql_update_stats(struct ql_adapter *qdev)
Ron Mercerc4e84bd2008-09-18 11:56:28 -040098{
99 u32 i;
100 u64 data;
101 u64 *iter = &qdev->nic_stats.tx_pkts;
102
103 spin_lock(&qdev->stats_lock);
104 if (ql_sem_spinlock(qdev, qdev->xg_sem_mask)) {
105 QPRINTK(qdev, DRV, ERR,
106 "Couldn't get xgmac sem.\n");
107 goto quit;
108 }
109 /*
110 * Get TX statistics.
111 */
112 for (i = 0x200; i < 0x280; i += 8) {
113 if (ql_read_xgmac_reg64(qdev, i, &data)) {
114 QPRINTK(qdev, DRV, ERR,
115 "Error reading status register 0x%.04x.\n", i);
116 goto end;
117 } else
118 *iter = data;
119 iter++;
120 }
121
122 /*
123 * Get RX statistics.
124 */
125 for (i = 0x300; i < 0x3d0; i += 8) {
126 if (ql_read_xgmac_reg64(qdev, i, &data)) {
127 QPRINTK(qdev, DRV, ERR,
128 "Error reading status register 0x%.04x.\n", i);
129 goto end;
130 } else
131 *iter = data;
132 iter++;
133 }
134
Ron Mercer6abd2342009-10-10 09:35:10 +0000135 /*
136 * Get Per-priority TX pause frame counter statistics.
137 */
138 for (i = 0x500; i < 0x540; i += 8) {
139 if (ql_read_xgmac_reg64(qdev, i, &data)) {
140 QPRINTK(qdev, DRV, ERR,
141 "Error reading status register 0x%.04x.\n", i);
142 goto end;
143 } else
144 *iter = data;
145 iter++;
146 }
147
148 /*
149 * Get Per-priority RX pause frame counter statistics.
150 */
151 for (i = 0x568; i < 0x5a8; i += 8) {
152 if (ql_read_xgmac_reg64(qdev, i, &data)) {
153 QPRINTK(qdev, DRV, ERR,
154 "Error reading status register 0x%.04x.\n", i);
155 goto end;
156 } else
157 *iter = data;
158 iter++;
159 }
160
161 /*
162 * Get RX NIC FIFO DROP statistics.
163 */
164 if (ql_read_xgmac_reg64(qdev, 0x5b8, &data)) {
165 QPRINTK(qdev, DRV, ERR,
166 "Error reading status register 0x%.04x.\n", i);
167 goto end;
168 } else
169 *iter = data;
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400170end:
171 ql_sem_unlock(qdev, qdev->xg_sem_mask);
172quit:
173 spin_unlock(&qdev->stats_lock);
174
175 QL_DUMP_STAT(qdev);
176
177 return;
178}
179
180static char ql_stats_str_arr[][ETH_GSTRING_LEN] = {
181 {"tx_pkts"},
182 {"tx_bytes"},
183 {"tx_mcast_pkts"},
184 {"tx_bcast_pkts"},
185 {"tx_ucast_pkts"},
186 {"tx_ctl_pkts"},
187 {"tx_pause_pkts"},
188 {"tx_64_pkts"},
189 {"tx_65_to_127_pkts"},
190 {"tx_128_to_255_pkts"},
191 {"tx_256_511_pkts"},
192 {"tx_512_to_1023_pkts"},
193 {"tx_1024_to_1518_pkts"},
194 {"tx_1519_to_max_pkts"},
195 {"tx_undersize_pkts"},
196 {"tx_oversize_pkts"},
197 {"rx_bytes"},
198 {"rx_bytes_ok"},
199 {"rx_pkts"},
200 {"rx_pkts_ok"},
201 {"rx_bcast_pkts"},
202 {"rx_mcast_pkts"},
203 {"rx_ucast_pkts"},
204 {"rx_undersize_pkts"},
205 {"rx_oversize_pkts"},
206 {"rx_jabber_pkts"},
207 {"rx_undersize_fcerr_pkts"},
208 {"rx_drop_events"},
209 {"rx_fcerr_pkts"},
210 {"rx_align_err"},
211 {"rx_symbol_err"},
212 {"rx_mac_err"},
213 {"rx_ctl_pkts"},
214 {"rx_pause_pkts"},
215 {"rx_64_pkts"},
216 {"rx_65_to_127_pkts"},
217 {"rx_128_255_pkts"},
218 {"rx_256_511_pkts"},
219 {"rx_512_to_1023_pkts"},
220 {"rx_1024_to_1518_pkts"},
221 {"rx_1519_to_max_pkts"},
222 {"rx_len_err_pkts"},
Ron Mercer6abd2342009-10-10 09:35:10 +0000223 {"tx_cbfc_pause_frames0"},
224 {"tx_cbfc_pause_frames1"},
225 {"tx_cbfc_pause_frames2"},
226 {"tx_cbfc_pause_frames3"},
227 {"tx_cbfc_pause_frames4"},
228 {"tx_cbfc_pause_frames5"},
229 {"tx_cbfc_pause_frames6"},
230 {"tx_cbfc_pause_frames7"},
231 {"rx_cbfc_pause_frames0"},
232 {"rx_cbfc_pause_frames1"},
233 {"rx_cbfc_pause_frames2"},
234 {"rx_cbfc_pause_frames3"},
235 {"rx_cbfc_pause_frames4"},
236 {"rx_cbfc_pause_frames5"},
237 {"rx_cbfc_pause_frames6"},
238 {"rx_cbfc_pause_frames7"},
239 {"rx_nic_fifo_drop"},
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400240};
241
242static void ql_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
243{
244 switch (stringset) {
245 case ETH_SS_STATS:
246 memcpy(buf, ql_stats_str_arr, sizeof(ql_stats_str_arr));
247 break;
248 }
249}
250
251static int ql_get_sset_count(struct net_device *dev, int sset)
252{
253 switch (sset) {
254 case ETH_SS_STATS:
255 return ARRAY_SIZE(ql_stats_str_arr);
256 default:
257 return -EOPNOTSUPP;
258 }
259}
260
261static void
262ql_get_ethtool_stats(struct net_device *ndev,
263 struct ethtool_stats *stats, u64 *data)
264{
265 struct ql_adapter *qdev = netdev_priv(ndev);
266 struct nic_stats *s = &qdev->nic_stats;
267
268 ql_update_stats(qdev);
269
270 *data++ = s->tx_pkts;
271 *data++ = s->tx_bytes;
272 *data++ = s->tx_mcast_pkts;
273 *data++ = s->tx_bcast_pkts;
274 *data++ = s->tx_ucast_pkts;
275 *data++ = s->tx_ctl_pkts;
276 *data++ = s->tx_pause_pkts;
277 *data++ = s->tx_64_pkt;
278 *data++ = s->tx_65_to_127_pkt;
279 *data++ = s->tx_128_to_255_pkt;
280 *data++ = s->tx_256_511_pkt;
281 *data++ = s->tx_512_to_1023_pkt;
282 *data++ = s->tx_1024_to_1518_pkt;
283 *data++ = s->tx_1519_to_max_pkt;
284 *data++ = s->tx_undersize_pkt;
285 *data++ = s->tx_oversize_pkt;
286 *data++ = s->rx_bytes;
287 *data++ = s->rx_bytes_ok;
288 *data++ = s->rx_pkts;
289 *data++ = s->rx_pkts_ok;
290 *data++ = s->rx_bcast_pkts;
291 *data++ = s->rx_mcast_pkts;
292 *data++ = s->rx_ucast_pkts;
293 *data++ = s->rx_undersize_pkts;
294 *data++ = s->rx_oversize_pkts;
295 *data++ = s->rx_jabber_pkts;
296 *data++ = s->rx_undersize_fcerr_pkts;
297 *data++ = s->rx_drop_events;
298 *data++ = s->rx_fcerr_pkts;
299 *data++ = s->rx_align_err;
300 *data++ = s->rx_symbol_err;
301 *data++ = s->rx_mac_err;
302 *data++ = s->rx_ctl_pkts;
303 *data++ = s->rx_pause_pkts;
304 *data++ = s->rx_64_pkts;
305 *data++ = s->rx_65_to_127_pkts;
306 *data++ = s->rx_128_255_pkts;
307 *data++ = s->rx_256_511_pkts;
308 *data++ = s->rx_512_to_1023_pkts;
309 *data++ = s->rx_1024_to_1518_pkts;
310 *data++ = s->rx_1519_to_max_pkts;
311 *data++ = s->rx_len_err_pkts;
Ron Mercer6abd2342009-10-10 09:35:10 +0000312 *data++ = s->tx_cbfc_pause_frames0;
313 *data++ = s->tx_cbfc_pause_frames1;
314 *data++ = s->tx_cbfc_pause_frames2;
315 *data++ = s->tx_cbfc_pause_frames3;
316 *data++ = s->tx_cbfc_pause_frames4;
317 *data++ = s->tx_cbfc_pause_frames5;
318 *data++ = s->tx_cbfc_pause_frames6;
319 *data++ = s->tx_cbfc_pause_frames7;
320 *data++ = s->rx_cbfc_pause_frames0;
321 *data++ = s->rx_cbfc_pause_frames1;
322 *data++ = s->rx_cbfc_pause_frames2;
323 *data++ = s->rx_cbfc_pause_frames3;
324 *data++ = s->rx_cbfc_pause_frames4;
325 *data++ = s->rx_cbfc_pause_frames5;
326 *data++ = s->rx_cbfc_pause_frames6;
327 *data++ = s->rx_cbfc_pause_frames7;
328 *data++ = s->rx_nic_fifo_drop;
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400329}
330
331static int ql_get_settings(struct net_device *ndev,
332 struct ethtool_cmd *ecmd)
333{
334 struct ql_adapter *qdev = netdev_priv(ndev);
335
336 ecmd->supported = SUPPORTED_10000baseT_Full;
337 ecmd->advertising = ADVERTISED_10000baseT_Full;
338 ecmd->autoneg = AUTONEG_ENABLE;
339 ecmd->transceiver = XCVR_EXTERNAL;
Ron Mercerb82808b2009-02-26 10:08:32 +0000340 if ((qdev->link_status & STS_LINK_TYPE_MASK) ==
341 STS_LINK_TYPE_10GBASET) {
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400342 ecmd->supported |= (SUPPORTED_TP | SUPPORTED_Autoneg);
343 ecmd->advertising |= (ADVERTISED_TP | ADVERTISED_Autoneg);
344 ecmd->port = PORT_TP;
345 } else {
346 ecmd->supported |= SUPPORTED_FIBRE;
347 ecmd->advertising |= ADVERTISED_FIBRE;
348 ecmd->port = PORT_FIBRE;
349 }
350
351 ecmd->speed = SPEED_10000;
352 ecmd->duplex = DUPLEX_FULL;
353
354 return 0;
355}
356
357static void ql_get_drvinfo(struct net_device *ndev,
358 struct ethtool_drvinfo *drvinfo)
359{
360 struct ql_adapter *qdev = netdev_priv(ndev);
361 strncpy(drvinfo->driver, qlge_driver_name, 32);
362 strncpy(drvinfo->version, qlge_driver_version, 32);
Ron Mercercfec0cb2009-06-09 05:39:29 +0000363 snprintf(drvinfo->fw_version, 32, "v%d.%d.%d",
364 (qdev->fw_rev_id & 0x00ff0000) >> 16,
365 (qdev->fw_rev_id & 0x0000ff00) >> 8,
366 (qdev->fw_rev_id & 0x000000ff));
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400367 strncpy(drvinfo->bus_info, pci_name(qdev->pdev), 32);
368 drvinfo->n_stats = 0;
369 drvinfo->testinfo_len = 0;
370 drvinfo->regdump_len = 0;
371 drvinfo->eedump_len = 0;
372}
373
Ron Mercerbc083ce2009-10-21 11:07:40 +0000374static void ql_get_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
375{
376 struct ql_adapter *qdev = netdev_priv(ndev);
377 /* What we support. */
378 wol->supported = WAKE_MAGIC;
379 /* What we've currently got set. */
380 wol->wolopts = qdev->wol;
381}
382
383static int ql_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
384{
385 struct ql_adapter *qdev = netdev_priv(ndev);
386 int status;
387
388 if (wol->wolopts & ~WAKE_MAGIC)
389 return -EINVAL;
390 qdev->wol = wol->wolopts;
391
392 QPRINTK(qdev, DRV, INFO, "Set wol option 0x%x on %s\n",
393 qdev->wol, ndev->name);
394 if (!qdev->wol) {
395 u32 wol = 0;
396 status = ql_mb_wol_mode(qdev, wol);
397 QPRINTK(qdev, DRV, ERR, "WOL %s (wol code 0x%x) on %s\n",
398 (status == 0) ? "cleared sucessfully" : "clear failed",
399 wol, qdev->ndev->name);
400 }
401
402 return 0;
403}
Ron Mercerd8eb59d2009-10-21 11:07:39 +0000404
405static int ql_phys_id(struct net_device *ndev, u32 data)
406{
407 struct ql_adapter *qdev = netdev_priv(ndev);
408 u32 led_reg, i;
409 int status;
410
411 /* Save the current LED settings */
412 status = ql_mb_get_led_cfg(qdev);
413 if (status)
414 return status;
415 led_reg = qdev->led_config;
416
417 /* Start blinking the led */
418 if (!data || data > 300)
419 data = 300;
420
421 for (i = 0; i < (data * 10); i++)
422 ql_mb_set_led_cfg(qdev, QL_LED_BLINK);
423
424 /* Restore LED settings */
425 status = ql_mb_set_led_cfg(qdev, led_reg);
426 if (status)
427 return status;
428
429 return 0;
430}
Ron Mercera61f8022009-10-21 11:07:41 +0000431
432static int ql_get_regs_len(struct net_device *ndev)
433{
434 return sizeof(struct ql_reg_dump);
435}
436
437static void ql_get_regs(struct net_device *ndev,
438 struct ethtool_regs *regs, void *p)
439{
440 struct ql_adapter *qdev = netdev_priv(ndev);
441
442 ql_gen_reg_dump(qdev, p);
443}
444
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400445static int ql_get_coalesce(struct net_device *dev, struct ethtool_coalesce *c)
446{
447 struct ql_adapter *qdev = netdev_priv(dev);
448
449 c->rx_coalesce_usecs = qdev->rx_coalesce_usecs;
450 c->tx_coalesce_usecs = qdev->tx_coalesce_usecs;
451
452 /* This chip coalesces as follows:
453 * If a packet arrives, hold off interrupts until
454 * cqicb->int_delay expires, but if no other packets arrive don't
455 * wait longer than cqicb->pkt_int_delay. But ethtool doesn't use a
456 * timer to coalesce on a frame basis. So, we have to take ethtool's
457 * max_coalesced_frames value and convert it to a delay in microseconds.
458 * We do this by using a basic thoughput of 1,000,000 frames per
459 * second @ (1024 bytes). This means one frame per usec. So it's a
460 * simple one to one ratio.
461 */
462 c->rx_max_coalesced_frames = qdev->rx_max_coalesced_frames;
463 c->tx_max_coalesced_frames = qdev->tx_max_coalesced_frames;
464
465 return 0;
466}
467
468static int ql_set_coalesce(struct net_device *ndev, struct ethtool_coalesce *c)
469{
470 struct ql_adapter *qdev = netdev_priv(ndev);
471
472 /* Validate user parameters. */
473 if (c->rx_coalesce_usecs > qdev->rx_ring_size / 2)
474 return -EINVAL;
475 /* Don't wait more than 10 usec. */
476 if (c->rx_max_coalesced_frames > MAX_INTER_FRAME_WAIT)
477 return -EINVAL;
478 if (c->tx_coalesce_usecs > qdev->tx_ring_size / 2)
479 return -EINVAL;
480 if (c->tx_max_coalesced_frames > MAX_INTER_FRAME_WAIT)
481 return -EINVAL;
482
483 /* Verify a change took place before updating the hardware. */
484 if (qdev->rx_coalesce_usecs == c->rx_coalesce_usecs &&
485 qdev->tx_coalesce_usecs == c->tx_coalesce_usecs &&
486 qdev->rx_max_coalesced_frames == c->rx_max_coalesced_frames &&
487 qdev->tx_max_coalesced_frames == c->tx_max_coalesced_frames)
488 return 0;
489
490 qdev->rx_coalesce_usecs = c->rx_coalesce_usecs;
491 qdev->tx_coalesce_usecs = c->tx_coalesce_usecs;
492 qdev->rx_max_coalesced_frames = c->rx_max_coalesced_frames;
493 qdev->tx_max_coalesced_frames = c->tx_max_coalesced_frames;
494
495 return ql_update_ring_coalescing(qdev);
496}
497
Ron Mercer1d30df22009-10-21 11:07:38 +0000498static void ql_get_pauseparam(struct net_device *netdev,
499 struct ethtool_pauseparam *pause)
500{
501 struct ql_adapter *qdev = netdev_priv(netdev);
502
503 ql_mb_get_port_cfg(qdev);
504 if (qdev->link_config & CFG_PAUSE_STD) {
505 pause->rx_pause = 1;
506 pause->tx_pause = 1;
507 }
508}
509
510static int ql_set_pauseparam(struct net_device *netdev,
511 struct ethtool_pauseparam *pause)
512{
513 struct ql_adapter *qdev = netdev_priv(netdev);
514 int status = 0;
515
516 if ((pause->rx_pause) && (pause->tx_pause))
517 qdev->link_config |= CFG_PAUSE_STD;
518 else if (!pause->rx_pause && !pause->tx_pause)
519 qdev->link_config &= ~CFG_PAUSE_STD;
520 else
521 return -EINVAL;
522
523 status = ql_mb_set_port_cfg(qdev);
524 if (status)
525 return status;
526 return status;
527}
528
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400529static u32 ql_get_rx_csum(struct net_device *netdev)
530{
531 struct ql_adapter *qdev = netdev_priv(netdev);
532 return qdev->rx_csum;
533}
534
535static int ql_set_rx_csum(struct net_device *netdev, uint32_t data)
536{
537 struct ql_adapter *qdev = netdev_priv(netdev);
538 qdev->rx_csum = data;
539 return 0;
540}
541
542static int ql_set_tso(struct net_device *ndev, uint32_t data)
543{
544
545 if (data) {
546 ndev->features |= NETIF_F_TSO;
547 ndev->features |= NETIF_F_TSO6;
548 } else {
549 ndev->features &= ~NETIF_F_TSO;
550 ndev->features &= ~NETIF_F_TSO6;
551 }
552 return 0;
553}
554
555static u32 ql_get_msglevel(struct net_device *ndev)
556{
557 struct ql_adapter *qdev = netdev_priv(ndev);
558 return qdev->msg_enable;
559}
560
561static void ql_set_msglevel(struct net_device *ndev, u32 value)
562{
563 struct ql_adapter *qdev = netdev_priv(ndev);
564 qdev->msg_enable = value;
565}
566
567const struct ethtool_ops qlge_ethtool_ops = {
568 .get_settings = ql_get_settings,
569 .get_drvinfo = ql_get_drvinfo,
Ron Mercerbc083ce2009-10-21 11:07:40 +0000570 .get_wol = ql_get_wol,
571 .set_wol = ql_set_wol,
Ron Mercera61f8022009-10-21 11:07:41 +0000572 .get_regs_len = ql_get_regs_len,
573 .get_regs = ql_get_regs,
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400574 .get_msglevel = ql_get_msglevel,
575 .set_msglevel = ql_set_msglevel,
576 .get_link = ethtool_op_get_link,
Ron Mercerd8eb59d2009-10-21 11:07:39 +0000577 .phys_id = ql_phys_id,
Ron Mercer1d30df22009-10-21 11:07:38 +0000578 .get_pauseparam = ql_get_pauseparam,
579 .set_pauseparam = ql_set_pauseparam,
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400580 .get_rx_csum = ql_get_rx_csum,
581 .set_rx_csum = ql_set_rx_csum,
582 .get_tx_csum = ethtool_op_get_tx_csum,
Ron Mercer00acd0d2009-06-09 05:39:31 +0000583 .set_tx_csum = ethtool_op_set_tx_csum,
Ron Mercerc4e84bd2008-09-18 11:56:28 -0400584 .get_sg = ethtool_op_get_sg,
585 .set_sg = ethtool_op_set_sg,
586 .get_tso = ethtool_op_get_tso,
587 .set_tso = ql_set_tso,
588 .get_coalesce = ql_get_coalesce,
589 .set_coalesce = ql_set_coalesce,
590 .get_sset_count = ql_get_sset_count,
591 .get_strings = ql_get_strings,
592 .get_ethtool_stats = ql_get_ethtool_stats,
593};
594