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

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

?? sdio.c

?? linux下SDIO的驅動,請查看具體代碼內容.
?? C
?? 第 1 頁 / 共 5 頁
字號:
                                 | SD_Int_Tx_Empty 
                                 | SD_Int_Data_Timeout ));
        // clear interrupts
    SD_INTERRUPTS_CLEAR(pSlot, ( SD_Int_Rx_FIFO_Not_Empty 
                               | SD_Int_Tx_Empty 
                               | SD_Int_Data_Timeout ));

        // complete request with timeout indication
    CompleteRequest(pSlot, SD_API_STATUS_DATA_TIMEOUT);
}

///////////////////////////////////////////////////////////////////////////////
//  HandleResponseDone - handle response done interrupt
//  Input:  pSlot  - slot context
//  Output: 
//  Return:
//  Notes:  Completes the following requests:
//             Requests with no data phase
//             Requests with a CRC/timeout error in command/response phase
///////////////////////////////////////////////////////////////////////////////
VOID HandleResponseDone(PSDIO_SLOT pSlot)
{
    PSD_BUS_REQUEST pRequest;       // current request
    ULONG           response[4];
    
    pRequest = pSlot->pCurrentRequest;   

    if (NULL==pRequest) {
        return;
    }

        // Turn off response end interrupt
    SD_INTERRUPTS_DISABLE(pSlot, SD_Int_Response_Done);
        // Clear interrupt
    SD_INTERRUPTS_CLEAR(pSlot, SD_Int_Response_Done);

    response[0] = READ_REGISTER_ULONG((PULONG)&pSlot->pSD->resp0);
    response[1] = READ_REGISTER_ULONG((PULONG)&pSlot->pSD->resp1);
    response[2] = READ_REGISTER_ULONG((PULONG)&pSlot->pSD->resp2);
    response[3] = READ_REGISTER_ULONG((PULONG)&pSlot->pSD->resp3);

    DEBUGMSG(SDIO_RESPONSE_ZONE, (TEXT("HandleResponseDone SD_RESP0: 0x%08X \n"),response[0]));
    DEBUGMSG(SDIO_RESPONSE_ZONE, (TEXT("HandleResponseDone SD_RESP1: 0x%08X \n"),response[1]));
    DEBUGMSG(SDIO_RESPONSE_ZONE, (TEXT("HandleResponseDone SD_RESP2: 0x%08X \n"),response[2]));
    DEBUGMSG(SDIO_RESPONSE_ZONE, (TEXT("HandleResponseDone SD_RESP3: 0x%08X \n"),response[3]));

    if (NoResponse != pRequest->CommandResponse.ResponseType) {
            // Copy response over to request structure
        PUCHAR pResponseBuffer = &(pRequest->CommandResponse.ResponseBuffer[1]);
        int ii;

        for (ii=0; ii<4; ii++) {
            *pResponseBuffer++ = (UCHAR)(response[ii]);
            *pResponseBuffer++ = (UCHAR)(response[ii] >> 8);
            *pResponseBuffer++ = (UCHAR)(response[ii] >> 16);
            *pResponseBuffer++ = (UCHAR)(response[ii] >> 24);
        }
    }

        // check for command/response only
    if (SD_COMMAND == pRequest->TransferClass) {
            // check for and handle errors
        if (FALSE==HandleTransferErrors(pSlot,pRequest,SD_Int_Response_CRC_Error)) {
                // no errors, complete request with success
            CompleteRequest(pSlot, SD_API_STATUS_SUCCESS);
        }
    } else {

#ifdef USE_DMA
        if (!pSlot->UsingDmaThisCmd) {
#endif // #ifdef USE_DMA

                // handle data phase transfer
                // set blocks transferred to 0
            ((PHC_PARAMS)pRequest->HCParam)->BytesCopied = 0;
         
            if (TRANSFER_IS_READ(pRequest)) {
                    // Enable buffer read enable interrupt
                SD_INTERRUPTS_ENABLE(pSlot, SD_Int_Rx_FIFO_Not_Empty | 
                                            SD_Int_Data_Timeout);
            } else {
                    // Enable buffer write enable interrupt
                SD_INTERRUPTS_ENABLE(pSlot, SD_Int_Tx_Empty | 
                                            SD_Int_Data_Timeout);  
            }
#ifdef USE_DMA
        } else {
            if (TRANSFER_IS_READ(pRequest)) {
		        HalStartDMA(pSlot->RxDmaChannel);
            } else {
		        HalStartDMA(pSlot->TxDmaChannel);
            }
        }
#endif // #ifdef USE_DMA
    }
}

