提交 f1608f85 编写于 作者: S Stephen Hemminger 提交者: David S. Miller

tms380tr: convert to net_device_ops

Conver this related group of drivers to new API
Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 efda0723
...@@ -92,6 +92,8 @@ static void abyss_sifwritew(struct net_device *dev, unsigned short val, unsigned ...@@ -92,6 +92,8 @@ static void abyss_sifwritew(struct net_device *dev, unsigned short val, unsigned
outw(val, dev->base_addr + reg); outw(val, dev->base_addr + reg);
} }
static struct net_device_ops abyss_netdev_ops;
static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_id *ent) static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int versionprinted; static int versionprinted;
...@@ -157,8 +159,7 @@ static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_ ...@@ -157,8 +159,7 @@ static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_
memcpy(tp->ProductID, "Madge PCI 16/4 Mk2", PROD_ID_SIZE + 1); memcpy(tp->ProductID, "Madge PCI 16/4 Mk2", PROD_ID_SIZE + 1);
dev->open = abyss_open; dev->netdev_ops = &abyss_netdev_ops;
dev->stop = abyss_close;
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
SET_NETDEV_DEV(dev, &pdev->dev); SET_NETDEV_DEV(dev, &pdev->dev);
...@@ -450,6 +451,11 @@ static struct pci_driver abyss_driver = { ...@@ -450,6 +451,11 @@ static struct pci_driver abyss_driver = {
static int __init abyss_init (void) static int __init abyss_init (void)
{ {
abyss_netdev_ops = tms380tr_netdev_ops;
abyss_netdev_ops.ndo_open = abyss_open;
abyss_netdev_ops.ndo_stop = abyss_close;
return pci_register_driver(&abyss_driver); return pci_register_driver(&abyss_driver);
} }
......
...@@ -2330,6 +2330,17 @@ void tmsdev_term(struct net_device *dev) ...@@ -2330,6 +2330,17 @@ void tmsdev_term(struct net_device *dev)
DMA_BIDIRECTIONAL); DMA_BIDIRECTIONAL);
} }
const struct net_device_ops tms380tr_netdev_ops = {
.ndo_open = tms380tr_open,
.ndo_stop = tms380tr_close,
.ndo_start_xmit = tms380tr_send_packet,
.ndo_tx_timeout = tms380tr_timeout,
.ndo_get_stats = tms380tr_get_stats,
.ndo_set_multicast_list = tms380tr_set_multicast_list,
.ndo_set_mac_address = tms380tr_set_mac_address,
};
EXPORT_SYMBOL(tms380tr_netdev_ops);
int tmsdev_init(struct net_device *dev, struct device *pdev) int tmsdev_init(struct net_device *dev, struct device *pdev)
{ {
struct net_local *tms_local; struct net_local *tms_local;
...@@ -2353,16 +2364,8 @@ int tmsdev_init(struct net_device *dev, struct device *pdev) ...@@ -2353,16 +2364,8 @@ int tmsdev_init(struct net_device *dev, struct device *pdev)
return -ENOMEM; return -ENOMEM;
} }
/* These can be overridden by the card driver if needed */ dev->netdev_ops = &tms380tr_netdev_ops;
dev->open = tms380tr_open;
dev->stop = tms380tr_close;
dev->do_ioctl = NULL;
dev->hard_start_xmit = tms380tr_send_packet;
dev->tx_timeout = tms380tr_timeout;
dev->watchdog_timeo = HZ; dev->watchdog_timeo = HZ;
dev->get_stats = tms380tr_get_stats;
dev->set_multicast_list = &tms380tr_set_multicast_list;
dev->set_mac_address = tms380tr_set_mac_address;
return 0; return 0;
} }
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
/* module prototypes */ /* module prototypes */
extern const struct net_device_ops tms380tr_netdev_ops;
int tms380tr_open(struct net_device *dev); int tms380tr_open(struct net_device *dev);
int tms380tr_close(struct net_device *dev); int tms380tr_close(struct net_device *dev);
irqreturn_t tms380tr_interrupt(int irq, void *dev_id); irqreturn_t tms380tr_interrupt(int irq, void *dev_id);
......
...@@ -157,8 +157,8 @@ static int __devinit tms_pci_attach(struct pci_dev *pdev, const struct pci_devic ...@@ -157,8 +157,8 @@ static int __devinit tms_pci_attach(struct pci_dev *pdev, const struct pci_devic
tp->tmspriv = cardinfo; tp->tmspriv = cardinfo;
dev->open = tms380tr_open; dev->netdev_ops = &tms380tr_netdev_ops;
dev->stop = tms380tr_close;
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
SET_NETDEV_DEV(dev, &pdev->dev); SET_NETDEV_DEV(dev, &pdev->dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册