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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? lan91c96.c

?? 移植到WLIT項目的redboot源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
            data = ReadWord(&ioRegsP[LAN91C96_DATA_HIGH]);            // Save the data.                             *dataP++ = data;        }        // Now check the status word for an odd byte in the data packet.        if (statusWord & LAN91C96_ODD_FRM)        {            // Now read the Control word to get the last data byte.            controlWord = ReadWord(&ioRegsP[LAN91C96_DATA_HIGH]);            // Store the last byte.            *dataP = (UCHAR)controlWord;            // Update the receive count.                        count += 1;        }        // Now deallocate the page.        DeallocateRxPacket(ctxP);        // Check for errors.        if (statusWord & LAN91C96_TOO_SHORT)        {            /*LOGERROR(ctxP->loggedError, ERR_L_LAN91C96,                     ERR_LAN91C96_RECEIVE, ERR_T_WRONG_STATE, statusWord, 0, 0);*/            //printf("LAN91C96: rx error frame too short\n");        }        if (statusWord & LAN91C96_TOO_LONG)        {            //printf("LAN91C96: rx error frame too long\n");        }        if (statusWord & LAN91C96_BAD_CRC)        {            //printf("LAN91C96: rx error bad CRC\n");        }        if (statusWord & LAN91C96_ALGN_ERR)        {            //printf("LAN91C96: rx error, alignment error\n");        }        // Check dump flag.        if (ctxP->dumpFlag)        {            if (statusWord & LAN91C96_BROD_CAST)            {                //printf("LAN91C96: rx broadcast\n");            }        }        // Check dump flag.        if (ctxP->dumpFlag)        {            // Display received frame.            /*DM_Printf("Receive Packet:");*/            LAN91C96DumpFrame(ctxP, 0, (PUCHAR)bufferP, count - CRC_LEN);        }        // Return the receive count.        *rxCountP = count - CRC_LEN;    }    // Get delta time reference.    GetDeltaTimeStamp(ctxP, "Rx");    return (0);}/********************************************************************************** FUNCTION:*    LAN91C96HWSetup** DESCRIPTION:*    Initialize the LAN91C96 and set the MAC address.** INPUT PARAMETERS:*    LAN91C96_ContextT *ctxP - Pointer to the LAN91C96 Device Context Structure*    BOOL resetFlag - Reset the LAN91C96 even if previously setup.** RETURNS:*    0 - Success*    non-zero - Error** GLOBAL EFFECTS:*    Sets up the initial state of the LAN91C96 Ethernet controller.** 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.*    WriteEEPROM - Write the word into the specified location within the EEPROM.*    ReadEEPROM - Read the work from the specified location within the EEPROM.** CALLED BY:*    Application or test code.** PROTOTYPE:*    UINT LAN91C96HWSetup(LAN91C96_ContextT *ctxP, BOOL resetFlag);*********************************************************************************/UINT LAN91C96HWSetup(LAN91C96_ContextT *ctxP, BOOL resetFlag){    PVUINT32 ioRegsP = ctxP->LAN91C96IoP;     // Get pointer to I/O space    PVUINT32 attRegsP = ctxP->LAN91C96AttP;   // Get pointer to attribute space    volatile UINT32 lanReg;                            // Copy of LAN91C96 register    volatile UINT16 MACAddress[3];                     // Used to check the MAC address    volatile UINT16 CfgReg;                            // Contents of Config Register    UINT16 frameHandle = 0;                   // Page number of allocated frame    volatile UINT32 randomNumber, i;    char     tempChar ;    // Check if we should override the default and do a hard reset.    if (resetFlag)    {        // Clear the setup flag and do a hard reset.        ctxP->setupFlag = FALSE;    }    // Check if we've already reset the LAN91C96    if (ctxP->setupFlag)    {        // Already setup, just return.        return (0);    }    // When an EEPROM acess is in progress the STORE and RELOAD bits will be    // read back as high. The remaining 14 bits of this register will be    // invalid. During this time, attempted read/write operations, other than    // polling the EEPROM status, will NOT have any effect on the internal    // registers. The CPU can resume accessess to the LAN91C96 after both bits    // are low. A worst case RELOAD operation initiated by RESET or by software    // takes less than 750 us in either mode.    //    // SRESET: This bit when set will clear all internal registers    // associated with the Ethernet function except itself and it will also    // lower the nIREQ/READY pin. When this bit is cleared, nIREQ/READY pin    // will be raised.    //    // Enable Function: This bit enables (1) or disables (0) the Ethernet    // function. While the Ethernet function is disabled it remains in power    // down mode, no access to the Ethernet I/O space (i.e. The bank register    // are not accessible) is allowed. IREQ is not generated for this function    // and INPACK* is not returned for accessess to the Ethernet registers.    //    // Note: Magic packet bit setting is ignored if the function is disabled.    // Access the attribute space to set the SRESET bit to reset the LAN91C96    lanReg = ReadByte(&attRegsP[LAN91C96_ECOR]);    lanReg |= LAN91C96_ECOR_SRESET;    WriteByte(lanReg, &attRegsP[LAN91C96_ECOR]);    hal_delay_us(750) ;    // Access the attribute space to enable the LAN91C96.    // First clear the SRESET bit.    lanReg = ReadByte(&attRegsP[LAN91C96_ECOR]);    lanReg &= ~LAN91C96_ECOR_SRESET;    WriteByte(lanReg, &attRegsP[LAN91C96_ECOR]);    hal_delay_us(750);    // Now set the Enable Function bit.    lanReg = ReadByte(&attRegsP[LAN91C96_ECOR]);    lanReg |= LAN91C96_ECOR_ENABLE;    WriteByte(lanReg, &attRegsP[LAN91C96_ECOR]);    hal_delay_us(750);    // Force byte mode (not required)    lanReg = ReadByte(&attRegsP[LAN91C96_ECSR]);    lanReg |= LAN91C96_ECSR_IOIS8;    WriteByte(lanReg, &attRegsP[LAN91C96_ECSR]);    hal_delay_us(750) ;    lanReg = ReadWord(&ioRegsP[LAN91C96_BANK_SELECT]) ;    if((lanReg & 0xFF00) != 0x3300)    {        printf("LAN91C96: Unable to detect device - upper 8 bits = %x\n", lanReg);        return (-1);    }    // Read the MAC address from the 91C96. This gets read from the EEPROM    // by the 91C96 during reset. This assumes Bank 1 is selected.    /* Need to copy the MAC address into the ioRegs space in a different order       than which it is stored in EEPROM.  It is stored in EEPROM with the most       significant octet in the highest memory location octet and down from       there.  So what I need to so is read EEPROM_MAC_OFSSET_3 amd store the       uooer 8 bits in the first 8 bits of &ioRegs[LAN91C96_IA0], and ...*/    WriteByte(BANK1, &ioRegsP[LAN91C96_BANK_SELECT]);/*    MACAddress[0] = ReadWord(&ioRegsP[LAN91C96_IA0]);    MACAddress[1] = ReadWord(&ioRegsP[LAN91C96_IA2]);    MACAddress[2] = ReadWord(&ioRegsP[LAN91C96_IA4]);*/    	/*    MACAddress[0] = ReadEEPROM(ctxP, EEPROM_MAC_OFFSET_1);    MACAddress[1] = ReadEEPROM(ctxP, EEPROM_MAC_OFFSET_2);    MACAddress[2] = ReadEEPROM(ctxP, EEPROM_MAC_OFFSET_3);	*/    MACAddress[0] = ReadWord(&ioRegsP[LAN91C96_IA0]);    MACAddress[1] = ReadWord(&ioRegsP[LAN91C96_IA2]);    MACAddress[2] = ReadWord(&ioRegsP[LAN91C96_IA4]);    // Convert the MAC address to ASCII so it prints out consistently    printf("LAN91C96: The current MAC address is ") ;    for(i=0;i<3;i++)    {      tempChar = (char)(0x30 + (MACAddress[i]>>4 & 0x000F)) ;      if((short)tempChar>0x39)      {          (short)tempChar = (short)tempChar + 7 ;      }		  printf("%c", tempChar) ;      tempChar = (char)(0x30 + (MACAddress[i]>>0 & 0x000F)) ;      if((short)tempChar>0x39)      {          (short)tempChar = (short)tempChar + 7 ;      }      printf("%c", tempChar) ;      printf("%c", ' ') ;      tempChar = (char)(0x30 + (MACAddress[i]>>12 & 0x000F)) ;      if((short)tempChar>0x39)      {          (short)tempChar = (short)tempChar + 7 ;      }      printf("%c", tempChar) ;      tempChar = (char)(0x30 + (MACAddress[i]>>8 & 0x000F)) ;      if((short)tempChar>0x39)      {          (short)tempChar = (short)tempChar + 7 ;      }      printf("%c", tempChar) ;            printf("%c", ' ') ;      }    printf("\n") ;		// copy the MAC address to the configuration structure		ctxP->MACAddress[0] = MACAddress[0] ;		ctxP->MACAddress[1] = MACAddress[1] ;		ctxP->MACAddress[2] = MACAddress[2] ;    // Read the Configuration Register. This assumes Bank 1 is selected.    ctxP->configRegister = ReadWord(&ioRegsP[LAN91C96_CONFIG]);    // Read the Base Address Register.    // Access the I/O space to select Bank 3 and read the IOS bits.    WriteByte(BANK3, &ioRegsP[LAN91C96_BANK_SELECT]);    ctxP->switches = ReadWord(&ioRegsP[LAN91C96_MGMT]);    // Read the LAN91C96 revision. This assumes Bank 3 is selected.    ctxP->revision = ReadWord(&ioRegsP[LAN91C96_REVISION]);    // Give the LAN91C96 time to settle down.    hal_delay_us(750) ;    // Set the SQUELCH bit - this changes the threshold for a valid signal    //  from 300mV to 180mV. This is to attempt to fix problems we have seen    // with some (usually 8 port) hubs.    // Select Bank 1    WriteByte(BANK1, &ioRegsP[LAN91C96_BANK_SELECT]);    // Set the squelch and no wait bits.    CfgReg = ReadWord(&ioRegsP[LAN91C96_CONFIG]);    CfgReg |= (LAN91C96_CR_SET_SQLCH | LAN91C96_CR_NO_WAIT);        CfgReg &= ~(LAN91C96_CR_AUI_SELECT | LAN91C96_CR_INT_SEL0 | LAN91C96_CR_DIS_LINK);    WriteWord(CfgReg, &ioRegsP[LAN91C96_CONFIG]);    // Initialize the Control Register - set Transmit Enable and Auto Release.    // Bit 8 is always set? This assumes Bank 1 is selected.    WriteWord((LAN91C96_CTR_TE_ENABLE |               LAN91C96_CTR_BIT_8     |               LAN91C96_CTR_AUTO_RELEASE), &ioRegsP[LAN91C96_CONTROL]);    // Select Bank 0    WriteByte(BANK0, &ioRegsP[LAN91C96_BANK_SELECT]);    // Initialize the Memory Configuration Register. See page 49 of the    // LAN91C96 data sheet for details. We reserve enough memory for one    // maximum sized transmit frame. This will prevent deadlock conditions    // if we receive multiple frames that can't be handled because of the    // lack of memory. The amount of memory reserved for transmit is calculated    // as LAN91C96_MCR_TRANSMIT_PAGES * 256 * M, where M is 1 for the 91C96.    // For a 1500 byte frame, we'll need 1500 / 256 = 6 memory pages.    WriteWord(LAN91C96_MCR_TRANSMIT_PAGES, &ioRegsP[LAN91C96_MCR]);    // Initialize the Transmit Control Register - Set the Transmit enable and    // Pad bit, which will pad transmit packets less than 64 bytes with zeroes.    // This assumes Bank 0 is selected.    WriteWord((LAN91C96_TCR_TXENA | LAN91C96_TCR_PAD_EN),               &ioRegsP[LAN91C96_TCR]);    // Select Bank 2    WriteByte(BANK2, &ioRegsP[LAN91C96_BANK_SELECT]);    // Disable all interrupts.    WriteByte(0, &ioRegsP[LAN91C96_INT_MASK]);    // Select Bank 0    WriteByte(BANK0, &ioRegsP[LAN91C96_BANK_SELECT]);    // The receive register should be the last thing initialized to avoid    // receiving packets before we're ready. Now set the Receive Enable bit.    WriteWord((LAN91C96_RCR_RXEN | LAN91C96_RCR_ALMUL | LAN91C96_RCR_PRMS), &ioRegsP[LAN91C96_RCR]);    // Select Bank 2    WriteByte(BANK2, &ioRegsP[LAN91C96_BANK_SELECT]);    // Now perform a quick test to determine if the LAN91C96 is working.    // Allocate a transmit frame from the LAN91C96.    if (AllocateTxPacket(ctxP, ETHERNET_MAX_LENGTH, &frameHandle))    {      printf("In LAN91C96HWSetup - AllocateTxPacket failed\n") ;      return (ctxP->loggedError);    }    // Now deallocate the page.    if (DeallocateTxPacket(ctxP))    {      printf("In LAN91C96HWSetup - DeallocateTxPacket failed\n") ;      return (ctxP->loggedError);    }    // Set setup flag.    ctxP->setupFlag = TRUE;		LAN91C96LoopBack(ctxP, 0) ;    // Let the LAN91C96 settle before attempting the first transmit.	hal_delay_us(LAN91C96_TIME_DELAY) ;	return (0);}/********************************************************************************** FUNCTION:*    LAN91C96HWShutdown** DESCRIPTION:*    This routine disables the LAN91C96 and turns it off.** INPUT PARAMETERS:*    LAN91C96_ContextT *ctxP - Pointer to the LAN91C96 Device Context Structure** RETURNS:*    None.** GLOBAL EFFECTS:*    Disables the LAN91C96 from transmitting or receiving packets from the*    Ethernet.** ASSUMPTIONS:*    None.** CALLS:*    None.** CALLED BY:*    None.** PROTOTYPE:*   VOID LAN91C96HWShutdown(LAN91C96_ContextT *ctxP);*********************************************************************************/VOID LAN91C96HWShutdown(LAN91C96_ContextT *ctxP){    PVUINT32 attRegsP = ctxP->LAN91C96AttP;   // Get pointer to attribute space    UINT16 lanReg;                            // Copy of LAN91C96 register    // SRESET: This bit when set will clear all internal registers    // associated with the Ethernet function except itself and it will also    // lower the nIREQ/READY pin. When this bit is cleared, nIREQ/READY pin    // will be raised.    // Access the attribute space to set the SRESET bit to reset the LAN91C96.    lanReg = ReadByte(&attRegsP[LAN91C96_ECOR]);    lanReg |= LAN91C96_ECOR_SRESET;    WriteByte(lanReg, &attRegsP[LAN91C96_ECOR]);    hal_delay_us(750) ;//DM_WaitUs(750);    // Save the default interrupt mask.    ctxP->intMask = LAN91C96_MSK_RCV_INT;    // Clear setup flag.    ctxP->setupFlag = FALSE;    // Zero the MAC address.    memset(&ctxP->MACAddress[0], 0, sizeof(ctxP->MACAddress));    // Clear ramdom MAC flag.    ctxP->randomMACFlag = 0;}/********************************************************************************** FUNCTION:*    LAN91C96SetMACAddress** DESCRIPTION:*    This routine will set the specified MAC address.** INPUT PARAMETERS:*    LAN91C96_ContextT *ctxP - Pointer to the LAN91C96 Device Context Structure*    PUCHAR MACP - Pointer to the MAC address.*    UINT randomFlag = 0 = MAC address supplied, 1 = generate a MAC address.** RETURNS:*    0 - Success*    non-zero - Error** GLOBAL EFFECTS:*    The LAN91C96 MAC address is changed.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
