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

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

?? cmmd_ata.c

?? STi5518機頂盒ATAPI源代碼!絕對超值!
?? C
?? 第 1 頁 / 共 2 頁
字號:
                break;            }            /* All sectors have been read without error, exit */            Ata_p->LastExtendedErrorCode= 0x00;             break;        }                #if  ATAPI_USING_INTERRUPTS        if(hal_AwaitInt(Ata_p->HalHndl,INT_TIMEOUT))        {            STTBX_Print(("no interrupt 0x44\n"));            Ata_p->LastExtendedErrorCode= 0x44;            Error= TRUE;            break;        }        #else        WAIT400NS;        if(WaitForBit(Ata_p->HalHndl,ATA_REG_ALTSTAT,BSY_BIT_MASK,0))        {            Ata_p->LastExtendedErrorCode= 0x45;              Error= TRUE;            break;        }#endif /* ATAPI_USING_INTERRUPTS */                status = hal_RegInByte(Ata_p->HalHndl, ATA_REG_STATUS);                        /*  So was there any error?  */        if ((status & (ERR_BIT_MASK | DF_BIT_MASK)) != 0)        {            STTBX_Print(("DF or ERR; 0x%02x; 0x41\n", status));            GetCmdStatus(Ata_p, Cmd_p->Stat.CmdStat);            Ata_p->LastExtendedErrorCode = 0x41;            Error = TRUE;            break;        }                if (status & (DRQ_BIT_MASK) == 0)        {            STTBX_Print(("DRQ bit empty; 0x%02x; 0x42\n", status));            Ata_p->LastExtendedErrorCode = 0x42;            Error = TRUE;            break;        }                /*End of write loop*/    }        /*read the output registers and store them in the cmd status structure*/    GetCmdStatus(Ata_p, Cmd_p->Stat.CmdStat);    return Error;    } /************************************************************************Name: ata_cmd_DmaInDescription:     Executes a command with data transfer from the host to the device via DMA.     The device and mode are already selected, no parameter checks are     performed. Buffers are assumed to be 16-bit aligned (for DMA).Parameters:     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_cmd_DmaIn(ata_ControlBlock_t *Ata_p, ata_Cmd_t *Cmd_p){    volatile U8 status;    BOOL Error=FALSE, CrcError = FALSE;    U16* Data_p;    while ((Error == FALSE) && (Cmd_p->SecCount > 0))    {        *Cmd_p->BytesRW = 0;        Data_p= (U16*) Cmd_p->DataBuffer;           /* First we write the registers */        ata_cmd_WriteRegs(Ata_p, Cmd_p);            if(WaitForBit(Ata_p->HalHndl,ATA_REG_ALTSTAT,DRDY_BIT_MASK,DRDY_BIT_MASK))        {            Ata_p->LastExtendedErrorCode= 0x36;              GetCmdStatus(Ata_p,Cmd_p->Stat.CmdStat);                       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_STATUS);                /* Checking if Busy =0 and DRQ=1 in order to           enter into the transfer phase                    */        if ((status & (BSY_BIT_MASK | DRQ_BIT_MASK)) != 0)        {            /* Read one DRQ sector*/            Error = hal_DmaDataBlock(Ata_p->HalHndl,                             Cmd_p->DevCtrl, Cmd_p->DevHead,                             Data_p, Cmd_p->MultiCnt * SECTOR_WSIZE,                             Cmd_p->BufferSize, Cmd_p->BytesRW,                             TRUE, &CrcError);            if (Error == FALSE)            {                Data_p += (Cmd_p->MultiCnt * SECTOR_WSIZE);                Cmd_p->SecCount = Cmd_p->SecCount - Cmd_p->MultiCnt;                }            /* Do any tidying up required */            hal_AfterDma(Ata_p->HalHndl);        }        if (CrcError == TRUE)        {            Ata_p->LastExtendedErrorCode = EXTERROR_CRCERROR;            Error = TRUE;            break;        }                /* Now check the status*/        status = hal_RegInByte(Ata_p->HalHndl,ATA_REG_STATUS);        /*  So was there any error?  */        if ((status & (BSY_BIT_MASK | ERR_BIT_MASK | DF_BIT_MASK))!= 0)        {            Ata_p->LastExtendedErrorCode= 0x31;              Error = TRUE;            break;        }                if ((status & (DRDY_BIT_MASK)) == 0)        {            Ata_p->LastExtendedErrorCode= 0x32;             Error = TRUE;            break;        }        if(Cmd_p->SecCount < 1)        {               /* Since the drive has transferred all of the requested sectors               without error, the drive should not have BUSY, DEVICE FAULT,               DATA REQUEST or ERROR active now.*/            WAIT400NS;              status = hal_RegInByte(Ata_p->HalHndl,ATA_REG_STATUS);            if (status & (BSY_BIT_MASK | ERR_BIT_MASK | DF_BIT_MASK | DRQ_BIT_MASK))            {                Ata_p->LastExtendedErrorCode= 0x33;                  Error= TRUE;                break;            }            /* All sectors have been read without error, exit */            Ata_p->LastExtendedErrorCode= 0x00;            break;        }        /*End of read loop*/    }    /*read the output registers and store them in the cmd status structure*/    GetCmdStatus(Ata_p, Cmd_p->Stat.CmdStat);    return Error;    }   /************************************************************************Name: ata_cmd_DmaOutDescription:     Executes a command with data transfer from the host to the device via DMA.     The device and mode are already selected, no parameter checks are     performed. Buffers are assumed to be 16-bit aligned (for DMA).Parameters:     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_cmd_DmaOut(ata_ControlBlock_t *Ata_p, ata_Cmd_t *Cmd_p){    volatile U8 status;    BOOL Error=FALSE, CrcError = FALSE;    U16* Data_p;    while ((Error == FALSE) && (Cmd_p->SecCount > 0))    {        *Cmd_p->BytesRW =0;        Data_p= (U16*) Cmd_p->DataBuffer;            /* First we write the registers */        ata_cmd_WriteRegs(Ata_p, Cmd_p);        intcount = 0;        if(WaitForBit(Ata_p->HalHndl, ATA_REG_ALTSTAT,                       DRDY_BIT_MASK | BSY_BIT_MASK, DRDY_BIT_MASK))        {            Ata_p->LastExtendedErrorCode= 0x46;              GetCmdStatus(Ata_p,Cmd_p->Stat.CmdStat);            return TRUE;        }        /* Write the command */        hal_RegOutByte(Ata_p->HalHndl,ATA_REG_COMMAND, Cmd_p->CommandCode);                WAIT400NS;                /* Wait for BSY == 0 and DRQ == 1 */        if (WaitForBit(Ata_p->HalHndl, ATA_REG_STATUS,                        BSY_BIT_MASK | DRQ_BIT_MASK, DRQ_BIT_MASK))        {            /* Busy signal, or drive not ready for data */            Ata_p->LastExtendedErrorCode= 0x45;              return  TRUE;        }        STTBX_Print(("DMA writing\n"));        /* Transfering Data: Write Loop*/        status = hal_RegInByte(Ata_p->HalHndl, ATA_REG_STATUS);        /* Check for BSY xor DRQ to continue */        if ((status & (DRQ_BIT_MASK | BSY_BIT_MASK)) != 0)        {            /* Write sector(s) */            Error = hal_DmaDataBlock(Ata_p->HalHndl,                             Cmd_p->DevCtrl, Cmd_p->DevHead,                             Data_p, Cmd_p->MultiCnt * SECTOR_WSIZE,                             Cmd_p->BufferSize, Cmd_p->BytesRW,                             FALSE, &CrcError);            if (Error == FALSE)            {                Data_p += (Cmd_p->MultiCnt * SECTOR_WSIZE);                Cmd_p->SecCount = Cmd_p->SecCount - Cmd_p->MultiCnt;            }            /* Do any tidying up that might be required */            hal_AfterDma(Ata_p->HalHndl);                }                if (CrcError == TRUE)        {            Ata_p->LastExtendedErrorCode = EXTERROR_CRCERROR;            Error = TRUE;            break;        }                /* Check the status*/                status=hal_RegInByte(Ata_p->HalHndl,ATA_REG_STATUS);        if ((status & (BSY_BIT_MASK | ERR_BIT_MASK | DF_BIT_MASK)) != 0)        {            Ata_p->LastExtendedErrorCode = 0x41;            Error = TRUE;            break;        }                if ((status & (DRDY_BIT_MASK)) == 0)        {            Ata_p->LastExtendedErrorCode= 0x32;             Error= TRUE;            break;        }                if (Cmd_p->SecCount < 1)        {               /*Since the drive has transferred all of the requested sectors              without error, the drive should not have BUSY, DEVICE FAULT,              DATA REQUEST or ERROR active now.*/            WAIT400NS;            status = hal_RegInByte(Ata_p->HalHndl,ATA_REG_STATUS);            if(status & (BSY_BIT_MASK | ERR_BIT_MASK | DF_BIT_MASK | DRQ_BIT_MASK))            {                Ata_p->LastExtendedErrorCode= 0x43;                  Error= TRUE;                break;            }            /* All sectors have been read without error, exit */            Ata_p->LastExtendedErrorCode= 0x00;             break;        }        /* Do any tidying up that might be required */        hal_AfterDma(Ata_p->HalHndl);                /*End of write loop*/    }        /*read the output registers and store them in the cmd status structure*/    GetCmdStatus(Ata_p, Cmd_p->Stat.CmdStat);    return Error;    }/************************************************************************Name: ata_cmd_ExecuteDiagnosticsDescription: Executes this special commandParameter:  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_cmd_ExecuteDiagnostics(ata_ControlBlock_t *Ata_p, ata_Cmd_t *Cmd_p){    BOOL Error=FALSE;    /* First we write the registers */ #if  ATAPI_USING_INTERRUPTS    hal_RegOutByte(Ata_p->HalHndl,ATA_REG_CONTROL, nIEN_CLEARED);#else    hal_RegOutByte(Ata_p->HalHndl,ATA_REG_CONTROL, nIEN_SET);#endif        hal_RegOutByte(Ata_p->HalHndl,ATA_REG_DEVHEAD, Cmd_p->DevHead);    /* Finally write the command */    hal_RegOutByte(Ata_p->HalHndl,ATA_REG_COMMAND, Cmd_p->CommandCode);   #if  ATAPI_USING_INTERRUPTS    if(hal_AwaitInt(Ata_p->HalHndl,INT_TIMEOUT * 10))    {        Ata_p->LastExtendedErrorCode= 0x24;        GetCmdStatus(Ata_p,Cmd_p->Stat.CmdStat);                return TRUE;              }#else    /* Wait t > 2msec */    task_delay(TWO_MS);#endif        if (WaitForBit(Ata_p->HalHndl, ATA_REG_ALTSTAT, BSY_BIT_MASK, 0))    {        Ata_p->LastExtendedErrorCode= 0x24;         GetCmdStatus(Ata_p,Cmd_p->Stat.CmdStat);         return TRUE;               }        /*read the output registers and store them in the cmd status structure*/    GetCmdStatus(Ata_p,Cmd_p->Stat.CmdStat);    Ata_p->LastExtendedErrorCode= 0x00;      return Error;      }/************************************************************************Name: GetCmdStatusDescription: Retrieves the command block registers and store them in the             structure previosly allocated              Parameters: Two params:            Ata_p : Pointer to the ATA control block            Cmd_p : Pointer to a command status structure                   ************************************************************************/void GetCmdStatus(ata_ControlBlock_t *Ata_p,STATAPI_CmdStatus_t *Stat_p){    U32 Dummy;         Stat_p->Status = hal_RegInByte(Ata_p->HalHndl,ATA_REG_STATUS);    Stat_p->CylinderLow = hal_RegInByte(Ata_p->HalHndl,ATA_REG_CYLLOW);    Stat_p->CylinderHigh = hal_RegInByte(Ata_p->HalHndl,ATA_REG_CYLHIGH);        Stat_p->SectorCount = hal_RegInByte(Ata_p->HalHndl,ATA_REG_SECCOUNT);        Stat_p->Head = hal_RegInByte(Ata_p->HalHndl,ATA_REG_DEVHEAD);        Stat_p->Sector = hal_RegInByte(Ata_p->HalHndl,ATA_REG_SECNUM);         Stat_p->Error = hal_RegInByte(Ata_p->HalHndl,ATA_REG_ERROR);            Stat_p->LBA=0x00000000;        Dummy = Stat_p->Sector;    Stat_p->LBA |= Dummy & 0x000000FF;    Dummy = Stat_p->CylinderLow;    Stat_p->LBA |= (Dummy<<8) & 0x0000FF00;    Dummy = Stat_p->CylinderHigh;    Stat_p->LBA |= (Dummy<<16) & 0x00FF0000;    Dummy = Stat_p->Head;    Stat_p->LBA |= (Dummy<<24 )& 0x0F000000;        if (LastCommandExtended == TRUE)    {        /* Get the extra values */        U32 Control, Dummy;                Control = hal_RegInByte(Ata_p->HalHndl, ATA_REG_CONTROL);        Control |= CONTROL_HOB;        hal_RegOutByte(Ata_p->HalHndl, ATA_REG_CONTROL, Control);                /* We can destroy these values, since if it's an extended command         * they shouldn't be looking at them anyway.         */        Stat_p->CylinderLow = hal_RegInByte(Ata_p->HalHndl, ATA_REG_CYLLOW);        Stat_p->CylinderHigh = hal_RegInByte(Ata_p->HalHndl, ATA_REG_CYLHIGH);            Stat_p->Sector = hal_RegInByte(Ata_p->HalHndl, ATA_REG_SECNUM);         Dummy = Stat_p->Sector & 0xff;        Dummy <<= 24;        Stat_p->LBA |= Dummy;        Dummy = Stat_p->CylinderLow  & 0x00ff;        Stat_p->LBAExtended  = Dummy;                Dummy = Stat_p->CylinderHigh & 0xff00;        Dummy <<= 8;        Stat_p->LBAExtended |= Dummy;        /* Reset HOB bit */        Control &= ~CONTROL_HOB;        hal_RegOutByte(Ata_p->HalHndl, ATA_REG_CONTROL, Control);    }}/*end of cmmd_ata.c --------------------------------------------------*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产91精品免费| 亚洲精品成人a在线观看| 色视频成人在线观看免| 麻豆精品一区二区三区| 国产精品理伦片| 91精品福利在线一区二区三区| 国产成人亚洲综合a∨婷婷图片| 亚洲国产精品久久不卡毛片| 久久久精品影视| 欧美精品xxxxbbbb| 99免费精品视频| 国产一区二区三区在线观看免费视频| 亚洲天堂a在线| 国产免费观看久久| 久久亚洲综合av| 欧美精品v国产精品v日韩精品| 波多野结衣中文字幕一区二区三区| 热久久国产精品| 一区二区不卡在线视频 午夜欧美不卡在| 久久品道一品道久久精品| 欧美区一区二区三区| 91污片在线观看| 豆国产96在线|亚洲| 国产毛片一区二区| 久久国产视频网| 青青草伊人久久| 午夜欧美在线一二页| 一区二区免费视频| 自拍偷自拍亚洲精品播放| 久久精品一区二区三区不卡牛牛| 日韩一区二区三| 欧美午夜电影一区| 91黄色免费版| 91蜜桃视频在线| 99精品久久99久久久久| 国产成人精品影视| 国产91精品入口| 高清成人在线观看| 成人禁用看黄a在线| 国产福利一区在线| 国产成a人亚洲精品| 国产91丝袜在线观看| 精品亚洲欧美一区| 国产伦精品一区二区三区免费| 国产自产高清不卡| 国产精品一区二区不卡| 国产精品主播直播| 国产98色在线|日韩| 粉嫩欧美一区二区三区高清影视| 懂色一区二区三区免费观看| 成人国产电影网| 99久久99久久精品免费看蜜桃| 99久久99久久精品免费观看| 91网址在线看| 欧美日韩精品免费观看视频 | 一本一道波多野结衣一区二区 | 99麻豆久久久国产精品免费| 不卡影院免费观看| 色先锋资源久久综合| 91福利区一区二区三区| 欧美日韩一区二区不卡| 91精品国产综合久久小美女 | 亚洲精品国产一区二区精华液 | 色婷婷综合久久久久中文 | jlzzjlzz亚洲女人18| 在线欧美日韩国产| 日韩视频免费观看高清完整版在线观看 | 久久99精品久久久久婷婷| 国产黄色成人av| 91视视频在线观看入口直接观看www | 8v天堂国产在线一区二区| 欧美成人伊人久久综合网| 久久久久久久久蜜桃| 国产精品国产三级国产普通话三级| 亚洲色图色小说| 午夜久久久影院| 激情深爱一区二区| 欧美电影免费观看高清完整版在线观看 | 麻豆精品一二三| 高清成人免费视频| 欧美三级韩国三级日本三斤 | 欧美电影免费观看高清完整版在线| 国产片一区二区| 亚洲妇女屁股眼交7| 国产一区二区网址| 在线观看亚洲精品视频| 精品欧美乱码久久久久久| 亚洲欧洲国产日韩| 日韩av中文字幕一区二区 | 国产成人免费视频网站| 欧美日韩国产中文| 中文字幕欧美国产| 奇米精品一区二区三区四区 | 久草中文综合在线| 91久久精品网| 国产亚洲一二三区| 午夜国产精品一区| 成人av电影免费在线播放| 宅男在线国产精品| 亚洲精选视频免费看| 国产精品一区二区久久精品爱涩 | 丁香啪啪综合成人亚洲小说| 欧美精品日韩精品| 亚洲欧洲一区二区在线播放| 久久99精品一区二区三区三区| 色婷婷精品大在线视频| 久久久精品tv| 免费观看在线色综合| 色婷婷综合激情| 亚洲国产精品传媒在线观看| 日韩高清欧美激情| 在线免费观看日本欧美| 国产蜜臀av在线一区二区三区| 婷婷久久综合九色综合绿巨人| 97超碰欧美中文字幕| 国产欧美精品区一区二区三区| 蜜桃在线一区二区三区| 欧美日韩精品一区二区三区四区| 亚洲免费视频成人| 成人app网站| 中文一区二区在线观看| 国产精品资源站在线| 精品国产免费人成在线观看| 日本中文一区二区三区| 欧美男女性生活在线直播观看| 亚洲精品第一国产综合野| 91一区在线观看| 国产精品成人免费精品自在线观看| 国产精品77777| 欧美tk—视频vk| 激情亚洲综合在线| 精品久久久久99| 久久国产精品色| 精品久久久三级丝袜| 国产在线麻豆精品观看| 日韩三级.com| 三级欧美在线一区| 韩国欧美国产1区| 26uuuu精品一区二区| 免费成人你懂的| 欧美亚日韩国产aⅴ精品中极品| 亚洲色大成网站www久久九九| 丰满白嫩尤物一区二区| 国产无遮挡一区二区三区毛片日本| 欧美a一区二区| 欧美视频在线播放| 一区二区不卡在线视频 午夜欧美不卡在 | 精品一区二区免费视频| 欧美草草影院在线视频| 美女视频黄久久| 91精品婷婷国产综合久久竹菊| 午夜私人影院久久久久| 91精品国产综合久久久久久| 五月婷婷综合在线| 欧美色偷偷大香| 亚洲国产精品一区二区www在线 | 国产老妇另类xxxxx| 久久久亚洲精品一区二区三区| 日韩中文字幕区一区有砖一区 | 国产一区福利在线| 久久久久久久久岛国免费| 韩国成人精品a∨在线观看| 精品99999| 国产一区二区精品久久99| 亚洲色图第一区| 欧美性大战久久久| 日韩高清在线观看| 精品国产乱码久久久久久夜甘婷婷| 国产不卡免费视频| 亚洲天堂久久久久久久| 在线视频综合导航| 日韩影院免费视频| 国产亚洲欧美色| 97精品久久久午夜一区二区三区 | 亚洲一区二区欧美日韩| 欧美日高清视频| 麻豆国产欧美日韩综合精品二区| 精品国产一区久久| 成人一区二区三区中文字幕| 欧美国产欧美亚州国产日韩mv天天看完整 | 国产精品沙发午睡系列990531| 91网站黄www| 日日夜夜免费精品| 日韩欧美国产精品| 91免费精品国自产拍在线不卡| 一区二区三区在线免费播放| 91精品久久久久久久99蜜桃| 国产精品一区二区在线看| 亚洲电影一级黄| 国产网站一区二区| 欧洲一区在线观看| 精品一区二区免费在线观看| 亚洲一区二区三区自拍| 欧美变态tickle挠乳网站| 国产永久精品大片wwwapp| 国产精品第四页| 欧美一区二区三区日韩视频| 久久狠狠亚洲综合| 亚洲理论在线观看| 精品国产一区a|