i try to build a driver for testing to do some dma transfers. My main work is on the hardware side, but i need an initilized buffer for testing.

What i need to do is:
get a page (alloc_page?)
initialize the page with data (can i just work with the page adress here?)
register it as dma_to_device buffer (dma_map_single?)
get the bus address of the buffer

I have read up in some Books (Rubini, Linux device drivers) and internet sources, but i cant find a simple and working example. Can someone give me some lines of code that do what i described above? I really need a working code snippet to start with.

For most things i have diffrent functions but no idea what the parameters really mean (and where i get the stuff from) or where to find the exact type definitions for them.