Thank you for your answer Joao
Forgive me but I'm a little lost about the "cross compile" thing: do you think I might be able to do the porting directly on the NAS or should I cross-compile everything on a PC and then flash the custom firmware?
Maybe I misled you when I said that I was working on Ubuntu in parallel. They are two distinct projects, I was hoping that once I learn on the PC all the necessary modifications to compile the old driver on 4.x kernel I could replicate the steps on the NAS (since working on a PC is much faster and they both have kernel 4.x anyway). On the NAS however I got stuck at the first step because I don't have the /usr/src/linux-header$(uname -r) folder
Thank you for your support
Moreno