This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Adding and removing a ethernet interface during runtime

Other Parts Discussed in Thread: SYSBIOS, OMAPL138

Hi,

I'm using SYSBIOS 6.31.4.27 and ndk version 2.0.0.19 on OMAP L138. I'd like to realize a function to add and remove an ethernet inteface during runtime. This interface has its own MAC- and IP-address as well as a subnet mask. What will be the best procedure to do that?

Regards

Klaus Peter Hensel

  • Hi Klaus Peter Hensel,

    You would need to do this using the Network Interface Management Unit (NIMU) component of the stack.  The NIMU component allows the NDK to support multiple devices by using interface IDs.

    You should look at the driver code for the OMAPL138 for an example of this.  In short, you need to create a NETIF_DEVICE structure and fill in the data for its attributes, such as the MAC address, etc.  Then you register it via NIMURegister().  E.g. this can be seen in the EmacStart() function in the driver file "nimu_eth.c":

        int EmacInit (STKEVENT_Handle hEvent)
        {

            NETIF_DEVICE*       ptr_device;
            EMAC_DATA*  ptr_pvt_data;

            ...

            /* Register the device with NIMU */
           if (NIMURegister (ptr_device) < 0)
           {
                printf ("Error: Unable to register the EMAC\n");
                return -1;
           }
        ...

    Please refer to the NDK Programmer's Guide for additional info (see section A.15 Network Interface Management Unit (NIMU) )

    Also, it looks like you are using a somewhat dated version of the NDK and OMAPL138 driver.  You may want to upgrade to the latest NDK and also grab the latest NSP (it has the latest driver for OMAPL138).

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/ndk/index.html

    Steve