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

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

?? lan91c96.c

?? Intel XScale PXA255 引導Linux的Redboot 版bootloader源代碼!
?? 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精品麻豆日日躁夜夜躁| 欧美刺激脚交jootjob| 国产精品乱子久久久久| 中日韩免费视频中文字幕| 中文字幕亚洲综合久久菠萝蜜| 日韩理论片一区二区| 亚洲综合在线观看视频| 日本女人一区二区三区| 国产盗摄女厕一区二区三区| 成人av资源下载| 欧美日韩精品免费观看视频| 日韩免费一区二区三区在线播放| 久久综合狠狠综合久久激情| 国产精品久久777777| 亚洲h在线观看| 国产精品一区久久久久| 91久久人澡人人添人人爽欧美 | 国产麻豆成人精品| 色综合久久六月婷婷中文字幕| 欧美三级电影在线看| 亚洲精品一区二区在线观看| 国产精品第一页第二页第三页| 亚洲自拍都市欧美小说| 国产伦精一区二区三区| 欧美综合久久久| 中文乱码免费一区二区| 日本午夜一区二区| 色国产精品一区在线观看| 日韩欧美三级在线| 亚洲制服丝袜一区| 成人自拍视频在线观看| 欧美成人精品二区三区99精品| 1000精品久久久久久久久| 久久精品国产免费| 欧美日韩在线一区二区| 中文字幕在线一区免费| 久久国产精品99精品国产| 欧美视频精品在线| 日韩毛片在线免费观看| 国产九色精品成人porny| 欧美肥胖老妇做爰| 亚洲免费在线看| 成人午夜精品在线| 久久亚洲精华国产精华液| 三级欧美在线一区| 欧美在线短视频| 亚洲欧美精品午睡沙发| 成人av免费在线| 欧美国产一区在线| 国产一区二区三区| 久久嫩草精品久久久精品| 男男成人高潮片免费网站| 在线看一区二区| 亚洲免费av网站| 99精品国产91久久久久久| 欧美国产精品一区二区三区| 国产在线精品一区二区夜色 | 亚洲国产精品一区二区尤物区| 99久久综合精品| 国产精品成人免费在线| a在线播放不卡| 中文字幕日本不卡| 99re成人精品视频| 亚洲美女视频在线| 在线中文字幕不卡| 亚洲成人先锋电影| 69久久99精品久久久久婷婷| 亚洲成a人在线观看| 欧美日韩国产免费一区二区| 丝袜国产日韩另类美女| 精品日本一线二线三线不卡| 国产剧情在线观看一区二区| www精品美女久久久tv| 国产成人在线视频免费播放| 国产欧美一区二区三区沐欲| 丁香六月久久综合狠狠色| 国产精品国产精品国产专区不片| www.色精品| 亚洲第一激情av| 欧美成人vps| 成人免费毛片a| 一区二区三区电影在线播| 欧美精品精品一区| 久久精品999| 国产精品国产三级国产有无不卡| 一本久道中文字幕精品亚洲嫩| 亚洲国产视频网站| 欧美精品一区二区三区蜜臀| 高清不卡一区二区| 亚洲综合丝袜美腿| 欧美草草影院在线视频| 99国产精品久久久| 日韩av电影免费观看高清完整版 | 国产91精品免费| 亚洲成人tv网| 国产婷婷色一区二区三区在线| 99re热视频精品| 九九久久精品视频| 亚洲欧美日韩中文播放| 日韩一区二区免费在线观看| 国产精品小仙女| 午夜精品久久久久久久99樱桃| 精品国产在天天线2019| 91国产丝袜在线播放| 国产精一区二区三区| 亚洲欧美激情视频在线观看一区二区三区| 3d动漫精品啪啪一区二区竹菊| 国产高清精品在线| 美女www一区二区| 亚洲综合成人在线视频| 国产欧美视频在线观看| 日韩一区二区三区免费看| 在线精品观看国产| 成人永久看片免费视频天堂| 日韩有码一区二区三区| 亚洲免费资源在线播放| 国产日韩三级在线| 精品少妇一区二区| 欧美妇女性影城| 色综合欧美在线视频区| 成人黄色av电影| 国产精品一区二区无线| 麻豆高清免费国产一区| 亚洲国产aⅴ成人精品无吗| 国产精品嫩草影院av蜜臀| 久久久亚洲精品石原莉奈 | 欧美在线观看视频一区二区三区| 国产精品18久久久久久久久 | aaa欧美大片| 成人妖精视频yjsp地址| 国产精品香蕉一区二区三区| 狠狠色伊人亚洲综合成人| 久久国产精品色| 麻豆精品在线观看| 蜜桃视频在线观看一区| 肉肉av福利一精品导航| 日本aⅴ免费视频一区二区三区| 五月激情综合网| 亚洲丶国产丶欧美一区二区三区| 亚洲最新视频在线播放| 亚洲国产毛片aaaaa无费看| 一区二区三区四区乱视频| 亚洲色图欧美偷拍| 一区二区三区日韩欧美精品| 一区二区三区精品久久久| 亚洲精品久久嫩草网站秘色| 亚洲欧洲日韩综合一区二区| 亚洲日本va午夜在线影院| 成人免费在线视频观看| 一区二区三区 在线观看视频| 亚洲永久免费av| 日韩在线a电影| 国产一区二区三区免费看| 国产精品一区久久久久| 99在线视频精品| 欧美群妇大交群中文字幕| 777午夜精品视频在线播放| 精品久久久久久亚洲综合网| 国产亚洲一本大道中文在线| 国产精品天干天干在观线| 国产精品污网站| 亚洲国产综合视频在线观看| 日韩电影免费在线观看网站| 青青青伊人色综合久久| 国产精品18久久久久久vr| 91一区二区三区在线观看| 欧美久久久久中文字幕| 久久精品欧美一区二区三区不卡 | 欧美日韩亚洲不卡| 欧美日韩综合在线| 日韩精品一区二区三区四区| 久久精品日韩一区二区三区| 亚洲精品久久久蜜桃| 蜜桃久久av一区| 一本久道久久综合中文字幕| 欧美精品久久99| 久久蜜桃av一区精品变态类天堂 | 欧美性受xxxx黑人xyx性爽| 日韩欧美视频在线| 一区二区三区色| 韩国毛片一区二区三区| 欧美自拍偷拍午夜视频| 国产日韩一级二级三级| 日韩中文字幕区一区有砖一区| 成人av在线播放网站| 欧美mv和日韩mv国产网站| 一区二区三区小说|