clean up device_config_t formatting

This commit is contained in:
Jasmine Iwanek
2022-02-26 23:31:28 -05:00
parent f4587949a7
commit 801f81fbda
61 changed files with 2679 additions and 4300 deletions

View File

@@ -636,111 +636,61 @@ threec503_nic_close(void *priv)
}
static const device_config_t threec503_config[] =
{
static const device_config_t threec503_config[] = {
// clang-format off
{
"base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 },
{
{
"0x250", 0x250
},
{
"0x280", 0x280
},
{
"0x2a0", 0x2a0
},
{
"0x2e0", 0x2e0
},
{
"0x300", 0x300
},
{
"0x310", 0x310
},
{
"0x330", 0x330
},
{
"0x350", 0x350
},
{
"", 0
}
},
"base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 },
{
{ "0x250", 0x250 },
{ "0x280", 0x280 },
{ "0x2a0", 0x2a0 },
{ "0x2e0", 0x2e0 },
{ "0x300", 0x300 },
{ "0x310", 0x310 },
{ "0x330", 0x330 },
{ "0x350", 0x350 },
{ "", 0 }
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{
"IRQ 2", 2
},
{
"IRQ 3", 3
},
{
"IRQ 4", 4
},
{
"IRQ 5", 5
},
{
"", 0
}
},
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{ "IRQ 2", 2 },
{ "IRQ 3", 3 },
{ "IRQ 4", 4 },
{ "IRQ 5", 5 },
{ "", 0 }
},
},
{
"dma", "DMA", CONFIG_SELECTION, "", 3, "", { 0 },
{
{
"DMA 1", 1
},
{
"DMA 2", 2
},
{
"DMA 3", 3
},
{
"", 0
}
},
"dma", "DMA", CONFIG_SELECTION, "", 3, "", { 0 },
{
{ "DMA 1", 1 },
{ "DMA 2", 2 },
{ "DMA 3", 3 },
{ "", 0 }
},
},
{
"mac", "MAC Address", CONFIG_MAC, "", -1, "", { 0 },
{
{
"", 0
}
},
"mac", "MAC Address", CONFIG_MAC, "", -1, "", { 0 },
{
{ "", 0 }
},
},
{
"bios_addr", "BIOS address", CONFIG_HEX20, "", 0xCC000, "", { 0 },
{
{
"DC00", 0xDC000
},
{
"D800", 0xD8000
},
{
"C800", 0xC8000
},
{
"CC00", 0xCC000
},
{
"", 0
}
},
"bios_addr", "BIOS address", CONFIG_HEX20, "", 0xCC000, "", { 0 },
{
{ "DC00", 0xDC000 },
{ "D800", 0xD8000 },
{ "C800", 0xC8000 },
{ "CC00", 0xCC000 },
{ "", 0 }
},
},
{
"", "", -1
}
{ "", "", -1 }
// clang-format off
};
const device_t threec503_device = {
"3Com EtherLink II",
"3c503",

View File

@@ -1111,11 +1111,10 @@ dp8390_close(void *priv)
}
const device_t dp8390_device =
{
"DP8390 Network Interface Controller",
"dp8390",
0, 0,
dp8390_init, dp8390_close,
NULL, { NULL }, NULL, NULL
const device_t dp8390_device = {
"DP8390 Network Interface Controller",
"dp8390",
0, 0,
dp8390_init, dp8390_close,
NULL, { NULL }, NULL, NULL
};

View File

@@ -1139,185 +1139,91 @@ nic_close(void *priv)
free(dev);
}
static const device_config_t ne1000_config[] =
{
{
"base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 },
{
{
"0x280", 0x280
},
{
"0x300", 0x300
},
{
"0x320", 0x320
},
{
"0x340", 0x340
},
{
"0x360", 0x360
},
{
"0x380", 0x380
},
{
""
}
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{
"IRQ 2", 2
},
{
"IRQ 3", 3
},
{
"IRQ 5", 5
},
{
"IRQ 7", 7
},
{
"IRQ 10", 10
},
{
"IRQ 11", 11
},
{
""
}
},
},
{
"mac", "MAC Address", CONFIG_MAC, "", -1
},
{
"", "", -1
}
// clang-format off
static const device_config_t ne1000_config[] = {
{
"base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 },
{
{ "0x280", 0x280 },
{ "0x300", 0x300 },
{ "0x320", 0x320 },
{ "0x340", 0x340 },
{ "0x360", 0x360 },
{ "0x380", 0x380 },
{ "" }
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{ "IRQ 2", 2 },
{ "IRQ 3", 3 },
{ "IRQ 5", 5 },
{ "IRQ 7", 7 },
{ "IRQ 10", 10 },
{ "IRQ 11", 11 },
{ "" }
},
},
{ "mac", "MAC Address", CONFIG_MAC, "", -1 },
{ "", "", -1 }
};
static const device_config_t ne2000_config[] =
{
{
"base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 },
{
{
"0x280", 0x280
},
{
"0x300", 0x300
},
{
"0x320", 0x320
},
{
"0x340", 0x340
},
{
"0x360", 0x360
},
{
"0x380", 0x380
},
{
""
}
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 10, "", { 0 },
{
{
"IRQ 2", 2
},
{
"IRQ 3", 3
},
{
"IRQ 5", 5
},
{
"IRQ 7", 7
},
{
"IRQ 10", 10
},
{
"IRQ 11", 11
},
{
""
}
},
},
{
"mac", "MAC Address", CONFIG_MAC, "", -1
},
{
"bios_addr", "BIOS address", CONFIG_HEX20, "", 0, "", { 0 },
{
{
"Disabled", 0x00000
},
{
"D000", 0xD0000
},
{
"D800", 0xD8000
},
{
"C800", 0xC8000
},
{
""
}
},
},
{
"", "", -1
}
static const device_config_t ne2000_config[] = {
{
"base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 },
{
{ "0x280", 0x280 },
{ "0x300", 0x300 },
{ "0x320", 0x320 },
{ "0x340", 0x340 },
{ "0x360", 0x360 },
{ "0x380", 0x380 },
{ "" }
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 10, "", { 0 },
{
{ "IRQ 2", 2 },
{ "IRQ 3", 3 },
{ "IRQ 5", 5 },
{ "IRQ 7", 7 },
{ "IRQ 10", 10 },
{ "IRQ 11", 11 },
{ "" }
},
},
{ "mac", "MAC Address", CONFIG_MAC, "", -1 },
{
"bios_addr", "BIOS address", CONFIG_HEX20, "", 0, "", { 0 },
{
{ "Disabled", 0x00000 },
{ "D000", 0xD0000 },
{ "D800", 0xD8000 },
{ "C800", 0xC8000 },
{ "" }
},
},
{ "", "", -1 }
};
static const device_config_t rtl8019as_config[] =
{
{
"mac", "MAC Address", CONFIG_MAC, "", -1
},
{
"", "", -1
}
static const device_config_t rtl8019as_config[] = {
{ "mac", "MAC Address", CONFIG_MAC, "", -1 },
{ "", "", -1 }
};
static const device_config_t rtl8029as_config[] =
{
{
"bios", "Enable BIOS", CONFIG_BINARY, "", 0
},
{
"mac", "MAC Address", CONFIG_MAC, "", -1
},
{
"", "", -1
}
static const device_config_t rtl8029as_config[] = {
{ "bios", "Enable BIOS", CONFIG_BINARY, "", 0 },
{ "mac", "MAC Address", CONFIG_MAC, "", -1 },
{ "", "", -1 }
};
static const device_config_t mca_mac_config[] =
{
{
"mac", "MAC Address", CONFIG_MAC, "", -1
},
{
"", "", -1
}
static const device_config_t mca_mac_config[] = {
{ "mac", "MAC Address", CONFIG_MAC, "", -1 },
{ "", "", -1 }
};
// clang-format on
const device_t ne1000_device = {
"Novell NE1000",

View File

@@ -3076,137 +3076,72 @@ pcnet_close(void *priv)
}
}
static const device_config_t pcnet_pci_config[] =
{
{
"mac", "MAC Address", CONFIG_MAC, "", -1
},
{
"", "", -1
}
// clang-format off
static const device_config_t pcnet_pci_config[] = {
{ "mac", "MAC Address", CONFIG_MAC, "", -1 },
{ "", "", -1 }
};
static const device_config_t pcnet_isa_config[] =
{
{
"base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 },
{
{
"0x300", 0x300
},
{
"0x320", 0x320
},
{
"0x340", 0x340
},
{
"0x360", 0x360
},
{
""
}
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{
"IRQ 3", 3
},
{
"IRQ 4", 4
},
{
"IRQ 5", 5
},
{
"IRQ 9", 9
},
{
""
}
},
},
{
"dma", "DMA channel", CONFIG_SELECTION, "", 5, "", { 0 },
{
{
"DMA 3", 3
},
{
"DMA 5", 5
},
{
"DMA 6", 6
},
{
"DMA 7", 7
},
{
""
}
},
},
{
"mac", "MAC Address", CONFIG_MAC, "", -1
},
{
"", "", -1
}
static const device_config_t pcnet_isa_config[] = {
{
"base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 },
{
{ "0x300", 0x300 },
{ "0x320", 0x320 },
{ "0x340", 0x340 },
{ "0x360", 0x360 },
{ "" }
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{ "IRQ 3", 3 },
{ "IRQ 4", 4 },
{ "IRQ 5", 5 },
{ "IRQ 9", 9 },
{ "" }
},
},
{
"dma", "DMA channel", CONFIG_SELECTION, "", 5, "", { 0 },
{
{ "DMA 3", 3 },
{ "DMA 5", 5 },
{ "DMA 6", 6 },
{ "DMA 7", 7 },
{ "" }
},
},
{ "mac", "MAC Address", CONFIG_MAC, "", -1 },
{ "", "", -1 }
};
static const device_config_t pcnet_vlb_config[] =
{
{
"base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 },
{
{
"0x300", 0x300
},
{
"0x320", 0x320
},
{
"0x340", 0x340
},
{
"0x360", 0x360
},
{
""
}
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{
"IRQ 3", 3
},
{
"IRQ 4", 4
},
{
"IRQ 5", 5
},
{
"IRQ 9", 9
},
{
""
}
},
},
{
"mac", "MAC Address", CONFIG_MAC, "", -1
},
{
"", "", -1
}
static const device_config_t pcnet_vlb_config[] = {
{
"base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 },
{
{ "0x300", 0x300 },
{ "0x320", 0x320 },
{ "0x340", 0x340 },
{ "0x360", 0x360 },
{ "" }
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{ "IRQ 3", 3 },
{ "IRQ 4", 4 },
{ "IRQ 5", 5 },
{ "IRQ 9", 9 },
{ "" }
},
},
{ "mac", "MAC Address", CONFIG_MAC, "", -1 },
{ "", "", -1 }
};
// clang-format on
const device_t pcnet_am79c960_device = {
"AMD PCnet-ISA",

View File

@@ -735,335 +735,161 @@ wd_close(void *priv)
free(dev);
}
static const device_config_t wd8003_config[] =
{
{
"base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 },
{
{
"0x240", 0x240
},
{
"0x280", 0x280
},
{
"0x300", 0x300
},
{
"0x380", 0x380
},
{
""
}
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{
"IRQ 2", 2
},
{
"IRQ 3", 3
},
{
"IRQ 5", 5
},
{
"IRQ 7", 7
},
{
""
}
},
},
{
"ram_addr", "RAM address", CONFIG_HEX20, "", 0xD0000, "", { 0 },
{
{
"C800", 0xC8000
},
{
"CC00", 0xCC000
},
{
"D000", 0xD0000
},
{
"D400", 0xD4000
},
{
"D800", 0xD8000
},
{
"DC00", 0xDC000
},
{
""
}
},
},
{
"mac", "MAC Address", CONFIG_MAC, "", -1
},
{
"", "", -1
}
// clang-format off
static const device_config_t wd8003_config[] = {
{
"base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 },
{
{ "0x240", 0x240 },
{ "0x280", 0x280 },
{ "0x300", 0x300 },
{ "0x380", 0x380 },
{ "" }
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{ "IRQ 2", 2 },
{ "IRQ 3", 3 },
{ "IRQ 5", 5 },
{ "IRQ 7", 7 },
{ "" }
},
},
{
"ram_addr", "RAM address", CONFIG_HEX20, "", 0xD0000, "", { 0 },
{
{ "C800", 0xC8000 },
{ "CC00", 0xCC000 },
{ "D000", 0xD0000 },
{ "D400", 0xD4000 },
{ "D800", 0xD8000 },
{ "DC00", 0xDC000 },
{ "" }
},
},
{ "mac", "MAC Address", CONFIG_MAC, "", -1 },
{ "", "", -1 }
};
static const device_config_t wd8003eb_config[] =
{
{
"base", "Address", CONFIG_HEX16, "", 0x280, "", { 0 },
{
{
"0x200", 0x200
},
{
"0x220", 0x220
},
{
"0x240", 0x240
},
{
"0x260", 0x260
},
{
"0x280", 0x280
},
{
"0x2A0", 0x2A0
},
{
"0x2C0", 0x2C0
},
{
"0x300", 0x300
},
{
"0x340", 0x340
},
{
"0x380", 0x380
},
{
""
}
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{
"IRQ 2/9", 9
},
{
"IRQ 3", 3
},
{
"IRQ 4", 4
},
{
"IRQ 7", 7
},
{
""
}
},
},
{
"ram_addr", "RAM address", CONFIG_HEX20, "", 0xD0000, "", { 0 },
{
{
"C000", 0xC0000
},
{
"C400", 0xC4000
},
{
"C800", 0xC8000
},
{
"CC00", 0xCC000
},
{
"D000", 0xD0000
},
{
"D400", 0xD4000
},
{
"D800", 0xD8000
},
{
"DC00", 0xDC000
},
{
""
}
},
},
{
"ram_size", "RAM size", CONFIG_SELECTION, "", 8192, "", { 0 },
{
{
"8 kB", 8192
},
{
"32 kB", 32768
},
{
""
}
},
},
{
"mac", "MAC Address", CONFIG_MAC, "", -1
},
{
"", "", -1
}
static const device_config_t wd8003eb_config[] = {
{
"base", "Address", CONFIG_HEX16, "", 0x280, "", { 0 },
{
{ "0x200", 0x200 },
{ "0x220", 0x220 },
{ "0x240", 0x240 },
{ "0x260", 0x260 },
{ "0x280", 0x280 },
{ "0x2A0", 0x2A0 },
{ "0x2C0", 0x2C0 },
{ "0x300", 0x300 },
{ "0x340", 0x340 },
{ "0x380", 0x380 },
{ "" }
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{ "IRQ 2/9", 9 },
{ "IRQ 3", 3 },
{ "IRQ 4", 4 },
{ "IRQ 7", 7 },
{ "" }
},
},
{
"ram_addr", "RAM address", CONFIG_HEX20, "", 0xD0000, "", { 0 },
{
{ "C000", 0xC0000 },
{ "C400", 0xC4000 },
{ "C800", 0xC8000 },
{ "CC00", 0xCC000 },
{ "D000", 0xD0000 },
{ "D400", 0xD4000 },
{ "D800", 0xD8000 },
{ "DC00", 0xDC000 },
{ "" }
},
},
{
"ram_size", "RAM size", CONFIG_SELECTION, "", 8192, "", { 0 },
{
{ "8 kB", 8192 },
{ "32 kB", 32768 },
{ "" }
},
},
{ "mac", "MAC Address", CONFIG_MAC, "", -1 },
{ "", "", -1 }
};
/* WD8013EBT configuration and defaults set according to this site:
http://www.stack.nl/~marcolz/network/wd80x3.html#WD8013EBT */
static const device_config_t wd8013_config[] =
{
{
"base", "Address", CONFIG_HEX16, "", 0x280, "", { 0 },
{
{
"0x200", 0x200
},
{
"0x220", 0x220
},
{
"0x240", 0x240
},
{
"0x260", 0x260
},
{
"0x280", 0x280
},
{
"0x2A0", 0x2A0
},
{
"0x2C0", 0x2C0
},
{
"0x300", 0x300
},
{
"0x340", 0x340
},
{
"0x380", 0x380
},
{
""
}
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{
"IRQ 2/9", 9
},
{
"IRQ 3", 3
},
{
"IRQ 4", 4
},
{
"IRQ 5", 5
},
{
"IRQ 7", 7
},
{
"IRQ 10", 10
},
{
"IRQ 11", 11
},
{
"IRQ 15", 15
},
{
""
}
},
},
{
"ram_addr", "RAM address", CONFIG_HEX20, "", 0xD0000, "", { 0 },
{
{
"C000", 0xC0000
},
{
"C400", 0xC4000
},
{
"C800", 0xC8000
},
{
"CC00", 0xCC000
},
{
"D000", 0xD0000
},
{
"D400", 0xD4000
},
{
"D800", 0xD8000
},
{
"DC00", 0xDC000
},
{
""
}
},
},
{
"ram_size", "RAM size", CONFIG_SELECTION, "", 16384, "", { 0 },
{
{
"16 kB", 16384
},
{
"64 kB", 65536
},
{
""
}
},
},
{
"mac", "MAC Address", CONFIG_MAC, "", -1
},
{
"", "", -1
}
static const device_config_t wd8013_config[] = {
{
"base", "Address", CONFIG_HEX16, "", 0x280, "", { 0 },
{
{ "0x200", 0x200 },
{ "0x220", 0x220 },
{ "0x240", 0x240 },
{ "0x260", 0x260 },
{ "0x280", 0x280 },
{ "0x2A0", 0x2A0 },
{ "0x2C0", 0x2C0 },
{ "0x300", 0x300 },
{ "0x340", 0x340 },
{ "0x380", 0x380 },
{ "" }
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{ "IRQ 2/9", 9 },
{ "IRQ 3", 3 },
{ "IRQ 4", 4 },
{ "IRQ 5", 5 },
{ "IRQ 7", 7 },
{ "IRQ 10", 10 },
{ "IRQ 11", 11 },
{ "IRQ 15", 15 },
{ "" }
},
},
{
"ram_addr", "RAM address", CONFIG_HEX20, "", 0xD0000, "", { 0 },
{
{ "C000", 0xC0000 },
{ "C400", 0xC4000 },
{ "C800", 0xC8000 },
{ "CC00", 0xCC000 },
{ "D000", 0xD0000 },
{ "D400", 0xD4000 },
{ "D800", 0xD8000 },
{ "DC00", 0xDC000 },
{ "" }
},
},
{
"ram_size", "RAM size", CONFIG_SELECTION, "", 16384, "", { 0 },
{
{ "16 kB", 16384 },
{ "64 kB", 65536 },
{ "" }
},
},
{ "mac", "MAC Address", CONFIG_MAC, "", -1 },
{ "", "", -1 }
};
static const device_config_t mca_mac_config[] =
{
{
"mac", "MAC Address", CONFIG_MAC, "", -1
},
{
"", "", -1
}
static const device_config_t mca_mac_config[] = {
{ "mac", "MAC Address", CONFIG_MAC, "", -1 },
{ "", "", -1 }
};
// clang-format on
const device_t wd8003e_device = {
"Western Digital WD8003E",

View File

@@ -81,26 +81,28 @@ static const device_t net_none_device = {
static netcard_t net_cards[] = {
{ &net_none_device, NULL },
{ &threec503_device, NULL },
{ &pcnet_am79c960_device, NULL },
{ &pcnet_am79c961_device, NULL },
{ &ne1000_device, NULL },
{ &ne2000_device, NULL },
{ &pcnet_am79c960_eb_device, NULL },
{ &rtl8019as_device, NULL },
{ &wd8003e_device, NULL },
{ &wd8003eb_device, NULL },
{ &wd8013ebt_device, NULL },
{ &plip_device, NULL },
{ &ethernext_mc_device, NULL },
{ &wd8003eta_device, NULL },
{ &wd8003ea_device, NULL },
{ &pcnet_am79c973_device, NULL },
{ &pcnet_am79c970a_device, NULL },
{ &rtl8029as_device, NULL },
{ &pcnet_am79c960_vlb_device, NULL },
{ NULL, NULL }
// clang-format off
{ &net_none_device, NULL },
{ &threec503_device, NULL },
{ &pcnet_am79c960_device, NULL },
{ &pcnet_am79c961_device, NULL },
{ &ne1000_device, NULL },
{ &ne2000_device, NULL },
{ &pcnet_am79c960_eb_device, NULL },
{ &rtl8019as_device, NULL },
{ &wd8003e_device, NULL },
{ &wd8003eb_device, NULL },
{ &wd8013ebt_device, NULL },
{ &plip_device, NULL },
{ &ethernext_mc_device, NULL },
{ &wd8003eta_device, NULL },
{ &wd8003ea_device, NULL },
{ &pcnet_am79c973_device, NULL },
{ &pcnet_am79c970a_device, NULL },
{ &rtl8029as_device, NULL },
{ &pcnet_am79c960_vlb_device, NULL },
{ NULL, NULL }
// clang-format off
};

View File

@@ -69,12 +69,14 @@ static pcap_t *(*f_pcap_open_live)(const char *,int,int,int,char *);
static int (*f_pcap_next_ex)(pcap_t*,struct pcap_pkthdr**,const unsigned char**);
static void (*f_pcap_close)(pcap_t *);
static dllimp_t pcap_imports[] = {
{ "pcap_findalldevs", &f_pcap_findalldevs },
{ "pcap_freealldevs", &f_pcap_freealldevs },
{ "pcap_open_live", &f_pcap_open_live },
{ "pcap_next_ex", &f_pcap_next_ex },
{ "pcap_close", &f_pcap_close },
{ NULL, NULL },
// clang-format off
{ "pcap_findalldevs", &f_pcap_findalldevs },
{ "pcap_freealldevs", &f_pcap_freealldevs },
{ "pcap_open_live", &f_pcap_open_live },
{ "pcap_next_ex", &f_pcap_next_ex },
{ "pcap_close", &f_pcap_close },
{ NULL, NULL },
// clang-format on
};