Hello,
I found a bug in ath_descdma_setup function.
Below I list the part of the function that contains the bug.
/*
* This function will allocate both the DMA descriptor structure, and the
* buffers it contains. These are used to contain the descriptors used
* by the system.
*/
int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd,
struct list_head *head, const char *name,
int nbuf, int ndesc)
....
/*
* Need additional DMA memory because we can't use
* descriptors that cross the 4K page boundary. Assume
* one skipped descriptor per 4K page.
*/
if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_4KB_SPLITTRANS)) {
u32 ndesc_skipped =
ATH_DESC_4KB_BOUND_NUM_SKIPPED(dd->dd_desc_len);
u32 dma_len;
while (ndesc_skipped) {
dma_len = ndesc_skipped * sizeof(struct ath_desc);
dd->dd_desc_len += dma_len;
*ndesc_skipped = ATH_DESC_4KB_BOUND_NUM_SKIPPED(dma_len);*
};
}
.........
And the bug is: ndesc_skipped = ATH_DESC_4KB_BOUND_NUM_SKIPPED(dma_len).
In my opinion: ndesc_skipped = ATH_DESC_4KB_BOUND_NUM_SKIPPED((dma_len +
(dd->dd_desc_len%4096))).
Am I right? If no, please explain to me.
Thank you,
Mircea BARBU
_______________________________________________
ath9k-devel mailing list
[email protected]
https://lists.ath9k.org/mailman/listinfo/ath9k-devel