Commit 60490fe0 authored by Malli Chilakala's avatar Malli Chilakala Committed by Jeff Garzik

[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: default avatarMallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Signed-off-by: default avatarGanesh Venkatesan <ganesh.venkatesan@intel.com>
Signed-off-by: default avatarJohn Ronciak <john.ronciak@intel.com>
parent 70cf362b
...@@ -105,7 +105,7 @@ static const char e1000_gstrings_test[][ETH_GSTRING_LEN] = { ...@@ -105,7 +105,7 @@ static const char e1000_gstrings_test[][ETH_GSTRING_LEN] = {
static int static int
e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
if(hw->media_type == e1000_media_type_copper) { if(hw->media_type == e1000_media_type_copper) {
...@@ -179,7 +179,7 @@ e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) ...@@ -179,7 +179,7 @@ e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
static int static int
e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
if(ecmd->autoneg == AUTONEG_ENABLE) { if(ecmd->autoneg == AUTONEG_ENABLE) {
...@@ -206,7 +206,7 @@ static void ...@@ -206,7 +206,7 @@ static void
e1000_get_pauseparam(struct net_device *netdev, e1000_get_pauseparam(struct net_device *netdev,
struct ethtool_pauseparam *pause) struct ethtool_pauseparam *pause)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
pause->autoneg = pause->autoneg =
...@@ -226,7 +226,7 @@ static int ...@@ -226,7 +226,7 @@ static int
e1000_set_pauseparam(struct net_device *netdev, e1000_set_pauseparam(struct net_device *netdev,
struct ethtool_pauseparam *pause) struct ethtool_pauseparam *pause)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
adapter->fc_autoneg = pause->autoneg; adapter->fc_autoneg = pause->autoneg;
...@@ -259,14 +259,14 @@ e1000_set_pauseparam(struct net_device *netdev, ...@@ -259,14 +259,14 @@ e1000_set_pauseparam(struct net_device *netdev,
static uint32_t static uint32_t
e1000_get_rx_csum(struct net_device *netdev) e1000_get_rx_csum(struct net_device *netdev)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
return adapter->rx_csum; return adapter->rx_csum;
} }
static int static int
e1000_set_rx_csum(struct net_device *netdev, uint32_t data) e1000_set_rx_csum(struct net_device *netdev, uint32_t data)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
adapter->rx_csum = data; adapter->rx_csum = data;
if(netif_running(netdev)) { if(netif_running(netdev)) {
...@@ -286,7 +286,7 @@ e1000_get_tx_csum(struct net_device *netdev) ...@@ -286,7 +286,7 @@ e1000_get_tx_csum(struct net_device *netdev)
static int static int
e1000_set_tx_csum(struct net_device *netdev, uint32_t data) e1000_set_tx_csum(struct net_device *netdev, uint32_t data)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
if(adapter->hw.mac_type < e1000_82543) { if(adapter->hw.mac_type < e1000_82543) {
if (!data) if (!data)
...@@ -306,8 +306,8 @@ e1000_set_tx_csum(struct net_device *netdev, uint32_t data) ...@@ -306,8 +306,8 @@ e1000_set_tx_csum(struct net_device *netdev, uint32_t data)
static int static int
e1000_set_tso(struct net_device *netdev, uint32_t data) e1000_set_tso(struct net_device *netdev, uint32_t data)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
if ((adapter->hw.mac_type < e1000_82544) || if((adapter->hw.mac_type < e1000_82544) ||
(adapter->hw.mac_type == e1000_82547)) (adapter->hw.mac_type == e1000_82547))
return data ? -EINVAL : 0; return data ? -EINVAL : 0;
...@@ -322,14 +322,14 @@ e1000_set_tso(struct net_device *netdev, uint32_t data) ...@@ -322,14 +322,14 @@ e1000_set_tso(struct net_device *netdev, uint32_t data)
static uint32_t static uint32_t
e1000_get_msglevel(struct net_device *netdev) e1000_get_msglevel(struct net_device *netdev)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
return adapter->msg_enable; return adapter->msg_enable;
} }
static void static void
e1000_set_msglevel(struct net_device *netdev, uint32_t data) e1000_set_msglevel(struct net_device *netdev, uint32_t data)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
adapter->msg_enable = data; adapter->msg_enable = data;
} }
...@@ -344,7 +344,7 @@ static void ...@@ -344,7 +344,7 @@ static void
e1000_get_regs(struct net_device *netdev, e1000_get_regs(struct net_device *netdev,
struct ethtool_regs *regs, void *p) struct ethtool_regs *regs, void *p)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
uint32_t *regs_buff = p; uint32_t *regs_buff = p;
uint16_t phy_data; uint16_t phy_data;
...@@ -432,7 +432,7 @@ e1000_get_regs(struct net_device *netdev, ...@@ -432,7 +432,7 @@ e1000_get_regs(struct net_device *netdev,
static int static int
e1000_get_eeprom_len(struct net_device *netdev) e1000_get_eeprom_len(struct net_device *netdev)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
return adapter->hw.eeprom.word_size * 2; return adapter->hw.eeprom.word_size * 2;
} }
...@@ -440,7 +440,7 @@ static int ...@@ -440,7 +440,7 @@ static int
e1000_get_eeprom(struct net_device *netdev, e1000_get_eeprom(struct net_device *netdev,
struct ethtool_eeprom *eeprom, uint8_t *bytes) struct ethtool_eeprom *eeprom, uint8_t *bytes)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
uint16_t *eeprom_buff; uint16_t *eeprom_buff;
int first_word, last_word; int first_word, last_word;
...@@ -486,7 +486,7 @@ static int ...@@ -486,7 +486,7 @@ static int
e1000_set_eeprom(struct net_device *netdev, e1000_set_eeprom(struct net_device *netdev,
struct ethtool_eeprom *eeprom, uint8_t *bytes) struct ethtool_eeprom *eeprom, uint8_t *bytes)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
uint16_t *eeprom_buff; uint16_t *eeprom_buff;
void *ptr; void *ptr;
...@@ -547,7 +547,7 @@ static void ...@@ -547,7 +547,7 @@ static void
e1000_get_drvinfo(struct net_device *netdev, e1000_get_drvinfo(struct net_device *netdev,
struct ethtool_drvinfo *drvinfo) struct ethtool_drvinfo *drvinfo)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
strncpy(drvinfo->driver, e1000_driver_name, 32); strncpy(drvinfo->driver, e1000_driver_name, 32);
strncpy(drvinfo->version, e1000_driver_version, 32); strncpy(drvinfo->version, e1000_driver_version, 32);
...@@ -563,7 +563,7 @@ static void ...@@ -563,7 +563,7 @@ static void
e1000_get_ringparam(struct net_device *netdev, e1000_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring) struct ethtool_ringparam *ring)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
e1000_mac_type mac_type = adapter->hw.mac_type; e1000_mac_type mac_type = adapter->hw.mac_type;
struct e1000_desc_ring *txdr = &adapter->tx_ring; struct e1000_desc_ring *txdr = &adapter->tx_ring;
struct e1000_desc_ring *rxdr = &adapter->rx_ring; struct e1000_desc_ring *rxdr = &adapter->rx_ring;
...@@ -584,7 +584,7 @@ static int ...@@ -584,7 +584,7 @@ static int
e1000_set_ringparam(struct net_device *netdev, e1000_set_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring) struct ethtool_ringparam *ring)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
e1000_mac_type mac_type = adapter->hw.mac_type; e1000_mac_type mac_type = adapter->hw.mac_type;
struct e1000_desc_ring *txdr = &adapter->tx_ring; struct e1000_desc_ring *txdr = &adapter->tx_ring;
struct e1000_desc_ring *rxdr = &adapter->rx_ring; struct e1000_desc_ring *rxdr = &adapter->rx_ring;
...@@ -766,7 +766,7 @@ e1000_test_intr(int irq, ...@@ -766,7 +766,7 @@ e1000_test_intr(int irq,
struct pt_regs *regs) struct pt_regs *regs)
{ {
struct net_device *netdev = (struct net_device *) data; struct net_device *netdev = (struct net_device *) data;
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
adapter->test_icr |= E1000_READ_REG(&adapter->hw, ICR); adapter->test_icr |= E1000_READ_REG(&adapter->hw, ICR);
...@@ -1422,7 +1422,7 @@ static void ...@@ -1422,7 +1422,7 @@ static void
e1000_diag_test(struct net_device *netdev, e1000_diag_test(struct net_device *netdev,
struct ethtool_test *eth_test, uint64_t *data) struct ethtool_test *eth_test, uint64_t *data)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
boolean_t if_running = netif_running(netdev); boolean_t if_running = netif_running(netdev);
if(eth_test->flags == ETH_TEST_FL_OFFLINE) { if(eth_test->flags == ETH_TEST_FL_OFFLINE) {
...@@ -1482,7 +1482,7 @@ e1000_diag_test(struct net_device *netdev, ...@@ -1482,7 +1482,7 @@ e1000_diag_test(struct net_device *netdev,
static void static void
e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
switch(adapter->hw.device_id) { switch(adapter->hw.device_id) {
...@@ -1527,7 +1527,7 @@ e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) ...@@ -1527,7 +1527,7 @@ e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
static int static int
e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
switch(adapter->hw.device_id) { switch(adapter->hw.device_id) {
...@@ -1588,7 +1588,7 @@ e1000_led_blink_callback(unsigned long data) ...@@ -1588,7 +1588,7 @@ e1000_led_blink_callback(unsigned long data)
static int static int
e1000_phys_id(struct net_device *netdev, uint32_t data) e1000_phys_id(struct net_device *netdev, uint32_t data)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
if(!data || data > (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ)) if(!data || data > (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ))
data = (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ); data = (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ);
...@@ -1614,7 +1614,7 @@ e1000_phys_id(struct net_device *netdev, uint32_t data) ...@@ -1614,7 +1614,7 @@ e1000_phys_id(struct net_device *netdev, uint32_t data)
static int static int
e1000_nway_reset(struct net_device *netdev) e1000_nway_reset(struct net_device *netdev)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
if(netif_running(netdev)) { if(netif_running(netdev)) {
e1000_down(adapter); e1000_down(adapter);
e1000_up(adapter); e1000_up(adapter);
...@@ -1632,7 +1632,7 @@ static void ...@@ -1632,7 +1632,7 @@ static void
e1000_get_ethtool_stats(struct net_device *netdev, e1000_get_ethtool_stats(struct net_device *netdev,
struct ethtool_stats *stats, uint64_t *data) struct ethtool_stats *stats, uint64_t *data)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
int i; int i;
e1000_update_stats(adapter); e1000_update_stats(adapter);
......
...@@ -517,7 +517,7 @@ e1000_probe(struct pci_dev *pdev, ...@@ -517,7 +517,7 @@ e1000_probe(struct pci_dev *pdev,
SET_NETDEV_DEV(netdev, &pdev->dev); SET_NETDEV_DEV(netdev, &pdev->dev);
pci_set_drvdata(pdev, netdev); pci_set_drvdata(pdev, netdev);
adapter = netdev->priv; adapter = netdev_priv(netdev);
adapter->netdev = netdev; adapter->netdev = netdev;
adapter->pdev = pdev; adapter->pdev = pdev;
adapter->hw.back = adapter; adapter->hw.back = adapter;
...@@ -738,7 +738,7 @@ static void __devexit ...@@ -738,7 +738,7 @@ static void __devexit
e1000_remove(struct pci_dev *pdev) e1000_remove(struct pci_dev *pdev)
{ {
struct net_device *netdev = pci_get_drvdata(pdev); struct net_device *netdev = pci_get_drvdata(pdev);
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
uint32_t manc, swsm; uint32_t manc, swsm;
flush_scheduled_work(); flush_scheduled_work();
...@@ -871,7 +871,7 @@ e1000_sw_init(struct e1000_adapter *adapter) ...@@ -871,7 +871,7 @@ e1000_sw_init(struct e1000_adapter *adapter)
static int static int
e1000_open(struct net_device *netdev) e1000_open(struct net_device *netdev)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
int err; int err;
/* allocate transmit descriptors */ /* allocate transmit descriptors */
...@@ -919,7 +919,7 @@ e1000_open(struct net_device *netdev) ...@@ -919,7 +919,7 @@ e1000_open(struct net_device *netdev)
static int static int
e1000_close(struct net_device *netdev) e1000_close(struct net_device *netdev)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
e1000_down(adapter); e1000_down(adapter);
...@@ -1599,7 +1599,7 @@ e1000_leave_82542_rst(struct e1000_adapter *adapter) ...@@ -1599,7 +1599,7 @@ e1000_leave_82542_rst(struct e1000_adapter *adapter)
static int static int
e1000_set_mac(struct net_device *netdev, void *p) e1000_set_mac(struct net_device *netdev, void *p)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
struct sockaddr *addr = p; struct sockaddr *addr = p;
if(!is_valid_ether_addr(addr->sa_data)) if(!is_valid_ether_addr(addr->sa_data))
...@@ -1634,7 +1634,7 @@ e1000_set_mac(struct net_device *netdev, void *p) ...@@ -1634,7 +1634,7 @@ e1000_set_mac(struct net_device *netdev, void *p)
static void static void
e1000_set_multi(struct net_device *netdev) e1000_set_multi(struct net_device *netdev)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
struct dev_mc_list *mc_ptr; struct dev_mc_list *mc_ptr;
unsigned long flags; unsigned long flags;
...@@ -2213,7 +2213,7 @@ e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb) ...@@ -2213,7 +2213,7 @@ e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb)
static int static int
e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
unsigned int first, max_per_txd = E1000_MAX_DATA_PER_TXD; unsigned int first, max_per_txd = E1000_MAX_DATA_PER_TXD;
unsigned int max_txd_pwr = E1000_MAX_TXD_PWR; unsigned int max_txd_pwr = E1000_MAX_TXD_PWR;
unsigned int tx_flags = 0; unsigned int tx_flags = 0;
...@@ -2344,7 +2344,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) ...@@ -2344,7 +2344,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
static void static void
e1000_tx_timeout(struct net_device *netdev) e1000_tx_timeout(struct net_device *netdev)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
/* Do the reset outside of interrupt context */ /* Do the reset outside of interrupt context */
schedule_work(&adapter->tx_timeout_task); schedule_work(&adapter->tx_timeout_task);
...@@ -2353,7 +2353,7 @@ e1000_tx_timeout(struct net_device *netdev) ...@@ -2353,7 +2353,7 @@ e1000_tx_timeout(struct net_device *netdev)
static void static void
e1000_tx_timeout_task(struct net_device *netdev) e1000_tx_timeout_task(struct net_device *netdev)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
e1000_down(adapter); e1000_down(adapter);
e1000_up(adapter); e1000_up(adapter);
...@@ -2370,7 +2370,7 @@ e1000_tx_timeout_task(struct net_device *netdev) ...@@ -2370,7 +2370,7 @@ e1000_tx_timeout_task(struct net_device *netdev)
static struct net_device_stats * static struct net_device_stats *
e1000_get_stats(struct net_device *netdev) e1000_get_stats(struct net_device *netdev)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
e1000_update_stats(adapter); e1000_update_stats(adapter);
return &adapter->net_stats; return &adapter->net_stats;
...@@ -2387,7 +2387,7 @@ e1000_get_stats(struct net_device *netdev) ...@@ -2387,7 +2387,7 @@ e1000_get_stats(struct net_device *netdev)
static int static int
e1000_change_mtu(struct net_device *netdev, int new_mtu) e1000_change_mtu(struct net_device *netdev, int new_mtu)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE; int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
if((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) || if((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) ||
...@@ -2598,7 +2598,7 @@ static irqreturn_t ...@@ -2598,7 +2598,7 @@ static irqreturn_t
e1000_intr(int irq, void *data, struct pt_regs *regs) e1000_intr(int irq, void *data, struct pt_regs *regs)
{ {
struct net_device *netdev = data; struct net_device *netdev = data;
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
uint32_t icr = E1000_READ_REG(hw, ICR); uint32_t icr = E1000_READ_REG(hw, ICR);
#ifndef CONFIG_E1000_NAPI #ifndef CONFIG_E1000_NAPI
...@@ -2661,7 +2661,7 @@ e1000_intr(int irq, void *data, struct pt_regs *regs) ...@@ -2661,7 +2661,7 @@ e1000_intr(int irq, void *data, struct pt_regs *regs)
static int static int
e1000_clean(struct net_device *netdev, int *budget) e1000_clean(struct net_device *netdev, int *budget)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
int work_to_do = min(*budget, netdev->quota); int work_to_do = min(*budget, netdev->quota);
int tx_cleaned; int tx_cleaned;
int work_done = 0; int work_done = 0;
...@@ -3371,7 +3371,7 @@ e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) ...@@ -3371,7 +3371,7 @@ e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
static int static int
e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
struct mii_ioctl_data *data = if_mii(ifr); struct mii_ioctl_data *data = if_mii(ifr);
int retval; int retval;
uint16_t mii_reg; uint16_t mii_reg;
...@@ -3520,7 +3520,7 @@ e1000_io_write(struct e1000_hw *hw, unsigned long port, uint32_t value) ...@@ -3520,7 +3520,7 @@ e1000_io_write(struct e1000_hw *hw, unsigned long port, uint32_t value)
static void static void
e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
uint32_t ctrl, rctl; uint32_t ctrl, rctl;
e1000_irq_disable(adapter); e1000_irq_disable(adapter);
...@@ -3560,7 +3560,7 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) ...@@ -3560,7 +3560,7 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
static void static void
e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid) e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
uint32_t vfta, index; uint32_t vfta, index;
if((adapter->hw.mng_cookie.status & if((adapter->hw.mng_cookie.status &
E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) && E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) &&
...@@ -3576,7 +3576,7 @@ e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid) ...@@ -3576,7 +3576,7 @@ e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid)
static void static void
e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid) e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
uint32_t vfta, index; uint32_t vfta, index;
e1000_irq_disable(adapter); e1000_irq_disable(adapter);
...@@ -3663,7 +3663,7 @@ static int ...@@ -3663,7 +3663,7 @@ static int
e1000_suspend(struct pci_dev *pdev, uint32_t state) e1000_suspend(struct pci_dev *pdev, uint32_t state)
{ {
struct net_device *netdev = pci_get_drvdata(pdev); struct net_device *netdev = pci_get_drvdata(pdev);
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
uint32_t ctrl, ctrl_ext, rctl, manc, status, swsm; uint32_t ctrl, ctrl_ext, rctl, manc, status, swsm;
uint32_t wufc = adapter->wol; uint32_t wufc = adapter->wol;
...@@ -3756,8 +3756,8 @@ static int ...@@ -3756,8 +3756,8 @@ static int
e1000_resume(struct pci_dev *pdev) e1000_resume(struct pci_dev *pdev)
{ {
struct net_device *netdev = pci_get_drvdata(pdev); struct net_device *netdev = pci_get_drvdata(pdev);
struct e1000_adapter *adapter = netdev->priv;
uint32_t manc, ret, swsm; uint32_t manc, ret, swsm;
struct e1000_adapter *adapter = netdev_priv(netdev);
pci_set_power_state(pdev, 0); pci_set_power_state(pdev, 0);
pci_restore_state(pdev); pci_restore_state(pdev);
...@@ -3804,7 +3804,7 @@ e1000_resume(struct pci_dev *pdev) ...@@ -3804,7 +3804,7 @@ e1000_resume(struct pci_dev *pdev)
static void static void
e1000_netpoll(struct net_device *netdev) e1000_netpoll(struct net_device *netdev)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev_priv(netdev);
disable_irq(adapter->pdev->irq); disable_irq(adapter->pdev->irq);
e1000_intr(adapter->pdev->irq, netdev, NULL); e1000_intr(adapter->pdev->irq, netdev, NULL);
enable_irq(adapter->pdev->irq); enable_irq(adapter->pdev->irq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment