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

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

?? ether_cs8900.c~

?? 針對(duì)德州儀器DM270開發(fā)板的bootloader,其實(shí)現(xiàn)了內(nèi)核的下載以及文件系統(tǒng)的下載
?? C~
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
  unsigned i = 0;//util_printf("the reg INTCNTRL is 0x%X\n", readreg(INTCNTRL));//util_printf("the reg RECVCONF is 0x%X\n", readreg(RECVCONF));//util_printf("the reg RECVCNTRL is 0x%X\n", readreg(RECVCNTRL));  i=readreg(PP_ChipID);if (i != CHIP_EISA_ID_SIG)    {      util_printf("cs89x0.c: No CrystalLan device found. 0x%X\n", i);      return;    }  else{      util_printf("The ID of CS8900 is 0x%X\n", i);     }//util_printf("The PRODUCT_ID_ADD of CS8900 is 0x%X\n", readreg(PRODUCT_ID_ADD));util_printf("The PP_SelfST of CS8900 is 0x%X\n", readreg(PP_SelfST));util_printf("The PP_SelfCTL of CS8900 is 0x%X\n", readreg(PP_SelfCTL));util_printf("The PP_LineCTL of CS8900 is 0x%X\n", readreg(PP_LineCTL));util_printf("The PP_LineST of CS8900 is 0x%X\n", readreg(PP_LineST));util_printf("The PP_BusST of CS8900 is 0x%X\n", readreg(PP_BusST));util_printf("The PP_TxEvent of CS8900 is 0x%X\n", readreg(PP_TxEvent));util_printf("The PP_RxMiss of CS8900 is 0x%X\n", readreg(PP_RxMiss));util_printf("The PP_TxCol of CS8900 is 0x%X\n", readreg(PP_TxCol));#ifdef BSPCONF_BTLDR_CS8900_DEBUG   last_readreg_addr=0;  last_readreg_data=0;#endif  writereg(LINECNTRL,0x0000);  // go offline  writereg(SELFCNTRL,0x0055);  // reset.  while (!(readreg(SELFSTATUS)&0x0080)) {          ; //wait  }}/****************************** Routine: Description: ******************************/static void chip_mac_assign(unsigned char *mac_array){  short s;  s = mac_array[0] | (mac_array[1] << 8);  writereg(MACREG1,s);  s = mac_array[2] | (mac_array[3] << 8);  writereg(MACREG2,s);  s = mac_array[4] | (mac_array[5] << 8);  writereg(MACREG3,s);}/****************************** Routine: Description:   Polls the chip until a chip packet is recieved   containing an ether frame and then xfers the data   field portion of the received ether frame to the   client's supplied datagram buffer and then sets the   client's num_bytes variable appropriately. ******************************/static void chip_read_data_polled(void *datagram,            // in/out                                  unsigned short *num_bytes) // in/out{  #define RxOK 0x0100  #define RxBROADCAST 0x0800  unsigned short i;  unsigned short RxStatus, RxLength;  while (1) {    while (1) {      // loop here until the bit goes high indicating      // that the chip has a non broadcast incoming packet for us.      i=readreg(RECVEVENT);      if ((i & RxOK) && ! (i & RxBROADCAST)) {	break;      }    }#ifdef BSPCONF_BTLDR_CS8900_DEBUG    util_printf("received a packet \n");#endif    // Next, repeatively read from the receive port to    // pick up the packet; the packet is actually proceeded    // by a status word and a length word, the same two    // words that would also be returned from a readreg(RXSTATUS)    // and readreg(RXLENGTH), but we might as well get them this    // way instead:    RxStatus = inw(RECVPORT);    RxLength = inw(RECVPORT);    if (RxStatus & 0x7080) {      // Error: Either the Extradata, Runt, CRCerror, or Dribble bit was set.      // Ignore this packet and loop back around to pick up another.    }    else {      // --Normal Path--      // First read out the ether header that proceeds the frame data field. We'll      // temporarily put this in the client's buffer and then immediately overwrite      // it with the frame data field that we really want to deliver to the client.      insw(RECVPORT, (unsigned short *)datagram, (sizeof(ether_hdr_t)>>1));      if (RxLength > sizeof(ether_hdr_t)) { // sanity check        // --Normal Path--        RxLength -= sizeof(ether_hdr_t); // adjust length to reflect data field only.        // Now load the client's buffer with the frame's data field.         insw(RECVPORT, (unsigned short *)datagram, RxLength>>1);        if (RxLength & 1) {          // Odd length; get that last byte.          ((unsigned char *)datagram)[RxLength-1] = (unsigned char)inw(RECVPORT);        }        *num_bytes = RxLength;#ifdef BSPCONF_BTLDR_CS8900_DEBUG	util_dump_memory((unsigned int) datagram, RxLength);#endif        break; // return to client      }    }  }}/****************************** Routine: Description:   Package up the client's datagram into an Ether frame   which is then loaded into the chip for transmission on    the physical wire. Note: wire collisions are handled   by the chip itself. ******************************/static void chip_send_data(submit_mode mode,          // in                           char *device_MAC,          // in                           char *server_MAC,          // in                           void *datagram,            // in/out                           unsigned short *num_bytes) // in/out{  #define TxMask 0x87C0    // All error bits plus the TkOK bit.  #define TxErrMask 0x84C0 // All error bits minus the TkOK bit.  #define TX_AFTER_381 0x0040  #define TX_AFTER_ALL 0x00C0  #define RDY_FOR_TX_NOW 0x0100  ether_hdr_t *ethdatagram;  unsigned short ethfrm_len, *data, status;  unsigned char d_MAC[6], s_MAC[6];  int i;  while (1) {    util_fill_MAC(d_MAC,device_MAC);    util_fill_MAC(s_MAC,server_MAC);    // Add the eth header.    // Recall that the client has provided the space for us to    // back the pointer up like this and add our header.    ethdatagram = (ether_hdr_t *)(datagram - sizeof(ether_hdr_t));    // Next, build the ether frame header.    // Notice that our header does not include the 8 byte preamble     // of alternating 1s and 0s since the chip will provide those    // bits automatically as part of interfacing with the wire.    // chip also does the crc generation for us and appends it to    // tail end of our data as it heads out the wire.    for (i=0; i<6; i++) {      ethdatagram->dest_addr[i] = s_MAC[i];      ethdatagram->src_addr[i] = d_MAC[i];    }    ethdatagram->frame_type = 0x0000; // IP code as per /etc/protocols    // Hmmm????    // well 0x0000 is what I thought it should be anyways, but as I    // trace other packets moving about the network I see that they    // use the value 0x8000 although I don't understand the signifcance    // of that just yet. In the meantime it does seem to work beter    // to use that value. so... override previous setting now...    ethdatagram->frame_type = htons(0x0800); // override, see comment above.    ethfrm_len = *num_bytes + sizeof(ether_hdr_t);    if (ethfrm_len < 61) {      // *debug*, Get to the bottom of this one.      // Special case, at the moment I can't get the chip to send      // out ether packets smaller than this minimum amount. If it      // drops below it then pad it and assume that the destination      // server will just ignore the extra bytes. I happen to know      // that Tftp servers do, for example.      ethfrm_len = 61;    }    data = (unsigned short *)ethdatagram;    // Initiate the Transmit#ifdef BSPCONF_BTLDR_CS8900_DEBUG    util_printf("sending a packet \n");    util_printf("buffer = 0x%X, len = 0x%x\n",data,ethfrm_len); // *revisit-skranz* temp only.    util_printf("sizeof ether_hdr_t = 0x%x\n",sizeof(ether_hdr_t)); // *revisit-skranz* temp only.    util_printf("sizeof ip_hdr_t = 0x%x\n",sizeof(ip_hdr_t)); // *revisit-skranz* temp only.    util_printf("sizeof udp_hdr_t = 0x%x\n",sizeof(udp_hdr_t)); // *revisit-skranz* temp only.#endif    status = readreg(XMITEVENT); // clear any existing xmit status bits before starting new xmit.    outw(TXCMDPORT,TX_AFTER_381);    outw(TXLENPORT,ethfrm_len);    while (0 == (readreg(BUSSTATUS) & RDY_FOR_TX_NOW)) {      // Wait here until the chip performs the internal chip      // mem allocation needed to hold our ether frame packet.    }#ifdef BSPCONF_BTLDR_CS8900_DEBUG    util_dump_memory((unsigned int) data, ethfrm_len);#endif    // on the wire she goes....    outsw(XMITPORT,data,(ethfrm_len+1)>>1);    status = readreg(XMITEVENT); // read new xmit status bits.    while (0 == (status & TxMask)) {      // Wait here until the chip performs the transmission.      // When complete, or if aborted, then at least one bit      // in TxMask set will go high.      status = readreg(XMITEVENT); // read new xmit status bits.    }    if (0 == (status & TxErrMask)) {      // It had completed without an error bits being set.      // We won't have to resend our packet. The only bit that      // must have been set is the TkOK; good.      break;    }#ifdef BSPCONF_BTLDR_CS8900_DEBUG    util_printf("Bad xmit attempting; status = 0x%x; retrying... \n",status);#endif  }}/****************************** Routine: Description:    See ether.h for more info. ******************************/void ether_init(void){  chip_reset();  // TF 030630 - removed so chip isn't touched until                   // TFTP is used (which causes chip_reset to be called)}/****************************** Routine: Description:   See ether.h for more info. ******************************/void ether_submit(submit_mode mode,          // in                  char *device_MAC,          // in                  char *server_MAC,          // in                  void *datagram,            // in/out                  unsigned short *num_bytes) // in/out{  // --Stage one--  switch(mode) {    case SEND:    case SEND_AND_GET_REPLY:      chip_send_data(mode,       // in                     device_MAC, // in                     server_MAC, // in                     datagram,   // in                     num_bytes); // in      break;    case RECV:      // See "Stage two" below.      break;    case FLUSH:      {        unsigned char d_MAC[6];        util_fill_MAC(d_MAC,device_MAC);        chip_reset();        chip_mac_assign(d_MAC);        chip_online();      }      break;    default:      SYSTEM_FATAL("Logic Error");      break;  }  // --Stage two--  switch(mode) {    case RECV:    case SEND_AND_GET_REPLY:      chip_read_data_polled(datagram,   // out                            num_bytes); // out      break;    default:      break;  }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看日韩毛片| 在线观看精品一区| 午夜精品一区在线观看| 久久蜜臀中文字幕| 91成人看片片| 国产69精品一区二区亚洲孕妇| 一区二区三区精品在线观看| 2023国产精品视频| 欧美一区二区三区在线看| av亚洲精华国产精华精| 国产一区二区三区黄视频| 午夜免费久久看| 亚洲男帅同性gay1069| 久久综合丝袜日本网| 欧美日韩精品电影| 色欧美片视频在线观看在线视频| 国产一区二区三区四区五区美女| 无码av免费一区二区三区试看 | 欧亚洲嫩模精品一区三区| 国产在线视频不卡二| 日韩国产欧美视频| 一区二区三区四区av| 国产精品久久久久久久久久免费看 | 精品国产乱子伦一区| 精品视频免费在线| 色婷婷久久综合| 99麻豆久久久国产精品免费 | 欧美一区二区久久久| 91精品福利视频| 91麻豆免费观看| 97成人超碰视| 99热精品一区二区| 色综合久久天天| 在线免费观看日本欧美| 91国偷自产一区二区三区成为亚洲经典| 成人黄色av网站在线| 成人高清伦理免费影院在线观看| 国产精品77777| 成人爽a毛片一区二区免费| 国产精品自拍网站| 国产不卡在线一区| 国产**成人网毛片九色| 风间由美一区二区三区在线观看 | 欧美日韩久久久| 欧美日韩免费电影| 欧美日韩mp4| 538在线一区二区精品国产| 欧美欧美午夜aⅴ在线观看| 欧美电影一区二区三区| 欧美一级国产精品| 久久久亚洲高清| 中文字幕国产一区| 亚洲欧美自拍偷拍| 一区二区三区成人| 亚洲成人动漫在线观看| 欧美96一区二区免费视频| 美女视频黄 久久| 国产一区二区三区综合| av电影天堂一区二区在线观看| 91视频国产观看| 欧美日韩国产电影| 26uuu亚洲| 亚洲天堂2016| 日韩国产欧美在线观看| 国内成人自拍视频| 99视频在线精品| 欧美精品自拍偷拍| 欧美精品一区二区久久婷婷| 国产精品久久久久aaaa樱花 | 蜜臀a∨国产成人精品| 韩国欧美国产一区| 99精品视频一区二区| 欧美日韩亚洲国产综合| 精品国产乱码久久久久久图片 | 欧美岛国在线观看| 国产精品伦理一区二区| 夜夜嗨av一区二区三区四季av| 午夜精品久久久久久久久| 狠狠狠色丁香婷婷综合久久五月| 成人午夜av影视| 欧美一区二区三区在线看| 国产精品美女久久久久久久久久久 | 国产亚洲欧美激情| 亚洲码国产岛国毛片在线| 三级在线观看一区二区| 国产成人aaaa| 3751色影院一区二区三区| 国产亚洲一区二区在线观看| 亚洲小说春色综合另类电影| 久久精品国产亚洲a| 色综合天天综合网天天看片| 日韩午夜激情免费电影| 国产精品久久久久一区二区三区共 | 欧美视频中文字幕| 国产欧美精品一区二区色综合朱莉 | 色综合天天做天天爱| 欧美成人一区二区三区片免费| 国产精品久久久久影院| 精品一区二区免费看| 欧美色大人视频| 欧美激情资源网| 免费精品视频在线| 欧美在线看片a免费观看| 国产欧美精品国产国产专区| 午夜欧美视频在线观看| 91亚洲精品乱码久久久久久蜜桃| 日韩欧美一二区| 亚洲综合色在线| 97成人超碰视| 中文字幕av资源一区| 韩国av一区二区三区在线观看| 欧美性受xxxx黑人xyx| 国产精品久久久久影院色老大| 久久www免费人成看片高清| 欧美视频一区在线观看| 亚洲天堂2014| 成人午夜电影小说| 久久久精品免费观看| 美国欧美日韩国产在线播放| 欧美日韩卡一卡二| 亚洲老妇xxxxxx| 91久久精品午夜一区二区| 亚洲欧美一区二区三区久本道91| 福利一区福利二区| 久久久.com| 国产一区二区三区在线观看免费| 日韩午夜激情免费电影| 美女视频黄免费的久久 | 亚洲色图制服诱惑 | 午夜激情久久久| 91极品视觉盛宴| 亚洲精品欧美综合四区| 99久久99久久免费精品蜜臀| 久久伊人中文字幕| 狠狠色丁香婷婷综合久久片| 精品黑人一区二区三区久久 | 久久er精品视频| 精品国产乱码久久久久久免费| 狠狠色丁香久久婷婷综| 精品成人免费观看| 国产精品1区二区.| 国产精品人成在线观看免费| 不卡电影免费在线播放一区| 成人免费在线视频| 色狠狠色狠狠综合| 天天综合日日夜夜精品| 欧美一区二区三区成人| 久久er99精品| 国产精品乱人伦一区二区| 96av麻豆蜜桃一区二区| 日本电影欧美片| 日韩成人精品视频| 日韩欧美久久一区| 国精产品一区一区三区mba桃花| 久久久不卡影院| 99热精品国产| 婷婷综合五月天| 精品国产一区二区三区久久久蜜月| 美女性感视频久久| 国产农村妇女精品| 欧洲亚洲精品在线| 日韩电影在线观看一区| 精品久久久久久亚洲综合网| 国产精品1024| 亚洲国产精品一区二区尤物区| 日韩小视频在线观看专区| 粉嫩一区二区三区在线看 | 精品一区二区三区在线视频| 国产午夜精品理论片a级大结局 | 日韩欧美一级片| 成人在线一区二区三区| 尤物在线观看一区| 91精品国产美女浴室洗澡无遮挡| 国产精品综合一区二区| 一区二区三区视频在线看| 日韩三级视频中文字幕| 成人开心网精品视频| 亚洲国产精品欧美一二99| 精品国产成人系列| 99久久免费视频.com| 日韩电影在线看| 国产精品萝li| 欧美成人r级一区二区三区| 99久久婷婷国产综合精品| 日本欧美一区二区在线观看| 国产人妖乱国产精品人妖| 欧美日韩中文字幕精品| 高清不卡在线观看av| 日韩av网站在线观看| 一区精品在线播放| 欧美tickling网站挠脚心| 色噜噜狠狠成人中文综合| 国内成人免费视频| 日韩精品三区四区| 亚洲人成网站精品片在线观看| 精品国产在天天线2019| 欧美日韩中文国产| bt7086福利一区国产| 国产乱码精品一区二区三区五月婷| 亚洲欧美日韩国产中文在线|