diff options
Diffstat (limited to 'net/rose/rose_dev.c')
-rw-r--r-- | net/rose/rose_dev.c | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/net/rose/rose_dev.c b/net/rose/rose_dev.c index ed3599a93..88f2d55e7 100644 --- a/net/rose/rose_dev.c +++ b/net/rose/rose_dev.c @@ -57,7 +57,7 @@ int rose_rx_ip(struct sk_buff *skb, struct net_device *dev) struct net_device_stats *stats = (struct net_device_stats *)dev->priv; #ifdef CONFIG_INET - if (!dev->start) { + if (!netif_running(dev)) { stats->rx_errors++; return 0; } @@ -145,25 +145,17 @@ static int rose_set_mac_address(struct net_device *dev, void *addr) static int rose_open(struct net_device *dev) { - dev->tbusy = 0; - dev->start = 1; - MOD_INC_USE_COUNT; - + netif_start_queue(dev); rose_add_loopback_node((rose_address *)dev->dev_addr); - return 0; } static int rose_close(struct net_device *dev) { - dev->tbusy = 1; - dev->start = 0; - - MOD_DEC_USE_COUNT; - + netif_stop_queue(dev); rose_del_loopback_node((rose_address *)dev->dev_addr); - + MOD_DEC_USE_COUNT; return 0; } @@ -171,34 +163,12 @@ static int rose_xmit(struct sk_buff *skb, struct net_device *dev) { struct net_device_stats *stats = (struct net_device_stats *)dev->priv; - if (skb == NULL || dev == NULL) - return 0; - - if (!dev->start) { + if (!netif_running(dev)) { printk(KERN_ERR "ROSE: rose_xmit - called when iface is down\n"); return 1; } - - cli(); - - if (dev->tbusy != 0) { - sti(); - stats->tx_errors++; - return 1; - } - - dev->tbusy = 1; - - sti(); - - kfree_skb(skb); - + dev_kfree_skb(skb); stats->tx_errors++; - - dev->tbusy = 0; - - mark_bh(NET_BH); - return 0; } @@ -210,7 +180,6 @@ static struct net_device_stats *rose_get_stats(struct net_device *dev) int rose_init(struct net_device *dev) { dev->mtu = ROSE_MAX_PACKET_SIZE - 2; - dev->tbusy = 0; dev->hard_start_xmit = rose_xmit; dev->open = rose_open; dev->stop = rose_close; |