[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>
This commit is contained in:
Malli Chilakala 2005-08-11 13:58:40 -07:00 committed by Jeff Garzik
parent 51b54b512c
commit 8908c6cd1d
2 changed files with 32 additions and 30 deletions

View File

@ -98,7 +98,7 @@ static struct ixgb_stats ixgb_gstrings_stats[] = {
static int static int
ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
ecmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE); ecmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);
ecmd->advertising = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE); ecmd->advertising = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);
@ -120,7 +120,7 @@ ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
static int static int
ixgb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) ixgb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
if(ecmd->autoneg == AUTONEG_ENABLE || if(ecmd->autoneg == AUTONEG_ENABLE ||
ecmd->speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL) ecmd->speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL)
@ -146,7 +146,7 @@ static void
ixgb_get_pauseparam(struct net_device *netdev, ixgb_get_pauseparam(struct net_device *netdev,
struct ethtool_pauseparam *pause) struct ethtool_pauseparam *pause)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
struct ixgb_hw *hw = &adapter->hw; struct ixgb_hw *hw = &adapter->hw;
pause->autoneg = AUTONEG_DISABLE; pause->autoneg = AUTONEG_DISABLE;
@ -165,7 +165,7 @@ static int
ixgb_set_pauseparam(struct net_device *netdev, ixgb_set_pauseparam(struct net_device *netdev,
struct ethtool_pauseparam *pause) struct ethtool_pauseparam *pause)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
struct ixgb_hw *hw = &adapter->hw; struct ixgb_hw *hw = &adapter->hw;
if(pause->autoneg == AUTONEG_ENABLE) if(pause->autoneg == AUTONEG_ENABLE)
@ -197,14 +197,16 @@ ixgb_set_pauseparam(struct net_device *netdev,
static uint32_t static uint32_t
ixgb_get_rx_csum(struct net_device *netdev) ixgb_get_rx_csum(struct net_device *netdev)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
return adapter->rx_csum; return adapter->rx_csum;
} }
static int static int
ixgb_set_rx_csum(struct net_device *netdev, uint32_t data) ixgb_set_rx_csum(struct net_device *netdev, uint32_t data)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
adapter->rx_csum = data; adapter->rx_csum = data;
if(netif_running(netdev)) { if(netif_running(netdev)) {
@ -262,7 +264,7 @@ static void
ixgb_get_regs(struct net_device *netdev, ixgb_get_regs(struct net_device *netdev,
struct ethtool_regs *regs, void *p) struct ethtool_regs *regs, void *p)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
struct ixgb_hw *hw = &adapter->hw; struct ixgb_hw *hw = &adapter->hw;
uint32_t *reg = p; uint32_t *reg = p;
uint32_t *reg_start = reg; uint32_t *reg_start = reg;
@ -407,7 +409,7 @@ static int
ixgb_get_eeprom(struct net_device *netdev, ixgb_get_eeprom(struct net_device *netdev,
struct ethtool_eeprom *eeprom, uint8_t *bytes) struct ethtool_eeprom *eeprom, uint8_t *bytes)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
struct ixgb_hw *hw = &adapter->hw; struct ixgb_hw *hw = &adapter->hw;
uint16_t *eeprom_buff; uint16_t *eeprom_buff;
int i, max_len, first_word, last_word; int i, max_len, first_word, last_word;
@ -455,7 +457,7 @@ static int
ixgb_set_eeprom(struct net_device *netdev, ixgb_set_eeprom(struct net_device *netdev,
struct ethtool_eeprom *eeprom, uint8_t *bytes) struct ethtool_eeprom *eeprom, uint8_t *bytes)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
struct ixgb_hw *hw = &adapter->hw; struct ixgb_hw *hw = &adapter->hw;
uint16_t *eeprom_buff; uint16_t *eeprom_buff;
void *ptr; void *ptr;
@ -513,7 +515,7 @@ static void
ixgb_get_drvinfo(struct net_device *netdev, ixgb_get_drvinfo(struct net_device *netdev,
struct ethtool_drvinfo *drvinfo) struct ethtool_drvinfo *drvinfo)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
strncpy(drvinfo->driver, ixgb_driver_name, 32); strncpy(drvinfo->driver, ixgb_driver_name, 32);
strncpy(drvinfo->version, ixgb_driver_version, 32); strncpy(drvinfo->version, ixgb_driver_version, 32);
@ -528,7 +530,7 @@ static void
ixgb_get_ringparam(struct net_device *netdev, ixgb_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring) struct ethtool_ringparam *ring)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
struct ixgb_desc_ring *txdr = &adapter->tx_ring; struct ixgb_desc_ring *txdr = &adapter->tx_ring;
struct ixgb_desc_ring *rxdr = &adapter->rx_ring; struct ixgb_desc_ring *rxdr = &adapter->rx_ring;
@ -546,7 +548,7 @@ static int
ixgb_set_ringparam(struct net_device *netdev, ixgb_set_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring) struct ethtool_ringparam *ring)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
struct ixgb_desc_ring *txdr = &adapter->tx_ring; struct ixgb_desc_ring *txdr = &adapter->tx_ring;
struct ixgb_desc_ring *rxdr = &adapter->rx_ring; struct ixgb_desc_ring *rxdr = &adapter->rx_ring;
struct ixgb_desc_ring tx_old, tx_new, rx_old, rx_new; struct ixgb_desc_ring tx_old, tx_new, rx_old, rx_new;
@ -628,7 +630,7 @@ ixgb_led_blink_callback(unsigned long data)
static int static int
ixgb_phys_id(struct net_device *netdev, uint32_t data) ixgb_phys_id(struct net_device *netdev, uint32_t data)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_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);
@ -664,7 +666,7 @@ static void
ixgb_get_ethtool_stats(struct net_device *netdev, ixgb_get_ethtool_stats(struct net_device *netdev,
struct ethtool_stats *stats, uint64_t *data) struct ethtool_stats *stats, uint64_t *data)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
int i; int i;
ixgb_update_stats(adapter); ixgb_update_stats(adapter);

