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

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

?? cmmd_atapi.c

?? STi5518機(jī)頂盒ATAPI源代碼!絕對超值!
?? C
?? 第 1 頁 / 共 3 頁
字號:
       /* Data Transfer Loop....          Check for buffer overrun       */       if((*Cmd_p->BytesRW)+ByteCount > Cmd_p->BufferSize )       {           Ata_p->LastExtendedErrorCode= 0x59;           GetPktStatus(Ata_p,Cmd_p->Stat.PktStat);           Error=TRUE;           break;       }            WordCount = ( ByteCount >> 1 ) + ( ByteCount & 0x0001 );              /* Data Transfer ....                      */                              *Cmd_p->BytesRW+= (WordCount << 1);        hal_RegInBlock(Ata_p->HalHndl,Data_p,ByteCount,                           Cmd_p->UseDMA);        Data_p+=WordCount;               WAIT400NS;   }    /* End of transfer loop */      if(Error == FALSE)   {                        Status= hal_RegInByte(Ata_p->HalHndl,ATA_REG_STATUS);           Reason= hal_RegInByte(Ata_p->HalHndl,ATA_REG_SECCOUNT);        LowCyl= hal_RegInByte(Ata_p->HalHndl,ATA_REG_CYLLOW);           HighCyl= hal_RegInByte(Ata_p->HalHndl,ATA_REG_CYLHIGH);                 /* Final Status check */                          if( Status  & (BSY_BIT_MASK | DRQ_BIT_MASK | ERR_BIT_MASK))       {          Ata_p->LastExtendedErrorCode= 0x58;          GetPktStatus(Ata_p,Cmd_p->Stat.PktStat);          return TRUE;       }       Ata_p->LastExtendedErrorCode= 0x00;                  }       /*read the output registers and store them in the pkt status structure*/    GetPktStatus(Ata_p,Cmd_p->Stat.PktStat);    return Error;    }   /************************************************************************Name: ata_packet_PioOutDescription: executes a command with data transfer from the host              to the device via PIO.             The device is already selected, no parameters check             is performed. We totally trust on the caller               Parameters: Two params:            Ata_p : Pointer to the ATA control block            Cmd_p : Pointer to a command structureReturn:     TRUE:  Extended error is set            FALSE: No error                     ************************************************************************/BOOL ata_packet_PioOut(ata_ControlBlock_t *Ata_p, ata_Cmd_t *Cmd_p){    DU8 Status,Reason,LowCyl,HighCyl;    U32 TimeOut,i;    BOOL Error=FALSE;    U32 WordCount,ByteCount;        U16 *Data_p;        /* First we write the registers */       hal_RegOutByte(Ata_p->HalHndl,ATA_REG_FEATURE, Cmd_p->Feature);   hal_RegOutByte(Ata_p->HalHndl,ATA_REG_SECCOUNT, Cmd_p->SecCount);   hal_RegOutByte(Ata_p->HalHndl,ATA_REG_SECNUM, Cmd_p->SecNum);   hal_RegOutByte(Ata_p->HalHndl,ATA_REG_CYLLOW, Cmd_p->CylLow);   hal_RegOutByte(Ata_p->HalHndl,ATA_REG_CYLHIGH, Cmd_p->CylHigh);   hal_RegOutByte(Ata_p->HalHndl,ATA_REG_DEVHEAD, Cmd_p->DevHead);      if(WaitForBitPkt(Ata_p->HalHndl,ATA_REG_ALTSTAT,DRDY_BIT_MASK,DRDY_BIT_MASK))   {       Ata_p->LastExtendedErrorCode= 0x5B;         GetPktStatus(Ata_p,Cmd_p->Stat.PktStat);                  return TRUE;              }       /* Finally write the command */   hal_RegOutByte(Ata_p->HalHndl,ATA_REG_COMMAND, Cmd_p->CommandCode);              WAIT400NS;      /* Now Check the Status */    Status= hal_RegInByte(Ata_p->HalHndl,ATA_REG_ALTSTAT);        /* Command packet transfer...*/    /* Check for protocol failures, the device should        have BSY=1 now, but a number of strange things can happen:       1) the device may not set BSY=1 or DRQ=1 for a while       2) the device may go directly to DRQ status,       3) the device may reject the command (maybe is not really          an  ATAPI device or has some error)    */    TimeOut= PACKET_TIMEOUT;        while(TRUE)    {        if(Status & BSY_BIT_MASK)        {           break; /* BSY=1 that's OK! */        }else        {           if( Status & DRQ_BIT_MASK )             {             break;  /* BSY=0 & DRQ=1 That's OK */           }           if( Status & ERR_BIT_MASK)           {             /* Error,that's not OK */             break;           }         }        if(TimeOut==0)        {            /* Error */            break;        }                TimeOut--;        Status= hal_RegInByte(Ata_p->HalHndl,ATA_REG_ALTSTAT);    }        /* Command packet transfer....                          */    /* Poll Alternate Status for BSY=0                      */    if(WaitForBitPkt(Ata_p->HalHndl,ATA_REG_ALTSTAT,BSY_BIT_MASK,0))    {       Ata_p->LastExtendedErrorCode= 0x51;       GetPktStatus(Ata_p,Cmd_p->Stat.PktStat);       return TRUE;    }        /* Command packet transfer....                          */    /* Check for protocol failures.. clear interrupts       */               hal_ClearInterrupt(Ata_p->HalHndl);                /* Command packet transfer....                                 Read the primary status register abd other ATAPI registers                */              Status= hal_RegInByte(Ata_p->HalHndl,ATA_REG_STATUS);            Reason= hal_RegInByte(Ata_p->HalHndl,ATA_REG_SECCOUNT);         LowCyl= hal_RegInByte(Ata_p->HalHndl,ATA_REG_CYLLOW);            HighCyl= hal_RegInByte(Ata_p->HalHndl,ATA_REG_CYLHIGH);                /* Command packet transfer....                                  check status must have BSY=0 DRQ-1     */                if((Status & (BSY_BIT_MASK | DRQ_BIT_MASK))!= DRQ_BIT_MASK)     {        Ata_p->LastExtendedErrorCode= 0x52;        GetPktStatus(Ata_p,Cmd_p->Stat.PktStat);        return TRUE;     }                    /* Transfer the packet     */               for(i=0;i<Ata_p->Handles[Ata_p->DeviceSelected].PktSize;i++)      {      hal_RegOutWord(Ata_p->HalHndl,Cmd_p->Pkt[i]);       }           WAIT400NS;           /* --------------- Transfer Loop--------------- */   *Cmd_p->BytesRW=0;    Data_p =(U16*) Cmd_p->DataBuffer;      while (Error==FALSE)        {      #if ATAPI_USING_INTERRUPTS     if(hal_AwaitInt(Ata_p->HalHndl,PACKET_INT_TIMEOUT))     {          Ata_p->LastExtendedErrorCode= 0x53;          GetPktStatus(Ata_p,Cmd_p->Stat.PktStat);          return TRUE;     }       #else     WAIT400NS;     if(WaitForBitPkt(Ata_p->HalHndl,ATA_REG_ALTSTAT,BSY_BIT_MASK,0))     {        Ata_p->LastExtendedErrorCode= 0x54;        GetPktStatus(Ata_p,Cmd_p->Stat.PktStat);        return TRUE;     }    #endif /* ATAPI_USING_INTERRUPTS */               Status= hal_RegInByte(Ata_p->HalHndl,ATA_REG_STATUS);           Reason= hal_RegInByte(Ata_p->HalHndl,ATA_REG_SECCOUNT);        LowCyl= hal_RegInByte(Ata_p->HalHndl,ATA_REG_CYLLOW);           HighCyl= hal_RegInByte(Ata_p->HalHndl,ATA_REG_CYLHIGH);                    if( (Status & (BSY_BIT_MASK | DRQ_BIT_MASK)) == 0)       {            /* end of transfer lets quit*/           Ata_p->LastExtendedErrorCode= 0x00;           GetPktStatus(Ata_p,Cmd_p->Stat.PktStat);           Error=FALSE;           break;       }              if( (Status & (BSY_BIT_MASK | DRQ_BIT_MASK)) != DRQ_BIT_MASK)       {           Ata_p->LastExtendedErrorCode= 0x55;           GetPktStatus(Ata_p,Cmd_p->Stat.PktStat);           Error=TRUE;           break;       }       if( (Reason & (TAG_BIT_MASK | REL_BIT_MASK))            || (Reason &  CD_BIT_MASK))       {           Ata_p->LastExtendedErrorCode= 0x5C;           GetPktStatus(Ata_p,Cmd_p->Stat.PktStat);           Error=TRUE;           break;       }       if( (Reason & IO_BIT_MASK )==0)       {           /* Wrong direction, we expect a IO = 1 */            Ata_p->LastExtendedErrorCode= 0x5D;           GetPktStatus(Ata_p,Cmd_p->Stat.PktStat);           Error=TRUE;           break;       }       /* Data Transfer Loop....          get the byte count and check for zero       */       ByteCount= (HighCyl<<8) | LowCyl;       if(ByteCount<1)       {           Ata_p->LastExtendedErrorCode= 0x60;           GetPktStatus(Ata_p,Cmd_p->Stat.PktStat);           Error=TRUE;           break;       }              /* Data Transfer Loop....          Check for buffer overrun       */       if((*Cmd_p->BytesRW)+ByteCount > Cmd_p->BufferSize )       {           Ata_p->LastExtendedErrorCode= 0x59;           GetPktStatus(Ata_p,Cmd_p->Stat.PktStat);           Error=TRUE;           break;       }            WordCount = ( ByteCount >> 1 ) + ( ByteCount & 0x0001 );              /* Data Transfer ....                      */        hal_RegOutBlock(Ata_p->HalHndl,Data_p,ByteCount,                           Cmd_p->UseDMA);        *Cmd_p->BytesRW+= (WordCount << 1);        Data_p+=WordCount;              WAIT400NS;   }       if(Error == FALSE)   {                         Status= hal_RegInByte(Ata_p->HalHndl,ATA_REG_STATUS);           Reason= hal_RegInByte(Ata_p->HalHndl,ATA_REG_SECCOUNT);        LowCyl= hal_RegInByte(Ata_p->HalHndl,ATA_REG_CYLLOW);           HighCyl= hal_RegInByte(Ata_p->HalHndl,ATA_REG_CYLHIGH);                 /* Final Status check */                          if( Status  & (BSY_BIT_MASK | DRQ_BIT_MASK | ERR_BIT_MASK))       {          Ata_p->LastExtendedErrorCode= 0x58;          GetPktStatus(Ata_p,Cmd_p->Stat.PktStat);          return TRUE;       }       Ata_p->LastExtendedErrorCode= 0x00;              }       /*read the output registers and store them in the pkt status structure*/    GetPktStatus(Ata_p,Cmd_p->Stat.PktStat);    return Error;    } /************************************************************************Name: ata_packet_PioInDescription: executes a command with data transfer from the device              to the host via DMA.             The device is already selected, no parameters check             is performed.               Parameters: Two params:            Ata_p : Pointer to the ATA control block            Cmd_p : Pointer to a command structureReturn:     TRUE:  Extended error is set            FALSE: No error                     ************************************************************************/BOOL ata_packet_DmaIn(ata_ControlBlock_t *Ata_p, ata_Cmd_t *Cmd_p){    DU8 Status,Reason,LowCyl,HighCyl;    U32 TimeOut,i;    BOOL Error=FALSE, CrcError = FALSE;    U32 WordCount,ByteCount;        U16 *Data_p;    U8 Retries = 4;    while ((Error==FALSE) && (Retries > 0))    {         /* First we write the registers */             hal_RegOutByte(Ata_p->HalHndl,ATA_REG_FEATURE, Cmd_p->Feature);        hal_RegOutByte(Ata_p->HalHndl,ATA_REG_SECCOUNT, Cmd_p->SecCount);        hal_RegOutByte(Ata_p->HalHndl,ATA_REG_SECNUM, Cmd_p->SecNum);        hal_RegOutByte(Ata_p->HalHndl,ATA_REG_CYLLOW, Cmd_p->CylLow);        hal_RegOutByte(Ata_p->HalHndl,ATA_REG_CYLHIGH, Cmd_p->CylHigh);        hal_RegOutByte(Ata_p->HalHndl,ATA_REG_DEVHEAD, Cmd_p->DevHead);            if(WaitForBitPkt(Ata_p->HalHndl,ATA_REG_ALTSTAT,DRDY_BIT_MASK,DRDY_BIT_MASK))        {            Ata_p->LastExtendedErrorCode= 0x5B;              GetPktStatus(Ata_p,Cmd_p->Stat.PktStat);                       return TRUE;                }            /* Finally write the command */        hal_RegOutByte(Ata_p->HalHndl,ATA_REG_COMMAND, Cmd_p->CommandCode);        WAIT400NS;            /* Now Check the Status */        Status= hal_RegInByte(Ata_p->HalHndl,ATA_REG_ALTSTAT);            /* Command packet transfer...*/        /* Check for protocol failures, the device should            have BSY=1 now, but a number of strange things can happen:           1) the device may not set BSY=1 or DRQ=1 for a while           2) the device may go directly to DRQ status,           3) the device may reject the command (maybe is not really           an  ATAPI device or has some error)        */        TimeOut= PACKET_TIMEOUT;            while(TRUE)        {            if(Status & BSY_BIT_MASK)            {                break; /* BSY=1 that's OK! */            }            else            {                if( Status & DRQ_BIT_MASK )                  {                    break;  /* BSY=0 & DRQ=1 That's OK */                }                if( Status & ERR_BIT_MASK)                {                    /* Error,that's not OK */                    break;                }             }            if(TimeOut==0)            {                /* Error */                break;            }                    TimeOut--;            Status= hal_RegInByte(Ata_p->HalHndl,ATA_REG_ALTSTAT);        }            /* Command packet transfer....                          */        /* Poll Alternate Status for BSY=0                      */        if(WaitForBitPkt(Ata_p->HalHndl,ATA_REG_ALTSTAT,BSY_BIT_MASK,0))        {            Ata_p->LastExtendedErrorCode= 0x51;            GetPktStatus(Ata_p,Cmd_p->Stat.PktStat);            return TRUE;        }            /* Command packet transfer....                          */        /* Check for protocol failures.. clear interrupts       */                 hal_ClearInterrupt(Ata_p->HalHndl);            /* Command packet transfer....                                     Read the primary status register and other ATAPI registers                    */              Status= hal_RegInByte(Ata_p->HalHndl,ATA_REG_STATUS);            Reason= hal_RegInByte(Ata_p->HalHndl,ATA_REG_SECCOUNT); 

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久久久蜜桃| 91黄色激情网站| 亚洲午夜精品网| 久久先锋影音av| 在线视频观看一区| 国产一区二区不卡在线| 一区二区三区免费观看| 久久精品免视看| 日韩视频免费观看高清在线视频| 不卡的电影网站| 国产一区二区在线电影| 日韩精品色哟哟| 一区二区三区日本| 一区在线播放视频| 久久久另类综合| 精品电影一区二区三区| 精品视频1区2区| 色欲综合视频天天天| 成人一区在线观看| 国内偷窥港台综合视频在线播放| 亚洲成av人片在线观看无码| 亚洲视频图片小说| 亚洲欧洲色图综合| 国产精品私房写真福利视频| 久久综合一区二区| 亚洲精品在线观看视频| 日韩免费高清视频| 91麻豆精品国产91久久久 | 国产人伦精品一区二区| 欧美成人a在线| 在线91免费看| 欧美一区三区四区| 欧美一区二区大片| 日韩欧美一级精品久久| 正在播放亚洲一区| 91精品国产免费久久综合| 在线不卡中文字幕| 欧美裸体bbwbbwbbw| 欧美日韩二区三区| 欧美一级欧美三级在线观看| 制服丝袜av成人在线看| 欧美一区二区三区小说| 欧美电影精品一区二区| 日韩精品自拍偷拍| 欧美xxxxxxxx| 日本一区二区三区视频视频| 国产亚洲污的网站| 国产精品久久久久7777按摩| 中文字幕欧美一| 亚洲免费在线播放| 亚洲福利一区二区三区| 午夜精品久久久久久久| 亚洲第一福利一区| 日韩电影网1区2区| 激情国产一区二区| 高清视频一区二区| 91久久精品一区二区三| 欧美日韩一区高清| 欧美成人女星排名| 中文子幕无线码一区tr| 午夜欧美电影在线观看| 午夜精品视频在线观看| 老司机精品视频一区二区三区| 美腿丝袜在线亚洲一区| 国产精品一区二区久久精品爱涩| 成人一级黄色片| 91免费版在线看| 91精品综合久久久久久| 久久蜜桃av一区二区天堂| 亚洲欧洲精品一区二区三区不卡| 亚洲在线成人精品| 黑人巨大精品欧美一区| 91网上在线视频| 欧美精品久久久久久久多人混战 | 一区二区三区波多野结衣在线观看| 亚洲一区视频在线| 国产一区二区三区四区五区美女 | 欧美日韩精品一二三区| 欧美精品一区二区高清在线观看 | 日本视频免费一区| 国产成人亚洲综合a∨婷婷图片| av不卡在线观看| 91精品国产色综合久久不卡电影 | 国产精品毛片无遮挡高清| 一区二区三区在线免费观看| 久久精品噜噜噜成人av农村| 国产.欧美.日韩| 欧美日韩亚洲综合一区二区三区| 久久综合九色综合97婷婷女人| 亚洲视频1区2区| 精品在线观看视频| 欧美性色黄大片手机版| 久久综合九色综合97婷婷女人 | 香蕉加勒比综合久久| 国产高清久久久| 欧美喷潮久久久xxxxx| 中文字幕免费一区| 蜜桃一区二区三区四区| 91免费在线看| 国产日韩欧美不卡在线| 免费成人在线观看| 日本韩国精品在线| 亚洲国产精品国自产拍av| 蜜桃av一区二区在线观看| 色屁屁一区二区| 国产欧美日产一区| 精品一区二区三区免费播放 | 国产欧美日韩不卡| 毛片av一区二区三区| 欧美亚洲禁片免费| 亚洲欧美日韩国产综合| 国产 日韩 欧美大片| www久久久久| 男女性色大片免费观看一区二区 | 国产在线精品免费| 欧美一级午夜免费电影| 亚洲成人免费观看| 欧美性生活一区| 亚洲免费在线视频一区 二区| 豆国产96在线|亚洲| 久久免费的精品国产v∧| 蜜桃在线一区二区三区| 在线91免费看| 视频一区中文字幕国产| 久久青草欧美一区二区三区| 琪琪一区二区三区| 51精品视频一区二区三区| 亚洲综合一二区| 欧美色图在线观看| 亚洲乱码国产乱码精品精的特点 | 国产成人精品亚洲777人妖| 91麻豆精品国产自产在线| 丝袜亚洲另类欧美| 9191成人精品久久| 亚洲福利一区二区| 91麻豆精品国产91| 日韩av一区二区三区四区| 欧美一区二区二区| 精品一区二区三区在线视频| 日韩欧美一二区| 精品无码三级在线观看视频| 欧美mv日韩mv国产| 国产成人在线色| 1000精品久久久久久久久| 91一区二区三区在线观看| 一区二区三区四区激情| 欧美日韩国产综合一区二区| 亚洲h在线观看| 日韩三级视频中文字幕| 激情综合色综合久久综合| 久久久美女毛片| 不卡视频在线看| 一区二区三区四区国产精品| 欧美高清视频在线高清观看mv色露露十八| 亚洲图片欧美一区| 欧美高清dvd| 精品一区二区三区欧美| 国产精品全国免费观看高清| 99久久精品情趣| 亚洲一区二区三区四区在线免费观看 | 欧美性猛片aaaaaaa做受| 天天色 色综合| 久久久久久99精品| 99久久亚洲一区二区三区青草| 一区二区视频在线看| 欧美肥妇毛茸茸| 国产在线不卡视频| 亚洲欧美激情插| 日韩精品一区二区三区在线观看| 丁香六月综合激情| 亚洲激情综合网| 日韩精品一区二区三区三区免费| 福利视频网站一区二区三区| 亚洲男人都懂的| 欧美一区二区三级| 97se亚洲国产综合自在线观| 五月婷婷欧美视频| 国产视频亚洲色图| 精品视频999| 成人免费va视频| 日日欢夜夜爽一区| 国产精品少妇自拍| 欧美日韩国产精品成人| 国产精品亚洲第一| 婷婷夜色潮精品综合在线| 久久精品一二三| 在线播放国产精品二区一二区四区| 国产一区欧美一区| 久久99国内精品| 亚洲综合小说图片| 国产日韩欧美电影| 日韩欧美亚洲另类制服综合在线 | 91精品国产综合久久久久久久 | 久久精品久久久精品美女| 中文字幕在线观看一区二区| 日韩一区二区电影网| 91丨porny丨首页| 国产精品夜夜嗨| 日韩成人伦理电影在线观看| 亚洲视频在线一区|