madwifi: reduce the packet loss impact of forced background scans triggered by the...
[openwrt.git] / package / madwifi / patches-testing / 126-rxerr_frames.patch
1 --- a/ath/if_ath.c
2 +++ b/ath/if_ath.c
3 @@ -6451,9 +6451,6 @@
4                 rs = &bf->bf_dsstatus.ds_rxstat;
5  
6                 len = rs->rs_datalen;
7 -               /* DMA sync. dies spectacularly if len == 0 */
8 -               if (len == 0)
9 -                       goto rx_next;
10                 if (rs->rs_more) {
11                         /* Frame spans multiple descriptors; this
12                          * cannot happen yet as we don't support
13 @@ -6513,8 +6510,12 @@
14                  * setup again to receive another frame. 
15                  * NB: Meta-data (rs, noise, tsf) in the ath_buf is still
16                  * used. */
17 -               bus_dma_sync_single(sc->sc_bdev,
18 -                       bf->bf_skbaddr, len, BUS_DMA_FROMDEVICE);
19 +
20 +               /* DMA sync. dies spectacularly if len == 0 */
21 +               if (len != 0) {
22 +                       bus_dma_sync_single(sc->sc_bdev,
23 +                               bf->bf_skbaddr, len, BUS_DMA_FROMDEVICE);
24 +               }
25                 skb = ath_rxbuf_take_skb(sc, bf);
26  
27                 sc->sc_stats.ast_ant_rx[rs->rs_antenna]++;