///////////////////////////////////////////////////////////////////////////////
//  HandleRxFifoNotEmpty - handle Rx FIFO not empty interrupt
//  Input:  pSlot  - slot context
//  Output: 
//  Return:
//  Notes:  Completes the following requests:
//             Requests with a CRC/timeout error in the read data phase
///////////////////////////////////////////////////////////////////////////////
VOID HandleRxFifoNotEmpty(PSDIO_SLOT pSlot)
{
    PSD_BUS_REQUEST pRequest;   // current request
    ULONG           regValue;   // reg value

        // get the current request  
    pRequest = pSlot->pCurrentRequest;
        
    if (NULL==pRequest) {
        return;
    }

    if (((PHC_PARAMS)pRequest->HCParam)->BytesCopied == (pRequest->BlockSize*pRequest->NumBlocks)) {
        return;
    }
        
        // we are touching the block buffer, we must set the process permissions
    SD_SET_PROC_PERMISSIONS_FROM_REQUEST(pRequest) {
		while( (READ_REGISTER_ULONG((PULONG)&pSlot->pSD->status) & SD_Int_Rx_FIFO_Not_Empty) &&
		       (((PHC_PARAMS)pRequest->HCParam)->BytesCopied < (pRequest->BlockSize*pRequest->NumBlocks)))	{
				// Get byte from fifo
			regValue = READ_REGISTER_ULONG((PULONG)&pSlot->pSD->rxport);
			pRequest->pBlockBuffer[((PHC_PARAMS)pRequest->HCParam)->BytesCopied] = (UCHAR)(regValue&0xFF);
			((PHC_PARAMS)pRequest->HCParam)->BytesCopied++;
		}
    } SD_RESTORE_PROC_PERMISSIONS();

    if (((PHC_PARAMS)pRequest->HCParam)->BytesCopied == (pRequest->BlockSize*pRequest->NumBlocks)) {
        SD_INTERRUPTS_DISABLE(pSlot,SD_Int_Rx_FIFO_Not_Empty);
        DEBUGMSG(SDIO_INTERRUPT_ZONE,(TEXT("SDIO: RxFifoNotEmpty completing request, HCParam=%d\r\n"),((PHC_PARAMS)pRequest->HCParam)->BytesCopied));
            // check for and handle errors
        if (FALSE==HandleTransferErrors(pSlot,pRequest,SD_Int_Read_CRC_Error)) {
                // no errors, complete request with success
            CompleteRequest(pSlot, SD_API_STATUS_SUCCESS);
        }
    }
}
        
///////////////////////////////////////////////////////////////////////////////
//  HandleTxEmpty - handle Tx empty interrupt
//  Input:  pSlot  - slot context
//  Output: 
//  Return: TRUE if the request has been completed
//  Notes:  Completes the following requests:
//             Requests with a CRC/timeout error in the read data phase
///////////////////////////////////////////////////////////////////////////////
VOID HandleTxEmpty(PSDIO_SLOT pSlot)
{
    PSD_BUS_REQUEST pRequest;   // current request
    ULONG           dataValue;  // reg value

        // get the current request  
    pRequest = pSlot->pCurrentRequest;
        
        // check the request hasn't already been completed
    if ((NULL==pRequest) || (((PHC_PARAMS)pRequest->HCParam)->BytesCopied == (pRequest->BlockSize*pRequest->NumBlocks))) {
        SD_INTERRUPTS_DISABLE(pSlot,SD_Int_Tx_Empty);
        return;
    }
        
        // we are touching the block buffer, we must set the process permissions
    SD_SET_PROC_PERMISSIONS_FROM_REQUEST(pRequest) {
		while( (READ_REGISTER_ULONG((PULONG)&pSlot->pSD->status) & SD_Int_Tx_Empty) &&
		       (((PHC_PARAMS)pRequest->HCParam)->BytesCopied < (pRequest->BlockSize*pRequest->NumBlocks)))	{
            // Get byte from buffer
			dataValue = pRequest->pBlockBuffer[((PHC_PARAMS)pRequest->HCParam)->BytesCopied];
			WRITE_REGISTER_ULONG((PULONG)&pSlot->pSD->txport,dataValue);
			((PHC_PARAMS)pRequest->HCParam)->BytesCopied++;
		}
    } SD_RESTORE_PROC_PERMISSIONS();

    if (((PHC_PARAMS)pRequest->HCParam)->BytesCopied == (pRequest->BlockSize*pRequest->NumBlocks)) {
        SD_INTERRUPTS_DISABLE(pSlot,SD_Int_Tx_Empty);
            // check for and handle errors
            if (FALSE==HandleTransferErrors(pSlot,pRequest,SD_Int_Write_CRC_Error)) {
                    // no errors, complete request with success
                CompleteRequest(pSlot, SD_API_STATUS_SUCCESS);
            }
    }
}
       
