Patchwork Staging: rtl8187se: convert to net_device_ops

login
register
mail settings
Submitter Alexander Beregalov
Date May 9, 2009, 11:06 p.m.
Message ID <1241910414-7389-1-git-send-email-a.beregalov@gmail.com>
Download mbox | patch
Permalink /patch/27032/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Alexander Beregalov - May 9, 2009, 11:06 p.m.
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
---
 drivers/staging/rtl8187se/Kconfig                  |    2 +-
 .../staging/rtl8187se/ieee80211/ieee80211_module.c |    1 -
 drivers/staging/rtl8187se/r8180_core.c             |   25 ++++++++++++--------
 drivers/staging/rtl8187se/r8180_pm.c               |    6 +++-
 4 files changed, 20 insertions(+), 14 deletions(-)
David Miller - May 10, 2009, 5:56 a.m.
From: Alexander Beregalov <a.beregalov@gmail.com>
Date: Sun, 10 May 2009 03:06:54 +0400

> Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>

Thanks for doing this work Alexander.

Acked-by: David S. Miller <davem@davemloft.net>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/staging/rtl8187se/Kconfig b/drivers/staging/rtl8187se/Kconfig
index f636296..236e427 100644
--- a/drivers/staging/rtl8187se/Kconfig
+++ b/drivers/staging/rtl8187se/Kconfig
@@ -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---
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c
index 0c9fef0..c2b61e6 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c
@@ -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;
 
diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c
index e10413c..7e2feca 100644
--- a/drivers/staging/rtl8187se/r8180_core.c
+++ b/drivers/staging/rtl8187se/r8180_core.c
@@ -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
diff --git a/drivers/staging/rtl8187se/r8180_pm.c b/drivers/staging/rtl8187se/r8180_pm.c
index 3851b93..2b3d642 100644
--- a/drivers/staging/rtl8187se/r8180_pm.c
+++ b/drivers/staging/rtl8187se/r8180_pm.c
@@ -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;