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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_52/] [or1ksim/] [peripheral/] [eth.c] - Diff between revs 849 and 867

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

Rev 849 Rev 867
Line 28... Line 28...
#include <sys/poll.h>   
#include <sys/poll.h>   
#include <sys/time.h>   
#include <sys/time.h>   
#include <unistd.h>     
#include <unistd.h>     
#include <errno.h>
#include <errno.h>
 
 
 
#include "config.h"
#include "abstract.h"
#include "abstract.h"
#include "ethernet_i.h"
#include "ethernet_i.h"
#include "dma.h"
#include "dma.h"
#include "sim-config.h"
#include "sim-config.h"
#include "fields.h"
#include "fields.h"
Line 64... Line 65...
 */
 */
void eth_controller_tx_clock( struct eth_device *eth )
void eth_controller_tx_clock( struct eth_device *eth )
{
{
    int breakpoint = 0;
    int breakpoint = 0;
    int bAdvance   = 1;
    int bAdvance   = 1;
#ifdef HAVE_ETH_PHY
#if HAVE_ETH_PHY
    struct sockaddr_ll sll;
    struct sockaddr_ll sll;
#endif /* HAVE_ETH_PHY */
#endif /* HAVE_ETH_PHY */
    long nwritten;
    long nwritten;
    unsigned long read_word;
    unsigned long read_word;
 
 
Line 173... Line 174...
        /* send packet */
        /* send packet */
        switch (eth->rtx_type) {
        switch (eth->rtx_type) {
        case ETH_RTX_FILE:
        case ETH_RTX_FILE:
            nwritten = write( eth->txfd, eth->tx_buff, eth->tx.packet_length );
            nwritten = write( eth->txfd, eth->tx_buff, eth->tx.packet_length );
            break;
            break;
#ifdef HAVE_ETH_PHY
#if HAVE_ETH_PHY
        case ETH_RTX_SOCK:
        case ETH_RTX_SOCK:
            memset(&sll, 0, sizeof(sll));
            memset(&sll, 0, sizeof(sll));
            sll.sll_ifindex = eth->ifr.ifr_ifindex;
            sll.sll_ifindex = eth->ifr.ifr_ifindex;
            nwritten = sendto(eth->rtx_sock, eth->tx_buff, eth->tx.packet_length, 0, (struct sockaddr *)&sll, sizeof(sll));
            nwritten = sendto(eth->rtx_sock, eth->tx_buff, eth->tx.packet_length, 0, (struct sockaddr *)&sll, sizeof(sll));
#endif /* HAVE_ETH_PHY */
#endif /* HAVE_ETH_PHY */
Line 511... Line 512...
 
 
static void eth_reset_controller(struct eth_device *eth)
static void eth_reset_controller(struct eth_device *eth)
{
{
    int i = eth->eth_number;
    int i = eth->eth_number;
    int j;
    int j;
#ifdef HAVE_ETH_PHY
#if HAVE_ETH_PHY
    struct sockaddr_ll sll;
    struct sockaddr_ll sll;
#endif /* HAVE_ETH_PHY */
#endif /* HAVE_ETH_PHY */
 
 
    eth->baseaddr = config.ethernets[i].baseaddr;
    eth->baseaddr = config.ethernets[i].baseaddr;
 
 
Line 546... Line 547...
                                    S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH )) < 0 )
                                    S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH )) < 0 )
                fprintf( stderr, "Cannot open Ethernet TX file \"%s\"\n", eth->txfile );
                fprintf( stderr, "Cannot open Ethernet TX file \"%s\"\n", eth->txfile );
            eth->loopback_offset = lseek( eth->txfd, 0, SEEK_END );
            eth->loopback_offset = lseek( eth->txfd, 0, SEEK_END );
 
 
            break;
            break;
#ifdef HAVE_ETH_PHY
#if HAVE_ETH_PHY
        case ETH_RTX_SOCK:
        case ETH_RTX_SOCK:
            /* (Re-)open TX/RX sockets */
            /* (Re-)open TX/RX sockets */
            if (eth->rtx_sock != 0)
            if (eth->rtx_sock != 0)
                break;
                break;
 
 

powered by: WebSVN 2.1.0

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