aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000_main.c
diff options
context:
space:
mode:
authorMalli Chilakala <mallikarjuna.chilakala@intel.com>2005-06-17 20:41:45 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-06-27 00:34:24 -0400
commit60490fe030f3969a8706d94c7cf8469be6330678 (patch)
tree81d468a11f564fc90d00f42b2ec7c955bff17ae4 /drivers/net/e1000/e1000_main.c
parent70cf362ba988b4e6c9027cd7acff158e46a95b15 (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_main.c')
-rw-r--r--drivers/net/e1000/e1000_main.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index d21e29d09ddc..936fde1f38cc 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -517,7 +517,7 @@ e1000_probe(struct pci_dev *pdev,
517 SET_NETDEV_DEV(netdev, &pdev->dev); 517 SET_NETDEV_DEV(netdev, &pdev->dev);
518 518
519 pci_set_drvdata(pdev, netdev); 519 pci_set_drvdata(pdev, netdev);
520 adapter = netdev->priv; 520 adapter = netdev_priv(netdev);
521 adapter->netdev = netdev; 521 adapter->netdev = netdev;
522 adapter->pdev = pdev; 522 adapter->pdev = pdev;
523 adapter->hw.back = adapter; 523 adapter->hw.back = adapter;
@@ -738,7 +738,7 @@ static void __devexit
738e1000_remove(struct pci_dev *pdev) 738e1000_remove(struct pci_dev *pdev)
739{ 739{
740 struct net_device *netdev = pci_get_drvdata(pdev); 740 struct net_device *netdev = pci_get_drvdata(pdev);
741 struct e1000_adapter *adapter = netdev->priv; 741 struct e1000_adapter *adapter = netdev_priv(netdev);
742 uint32_t manc, swsm; 742 uint32_t manc, swsm;
743 743
744 flush_scheduled_work(); 744 flush_scheduled_work();
@@ -871,7 +871,7 @@ e1000_sw_init(struct e1000_adapter *adapter)
871static int 871static int
872e1000_open(struct net_device *netdev) 872e1000_open(struct net_device *netdev)
873{ 873{
874 struct e1000_adapter *adapter = netdev->priv; 874 struct e1000_adapter *adapter = netdev_priv(netdev);
875 int err; 875 int err;
876 876
877 /* allocate transmit descriptors */ 877 /* allocate transmit descriptors */
@@ -919,7 +919,7 @@ err_setup_tx:
919static int 919static int
920e1000_close(struct net_device *netdev) 920e1000_close(struct net_device *netdev)
921{ 921{
922 struct e1000_adapter *adapter = netdev->priv; 922 struct e1000_adapter *adapter = netdev_priv(netdev);
923 923
924 e1000_down(adapter); 924 e1000_down(adapter);
925 925
@@ -1599,7 +1599,7 @@ e1000_leave_82542_rst(struct e1000_adapter *adapter)
1599static int 1599static int
1600e1000_set_mac(struct net_device *netdev, void *p) 1600e1000_set_mac(struct net_device *netdev, void *p)
1601{ 1601{
1602 struct e1000_adapter *adapter = netdev->priv; 1602 struct e1000_adapter *adapter = netdev_priv(netdev);
1603 struct sockaddr *addr = p; 1603 struct sockaddr *addr = p;
1604 1604
1605 if(!is_valid_ether_addr(addr->sa_data)) 1605 if(!is_valid_ether_addr(addr->sa_data))
@@ -1634,7 +1634,7 @@ e1000_set_mac(struct net_device *netdev, void *p)
1634static void 1634static void
1635e1000_set_multi(struct net_device *netdev) 1635e1000_set_multi(struct net_device *netdev)
1636{ 1636{
1637 struct e1000_adapter *adapter = netdev->priv; 1637 struct e1000_adapter *adapter = netdev_priv(netdev);
1638 struct e1000_hw *hw = &adapter->hw; 1638 struct e1000_hw *hw = &adapter->hw;
1639 struct dev_mc_list *mc_ptr; 1639 struct dev_mc_list *mc_ptr;
1640 unsigned long flags; 1640 unsigned long flags;
@@ -2213,7 +2213,7 @@ e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb)
2213static int 2213static int
2214e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) 2214e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
2215{ 2215{
2216 struct e1000_adapter *adapter = netdev->priv; 2216 struct e1000_adapter *adapter = netdev_priv(netdev);
2217 unsigned int first, max_per_txd = E1000_MAX_DATA_PER_TXD; 2217 unsigned int first, max_per_txd = E1000_MAX_DATA_PER_TXD;
2218 unsigned int max_txd_pwr = E1000_MAX_TXD_PWR; 2218 unsigned int max_txd_pwr = E1000_MAX_TXD_PWR;
2219 unsigned int tx_flags = 0; 2219 unsigned int tx_flags = 0;
@@ -2344,7 +2344,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
2344static void 2344static void
2345e1000_tx_timeout(struct net_device *netdev) 2345e1000_tx_timeout(struct net_device *netdev)
2346{ 2346{
2347 struct e1000_adapter *adapter = netdev->priv; 2347 struct e1000_adapter *adapter = netdev_priv(netdev);
2348 2348
2349 /* Do the reset outside of interrupt context */ 2349 /* Do the reset outside of interrupt context */
2350 schedule_work(&adapter->tx_timeout_task); 2350 schedule_work(&adapter->tx_timeout_task);
@@ -2353,7 +2353,7 @@ e1000_tx_timeout(struct net_device *netdev)
2353static void 2353static void
2354e1000_tx_timeout_task(struct net_device *netdev) 2354e1000_tx_timeout_task(struct net_device *netdev)
2355{ 2355{
2356 struct e1000_adapter *adapter = netdev->priv; 2356 struct e1000_adapter *adapter = netdev_priv(netdev);
2357 2357
2358 e1000_down(adapter); 2358 e1000_down(adapter);
2359 e1000_up(adapter); 2359 e1000_up(adapter);
@@ -2370,7 +2370,7 @@ e1000_tx_timeout_task(struct net_device *netdev)
2370static struct net_device_stats * 2370static struct net_device_stats *
2371e1000_get_stats(struct net_device *netdev) 2371e1000_get_stats(struct net_device *netdev)
2372{ 2372{
2373 struct e1000_adapter *adapter = netdev->priv; 2373 struct e1000_adapter *adapter = netdev_priv(netdev);
2374 2374
2375 e1000_update_stats(adapter); 2375 e1000_update_stats(adapter);
2376 return &adapter->net_stats; 2376 return &adapter->net_stats;
@@ -2387,7 +2387,7 @@ e1000_get_stats(struct net_device *netdev)
2387static int 2387static int
2388e1000_change_mtu(struct net_device *netdev, int new_mtu) 2388e1000_change_mtu(struct net_device *netdev, int new_mtu)
2389{ 2389{
2390 struct e1000_adapter *adapter = netdev->priv; 2390 struct e1000_adapter *adapter = netdev_priv(netdev);
2391 int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE; 2391 int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
2392 2392
2393 if((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) || 2393 if((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) ||
@@ -2598,7 +2598,7 @@ static irqreturn_t
2598e1000_intr(int irq, void *data, struct pt_regs *regs) 2598e1000_intr(int irq, void *data, struct pt_regs *regs)
2599{ 2599{
2600 struct net_device *netdev = data; 2600 struct net_device *netdev = data;
2601 struct e1000_adapter *adapter = netdev->priv; 2601 struct e1000_adapter *adapter = netdev_priv(netdev);
2602 struct e1000_hw *hw = &adapter->hw; 2602 struct e1000_hw *hw = &adapter->hw;
2603 uint32_t icr = E1000_READ_REG(hw, ICR); 2603 uint32_t icr = E1000_READ_REG(hw, ICR);
2604#ifndef CONFIG_E1000_NAPI 2604#ifndef CONFIG_E1000_NAPI
@@ -2661,7 +2661,7 @@ e1000_intr(int irq, void *data, struct pt_regs *regs)
2661static int 2661static int
2662e1000_clean(struct net_device *netdev, int *budget) 2662e1000_clean(struct net_device *netdev, int *budget)
2663{ 2663{
2664 struct e1000_adapter *adapter = netdev->priv; 2664 struct e1000_adapter *adapter = netdev_priv(netdev);
2665 int work_to_do = min(*budget, netdev->quota); 2665 int work_to_do = min(*budget, netdev->quota);
2666 int tx_cleaned; 2666 int tx_cleaned;
2667 int work_done = 0; 2667 int work_done = 0;
@@ -3371,7 +3371,7 @@ e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
3371static int 3371static int
3372e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) 3372e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
3373{ 3373{
3374 struct e1000_adapter *adapter = netdev->priv; 3374 struct e1000_adapter *adapter = netdev_priv(netdev);
3375 struct mii_ioctl_data *data = if_mii(ifr); 3375 struct mii_ioctl_data *data = if_mii(ifr);
3376 int retval; 3376 int retval;
3377 uint16_t mii_reg; 3377 uint16_t mii_reg;
@@ -3520,7 +3520,7 @@ e1000_io_write(struct e1000_hw *hw, unsigned long port, uint32_t value)
3520static void 3520static void
3521e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) 3521e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
3522{ 3522{
3523 struct e1000_adapter *adapter = netdev->priv; 3523 struct e1000_adapter *adapter = netdev_priv(netdev);
3524 uint32_t ctrl, rctl; 3524 uint32_t ctrl, rctl;
3525 3525
3526 e1000_irq_disable(adapter); 3526 e1000_irq_disable(adapter);
@@ -3560,7 +3560,7 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
3560static void 3560static void
3561e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid) 3561e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid)
3562{ 3562{
3563 struct e1000_adapter *adapter = netdev->priv; 3563 struct e1000_adapter *adapter = netdev_priv(netdev);
3564 uint32_t vfta, index; 3564 uint32_t vfta, index;
3565 if((adapter->hw.mng_cookie.status & 3565 if((adapter->hw.mng_cookie.status &
3566 E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) && 3566 E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) &&
@@ -3576,7 +3576,7 @@ e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid)
3576static void 3576static void
3577e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid) 3577e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid)
3578{ 3578{
3579 struct e1000_adapter *adapter = netdev->priv; 3579 struct e1000_adapter *adapter = netdev_priv(netdev);
3580 uint32_t vfta, index; 3580 uint32_t vfta, index;
3581 3581
3582 e1000_irq_disable(adapter); 3582 e1000_irq_disable(adapter);
@@ -3663,7 +3663,7 @@ static int
3663e1000_suspend(struct pci_dev *pdev, uint32_t state) 3663e1000_suspend(struct pci_dev *pdev, uint32_t state)
3664{ 3664{
3665 struct net_device *netdev = pci_get_drvdata(pdev); 3665 struct net_device *netdev = pci_get_drvdata(pdev);
3666 struct e1000_adapter *adapter = netdev->priv; 3666 struct e1000_adapter *adapter = netdev_priv(netdev);
3667 uint32_t ctrl, ctrl_ext, rctl, manc, status, swsm; 3667 uint32_t ctrl, ctrl_ext, rctl, manc, status, swsm;
3668 uint32_t wufc = adapter->wol; 3668 uint32_t wufc = adapter->wol;
3669 3669
@@ -3756,8 +3756,8 @@ static int
3756e1000_resume(struct pci_dev *pdev) 3756e1000_resume(struct pci_dev *pdev)
3757{ 3757{
3758 struct net_device *netdev = pci_get_drvdata(pdev); 3758 struct net_device *netdev = pci_get_drvdata(pdev);
3759 struct e1000_adapter *adapter = netdev->priv;
3760 uint32_t manc, ret, swsm; 3759 uint32_t manc, ret, swsm;
3760 struct e1000_adapter *adapter = netdev_priv(netdev);
3761 3761
3762 pci_set_power_state(pdev, 0); 3762 pci_set_power_state(pdev, 0);
3763 pci_restore_state(pdev); 3763 pci_restore_state(pdev);
@@ -3804,7 +3804,7 @@ e1000_resume(struct pci_dev *pdev)
3804static void 3804static void
3805e1000_netpoll(struct net_device *netdev) 3805e1000_netpoll(struct net_device *netdev)
3806{ 3806{
3807 struct e1000_adapter *adapter = netdev->priv; 3807 struct e1000_adapter *adapter = netdev_priv(netdev);
3808 disable_irq(adapter->pdev->irq); 3808 disable_irq(adapter->pdev->irq);
3809 e1000_intr(adapter->pdev->irq, netdev, NULL); 3809 e1000_intr(adapter->pdev->irq, netdev, NULL);
3810 enable_irq(adapter->pdev->irq); 3810 enable_irq(adapter->pdev->irq);