patch-2.3.44 linux/drivers/net/wan/dlci.c

Next file: linux/drivers/net/wan/hostess_sv11.c
Previous file: linux/drivers/net/tulip.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.43/linux/drivers/net/wan/dlci.c linux/drivers/net/wan/dlci.c
@@ -244,43 +244,34 @@
 	if (!skb || !dev)
 		return(0);
 
-	if (dev->tbusy)
-		return(1);
-
 	dlp = dev->priv;
 
-	if (test_and_set_bit(0, (void*)&dev->tbusy) != 0)
-		printk(KERN_WARNING "%s: transmitter access conflict.\n", dev->name);
-	else
-	{
-		ret = dlp->slave->hard_start_xmit(skb, dlp->slave);
-		switch (ret)
-		{
-			case DLCI_RET_OK:
-				dlp->stats.tx_packets++;
-				ret = 0;
-				break;
-
+	netif_stop_queue(dev);
+	
+	ret = dlp->slave->hard_start_xmit(skb, dlp->slave);
+	switch (ret)
+	{
+		case DLCI_RET_OK:
+			dlp->stats.tx_packets++;
+			ret = 0;
+			break;
 			case DLCI_RET_ERR:
-				dlp->stats.tx_errors++;
-				ret = 0;
-				break;
-
+			dlp->stats.tx_errors++;
+			ret = 0;
+			break;
 			case DLCI_RET_DROP:
-				dlp->stats.tx_dropped++;
-				ret = 1;
-				break;
-		}
-
-		/* Alan Cox recommends always returning 0, and always freeing the packet */
-		/* experience suggest a slightly more conservative approach */
-
-		if (!ret)
-			dev_kfree_skb(skb);
-
-		dev->tbusy = 0;
+			dlp->stats.tx_dropped++;
+			ret = 1;
+			break;
 	}
+	/* Alan Cox recommends always returning 0, and always freeing the packet */
+	/* experience suggest a slightly more conservative approach */
 
+	if (!ret)
+	{
+		dev_kfree_skb(skb);
+		netif_wake_queue(dev);
+	}
 	return(ret);
 }
 
@@ -370,19 +361,16 @@
 	if (!*(short *)(dev->dev_addr))
 		return(-EINVAL);
 
-	if (!dlp->slave->start)
+	if (!test_bit(LINK_STATE_START, &dlp->slave->state))
 		return(-ENOTCONN);
 
-	dev->flags = 0;
-	dev->tbusy = 0;
-	dev->interrupt = 0;
-	dev->start = 1;
-
 	flp = dlp->slave->priv;
 	err = (*flp->activate)(dlp->slave, dev);
 	if (err)
 		return(err);
 
+	netif_start_queue(dev);
+
 	return 0;
 }
 
@@ -392,14 +380,13 @@
 	struct frad_local	*flp;
 	int			err;
 
+	netif_stop_queue(dev);
+
 	dlp = dev->priv;
 
 	flp = dlp->slave->priv;
 	err = (*flp->deactivate)(dlp->slave, dev);
 
-	dev->start = 0;
-	dev->tbusy = 1;
-
 	return 0;
 }
 
@@ -508,7 +495,7 @@
 	if (!master)
 		return(-ENODEV);
 
-	if (master->start)
+	if (test_bit(LINK_STATE_START, &master->state))
 		return(-EBUSY);
 
 	dlp = master->priv;

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