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

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

?? cssysend.c

?? cs8900在vxworks系統下的驅動
?? C
?? 第 1 頁 / 共 2 頁
字號:
* This routine uses global variables in the CS_END_DEVICE structure to configure the 
* adapter for the board-specific IO circuitry and media types supported.
*        
* RETURNS: Nothing
*         
*/

LOCAL void sysEnetHWInit( CS_END_DEVICE *pCS )
{
   USHORT BusCtl;
   USHORT SelfCtl;
   IOADDR DataPort;
   IOADDR AddrPort;

   DataPort=pCS->IOAddr + PORT_PKTPG_DATA;
   AddrPort=pCS->IOAddr + PORT_PKTPG_PTR;
   



   /* If memory mode is enabled */
   if ( pCS->ConfigFlags & CFGFLG_MEM_MODE )
   {
      /* If external logic is present for address decoding */
      if ( csReadPacketPage(pCS,PKTPG_SELF_ST) & SELF_ST_EL_PRES )
      {
         /* Program the external logic to decode address bits SA20-SA23 */
         csWritePacketPage( pCS, PKTPG_EEPROM_CMD,
               ((UINT)(pCS->pPacketPage)>>20) | EEPROM_CMD_ELSEL );
      }

      /* Setup chip for memory mode */
      csWritePacketPage( pCS, PKTPG_MEM_BASE, (UINT)(pCS->pPacketPage)&0xFFFF );
      csWritePacketPage( pCS, PKTPG_MEM_BASE+2, (UINT)(pCS->pPacketPage)>>16 );
      BusCtl = BUS_CTL_MEM_MODE;
      if ( pCS->ConfigFlags & CFGFLG_USE_SA )
         BusCtl |= BUS_CTL_USE_SA;
      csWritePacketPage( pCS, PKTPG_BUS_CTL, BusCtl );

      /* We are in memory mode now! */
      pCS->InMemoryMode = TRUE;
   }

   /* If IOCHRDY is enabled then clear the bit in the BusCtl register */
   BusCtl = csReadPacketPage( pCS, PKTPG_BUS_CTL );
   if ( pCS->ConfigFlags & CFGFLG_IOCHRDY )
      csWritePacketPage( pCS, PKTPG_BUS_CTL, BusCtl & ~BUS_CTL_IOCHRDY );
   else
      csWritePacketPage( pCS, PKTPG_BUS_CTL, BusCtl | BUS_CTL_IOCHRDY );

   /* Set the Line Control register to match the media type */
   if ( pCS->MediaType == MEDIA_10BASET )
      csWritePacketPage( pCS, PKTPG_LINE_CTL, LINE_CTL_10BASET );
   else
      csWritePacketPage( pCS, PKTPG_LINE_CTL, LINE_CTL_AUI_ONLY );

   /* Set the BSTATUS/HC1 pin to be used as HC1 */
   /* HC1 is used to enable the DC/DC converter */
   SelfCtl = SELF_CTL_HC1E;

   /* If the media type is 10Base2 */
   if ( pCS->MediaType == MEDIA_10BASE2 )
   {
      /* Enable the DC/DC converter */
      /* If the DC/DC converter has a low enable */
      if ( (pCS->ConfigFlags & CFGFLG_DCDC_POL) == 0 )
         /* Set the HCB1 bit, which causes the HC1 pin to go low */
         SelfCtl |= SELF_CTL_HCB1;
   }
   else  /* Media type is 10BaseT or AUI */
   {
      /* Disable the DC/DC converter */
      /* If the DC/DC converter has a high enable */
      if ( (pCS->ConfigFlags & CFGFLG_DCDC_POL) != 0 )
         /* Set the HCB1 bit, which causes the HC1 pin to go low */
         SelfCtl |= SELF_CTL_HCB1;
   }
   csWritePacketPage( pCS, PKTPG_SELF_CTL, SelfCtl );

   /* If media type is 10BaseT */
   if ( pCS->MediaType == MEDIA_10BASET )
   {
      /* If full duplex mode then set the FDX bit in TestCtl register */
      if ( pCS->ConfigFlags & CFGFLG_FDX )
         csWritePacketPage( pCS, PKTPG_TEST_CTL, TEST_CTL_FDX );
   }
 
}



