01 // vim: set ft=c: 02 03 #exe { 04 #include "::/Adam/HwSupp/Pci" 05 06 U8* native_driver = NULL; 07 I64 b, d, f; 08 09 if (PciFindByID(0x1022, 0x2000, &b, &d, &f)) 10 native_driver = "PCNet"; 11 12 // If we're using the native stack, load it system-wide 13 if (native_driver != NULL) { 14 StreamPrint("U8* SNAILNET_NATIVE_DRIVER = \"%s\";\n", native_driver); 15 16 // Hardware support 17 StreamPrint("#include \"::/Adam/Net/NetFifo\""); 18 StreamPrint("#include \"::/Adam/HwSupp/%s\"", native_driver); 19 20 // Contains a lot of common definitions, probably should be cleaned up 21 StreamPrint("#include \"::/Adam/Net/NativeSocket\""); 22 23 // L2 24 StreamPrint("#include \"::/Adam/Net/Ethernet\""); 25 26 // L3 27 StreamPrint("#include \"::/Adam/Net/Arp\""); 28 StreamPrint("#include \"::/Adam/Net/IPv4\""); 29 30 // L4 31 StreamPrint("#include \"::/Adam/Net/Icmp\""); 32 StreamPrint("#include \"::/Adam/Net/Tcp\""); 33 StreamPrint("#include \"::/Adam/Net/Udp\""); 34 35 // L7 36 StreamPrint("#include \"::/Adam/Net/Dns\""); 37 38 // Handler Task 39 StreamPrint("#include \"::/Adam/Net/NetHandlerTask\""); 40 41 StreamPrint("#include \"::/Adam/Net/Netcfg\""); 42 } 43 else 44 StreamPrint("U8* SNAILNET_NATIVE_DRIVER = NULL;\n", native_driver); 45 }