diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-20 20:43:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-20 20:43:29 -0400 |
commit | db6d8c7a4027b48d797b369a53f8470aaeed7063 (patch) | |
tree | e140c104a89abc2154e1f41a7db8ebecbb6fa0b4 /drivers/net/ixgb/ixgb_ethtool.c | |
parent | 3a533374283aea50eab3976d8a6d30532175f009 (diff) | |
parent | fb65a7c091529bfffb1262515252c0d0f6241c5c (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (1232 commits)
iucv: Fix bad merging.
net_sched: Add size table for qdiscs
net_sched: Add accessor function for packet length for qdiscs
net_sched: Add qdisc_enqueue wrapper
highmem: Export totalhigh_pages.
ipv6 mcast: Omit redundant address family checks in ip6_mc_source().
net: Use standard structures for generic socket address structures.
ipv6 netns: Make several "global" sysctl variables namespace aware.
netns: Use net_eq() to compare net-namespaces for optimization.
ipv6: remove unused macros from net/ipv6.h
ipv6: remove unused parameter from ip6_ra_control
tcp: fix kernel panic with listening_get_next
tcp: Remove redundant checks when setting eff_sacks
tcp: options clean up
tcp: Fix MD5 signatures for non-linear skbs
sctp: Update sctp global memory limit allocations.
sctp: remove unnecessary byteshifting, calculate directly in big-endian
sctp: Allow only 1 listening socket with SO_REUSEADDR
sctp: Do not leak memory on multiple listen() calls
sctp: Support ipv6only AF_INET6 sockets.
...
Diffstat (limited to 'drivers/net/ixgb/ixgb_ethtool.c')
-rw-r--r-- | drivers/net/ixgb/ixgb_ethtool.c | 120 |
1 files changed, 59 insertions, 61 deletions
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c index 8464d8a013b0..288ee1d0f431 100644 --- a/drivers/net/ixgb/ixgb_ethtool.c +++ b/drivers/net/ixgb/ixgb_ethtool.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel PRO/10GbE Linux driver | 3 | Intel PRO/10GbE Linux driver |
4 | Copyright(c) 1999 - 2006 Intel Corporation. | 4 | Copyright(c) 1999 - 2008 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
@@ -95,7 +95,7 @@ ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | |||
95 | ecmd->port = PORT_FIBRE; | 95 | ecmd->port = PORT_FIBRE; |
96 | ecmd->transceiver = XCVR_EXTERNAL; | 96 | ecmd->transceiver = XCVR_EXTERNAL; |
97 | 97 | ||
98 | if(netif_carrier_ok(adapter->netdev)) { | 98 | if (netif_carrier_ok(adapter->netdev)) { |
99 | ecmd->speed = SPEED_10000; | 99 | ecmd->speed = SPEED_10000; |
100 | ecmd->duplex = DUPLEX_FULL; | 100 | ecmd->duplex = DUPLEX_FULL; |
101 | } else { | 101 | } else { |
@@ -122,11 +122,11 @@ ixgb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | |||
122 | { | 122 | { |
123 | struct ixgb_adapter *adapter = netdev_priv(netdev); | 123 | struct ixgb_adapter *adapter = netdev_priv(netdev); |
124 | 124 | ||
125 | if(ecmd->autoneg == AUTONEG_ENABLE || | 125 | if (ecmd->autoneg == AUTONEG_ENABLE || |
126 | ecmd->speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL) | 126 | ecmd->speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL) |
127 | return -EINVAL; | 127 | return -EINVAL; |
128 | 128 | ||
129 | if(netif_running(adapter->netdev)) { | 129 | if (netif_running(adapter->netdev)) { |
130 | ixgb_down(adapter, true); | 130 | ixgb_down(adapter, true); |
131 | ixgb_reset(adapter); | 131 | ixgb_reset(adapter); |
132 | ixgb_up(adapter); | 132 | ixgb_up(adapter); |
@@ -143,14 +143,14 @@ ixgb_get_pauseparam(struct net_device *netdev, | |||
143 | { | 143 | { |
144 | struct ixgb_adapter *adapter = netdev_priv(netdev); | 144 | struct ixgb_adapter *adapter = netdev_priv(netdev); |
145 | struct ixgb_hw *hw = &adapter->hw; | 145 | struct ixgb_hw *hw = &adapter->hw; |
146 | 146 | ||
147 | pause->autoneg = AUTONEG_DISABLE; | 147 | pause->autoneg = AUTONEG_DISABLE; |
148 | 148 | ||
149 | if(hw->fc.type == ixgb_fc_rx_pause) | 149 | if (hw->fc.type == ixgb_fc_rx_pause) |
150 | pause->rx_pause = 1; | 150 | pause->rx_pause = 1; |
151 | else if(hw->fc.type == ixgb_fc_tx_pause) | 151 | else if (hw->fc.type == ixgb_fc_tx_pause) |
152 | pause->tx_pause = 1; | 152 | pause->tx_pause = 1; |
153 | else if(hw->fc.type == ixgb_fc_full) { | 153 | else if (hw->fc.type == ixgb_fc_full) { |
154 | pause->rx_pause = 1; | 154 | pause->rx_pause = 1; |
155 | pause->tx_pause = 1; | 155 | pause->tx_pause = 1; |
156 | } | 156 | } |
@@ -162,26 +162,26 @@ ixgb_set_pauseparam(struct net_device *netdev, | |||
162 | { | 162 | { |
163 | struct ixgb_adapter *adapter = netdev_priv(netdev); | 163 | struct ixgb_adapter *adapter = netdev_priv(netdev); |
164 | struct ixgb_hw *hw = &adapter->hw; | 164 | struct ixgb_hw *hw = &adapter->hw; |
165 | 165 | ||
166 | if(pause->autoneg == AUTONEG_ENABLE) | 166 | if (pause->autoneg == AUTONEG_ENABLE) |
167 | return -EINVAL; | 167 | return -EINVAL; |
168 | 168 | ||
169 | if(pause->rx_pause && pause->tx_pause) | 169 | if (pause->rx_pause && pause->tx_pause) |
170 | hw->fc.type = ixgb_fc_full; | 170 | hw->fc.type = ixgb_fc_full; |
171 | else if(pause->rx_pause && !pause->tx_pause) | 171 | else if (pause->rx_pause && !pause->tx_pause) |
172 | hw->fc.type = ixgb_fc_rx_pause; | 172 | hw->fc.type = ixgb_fc_rx_pause; |
173 | else if(!pause->rx_pause && pause->tx_pause) | 173 | else if (!pause->rx_pause && pause->tx_pause) |
174 | hw->fc.type = ixgb_fc_tx_pause; | 174 | hw->fc.type = ixgb_fc_tx_pause; |
175 | else if(!pause->rx_pause && !pause->tx_pause) | 175 | else if (!pause->rx_pause && !pause->tx_pause) |
176 | hw->fc.type = ixgb_fc_none; | 176 | hw->fc.type = ixgb_fc_none; |
177 | 177 | ||
178 | if(netif_running(adapter->netdev)) { | 178 | if (netif_running(adapter->netdev)) { |
179 | ixgb_down(adapter, true); | 179 | ixgb_down(adapter, true); |
180 | ixgb_up(adapter); | 180 | ixgb_up(adapter); |
181 | ixgb_set_speed_duplex(netdev); | 181 | ixgb_set_speed_duplex(netdev); |
182 | } else | 182 | } else |
183 | ixgb_reset(adapter); | 183 | ixgb_reset(adapter); |
184 | 184 | ||
185 | return 0; | 185 | return 0; |
186 | } | 186 | } |
187 | 187 | ||
@@ -200,7 +200,7 @@ ixgb_set_rx_csum(struct net_device *netdev, u32 data) | |||
200 | 200 | ||
201 | adapter->rx_csum = data; | 201 | adapter->rx_csum = data; |
202 | 202 | ||
203 | if(netif_running(netdev)) { | 203 | if (netif_running(netdev)) { |
204 | ixgb_down(adapter, true); | 204 | ixgb_down(adapter, true); |
205 | ixgb_up(adapter); | 205 | ixgb_up(adapter); |
206 | ixgb_set_speed_duplex(netdev); | 206 | ixgb_set_speed_duplex(netdev); |
@@ -208,7 +208,7 @@ ixgb_set_rx_csum(struct net_device *netdev, u32 data) | |||
208 | ixgb_reset(adapter); | 208 | ixgb_reset(adapter); |
209 | return 0; | 209 | return 0; |
210 | } | 210 | } |
211 | 211 | ||
212 | static u32 | 212 | static u32 |
213 | ixgb_get_tx_csum(struct net_device *netdev) | 213 | ixgb_get_tx_csum(struct net_device *netdev) |
214 | { | 214 | { |
@@ -229,12 +229,12 @@ ixgb_set_tx_csum(struct net_device *netdev, u32 data) | |||
229 | static int | 229 | static int |
230 | ixgb_set_tso(struct net_device *netdev, u32 data) | 230 | ixgb_set_tso(struct net_device *netdev, u32 data) |
231 | { | 231 | { |
232 | if(data) | 232 | if (data) |
233 | netdev->features |= NETIF_F_TSO; | 233 | netdev->features |= NETIF_F_TSO; |
234 | else | 234 | else |
235 | netdev->features &= ~NETIF_F_TSO; | 235 | netdev->features &= ~NETIF_F_TSO; |
236 | return 0; | 236 | return 0; |
237 | } | 237 | } |
238 | 238 | ||
239 | static u32 | 239 | static u32 |
240 | ixgb_get_msglevel(struct net_device *netdev) | 240 | ixgb_get_msglevel(struct net_device *netdev) |
@@ -251,7 +251,7 @@ ixgb_set_msglevel(struct net_device *netdev, u32 data) | |||
251 | } | 251 | } |
252 | #define IXGB_GET_STAT(_A_, _R_) _A_->stats._R_ | 252 | #define IXGB_GET_STAT(_A_, _R_) _A_->stats._R_ |
253 | 253 | ||
254 | static int | 254 | static int |
255 | ixgb_get_regs_len(struct net_device *netdev) | 255 | ixgb_get_regs_len(struct net_device *netdev) |
256 | { | 256 | { |
257 | #define IXGB_REG_DUMP_LEN 136*sizeof(u32) | 257 | #define IXGB_REG_DUMP_LEN 136*sizeof(u32) |
@@ -301,7 +301,7 @@ ixgb_get_regs(struct net_device *netdev, | |||
301 | *reg++ = IXGB_READ_REG(hw, RXCSUM); /* 20 */ | 301 | *reg++ = IXGB_READ_REG(hw, RXCSUM); /* 20 */ |
302 | 302 | ||
303 | /* there are 16 RAR entries in hardware, we only use 3 */ | 303 | /* there are 16 RAR entries in hardware, we only use 3 */ |
304 | for(i = 0; i < IXGB_ALL_RAR_ENTRIES; i++) { | 304 | for (i = 0; i < IXGB_ALL_RAR_ENTRIES; i++) { |
305 | *reg++ = IXGB_READ_REG_ARRAY(hw, RAL, (i << 1)); /*21,...,51 */ | 305 | *reg++ = IXGB_READ_REG_ARRAY(hw, RAL, (i << 1)); /*21,...,51 */ |
306 | *reg++ = IXGB_READ_REG_ARRAY(hw, RAH, (i << 1)); /*22,...,52 */ | 306 | *reg++ = IXGB_READ_REG_ARRAY(hw, RAH, (i << 1)); /*22,...,52 */ |
307 | } | 307 | } |
@@ -415,7 +415,7 @@ ixgb_get_eeprom(struct net_device *netdev, | |||
415 | int i, max_len, first_word, last_word; | 415 | int i, max_len, first_word, last_word; |
416 | int ret_val = 0; | 416 | int ret_val = 0; |
417 | 417 | ||
418 | if(eeprom->len == 0) { | 418 | if (eeprom->len == 0) { |
419 | ret_val = -EINVAL; | 419 | ret_val = -EINVAL; |
420 | goto geeprom_error; | 420 | goto geeprom_error; |
421 | } | 421 | } |
@@ -424,12 +424,12 @@ ixgb_get_eeprom(struct net_device *netdev, | |||
424 | 424 | ||
425 | max_len = ixgb_get_eeprom_len(netdev); | 425 | max_len = ixgb_get_eeprom_len(netdev); |
426 | 426 | ||
427 | if(eeprom->offset > eeprom->offset + eeprom->len) { | 427 | if (eeprom->offset > eeprom->offset + eeprom->len) { |
428 | ret_val = -EINVAL; | 428 | ret_val = -EINVAL; |
429 | goto geeprom_error; | 429 | goto geeprom_error; |
430 | } | 430 | } |
431 | 431 | ||
432 | if((eeprom->offset + eeprom->len) > max_len) | 432 | if ((eeprom->offset + eeprom->len) > max_len) |
433 | eeprom->len = (max_len - eeprom->offset); | 433 | eeprom->len = (max_len - eeprom->offset); |
434 | 434 | ||
435 | first_word = eeprom->offset >> 1; | 435 | first_word = eeprom->offset >> 1; |
@@ -437,16 +437,14 @@ ixgb_get_eeprom(struct net_device *netdev, | |||
437 | 437 | ||
438 | eeprom_buff = kmalloc(sizeof(__le16) * | 438 | eeprom_buff = kmalloc(sizeof(__le16) * |
439 | (last_word - first_word + 1), GFP_KERNEL); | 439 | (last_word - first_word + 1), GFP_KERNEL); |
440 | if(!eeprom_buff) | 440 | if (!eeprom_buff) |
441 | return -ENOMEM; | 441 | return -ENOMEM; |
442 | 442 | ||
443 | /* note the eeprom was good because the driver loaded */ | 443 | /* note the eeprom was good because the driver loaded */ |
444 | for(i = 0; i <= (last_word - first_word); i++) { | 444 | for (i = 0; i <= (last_word - first_word); i++) |
445 | eeprom_buff[i] = ixgb_get_eeprom_word(hw, (first_word + i)); | 445 | eeprom_buff[i] = ixgb_get_eeprom_word(hw, (first_word + i)); |
446 | } | ||
447 | 446 | ||
448 | memcpy(bytes, (u8 *)eeprom_buff + (eeprom->offset & 1), | 447 | memcpy(bytes, (u8 *)eeprom_buff + (eeprom->offset & 1), eeprom->len); |
449 | eeprom->len); | ||
450 | kfree(eeprom_buff); | 448 | kfree(eeprom_buff); |
451 | 449 | ||
452 | geeprom_error: | 450 | geeprom_error: |
@@ -464,47 +462,47 @@ ixgb_set_eeprom(struct net_device *netdev, | |||
464 | int max_len, first_word, last_word; | 462 | int max_len, first_word, last_word; |
465 | u16 i; | 463 | u16 i; |
466 | 464 | ||
467 | if(eeprom->len == 0) | 465 | if (eeprom->len == 0) |
468 | return -EINVAL; | 466 | return -EINVAL; |
469 | 467 | ||
470 | if(eeprom->magic != (hw->vendor_id | (hw->device_id << 16))) | 468 | if (eeprom->magic != (hw->vendor_id | (hw->device_id << 16))) |
471 | return -EFAULT; | 469 | return -EFAULT; |
472 | 470 | ||
473 | max_len = ixgb_get_eeprom_len(netdev); | 471 | max_len = ixgb_get_eeprom_len(netdev); |
474 | 472 | ||
475 | if(eeprom->offset > eeprom->offset + eeprom->len) | 473 | if (eeprom->offset > eeprom->offset + eeprom->len) |
476 | return -EINVAL; | 474 | return -EINVAL; |
477 | 475 | ||
478 | if((eeprom->offset + eeprom->len) > max_len) | 476 | if ((eeprom->offset + eeprom->len) > max_len) |
479 | eeprom->len = (max_len - eeprom->offset); | 477 | eeprom->len = (max_len - eeprom->offset); |
480 | 478 | ||
481 | first_word = eeprom->offset >> 1; | 479 | first_word = eeprom->offset >> 1; |
482 | last_word = (eeprom->offset + eeprom->len - 1) >> 1; | 480 | last_word = (eeprom->offset + eeprom->len - 1) >> 1; |
483 | eeprom_buff = kmalloc(max_len, GFP_KERNEL); | 481 | eeprom_buff = kmalloc(max_len, GFP_KERNEL); |
484 | if(!eeprom_buff) | 482 | if (!eeprom_buff) |
485 | return -ENOMEM; | 483 | return -ENOMEM; |
486 | 484 | ||
487 | ptr = (void *)eeprom_buff; | 485 | ptr = (void *)eeprom_buff; |
488 | 486 | ||
489 | if(eeprom->offset & 1) { | 487 | if (eeprom->offset & 1) { |
490 | /* need read/modify/write of first changed EEPROM word */ | 488 | /* need read/modify/write of first changed EEPROM word */ |
491 | /* only the second byte of the word is being modified */ | 489 | /* only the second byte of the word is being modified */ |
492 | eeprom_buff[0] = ixgb_read_eeprom(hw, first_word); | 490 | eeprom_buff[0] = ixgb_read_eeprom(hw, first_word); |
493 | ptr++; | 491 | ptr++; |
494 | } | 492 | } |
495 | if((eeprom->offset + eeprom->len) & 1) { | 493 | if ((eeprom->offset + eeprom->len) & 1) { |
496 | /* need read/modify/write of last changed EEPROM word */ | 494 | /* need read/modify/write of last changed EEPROM word */ |
497 | /* only the first byte of the word is being modified */ | 495 | /* only the first byte of the word is being modified */ |
498 | eeprom_buff[last_word - first_word] | 496 | eeprom_buff[last_word - first_word] |
499 | = ixgb_read_eeprom(hw, last_word); | 497 | = ixgb_read_eeprom(hw, last_word); |
500 | } | 498 | } |
501 | 499 | ||
502 | memcpy(ptr, bytes, eeprom->len); | 500 | memcpy(ptr, bytes, eeprom->len); |
503 | for(i = 0; i <= (last_word - first_word); i++) | 501 | for (i = 0; i <= (last_word - first_word); i++) |
504 | ixgb_write_eeprom(hw, first_word + i, eeprom_buff[i]); | 502 | ixgb_write_eeprom(hw, first_word + i, eeprom_buff[i]); |
505 | 503 | ||
506 | /* Update the checksum over the first part of the EEPROM if needed */ | 504 | /* Update the checksum over the first part of the EEPROM if needed */ |
507 | if(first_word <= EEPROM_CHECKSUM_REG) | 505 | if (first_word <= EEPROM_CHECKSUM_REG) |
508 | ixgb_update_eeprom_checksum(hw); | 506 | ixgb_update_eeprom_checksum(hw); |
509 | 507 | ||
510 | kfree(eeprom_buff); | 508 | kfree(eeprom_buff); |
@@ -534,7 +532,7 @@ ixgb_get_ringparam(struct net_device *netdev, | |||
534 | struct ixgb_desc_ring *txdr = &adapter->tx_ring; | 532 | struct ixgb_desc_ring *txdr = &adapter->tx_ring; |
535 | struct ixgb_desc_ring *rxdr = &adapter->rx_ring; | 533 | struct ixgb_desc_ring *rxdr = &adapter->rx_ring; |
536 | 534 | ||
537 | ring->rx_max_pending = MAX_RXD; | 535 | ring->rx_max_pending = MAX_RXD; |
538 | ring->tx_max_pending = MAX_TXD; | 536 | ring->tx_max_pending = MAX_TXD; |
539 | ring->rx_mini_max_pending = 0; | 537 | ring->rx_mini_max_pending = 0; |
540 | ring->rx_jumbo_max_pending = 0; | 538 | ring->rx_jumbo_max_pending = 0; |
@@ -544,7 +542,7 @@ ixgb_get_ringparam(struct net_device *netdev, | |||
544 | ring->rx_jumbo_pending = 0; | 542 | ring->rx_jumbo_pending = 0; |
545 | } | 543 | } |
546 | 544 | ||
547 | static int | 545 | static int |
548 | ixgb_set_ringparam(struct net_device *netdev, | 546 | ixgb_set_ringparam(struct net_device *netdev, |
549 | struct ethtool_ringparam *ring) | 547 | struct ethtool_ringparam *ring) |
550 | { | 548 | { |
@@ -557,10 +555,10 @@ ixgb_set_ringparam(struct net_device *netdev, | |||
557 | tx_old = adapter->tx_ring; | 555 | tx_old = adapter->tx_ring; |
558 | rx_old = adapter->rx_ring; | 556 | rx_old = adapter->rx_ring; |
559 | 557 | ||
560 | if((ring->rx_mini_pending) || (ring->rx_jumbo_pending)) | 558 | if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending)) |
561 | return -EINVAL; | 559 | return -EINVAL; |
562 | 560 | ||
563 | if(netif_running(adapter->netdev)) | 561 | if (netif_running(adapter->netdev)) |
564 | ixgb_down(adapter, true); | 562 | ixgb_down(adapter, true); |
565 | 563 | ||
566 | rxdr->count = max(ring->rx_pending,(u32)MIN_RXD); | 564 | rxdr->count = max(ring->rx_pending,(u32)MIN_RXD); |
@@ -571,11 +569,11 @@ ixgb_set_ringparam(struct net_device *netdev, | |||
571 | txdr->count = min(txdr->count,(u32)MAX_TXD); | 569 | txdr->count = min(txdr->count,(u32)MAX_TXD); |
572 | txdr->count = ALIGN(txdr->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE); | 570 | txdr->count = ALIGN(txdr->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE); |
573 | 571 | ||
574 | if(netif_running(adapter->netdev)) { | 572 | if (netif_running(adapter->netdev)) { |
575 | /* Try to get new resources before deleting old */ | 573 | /* Try to get new resources before deleting old */ |
576 | if((err = ixgb_setup_rx_resources(adapter))) | 574 | if ((err = ixgb_setup_rx_resources(adapter))) |
577 | goto err_setup_rx; | 575 | goto err_setup_rx; |
578 | if((err = ixgb_setup_tx_resources(adapter))) | 576 | if ((err = ixgb_setup_tx_resources(adapter))) |
579 | goto err_setup_tx; | 577 | goto err_setup_tx; |
580 | 578 | ||
581 | /* save the new, restore the old in order to free it, | 579 | /* save the new, restore the old in order to free it, |
@@ -589,7 +587,7 @@ ixgb_set_ringparam(struct net_device *netdev, | |||
589 | ixgb_free_tx_resources(adapter); | 587 | ixgb_free_tx_resources(adapter); |
590 | adapter->rx_ring = rx_new; | 588 | adapter->rx_ring = rx_new; |
591 | adapter->tx_ring = tx_new; | 589 | adapter->tx_ring = tx_new; |
592 | if((err = ixgb_up(adapter))) | 590 | if ((err = ixgb_up(adapter))) |
593 | return err; | 591 | return err; |
594 | ixgb_set_speed_duplex(netdev); | 592 | ixgb_set_speed_duplex(netdev); |
595 | } | 593 | } |
@@ -615,7 +613,7 @@ ixgb_led_blink_callback(unsigned long data) | |||
615 | { | 613 | { |
616 | struct ixgb_adapter *adapter = (struct ixgb_adapter *)data; | 614 | struct ixgb_adapter *adapter = (struct ixgb_adapter *)data; |
617 | 615 | ||
618 | if(test_and_change_bit(IXGB_LED_ON, &adapter->led_status)) | 616 | if (test_and_change_bit(IXGB_LED_ON, &adapter->led_status)) |
619 | ixgb_led_off(&adapter->hw); | 617 | ixgb_led_off(&adapter->hw); |
620 | else | 618 | else |
621 | ixgb_led_on(&adapter->hw); | 619 | ixgb_led_on(&adapter->hw); |
@@ -631,7 +629,7 @@ ixgb_phys_id(struct net_device *netdev, u32 data) | |||
631 | if (!data) | 629 | if (!data) |
632 | data = INT_MAX; | 630 | data = INT_MAX; |
633 | 631 | ||
634 | if(!adapter->blink_timer.function) { | 632 | if (!adapter->blink_timer.function) { |
635 | init_timer(&adapter->blink_timer); | 633 | init_timer(&adapter->blink_timer); |
636 | adapter->blink_timer.function = ixgb_led_blink_callback; | 634 | adapter->blink_timer.function = ixgb_led_blink_callback; |
637 | adapter->blink_timer.data = (unsigned long)adapter; | 635 | adapter->blink_timer.data = (unsigned long)adapter; |
@@ -647,7 +645,7 @@ ixgb_phys_id(struct net_device *netdev, u32 data) | |||
647 | return 0; | 645 | return 0; |
648 | } | 646 | } |
649 | 647 | ||
650 | static int | 648 | static int |
651 | ixgb_get_sset_count(struct net_device *netdev, int sset) | 649 | ixgb_get_sset_count(struct net_device *netdev, int sset) |
652 | { | 650 | { |
653 | switch (sset) { | 651 | switch (sset) { |
@@ -658,30 +656,30 @@ ixgb_get_sset_count(struct net_device *netdev, int sset) | |||
658 | } | 656 | } |
659 | } | 657 | } |
660 | 658 | ||
661 | static void | 659 | static void |
662 | ixgb_get_ethtool_stats(struct net_device *netdev, | 660 | ixgb_get_ethtool_stats(struct net_device *netdev, |
663 | struct ethtool_stats *stats, u64 *data) | 661 | struct ethtool_stats *stats, u64 *data) |
664 | { | 662 | { |
665 | struct ixgb_adapter *adapter = netdev_priv(netdev); | 663 | struct ixgb_adapter *adapter = netdev_priv(netdev); |
666 | int i; | 664 | int i; |
667 | 665 | ||
668 | ixgb_update_stats(adapter); | 666 | ixgb_update_stats(adapter); |
669 | for(i = 0; i < IXGB_STATS_LEN; i++) { | 667 | for (i = 0; i < IXGB_STATS_LEN; i++) { |
670 | char *p = (char *)adapter+ixgb_gstrings_stats[i].stat_offset; | 668 | char *p = (char *)adapter+ixgb_gstrings_stats[i].stat_offset; |
671 | data[i] = (ixgb_gstrings_stats[i].sizeof_stat == | 669 | data[i] = (ixgb_gstrings_stats[i].sizeof_stat == |
672 | sizeof(u64)) ? *(u64 *)p : *(u32 *)p; | 670 | sizeof(u64)) ? *(u64 *)p : *(u32 *)p; |
673 | } | 671 | } |
674 | } | 672 | } |
675 | 673 | ||
676 | static void | 674 | static void |
677 | ixgb_get_strings(struct net_device *netdev, u32 stringset, u8 *data) | 675 | ixgb_get_strings(struct net_device *netdev, u32 stringset, u8 *data) |
678 | { | 676 | { |
679 | int i; | 677 | int i; |
680 | 678 | ||
681 | switch(stringset) { | 679 | switch(stringset) { |
682 | case ETH_SS_STATS: | 680 | case ETH_SS_STATS: |
683 | for(i=0; i < IXGB_STATS_LEN; i++) { | 681 | for (i = 0; i < IXGB_STATS_LEN; i++) { |
684 | memcpy(data + i * ETH_GSTRING_LEN, | 682 | memcpy(data + i * ETH_GSTRING_LEN, |
685 | ixgb_gstrings_stats[i].stat_string, | 683 | ixgb_gstrings_stats[i].stat_string, |
686 | ETH_GSTRING_LEN); | 684 | ETH_GSTRING_LEN); |
687 | } | 685 | } |