/******************************************************************************
*
* sysEnetIntEnable - enable CS8900 interrupts at the system level
*
* This routine enables the interrupt used by the CS8900 at the system level.  
* For the i386/i486 BSPs, this is done by making the system call 
* sysIntEnablePIC to enable the CS8900's interrupt at the 8259 PIC.
*
* RETURNS: OK or ERROR
*/

LOCAL STATUS sysEnetIntEnable( CS_END_DEVICE *pCS )
{
#if CPU_FAMILY == ARM
	/* For ARM user:
	   Please make sure how to enable your ARM interrupt for CS8900. */
   /* Enable interrupt at the Interrupt Controller */
    int_enable(pCS->IntLevel);  /* modefied by syx*/
#else
   /* For generic processor */
   /*  intEnable(pCS->IntLevel); */

   /* Enable interrupt at the 8259 PIC */
   if ( sysIntEnablePIC(pCS->IntLevel) == ERROR )
   {
      return ERROR;
   }
#endif

   return OK;
}


/******************************************************************************
*
* sysEnetIntDisable - disable CS8900 interrupts at the system level
*
* This routine disables the interrupt used by the CS8900 at the system level.  
* For the i386/i486 BSPs, this is done by making the system call 
* sysIntDisablePIC to disable the CS8900's interrupt at the 8259 PIC.
*
* NOTE: This routine is not currently required by the CS8900 driver.
*
* RETURNS: OK or ERROR
*/

LOCAL STATUS sysEnetIntDisable( CS_END_DEVICE *pCS )
{
   
#if CPU_FAMILY == ARM
	/* For ARM user:
	   Please make sure how to disable your ARM interrupt for CS8900.*/
   /* disable interrupt at the Interrupt Controller */
  int_disable(pCS->IntLevel);/* turn off the GPIO IRQ bit*/
#else
   /* For generic processor */
   /*  intDisable(pCS->IntLevel); */

   if ( sysIntDisablePIC(pCS->IntLevel) == ERROR )
   {
      return ERROR;
   }
#endif

   return OK;
}

void   INT_UNLOCK(int lockKey)
{
#if CPU_FAMILY ==  ARM
/* For ARM User:
   Please modify these two functions to fit your board.*/
   int_enable(pCS->IntLevel); /*turn on the GPIO IRQ bit*/
#else
     intUnlock(lockKey);
#endif
}


int    INT_LOCK(void)
{
#if CPU_FAMILY ==  ARM
/* For ARM User:
   Please modify these two functions to fit your board.*/
   int_disable(pCS->IntLevel); /* turn off the GPIO IRQ bit*/
    return 0; 
#else
   return intLock();
#endif
}


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
 * Support routines for the above board-specific routines                      *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */


/*******************************************************************************
*
* csGetUnspecifiedParms
*
*
*/

