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

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

?? if_ne2kd.c

?? 嵌入式TCP/IP協(xié)議棧
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
        // ***** 10. Take the NIC out of loopback mode (that means normal operation)        OUTPORTB(PG0W_TCR, 0x00);        PAUSE;        // ***** 11. IF Resend = 1 THEN reissue a transmit        if (Resend)        {            // Reissue transmit            OUTPORTB(NIC_CR, CR_START | CR_NO_DMA | CR_TXP);            PAUSE;        }    }else{        PAUSE;    }    // ***** Restore NIC IMR    OUTPORTB(PG0W_IMR, Imr);    PAUSE;    // ***** RETURN Success    return rtn;}static u_short Ne2kTransmitReady(void){  // ***** IF transmitting THEN RETURN FALSE  if (INPORTB(NIC_CR) & CR_TXP) return FALSE;  // ***** RETURN TRUE  return TRUE;}int Ne2kTransmit(const u_char *packet, u_short length){  int Timeout, Count;  u_char Imr;  u_char CrdaLow, CrdaHigh;//    printf("Ne2kTransmit\n");  // ***** IF transmitting THEN RETURN FALSE  if (!Ne2kTransmitReady()) return FALSE;  // ***** IF (length < 14) OR (length > 1514) THEN RETURN FALSE  if ((length < 14) || (length > 1514)) return FALSE;  // ***** Remember NIC IMR and disable interrupt from NIC (ATOMIC OPERATION!)  DISABLE_INTERRUPTS;  // Select PAGE 2  OUTPORTB(NIC_CR, CR_PAGE2 | CR_NO_DMA | CR_START);  PAUSE;  // Read IMR register  Imr = INPORTB(PG2R_IMR);  PAUSE;  // Select PAGE 0 again  OUTPORTB(NIC_CR, CR_PAGE0 | CR_NO_DMA | CR_START);  PAUSE;  // Disable interrupts from NIC  OUTPORTB(PG0W_IMR, 0x00);  PAUSE;  ENABLE_INTERRUPTS;  // ***** Clear REMOTE DMA COMPLETE bit in ISR  OUTPORTB(PG0W_ISR, ISR_RDC);  PAUSE;  // ***********************************************************************************  // ***** Due to two non synchronized state machines in the NIC, you should always do a   // ***** Remote Read (called a dummy read) before a Remote Write.  // ***** This is stated in the datasheet DP8390D/NS32490D NIC Network Interface Controller  // ***** (July 1995) from National  Semiconductor.   // ***** 1. Set Remote Byte Count to a value > 0 and Remote Start Address to unused RAM   //          (like transmit start page - 1) (REMEMBER THESE VALUES!)  CrdaLow = 0;  CrdaHigh = TSTART_PG - 1;  OUTPORTB(PG0W_RBCR0, 1);  PAUSE;  OUTPORTB(PG0W_RBCR1, 0);  PAUSE;  OUTPORTB(PG0W_RSAR0, CrdaLow);  PAUSE;  OUTPORTB(PG0W_RSAR1, CrdaHigh);  PAUSE;  // ***** 2. Issue the "dummy" Remote Read command  OUTPORTB(NIC_CR, CR_START | CR_DMA_READ);  PAUSE;  // ***** 3. Read the current remote DMA address (CRDA) (both bytes)  // ***** 4. Compare to previous CRDA value, if different go to step 6  // ***** 5. Delay and go to step 3.  // timeout < 100 === leave us with appr. 200us timeout (which is a lot)  // (this timeout is not impl. in NS' datasheet, but it's better to be on the safe side)  for (Timeout = 0; Timeout < 50; Timeout++)  {    if (CrdaLow != INPORTB(PG0R_CRDA0)) break;    PAUSE;    if (CrdaHigh != INPORTB(PG0R_CRDA1)) break;    PAUSE;  }  // ***** 6. Setup for the Remote Write command  // *****     Stop REMOTE DMA   OUTPORTB(NIC_CR, CR_START | CR_NO_DMA);  PAUSE;  // *****     Initialize Transmit Byte Count Registers to packet length and MIN. MIN_PACKET_SIZE bytes   if (length < MIN_PACKET_SIZE)  {     // Padding required    OUTPORTB(PG0W_TBCR0, MIN_PACKET_SIZE);    PAUSE;    OUTPORTB(PG0W_TBCR1, 0);    PAUSE;  }  else  {     // No padding required    OUTPORTB(PG0W_TBCR0, (length & 0xFF));    PAUSE;    OUTPORTB(PG0W_TBCR1, ((length >> 8) & 0xFF) );    PAUSE;  }  // ***** Update statistics (before making length an even value!)  Statistics.BytesTransmitted += length;  Statistics.PacketsTransmitted++;  // *****     We use word transfer mode, so make length an even value  length &= 0xfffe;  length++;  // *****     Initialize Remote Byte Count Register (DMA) to packet length   OUTPORTB(PG0W_RBCR0, (length & 0xFF));  PAUSE;  OUTPORTB(PG0W_RBCR1, ((length >> 8) & 0xFF));  PAUSE;  // *****     Initialize  Remote Start Address Register to address of NIC transmit buffer    OUTPORTB(PG0W_RSAR0, 0);  PAUSE;  OUTPORTB(PG0W_RSAR1, TSTART_PG);  PAUSE;  // ***** 7. Issue the Remote DMA WRITE   // *****     Start DMA Write  OUTPORTB(NIC_CR, CR_START | CR_DMA_WRITE);  PAUSE;  // *****     Write data to NIC  for (Count = 0; Count < length; Count += 2) OUTPORTW(NIC_DATAPORT, packet[Count] | (packet[Count+1] << 8));  // ***** Wait for Remote DMA to complete (should be instantly, but we have to wait anyway)  // timeout < 200 === leave us with appr. 200us timeout (which is a lot)  // (this timeout is not impl. in NS' datasheet, but it's better to be on the safe side)  for (Timeout = 0; Timeout < 200; Timeout++)  {    if (INPORTB(PG0R_ISR) & ISR_RDC) break;    PAUSE;  }  // ***** Clear REMOTE DMA COMPLETE bit in ISR  OUTPORTB(PG0W_ISR, ISR_RDC);  PAUSE;  // ***** Initialize Transmit Page Start Register  OUTPORTB(PG0W_TPSR, TSTART_PG);  PAUSE;  // ***** Start transmission  OUTPORTB(NIC_CR, CR_START | CR_NO_DMA | CR_TXP);  PAUSE;  // ***** Restore NIC IMR  OUTPORTB(PG0W_IMR, Imr);  PAUSE;  // ***** RETURN TRUE  return TRUE;}static void Ne2kTxNBuf(NBuf *pNBuf){    u_short d;    unsigned char *p_d;    long l;    int i;    NBuf *n;//    printf("TxNBuf:\n");    n=pNBuf;    l=pNBuf->len;    p_d=pNBuf->data;    i=0;    while(n)    {        if(l==0)        {            // next nBuf            n=n->nextBuf;            if(n)            {                l=n->len;                p_d=n->data;            }        }else{            d=(d<<8)|*p_d++;            l--;            if(++i==2)            {                i=0;                OUTPORTW(NIC_DATAPORT, d);//                printf("0x%lx\n",d);            }        }    }    if(i)    {        // as we were writing words, we might have a single trailling byte, so just send it...        d<<=8;        OUTPORTW(NIC_DATAPORT, d);//        printf("odd 0x%lx\n",d);    }}//static u_char dbgseq=1;static u_char Ne2kTxPacket(NBuf *pNBuf){  int Timeout;//  int Count;  u_char Imr;  u_char CrdaLow, CrdaHigh;    u_short length;//,padding,lTx;//    printf("Ne2kTxPacket\n");    // ***** IF transmitting THEN RETURN FALSE  if (!Ne2kTransmitReady()) return FALSE;    length=nChainLen(pNBuf);//    printf("Ne2kTxPacket: length=%d\n",length);  // ***** IF (length < 14) OR (length > 1514) THEN RETURN FALSE  if ((length < 14) || (length > 1514)) return FALSE;  // ***** Remember NIC IMR and disable interrupt from NIC (ATOMIC OPERATION!)  DISABLE_INTERRUPTS;  // Select PAGE 2  OUTPORTB(NIC_CR, CR_PAGE2 | CR_NO_DMA | CR_START);  PAUSE;  // Read IMR register  Imr = INPORTB(PG2R_IMR);  PAUSE;  // Select PAGE 0 again  OUTPORTB(NIC_CR, CR_PAGE0 | CR_NO_DMA | CR_START);  PAUSE;  // Disable interrupts from NIC  OUTPORTB(PG0W_IMR, 0x00);  PAUSE;  ENABLE_INTERRUPTS;  // ***** Clear REMOTE DMA COMPLETE bit in ISR  OUTPORTB(PG0W_ISR, ISR_RDC);  PAUSE;  // ***********************************************************************************  // ***** Due to two non synchronized state machines in the NIC, you should always do a  // ***** Remote Read (called a dummy read) before a Remote Write.  // ***** This is stated in the datasheet DP8390D/NS32490D NIC Network Interface Controller  // ***** (July 1995) from National  Semiconductor.  // ***** 1. Set Remote Byte Count to a value > 0 and Remote Start Address to unused RAM  //          (like transmit start page - 1) (REMEMBER THESE VALUES!)  CrdaLow = 0;  CrdaHigh = TSTART_PG - 1;  OUTPORTB(PG0W_RBCR0, 1);  PAUSE;  OUTPORTB(PG0W_RBCR1, 0);  PAUSE;  OUTPORTB(PG0W_RSAR0, CrdaLow);  PAUSE;  OUTPORTB(PG0W_RSAR1, CrdaHigh);  PAUSE;  // ***** 2. Issue the "dummy" Remote Read command  OUTPORTB(NIC_CR, CR_START | CR_DMA_READ);  PAUSE;  // ***** 3. Read the current remote DMA address (CRDA) (both bytes)  // ***** 4. Compare to previous CRDA value, if different go to step 6  // ***** 5. Delay and go to step 3.  // timeout < 100 === leave us with appr. 200us timeout (which is a lot)  // (this timeout is not impl. in NS' datasheet, but it's better to be on the safe side)  for (Timeout = 0; Timeout < 50; Timeout++)  {    if (CrdaLow != INPORTB(PG0R_CRDA0)) break;    PAUSE;    if (CrdaHigh != INPORTB(PG0R_CRDA1)) break;    PAUSE;  }  // ***** 6. Setup for the Remote Write command  // *****     Stop REMOTE DMA  OUTPORTB(NIC_CR, CR_START | CR_NO_DMA);  PAUSE;  // *****     Initialize Transmit Byte Count Registers to packet length and MIN. MIN_PACKET_SIZE bytes  if (length < MIN_PACKET_SIZE)  {//        printf("padding: length=%d, actual sent packet=%d\n",length,MIN_PACKET_SIZE);//        padding=MIN_PACKET_SIZE-length;//        length=MIN_PACKET_SIZE;    // Padding required    OUTPORTB(PG0W_TBCR0, MIN_PACKET_SIZE);    PAUSE;    OUTPORTB(PG0W_TBCR1, 0);    PAUSE;  }else{//        padding=0;//    }    // No padding required    OUTPORTB(PG0W_TBCR0, (length & 0xFF));    PAUSE;    OUTPORTB(PG0W_TBCR1, ((length >> 8) & 0xFF) );    PAUSE;  }  // ***** Update statistics (before making length an even value!)  Statistics.BytesTransmitted += length;  Statistics.PacketsTransmitted++;  // *****     We use word transfer mode, so make length an even value  length += length&1;  // *****     Initialize Remote Byte Count Register (DMA) to packet length  OUTPORTB(PG0W_RBCR0, (length & 0xFF));  PAUSE;  OUTPORTB(PG0W_RBCR1, ((length >> 8) & 0xFF));  PAUSE;  // *****     Initialize  Remote Start Address Register to address of NIC transmit buffer  OUTPORTB(PG0W_RSAR0, 0);  PAUSE;  OUTPORTB(PG0W_RSAR1, TSTART_PG);  PAUSE;  // ***** 7. Issue the Remote DMA WRITE  // *****     Start DMA Write  OUTPORTB(NIC_CR, CR_START | CR_DMA_WRITE);  PAUSE;  // *****     Write data to NIC    Ne2kTxNBuf(pNBuf);    // send padding/*    while(padding>0)    {        padding-=2;        OUTPORTW(NIC_DATAPORT,dbgseq);    }    dbgseq++;*/  // ***** Wait for Remote DMA to complete (should be instantly, but we have to wait anyway)  // timeout < 200 === leave us with appr. 200us timeout (which is a lot)  // (this timeout is not impl. in NS' datasheet, but it's better to be on the safe side)  for (Timeout = 0; Timeout < 200; Timeout++)  {    if (INPORTB(PG0R_ISR) & ISR_RDC) break;    PAUSE;  }  // ***** Clear REMOTE DMA COMPLETE bit in ISR  OUTPORTB(PG0W_ISR, ISR_RDC);  PAUSE;  // ***** Initialize Transmit Page Start Register  OUTPORTB(PG0W_TPSR, TSTART_PG);  PAUSE;  // ***** Start transmission  OUTPORTB(NIC_CR, CR_START | CR_NO_DMA | CR_TXP);  PAUSE;  // ***** Restore NIC IMR  OUTPORTB(PG0W_IMR, Imr);  PAUSE;  // ***** RETURN TRUE  return TRUE;}void Ne2kGetStatistics(Ne2kStatistics *statistics)

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人高清在线| 国模无码大尺度一区二区三区| 91精品婷婷国产综合久久竹菊| 国产一区不卡精品| 亚洲.国产.中文慕字在线| 国产欧美日韩视频在线观看| 6080国产精品一区二区| 93久久精品日日躁夜夜躁欧美| 五月天激情综合| 亚洲精品高清视频在线观看| 国产日韩欧美精品电影三级在线| 在线成人免费视频| 色一情一伦一子一伦一区| 国产成人精品综合在线观看 | 日韩理论在线观看| 精品国产成人系列| 5566中文字幕一区二区电影| 不卡一区二区三区四区| 国产真实乱对白精彩久久| 日韩专区一卡二卡| 亚洲制服丝袜av| 亚洲色图视频网| 国产精品区一区二区三区 | 亚洲丝袜美腿综合| 久久精品人人做| 精品国产a毛片| 日韩一区二区在线观看视频播放| 欧美吻胸吃奶大尺度电影| 99久久精品一区二区| 粉嫩13p一区二区三区| 国产精品99久久久久久似苏梦涵 | 免费成人在线网站| 日一区二区三区| 舔着乳尖日韩一区| 午夜精品在线看| 日本中文字幕一区| 日韩高清不卡一区二区| 蜜臀99久久精品久久久久久软件| 午夜精品久久久久| 日本成人超碰在线观看| 日精品一区二区| 老鸭窝一区二区久久精品| 免费久久99精品国产| 麻豆精品新av中文字幕| 久久电影国产免费久久电影| 麻豆专区一区二区三区四区五区| 人人精品人人爱| 精品一区二区三区在线观看| 国产精品一品视频| 成人av先锋影音| 99国产精品久久久久久久久久久 | 日韩精品国产欧美| 蜜臀精品久久久久久蜜臀 | 国产成人av电影免费在线观看| 国产自产2019最新不卡| 国产91清纯白嫩初高中在线观看 | 国产精品麻豆久久久| 亚洲天堂成人网| 午夜精品一区在线观看| 美女一区二区视频| 国产a久久麻豆| 色婷婷激情一区二区三区| 欧美日韩亚洲不卡| 日韩欧美国产一区二区三区| 国产喷白浆一区二区三区| 成人欧美一区二区三区小说| 一区二区日韩av| 美女一区二区三区| a级高清视频欧美日韩| 欧美在线观看禁18| 日韩免费观看高清完整版在线观看| 久久久精品日韩欧美| 亚洲激情综合网| 国产一区二区女| 91欧美一区二区| 欧美va亚洲va香蕉在线| 国产精品久久久久久久久果冻传媒| 一区二区三区国产| 国产精品影视网| 日本久久一区二区三区| 欧美大片在线观看一区| 中文字幕在线一区| 男人的天堂久久精品| 丰满少妇在线播放bd日韩电影| 在线观看日韩国产| 久久精品视频免费| 亚洲成人av电影| 成人在线视频一区二区| 欧美色视频在线| 亚洲国产电影在线观看| 日本网站在线观看一区二区三区| 成人国产精品视频| 日韩女优制服丝袜电影| 亚洲免费观看高清完整版在线观看 | 亚洲va欧美va人人爽| 粉嫩高潮美女一区二区三区| 51久久夜色精品国产麻豆| 成人欧美一区二区三区视频网页| 麻豆91精品视频| 欧美体内she精高潮| 中文字幕电影一区| 久久99精品久久只有精品| 在线视频你懂得一区二区三区| 久久久影视传媒| 美女视频黄a大片欧美| 在线观看91精品国产入口| 国产日韩精品一区| 激情av综合网| 91精品在线观看入口| 一区二区三区资源| 成人sese在线| 国产欧美一区二区精品性色| 久久se这里有精品| 欧美顶级少妇做爰| 亚洲成人免费视频| 欧美亚洲综合网| 亚洲精品久久嫩草网站秘色| 成人福利视频在线| 国产目拍亚洲精品99久久精品| 狠狠色综合日日| 欧美mv和日韩mv国产网站| 免费欧美高清视频| 91 com成人网| 日韩激情一区二区| 在线播放91灌醉迷j高跟美女| 亚洲精品欧美激情| 一本大道久久a久久精品综合| 国产精品久久久久久久岛一牛影视| 国产精品一区二区黑丝| 久久这里都是精品| 国产成人自拍高清视频在线免费播放| 精品盗摄一区二区三区| 久久99蜜桃精品| 久久综合成人精品亚洲另类欧美| 蜜桃精品视频在线| 精品少妇一区二区三区日产乱码 | 亚洲成人自拍偷拍| 欧美色老头old∨ideo| 亚洲乱码中文字幕| 日本高清无吗v一区| 洋洋成人永久网站入口| 欧美影片第一页| 天堂在线一区二区| 日韩欧美一级在线播放| 精品一区二区三区久久久| 精品盗摄一区二区三区| 国产精品一级在线| 日韩一区中文字幕| 欧美三级日韩三级| 美洲天堂一区二卡三卡四卡视频| 欧美大度的电影原声| 国产在线视频精品一区| 欧美国产成人在线| 91网站视频在线观看| 亚洲国产aⅴ成人精品无吗| 欧美一区二区高清| 国产一区二区三区蝌蚪| 国产一区欧美日韩| 国产精品区一区二区三区| 91亚洲精品久久久蜜桃网站| 亚洲va欧美va人人爽午夜 | 国产精品初高中害羞小美女文| 99久久99久久免费精品蜜臀| 亚洲已满18点击进入久久| 日韩欧美美女一区二区三区| 国产成人啪免费观看软件| 亚洲精品一二三区| 日韩欧美美女一区二区三区| 国产99精品在线观看| 有码一区二区三区| 日韩一区二区三区四区| va亚洲va日韩不卡在线观看| 亚洲国产综合人成综合网站| 精品蜜桃在线看| 色呦呦一区二区三区| 老司机午夜精品| 专区另类欧美日韩| 91精品国产高清一区二区三区蜜臀| 国产伦精一区二区三区| 亚洲精品免费看| 精品成人一区二区| 色香蕉成人二区免费| 精品亚洲国内自在自线福利| 亚洲日本韩国一区| 日韩一级免费一区| 在线视频你懂得一区| 国产高清在线观看免费不卡| 亚洲国产成人91porn| 亚洲国产成人私人影院tom| 欧美少妇性性性| 成人性生交大合| 美女高潮久久久| 亚洲一区二区三区四区在线免费观看| 久久久久国色av免费看影院| 欧美日韩国产一区| 99久久精品国产一区二区三区| 麻豆精品蜜桃视频网站| 亚洲影院在线观看| 国产精品久久久久久久久免费丝袜 | 欧美日本精品一区二区三区|