View File

@ -378,7 +378,7 @@ ixgb_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;
@ -514,7 +514,7 @@ static void __devexit
ixgb_remove(struct pci_dev *pdev) ixgb_remove(struct pci_dev *pdev)
{ {
struct net_device *netdev = pci_get_drvdata(pdev); struct net_device *netdev = pci_get_drvdata(pdev);
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
unregister_netdev(netdev); unregister_netdev(netdev);
@ -585,7 +585,7 @@ ixgb_sw_init(struct ixgb_adapter *adapter)
static int static int
ixgb_open(struct net_device *netdev) ixgb_open(struct net_device *netdev)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
int err; int err;
/* allocate transmit descriptors */ /* allocate transmit descriptors */
@ -628,7 +628,7 @@ err_setup_tx:
static int static int
ixgb_close(struct net_device *netdev) ixgb_close(struct net_device *netdev)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
ixgb_down(adapter, TRUE); ixgb_down(adapter, TRUE);
@ -1019,7 +1019,7 @@ ixgb_clean_rx_ring(struct ixgb_adapter *adapter)
static int static int
ixgb_set_mac(struct net_device *netdev, void *p) ixgb_set_mac(struct net_device *netdev, void *p)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_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))
@ -1045,7 +1045,7 @@ ixgb_set_mac(struct net_device *netdev, void *p)
static void static void
ixgb_set_multi(struct net_device *netdev) ixgb_set_multi(struct net_device *netdev)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
struct ixgb_hw *hw = &adapter->hw; struct ixgb_hw *hw = &adapter->hw;
struct dev_mc_list *mc_ptr; struct dev_mc_list *mc_ptr;
uint32_t rctl; uint32_t rctl;
@ -1373,7 +1373,7 @@ ixgb_tx_queue(struct ixgb_adapter *adapter, int count, int vlan_id,int tx_flags)
static int static int
ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
unsigned int first; unsigned int first;
unsigned int tx_flags = 0; unsigned int tx_flags = 0;
unsigned long flags; unsigned long flags;
@ -1427,7 +1427,7 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
static void static void
ixgb_tx_timeout(struct net_device *netdev) ixgb_tx_timeout(struct net_device *netdev)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_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);
@ -1436,7 +1436,7 @@ ixgb_tx_timeout(struct net_device *netdev)
static void static void
ixgb_tx_timeout_task(struct net_device *netdev) ixgb_tx_timeout_task(struct net_device *netdev)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
ixgb_down(adapter, TRUE); ixgb_down(adapter, TRUE);
ixgb_up(adapter); ixgb_up(adapter);
@ -1453,7 +1453,7 @@ ixgb_tx_timeout_task(struct net_device *netdev)
static struct net_device_stats * static struct net_device_stats *
ixgb_get_stats(struct net_device *netdev) ixgb_get_stats(struct net_device *netdev)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
return &adapter->net_stats; return &adapter->net_stats;
} }
@ -1469,7 +1469,7 @@ ixgb_get_stats(struct net_device *netdev)
static int static int
ixgb_change_mtu(struct net_device *netdev, int new_mtu) ixgb_change_mtu(struct net_device *netdev, int new_mtu)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
int max_frame = new_mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; int max_frame = new_mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH;
int old_max_frame = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; int old_max_frame = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH;
@ -1643,7 +1643,7 @@ static irqreturn_t
ixgb_intr(int irq, void *data, struct pt_regs *regs) ixgb_intr(int irq, void *data, struct pt_regs *regs)
{ {
struct net_device *netdev = data; struct net_device *netdev = data;
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
struct ixgb_hw *hw = &adapter->hw; struct ixgb_hw *hw = &adapter->hw;
uint32_t icr = IXGB_READ_REG(hw, ICR); uint32_t icr = IXGB_READ_REG(hw, ICR);
#ifndef CONFIG_IXGB_NAPI #ifndef CONFIG_IXGB_NAPI
@ -1690,7 +1690,7 @@ ixgb_intr(int irq, void *data, struct pt_regs *regs)
static int static int
ixgb_clean(struct net_device *netdev, int *budget) ixgb_clean(struct net_device *netdev, int *budget)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_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;
@ -2019,7 +2019,7 @@ ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter)
static void static void
ixgb_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) ixgb_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
uint32_t ctrl, rctl; uint32_t ctrl, rctl;
ixgb_irq_disable(adapter); ixgb_irq_disable(adapter);
@ -2057,7 +2057,7 @@ ixgb_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
static void static void
ixgb_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid) ixgb_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
uint32_t vfta, index; uint32_t vfta, index;
/* add VID to filter table */ /* add VID to filter table */
@ -2071,7 +2071,7 @@ ixgb_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid)
static void static void
ixgb_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid) ixgb_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid)
{ {
struct ixgb_adapter *adapter = netdev->priv; struct ixgb_adapter *adapter = netdev_priv(netdev);
uint32_t vfta, index; uint32_t vfta, index;
ixgb_irq_disable(adapter); ixgb_irq_disable(adapter);