How to find NIC driver RTEMS features requirements?

Karel Gardas kgardas at objectsecurity.com
Tue Jul 26 19:52:50 UTC 2005


Hello,

I'm experimenting with RTEMS 4.7/pc386 BSP. I'm testing various demos from 
which netdemo is the most used here. I've found that while running on PC 
with Intel NIC, netdemo from the CVS runs OK, i.e. just setup network 
interface define, driver attach function name and it runs well. On the 
other hand, when running on PC with 3C905, I've found several issues:

1) elnk.c driver does not initialized PCI subsystem, while if_fxp.c driver 
does. So as a temporary workaround I've just copied if_fxp's code:

diff -u -r1.13 elnk.c
--- elnk.c      6 May 2005 20:06:17 -0000       1.13
+++ elnk.c      26 Jul 2005 19:45:27 -0000
@@ -3126,6 +3126,7 @@
     char         *unitName;
     int          unitNumber;
     int          mtu, i;
+   int pci_init_retval;
     unsigned char cvalue;
     struct el_boards         sysboards[NUM_UNITS];
     int                      numFound = 0;
@@ -3161,6 +3162,15 @@
     }


+   /*
+    * init PCI Bios interface...
+    */
+   pci_init_retval = pci_initialize();
+   if (pci_init_retval != PCIB_ERR_SUCCESS) {
+       printk("elnk.c: could not initialize pci bios interface\n");
+       return 0;
+   }
+
     {
        int  done= 0, unum;



as Greg Melke was complaining about pc386 not initializing its own PCI few 
months ago, I know that this way is really crude hack now. :-)

Anyway, there is another issue which I've found:

2) in comparison with if_fxp driver, elnk driver seems to use some 
additional RTEMS functionality and when it is not enabled in let 
say netdemo it simply blocks for ever w/o even complaining about what's 
missing for it. E.g. I had to add:

+#define CONFIGURE_MAXIMUM_TIMERS 1
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES      1
+

to the netdemo init.c to get it running and also modify makefile:

-MANAGERS=io event semaphore
+# 3c905 driver requires timer and msg
+MANAGERS=io event semaphore timer msg


So my question is, isn't possible to "hack" those "empty" functions from 
no-timer, no-msg and others to printk to console some complain about a 
needed functionality and then assert? Or is there any way, how to not need 
to debug NIC driver in case user forgot to add some required define inside 
his/her application?

Thanks,
Karel
--
Karel Gardas                  kgardas at objectsecurity.com
ObjectSecurity Ltd.           http://www.objectsecurity.com



More information about the users mailing list