diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-11-21 20:39:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-21 20:39:02 -0500 |
commit | 4e4fd4e485ad63a9074ff09a9b53ffc7a5c594ec (patch) | |
tree | 4d6b86da5dfd81dcd26081bfeda723a440cad919 /drivers/net/ne2k-pci.c | |
parent | 99921b7e64f7726e7134046f8e1e8004e2711f30 (diff) |
ne2k: convert to net_device_ops
Convert driver to new net_device_ops. Compile tested only.
This required some additional work to export common code ei_XXX.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ne2k-pci.c')
-rw-r--r-- | drivers/net/ne2k-pci.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c index ea22ae268a5d..62f20ba211cb 100644 --- a/drivers/net/ne2k-pci.c +++ b/drivers/net/ne2k-pci.c | |||
@@ -200,6 +200,19 @@ struct ne2k_pci_card { | |||
200 | in the 'dev' and 'ei_status' structures. | 200 | in the 'dev' and 'ei_status' structures. |
201 | */ | 201 | */ |
202 | 202 | ||
203 | static const struct net_device_ops ne2k_netdev_ops = { | ||
204 | .ndo_open = ne2k_pci_open, | ||
205 | .ndo_stop = ne2k_pci_close, | ||
206 | .ndo_start_xmit = ei_start_xmit, | ||
207 | .ndo_tx_timeout = ei_tx_timeout, | ||
208 | .ndo_get_stats = ei_get_stats, | ||
209 | .ndo_set_multicast_list = ei_set_multicast_list, | ||
210 | .ndo_validate_addr = eth_validate_addr, | ||
211 | .ndo_change_mtu = eth_change_mtu, | ||
212 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
213 | .ndo_poll_controller = ei_poll, | ||
214 | #endif | ||
215 | }; | ||
203 | 216 | ||
204 | static int __devinit ne2k_pci_init_one (struct pci_dev *pdev, | 217 | static int __devinit ne2k_pci_init_one (struct pci_dev *pdev, |
205 | const struct pci_device_id *ent) | 218 | const struct pci_device_id *ent) |
@@ -265,6 +278,8 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev, | |||
265 | dev_err(&pdev->dev, "cannot allocate ethernet device\n"); | 278 | dev_err(&pdev->dev, "cannot allocate ethernet device\n"); |
266 | goto err_out_free_res; | 279 | goto err_out_free_res; |
267 | } | 280 | } |
281 | dev->netdev_ops = &ne2k_netdev_ops; | ||
282 | |||
268 | SET_NETDEV_DEV(dev, &pdev->dev); | 283 | SET_NETDEV_DEV(dev, &pdev->dev); |
269 | 284 | ||
270 | /* Reset card. Who knows what dain-bramaged state it was left in. */ | 285 | /* Reset card. Who knows what dain-bramaged state it was left in. */ |
@@ -353,12 +368,8 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev, | |||
353 | ei_status.block_output = &ne2k_pci_block_output; | 368 | ei_status.block_output = &ne2k_pci_block_output; |
354 | ei_status.get_8390_hdr = &ne2k_pci_get_8390_hdr; | 369 | ei_status.get_8390_hdr = &ne2k_pci_get_8390_hdr; |
355 | ei_status.priv = (unsigned long) pdev; | 370 | ei_status.priv = (unsigned long) pdev; |
356 | dev->open = &ne2k_pci_open; | 371 | |
357 | dev->stop = &ne2k_pci_close; | ||
358 | dev->ethtool_ops = &ne2k_pci_ethtool_ops; | 372 | dev->ethtool_ops = &ne2k_pci_ethtool_ops; |
359 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
360 | dev->poll_controller = ei_poll; | ||
361 | #endif | ||
362 | NS8390_init(dev, 0); | 373 | NS8390_init(dev, 0); |
363 | 374 | ||
364 | i = register_netdev(dev); | 375 | i = register_netdev(dev); |