Staging: rtl8187se: convert to net_device_ops
authorAlexander Beregalov <a.beregalov@gmail.com>
Sat, 9 May 2009 23:06:54 +0000 (03:06 +0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 19 Jun 2009 18:00:36 +0000 (11:00 -0700)
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/rtl8187se/Kconfig
drivers/staging/rtl8187se/ieee80211/ieee80211_module.c
drivers/staging/rtl8187se/r8180_core.c
drivers/staging/rtl8187se/r8180_pm.c

index f636296b54bc7fd7d809755682ecf844e0aa5f2e..236e42725447a49c395264a884737af921f22bb0 100644 (file)
@@ -1,6 +1,6 @@
 config RTL8187SE
        tristate "RealTek RTL8187SE Wireless LAN NIC driver"
        depends on PCI
-       depends on WIRELESS_EXT && COMPAT_NET_DEV_OPS
+       depends on WIRELESS_EXT
        default N
        ---help---
index 0c9fef0b4e3faed4814118ec5b299d37bb394120..c2b61e648e4e36281df9b91db645658bd3700c2d 100644 (file)
@@ -114,7 +114,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
                goto failed;
        }
        ieee = netdev_priv(dev);
-       dev->hard_start_xmit = ieee80211_xmit;
 
        ieee->dev = dev;
 
index e10413cee0dfcd31acf7fb760026ebf9170d1d3c..7e2fecae813c066b44ac01c1f1f4f2c7f05fa9d9 100644 (file)
@@ -198,7 +198,8 @@ static void __devexit rtl8180_pci_remove(struct pci_dev *pdev);
 static void rtl8180_shutdown (struct pci_dev *pdev)
 {
        struct net_device *dev = pci_get_drvdata(pdev);
-       dev->stop(dev);
+       if (dev->netdev_ops->ndo_stop)
+               dev->netdev_ops->ndo_stop(dev);
        pci_disable_device(pdev);
 }
 
@@ -4551,8 +4552,6 @@ short rtl8180_init(struct net_device *dev)
                //DMESG("Reported EEPROM chip is a 93c46 (1Kbit)");
        }
 
-       dev->get_stats = rtl8180_stats;
-
        dev->dev_addr[0]=eprom_read(dev,MAC_ADR) & 0xff;
        dev->dev_addr[1]=(eprom_read(dev,MAC_ADR) & 0xff00)>>8;
        dev->dev_addr[2]=eprom_read(dev,MAC_ADR+1) & 0xff;
@@ -5832,6 +5831,18 @@ int rtl8180_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
      -----------------------------PCI STUFF---------------------------
 *****************************************************************************/
 
+static const struct net_device_ops rtl8180_netdev_ops = {
+       .ndo_open               = rtl8180_open,
+       .ndo_stop               = rtl8180_close,
+       .ndo_get_stats          = rtl8180_stats,
+       .ndo_tx_timeout         = rtl8180_restart,
+       .ndo_do_ioctl           = rtl8180_ioctl,
+       .ndo_set_multicast_list = r8180_set_multicast,
+       .ndo_set_mac_address    = r8180_set_mac_adr,
+       .ndo_validate_addr      = eth_validate_addr,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_start_xmit         = ieee80211_xmit,
+};
 
 static int __devinit rtl8180_pci_probe(struct pci_dev *pdev,
                                       const struct pci_device_id *id)
@@ -5936,14 +5947,8 @@ static int __devinit rtl8180_pci_probe(struct pci_dev *pdev,
        dev->irq = pdev->irq;
        priv->irq = 0;
 
-       dev->open = rtl8180_open;
-       dev->stop = rtl8180_close;
-       //dev->hard_start_xmit = ieee80211_xmit;
-       dev->tx_timeout = rtl8180_restart;
+       dev->netdev_ops = &rtl8180_netdev_ops;
        dev->wireless_handlers = &r8180_wx_handlers_def;
-       dev->do_ioctl = rtl8180_ioctl;
-       dev->set_multicast_list = r8180_set_multicast;
-       dev->set_mac_address = r8180_set_mac_adr;
 
 #if WIRELESS_EXT >= 12
 #if WIRELESS_EXT < 17
index 3851b936835680cb827581e551798377f2c460a1..2b3d642db77f6442c41872836ddb5d4a7a022ec4 100644 (file)
@@ -30,7 +30,8 @@ int rtl8180_suspend (struct pci_dev *pdev, pm_message_t state)
        if (!netif_running(dev))
                goto out_pci_suspend;
 
-       dev->stop(dev);
+       if (dev->netdev_ops->ndo_stop)
+               dev->netdev_ops->ndo_stop(dev);
 
        netif_device_detach(dev);
 
@@ -71,7 +72,8 @@ int rtl8180_resume (struct pci_dev *pdev)
        if(!netif_running(dev))
                goto out;
 
-       dev->open(dev);
+       if (dev->netdev_ops->ndo_open)
+               dev->netdev_ops->ndo_open(dev);
        netif_device_attach(dev);
 out:
        return 0;