aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-03-20 15:36:16 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-22 01:38:00 -0400
commitd9b06c47a9eddef7d8829f6763bdf601c435c6f2 (patch)
tree2fa22d642f7974fa89651b1cc8fdf94b56788b93 /drivers/net/wan
parent49e8abaf62dc6403f11313e8fefbc0f5e7a9f50f (diff)
cycx: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan')
-rw-r--r--drivers/net/wan/cycx_x25.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/drivers/net/wan/cycx_x25.c b/drivers/net/wan/cycx_x25.c
index 5fa52923efa8..35dea3bea95d 100644
--- a/drivers/net/wan/cycx_x25.c
+++ b/drivers/net/wan/cycx_x25.c
@@ -355,12 +355,6 @@ static int cycx_wan_update(struct wan_device *wandev)
355 return 0; 355 return 0;
356} 356}
357 357
358/* callback to initialize device */
359static void cycx_x25_chan_setup(struct net_device *dev)
360{
361 dev->init = cycx_netdevice_init;
362}
363
364/* Create new logical channel. 358/* Create new logical channel.
365 * This routine is called by the router when ROUTER_IFNEW IOCTL is being 359 * This routine is called by the router when ROUTER_IFNEW IOCTL is being
366 * handled. 360 * handled.
@@ -476,6 +470,27 @@ static const struct header_ops cycx_header_ops = {
476 .rebuild = cycx_netdevice_rebuild_header, 470 .rebuild = cycx_netdevice_rebuild_header,
477}; 471};
478 472
473static const struct net_device_ops cycx_netdev_ops = {
474 .ndo_init = cycx_netdevice_init,
475 .ndo_open = cycx_netdevice_open,
476 .ndo_stop = cycx_netdevice_stop,
477 .ndo_start_xmit = cycx_netdevice_hard_start_xmit,
478 .ndo_get_stats = cycx_netdevice_get_stats,
479};
480
481static void cycx_x25_chan_setup(struct net_device *dev)
482{
483 /* Initialize device driver entry points */
484 dev->netdev_ops = &cycx_netdev_ops;
485 dev->header_ops = &cycx_header_ops;
486
487 /* Initialize media-specific parameters */
488 dev->mtu = CYCX_X25_CHAN_MTU;
489 dev->type = ARPHRD_HWX25; /* ARP h/w type */
490 dev->hard_header_len = 0; /* media header length */
491 dev->addr_len = 0; /* hardware address length */
492}
493
479/* Initialize Linux network interface. 494/* Initialize Linux network interface.
480 * 495 *
481 * This routine is called only once for each interface, during Linux network 496 * This routine is called only once for each interface, during Linux network
@@ -487,20 +502,6 @@ static int cycx_netdevice_init(struct net_device *dev)
487 struct cycx_device *card = chan->card; 502 struct cycx_device *card = chan->card;
488 struct wan_device *wandev = &card->wandev; 503 struct wan_device *wandev = &card->wandev;
489 504
490 /* Initialize device driver entry points */
491 dev->open = cycx_netdevice_open;
492 dev->stop = cycx_netdevice_stop;
493 dev->header_ops = &cycx_header_ops;
494
495 dev->hard_start_xmit = cycx_netdevice_hard_start_xmit;
496 dev->get_stats = cycx_netdevice_get_stats;
497
498 /* Initialize media-specific parameters */
499 dev->mtu = CYCX_X25_CHAN_MTU;
500 dev->type = ARPHRD_HWX25; /* ARP h/w type */
501 dev->hard_header_len = 0; /* media header length */
502 dev->addr_len = 0; /* hardware address length */
503
504 if (!chan->svc) 505 if (!chan->svc)
505 *(__be16*)dev->dev_addr = htons(chan->lcn); 506 *(__be16*)dev->dev_addr = htons(chan->lcn);
506 507