Commit f1608f859a3fba95a3b0ae70f2528b81c6928d77
Committed by
David S. Miller
1 parent
efda072393
Exists in
master
and in
7 other branches
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>
Showing 4 changed files with 23 additions and 13 deletions Side-by-side Diff
drivers/net/tokenring/abyss.c
... | ... | @@ -92,6 +92,8 @@ |
92 | 92 | outw(val, dev->base_addr + reg); |
93 | 93 | } |
94 | 94 | |
95 | +static struct net_device_ops abyss_netdev_ops; | |
96 | + | |
95 | 97 | static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_id *ent) |
96 | 98 | { |
97 | 99 | static int versionprinted; |
... | ... | @@ -157,8 +159,7 @@ |
157 | 159 | |
158 | 160 | memcpy(tp->ProductID, "Madge PCI 16/4 Mk2", PROD_ID_SIZE + 1); |
159 | 161 | |
160 | - dev->open = abyss_open; | |
161 | - dev->stop = abyss_close; | |
162 | + dev->netdev_ops = &abyss_netdev_ops; | |
162 | 163 | |
163 | 164 | pci_set_drvdata(pdev, dev); |
164 | 165 | SET_NETDEV_DEV(dev, &pdev->dev); |
... | ... | @@ -450,6 +451,11 @@ |
450 | 451 | |
451 | 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 | 459 | return pci_register_driver(&abyss_driver); |
454 | 460 | } |
455 | 461 |
drivers/net/tokenring/tms380tr.c
... | ... | @@ -2330,6 +2330,17 @@ |
2330 | 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 | 2344 | int tmsdev_init(struct net_device *dev, struct device *pdev) |
2334 | 2345 | { |
2335 | 2346 | struct net_local *tms_local; |
2336 | 2347 | |
... | ... | @@ -2353,16 +2364,8 @@ |
2353 | 2364 | return -ENOMEM; |
2354 | 2365 | } |
2355 | 2366 | |
2356 | - /* These can be overridden by the card driver if needed */ | |
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; | |
2367 | + dev->netdev_ops = &tms380tr_netdev_ops; | |
2362 | 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 | 2370 | return 0; |
2368 | 2371 | } |
drivers/net/tokenring/tms380tr.h
... | ... | @@ -14,6 +14,7 @@ |
14 | 14 | #include <linux/interrupt.h> |
15 | 15 | |
16 | 16 | /* module prototypes */ |
17 | +extern const struct net_device_ops tms380tr_netdev_ops; | |
17 | 18 | int tms380tr_open(struct net_device *dev); |
18 | 19 | int tms380tr_close(struct net_device *dev); |
19 | 20 | irqreturn_t tms380tr_interrupt(int irq, void *dev_id); |
drivers/net/tokenring/tmspci.c