BOOL InitKitlEtherArgs (OAL_KITL_ARGS *pKitlArgs) { // Initialize flags pKitlArgs->flags = OAL_KITL_FLAGS_ENABLED | OAL_KITL_FLAGS_VMINI; #ifdef CS8900A_KITL_POLLMODE pKitlArgs->flags |= OAL_KITL_FLAGS_POLL; #endif #ifdef CS8900A_KITL_DHCP pKitlArgs->flags |= OAL_KITL_FLAGS_DHCP; #endif pKitlArgs->devLoc.IfcType = Internal; pKitlArgs->devLoc.BusNumber = 0; pKitlArgs->devLoc.LogicalLoc = BSP_BASE_REG_PA_CS8900A_IOBASE; pKitlArgs->devLoc.Pin = 0; OALKitlStringToMAC(CS8900A_MAC,pKitlArgs->mac); #ifndef CS8900A_KITL_DHCP pKitlArgs->ipAddress = OALKitlStringToIP(CS8900A_IP_ADDRESS); pKitlArgs->ipMask = OALKitlStringToIP(CS8900A_IP_MASK); pKitlArgs->ipRoute = OALKitlStringToIP(CS8900A_IP_ROUTER); #endif g_kitlDevice.name = L"6400Ethernet"; g_kitlDevice.ifcType = Internal; g_kitlDevice.type = OAL_KITL_TYPE_ETH; g_kitlDevice.pDriver = (void *)&g_kitlEthCS8900A; //configure nCS3 for cs8900a InitSROMC_CS8900(); //setting EINT10 as IRQ_LAN if (!(pKitlArgs->flags & OAL_KITL_FLAGS_POLL)) { g_pGPIOReg = (S3C6400_GPIO_REG *)OALPAtoVA(S3C6400_BASE_REG_PA_GPIO, FALSE); g_pGPIOReg->GPNCON = (g_pGPIOReg->GPNCON & ~(0x3<<20)) | (0x2<<20); g_pGPIOReg->GPGPUD = (g_pGPIOReg->GPGPUD & ~(0x3<<20)); // pull-up/down disable g_pGPIOReg->EINT0CON0 = (g_pGPIOReg->EINT0CON0 & ~(0x7<<20)) | (0x1<<20); // High Level trigger } return 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:; }