///////////////////////////////////////////////////////////////////////////////
//  GetInterrupts - get current pending interrupts
//  Input:  pSlot - slot context
//  Output: pInterrupts - active, unmasked, controller interrupts
//  Return: TRUE if there is an active unmasked interrupt
//  Notes:  
///////////////////////////////////////////////////////////////////////////////
BOOL GetInterrupts(PSDIO_SLOT pSlot,
                   PULONG     pInterrupts) 
{
    ULONG  interrupts;      // controller interrupts

        // read interrupts from hardware
    interrupts = READ_REGISTER_ULONG((PULONG)&pSlot->pSD->status);
        // the hardware masks interrupts sources from causing an interrupt,
        // but not from showing up in the status register. Mask them here.
    interrupts &= pSlot->InterruptMask;

    *pInterrupts = interrupts;

        // Return TRUE if any unmasked interrupts are active
    return (0 != interrupts);
}

///////////////////////////////////////////////////////////////////////////////
//  SDIOInsertionIstThread - IST thread for driver
//  Input:  pSlot - slot context
//  Output: 
//  Notes:  
///////////////////////////////////////////////////////////////////////////////
DWORD SDIOInsertionIstThread(PSDIO_SLOT pSlot)
{
    DWORD waitStatus;       // wait status
    DWORD initRate = 200000;
    int   debounceCount;
    BOOL  cardInserted;

    if (!CeSetThreadPriority(GetCurrentThread(), pSlot->InsertionIstThreadPriority)) {
        DEBUGMSG(SDCARD_ZONE_WARN, (TEXT("SDIOInsertionIstThread[%d]: warning, failed to set CEThreadPriority \n"),pSlot->SlotNumber));
    }

    while(1) {

        waitStatus = WaitForSingleObject(pSlot->hInsertionInterruptEvent, INFINITE);

        if (WAIT_OBJECT_0 != waitStatus) {
            DEBUGMSG(SDCARD_ZONE_WARN, (TEXT("SDIOInsertionIstThread[%d]: Wait Failed! 0x%08X \n"),pSlot->SlotNumber, waitStatus));
                // bail out
            return 0;
        }

        if (pSlot->pController->DriverShutdown) {
            DEBUGMSG(1, (TEXT("SDIOInsertionIstThread[%d]: Thread Exiting\n"),pSlot->SlotNumber));
            return 0;
        }

            // check slot on startup for inserted cards
        if (pSlot->CheckSlotOnStartUp) {
            DEBUGMSG(SDIO_INTERRUPT_ZONE,(TEXT("SDIOInsertionIstThread[%d]: Removing device after powerdown\r\n"),pSlot->SlotNumber));
                // this case is hit when we suspend and resume while there is a
                // card in the slot, because we remove power we have
                // to indicate a device removal first
            RemoveDevice(pSlot);

				// Reset the slot
			ResetSlot(pSlot, FALSE);

#ifdef DEBUG
				// Dump the state of the slot
			DumpSlot(pSlot);
#endif

                // Now check to see if the card is still present, if so
                // handle as per device insertion
       
            if (SDIOPlatCardInserted(pSlot->pController,pSlot->SlotNumber)) {
                pSlot->CardPresent = TRUE;
				pSlot->CardInitialised = FALSE;

                    // indicate device arrival
                SDHCDIndicateSlotStateChange(pSlot->pController->pHCContext,
                                             pSlot->SlotNumber,
                                             DeviceInserted );
            } else {
                pSlot->CardPresent = FALSE;
            }
            pSlot->CheckSlotOnStartUp = FALSE;

            InterruptDone(pSlot->InsertionSysIntr);
            continue;
        }

        DEBUGMSG(SDIO_INTERRUPT_ZONE, (TEXT("SDIOInsertionIstThread[%d]: interrupt!\n"),pSlot->SlotNumber));
         
            // start debounce logic
        debounceCount = 0;
        cardInserted = FALSE;

            // stay in this loop until the insertion state has been the same for
            // ten consecutive debounce sampling intervals
        while(debounceCount < SDIO_DEBOUNCE_COUNT) {
            if (SDIOPlatCardInserted(pSlot->pController,pSlot->SlotNumber)) {
                if (cardInserted) {
                    debounceCount++;
                } else {
                    cardInserted = TRUE;
                    debounceCount = 0;
                }
            } else {
                if (cardInserted) {
                    cardInserted = FALSE;
                    debounceCount = 0;
                } else {
                    debounceCount++;
                }
            }
            Sleep(SDIO_DEBOUNCE_INTERVAL);
        }

        if (cardInserted && !pSlot->CardPresent) {
                // set clock to 100 kHz for card initialisation
            SDIOSetRate(pSlot, &initRate);

            pSlot->CardPresent = TRUE;
            pSlot->CardInitialised = FALSE;

            DEBUGMSG(SDIO_INTERRUPT_ZONE,(TEXT("SDIOInsertionIstThread[%d]: Card Insertion Interrupt\r\n"),pSlot->SlotNumber));
                // indicate device arrival
            SDHCDIndicateSlotStateChange(pSlot->pController->pHCContext,
                                         pSlot->SlotNumber,
                                         DeviceInserted );
        } else if (!cardInserted && pSlot->CardPresent) {
            DEBUGMSG(SDIO_INTERRUPT_ZONE,(TEXT("SDIOInsertionIstThread[%d]: Card Removal Interrupt\r\n"),pSlot->SlotNumber));
                // remove device
            RemoveDevice(pSlot);

            pSlot->CardPresent = FALSE;
        }

        InterruptDone(pSlot->InsertionSysIntr);
    }
}

