I am writing Ethernet driver.
I would like to do it in 2 steps:
- write it without DMA (simple memcpy)
- rewrite it using DMA.
I would like to ask if it is possible to do it first without using DMA (or is it that the kernel Ethernet framework insist that the driver shall use DMA) ?
Kernel's not stopping you do from doing anything. But specifically, I can't see it stopping you writing skbuffs. Nor mapping the device memory. Honestly you might have most difficulty if you want to find examples of network driver code that doesn't use DMA :-P. IIUC even Linux netpoll (for crash logging over network) doesn't avoid DMA in the drivers.
I wasn't sure
memcpy() would work though...
You need to read your docs (e.g. and specifically)
Looks like you need to use
memcpy_toio() on IO memory.