W dniu 19 lipca 2011 16:52 użytkownik Pavel Roskin <proski@xxxxxxx> napisał: > On 07/19/2011 04:05 AM, Rafał Miłecki wrote: > >> +#ifdef CONFIG_B43_BCMA >> + case B43_BUS_BCMA: >> + dma->translation = >> bcma_dma_translation(dev->dev->bdev->bus); >> + break; >> +#endif > > How about we set dma->translation to 0x40000000 for 32-bit DMA and to > 0x80000000 for 64-bit DMA and remove shifting translation by 1 in the 64-bit > DMA code? There should be a warning for non-PCI devices here. No ifdefs, no > separate treatment of different buses. > > I think we are adding too much complexity here. Warning is generated on bcma_dma_translation side. We could make that function return s32 and return negative values of error, but not sure if it's worth it. We will get warning anyway. After checking specs (http://bcm-v4.sipsolutions.net/802.11/DMA) I've to agree that our shifting looks crazy. Probably ssb function was implemented and someone added 64-bit DMA support without modifying ssb. There is no reason to shift value by 1. Routing mask is always 0xC0000000. It's just about different values: DMA32: 0x1 == Client Mode Translation (1GB) DMA64: 0x2 == Client Mode Translation (2 Zettabytes) Well, I've to say it was really worth to CC you :) -- Rafał -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html