How to find NIC driver RTEMS features requirements?

Joel Sherrill <joel@OARcorp.com> joel.sherrill at OARcorp.com
Mon Aug 1 15:43:02 UTC 2005


Karel Gardas wrote:
> 
> 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? 

It is possible but those are intended to be empty stubs to minimize
functionality linked into an application and logically ensure that
use of those managers is forbidden.  All calls in there return
"not configured" and the device driver should check for errors.

> 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?

If the NIC driver is using those, then it must not be checking the 
return status and doing it's own error output.  The elnk.c code appears
to be checking the return status of it's create calls and calling
printk with an error message.  I wonder why you didn't see them.

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


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985




More information about the users mailing list