LOCAL STATUS csGetUnspecifiedParms( CS_END_DEVICE *pCS )
{
   USHORT SelfStatus;
   USHORT ISAConfig;
   USHORT MemBase;
   USHORT AdapterConfig;
   USHORT XmitCtl;

   /* If all of these parameters were specified */
   if ( pCS->ConfigFlags!=0 && pCS->pPacketPage!=NULL && pCS->IntLevel!=0 &&
         pCS->MediaType!=0 )
      return OK;  /* Don't need to get anything from the EEPROM */

   /* Verify that the EEPROM is present and OK */
   SelfStatus = csReadPacketPage( pCS, PKTPG_SELF_ST );
   if ( !((SelfStatus & SELF_ST_EEP_PRES) && (SelfStatus & SELF_ST_EEP_OK)) )
   {
#ifdef CS_DEBUG_ENABLE
      logMsg("\ncs0 - EEPROM is missing or bad\n",0,0,0,0,0,0);
#endif
      return ERROR;
   }

   /* Get ISA configuration from the EEPROM */
   if ( csReadEEPROM(pCS,EEPROM_ISA_CFG,&ISAConfig) == ERROR )
      return ERROR;

   /* Get adapter configuration from the EEPROM */
   if ( csReadEEPROM(pCS,EEPROM_ADPTR_CFG,&AdapterConfig) == ERROR )
      return ERROR;

   /* Get transmission control from the EEPROM */
   if ( csReadEEPROM(pCS,EEPROM_XMIT_CTL,&XmitCtl) == ERROR )
      return ERROR;

   /* If the configuration flags were not specified */
   if ( pCS->ConfigFlags == 0 )
   {
      /* Copy the memory mode flag */
      if ( ISAConfig & ISA_CFG_MEM_MODE )
         pCS->ConfigFlags |= CFGFLG_MEM_MODE;

      /* Copy the USE_SA flag */
      if ( ISAConfig & ISA_CFG_USE_SA )
         pCS->ConfigFlags |= CFGFLG_USE_SA;

      /* Copy the IO Channel Ready flag */
      if ( ISAConfig & ISA_CFG_IOCHRDY )
         pCS->ConfigFlags |= CFGFLG_IOCHRDY;

      /* Copy the DC/DC Polarity flag */
      if ( AdapterConfig & ADPTR_CFG_DCDC_POL )
         pCS->ConfigFlags |= CFGFLG_DCDC_POL;

      /* Copy the Full Duplex flag */
      if ( XmitCtl & XMIT_CTL_FDX )
         pCS->ConfigFlags |= CFGFLG_FDX;
   }

   /* If the PacketPage pointer was not specified */
   if ( pCS->pPacketPage == NULL )
   {
      /* If memory mode is enabled */
      if ( pCS->ConfigFlags & CFGFLG_MEM_MODE )
      {
         /* Get the memory base address from EEPROM */
         if ( csReadEEPROM(pCS,EEPROM_MEM_BASE,&MemBase) == ERROR )
            return ERROR;

         MemBase &= MEM_BASE_MASK;  /* Clear unused bits */

         /* Setup the PacketPage pointer */
         pCS->pPacketPage = (unsigned short *)(((ULONG)MemBase)<<8);
      }
   }

#if CPU_FAMILY == I80X86
   /* If the interrupt level was not specified */
   if ( pCS->IntLevel == 0 )
   {
      /* Get the interrupt level from the ISA config */
      pCS->IntLevel = ISAConfig & ISA_CFG_IRQ_MASK;
      if ( pCS->IntLevel == 3 )
         pCS->IntLevel = 5;
      else
         pCS->IntLevel += 10;
   }
#endif

   /* If the media type was not specified */
   if ( pCS->MediaType == 0 )
   {
      switch( AdapterConfig & ADPTR_CFG_MEDIA )
      {
         case ADPTR_CFG_AUI:
            pCS->MediaType = MEDIA_AUI;
            break;
         case ADPTR_CFG_10BASE2:
            pCS->MediaType = MEDIA_10BASE2;
            break;
         case ADPTR_CFG_10BASET:
         default:
            pCS->MediaType = MEDIA_10BASET;
            break;
      }
   }

   return OK;
}


/*******************************************************************************
*
* csValidateParms
*
* This routine verifies that the memory address, interrupt level and media
* type are valid.  If any of these parameters are invalid, then and error
* message is printed and ERROR is returned.
*
*/

LOCAL STATUS csValidateParms( CS_END_DEVICE *pCS )
{
   int MemAddr;

   MemAddr = (int)(pCS->pPacketPage);

   if ( (MemAddr & 0x000FFF) != 0 )
   {
#ifdef CS_DEBUG_ENABLE
      logMsg("\ncs0 - Memory address (0x%X) must start on a 4K boundry\n",
            MemAddr,0,0,0,0,0);
#endif
      return ERROR;
   }

#if CPU_FAMILY == I80X86
   if ( MemAddr > 0xFFF000 )
   {
#ifdef CS_DEBUG_ENABLE
      logMsg("\ncs0 - Memory address (0x%X) is too large\n", MemAddr,0,0,0,0,0 );
#endif
      return ERROR;
   }

   if ( !(pCS->IntLevel==5 || pCS->IntLevel==10 || pCS->IntLevel==11 ||
         pCS->IntLevel==12) )
   {
#ifdef CS_DEBUG_ENABLE
      logMsg("\ncs0 - Interrupt level (%d) is invalid\n", pCS->IntLevel,0,0,0,0,0 );
#endif
      return ERROR;
   }
#endif

   if ( !(pCS->MediaType==MEDIA_AUI || pCS->MediaType==MEDIA_10BASE2 ||
         pCS->MediaType==MEDIA_10BASET) )
   {
#ifdef CS_DEBUG_ENABLE
      logMsg("\ncs0 - Media type (%d) is invalid\n", pCS->MediaType,0,0,0,0,0);
#endif
      return ERROR;
   }

   return OK;
}




/*******************************************************************************
*
* csReadEEPROM
*
* This routine reads a word from the EEPROM at the specified offset.
*
*/

