/*add by aizhanlong 00169427 for DTS2011102004063 wifi can't enable by wifi button before disable wifi using web*/ int sysSetWirelessStatus(int status) { if ( status == 1 ) { return (boardIoctl(BOARD_IOCTL_CHECK_WLAN_STATUS, 17, "", 0, 0, "")); } return (boardIoctl(BOARD_IOCTL_CHECK_WLAN_STATUS, 18, "", 0, 0, "")); }
//****************************************************************************** // Configure GPIO bit according to the passed values //****************************************************************************** static void sysGpioCtrl (int gpioNum, int gpioState) { int boardFd; if ((boardFd = open("/dev/brcmboard", O_RDWR)) == -1) printf("Unable to open device /dev/brcmboard.\n"); boardIoctl(boardFd, BOARD_IOCTL_GPIO_CTRL, 0, "", gpioNum, gpioState); close(boardFd); }
int sysFlashImageSet(void *image, int size, int addr, BOARD_IOCTL_ACTION imageType) { int result; result = boardIoctl(BOARD_IOCTL_FLASH_WRITE, imageType, image, size, addr, ""); return(result); }
static void sysLedCtrl(BOARD_LED_NAME ledName, BOARD_LED_STATE ledState) { int boardFd; if ((boardFd = open("/dev/brcmboard", O_RDWR)) == -1) printf("Unable to open device /dev/brcmboard.\n"); boardIoctl(boardFd, BOARD_IOCTL_LED_CTRL, 0, "", (int)ledName, (int)ledState); close(boardFd); }
//******************************************************************************** // Set monitor loop file descriptor //******************************************************************************** int sysSetMonitorFd(int fd) { return (boardIoctl(BOARD_IOCTL_SET_MONITOR_FD, 0, "", 0, fd, "")); }
//******************************************************************************** // Get Chip Id //******************************************************************************** int sysGetChipId( void ) { return( boardIoctl(BOARD_IOCTL_GET_CHIP_ID, 0, "", 0, 0, "") ); }
/***************************************************************************** * sysRsiSet - write the contents of rsi flash memory * RETURNS: OK, always. */ int sysRsiSet(char *string, int strLen, int offset) { return (boardIoctl(BOARD_IOCTL_FLASH_WRITE, RSI, string, strLen, offset, "")); }
//****************************************************************************** // Configure GPIO bit according to the passed values //****************************************************************************** int sysSetGpioBit (int gpio_bit, GPIO_STATE_t flag) { return(boardIoctl(BOARD_IOCTL_SET_GPIO, 0, "", gpio_bit, flag, "")); }
int sysGetEquipTestMode(void) { return (boardIoctl(BOARD_IOCTL_GET_EQUIPTEST_MODE, 0, NULL, 0, 0, NULL)); }
//******************************************************************************** // Get SDRAM size //******************************************************************************** int sysGetSdramSize( void ) { return( boardIoctl(BOARD_IOCTL_GET_SDRAM_SIZE, 0, "", 0, 0, "") ); }
int sysGetKeyMode(void) { return (boardIoctl(BOARD_IOCTL_GET_KEY_MODE, 0, NULL, 0, 0, NULL)); }
//******************************************************************************** // Get MAC Address //******************************************************************************** int sysGetMacAddress( unsigned char *pucaAddr, unsigned long ulId ) { return(boardIoctl(BOARD_IOCTL_GET_MAC_ADDRESS, 0, pucaAddr, 6, (int) ulId, "")); }
//******************************************************************************** // Release MAC Address //******************************************************************************** int sysReleaseMacAddress( unsigned char *pucaAddr ) { return( boardIoctl(BOARD_IOCTL_RELEASE_MAC_ADDRESS, 0, pucaAddr, 6, 0, "") ); }
//******************************************************************************** // Get board id //******************************************************************************** int sysGetBoardIdName(char *name, int length) { return( boardIoctl(BOARD_IOCTL_GET_ID, 0, name, length, 0, "") ); }
//******************************************************************************** // LED status display: ADSL link: DOWN/UP, PPP: DOWN/STARTING/UP //******************************************************************************** void sysLedCtrl(BOARD_LED_NAME ledName, BOARD_LED_STATE ledState) { boardIoctl(BOARD_IOCTL_LED_CTRL, 0, "", (int)ledName, (int)ledState, ""); }
//******************************************************************************** // Wakeup monitor task //******************************************************************************** void sysWakeupMonitorTask(void) { boardIoctl(BOARD_IOCTL_WAKEUP_MONITOR_TASK, 0, "", 0, 0, ""); }
//****************************************************************************** // Get VCOPE board information: cs, gpio, board revision //****************************************************************************** int sysGetVcopeInfo(int info_type) { return(boardIoctl(BOARD_IOCTL_GET_VCOPE_GPIO, 0, "", 0, info_type, "")); }
/***************************************************************************** * sysSetBootline - write the bootline to nvram * RETURNS: OK, always. */ int sysSetBootline(char *string, int strLen) { return (boardIoctl(BOARD_IOCTL_SET_BOOTLINE, 0, string, strLen, 0, "")); }
//****************************************************************************** // Configure Chip Select, by setting given parameter to a passed value //****************************************************************************** int sysConfigCs (int cs_number, void *cs_info) { return(boardIoctl(BOARD_IOCTL_SET_CS_PAR, 0, "", 0, cs_number, cs_info)); }
int sysSetCliPid(int iPid) { return (boardIoctl(BOARD_IOCTL_SET_TELNETD_PID, 0, NULL, 0, iPid, NULL)); }
//****************************************************************************** // Set up PLL clock register according to the passed values //****************************************************************************** int sysSetPllClockRegister(mask, value) { return(boardIoctl(BOARD_IOCTL_SET_PLL, 0, "", mask, value, "")); }
//******************************************************************************** // Get MAC Address //******************************************************************************** int sysGetBaseMacAddress( unsigned char *pucaAddr ) { return(boardIoctl(BOARD_IOCTL_EQUIPMENT_TEST, GET_BASE_MAC_ADDRESS, pucaAddr, 6, 0, "")); }
int sysGetPCBVersion(void) { return (boardIoctl(BOARD_IOCTL_EQUIPMENT_TEST, GET_PCB_VERSION, "", 0, 0, "")); }
//******************************************************************************** // Get number of Ethernet phys //******************************************************************************** int sysGetNumEnet(void) { return(boardIoctl(BOARD_IOCTL_GET_NUM_ENET, 0, "", 0, 0, "")); }
/***************************************************************************** * sysScratchPadGet - get the contents of persistent stratch pad flash memory * INPUT: tokenId -- token id, ASCIZ tokBuf (up to 15 char) * tokBuf -- buf * bufLen -- buf len * RETURNS: 0 - ok, -1 fail. */ int sysScratchPadGet(char *tokenId, char *tokBuf, int bufLen) { return (boardIoctl(BOARD_IOCTL_FLASH_READ, SCRATCH_PAD, tokenId, bufLen, bufLen, tokBuf)); }
/***************************************************************************** * kerSysMipsSoftReset - soft reset the mips. (reboot, go to 0xbfc00000) * RETURNS: NEVER */ void sysMipsSoftReset(void) { boardIoctl(BOARD_IOCTL_MIPS_SOFT_RESET, 0, "", 0, 0, ""); }
//******************************************************************************** // Get RSI size //******************************************************************************** int sysGetRsiSize( void ) { return( boardIoctl(BOARD_IOCTL_GET_RSI_SIZE, 0, "", 0, 0, "") ); }
//******************************************************************************** // Get board Ethernet configuration //******************************************************************************** int sysGetEnetCfg(char *string, int strLen) { return(boardIoctl(BOARD_IOCTL_GET_ENET_CFG, 0, string, strLen, 0, "")); }
//******************************************************************************** // Get CFE vesion info //******************************************************************************** int sysGetCFEVersion(char *string, int strLen) { return (boardIoctl(BOARD_IOCTL_GET_CFE_VER, 0, string, strLen, 0, "")); }
/*start of 增加 WPS 状态检测 by s53329 at 20090722*/ int sysCheckWirelessWpsStatus(void) { return (boardIoctl(BOARD_IOCTL_CHECK_WLAN_WPS_STATUS, 0, "", 0, 0, "")); }