tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Bug in urtwn_llt_init()?




> On Aug 4, 2018, at 7:42 AM, Jason Thorpe <thorpej%me.com@localhost> wrote:
> 
> Looking at the end of urtwn_llt_init(), we see:
> 
>        /*
>         * Use pages [page_count + 1; pktbuf_count - 1]
>         * as ring buffer.
>         */
>        for (++i; i < pktbuf_count - 1; i++) {
>                if ((error = urtwn_llt_write(sc, i, i + 1)) != 0)
>                        return error;
>        }
>        /* Make the last page point to the beginning of the ring buffer. */
>        error = urtwn_llt_write(sc, i, pktbuf_count + 1);
> 
> Shouldn't that last line read:
> 
>       error = urtwn_llt_write(sc, i, page_count + 1);
> 
> ?  Otherwise, I don't see how it ends up as a ring buffer.

To clarify... I think it happens to "work", but you end up losing a some slots after the first pass through the ring (e.g. R88E_TXPKTBUF_COUNT=177 and R88E_TX_PAGE_COUNT=169, so the end of the ring points to 178 instead of 170).

-- thorpej



Home | Main Index | Thread Index | Old Index