Linux Driver Porting Advice

John J. Karcher devuser at alternateapproach.com
Thu Apr 8 05:59:59 CEST 2021


Hello Everyone,

I have been (very slowly) trying my hand at adding the missing Wacom 
touchscreen functionality to the "usb_hid" driver, and I am encountering 
some of the friction Stefan describes in his recent Genodians article on 
porting Linux drivers.  (I have the additional handicap of not knowing 
what I'm doing, but that just makes it a learning experience. ;^) )

In that context, I'd like to ask for a little advice.

Since the "usb_hid" driver is generally working, the main problem is 
implementing missing functions.  After some fumbling, I have settled on 
commenting out sections of "dummies.c" and pulling more files in from 
the Linux source (rather than copying massive chunks into local files). 
  To do this, I am adding files to "usb_hid.list", then doing 
"prepare_port dde_linux" and "make drivers/usb_hid".

First question: Is this the right basic idea?

Using this approach, I have been able to reduce the number of build 
errors.  It looks like there are only a few left (although this could 
easily be a mirage).  But I'm stumbling on conflicting headers, which 
has led me to an interesting discovery - the 
"build/x86_64/var/libcache/usb_hid_include/include/include/include/linux/" 
directory, which is filled with symlinks to 
"repos/dde_linux/src/drivers/usb_hid/lx_emul.h".

Second question: Where is this controlled?  I assume that if I pull in 
the real "device.h", for example, I should be able to remove "device.h" 
from a list somewhere that generates these symlinks.  Is that correct?

Finally, if anyone has any general advice, I'm all ears!

  Thanks!
-- 
   John J. Karcher
   devuser at alternateapproach.com



More information about the users mailing list