VOID ShowNetworkSettings(OAL_BLMENU_ITEM *pMenu) { BOOL fValidExtMacAddr; UINT16 mac[3]; UNREFERENCED_PARAMETER(pMenu); memset(mac,0xFF,sizeof(mac)); LAN911XGetMacAddress(OALPAtoUA((DWORD) BSP_LAN9311_REGS_PA),mac); if (((mac[0]== 0xFFFF) && (mac[1] == 0xFFFF) && (mac[2] == 0xFFFF)) || ((mac[0]== 0x0) && (mac[1] == 0x0) && (mac[2] == 0x0))) { fValidExtMacAddr = FALSE; } else { fValidExtMacAddr = TRUE; } OALLog(L"\r\n Network:\r\n"); OALLog( L" KITL state: %s\r\n", (g_bootCfg.kitlFlags & OAL_KITL_FLAGS_ENABLED) ? L"enabled" : L"disabled" ); OALLog( L" KITL type: %s\r\n", (g_bootCfg.kitlFlags & OAL_KITL_FLAGS_PASSIVE) ? L"passive" : L"active" ); OALLog( L" KITL mode: %s\r\n", (g_bootCfg.kitlFlags & OAL_KITL_FLAGS_POLL) ? L"polled" : L"interrupt" ); OALLog( L" DHCP: %s\r\n", (g_bootCfg.kitlFlags & OAL_KITL_FLAGS_DHCP) ? L"enabled" : L"disabled" ); OALLog(L" IP address: %s\r\n", OALKitlIPtoString(g_bootCfg.ipAddress)); OALLog(L" IP mask: %s\r\n", OALKitlIPtoString(g_bootCfg.ipMask)); OALLog(L" IP router: %s\r\n", OALKitlIPtoString(g_bootCfg.ipRoute)); OALLog(L" Internal Eth MAC Addr: %s\r\n", OALKitlMACtoString(g_bootCfg.mac)); OALLog(L" External Eth MAC Addr: %s\r\n", fValidExtMacAddr ? OALKitlMACtoString(mac) : L"Not programmed"); OALLog( L" VMINI: %s\r\n", (g_bootCfg.kitlFlags & OAL_KITL_FLAGS_VMINI) ? L"enabled" : L"disabled" ); OALLog(L" Note: USBFN RNDIS MAC Addr cannot be changed.\r\n"); OALBLMenuReadKey(TRUE); }
VOID OALBLMenuSetIpMask(OAL_BLMENU_ITEM *pMenu) { LPCWSTR title = pMenu->pParam1; UINT32 *pIp = pMenu->pParam2; UINT32 ip; WCHAR buffer[16]; // First check input parameters if (title == NULL || pIp == NULL) { OALMSG(OAL_ERROR, ( L"ERROR: OALBLMenuSetIpMask: Invalid parameters\r\n" )); goto cleanUp; } // Get actual value ip = *pIp; // Print prompt OALLog(L" Enter %s IP mask (actual %s): ", title, OALKitlIPtoString(ip)); // Read input line if (OALBLMenuReadLine(buffer, dimof(buffer)) == 0) goto cleanUp; // Convert string to MAC address ip = OALKitlStringToIP(buffer); if (ip == 0) { OALLog(L" '%s' isn't valid IP mask\r\n", buffer); goto cleanUp; } // Print final IP mask OALLog(L" %s IP mask set to %s\r\n", title, OALKitlIPtoString(ip)); // Save new setting *pIp = ip; cleanUp:; }
VOID ShowNetworkSettings(OAL_BLMENU_ITEM *pMenu) { OALLog(L"\r\n Network:\r\n"); OALLog( L" KITL state: %s\r\n", (g_bootCfg.kitlFlags & OAL_KITL_FLAGS_ENABLED) ? L"enabled" : L"disabled" ); OALLog( L" KITL mode: %s\r\n", (g_bootCfg.kitlFlags & OAL_KITL_FLAGS_POLL) ? L"poll" : L"interrupt" ); OALLog( L" DHCP: %s\r\n", (g_bootCfg.kitlFlags & OAL_KITL_FLAGS_DHCP) ? L"enabled" : L"disabled" ); OALLog(L" IP address: %s\r\n", OALKitlIPtoString(g_bootCfg.ipAddress)); OALLog(L" IP mask: %s\r\n", OALKitlIPtoString(g_bootCfg.ipMask)); OALLog(L" IP router: %s\r\n", OALKitlIPtoString(g_bootCfg.ipRoute)); OALLog( L" VMINI: %s\r\n", (g_bootCfg.kitlFlags & OAL_KITL_FLAGS_VMINI) ? L"enabled" : L"disabled" ); }
BOOL OEMKitlStartup(void) { OAL_KITL_ARGS kitlArgs; OAL_KITL_ARGS *pArgs; BOOL bRet = FALSE; UCHAR *szDeviceId,buffer[OAL_KITL_ID_SIZE]="\0"; OALMSG(OAL_KITL&&OAL_FUNC, (L"[KITL] ++OEMKitlStartup()\r\n")); OALMSG(TRUE, (L"[KITL] ++OEMKitlStartup()\r\n")); memset(&kitlArgs, 0, sizeof (kitlArgs)); pArgs = (OAL_KITL_ARGS *)OALArgsQuery(OAL_ARGS_QUERY_KITL); szDeviceId = (UCHAR*)OALArgsQuery(OAL_ARGS_QUERY_DEVID); // Common parts kitlArgs.devLoc.IfcType = InterfaceTypeUndefined; g_kitlDevice.ifcType = InterfaceTypeUndefined; if((pArgs->flags & OAL_KITL_FLAGS_ENABLED) == 0) { RETAILMSG(1,(TEXT("KITL was Disabled from EBOOT !!\r\nPlease set KITL Configuration in EBoot !!\r\n"))); return FALSE; } #ifdef KITL_SERIAL KITLOutputDebugString ("[KITL] KITL: Serial\n"); bRet = InitKitlSerialArgs (&kitlArgs); strcpy(buffer,"6400SerialKITL"); szDeviceId = buffer; g_kitlDevice.id = kitlArgs.devLoc.LogicalLoc; #endif #ifdef KITL_USBSERIAL KITLOutputDebugString ("[KITL] KITL: USB Serial\n"); bRet = InitKitlUSBSerialArgs (&kitlArgs); strcpy(buffer,"6400USBSerialKITL"); szDeviceId = buffer; g_kitlDevice.id = kitlArgs.devLoc.LogicalLoc; #endif #ifdef KITL_USBRNDIS // TODO: TO be implemented #endif #ifdef KITL_ETHERNET KITLOutputDebugString("[KITL]: Ethernet\r\n"); if (pArgs->devLoc.LogicalLoc == 0) { KITLOutputDebugString ("[KITL] pArgs = NULL\n"); bRet = InitKitlEtherArgs(&kitlArgs); OALKitlCreateName(BSP_DEVICE_PREFIX, kitlArgs.mac, buffer); szDeviceId = buffer; g_kitlDevice.id = kitlArgs.devLoc.LogicalLoc; } else { KITLOutputDebugString ("[KITL] Kitl args bring from argument setting of RAM\n"); pArgs->flags |= OAL_KITL_FLAGS_VMINI; memcpy(&kitlArgs, pArgs, sizeof(kitlArgs)); g_kitlDevice.name = L"6400Ethernet"; g_kitlDevice.ifcType = kitlArgs.devLoc.IfcType; g_kitlDevice.id = kitlArgs.devLoc.LogicalLoc; g_kitlDevice.type = OAL_KITL_TYPE_ETH; g_kitlDevice.pDriver = (void *)&g_kitlEthCS8900A; bRet = TRUE; } #endif // KITL_ETHERNET RETAILMSG(KITL_DBON, (L"DeviceId................. %hs\r\n", szDeviceId)); RETAILMSG(KITL_DBON, (L"kitlArgs.flags............. 0x%x\r\n", kitlArgs.flags)); RETAILMSG(KITL_DBON, (L"kitlArgs.devLoc.IfcType.... %d\r\n", kitlArgs.devLoc.IfcType)); RETAILMSG(KITL_DBON, (L"kitlArgs.devLoc.LogicalLoc. 0x%x\r\n", kitlArgs.devLoc.LogicalLoc)); RETAILMSG(KITL_DBON, (L"kitlArgs.devLoc.PhysicalLoc 0x%x\r\n", kitlArgs.devLoc.PhysicalLoc)); RETAILMSG(KITL_DBON, (L"kitlArgs.devLoc.Pin........ %d\r\n", kitlArgs.devLoc.Pin)); RETAILMSG(KITL_DBON, (L"kitlArgs.ip4address........ %s\r\n", OALKitlIPtoString(kitlArgs.ipAddress))); if (bRet == FALSE) { KITLOutputDebugString ("[KITL] KITL: None\n"); RETAILMSG(TRUE, (TEXT("[KITL] KITL Argument Initialize Fail !!\n"))); return FALSE; } KITLOutputDebugString ("[KITL] Call OALKitlInit()\r\n"); bRet = OALKitlInit ((LPCSTR)szDeviceId, &kitlArgs, &g_kitlDevice); OALMSG(OAL_KITL&&OAL_FUNC, (L"[KITL] --OEMKitlStartup() = %d\r\n", bRet)); OALMSG(TRUE, (L"[KITL] --OEMKitlStartup() = %d\r\n", bRet)); return bRet; }