diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-03-30 14:04:53 +1100 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-03-30 14:04:53 +1100 |
commit | 9ff9a26b786c35ee8d2a66222924a807ec851a9f (patch) | |
tree | db432a17bccca1ca2c16907f0ee83ac449ed4012 /drivers/net/wan/cycx_x25.c | |
parent | 0a3108beea9143225119d5e7c72a8e2c64f3eb7d (diff) | |
parent | 0d34fb8e93ceba7b6dad0062dbb4a0813bacd75b (diff) |
Merge commit 'origin/master' into next
Manual merge of:
arch/powerpc/include/asm/elf.h
drivers/i2c/busses/i2c-mpc.c
Diffstat (limited to 'drivers/net/wan/cycx_x25.c')
-rw-r--r-- | drivers/net/wan/cycx_x25.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/drivers/net/wan/cycx_x25.c b/drivers/net/wan/cycx_x25.c index 5fa52923efa..35dea3bea95 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) return 0; } -/* callback to initialize device */ -static void cycx_x25_chan_setup(struct net_device *dev) -{ - dev->init = cycx_netdevice_init; -} - /* Create new logical channel. * This routine is called by the router when ROUTER_IFNEW IOCTL is being * handled. @@ -476,6 +470,27 @@ static const struct header_ops cycx_header_ops = { .rebuild = cycx_netdevice_rebuild_header, }; +static const struct net_device_ops cycx_netdev_ops = { + .ndo_init = cycx_netdevice_init, + .ndo_open = cycx_netdevice_open, + .ndo_stop = cycx_netdevice_stop, + .ndo_start_xmit = cycx_netdevice_hard_start_xmit, + .ndo_get_stats = cycx_netdevice_get_stats, +}; + +static void cycx_x25_chan_setup(struct net_device *dev) +{ + /* Initialize device driver entry points */ + dev->netdev_ops = &cycx_netdev_ops; + dev->header_ops = &cycx_header_ops; + + /* Initialize media-specific parameters */ + dev->mtu = CYCX_X25_CHAN_MTU; + dev->type = ARPHRD_HWX25; /* ARP h/w type */ + dev->hard_header_len = 0; /* media header length */ + dev->addr_len = 0; /* hardware address length */ +} + /* Initialize Linux network interface. * * 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) struct cycx_device *card = chan->card; struct wan_device *wandev = &card->wandev; - /* Initialize device driver entry points */ - dev->open = cycx_netdevice_open; - dev->stop = cycx_netdevice_stop; - dev->header_ops = &cycx_header_ops; - - dev->hard_start_xmit = cycx_netdevice_hard_start_xmit; - dev->get_stats = cycx_netdevice_get_stats; - - /* Initialize media-specific parameters */ - dev->mtu = CYCX_X25_CHAN_MTU; - dev->type = ARPHRD_HWX25; /* ARP h/w type */ - dev->hard_header_len = 0; /* media header length */ - dev->addr_len = 0; /* hardware address length */ - if (!chan->svc) *(__be16*)dev->dev_addr = htons(chan->lcn); |