diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2009-01-09 08:01:25 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-21 17:02:30 -0500 |
commit | f1608f859a3fba95a3b0ae70f2528b81c6928d77 (patch) | |
tree | 4cb19e2f821c5c868c21b1e63ba208b21fd6c62a | |
parent | efda072393fb4213e43d92bdd20cf180a06a8eb0 (diff) |
tms380tr: convert to net_device_ops
Conver this related group of drivers to new API
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/tokenring/abyss.c | 10 | ||||
-rw-r--r-- | drivers/net/tokenring/tms380tr.c | 21 | ||||
-rw-r--r-- | drivers/net/tokenring/tms380tr.h | 1 | ||||
-rw-r--r-- | drivers/net/tokenring/tmspci.c | 4 |
4 files changed, 23 insertions, 13 deletions
diff --git a/drivers/net/tokenring/abyss.c b/drivers/net/tokenring/abyss.c index b566d6d79ecd..b9db1b5a58a3 100644 --- a/drivers/net/tokenring/abyss.c +++ b/drivers/net/tokenring/abyss.c | |||
@@ -92,6 +92,8 @@ static void abyss_sifwritew(struct net_device *dev, unsigned short val, unsigned | |||
92 | outw(val, dev->base_addr + reg); | 92 | outw(val, dev->base_addr + reg); |
93 | } | 93 | } |
94 | 94 | ||
95 | static struct net_device_ops abyss_netdev_ops; | ||
96 | |||
95 | static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_id *ent) | 97 | static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_id *ent) |
96 | { | 98 | { |
97 | static int versionprinted; | 99 | static int versionprinted; |
@@ -157,8 +159,7 @@ static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_ | |||
157 | 159 | ||
158 | memcpy(tp->ProductID, "Madge PCI 16/4 Mk2", PROD_ID_SIZE + 1); | 160 | memcpy(tp->ProductID, "Madge PCI 16/4 Mk2", PROD_ID_SIZE + 1); |
159 | 161 | ||
160 | dev->open = abyss_open; | 162 | dev->netdev_ops = &abyss_netdev_ops; |
161 | dev->stop = abyss_close; | ||
162 | 163 | ||
163 | pci_set_drvdata(pdev, dev); | 164 | pci_set_drvdata(pdev, dev); |
164 | SET_NETDEV_DEV(dev, &pdev->dev); | 165 | SET_NETDEV_DEV(dev, &pdev->dev); |
@@ -450,6 +451,11 @@ static struct pci_driver abyss_driver = { | |||
450 | 451 | ||
451 | static int __init abyss_init (void) | 452 | static int __init abyss_init (void) |
452 | { | 453 | { |
454 | abyss_netdev_ops = tms380tr_netdev_ops; | ||
455 | |||
456 | abyss_netdev_ops.ndo_open = abyss_open; | ||
457 | abyss_netdev_ops.ndo_stop = abyss_close; | ||
458 | |||
453 | return pci_register_driver(&abyss_driver); | 459 | return pci_register_driver(&abyss_driver); |
454 | } | 460 | } |
455 | 461 | ||
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c index 5be34c2fd483..b11bb72dc7ab 100644 --- a/drivers/net/tokenring/tms380tr.c +++ b/drivers/net/tokenring/tms380tr.c | |||
@@ -2330,6 +2330,17 @@ void tmsdev_term(struct net_device *dev) | |||
2330 | DMA_BIDIRECTIONAL); | 2330 | DMA_BIDIRECTIONAL); |
2331 | } | 2331 | } |
2332 | 2332 | ||
2333 | const struct net_device_ops tms380tr_netdev_ops = { | ||
2334 | .ndo_open = tms380tr_open, | ||
2335 | .ndo_stop = tms380tr_close, | ||
2336 | .ndo_start_xmit = tms380tr_send_packet, | ||
2337 | .ndo_tx_timeout = tms380tr_timeout, | ||
2338 | .ndo_get_stats = tms380tr_get_stats, | ||
2339 | .ndo_set_multicast_list = tms380tr_set_multicast_list, | ||
2340 | .ndo_set_mac_address = tms380tr_set_mac_address, | ||
2341 | }; | ||
2342 | EXPORT_SYMBOL(tms380tr_netdev_ops); | ||
2343 | |||
2333 | int tmsdev_init(struct net_device *dev, struct device *pdev) | 2344 | int tmsdev_init(struct net_device *dev, struct device *pdev) |
2334 | { | 2345 | { |
2335 | struct net_local *tms_local; | 2346 | struct net_local *tms_local; |
@@ -2353,16 +2364,8 @@ int tmsdev_init(struct net_device *dev, struct device *pdev) | |||
2353 | return -ENOMEM; | 2364 | return -ENOMEM; |
2354 | } | 2365 | } |
2355 | 2366 | ||
2356 | /* These can be overridden by the card driver if needed */ | 2367 | dev->netdev_ops = &tms380tr_netdev_ops; |
2357 | dev->open = tms380tr_open; | ||
2358 | dev->stop = tms380tr_close; | ||
2359 | dev->do_ioctl = NULL; | ||
2360 | dev->hard_start_xmit = tms380tr_send_packet; | ||
2361 | dev->tx_timeout = tms380tr_timeout; | ||
2362 | dev->watchdog_timeo = HZ; | 2368 | dev->watchdog_timeo = HZ; |
2363 | dev->get_stats = tms380tr_get_stats; | ||
2364 | dev->set_multicast_list = &tms380tr_set_multicast_list; | ||
2365 | dev->set_mac_address = tms380tr_set_mac_address; | ||
2366 | 2369 | ||
2367 | return 0; | 2370 | return 0; |
2368 | } | 2371 | } |
diff --git a/drivers/net/tokenring/tms380tr.h b/drivers/net/tokenring/tms380tr.h index 7af76d708849..60b30ee38dcb 100644 --- a/drivers/net/tokenring/tms380tr.h +++ b/drivers/net/tokenring/tms380tr.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
15 | 15 | ||
16 | /* module prototypes */ | 16 | /* module prototypes */ |
17 | extern const struct net_device_ops tms380tr_netdev_ops; | ||
17 | int tms380tr_open(struct net_device *dev); | 18 | int tms380tr_open(struct net_device *dev); |
18 | int tms380tr_close(struct net_device *dev); | 19 | int tms380tr_close(struct net_device *dev); |
19 | irqreturn_t tms380tr_interrupt(int irq, void *dev_id); | 20 | irqreturn_t tms380tr_interrupt(int irq, void *dev_id); |
diff --git a/drivers/net/tokenring/tmspci.c b/drivers/net/tokenring/tmspci.c index 5f601773c260..b397e8785d6d 100644 --- a/drivers/net/tokenring/tmspci.c +++ b/drivers/net/tokenring/tmspci.c | |||
@@ -157,8 +157,8 @@ static int __devinit tms_pci_attach(struct pci_dev *pdev, const struct pci_devic | |||
157 | 157 | ||
158 | tp->tmspriv = cardinfo; | 158 | tp->tmspriv = cardinfo; |
159 | 159 | ||
160 | dev->open = tms380tr_open; | 160 | dev->netdev_ops = &tms380tr_netdev_ops; |
161 | dev->stop = tms380tr_close; | 161 | |
162 | pci_set_drvdata(pdev, dev); | 162 | pci_set_drvdata(pdev, dev); |
163 | SET_NETDEV_DEV(dev, &pdev->dev); | 163 | SET_NETDEV_DEV(dev, &pdev->dev); |
164 | 164 | ||