aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorPieter Dejaeghere <pieter@dejaeghere.net>2005-09-06 22:54:48 -0400
committerDavid S. Miller <davem@davemloft.net>2005-09-06 22:54:48 -0400
commitc6bb15a0c485fbdd3d161da54fd29f4f15e1b070 (patch)
treeb52bf3613cead1f9e209c2bb20a27caee4d497aa /drivers/net
parent0a3f4358ac6283fe3a565183eaf9716de28b6fd0 (diff)
[ARCNET]: Fix return value from arcnet_send_packet().
From: Pieter Dejaeghere <pieter@dejaeghere.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/arcnet/arcnet.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c
index 4f9f69e22c1b..12ef52c193a3 100644
--- a/drivers/net/arcnet/arcnet.c
+++ b/drivers/net/arcnet/arcnet.c
@@ -597,7 +597,7 @@ static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
597 struct ArcProto *proto; 597 struct ArcProto *proto;
598 int txbuf; 598 int txbuf;
599 unsigned long flags; 599 unsigned long flags;
600 int freeskb = 0; 600 int freeskb, retval;
601 601
602 BUGMSG(D_DURING, 602 BUGMSG(D_DURING,
603 "transmit requested (status=%Xh, txbufs=%d/%d, len=%d, protocol %x)\n", 603 "transmit requested (status=%Xh, txbufs=%d/%d, len=%d, protocol %x)\n",
@@ -615,7 +615,7 @@ static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
615 if (skb->len - ARC_HDR_SIZE > XMTU && !proto->continue_tx) { 615 if (skb->len - ARC_HDR_SIZE > XMTU && !proto->continue_tx) {
616 BUGMSG(D_NORMAL, "fixme: packet too large: compensating badly!\n"); 616 BUGMSG(D_NORMAL, "fixme: packet too large: compensating badly!\n");
617 dev_kfree_skb(skb); 617 dev_kfree_skb(skb);
618 return 0; /* don't try again */ 618 return NETDEV_TX_OK; /* don't try again */
619 } 619 }
620 620
621 /* We're busy transmitting a packet... */ 621 /* We're busy transmitting a packet... */
@@ -623,8 +623,11 @@ static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
623 623
624 spin_lock_irqsave(&lp->lock, flags); 624 spin_lock_irqsave(&lp->lock, flags);
625 AINTMASK(0); 625 AINTMASK(0);
626 626 if(lp->next_tx == -1)
627 txbuf = get_arcbuf(dev); 627 txbuf = get_arcbuf(dev);
628 else {
629 txbuf = -1;
630 }
628 if (txbuf != -1) { 631 if (txbuf != -1) {
629 if (proto->prepare_tx(dev, pkt, skb->len, txbuf) && 632 if (proto->prepare_tx(dev, pkt, skb->len, txbuf) &&
630 !proto->ack_tx) { 633 !proto->ack_tx) {
@@ -638,6 +641,8 @@ static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
638 lp->outgoing.skb = skb; 641 lp->outgoing.skb = skb;
639 lp->outgoing.pkt = pkt; 642 lp->outgoing.pkt = pkt;
640 643
644 freeskb = 0;
645
641 if (proto->continue_tx && 646 if (proto->continue_tx &&
642 proto->continue_tx(dev, txbuf)) { 647 proto->continue_tx(dev, txbuf)) {
643 BUGMSG(D_NORMAL, 648 BUGMSG(D_NORMAL,
@@ -645,10 +650,12 @@ static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
645 "(proto='%c')\n", proto->suffix); 650 "(proto='%c')\n", proto->suffix);
646 } 651 }
647 } 652 }
648 653 retval = NETDEV_TX_OK;
654 dev->trans_start = jiffies;
649 lp->next_tx = txbuf; 655 lp->next_tx = txbuf;
650 } else { 656 } else {
651 freeskb = 1; 657 retval = NETDEV_TX_BUSY;
658 freeskb = 0;
652 } 659 }
653 660
654 BUGMSG(D_DEBUG, "%s: %d: %s, status: %x\n",__FILE__,__LINE__,__FUNCTION__,ASTATUS()); 661 BUGMSG(D_DEBUG, "%s: %d: %s, status: %x\n",__FILE__,__LINE__,__FUNCTION__,ASTATUS());
@@ -664,7 +671,7 @@ static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
664 if (freeskb) { 671 if (freeskb) {
665 dev_kfree_skb(skb); 672 dev_kfree_skb(skb);
666 } 673 }
667 return 0; /* no need to try again */ 674 return retval; /* no need to try again */
668} 675}
669 676
670 677
@@ -690,7 +697,6 @@ static int go_tx(struct net_device *dev)
690 /* start sending */ 697 /* start sending */
691 ACOMMAND(TXcmd | (lp->cur_tx << 3)); 698 ACOMMAND(TXcmd | (lp->cur_tx << 3));
692 699
693 dev->trans_start = jiffies;
694 lp->stats.tx_packets++; 700 lp->stats.tx_packets++;
695 lp->lasttrans_dest = lp->lastload_dest; 701 lp->lasttrans_dest = lp->lastload_dest;
696 lp->lastload_dest = 0; 702 lp->lastload_dest = 0;
@@ -917,6 +923,9 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id, struct pt_regs *regs)
917 923
918 BUGMSG(D_RECON, "Network reconfiguration detected (status=%Xh)\n", 924 BUGMSG(D_RECON, "Network reconfiguration detected (status=%Xh)\n",
919 status); 925 status);
926 /* MYRECON bit is at bit 7 of diagstatus */
927 if(diagstatus & 0x80)
928 BUGMSG(D_RECON,"Put out that recon myself\n");
920 929
921 /* is the RECON info empty or old? */ 930 /* is the RECON info empty or old? */
922 if (!lp->first_recon || !lp->last_recon || 931 if (!lp->first_recon || !lp->last_recon ||