Commit c6bb15a0c485fbdd3d161da54fd29f4f15e1b070

Authored by Pieter Dejaeghere
Committed by David S. Miller
1 parent 0a3f4358ac

[ARCNET]: Fix return value from arcnet_send_packet().

From: Pieter Dejaeghere <pieter@dejaeghere.net>

Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 17 additions and 8 deletions Side-by-side Diff

drivers/net/arcnet/arcnet.c
... ... @@ -597,7 +597,7 @@
597 597 struct ArcProto *proto;
598 598 int txbuf;
599 599 unsigned long flags;
600   - int freeskb = 0;
  600 + int freeskb, retval;
601 601  
602 602 BUGMSG(D_DURING,
603 603 "transmit requested (status=%Xh, txbufs=%d/%d, len=%d, protocol %x)\n",
... ... @@ -615,7 +615,7 @@
615 615 if (skb->len - ARC_HDR_SIZE > XMTU && !proto->continue_tx) {
616 616 BUGMSG(D_NORMAL, "fixme: packet too large: compensating badly!\n");
617 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 621 /* We're busy transmitting a packet... */
... ... @@ -623,8 +623,11 @@
623 623  
624 624 spin_lock_irqsave(&lp->lock, flags);
625 625 AINTMASK(0);
626   -
627   - txbuf = get_arcbuf(dev);
  626 + if(lp->next_tx == -1)
  627 + txbuf = get_arcbuf(dev);
  628 + else {
  629 + txbuf = -1;
  630 + }
628 631 if (txbuf != -1) {
629 632 if (proto->prepare_tx(dev, pkt, skb->len, txbuf) &&
630 633 !proto->ack_tx) {
... ... @@ -638,6 +641,8 @@
638 641 lp->outgoing.skb = skb;
639 642 lp->outgoing.pkt = pkt;
640 643  
  644 + freeskb = 0;
  645 +
641 646 if (proto->continue_tx &&
642 647 proto->continue_tx(dev, txbuf)) {
643 648 BUGMSG(D_NORMAL,
644 649  
... ... @@ -645,10 +650,12 @@
645 650 "(proto='%c')\n", proto->suffix);
646 651 }
647 652 }
648   -
  653 + retval = NETDEV_TX_OK;
  654 + dev->trans_start = jiffies;
649 655 lp->next_tx = txbuf;
650 656 } else {
651   - freeskb = 1;
  657 + retval = NETDEV_TX_BUSY;
  658 + freeskb = 0;
652 659 }
653 660  
654 661 BUGMSG(D_DEBUG, "%s: %d: %s, status: %x\n",__FILE__,__LINE__,__FUNCTION__,ASTATUS());
... ... @@ -664,7 +671,7 @@
664 671 if (freeskb) {
665 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 @@
690 697 /* start sending */
691 698 ACOMMAND(TXcmd | (lp->cur_tx << 3));
692 699  
693   - dev->trans_start = jiffies;
694 700 lp->stats.tx_packets++;
695 701 lp->lasttrans_dest = lp->lastload_dest;
696 702 lp->lastload_dest = 0;
... ... @@ -917,6 +923,9 @@
917 923  
918 924 BUGMSG(D_RECON, "Network reconfiguration detected (status=%Xh)\n",
919 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 930 /* is the RECON info empty or old? */
922 931 if (!lp->first_recon || !lp->last_recon ||