Line 1... |
Line 1... |
#include "common.h"
|
#include "common.h"
|
#include "uart.h"
|
#include "uart.h"
|
#include "eth.h"
|
#include "eth.h"
|
#include "support.h"
|
#include "support.h"
|
#include "spr_defs.h"
|
#include "spr_defs.h"
|
|
#include "net.h"
|
|
|
#if 0
|
#if 0
|
extern int tx_pointer_index;
|
extern int tx_pointer_index;
|
unsigned long dest_mac_addr[6];
|
unsigned long dest_mac_addr[6];
|
|
|
Line 337... |
Line 338... |
else return -1;
|
else return -1;
|
return 0;
|
return 0;
|
}
|
}
|
#endif
|
#endif
|
|
|
|
int eth_conf_cmd(int argc, char *argv[])
|
|
{
|
|
switch(argc) {
|
|
case 0:
|
|
printf("IP: %s", inet_ntoa(global.ip));
|
|
printf("\nmask: %s", inet_ntoa(global.mask));
|
|
printf("\nGW: %s", inet_ntoa(global.gw_ip));
|
|
return 0;
|
|
case 3:
|
|
global.gw_ip = inet_aton(argv[2]);
|
|
case 2:
|
|
global.mask = inet_aton(argv[1]);
|
|
case 1:
|
|
global.ip = inet_aton(argv[0]);
|
|
break;
|
|
}
|
|
printf("Restarting network with new parameters...");
|
|
NetStartAgain();
|
|
|
|
return 0;
|
|
}
|
|
|
void module_eth_init (void)
|
void module_eth_init (void)
|
{
|
{
|
#if 0
|
#if 0
|
register_command ("eth_init", "", "init ethernet", eth_init_cmd);
|
register_command ("eth_init", "", "init ethernet", eth_init_cmd);
|
register_command ("show_txbd", "[<start BD>] [<max>]", "show Tx buffer desc", show_txbd_cmd);
|
register_command ("show_txbd", "[<start BD>] [<max>]", "show Tx buffer desc", show_txbd_cmd);
|
Line 353... |
Line 376... |
register_command ("set_phy_reg", "<addr> <value>", "set PHY register", set_phy_reg_cmd);
|
register_command ("set_phy_reg", "<addr> <value>", "set PHY register", set_phy_reg_cmd);
|
register_command ("show_mac_regs", "", "show all MAC registers", show_mac_regs_cmd);
|
register_command ("show_mac_regs", "", "show all MAC registers", show_mac_regs_cmd);
|
register_command ("eth_int_enable", "", "enable ethernet interrupt", eth_int_enable_cmd);
|
register_command ("eth_int_enable", "", "enable ethernet interrupt", eth_int_enable_cmd);
|
register_command ("show_rx_buffs", "[<show_all>]", "show receive buffers (optional arg will also show empty buffers)", show_rx_buffs_cmd);
|
register_command ("show_rx_buffs", "[<show_all>]", "show receive buffers (optional arg will also show empty buffers)", show_rx_buffs_cmd);
|
register_command ("show_tx_buffs", "", "show transmit buffers", show_rx_buffs_cmd);
|
register_command ("show_tx_buffs", "", "show transmit buffers", show_rx_buffs_cmd);
|
|
#endif
|
/* Initialize controller */
|
/* Initialize controller */
|
|
register_command ("eth_conf", "[<ip> [<mask> [<gw>]]]", "Get/set ethernet configuration", eth_conf_cmd);
|
|
#if 0
|
eth_init();
|
eth_init();
|
printf ("Ethernet not initialized (run eth_init command)\n");
|
printf ("Ethernet not initialized (run eth_init command)\n");
|
init_rx_bd_pool(0);
|
init_rx_bd_pool(0);
|
init_tx_bd_pool(3);
|
init_tx_bd_pool(3);
|
#endif
|
#endif
|