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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_39/] [or1ksim/] [peripheral/] [ethernet.h] - Diff between revs 324 and 346

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

Rev 324 Rev 346
Line 16... Line 16...
   You should have received a copy of the GNU General Public License
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
*/
 
 
 
#ifndef __OR1KSIM_PERIPHERAL_ETHERNET_H
 
#define __OR1KSIM_PERIPHERAL_ETHERNET_H
 
 
/* Exported function prototypes */
/* Exported function prototypes */
void eth_reset( void );
void eth_reset( void );
void eth_clock( void );
void eth_clock( void );
void eth_status( void );
void eth_status( void );
 
 
Line 128... Line 131...
#define ETH_RX_BD_RETRY_OFFSET         0
#define ETH_RX_BD_RETRY_OFFSET         0
#define ETH_RX_BD_RETRY_WIDTH          4
#define ETH_RX_BD_RETRY_WIDTH          4
 
 
 
 
 
 
/* Implementatino of Ethernet MAC Registers and State */
 
struct eth_device
#endif /* __OR1KSIM_PERIPHERAL_ETHERNET_H */
{
 
  /* Base address in memory */
 
  unsigned long baseaddr;
 
 
 
  /* Which Ethernet MAC is this? */
 
  unsigned eth_number;
 
 
 
  /* Which DMA controller is this MAC connected to */
 
  unsigned dma;
 
        unsigned tx_channel;
 
        unsigned rx_channel;
 
 
 
  /* RX and TX file names and handles */
 
  const char *rxfile, *txfile;
 
        int txfd;
 
        int rxfd;
 
        off_t loopback_offset;
 
 
 
        /* Current TX state */
 
        struct
 
        {
 
                unsigned long bd_index;
 
                unsigned long bd;
 
                unsigned working, waiting_for_ack, error;
 
                unsigned packet_length;
 
                unsigned minimum_length, maximum_length;
 
                unsigned crc;
 
                unsigned bytes_left, bytes_sent;
 
        } tx;
 
 
 
        /* Current RX state */
 
        struct
 
        {
 
                unsigned long bd_index;
 
                unsigned long bd;
 
                int fd;
 
                off_t *offset;
 
                unsigned working, error, waiting_for_ack;
 
                unsigned packet_length, bytes_read, bytes_left;
 
        } rx;
 
 
 
  /* Visible registers */
 
  struct
 
  {
 
    unsigned long moder;
 
    unsigned long int_source;
 
    unsigned long int_mask;
 
    unsigned long ipgt;
 
    unsigned long ipgr1;
 
    unsigned long ipgr2;
 
    unsigned long packetlen;
 
    unsigned long collconf;
 
    unsigned long rx_bd_adr;
 
    unsigned long controlmoder;
 
    unsigned long miimoder;
 
    unsigned long miicommand;
 
    unsigned long miiaddress;
 
    unsigned long miitx_data;
 
    unsigned long miirx_data;
 
    unsigned long miistatus;
 
    unsigned long mac_addr0;
 
    unsigned long mac_addr1;
 
 
 
                /* Buffer descriptors */
 
                unsigned long bd_ram[ETH_BD_SPACE / 4];
 
  } regs;
 
};
 
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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