Line 318... |
Line 318... |
#endif
|
#endif
|
}
|
}
|
}
|
}
|
/* ========================================================================= */
|
/* ========================================================================= */
|
|
|
No newline at end of file
|
No newline at end of file
|
|
/*----------------------------------------------------[ ATA Configuration ]---*/
|
|
void ata_natas(union param_val val, void *dat)
|
|
{
|
|
if (val.int_val >= 0 && val.int_val < MAX_ATAS)
|
|
config.natas = val.int_val;
|
|
else
|
|
CONFIG_ERROR("invalid number of devices.");
|
|
}
|
|
|
|
void ata_baseaddr(union param_val val, void *dat)
|
|
{
|
|
if (current_device >= 0 && current_device < config.natas)
|
|
config.atas[current_device].baseaddr = val.addr_val;
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void ata_irq(union param_val val, void *dat)
|
|
{
|
|
if (current_device >= 0 && current_device < config.natas)
|
|
config.atas[current_device].irq = val.int_val;
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void ata_dev_type0(union param_val val, void *dat)
|
|
{
|
|
if (current_device >= 0 && current_device < config.natas)
|
|
config.atas[current_device].dev_type0 = val.int_val;
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void ata_dev_file0(union param_val val, void *dat)
|
|
{
|
|
if (current_device >= 0 && current_device < config.natas)
|
|
strcpy (config.atas[current_device].dev_file0, val.str_val);
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void ata_dev_size0(union param_val val, void *dat)
|
|
{
|
|
if (current_device >= 0 && current_device < config.natas)
|
|
config.atas[current_device].dev_size0 = val.int_val;
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void ata_dev_packet0(union param_val val, void *dat)
|
|
{
|
|
if (current_device >= 0 && current_device < config.natas)
|
|
config.atas[current_device].dev_packet0 = val.int_val;
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void ata_dev_type1(union param_val val, void *dat)
|
|
{
|
|
if (current_device >= 0 && current_device < config.natas)
|
|
config.atas[current_device].dev_type1 = val.int_val;
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void ata_dev_file1(union param_val val, void *dat)
|
|
{
|
|
if (current_device >= 0 && current_device < config.natas)
|
|
strcpy (config.atas[current_device].dev_file1, val.str_val);
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void ata_dev_size1(union param_val val, void *dat)
|
|
{
|
|
if (current_device >= 0 && current_device < config.natas)
|
|
config.atas[current_device].dev_size1 = val.int_val;
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void ata_dev_packet1(union param_val val, void *dat)
|
|
{
|
|
if (current_device >= 0 && current_device < config.natas)
|
|
config.atas[current_device].dev_packet1 = val.int_val;
|
|
else
|
|
CONFIG_ERROR("invalid device number.");
|
|
}
|
|
|
|
void reg_ata_sec(void)
|
|
{
|
|
struct config_section *sec = reg_config_sec("ata", NULL, NULL);
|
|
|
|
reg_config_param(sec, "natas", paramt_int, ata_natas);
|
|
reg_config_param(sec, "device", paramt_int, change_device);
|
|
reg_config_param(sec, "baseaddr", paramt_addr, ata_baseaddr);
|
|
reg_config_param(sec, "irq", paramt_int, ata_irq);
|
|
reg_config_param(sec, "dev_type0", paramt_int, ata_dev_type0);
|
|
reg_config_param(sec, "dev_file0", paramt_str, ata_dev_file0);
|
|
reg_config_param(sec, "dev_size0", paramt_int, ata_dev_size0);
|
|
reg_config_param(sec, "dev_packet0", paramt_int, ata_dev_packet0);
|
|
reg_config_param(sec, "dev_type1", paramt_int, ata_dev_type1);
|
|
reg_config_param(sec, "dev_file1", paramt_str, ata_dev_file1);
|
|
reg_config_param(sec, "dev_size1", paramt_int, ata_dev_size1);
|
|
reg_config_param(sec, "dev_packet1", paramt_int, ata_dev_packet1);
|
|
reg_config_param(sec, "enddevice", paramt_none, end_device);
|
|
}
|
|
|
No newline at end of file
|
No newline at end of file
|