OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_33/] [or1ksim/] [peripheral/] [eth.c] - Diff between revs 723 and 725

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 723 Rev 725
Line 464... Line 464...
    eth->baseaddr = config.ethernets[i].baseaddr;
    eth->baseaddr = config.ethernets[i].baseaddr;
 
 
    if ( eth->baseaddr != 0 ) {
    if ( eth->baseaddr != 0 ) {
        /* Mark which DMA controller and channels */
        /* Mark which DMA controller and channels */
        eth->dma        = config.ethernets[i].dma;
        eth->dma        = config.ethernets[i].dma;
 
        eth->mac_int    = config.ethernets[i].irq;
        eth->tx_channel = config.ethernets[i].tx_channel;
        eth->tx_channel = config.ethernets[i].tx_channel;
        eth->rx_channel = config.ethernets[i].rx_channel;
        eth->rx_channel = config.ethernets[i].rx_channel;
        eth->rtx_type   = ETH_RTX_SOCK/*config.ethernets[i].rtx_type*/;
        eth->rtx_type   = config.ethernets[i].rtx_type;
 
 
        switch (eth->rtx_type) {
        switch (eth->rtx_type) {
        case ETH_RTX_FILE:
        case ETH_RTX_FILE:
            /* (Re-)open TX/RX files */
            /* (Re-)open TX/RX files */
            eth->rxfile = config.ethernets[i].rxfile;
            eth->rxfile = config.ethernets[i].rxfile;
Line 504... Line 505...
            }
            }
 
 
            /* get interface index number */
            /* get interface index number */
            debug (3, "RTX getting interface...\n");
            debug (3, "RTX getting interface...\n");
            memset(&(eth->ifr), 0, sizeof(eth->ifr));
            memset(&(eth->ifr), 0, sizeof(eth->ifr));
            strncpy(eth->ifr.ifr_name, "lo"/*config.ethernets[i].sock_interface*/, IFNAMSIZ);
            strncpy(eth->ifr.ifr_name, config.ethernets[i].sockif, IFNAMSIZ);
            if (ioctl(eth->rtx_sock, SIOCGIFINDEX, &(eth->ifr)) == -1) {
            if (ioctl(eth->rtx_sock, SIOCGIFINDEX, &(eth->ifr)) == -1) {
                fprintf( stderr, "SIOCGIFINDEX failed!\n");
                fprintf( stderr, "SIOCGIFINDEX failed!\n");
                return;
                return;
            }
            }
            debug (3, "RTX Socket Interface : %d\n", eth->ifr.ifr_ifindex);
            debug (3, "RTX Socket Interface : %d\n", eth->ifr.ifr_ifindex);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.