LOCAL STATUS csReadEEPROM( CS_END_DEVICE *pCS, USHORT Offset, USHORT *pValue )
{
   int x;

   /* Ensure that the EEPROM is not busy */
   for ( x=0; x < MAXLOOP; x++ )
      if ( !(csReadPacketPage(pCS,PKTPG_SELF_ST)&SELF_ST_SI_BUSY) )
         break;
   if ( x == MAXLOOP )
   {
#ifdef CS_DEBUG_ENABLE
      logMsg("\ncs0 - Can not read from EEPROM\n",0,0,0,0,0,0);
#endif
      return ERROR;
   }

   /* Issue the command to read the offset within the EEPROM */
   csWritePacketPage( pCS, PKTPG_EEPROM_CMD, Offset | EEPROM_CMD_READ );

   /* Wait until the command is completed */
   for ( x=0; x<MAXLOOP; x++ )
      if ( !(csReadPacketPage(pCS,PKTPG_SELF_ST)&SELF_ST_SI_BUSY) )
         break;
   if ( x == MAXLOOP )
   {
#ifdef CS_DEBUG_ENABLE
      logMsg("\ncs0 - Can not read from EEPROM\n",0,0,0,0,0,0);
#endif
      return ERROR;
   }

   /* Get the EEPROM data from the EEPROM Data register */
   *pValue = csReadPacketPage( pCS, PKTPG_EEPROM_DATA );

   return OK;
}