eeuss鲁片一区二区三区| 久久99精品国产.久久久久| 91视频免费观看| 亚洲少妇最新在线视频| 在线视频国内自拍亚洲视频| 亚洲亚洲人成综合网络| 正在播放亚洲一区| 蜜臀av性久久久久蜜臀aⅴ| 精品免费日韩av| 粉嫩欧美一区二区三区高清影视| 亚洲国产精品ⅴa在线观看| 91蝌蚪porny| 日韩av一二三| 久久精品一区二区| 91日韩在线专区| 香蕉成人伊视频在线观看| 日韩欧美国产1| 成人国产在线观看| 亚洲国产一区视频| 久久美女艺术照精彩视频福利播放| 不卡区在线中文字幕| 亚洲成av人片在www色猫咪| 日韩欧美在线网站| a级精品国产片在线观看| 亚洲一区二区三区三| 精品成人a区在线观看| 99re亚洲国产精品| 日本亚洲免费观看| 欧美国产乱子伦| 777奇米四色成人影色区| 国产精品99久久不卡二区| 亚洲精品国产高清久久伦理二区| 欧美一区二区在线视频| 99久久精品国产麻豆演员表| 美女视频黄 久久| 成人欧美一区二区三区| 欧美tickling挠脚心丨vk| 91在线小视频| 国产乱一区二区| 日日夜夜一区二区| 亚洲视频综合在线| 久久青草欧美一区二区三区| 欧美日韩国产另类一区| 播五月开心婷婷综合| 久久精品国产精品亚洲红杏| 亚洲摸摸操操av| 亚洲国产精品一区二区久久恐怖片| 久久综合视频网| 欧美美女一区二区| 91同城在线观看| 国产99一区视频免费| 美国一区二区三区在线播放| 亚洲综合色在线| 国产日本亚洲高清| 欧美成人乱码一区二区三区| 欧美狂野另类xxxxoooo| 一本到一区二区三区| 成人性色生活片| 国产一区二区三区最好精华液| 丝袜美腿亚洲一区| 亚洲18影院在线观看| 一区二区高清免费观看影视大全| 中文字幕不卡的av| 久久精品视频免费观看| 精品蜜桃在线看| 精品黑人一区二区三区久久| 91精品久久久久久久久99蜜臂| 在线观看欧美黄色| 色8久久人人97超碰香蕉987| jiyouzz国产精品久久| 国产成人在线看| 国产在线一区观看| 久久99精品国产91久久来源| 美美哒免费高清在线观看视频一区二区| 亚洲成av人片在线观看无码| 亚洲亚洲人成综合网络| 亚洲成a人片在线观看中文| 亚洲国产美女搞黄色| 一区二区欧美视频| 亚洲国产一二三| 亚洲成人av福利| 免费观看在线综合| 日本va欧美va欧美va精品| 蜜臀精品久久久久久蜜臀| 久久激情五月激情| 久久99精品国产91久久来源| 国产乱码精品一区二区三区av| 韩国v欧美v亚洲v日本v| 国产精品综合一区二区三区| 国产黑丝在线一区二区三区| 成人h动漫精品| 色呦呦国产精品| 欧美日韩国产高清一区| 91精品国产一区二区三区香蕉 | 成人黄色电影在线| av资源网一区| 欧美性大战久久久久久久蜜臀| 欧美日韩免费观看一区三区| 欧美精品日日鲁夜夜添| 日韩欧美专区在线| 精品91自产拍在线观看一区| 国产日韩欧美高清| 亚洲理论在线观看| 免费人成精品欧美精品| 国产aⅴ综合色| 欧美在线视频不卡| 午夜视频在线观看一区| 日韩综合小视频| 国产99一区视频免费| 欧美天堂一区二区三区| 精品免费99久久| 亚洲女与黑人做爰| 日本中文在线一区| 东方欧美亚洲色图在线| 91久久精品一区二区三| 精品捆绑美女sm三区| 专区另类欧美日韩| 美女看a上一区| 91亚洲永久精品| 日韩精品自拍偷拍| 亚洲欧美电影院| 国产做a爰片久久毛片| 91国偷自产一区二区三区观看| 日韩欧美一二区| 国产精品女同一区二区三区| 青青草精品视频| 91蜜桃婷婷狠狠久久综合9色| 欧美一区二区日韩| 亚洲乱码国产乱码精品精的特点| 精品影视av免费| 欧美亚洲国产一区二区三区 | 中文文精品字幕一区二区| 亚洲电影在线播放| 国产mv日韩mv欧美| 在线电影一区二区三区| 亚洲免费观看在线观看| 国产精品66部| 精品国产一区二区国模嫣然| 亚洲成人av免费| 色婷婷av一区二区三区大白胸| 国产三级一区二区| 激情文学综合丁香| 欧美一区二区三区免费在线看 | 偷拍亚洲欧洲综合| av毛片久久久久**hd| 久久久噜噜噜久噜久久综合| 天天综合色天天综合色h| 色天天综合久久久久综合片| 国产精品网站在线播放| 国产制服丝袜一区| 日韩欧美一二三区| 日韩电影在线免费看| 欧美性受xxxx黑人xyx| 18欧美亚洲精品| 成人久久18免费网站麻豆| 精品久久久久av影院| 喷白浆一区二区| 欧美一激情一区二区三区| 日本不卡1234视频| 欧美日本国产视频| 亚洲韩国一区二区三区| 在线观看视频欧美| 亚洲制服丝袜在线| 欧美午夜不卡视频| 亚洲成人手机在线| 欧美日韩aaaaa| 日本特黄久久久高潮| 日韩免费看网站| 老色鬼精品视频在线观看播放| 日韩欧美三级在线| 久久成人羞羞网站| 久久久久久久久久久99999| 国产在线国偷精品免费看| 久久久久青草大香线综合精品| 国产在线一区观看| 国产精品久久久久桃色tv| av一区二区三区四区| 夜夜嗨av一区二区三区网页 | 91美女片黄在线| 亚洲免费在线看| 欧美精品第1页| 久久精品999| 国产精品网站导航| 91黄色激情网站| 免费观看一级特黄欧美大片| 久久色视频免费观看| 福利视频网站一区二区三区| 亚洲欧美日韩国产中文在线| 欧美色老头old∨ideo| 麻豆专区一区二区三区四区五区| 久久精品夜色噜噜亚洲a∨| 不卡视频在线看| 偷拍一区二区三区| 久久久久久久久一| 色素色在线综合| 久久福利视频一区二区| 国产蜜臀av在线一区二区三区| 色婷婷精品久久二区二区蜜臂av| 五月天亚洲精品| 久久久精品人体av艺术|