aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/via-velocity.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-06-27 08:56:23 -0400
committerJeff Garzik <jeff@garzik.org>2006-07-05 13:40:50 -0400
commit8ab6f3f706f5cb91bc0793afc95c8809837ece05 (patch)
tree2fb858ca0f02d5d0f9e3e04e53557dc5242ae18f /drivers/net/via-velocity.c
parentc3d8e682b7d10f57d13c86ecbb15806781d6e953 (diff)
[netdrvr] via-velocity: use netdev_priv() where appropriate
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/via-velocity.c')
-rw-r--r--drivers/net/via-velocity.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index ba2972ba3757..bbab3972ff86 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -341,7 +341,7 @@ static char __devinit *get_chip_name(enum chip_type chip_id)
341static void __devexit velocity_remove1(struct pci_dev *pdev) 341static void __devexit velocity_remove1(struct pci_dev *pdev)
342{ 342{
343 struct net_device *dev = pci_get_drvdata(pdev); 343 struct net_device *dev = pci_get_drvdata(pdev);
344 struct velocity_info *vptr = dev->priv; 344 struct velocity_info *vptr = netdev_priv(dev);
345 345
346#ifdef CONFIG_PM 346#ifdef CONFIG_PM
347 unsigned long flags; 347 unsigned long flags;
@@ -708,7 +708,7 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
708 708
709 SET_MODULE_OWNER(dev); 709 SET_MODULE_OWNER(dev);
710 SET_NETDEV_DEV(dev, &pdev->dev); 710 SET_NETDEV_DEV(dev, &pdev->dev);
711 vptr = dev->priv; 711 vptr = netdev_priv(dev);
712 712
713 713
714 if (first) { 714 if (first) {
@@ -1728,7 +1728,7 @@ static void velocity_free_tx_buf(struct velocity_info *vptr, struct velocity_td_
1728 1728
1729static int velocity_open(struct net_device *dev) 1729static int velocity_open(struct net_device *dev)
1730{ 1730{
1731 struct velocity_info *vptr = dev->priv; 1731 struct velocity_info *vptr = netdev_priv(dev);
1732 int ret; 1732 int ret;
1733 1733
1734 vptr->rx_buf_sz = (dev->mtu <= 1504 ? PKT_BUF_SZ : dev->mtu + 32); 1734 vptr->rx_buf_sz = (dev->mtu <= 1504 ? PKT_BUF_SZ : dev->mtu + 32);
@@ -1785,7 +1785,7 @@ err_free_desc_rings:
1785 1785
1786static int velocity_change_mtu(struct net_device *dev, int new_mtu) 1786static int velocity_change_mtu(struct net_device *dev, int new_mtu)
1787{ 1787{
1788 struct velocity_info *vptr = dev->priv; 1788 struct velocity_info *vptr = netdev_priv(dev);
1789 unsigned long flags; 1789 unsigned long flags;
1790 int oldmtu = dev->mtu; 1790 int oldmtu = dev->mtu;
1791 int ret = 0; 1791 int ret = 0;
@@ -1861,7 +1861,7 @@ static void velocity_shutdown(struct velocity_info *vptr)
1861 1861
1862static int velocity_close(struct net_device *dev) 1862static int velocity_close(struct net_device *dev)
1863{ 1863{
1864 struct velocity_info *vptr = dev->priv; 1864 struct velocity_info *vptr = netdev_priv(dev);
1865 1865
1866 netif_stop_queue(dev); 1866 netif_stop_queue(dev);
1867 velocity_shutdown(vptr); 1867 velocity_shutdown(vptr);
@@ -1894,7 +1894,7 @@ static int velocity_close(struct net_device *dev)
1894 1894
1895static int velocity_xmit(struct sk_buff *skb, struct net_device *dev) 1895static int velocity_xmit(struct sk_buff *skb, struct net_device *dev)
1896{ 1896{
1897 struct velocity_info *vptr = dev->priv; 1897 struct velocity_info *vptr = netdev_priv(dev);
1898 int qnum = 0; 1898 int qnum = 0;
1899 struct tx_desc *td_ptr; 1899 struct tx_desc *td_ptr;
1900 struct velocity_td_info *tdinfo; 1900 struct velocity_td_info *tdinfo;
@@ -2049,7 +2049,7 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev)
2049static int velocity_intr(int irq, void *dev_instance, struct pt_regs *regs) 2049static int velocity_intr(int irq, void *dev_instance, struct pt_regs *regs)
2050{ 2050{
2051 struct net_device *dev = dev_instance; 2051 struct net_device *dev = dev_instance;
2052 struct velocity_info *vptr = dev->priv; 2052 struct velocity_info *vptr = netdev_priv(dev);
2053 u32 isr_status; 2053 u32 isr_status;
2054 int max_count = 0; 2054 int max_count = 0;
2055 2055
@@ -2104,7 +2104,7 @@ static int velocity_intr(int irq, void *dev_instance, struct pt_regs *regs)
2104 2104
2105static void velocity_set_multi(struct net_device *dev) 2105static void velocity_set_multi(struct net_device *dev)
2106{ 2106{
2107 struct velocity_info *vptr = dev->priv; 2107 struct velocity_info *vptr = netdev_priv(dev);
2108 struct mac_regs __iomem * regs = vptr->mac_regs; 2108 struct mac_regs __iomem * regs = vptr->mac_regs;
2109 u8 rx_mode; 2109 u8 rx_mode;
2110 int i; 2110 int i;
@@ -2153,7 +2153,7 @@ static void velocity_set_multi(struct net_device *dev)
2153 2153
2154static struct net_device_stats *velocity_get_stats(struct net_device *dev) 2154static struct net_device_stats *velocity_get_stats(struct net_device *dev)
2155{ 2155{
2156 struct velocity_info *vptr = dev->priv; 2156 struct velocity_info *vptr = netdev_priv(dev);
2157 2157
2158 /* If the hardware is down, don't touch MII */ 2158 /* If the hardware is down, don't touch MII */
2159 if(!netif_running(dev)) 2159 if(!netif_running(dev))
@@ -2196,7 +2196,7 @@ static struct net_device_stats *velocity_get_stats(struct net_device *dev)
2196 2196
2197static int velocity_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 2197static int velocity_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
2198{ 2198{
2199 struct velocity_info *vptr = dev->priv; 2199 struct velocity_info *vptr = netdev_priv(dev);
2200 int ret; 2200 int ret;
2201 2201
2202 /* If we are asked for information and the device is power 2202 /* If we are asked for information and the device is power
@@ -2825,7 +2825,7 @@ static void enable_flow_control_ability(struct velocity_info *vptr)
2825 2825
2826static int velocity_ethtool_up(struct net_device *dev) 2826static int velocity_ethtool_up(struct net_device *dev)
2827{ 2827{
2828 struct velocity_info *vptr = dev->priv; 2828 struct velocity_info *vptr = netdev_priv(dev);
2829 if (!netif_running(dev)) 2829 if (!netif_running(dev))
2830 pci_set_power_state(vptr->pdev, PCI_D0); 2830 pci_set_power_state(vptr->pdev, PCI_D0);
2831 return 0; 2831 return 0;
@@ -2841,14 +2841,14 @@ static int velocity_ethtool_up(struct net_device *dev)
2841 2841
2842static void velocity_ethtool_down(struct net_device *dev) 2842static void velocity_ethtool_down(struct net_device *dev)
2843{ 2843{
2844 struct velocity_info *vptr = dev->priv; 2844 struct velocity_info *vptr = netdev_priv(dev);
2845 if (!netif_running(dev)) 2845 if (!netif_running(dev))
2846 pci_set_power_state(vptr->pdev, PCI_D3hot); 2846 pci_set_power_state(vptr->pdev, PCI_D3hot);
2847} 2847}
2848 2848
2849static int velocity_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) 2849static int velocity_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
2850{ 2850{
2851 struct velocity_info *vptr = dev->priv; 2851 struct velocity_info *vptr = netdev_priv(dev);
2852 struct mac_regs __iomem * regs = vptr->mac_regs; 2852 struct mac_regs __iomem * regs = vptr->mac_regs;
2853 u32 status; 2853 u32 status;
2854 status = check_connection_type(vptr->mac_regs); 2854 status = check_connection_type(vptr->mac_regs);
@@ -2873,7 +2873,7 @@ static int velocity_get_settings(struct net_device *dev, struct ethtool_cmd *cmd
2873 2873
2874static int velocity_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) 2874static int velocity_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
2875{ 2875{
2876 struct velocity_info *vptr = dev->priv; 2876 struct velocity_info *vptr = netdev_priv(dev);
2877 u32 curr_status; 2877 u32 curr_status;
2878 u32 new_status = 0; 2878 u32 new_status = 0;
2879 int ret = 0; 2879 int ret = 0;
@@ -2896,14 +2896,14 @@ static int velocity_set_settings(struct net_device *dev, struct ethtool_cmd *cmd
2896 2896
2897static u32 velocity_get_link(struct net_device *dev) 2897static u32 velocity_get_link(struct net_device *dev)
2898{ 2898{
2899 struct velocity_info *vptr = dev->priv; 2899 struct velocity_info *vptr = netdev_priv(dev);
2900 struct mac_regs __iomem * regs = vptr->mac_regs; 2900 struct mac_regs __iomem * regs = vptr->mac_regs;
2901 return BYTE_REG_BITS_IS_ON(PHYSR0_LINKGD, &regs->PHYSR0) ? 0 : 1; 2901 return BYTE_REG_BITS_IS_ON(PHYSR0_LINKGD, &regs->PHYSR0) ? 0 : 1;
2902} 2902}
2903 2903
2904static void velocity_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) 2904static void velocity_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
2905{ 2905{
2906 struct velocity_info *vptr = dev->priv; 2906 struct velocity_info *vptr = netdev_priv(dev);
2907 strcpy(info->driver, VELOCITY_NAME); 2907 strcpy(info->driver, VELOCITY_NAME);
2908 strcpy(info->version, VELOCITY_VERSION); 2908 strcpy(info->version, VELOCITY_VERSION);
2909 strcpy(info->bus_info, pci_name(vptr->pdev)); 2909 strcpy(info->bus_info, pci_name(vptr->pdev));
@@ -2911,7 +2911,7 @@ static void velocity_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo
2911 2911
2912static void velocity_ethtool_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) 2912static void velocity_ethtool_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
2913{ 2913{
2914 struct velocity_info *vptr = dev->priv; 2914 struct velocity_info *vptr = netdev_priv(dev);
2915 wol->supported = WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_ARP; 2915 wol->supported = WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_ARP;
2916 wol->wolopts |= WAKE_MAGIC; 2916 wol->wolopts |= WAKE_MAGIC;
2917 /* 2917 /*
@@ -2927,7 +2927,7 @@ static void velocity_ethtool_get_wol(struct net_device *dev, struct ethtool_woli
2927 2927
2928static int velocity_ethtool_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) 2928static int velocity_ethtool_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
2929{ 2929{
2930 struct velocity_info *vptr = dev->priv; 2930 struct velocity_info *vptr = netdev_priv(dev);
2931 2931
2932 if (!(wol->wolopts & (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_ARP))) 2932 if (!(wol->wolopts & (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_ARP)))
2933 return -EFAULT; 2933 return -EFAULT;
@@ -2992,7 +2992,7 @@ static struct ethtool_ops velocity_ethtool_ops = {
2992 2992
2993static int velocity_mii_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 2993static int velocity_mii_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
2994{ 2994{
2995 struct velocity_info *vptr = dev->priv; 2995 struct velocity_info *vptr = netdev_priv(dev);
2996 struct mac_regs __iomem * regs = vptr->mac_regs; 2996 struct mac_regs __iomem * regs = vptr->mac_regs;
2997 unsigned long flags; 2997 unsigned long flags;
2998 struct mii_ioctl_data *miidata = if_mii(ifr); 2998 struct mii_ioctl_data *miidata = if_mii(ifr);