aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalli Chilakala <mallikarjuna.chilakala@intel.com>2005-08-11 16:58:40 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-08-11 17:09:19 -0400
commit8908c6cd1d6889850148aeb50bb14301959adaa7 (patch)
treef2d35f3f9dbad26caa665cdaef261ba42dac15fb
parent51b54b512cd26c4477ccd57b8d3736b99ccef7a0 (diff)
[PATCH] ixgb: Use netdev_priv() instead of netdev->priv
Use netdev_priv() instead of netdev->priv 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> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
-rw-r--r--drivers/net/ixgb/ixgb_ethtool.c30
-rw-r--r--drivers/net/ixgb/ixgb_main.c32
2 files changed, 32 insertions, 30 deletions
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index 94bc3d41cfa3..c80fa0007904 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -98,7 +98,7 @@ static struct ixgb_stats ixgb_gstrings_stats[] = {
98static int 98static int
99ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) 99ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
100{ 100{
101 struct ixgb_adapter *adapter = netdev->priv; 101 struct ixgb_adapter *adapter = netdev_priv(netdev);
102 102
103 ecmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE); 103 ecmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);
104 ecmd->advertising = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE); 104 ecmd->advertising = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);
@@ -120,7 +120,7 @@ ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
120static int 120static int
121ixgb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) 121ixgb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
122{ 122{
123 struct ixgb_adapter *adapter = netdev->priv; 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)
@@ -146,7 +146,7 @@ static void
146ixgb_get_pauseparam(struct net_device *netdev, 146ixgb_get_pauseparam(struct net_device *netdev,
147 struct ethtool_pauseparam *pause) 147 struct ethtool_pauseparam *pause)
148{ 148{
149 struct ixgb_adapter *adapter = netdev->priv; 149 struct ixgb_adapter *adapter = netdev_priv(netdev);
150 struct ixgb_hw *hw = &adapter->hw; 150 struct ixgb_hw *hw = &adapter->hw;
151 151
152 pause->autoneg = AUTONEG_DISABLE; 152 pause->autoneg = AUTONEG_DISABLE;
@@ -165,7 +165,7 @@ static int
165ixgb_set_pauseparam(struct net_device *netdev, 165ixgb_set_pauseparam(struct net_device *netdev,
166 struct ethtool_pauseparam *pause) 166 struct ethtool_pauseparam *pause)
167{ 167{
168 struct ixgb_adapter *adapter = netdev->priv; 168 struct ixgb_adapter *adapter = netdev_priv(netdev);
169 struct ixgb_hw *hw = &adapter->hw; 169 struct ixgb_hw *hw = &adapter->hw;
170 170
171 if(pause->autoneg == AUTONEG_ENABLE) 171 if(pause->autoneg == AUTONEG_ENABLE)
@@ -197,14 +197,16 @@ ixgb_set_pauseparam(struct net_device *netdev,
197static uint32_t 197static uint32_t
198ixgb_get_rx_csum(struct net_device *netdev) 198ixgb_get_rx_csum(struct net_device *netdev)
199{ 199{
200 struct ixgb_adapter *adapter = netdev->priv; 200 struct ixgb_adapter *adapter = netdev_priv(netdev);
201
201 return adapter->rx_csum; 202 return adapter->rx_csum;
202} 203}
203 204
204static int 205static int
205ixgb_set_rx_csum(struct net_device *netdev, uint32_t data) 206ixgb_set_rx_csum(struct net_device *netdev, uint32_t data)
206{ 207{
207 struct ixgb_adapter *adapter = netdev->priv; 208 struct ixgb_adapter *adapter = netdev_priv(netdev);
209
208 adapter->rx_csum = data; 210 adapter->rx_csum = data;
209 211
210 if(netif_running(netdev)) { 212 if(netif_running(netdev)) {
@@ -262,7 +264,7 @@ static void
262ixgb_get_regs(struct net_device *netdev, 264ixgb_get_regs(struct net_device *netdev,
263 struct ethtool_regs *regs, void *p) 265 struct ethtool_regs *regs, void *p)
264{ 266{
265 struct ixgb_adapter *adapter = netdev->priv; 267 struct ixgb_adapter *adapter = netdev_priv(netdev);
266 struct ixgb_hw *hw = &adapter->hw; 268 struct ixgb_hw *hw = &adapter->hw;
267 uint32_t *reg = p; 269 uint32_t *reg = p;
268 uint32_t *reg_start = reg; 270 uint32_t *reg_start = reg;
@@ -407,7 +409,7 @@ static int
407ixgb_get_eeprom(struct net_device *netdev, 409ixgb_get_eeprom(struct net_device *netdev,
408 struct ethtool_eeprom *eeprom, uint8_t *bytes) 410 struct ethtool_eeprom *eeprom, uint8_t *bytes)
409{ 411{
410 struct ixgb_adapter *adapter = netdev->priv; 412 struct ixgb_adapter *adapter = netdev_priv(netdev);
411 struct ixgb_hw *hw = &adapter->hw; 413 struct ixgb_hw *hw = &adapter->hw;
412 uint16_t *eeprom_buff; 414 uint16_t *eeprom_buff;
413 int i, max_len, first_word, last_word; 415 int i, max_len, first_word, last_word;
@@ -455,7 +457,7 @@ static int
455ixgb_set_eeprom(struct net_device *netdev, 457ixgb_set_eeprom(struct net_device *netdev,
456 struct ethtool_eeprom *eeprom, uint8_t *bytes) 458 struct ethtool_eeprom *eeprom, uint8_t *bytes)
457{ 459{
458 struct ixgb_adapter *adapter = netdev->priv; 460 struct ixgb_adapter *adapter = netdev_priv(netdev);
459 struct ixgb_hw *hw = &adapter->hw; 461 struct ixgb_hw *hw = &adapter->hw;
460 uint16_t *eeprom_buff; 462 uint16_t *eeprom_buff;
461 void *ptr; 463 void *ptr;
@@ -513,7 +515,7 @@ static void
513ixgb_get_drvinfo(struct net_device *netdev, 515ixgb_get_drvinfo(struct net_device *netdev,
514 struct ethtool_drvinfo *drvinfo) 516 struct ethtool_drvinfo *drvinfo)
515{ 517{
516 struct ixgb_adapter *adapter = netdev->priv; 518 struct ixgb_adapter *adapter = netdev_priv(netdev);
517 519
518 strncpy(drvinfo->driver, ixgb_driver_name, 32); 520 strncpy(drvinfo->driver, ixgb_driver_name, 32);
519 strncpy(drvinfo->version, ixgb_driver_version, 32); 521 strncpy(drvinfo->version, ixgb_driver_version, 32);
@@ -528,7 +530,7 @@ static void
528ixgb_get_ringparam(struct net_device *netdev, 530ixgb_get_ringparam(struct net_device *netdev,
529 struct ethtool_ringparam *ring) 531 struct ethtool_ringparam *ring)
530{ 532{
531 struct ixgb_adapter *adapter = netdev->priv; 533 struct ixgb_adapter *adapter = netdev_priv(netdev);
532 struct ixgb_desc_ring *txdr = &adapter->tx_ring; 534 struct ixgb_desc_ring *txdr = &adapter->tx_ring;
533 struct ixgb_desc_ring *rxdr = &adapter->rx_ring; 535 struct ixgb_desc_ring *rxdr = &adapter->rx_ring;
534 536
@@ -546,7 +548,7 @@ static int
546ixgb_set_ringparam(struct net_device *netdev, 548ixgb_set_ringparam(struct net_device *netdev,
547 struct ethtool_ringparam *ring) 549 struct ethtool_ringparam *ring)
548{ 550{
549 struct ixgb_adapter *adapter = netdev->priv; 551 struct ixgb_adapter *adapter = netdev_priv(netdev);
550 struct ixgb_desc_ring *txdr = &adapter->tx_ring; 552 struct ixgb_desc_ring *txdr = &adapter->tx_ring;
551 struct ixgb_desc_ring *rxdr = &adapter->rx_ring; 553 struct ixgb_desc_ring *rxdr = &adapter->rx_ring;
552 struct ixgb_desc_ring tx_old, tx_new, rx_old, rx_new; 554 struct ixgb_desc_ring tx_old, tx_new, rx_old, rx_new;
@@ -628,7 +630,7 @@ ixgb_led_blink_callback(unsigned long data)
628static int 630static int
629ixgb_phys_id(struct net_device *netdev, uint32_t data) 631ixgb_phys_id(struct net_device *netdev, uint32_t data)
630{ 632{
631 struct ixgb_adapter *adapter = netdev->priv; 633 struct ixgb_adapter *adapter = netdev_priv(netdev);
632 634
633 if(!data || data > (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ)) 635 if(!data || data > (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ))
634 data = (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ); 636 data = (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ);
@@ -664,7 +666,7 @@ static void
664ixgb_get_ethtool_stats(struct net_device *netdev, 666ixgb_get_ethtool_stats(struct net_device *netdev,
665 struct ethtool_stats *stats, uint64_t *data) 667 struct ethtool_stats *stats, uint64_t *data)
666{ 668{
667 struct ixgb_adapter *adapter = netdev->priv; 669 struct ixgb_adapter *adapter = netdev_priv(netdev);
668 int i; 670 int i;
669 671
670 ixgb_update_stats(adapter); 672 ixgb_update_stats(adapter);
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 492783be205e..d1fc431cb1c9 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -378,7 +378,7 @@ ixgb_probe(struct pci_dev *pdev,
378 SET_NETDEV_DEV(netdev, &pdev->dev); 378 SET_NETDEV_DEV(netdev, &pdev->dev);
379 379
380 pci_set_drvdata(pdev, netdev); 380 pci_set_drvdata(pdev, netdev);
381 adapter = netdev->priv; 381 adapter = netdev_priv(netdev);
382 adapter->netdev = netdev; 382 adapter->netdev = netdev;
383 adapter->pdev = pdev; 383 adapter->pdev = pdev;
384 adapter->hw.back = adapter; 384 adapter->hw.back = adapter;
@@ -514,7 +514,7 @@ static void __devexit
514ixgb_remove(struct pci_dev *pdev) 514ixgb_remove(struct pci_dev *pdev)
515{ 515{
516 struct net_device *netdev = pci_get_drvdata(pdev); 516 struct net_device *netdev = pci_get_drvdata(pdev);
517 struct ixgb_adapter *adapter = netdev->priv; 517 struct ixgb_adapter *adapter = netdev_priv(netdev);
518 518
519 unregister_netdev(netdev); 519 unregister_netdev(netdev);
520 520
@@ -585,7 +585,7 @@ ixgb_sw_init(struct ixgb_adapter *adapter)
585static int 585static int
586ixgb_open(struct net_device *netdev) 586ixgb_open(struct net_device *netdev)
587{ 587{
588 struct ixgb_adapter *adapter = netdev->priv; 588 struct ixgb_adapter *adapter = netdev_priv(netdev);
589 int err; 589 int err;
590 590
591 /* allocate transmit descriptors */ 591 /* allocate transmit descriptors */
@@ -628,7 +628,7 @@ err_setup_tx:
628static int 628static int
629ixgb_close(struct net_device *netdev) 629ixgb_close(struct net_device *netdev)
630{ 630{
631 struct ixgb_adapter *adapter = netdev->priv; 631 struct ixgb_adapter *adapter = netdev_priv(netdev);
632 632
633 ixgb_down(adapter, TRUE); 633 ixgb_down(adapter, TRUE);
634 634
@@ -1019,7 +1019,7 @@ ixgb_clean_rx_ring(struct ixgb_adapter *adapter)
1019static int 1019static int
1020ixgb_set_mac(struct net_device *netdev, void *p) 1020ixgb_set_mac(struct net_device *netdev, void *p)
1021{ 1021{
1022 struct ixgb_adapter *adapter = netdev->priv; 1022 struct ixgb_adapter *adapter = netdev_priv(netdev);
1023 struct sockaddr *addr = p; 1023 struct sockaddr *addr = p;
1024 1024
1025 if(!is_valid_ether_addr(addr->sa_data)) 1025 if(!is_valid_ether_addr(addr->sa_data))
@@ -1045,7 +1045,7 @@ ixgb_set_mac(struct net_device *netdev, void *p)
1045static void 1045static void
1046ixgb_set_multi(struct net_device *netdev) 1046ixgb_set_multi(struct net_device *netdev)
1047{ 1047{
1048 struct ixgb_adapter *adapter = netdev->priv; 1048 struct ixgb_adapter *adapter = netdev_priv(netdev);
1049 struct ixgb_hw *hw = &adapter->hw; 1049 struct ixgb_hw *hw = &adapter->hw;
1050 struct dev_mc_list *mc_ptr; 1050 struct dev_mc_list *mc_ptr;
1051 uint32_t rctl; 1051 uint32_t rctl;
@@ -1373,7 +1373,7 @@ ixgb_tx_queue(struct ixgb_adapter *adapter, int count, int vlan_id,int tx_flags)
1373static int 1373static int
1374ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) 1374ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1375{ 1375{
1376 struct ixgb_adapter *adapter = netdev->priv; 1376 struct ixgb_adapter *adapter = netdev_priv(netdev);
1377 unsigned int first; 1377 unsigned int first;
1378 unsigned int tx_flags = 0; 1378 unsigned int tx_flags = 0;
1379 unsigned long flags; 1379 unsigned long flags;
@@ -1427,7 +1427,7 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1427static void 1427static void
1428ixgb_tx_timeout(struct net_device *netdev) 1428ixgb_tx_timeout(struct net_device *netdev)
1429{ 1429{
1430 struct ixgb_adapter *adapter = netdev->priv; 1430 struct ixgb_adapter *adapter = netdev_priv(netdev);
1431 1431
1432 /* Do the reset outside of interrupt context */ 1432 /* Do the reset outside of interrupt context */
1433 schedule_work(&adapter->tx_timeout_task); 1433 schedule_work(&adapter->tx_timeout_task);
@@ -1436,7 +1436,7 @@ ixgb_tx_timeout(struct net_device *netdev)
1436static void 1436static void
1437ixgb_tx_timeout_task(struct net_device *netdev) 1437ixgb_tx_timeout_task(struct net_device *netdev)
1438{ 1438{
1439 struct ixgb_adapter *adapter = netdev->priv; 1439 struct ixgb_adapter *adapter = netdev_priv(netdev);
1440 1440
1441 ixgb_down(adapter, TRUE); 1441 ixgb_down(adapter, TRUE);
1442 ixgb_up(adapter); 1442 ixgb_up(adapter);
@@ -1453,7 +1453,7 @@ ixgb_tx_timeout_task(struct net_device *netdev)
1453static struct net_device_stats * 1453static struct net_device_stats *
1454ixgb_get_stats(struct net_device *netdev) 1454ixgb_get_stats(struct net_device *netdev)
1455{ 1455{
1456 struct ixgb_adapter *adapter = netdev->priv; 1456 struct ixgb_adapter *adapter = netdev_priv(netdev);
1457 1457
1458 return &adapter->net_stats; 1458 return &adapter->net_stats;
1459} 1459}
@@ -1469,7 +1469,7 @@ ixgb_get_stats(struct net_device *netdev)
1469static int 1469static int
1470ixgb_change_mtu(struct net_device *netdev, int new_mtu) 1470ixgb_change_mtu(struct net_device *netdev, int new_mtu)
1471{ 1471{
1472 struct ixgb_adapter *adapter = netdev->priv; 1472 struct ixgb_adapter *adapter = netdev_priv(netdev);
1473 int max_frame = new_mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; 1473 int max_frame = new_mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH;
1474 int old_max_frame = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; 1474 int old_max_frame = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH;
1475 1475
@@ -1643,7 +1643,7 @@ static irqreturn_t
1643ixgb_intr(int irq, void *data, struct pt_regs *regs) 1643ixgb_intr(int irq, void *data, struct pt_regs *regs)
1644{ 1644{
1645 struct net_device *netdev = data; 1645 struct net_device *netdev = data;
1646 struct ixgb_adapter *adapter = netdev->priv; 1646 struct ixgb_adapter *adapter = netdev_priv(netdev);
1647 struct ixgb_hw *hw = &adapter->hw; 1647 struct ixgb_hw *hw = &adapter->hw;
1648 uint32_t icr = IXGB_READ_REG(hw, ICR); 1648 uint32_t icr = IXGB_READ_REG(hw, ICR);
1649#ifndef CONFIG_IXGB_NAPI 1649#ifndef CONFIG_IXGB_NAPI
@@ -1690,7 +1690,7 @@ ixgb_intr(int irq, void *data, struct pt_regs *regs)
1690static int 1690static int
1691ixgb_clean(struct net_device *netdev, int *budget) 1691ixgb_clean(struct net_device *netdev, int *budget)
1692{ 1692{
1693 struct ixgb_adapter *adapter = netdev->priv; 1693 struct ixgb_adapter *adapter = netdev_priv(netdev);
1694 int work_to_do = min(*budget, netdev->quota); 1694 int work_to_do = min(*budget, netdev->quota);
1695 int tx_cleaned; 1695 int tx_cleaned;
1696 int work_done = 0; 1696 int work_done = 0;
@@ -2019,7 +2019,7 @@ ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter)
2019static void 2019static void
2020ixgb_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) 2020ixgb_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
2021{ 2021{
2022 struct ixgb_adapter *adapter = netdev->priv; 2022 struct ixgb_adapter *adapter = netdev_priv(netdev);
2023 uint32_t ctrl, rctl; 2023 uint32_t ctrl, rctl;
2024 2024
2025 ixgb_irq_disable(adapter); 2025 ixgb_irq_disable(adapter);
@@ -2057,7 +2057,7 @@ ixgb_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
2057static void 2057static void
2058ixgb_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid) 2058ixgb_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid)
2059{ 2059{
2060 struct ixgb_adapter *adapter = netdev->priv; 2060 struct ixgb_adapter *adapter = netdev_priv(netdev);
2061 uint32_t vfta, index; 2061 uint32_t vfta, index;
2062 2062
2063 /* add VID to filter table */ 2063 /* add VID to filter table */
@@ -2071,7 +2071,7 @@ ixgb_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid)
2071static void 2071static void
2072ixgb_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid) 2072ixgb_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid)
2073{ 2073{
2074 struct ixgb_adapter *adapter = netdev->priv; 2074 struct ixgb_adapter *adapter = netdev_priv(netdev);
2075 uint32_t vfta, index; 2075 uint32_t vfta, index;
2076 2076
2077 ixgb_irq_disable(adapter); 2077 ixgb_irq_disable(adapter);