diff options
author | Malli Chilakala <mallikarjuna.chilakala@intel.com> | 2005-06-17 20:41:45 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-06-27 00:34:24 -0400 |
commit | 60490fe030f3969a8706d94c7cf8469be6330678 (patch) | |
tree | 81d468a11f564fc90d00f42b2ec7c955bff17ae4 /drivers/net/e1000/e1000_ethtool.c | |
parent | 70cf362ba988b4e6c9027cd7acff158e46a95b15 (diff) |
[PATCH] e1000: Use netdev_priv() to get to netdev->priv
Use netdev_priv() to get to netdev->priv - from shemminger@osdl.org
Signed-off-by: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Signed-off-by: Ganesh Venkatesan <ganesh.venkatesan@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
Diffstat (limited to 'drivers/net/e1000/e1000_ethtool.c')
-rw-r--r-- | drivers/net/e1000/e1000_ethtool.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c index 237247f74df4..b27b71b8834f 100644 --- a/drivers/net/e1000/e1000_ethtool.c +++ b/drivers/net/e1000/e1000_ethtool.c | |||
@@ -105,7 +105,7 @@ static const char e1000_gstrings_test[][ETH_GSTRING_LEN] = { | |||
105 | static int | 105 | static int |
106 | e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | 106 | e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) |
107 | { | 107 | { |
108 | struct e1000_adapter *adapter = netdev->priv; | 108 | struct e1000_adapter *adapter = netdev_priv(netdev); |
109 | struct e1000_hw *hw = &adapter->hw; | 109 | struct e1000_hw *hw = &adapter->hw; |
110 | 110 | ||
111 | if(hw->media_type == e1000_media_type_copper) { | 111 | if(hw->media_type == e1000_media_type_copper) { |
@@ -179,7 +179,7 @@ e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | |||
179 | static int | 179 | static int |
180 | e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | 180 | e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) |
181 | { | 181 | { |
182 | struct e1000_adapter *adapter = netdev->priv; | 182 | struct e1000_adapter *adapter = netdev_priv(netdev); |
183 | struct e1000_hw *hw = &adapter->hw; | 183 | struct e1000_hw *hw = &adapter->hw; |
184 | 184 | ||
185 | if(ecmd->autoneg == AUTONEG_ENABLE) { | 185 | if(ecmd->autoneg == AUTONEG_ENABLE) { |
@@ -206,7 +206,7 @@ static void | |||
206 | e1000_get_pauseparam(struct net_device *netdev, | 206 | e1000_get_pauseparam(struct net_device *netdev, |
207 | struct ethtool_pauseparam *pause) | 207 | struct ethtool_pauseparam *pause) |
208 | { | 208 | { |
209 | struct e1000_adapter *adapter = netdev->priv; | 209 | struct e1000_adapter *adapter = netdev_priv(netdev); |
210 | struct e1000_hw *hw = &adapter->hw; | 210 | struct e1000_hw *hw = &adapter->hw; |
211 | 211 | ||
212 | pause->autoneg = | 212 | pause->autoneg = |
@@ -226,7 +226,7 @@ static int | |||
226 | e1000_set_pauseparam(struct net_device *netdev, | 226 | e1000_set_pauseparam(struct net_device *netdev, |
227 | struct ethtool_pauseparam *pause) | 227 | struct ethtool_pauseparam *pause) |
228 | { | 228 | { |
229 | struct e1000_adapter *adapter = netdev->priv; | 229 | struct e1000_adapter *adapter = netdev_priv(netdev); |
230 | struct e1000_hw *hw = &adapter->hw; | 230 | struct e1000_hw *hw = &adapter->hw; |
231 | 231 | ||
232 | adapter->fc_autoneg = pause->autoneg; | 232 | adapter->fc_autoneg = pause->autoneg; |
@@ -259,14 +259,14 @@ e1000_set_pauseparam(struct net_device *netdev, | |||
259 | static uint32_t | 259 | static uint32_t |
260 | e1000_get_rx_csum(struct net_device *netdev) | 260 | e1000_get_rx_csum(struct net_device *netdev) |
261 | { | 261 | { |
262 | struct e1000_adapter *adapter = netdev->priv; | 262 | struct e1000_adapter *adapter = netdev_priv(netdev); |
263 | return adapter->rx_csum; | 263 | return adapter->rx_csum; |
264 | } | 264 | } |
265 | 265 | ||
266 | static int | 266 | static int |
267 | e1000_set_rx_csum(struct net_device *netdev, uint32_t data) | 267 | e1000_set_rx_csum(struct net_device *netdev, uint32_t data) |
268 | { | 268 | { |
269 | struct e1000_adapter *adapter = netdev->priv; | 269 | struct e1000_adapter *adapter = netdev_priv(netdev); |
270 | adapter->rx_csum = data; | 270 | adapter->rx_csum = data; |
271 | 271 | ||
272 | if(netif_running(netdev)) { | 272 | if(netif_running(netdev)) { |
@@ -286,7 +286,7 @@ e1000_get_tx_csum(struct net_device *netdev) | |||
286 | static int | 286 | static int |
287 | e1000_set_tx_csum(struct net_device *netdev, uint32_t data) | 287 | e1000_set_tx_csum(struct net_device *netdev, uint32_t data) |
288 | { | 288 | { |
289 | struct e1000_adapter *adapter = netdev->priv; | 289 | struct e1000_adapter *adapter = netdev_priv(netdev); |
290 | 290 | ||
291 | if(adapter->hw.mac_type < e1000_82543) { | 291 | if(adapter->hw.mac_type < e1000_82543) { |
292 | if (!data) | 292 | if (!data) |
@@ -306,8 +306,8 @@ e1000_set_tx_csum(struct net_device *netdev, uint32_t data) | |||
306 | static int | 306 | static int |
307 | e1000_set_tso(struct net_device *netdev, uint32_t data) | 307 | e1000_set_tso(struct net_device *netdev, uint32_t data) |
308 | { | 308 | { |
309 | struct e1000_adapter *adapter = netdev->priv; | 309 | struct e1000_adapter *adapter = netdev_priv(netdev); |
310 | if ((adapter->hw.mac_type < e1000_82544) || | 310 | if((adapter->hw.mac_type < e1000_82544) || |
311 | (adapter->hw.mac_type == e1000_82547)) | 311 | (adapter->hw.mac_type == e1000_82547)) |
312 | return data ? -EINVAL : 0; | 312 | return data ? -EINVAL : 0; |
313 | 313 | ||
@@ -322,14 +322,14 @@ e1000_set_tso(struct net_device *netdev, uint32_t data) | |||
322 | static uint32_t | 322 | static uint32_t |
323 | e1000_get_msglevel(struct net_device *netdev) | 323 | e1000_get_msglevel(struct net_device *netdev) |
324 | { | 324 | { |
325 | struct e1000_adapter *adapter = netdev->priv; | 325 | struct e1000_adapter *adapter = netdev_priv(netdev); |
326 | return adapter->msg_enable; | 326 | return adapter->msg_enable; |
327 | } | 327 | } |
328 | 328 | ||
329 | static void | 329 | static void |
330 | e1000_set_msglevel(struct net_device *netdev, uint32_t data) | 330 | e1000_set_msglevel(struct net_device *netdev, uint32_t data) |
331 | { | 331 | { |
332 | struct e1000_adapter *adapter = netdev->priv; | 332 | struct e1000_adapter *adapter = netdev_priv(netdev); |
333 | adapter->msg_enable = data; | 333 | adapter->msg_enable = data; |
334 | } | 334 | } |
335 | 335 | ||
@@ -344,7 +344,7 @@ static void | |||
344 | e1000_get_regs(struct net_device *netdev, | 344 | e1000_get_regs(struct net_device *netdev, |
345 | struct ethtool_regs *regs, void *p) | 345 | struct ethtool_regs *regs, void *p) |
346 | { | 346 | { |
347 | struct e1000_adapter *adapter = netdev->priv; | 347 | struct e1000_adapter *adapter = netdev_priv(netdev); |
348 | struct e1000_hw *hw = &adapter->hw; | 348 | struct e1000_hw *hw = &adapter->hw; |
349 | uint32_t *regs_buff = p; | 349 | uint32_t *regs_buff = p; |
350 | uint16_t phy_data; | 350 | uint16_t phy_data; |
@@ -432,7 +432,7 @@ e1000_get_regs(struct net_device *netdev, | |||
432 | static int | 432 | static int |
433 | e1000_get_eeprom_len(struct net_device *netdev) | 433 | e1000_get_eeprom_len(struct net_device *netdev) |
434 | { | 434 | { |
435 | struct e1000_adapter *adapter = netdev->priv; | 435 | struct e1000_adapter *adapter = netdev_priv(netdev); |
436 | return adapter->hw.eeprom.word_size * 2; | 436 | return adapter->hw.eeprom.word_size * 2; |
437 | } | 437 | } |
438 | 438 | ||
@@ -440,7 +440,7 @@ static int | |||
440 | e1000_get_eeprom(struct net_device *netdev, | 440 | e1000_get_eeprom(struct net_device *netdev, |
441 | struct ethtool_eeprom *eeprom, uint8_t *bytes) | 441 | struct ethtool_eeprom *eeprom, uint8_t *bytes) |
442 | { | 442 | { |
443 | struct e1000_adapter *adapter = netdev->priv; | 443 | struct e1000_adapter *adapter = netdev_priv(netdev); |
444 | struct e1000_hw *hw = &adapter->hw; | 444 | struct e1000_hw *hw = &adapter->hw; |
445 | uint16_t *eeprom_buff; | 445 | uint16_t *eeprom_buff; |
446 | int first_word, last_word; | 446 | int first_word, last_word; |
@@ -486,7 +486,7 @@ static int | |||
486 | e1000_set_eeprom(struct net_device *netdev, | 486 | e1000_set_eeprom(struct net_device *netdev, |
487 | struct ethtool_eeprom *eeprom, uint8_t *bytes) | 487 | struct ethtool_eeprom *eeprom, uint8_t *bytes) |
488 | { | 488 | { |
489 | struct e1000_adapter *adapter = netdev->priv; | 489 | struct e1000_adapter *adapter = netdev_priv(netdev); |
490 | struct e1000_hw *hw = &adapter->hw; | 490 | struct e1000_hw *hw = &adapter->hw; |
491 | uint16_t *eeprom_buff; | 491 | uint16_t *eeprom_buff; |
492 | void *ptr; | 492 | void *ptr; |
@@ -547,7 +547,7 @@ static void | |||
547 | e1000_get_drvinfo(struct net_device *netdev, | 547 | e1000_get_drvinfo(struct net_device *netdev, |
548 | struct ethtool_drvinfo *drvinfo) | 548 | struct ethtool_drvinfo *drvinfo) |
549 | { | 549 | { |
550 | struct e1000_adapter *adapter = netdev->priv; | 550 | struct e1000_adapter *adapter = netdev_priv(netdev); |
551 | 551 | ||
552 | strncpy(drvinfo->driver, e1000_driver_name, 32); | 552 | strncpy(drvinfo->driver, e1000_driver_name, 32); |
553 | strncpy(drvinfo->version, e1000_driver_version, 32); | 553 | strncpy(drvinfo->version, e1000_driver_version, 32); |
@@ -563,7 +563,7 @@ static void | |||
563 | e1000_get_ringparam(struct net_device *netdev, | 563 | e1000_get_ringparam(struct net_device *netdev, |
564 | struct ethtool_ringparam *ring) | 564 | struct ethtool_ringparam *ring) |
565 | { | 565 | { |
566 | struct e1000_adapter *adapter = netdev->priv; | 566 | struct e1000_adapter *adapter = netdev_priv(netdev); |
567 | e1000_mac_type mac_type = adapter->hw.mac_type; | 567 | e1000_mac_type mac_type = adapter->hw.mac_type; |
568 | struct e1000_desc_ring *txdr = &adapter->tx_ring; | 568 | struct e1000_desc_ring *txdr = &adapter->tx_ring; |
569 | struct e1000_desc_ring *rxdr = &adapter->rx_ring; | 569 | struct e1000_desc_ring *rxdr = &adapter->rx_ring; |
@@ -584,7 +584,7 @@ static int | |||
584 | e1000_set_ringparam(struct net_device *netdev, | 584 | e1000_set_ringparam(struct net_device *netdev, |
585 | struct ethtool_ringparam *ring) | 585 | struct ethtool_ringparam *ring) |
586 | { | 586 | { |
587 | struct e1000_adapter *adapter = netdev->priv; | 587 | struct e1000_adapter *adapter = netdev_priv(netdev); |
588 | e1000_mac_type mac_type = adapter->hw.mac_type; | 588 | e1000_mac_type mac_type = adapter->hw.mac_type; |
589 | struct e1000_desc_ring *txdr = &adapter->tx_ring; | 589 | struct e1000_desc_ring *txdr = &adapter->tx_ring; |
590 | struct e1000_desc_ring *rxdr = &adapter->rx_ring; | 590 | struct e1000_desc_ring *rxdr = &adapter->rx_ring; |
@@ -766,7 +766,7 @@ e1000_test_intr(int irq, | |||
766 | struct pt_regs *regs) | 766 | struct pt_regs *regs) |
767 | { | 767 | { |
768 | struct net_device *netdev = (struct net_device *) data; | 768 | struct net_device *netdev = (struct net_device *) data; |
769 | struct e1000_adapter *adapter = netdev->priv; | 769 | struct e1000_adapter *adapter = netdev_priv(netdev); |
770 | 770 | ||
771 | adapter->test_icr |= E1000_READ_REG(&adapter->hw, ICR); | 771 | adapter->test_icr |= E1000_READ_REG(&adapter->hw, ICR); |
772 | 772 | ||
@@ -1422,7 +1422,7 @@ static void | |||
1422 | e1000_diag_test(struct net_device *netdev, | 1422 | e1000_diag_test(struct net_device *netdev, |
1423 | struct ethtool_test *eth_test, uint64_t *data) | 1423 | struct ethtool_test *eth_test, uint64_t *data) |
1424 | { | 1424 | { |
1425 | struct e1000_adapter *adapter = netdev->priv; | 1425 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1426 | boolean_t if_running = netif_running(netdev); | 1426 | boolean_t if_running = netif_running(netdev); |
1427 | 1427 | ||
1428 | if(eth_test->flags == ETH_TEST_FL_OFFLINE) { | 1428 | if(eth_test->flags == ETH_TEST_FL_OFFLINE) { |
@@ -1482,7 +1482,7 @@ e1000_diag_test(struct net_device *netdev, | |||
1482 | static void | 1482 | static void |
1483 | e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | 1483 | e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) |
1484 | { | 1484 | { |
1485 | struct e1000_adapter *adapter = netdev->priv; | 1485 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1486 | struct e1000_hw *hw = &adapter->hw; | 1486 | struct e1000_hw *hw = &adapter->hw; |
1487 | 1487 | ||
1488 | switch(adapter->hw.device_id) { | 1488 | switch(adapter->hw.device_id) { |
@@ -1527,7 +1527,7 @@ e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
1527 | static int | 1527 | static int |
1528 | e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | 1528 | e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) |
1529 | { | 1529 | { |
1530 | struct e1000_adapter *adapter = netdev->priv; | 1530 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1531 | struct e1000_hw *hw = &adapter->hw; | 1531 | struct e1000_hw *hw = &adapter->hw; |
1532 | 1532 | ||
1533 | switch(adapter->hw.device_id) { | 1533 | switch(adapter->hw.device_id) { |
@@ -1588,7 +1588,7 @@ e1000_led_blink_callback(unsigned long data) | |||
1588 | static int | 1588 | static int |
1589 | e1000_phys_id(struct net_device *netdev, uint32_t data) | 1589 | e1000_phys_id(struct net_device *netdev, uint32_t data) |
1590 | { | 1590 | { |
1591 | struct e1000_adapter *adapter = netdev->priv; | 1591 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1592 | 1592 | ||
1593 | if(!data || data > (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ)) | 1593 | if(!data || data > (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ)) |
1594 | data = (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ); | 1594 | data = (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ); |
@@ -1614,7 +1614,7 @@ e1000_phys_id(struct net_device *netdev, uint32_t data) | |||
1614 | static int | 1614 | static int |
1615 | e1000_nway_reset(struct net_device *netdev) | 1615 | e1000_nway_reset(struct net_device *netdev) |
1616 | { | 1616 | { |
1617 | struct e1000_adapter *adapter = netdev->priv; | 1617 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1618 | if(netif_running(netdev)) { | 1618 | if(netif_running(netdev)) { |
1619 | e1000_down(adapter); | 1619 | e1000_down(adapter); |
1620 | e1000_up(adapter); | 1620 | e1000_up(adapter); |
@@ -1632,7 +1632,7 @@ static void | |||
1632 | e1000_get_ethtool_stats(struct net_device *netdev, | 1632 | e1000_get_ethtool_stats(struct net_device *netdev, |
1633 | struct ethtool_stats *stats, uint64_t *data) | 1633 | struct ethtool_stats *stats, uint64_t *data) |
1634 | { | 1634 | { |
1635 | struct e1000_adapter *adapter = netdev->priv; | 1635 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1636 | int i; | 1636 | int i; |
1637 | 1637 | ||
1638 | e1000_update_stats(adapter); | 1638 | e1000_update_stats(adapter); |