Line 888... |
Line 888... |
}
|
}
|
|
|
return NULL;
|
return NULL;
|
}
|
}
|
|
|
No newline at end of file
|
No newline at end of file
|
|
/*-----------------------------------------------[ Ethernet configuration ]---*/
|
|
void eth_nethernets (union param_val val, void *dat) {
|
|
if (val.int_val >= 0 && val.int_val < MAX_ETHERNETS)
|
|
config.nethernets = val.int_val;
|
|
else
|
|
CONFIG_ERROR("invalid number of devices.");
|
|
}
|
|
|
|
void eth_baseaddr (union param_val val, void *dat) {
|
|
if (current_device >= 0 && current_device < config.nethernets)
|
|
config.ethernets[current_device].baseaddr = val.addr_val;
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void eth_dma (union param_val val, void *dat) {
|
|
if (current_device >= 0 && current_device < config.nethernets)
|
|
config.ethernets[current_device].dma = val.int_val;
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void eth_rtx_type (union param_val val, void *dat) {
|
|
if (current_device >= 0 && current_device < config.nethernets)
|
|
config.ethernets[current_device].rtx_type = val.int_val;
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void eth_rx_channel (union param_val val, void *dat) {
|
|
if (current_device >= 0 && current_device < config.nethernets)
|
|
config.ethernets[current_device].rx_channel = val.int_val;
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void eth_tx_channel (union param_val val, void *dat) {
|
|
if (current_device >= 0 && current_device < config.nethernets)
|
|
config.ethernets[current_device].rx_channel = val.int_val;
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void eth_rxfile (union param_val val, void *dat) {
|
|
if (current_device >= 0 && current_device < config.nethernets)
|
|
strcpy (config.ethernets[current_device].rxfile, val.str_val);
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void eth_txfile(union param_val val, void *dat)
|
|
{
|
|
if (current_device >= 0 && current_device < config.nethernets)
|
|
strcpy (config.ethernets[current_device].txfile, val.str_val);
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void eth_sockif(union param_val val, void *dat)
|
|
{
|
|
if (current_device >= 0 && current_device < config.nethernets)
|
|
strcpy (config.ethernets[current_device].sockif, val.str_val);
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void eth_irq(union param_val val, void *dat)
|
|
{
|
|
if (current_device >= 0 && current_device < config.nethernets)
|
|
config.ethernets[current_device].irq = val.int_val;
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void eth_vapi_id(union param_val val, void *dat)
|
|
{
|
|
if (current_device >= 0 && current_device < config.nethernets)
|
|
config.ethernets[current_device].base_vapi_id = val.int_val;
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void reg_ethernet_sec(void)
|
|
{
|
|
struct config_section *sec = reg_config_sec("ethernet", NULL, NULL);
|
|
|
|
reg_config_param(sec, "nethernets", paramt_int, eth_nethernets);
|
|
reg_config_param(sec, "device", paramt_int, change_device);
|
|
reg_config_param(sec, "irq", paramt_int, eth_irq);
|
|
reg_config_param(sec, "enddevice", paramt_int, end_device);
|
|
reg_config_param(sec, "baseaddr", paramt_int, eth_baseaddr);
|
|
reg_config_param(sec, "dma", paramt_int, eth_dma);
|
|
reg_config_param(sec, "rtx_type", paramt_int, eth_rtx_type);
|
|
reg_config_param(sec, "rx_channel", paramt_int, eth_rx_channel);
|
|
reg_config_param(sec, "tx_channel", paramt_int, eth_tx_channel);
|
|
reg_config_param(sec, "rxfile", paramt_str, eth_rxfile);
|
|
reg_config_param(sec, "txfile", paramt_str, eth_txfile);
|
|
reg_config_param(sec, "sockif", paramt_str, eth_sockif);
|
|
reg_config_param(sec, "vapi_id", paramt_int, eth_vapi_id);
|
|
}
|
|
|
No newline at end of file
|
No newline at end of file
|