/*add by syx*/   /*to be add to sysLib.c*/
void CS_end_Init(void)
{
unsigned int *vEXTINT1  = (unsigned int *)EXTINT1;
unsigned int *vGPGCON  = (unsigned int *)GPGCON;
unsigned int *vBWSCON = (unsigned int *)BWSCON;
unsigned int *vBANKCON2= (unsigned int *)BANKCON2;
*vGPGCON=(*vGPGCON)&((~3)<<2)|(2<<2);*vEXTINT1=(*vEXTINT1)&((~0xf)<<4)|(4<<4);

*vBWSCON=(*vBWSCON)&((~0x3)<<8)|(1<<8); 
*vBWSCON=(*vBWSCON)&((~0x3)<<14)|(1<<14); /* 設置網卡芯片所在BANK2的位寬為16bit,使用NWAIT信號,不使用 UB/LB */
*vBANKCON2=0x00000C00;

}
/*end add*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产大片一区二区| 精品久久人人做人人爽| 欧美性猛片aaaaaaa做受| 日韩三级免费观看| 亚洲黄色小视频| 激情综合色综合久久| 日本精品视频一区二区| 欧美国产精品v| 激情综合色综合久久综合| 欧美在线观看视频在线| 国产欧美一区二区精品性色超碰| 日韩av不卡在线观看| 91欧美激情一区二区三区成人| 久久亚洲影视婷婷| 美女网站在线免费欧美精品| 日本久久精品电影| 综合婷婷亚洲小说| 成人av集中营| 国产欧美日本一区视频| 国产一区亚洲一区| 7777精品伊人久久久大香线蕉经典版下载 | 亚洲一区免费在线观看| 国产成人亚洲综合a∨婷婷图片| 日韩免费一区二区| 男女男精品网站| 欧美日韩国产精选| 五月综合激情网| 欧美日韩高清一区二区不卡| 亚洲一区二区三区自拍| 欧美亚洲综合色| 亚洲精品国产a| 91成人在线免费观看| 亚洲免费观看高清完整版在线观看 | 91黄色免费看| 自拍偷在线精品自拍偷无码专区| 成人永久aaa| 国产精品美女久久久久aⅴ | 国产精品视频九色porn| 国产成人av资源| 欧美国产精品专区| 一本色道久久综合亚洲精品按摩| 樱桃视频在线观看一区| 在线观看欧美黄色| 性做久久久久久免费观看欧美| 欧美精品丝袜中出| 青娱乐精品在线视频| 精品久久久久av影院| 国产自产v一区二区三区c| 国产偷国产偷精品高清尤物| 成人午夜大片免费观看| 亚洲视频你懂的| 欧美高清激情brazzers| 久久不见久久见免费视频7| 久久久久久久久免费| 91视频在线看| 日韩精品欧美成人高清一区二区| 日韩欧美123| 成人黄色免费短视频| 夜夜夜精品看看| 欧美一级淫片007| 国产成人一级电影| 亚洲午夜免费视频| 久久综合色8888| 色吧成人激情小说| 久久99热99| 亚洲精品乱码久久久久久久久| 欧美一区二区三区啪啪| 国产成人综合亚洲网站| 美国毛片一区二区| 国产精品毛片久久久久久久| 69p69国产精品| 成人黄色软件下载| 美女网站在线免费欧美精品| 国产精品久久久久四虎| 欧美一区二区三区在线视频| av在线不卡免费看| 免费观看日韩av| 亚洲欧美另类图片小说| 精品国产一区二区三区忘忧草| av中文字幕不卡| 狠狠色丁香婷婷综合| 亚洲精品菠萝久久久久久久| www激情久久| 制服丝袜中文字幕亚洲| aaa欧美日韩| 国产精品996| 日韩极品在线观看| 亚洲狠狠丁香婷婷综合久久久| 久久综合久久综合久久综合| 欧美日韩精品一区二区三区蜜桃 | 欧美国产激情二区三区| 91精品国产欧美一区二区18| eeuss鲁片一区二区三区在线观看| 麻豆国产一区二区| 午夜精品123| 亚洲一区二区四区蜜桃| 亚洲欧洲99久久| 国产精品美女视频| 26uuu欧美日本| 日韩一级片在线观看| 欧美日韩午夜在线视频| 91成人在线免费观看| eeuss鲁片一区二区三区| 国产精品1区2区3区| 国内国产精品久久| 蜜臀久久99精品久久久久宅男 | 国产亚洲自拍一区| 日韩精品自拍偷拍| 91精品国产日韩91久久久久久| 在线观看一区日韩| 色婷婷综合久久久久中文| 国产福利一区在线| 国产在线日韩欧美| 激情深爱一区二区| 国产一区二区三区免费| 六月丁香综合在线视频| 久久精品国产一区二区| 日本在线不卡视频| 蜜桃久久av一区| 蜜桃视频在线一区| 国产中文字幕精品| 国产成人在线免费| 成人福利视频网站| 91在线你懂得| 欧美在线视频全部完| 欧美日韩精品一区视频| 欧美精品 日韩| 欧美不卡123| 中文字幕高清不卡| 亚洲人成精品久久久久| 亚洲一区二区三区四区在线| 午夜精品一区二区三区电影天堂| 日本午夜精品视频在线观看| 九九精品视频在线看| 国产suv精品一区二区883| 成人免费va视频| 色综合久久88色综合天天免费| 欧美亚洲国产bt| 欧美成人一区二区三区在线观看| 2019国产精品| 亚洲视频一二三区| 日韩avvvv在线播放| 国产夫妻精品视频| 色综合久久六月婷婷中文字幕| 欧美性生活影院| 欧美r级在线观看| 国产精品天美传媒| 香蕉久久一区二区不卡无毒影院| 免费美女久久99| 不卡视频免费播放| 91精品午夜视频| 中文字幕欧美激情一区| 日韩中文字幕亚洲一区二区va在线| 日韩**一区毛片| www.色精品| 日韩情涩欧美日韩视频| 亚洲天堂成人网| 麻豆精品久久久| 欧美在线免费播放| 国产精品亲子伦对白| 日本欧美大码aⅴ在线播放| 成人精品视频.| 欧美一级片在线| 一卡二卡欧美日韩| 国产成人在线电影| 日韩你懂的在线播放| 亚洲愉拍自拍另类高清精品| 国产精品系列在线播放| 欧美精品18+| 亚洲一二三四区| www.激情成人| 国产亚洲精品中文字幕| 天天av天天翘天天综合网| av欧美精品.com| 久久久精品人体av艺术| 美女视频一区二区三区| 欧美亚洲免费在线一区| 亚洲天堂av一区| 成人网页在线观看| 精品国产一区二区精华| 日本美女一区二区| 欧美日韩高清在线播放| 一级女性全黄久久生活片免费| 成人国产精品免费观看动漫| 久久综合久久久久88| 欧美a级一区二区| 91精品欧美一区二区三区综合在| 亚洲精品国产无天堂网2021| 91在线免费播放| 17c精品麻豆一区二区免费| 成人一级片在线观看| 国产亚洲一二三区| 国产一区欧美二区| 精品播放一区二区| 久久99精品久久久久| 精品区一区二区| 韩国女主播成人在线| 久久久精品2019中文字幕之3| 精品一区二区三区免费视频| 欧美变态tickling挠脚心|