patch-2.3.45 linux/net/rose/rose_dev.c

Next file: linux/net/wanrouter/wanmain.c
Previous file: linux/net/netsyms.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.44/linux/net/rose/rose_dev.c linux/net/rose/rose_dev.c
@@ -57,7 +57,7 @@
 	struct net_device_stats *stats = (struct net_device_stats *)dev->priv;
 
 #ifdef CONFIG_INET
-	if (!dev->start) {
+	if (!test_bit(LINK_STATE_START, &dev->state)) {
 		stats->rx_errors++;
 		return 0;
 	}
@@ -145,25 +145,17 @@
 
 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 @@
 {
 	struct net_device_stats *stats = (struct net_device_stats *)dev->priv;
 
-	if (skb == NULL || dev == NULL)
-		return 0;
-
-	if (!dev->start) {
+	if (!test_bit(LINK_STATE_START, &dev->state)) {
 		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 @@
 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;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)