[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Network driver again



I recall having a similar problem some months ago when adding a second
network driver.  IIRC it was all to do with the name of the device.

In your attach function, you should have something like:

  ifp->if_name = "eth";

while in the file networkconfig.h the rtems_bsdnet_ifconfig should contain
"eth1" (or "eth2" for a second interface) like this:


static struct rtems_bsdnet_ifconfig netdriver_config = {
  "eth1",                            /* May be RTEMS_BSP_NETWORK_DRIVER_NAME
*/
                                     /* you defined in bsp.h */
  RTEMS_BSP_NETWORK_DRIVER_ATTACH,   /* attach function */
... and so on.


Of course you could be using some other name than "eth".

Best wishes,

-- Nick Simon 

> -----Original Message-----
> From: Alexey S. Fadeyev [mailto:alexey at mdis.ru]
> Sent: 20 October 1999 16:24
> To: rtems-list
> Subject: Network driver again
> 
> 
> Hello there
> 
> // rtems_glue.c
> /*
>    * Get the interface flags
>    */
>   strcpy (ifreq.ifr_name, ifp->name);
> 
> After that we have in ifreq.ifr_name just name of our interface but
> name+unit
> 
> 
> ioctl(s, SIOCGIFFLAGS, &ifreq) -> so_ioctl  -> ifioctl ->ifunit
> 
> // if.c
> /*
>  * Interface ioctls.
>  */
> int ifioctl(so, cmd, data, p)
>         struct socket *so;
>         int cmd;
>         caddr_t data;
>         struct proc *p;
> {
>         register struct ifnet *ifp;
>         register struct ifreq *ifr;
>         int error;
> 
>         switch (cmd) {
> 
>         case SIOCGIFCONF:
>         case OSIOCGIFCONF:
>                 return (ifconf(cmd, data));
>         }
>         ifr = (struct ifreq *)data;
>         ifp = ifunit(ifr->ifr_name);            // In this 
> point I recieve 0
> and rtems_panic ("Can't get %s flags: %s", ifp->name, 
> strerror (errno));
>         if (ifp == 0)
>                 return (ENXIO);
> 
> 
> What's wrong?
> 
> 
> Regards
> Alexey
> 
>