summaryrefslogtreecommitdiffstats
path: root/net/atm/mpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/atm/mpc.c')
-rw-r--r--net/atm/mpc.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index 039d5cc..e5bf114 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -286,33 +286,32 @@ static void start_mpc(struct mpoa_client *mpc, struct net_device *dev)
{
dprintk("mpoa: (%s) start_mpc:\n", mpc->dev->name);
- if (dev->hard_start_xmit == NULL) {
- printk("mpoa: (%s) start_mpc: dev->hard_start_xmit == NULL, not starting\n",
- dev->name);
- return;
+ if (!dev->netdev_ops)
+ printk("mpoa: (%s) start_mpc not starting\n", dev->name);
+ else {
+ mpc->old_ops = dev->netdev_ops;
+ mpc->new_ops = *mpc->old_ops;
+ mpc->new_ops.ndo_start_xmit = mpc_send_packet;
+ dev->netdev_ops = &mpc->new_ops;
}
- mpc->old_hard_start_xmit = dev->hard_start_xmit;
- dev->hard_start_xmit = mpc_send_packet;
-
- return;
}
static void stop_mpc(struct mpoa_client *mpc)
{
-
+ struct net_device *dev = mpc->dev;
dprintk("mpoa: (%s) stop_mpc:", mpc->dev->name);
/* Lets not nullify lec device's dev->hard_start_xmit */
- if (mpc->dev->hard_start_xmit != mpc_send_packet) {
+ if (dev->netdev_ops != &mpc->new_ops) {
dprintk(" mpc already stopped, not fatal\n");
return;
}
dprintk("\n");
- mpc->dev->hard_start_xmit = mpc->old_hard_start_xmit;
- mpc->old_hard_start_xmit = NULL;
- /* close_shortcuts(mpc); ??? FIXME */
- return;
+ dev->netdev_ops = mpc->old_ops;
+ mpc->old_ops = NULL;
+
+ /* close_shortcuts(mpc); ??? FIXME */
}
static const char *mpoa_device_type_string(char type) __attribute__ ((unused));
@@ -531,7 +530,6 @@ static int send_via_shortcut(struct sk_buff *skb, struct mpoa_client *mpc)
*/
static int mpc_send_packet(struct sk_buff *skb, struct net_device *dev)
{
- int retval;
struct mpoa_client *mpc;
struct ethhdr *eth;
int i = 0;
@@ -561,9 +559,7 @@ static int mpc_send_packet(struct sk_buff *skb, struct net_device *dev)
}
non_ip:
- retval = mpc->old_hard_start_xmit(skb,dev);
-
- return retval;
+ return mpc->old_ops->ndo_start_xmit(skb,dev);
}
static int atm_mpoa_vcc_attach(struct atm_vcc *vcc, void __user *arg)
OpenPOWER on IntegriCloud