
Haavard Skinnemoen wrote:
On Wed, 26 Mar 2008 20:39:26 +0900 Shinya Kuribayashi skuribay@ruby.dti.ne.jp wrote:
I just thought that, a header file full of driver-specific declarations, is somewhat ugly.
The functions must be declared somewhere, but declaring them at the callsite is not only ugly, but error-prone as well.
One alternative might be to add one header file per driver and put the declarations there. Maybe we should add a include/netdev directory for network driver-specific header files?
Haavard
No, I like the way I did it with a single header file for all interfaces. It's not ugly - externs in every board file or a directory of tiny header files or the existing #ifdef mess is ugly. One header file means one-stop-shopping for finding a controller's interface. The only thing that might be better is to #include netdev.h in common.h, getting rid of the requirement to include it in each board file. OTOH, cascading header files is itself an ugly practice. In an entirely biased way, I think the way I've implemented this is a big improvement over the status quo and should make things easier going forward.
regards, Ben