Line 27... |
Line 27... |
#include <fcntl.h>
|
#include <fcntl.h>
|
#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 <netinet/in.h>
|
|
|
#include "config.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"
|
#include "crc32.h"
|
#include "crc32.h"
|
#include "vapi.h"
|
#include "vapi.h"
|
|
#include "pic.h"
|
|
#include "debug.h"
|
|
|
static struct eth_device eths[MAX_ETHERNETS];
|
static struct eth_device eths[MAX_ETHERNETS];
|
|
|
/* simulator interface */
|
/* simulator interface */
|
static void eth_reset_controller( struct eth_device *eth);
|
static void eth_reset_controller( struct eth_device *eth);
|
Line 242... |
Line 245... |
* RX clock
|
* RX clock
|
* Responsible for starting and finishing RX
|
* Responsible for starting and finishing RX
|
*/
|
*/
|
void eth_controller_rx_clock( struct eth_device *eth )
|
void eth_controller_rx_clock( struct eth_device *eth )
|
{
|
{
|
int i;
|
|
int breakpoint = 0;
|
int breakpoint = 0;
|
long nread;
|
long nread;
|
unsigned long send_word;
|
unsigned long send_word;
|
|
|
fd_set rfds;
|
|
|
|
switch (eth->rx.state) {
|
switch (eth->rx.state) {
|
case ETH_RXSTATE_IDLE:
|
case ETH_RXSTATE_IDLE:
|
if ( TEST_FLAG( eth->regs.moder, ETH_MODER, RXEN) ) {
|
if ( TEST_FLAG( eth->regs.moder, ETH_MODER, RXEN) ) {
|
debug (3, "RX - entering state WAIT4BD (%d)\n", eth->rx.bd_index);
|
debug (3, "RX - entering state WAIT4BD (%d)\n", eth->rx.bd_index);
|
Line 517... |
Line 518... |
|
|
|
|
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;
|
|
#if HAVE_ETH_PHY
|
#if HAVE_ETH_PHY
|
|
int j;
|
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 651... |
Line 652... |
struct eth_device *eth = &(eths[i]);
|
struct eth_device *eth = &(eths[i]);
|
|
|
if ( eth->baseaddr == 0 )
|
if ( eth->baseaddr == 0 )
|
continue;
|
continue;
|
|
|
PRINTF( "\nEthernet MAC %u at 0x%08X:\n", i, eth->baseaddr );
|
PRINTF( "\nEthernet MAC %u at 0x%08lX:\n", i, eth->baseaddr );
|
PRINTF( "MODER : 0x%08lX\n", eth->regs.moder );
|
PRINTF( "MODER : 0x%08lX\n", eth->regs.moder );
|
PRINTF( "INT_SOURCE : 0x%08lX\n", eth->regs.int_source );
|
PRINTF( "INT_SOURCE : 0x%08lX\n", eth->regs.int_source );
|
PRINTF( "INT_MASK : 0x%08lX\n", eth->regs.int_mask );
|
PRINTF( "INT_MASK : 0x%08lX\n", eth->regs.int_mask );
|
PRINTF( "IPGT : 0x%08lX\n", eth->regs.ipgt );
|
PRINTF( "IPGT : 0x%08lX\n", eth->regs.ipgt );
|
PRINTF( "IPGR1 : 0x%08lX\n", eth->regs.ipgr1 );
|
PRINTF( "IPGR1 : 0x%08lX\n", eth->regs.ipgr1 );
|