亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? lan91c96.c

?? 移植到WLIT項目的redboot源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
** INPUT PARAMETERS:*    LAN91C96_ContextT *ctxP - Pointer to the LAN91C96 Device Context Structure*    UINT16 offset - Offset within the EEPROM to read.** RETURNS:*    Contents of the EEPROM at the specified location.** GLOBAL EFFECTS:*    None.** ASSUMPTIONS:*    None.** CALLS:*    WriteByte, WriteWord, ReadWord, getTimer, getDelta, LOGERROR** CALLED BY:*    LAN91C96HWSetup** PROTOTYPE:*    static*    UINT16 ReadEEPROM(LAN91C96_ContextT *ctxP, UINT16 offset);*********************************************************************************/staticUINT16 ReadEEPROM(LAN91C96_ContextT *ctxP, UINT16 offset){    PVUINT32 ioRegsP = ctxP->LAN91C96IoP;     // Get pointer to I/O space    UINT16   lanReg;                          // Temporary holding register    unsigned long start, timebase = __TIMEBASE ; //ostCtxP->getTimebase_fnp(ostCtxP);    UINT timeout = (UINT)((LAN91C96_TO_EEPROM * timebase)>>20);    // Assume success.    ctxP->loggedError = 0;    // Select Bank 2    WriteByte(BANK2, &ioRegsP[LAN91C96_BANK_SELECT]);    // Set the LAN91C96 pointer register to the specified EEPROM address.    WriteWord(offset, &ioRegsP[LAN91C96_POINTER]);    // Select Bank 1    WriteByte(BANK1, &ioRegsP[LAN91C96_BANK_SELECT]);    // Read the Control Register.    lanReg = ReadWord(&ioRegsP[LAN91C96_CONTROL]);    // The LAN91C96 reads the Configuration, Base and Individual Address, and    // STORE writes the Configuration and Base registers. Also when set it will     // read the EEPROM and update relevant registers with its contents. This bit    // then Clears upon completing the operation.    lanReg |= (LAN91C96_CTR_RELOAD | LAN91C96_CTR_EEPROM);    // Store the data to EEPROM.    WriteWord(lanReg, &ioRegsP[LAN91C96_CONTROL]);    // Prepare for timeout by getting the initial time interval.    hal_clock_read((cyg_uint32 *)&start) ;    // Verify that the data was read successfully. This assumes Bank 1 has    // been selected from the previous operation.    while (1)    {        // Read the Control Register.        lanReg = ReadWord(&ioRegsP[LAN91C96_CONTROL]);        // Only interested in the STORE and RELOAD bits.        lanReg &= (LAN91C96_CTR_STORE | LAN91C96_CTR_RELOAD);        // Complete when the STORE and RELOAD bits are cleared.        if (0 == lanReg)        {            break;        }        // Get the current time interval.				//hal_elapsed_ticks(&start) ;				//printf("currTimerValue-start=%d\n", currTimerValue-start) ;        if (hal_elapsed_ticks(&start) > timeout)        {         /*   LOGERROR(ctxP->loggedError, ERR_L_LAN91C96, ERR_LAN91C96_EEPROM,                     ERR_T_TIMEOUT, 0, 0, 0);*/            printf("ReadEEPROM:LAN91C96: Access timeout!");            return (-1);        }				    }    // Read the EEPROM data and return.    return (ReadWord(&ioRegsP[LAN91C96_GEN_PURPOSE]));}/********************************************************************************** FUNCTION:*    WriteEEPROM** DESCRIPTION:*    This routine provides access to the 64 x 16-bit EEPROM attached to the*    LAN91C96.  The procedure for accessing the EEPROM are described in the*    LAN91C96 data sheet on pages 98 - 100.** INPUT PARAMETERS:*    LAN91C96_ContextT *ctxP - Pointer to the LAN91C96 Device Context Structure*    UINT16 offset - Offset within the EEPROM to write.*    UINT16 value - Value to write into EEPROM.** RETURNS:*    None.** GLOBAL EFFECTS:*    None.** ASSUMPTIONS:*    None.** CALLS:*    WriteByte, WriteWord, ReadWord, getTimer, getDelta, LOGERROR** CALLED BY:*    LAN91C96HWSetup** PROTOTYPE:*    static*    VOID WriteEEPROM(LAN91C96_ContextT *ctxP, UINT16 offset, UINT16 value);*********************************************************************************/staticVOID WriteEEPROM(LAN91C96_ContextT *ctxP, UINT16 offset, UINT16 value){    PVUINT32 ioRegsP = ctxP->LAN91C96IoP;     // Get pointer to I/O space    UINT16   lanReg;                          // Temporary holding register    UINT32 start ;     UINT32 timeout = (UINT32)((LAN91C96_TO_EEPROM * (3686400>>7))>>13);    // Assume success.    ctxP->loggedError = 0;    // Select Bank 2    WriteByte(BANK2, &ioRegsP[LAN91C96_BANK_SELECT]);    // Set the LAN91C96 pointer register to the specified EEPROM address.    WriteWord(offset, &ioRegsP[LAN91C96_POINTER]);    // Select Bank 1    WriteByte(BANK1, &ioRegsP[LAN91C96_BANK_SELECT]);    // Write the specified data to the EEPROM.    WriteWord(value, &ioRegsP[LAN91C96_GEN_PURPOSE]);    // Read the Control Register. This assumes Bank1 is selected.    lanReg = ReadWord(&ioRegsP[LAN91C96_CONTROL]);    // The STORE LAN91C96 bit when set, stores the contents of all relevant    // registers in the serial EEPROM. This bit is cleared upon completing    // the operation.    //    // Note: When an EEPROM access is in progress the STORE and RELOAD bits    // will be read back as high. The remaining 14 bits of this registers will    // be invalid. During this time, attempted read/write operations, other    // than polling the EEPROM status, will NOT have any effect the internal    // registers. The CPU can resume accesses to the LAN91C96 after both bits    // are low. A worst case RELOAD operation initated by RESET or by software    // takes less than 750 usec in either mode.    lanReg |= (LAN91C96_CTR_STORE | LAN91C96_CTR_EEPROM);    // Store the data to EEPROM. This assumes Bank 1 is selected.    WriteWord(lanReg, &ioRegsP[LAN91C96_CONTROL]);    // Prepare for timeout by getting the initial time interval.    hal_clock_read(&start) ;    // Verify that the data was read successfully. This assumes Bank 1 has    // been selected from the previous operation.    while (1)    {        // Read the Control Register.        lanReg = ReadWord(&ioRegsP[LAN91C96_CONTROL]);        // Only interested in the STORE and RELOAD bits.        lanReg &= (LAN91C96_CTR_STORE | LAN91C96_CTR_RELOAD);        // Complete when the STORE and RELOAD bits are cleared.        if (0 == lanReg)        {            break;        }				//printf("WriteEEPROM:currTimerValue-start=%d\n", start) ;        if (hal_elapsed_ticks((unsigned long *)&start) > timeout)        {         /*   LOGERROR(ctxP->loggedError, ERR_L_LAN91C96, ERR_LAN91C96_EEPROM,                     ERR_T_TIMEOUT, 0, 0, 0);*/            printf("WriteEEPROM:LAN91C96: Access timeout!\n");            return;        }				    }}/********************************************************************************** FUNCTION:*    AllocateTxPacket** DESCRIPTION:*    This routine will allocate a transmit frame from the LAN91C96 MMU.** INPUT PARAMETERS:*    LAN91C96_ContextT *ctxP - Pointer to the LAN91C96 Device Context Structure*    INT length - Size of the transmit buffer.*    PUINT16 handle - Returned frame number.** RETURNS:*    0 - Error, error code in ctxP->loggedError.*    non-zero - The allocated frame number.** GLOBAL EFFECTS:*    None.** ASSUMPTIONS:*    None.** CALLS:*    WriteByte - To write a byte to either the attribute or I/O space.*    WriteWord - To write a word to either the attribute or I/O space.*    ReadByte - Read a byte from either the attribute or I/O space.*    ReadWord - Read a word from either the attribute or I/O space.*    DM_ErrPrintf - Display error string.*    LOGERROR - Logs errors encountered.** CALLED BY:*    LAN91C96HWSetup, LAN91C96TransmitPacket.** PROTOTYPE:*    static*    INT AllocateTxPacket(LAN91C96_ContextT *ctxP, INT length);**    See page 36 in the LAN91C96 specification for details.**    RAM*  Offset    15         8          0*            +---------------------+*     0      \    Status Word      \    Transmit/Receive Status*            \---------------------\*     2      \ RESVD \  Byte Count \    Total number of bytes in frame *            \---------------------\*     4      \                     \*            ~      Data Area      ~    Data packet*            ~                     ~*            \                     \*            \---------------------\*  1536 Max  \ Control  \ Odd byte \    Control status and/or last data byte* (6 x 256)  +---------------------+** The minimum Ethernet frame on the wire includes the following:*     Inter Frame Gap - 12 Bytes*     MAC Preamble - 8 Bytes *     MAC Destination Address - 6 Bytes *     MAC Source Address - 6 Bytes *     MAC Type (or Length) - 2 Bytes *     Payload (Network PDU) - 46 Bytes *     Check Sequence (CRC) - 4 Bytes *     Total Frame Physical Size - 84 Bytes ** The maximum Ethernet frame on the wire includes the following:*    Inter Frame Gap - 12 Bytes *    MAC Preamble - 8 Bytes *    MAC Destination Address - 6 Bytes *    MAC Source Address -  6 Bytes *    MAC Type (or Length) - 2 Bytes *    Payload (Network PDU) - 1500 Bytes *    Check Sequence (CRC) - 4 Bytes *   Total Frame Physical Size - 1538 Bytes ** The LAN91C96 MMU consists of 24 pages each 256 bytes for a maximum of* 6144 bytes. The maximum number of pages per packet is 6, thus the maximum* size packet is 1536 bytes.** Each packet contains 5 bytes of overhead, 2 for the Status Word, 2 for* the byte count and 1 byte for control information.** The Status Word for a transmit is as follows:* 15                                                                         0* +--------------------------------------------------------------------------+* \ TX UNRN \ LINK_OK \ RES \ CTR_ROL \ EXC_DEF\ LOST CARR \ LASTCOL\ WAKEUP \* +--------------------------------------------------------------------------+* \ TX DEFR \ LTX BRD \ SQET \ 16COL \ LTX MULT \ MUL COL \ SNGL COL \ TX_SUC\* +--------------------------------------------------------------------------+** The Status Word for a receive is as follows:* 15                                                                         0* +--------------------------------------------------------------------------+* \ ALGN ERR \ BROD CAST \ BADCRC \ ODDFRM \ TOOLNG \ TOO SHORT\       \     \* +--------------------------------------------------------------------------+* \          \                   Hash Value                           \ MULT \* +          \--------------------------------------------------------\ CAST \  * \          \    5   \    4   \    3    \    2   \    1    \    0    \      \    * +--------------------------------------------------------------------------+** The Byte Count is the total number of words including the Status Word,* the Byte Count Word, the Data Area and the Control Byte divided by 2.** The Data Area contains the Ethernet header and the payload. The maximum size* Ethernet packet is 1514.** The Data Area is used to store the frame. The Ethernet header contains 14* bytes of information. The header includes 6 bytes for the destination* address, 6 bytes for the source address and 2 bytes for the protocol type.* The payload follows the Ethernet header and can be a maximum of 1500 bytes.* The data area does not include the 4 bytes needed on the wire for the CRC.** The Control Byte is as follows:* +---------------------------------------------------------------+* \   X   \   X   \  ODD  \  CRC  \   0   \   0   \   0   \   0   \* +---------------------------------------------------------------+** If the ODD bit is set, the last byte is right before the Control Byte.*********************************************************************************/externINT AllocateTxPacket(LAN91C96_ContextT *ctxP, INT length, PUINT16 handle){    PVUINT32 ioRegsP = ctxP->LAN91C96IoP;     // Get pointer to I/O space    UINT start, currTimerValue ;    UINT timeout = (UINT)((LAN91C96_TO_ALLOC * 3686400) >> 20) ;    UINT16 resultCode;    UINT16 bufferSize;    UINT16 tempHandle;    // Calculate the memory needed. This includes the status word, byte count    // data and control rounded up.    bufferSize = sizeof(UINT16) + sizeof(UINT16) + length + 1;    if (bufferSize & 1)    {        // Round the size up.        bufferSize++;    }    // Make sure we aren't attempting to send the maximum size Ethernet packet.    if ((bufferSize >> 8) > LAN91C96_MAX_PAGES)    {//      printf("in AllocateTxPacket - attempting to send the maximum size Ethernet packet.\n") ;        // Report the error.        return (1);    }    // Select Bank 2    WriteByte(BANK2, &ioRegsP[LAN91C96_BANK_SELECT]);    // Allocate memory in the buffer for the frame. The amount requested    // is specified by dividing the buffer size by 256.    WriteWord(LAN91C96_MMUCR_ALLOC_TX | (bufferSize >> 8),              &ioRegsP[LAN91C96_MMU]);    // Prepare for timeout by getting the initial time interval.    hal_clock_read(&start) ;//ostCtxP->getTimer_fnp(ostCtxP);    // Wait for the request to complete by monitoring the ALLOC INT bit in    // the Interrupt Status Register.    while (!ReadByte(&ioRegsP[LAN91C96_INT_STATS]) & LAN91C96_IST_ALLOC_INT)    {        // Get the current time interval.				hal_clock_read(&currTimerValue) ;        if (hal_elapsed_ticks((unsigned long *)&start) > timeout)        {            // Get the status word for display.            WriteWord(LAN91C96_PTR_READ, &ioRegsP[LAN91C96_POINTER]);            resultCode = ReadWord(&ioRegsP[LAN91C96_DATA_HIGH]);                        //printf("LAN91C96: Buffer allocation timeout\n");            return (-1);        }    }    // Get the packet number just allocated.    tempHandle = ReadWord(&ioRegsP[LAN91C96_PNR]);    *handle = tempHandle >> 8;    return (0);}/********************************************************************************** FUNCTION:*    DeallocateTxPacket** DESCRIPTION:*    This routine will deallocate a transmit buffer and clear any errors.** INPUT PARAMETERS:*    LAN91C96_ContextT *ctxP - Pointer to the LAN91C96 Device Context Structure** RETURNS:*    0 - Success*    non-zero - Error** GLOBAL EFFECTS:*    None.** ASSUMPTIONS:*    None.** CALLS:*    WriteByte - To write a byte to either the attribute or I/O space.*    WriteWord - To write a word to either the attribute or I/O space.*    ReadByte - Read a byte from either the attribute or I/O space.*    ReadWord - Read a word from either the attribute or I/O space.** CALLED BY:*    static*    LAN91C96HWSetup, LAN91C96TransmitPacket** PROTOTYPE:*    INT DeallocateTxPacket(LAN91C96_ContextT *ctxP);*********************************************************************************/externINT DeallocateTxPacket(LAN91C96_ContextT *ctxP){    PVUINT32 ioRegsP = ctxP->LAN91C96IoP;     // Get pointer to I/O space    UINT start, currTimerValue ;    UINT timeout = (UINT)((LAN91C96_TO_ALLOC * 3686400) >> 20) ;    UINT16 resultCode;    UCHAR intStatus;    // Select Bank 2    WriteByte(BANK2, &ioRegsP[LAN91C96_BANK_SELECT]);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
图片区日韩欧美亚洲| 五月天亚洲精品| 一区二区久久久| 久久综合综合久久综合| 91在线云播放| 国产偷国产偷亚洲高清人白洁| 亚洲一区二区三区中文字幕在线| 国产精品自拍网站| 欧美日韩精品一区二区在线播放| 国产午夜一区二区三区| 日韩专区在线视频| 91麻豆精东视频| 国产精品日产欧美久久久久| 奇米精品一区二区三区在线观看一 | 久久电影网站中文字幕| 91免费在线看| 综合精品久久久| 国产成人综合视频| 精品国产一区二区三区久久影院| 亚洲成av人片| 在线免费观看日本一区| 国产精品久久久久久久久搜平片 | 亚洲欧美成人一区二区三区| 国产麻豆精品theporn| 91精品一区二区三区在线观看| 综合网在线视频| 成人在线综合网站| 国产女主播视频一区二区| 精品一区二区三区蜜桃| 67194成人在线观看| 亚洲v中文字幕| 91成人网在线| 一区二区三区四区在线| 91麻豆123| 亚洲三级电影网站| 日本高清视频一区二区| 国产一本一道久久香蕉| 欧美一级欧美三级在线观看| 调教+趴+乳夹+国产+精品| 欧美在线三级电影| 亚洲一区二区在线视频| 欧美亚洲日本国产| 亚洲国产乱码最新视频| 欧美剧情片在线观看| 石原莉奈一区二区三区在线观看| 欧美人成免费网站| 久久精品国产秦先生| 亚洲精品在线网站| k8久久久一区二区三区| 一区二区三区小说| 欧美一区二区视频网站| 精品在线视频一区| 中文字幕第一区二区| 色噜噜狠狠一区二区三区果冻| 亚洲免费观看高清完整 | 波多野结衣视频一区| 一区二区三区中文字幕在线观看| 欧美天堂一区二区三区| 韩国欧美国产1区| 国产精品福利影院| 欧美日韩精品一区二区| 久88久久88久久久| 国产精品国产成人国产三级 | 一区二区三区国产精品| 91精品在线观看入口| 成人免费福利片| 亚洲成av人**亚洲成av**| 精品99999| 欧美午夜精品一区二区三区| 精品一区二区三区蜜桃| 亚洲精品成人在线| 精品免费视频.| 色综合av在线| 国产一区二区在线观看视频| **欧美大码日韩| 日韩免费一区二区三区在线播放| av一二三不卡影片| 麻豆91在线播放| 成人欧美一区二区三区1314| 日韩午夜精品电影| 99久久婷婷国产精品综合| 日韩av午夜在线观看| 中文字幕一区在线| 日韩女优电影在线观看| 欧美专区在线观看一区| 懂色一区二区三区免费观看| 亚洲r级在线视频| 国产精品乱码久久久久久| 91精品国产综合久久香蕉的特点| 99精品国产热久久91蜜凸| 久久国产精品免费| 亚洲成av人综合在线观看| 日本一区二区视频在线观看| 欧美一级欧美三级在线观看| 欧美中文字幕一二三区视频| 成人午夜视频福利| 国产精品综合网| 极品少妇一区二区三区精品视频 | 韩国中文字幕2020精品| 亚洲图片欧美色图| 亚洲精品免费电影| 国产精品丝袜一区| 国产欧美一区二区精品忘忧草| 日韩一区二区麻豆国产| 精品视频色一区| 91久久人澡人人添人人爽欧美| 成熟亚洲日本毛茸茸凸凹| 国产一区二区三区美女| 久久精品久久精品| 久久成人免费电影| 久久精品国产**网站演员| 午夜国产不卡在线观看视频| 亚洲精品久久久蜜桃| 亚洲私人影院在线观看| 亚洲日本乱码在线观看| 国产精品成人在线观看| 日韩一区有码在线| 亚洲靠逼com| 亚洲在线视频网站| 五月天欧美精品| 日本不卡高清视频| 欧美优质美女网站| 在线观看中文字幕不卡| 在线视频国内一区二区| 在线观看精品一区| 欧美日韩在线免费视频| 欧美精品三级日韩久久| 欧美一区二区精美| 精品欧美一区二区三区精品久久 | 欧美日本一区二区三区四区| 欧美久久一区二区| 精品欧美一区二区久久 | 国产91高潮流白浆在线麻豆| 成人午夜激情视频| 一本久久精品一区二区| 欧美另类久久久品| 久久在线观看免费| 国产精品福利在线播放| 亚洲成人免费电影| 蜜桃av一区二区| 国产一区二区三区免费在线观看| 国产成人在线网站| 欧美亚洲精品一区| 精品精品欲导航| 国产精品成人在线观看| 午夜精品福利一区二区蜜股av| 久久99精品一区二区三区| eeuss影院一区二区三区| 欧美日韩亚洲不卡| 久久亚洲一级片| 亚洲自拍都市欧美小说| 激情成人综合网| 欧美日韩在线三级| 亚洲国产精华液网站w| 一区二区在线免费观看| 久久99精品国产.久久久久 | 亚洲欧洲日韩女同| 丝袜亚洲另类欧美综合| 高清国产午夜精品久久久久久| 欧美性大战xxxxx久久久| 日韩精品一区二区三区视频播放| 亚洲图片欧美激情| 极品销魂美女一区二区三区| 日本久久电影网| 精品久久久久久最新网址| 亚洲精品免费电影| 成人深夜在线观看| 91精品免费在线| 一区二区在线观看视频在线观看| 欧美视频一区二| 久久久久久久国产精品影院| 亚洲大片免费看| 99久久精品国产精品久久| 亚洲精品一区二区三区精华液| 亚洲第一狼人社区| 99国产精品久久久久久久久久久| 日韩精品一区国产麻豆| 亚洲高清视频中文字幕| 99久久婷婷国产综合精品电影| 欧美精品一区二区三区高清aⅴ | 一级中文字幕一区二区| 国产成人精品免费视频网站| 日韩欧美中文一区| 午夜电影网亚洲视频| 91影院在线观看| 国产精品久久久久毛片软件| 国产一区二区女| 精品久久久久一区| 日韩电影在线免费| 在线播放国产精品二区一二区四区| 亚洲欧洲日本在线| 成人蜜臀av电影| 国产日本欧美一区二区| 国产一二精品视频| 精品国产伦一区二区三区观看方式| 天天综合天天做天天综合| 欧美久久久久久久久中文字幕| 亚洲在线成人精品| 欧美在线观看视频一区二区| 亚洲视频免费观看|