///////////////////////////////////////////////////////////////////////////////
//  SDIOControllerIstThread - IST thread for driver
//  Input:  pController - controller context
//  Output: 
//  Notes:  
////////////////////////////////////////////////////////////////////////

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区精品在线播放| 日韩欧美一区二区在线视频| 成人va在线观看| 国产精品国产馆在线真实露脸 | 亚洲国产成人av好男人在线观看| 国产成都精品91一区二区三| 国产情人综合久久777777| 波多野结衣亚洲一区| 亚洲二区在线观看| 午夜精品久久久久久久99水蜜桃 | 国内精品视频一区二区三区八戒| 色94色欧美sute亚洲线路二| 亚洲一区二区黄色| 久久综合狠狠综合| 欧美视频在线观看一区| 韩国成人福利片在线播放| 国产永久精品大片wwwapp| 一区二区三区久久久| 精品国产免费人成在线观看| 色成年激情久久综合| 欧美亚洲综合一区| 日韩精品综合一本久道在线视频| 精品91自产拍在线观看一区| 国产日韩欧美一区二区三区综合| 综合色天天鬼久久鬼色| 欧美一区二区私人影院日本| 成人免费黄色大片| 国产一区久久久| 99国产精品久久久久久久久久| 国产在线不卡一卡二卡三卡四卡| 风间由美一区二区av101| 欧美性色综合网| 久久精品在线免费观看| 欧美tk—视频vk| 欧美人与z0zoxxxx视频| 色狠狠综合天天综合综合| 欧美一区二区三区在线观看 | av一区二区三区在线| 色婷婷香蕉在线一区二区| 国产成人夜色高潮福利影视| 国产在线精品免费| 欧美日韩在线亚洲一区蜜芽| 色婷婷亚洲一区二区三区| 欧美大白屁股肥臀xxxxxx| 亚洲欧美另类久久久精品| 亚洲图片你懂的| 欧美96一区二区免费视频| 亚洲3atv精品一区二区三区| 亚洲成人黄色影院| 成人18视频日本| 精品卡一卡二卡三卡四在线| 亚洲高清免费观看| 99精品视频在线观看| 久久新电视剧免费观看| 日本免费新一区视频| 精品综合久久久久久8888| 国产一区二区三区蝌蚪| 欧美日韩电影在线| 樱桃视频在线观看一区| 亚洲永久精品大片| 99久久亚洲一区二区三区青草 | 波多野结衣亚洲| 精品久久久久久久久久久久包黑料| 亚洲电影中文字幕在线观看| 91精品国产综合久久香蕉麻豆 | 国产三级久久久| 视频一区二区中文字幕| 香蕉影视欧美成人| 欧日韩精品视频| 日韩一二三区视频| 偷窥国产亚洲免费视频| 欧美午夜精品一区二区三区| 国产精品国产三级国产aⅴ原创| 国产大陆亚洲精品国产| 久久久精品国产99久久精品芒果 | 日韩欧美一级二级| 久久精品免费观看| 99国产精品国产精品毛片| 久久久www成人免费毛片麻豆| 国产一区二区精品在线观看| 精品国产乱子伦一区| 韩国成人福利片在线播放| 欧美精品一区二区三区四区 | 色婷婷综合久色| 亚洲尤物在线视频观看| 88在线观看91蜜桃国自产| 青草国产精品久久久久久| 欧美xxxxxxxxx| 国产高清亚洲一区| 中文字幕一区不卡| 欧美日韩日日摸| 久久精品国产99国产精品| 久久综合九色综合97婷婷女人| 国产激情视频一区二区三区欧美| 国产精品免费看片| 精品一二三四在线| 国产日本一区二区| 日本高清不卡aⅴ免费网站| 亚洲国产另类精品专区| 中文字幕免费在线观看视频一区| 五月婷婷综合激情| 精品国产精品一区二区夜夜嗨| 国产福利精品一区| 亚洲一区二区三区在线| 精品国产一区a| 91性感美女视频| 专区另类欧美日韩| 欧美另类高清zo欧美| 亚洲大片精品永久免费| 日韩精品在线一区二区| hitomi一区二区三区精品| 五月婷婷欧美视频| 国产精品卡一卡二卡三| 欧美一区二区三区在线观看视频| 成人黄色免费短视频| 天天操天天色综合| 日本一区二区电影| 日韩欧美中文字幕精品| 日本二三区不卡| 国产丶欧美丶日本不卡视频| 午夜视频一区二区三区| 中文字幕亚洲不卡| 久久亚洲精华国产精华液| 欧美日韩在线不卡| 91在线视频网址| 国产精品性做久久久久久| 久久亚洲春色中文字幕久久久| 色综合天天综合色综合av| 日韩一区二区免费高清| 色狠狠综合天天综合综合| 国产91精品露脸国语对白| 男人操女人的视频在线观看欧美| 亚洲四区在线观看| 国产欧美日韩另类视频免费观看 | 成人美女在线观看| 激情文学综合插| 日韩国产欧美视频| 亚洲综合成人网| 自拍偷拍亚洲欧美日韩| 欧美极品另类videosde| 26uuu久久天堂性欧美| 欧美一区二区三区系列电影| 国产精品无码永久免费888| 精品电影一区二区三区 | av毛片久久久久**hd| 福利一区二区在线| av在线播放不卡| 91色视频在线| 91啦中文在线观看| 91精品福利在线| 欧美午夜精品电影| 欧美日韩你懂得| 日韩天堂在线观看| 精品伦理精品一区| 久久久国产午夜精品| 欧美精彩视频一区二区三区| 国产亚洲成年网址在线观看| 国产女人18水真多18精品一级做| 国产色婷婷亚洲99精品小说| 国产精品拍天天在线| 中文字幕亚洲精品在线观看| 亚洲男人的天堂网| 亚洲线精品一区二区三区| 日韩电影在线看| 国产一区不卡在线| 92国产精品观看| 欧美日韩免费电影| 日韩美女主播在线视频一区二区三区| 日韩午夜三级在线| 欧美激情中文不卡| 亚洲精品综合在线| 日韩高清不卡一区二区| 免费高清视频精品| 国产成人aaa| 欧美午夜宅男影院| 2020国产成人综合网| 亚洲欧洲国产日本综合| 午夜欧美大尺度福利影院在线看| 毛片一区二区三区| 香蕉加勒比综合久久| 激情欧美一区二区| 97se亚洲国产综合自在线| 欧美精品久久99| 国产精品萝li| 麻豆成人av在线| 91老师国产黑色丝袜在线| 日韩一二三四区| 亚洲美女淫视频| 国产在线播精品第三| 91国偷自产一区二区开放时间 | 日本道免费精品一区二区三区| 欧美日韩国产精品自在自线| 亚洲精品一区二区三区在线观看| 亚洲视频一区在线| 精品亚洲成a人在线观看 | 免费欧美高清视频| 99国产精品久久久| 精品av综合导航| 午夜精品123| 一本久久精品一区二区|