Support for multiple ethernet ports

Alex Holeczy alex at wmi.com
Thu Jan 3 13:56:38 UTC 2002


On Wed, 2 Jan 2002, suvrat gupta wrote:

> Hi,
> I am using RTEMS with 2 Ethernet interfaces. Thomas is right, you need
> to modify your driver to support multiple interfaces. The driver that
> comes with RTEMS doesn't do that.
> thanks
> -suvrat

When I developed the driver for the dp83815, I implemented it to handle
multiple Ethernet devices.  Each device has a unique name: eth0, eth1 and
eth2.

When I configure the network table to use two ports (eth1 and eth2 for
example), the driver_attach() gets called twice once for eth1 and
once for eth2.  I use the device number, 1 and 2 in this case, as an index
into my version of the softc structure.

After the driver_attach() for the second device is called,
driver_ioctl() is called three times for the first device, eth1.  The
first and third invocations of driver_ioctl() call driver_init() for
eth1.  driver_init() is design to be called multiple times without causing
any problems.

Then driver_ioctl() get called three times for the second device, eth2.
After the third call to driver_ioctl(), the error message indicated in my
first e-mail is generated, see below.

Since the error is not generated by the driver code but by RTEMS code, I
do not think it is a problem with the device driver, but I could be wrong.

If the RTEMS application ignores the error, I can receive ping traffic on
both ports, but RTEMS sends the majority of the ping return messages out
the first port initialized and only sends a single message out of the
second port initialized.

What version of RTEMS are you using?

Alex


>
> Thomas Doerfler wrote:
> >
> > Hi,
> >
> > since nobody answered up to now, I will try to add my 2 cents
> > of knowledge here...
> >
> > >
> > >
> > > It appears from reading the RTEMS network supplement that RTEMS can
> > > supports multiple Ethernet ports.  For my application, I would like to
> > > configure RTEMS to support 3 Ethernet ports.
> >
> > I have an application running with one ethernet port
> > (MC68360), one local loopback interface, and one PPP
> > interface, so from the protocol stack point of view this must
> > be quite similar. RTEMS should definitely support multiple
> > networking interfaces.
> >
> > The only difference to your application is, that you have a
> > different device and possibly multiple devices of the same
> > type. How do you distinguish the network interfaces on driver
> > level? Maybe some part of the software doesn't work properly
> > with an identical major number or so?
> >
> > >
> > > I have successfully configured RTEMS to use a single Ethernet port.  When
> > > I configure RTEMS to use two ports, part way through the initialization of
> > > the second port I get the following error:
> > >
> > >     Can't set eth2 address: File exists
> > >
> > > This error message is in rtems_glue.c at approximately line 828.  The call
> > > to ioctl (s, SIOCSIFADDR, &ifreq) returns with a failure.
> > >
> > > Since RTEMS seems to support multiple Ethernet port, I am assuming that I
> > > have not correctly configured the building of RTEMS.  How do I configure
> > > RTEMS to support 3 Ethernet ports?
> >
> > I don't think this is a building problem, possibly you should
> > look for a problem in the code involved. I had a look into the
> > "gen68360" networking driver, it does not distinguish between
> > multiple devices, although the hardware would be capable to
> > supply multiple ethernet interface. The same is true for the
> > entries in the "netdriver_config" table. So have you created
> > your own mechanism to distinguish multiple devices on
> > driver/configuration level? Maybe you got a problem there?
> >
> > Bye,
> >         Thomas.
> >
> > >
> > >
> > > TIA
> > > Alex
> > >
> > > --
> > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > > Alex Holeczy (alex at wmi.com)
> > >
> > > Communication Automation Corporation (CAC)      www.cacdsp.com www.wmi.com
> > > 1180 McDermott Drive, West Chester, PA  19380
> > >
> > > 800-367-6735 Ext. 122 or 610-692-9526 Ext. 122 (Voice)
> > > 610-436-8258 (Fax)
> > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >
> > --------------------------------------------
> > IMD Ingenieurbuero fuer Microcomputertechnik
> > Thomas Doerfler           Herbststrasse 8
> > D-82178 Puchheim          Germany
> > email:    Thomas.Doerfler at imd-systems.de
> > PGP public key available at: http://www.imd-
> > systems.de/pgp_key.htm
>

-- 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alex Holeczy (alex at wmi.com)

Communication Automation Corporation (CAC)      www.cacdsp.com www.wmi.com
1180 McDermott Drive, West Chester, PA  19380

800-367-6735 Ext. 122 or 610-692-9526 Ext. 122 (Voice)
610-436-8258 (Fax)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




More information about the users mailing list