Ticket #1428: fix_returncodes_of_ath_hardstart.patch

File fix_returncodes_of_ath_hardstart.patch, 1.5 kB (added by hannemann@i4.informatik.rwth-aachen.de, 2 years ago)

[PATCH] fix return codes ath_hardstart

  • a/ath/if_ath.c

    old new  
    24872487        struct ath_buf *tbf, *tempbf; 
    24882488        struct sk_buff *tskb; 
    24892489        int framecnt; 
     2490        int requeue = 0; 
    24902491#ifdef ATH_SUPERG_FF 
    24912492        unsigned int pktlen; 
    24922493        struct ieee80211com *ic = &sc->sc_ic; 
     
    25112512                ATH_HARDSTART_GET_TX_BUF_WITH_LOCK; 
    25122513                if (bf == NULL) 
    25132514                        goto hardstart_fail; 
    2514                 return ath_tx_startraw(dev, bf, skb); 
     2515                ath_tx_startraw(dev, bf, skb); 
     2516                return NETDEV_TX_OK; 
    25152517        } 
    25162518 
    25172519        eh = (struct ether_header *) skb->data; 
     
    25432545 
    25442546        if (txq->axq_depth > TAIL_DROP_COUNT) { 
    25452547                sc->sc_stats.ast_tx_discard++; 
     2548                /* queue is full, let the kernel backlog the skb */ 
     2549                requeue = 1; 
    25462550                goto hardstart_fail; 
    25472551        } 
    25482552 
     
    25942598 
    25952599                        ATH_TXQ_UNLOCK_IRQ_EARLY(txq); 
    25962600 
    2597                         return 0
     2601                        return NETDEV_TX_OK
    25982602                } 
    25992603        } else { 
    26002604                if (ff_flush) { 
     
    27512755                ath_ffstageq_flush(sc, txq, ath_ff_ageflushtestdone); 
    27522756#endif 
    27532757 
    2754         return 0
     2758        return NETDEV_TX_OK
    27552759 
    27562760hardstart_fail: 
    27572761        if (!STAILQ_EMPTY(&bf_head)) { 
     
    27682772                ATH_TXBUF_UNLOCK_IRQ(sc); 
    27692773        } 
    27702774 
     2775        /* let the kernel requeue the skb (dont free it!) */ 
     2776        if (requeue) 
     2777                return NETDEV_TX_BUSY; 
     2778 
    27712779        /* free sk_buffs */ 
    27722780        while (skb) { 
    27732781                tskb = skb->next; 
     
    27752783                dev_kfree_skb(skb); 
    27762784                skb = tskb; 
    27772785        } 
    2778         return 0;      /* NB: return !0 only in a ``hard error condition'' */ 
     2786        return NETDEV_TX_OK;    
    27792787} 
    27802788#undef ATH_HARDSTART_GET_TX_BUF_WITH_LOCK 
    27812789