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

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

?? pehci.c

?? usb isp1761驅動源代碼 可編進內核。
?? C
?? 第 1 頁 / 共 5 頁
字號:
            td_ptd_map->ptd_ram_data_addr,
            qh
            /*td_ptd_map->datatoggle*/);

    if(qh->type == TD_PTD_BUFF_TYPE_INTL){
        phci_hcd_qhint_schedule(hcd, qh,qtd,(isp1761_qhint *)qha,qtd->urb);
    }


    length = PTD_XFERRED_LENGTH(qha->td_info1 >> 3);
    if(length > HC_ATL_PL_SIZE){
        err("Never Error: Bogus length,length %d(max %d)\n",(int)qtd->length, HC_ATL_PL_SIZE);
    }

    /*write qha into the header of the host controller*/
    isp1761_mem_write(hcd->dev, td_ptd_map->ptd_header_addr,0,(u32 *)(qha),PHCI_QHA_LENGTH,0);
    /*if this is SETUP/OUT token , then need to write into the buffer*/
    /*length should be valid*/
    if(qtd->length && ( length <= HC_ATL_PL_SIZE))
        switch(PTD_PID(qha->td_info2)){
            case OUT_PID:
            case SETUP_PID:
                isp1761_mem_write(hcd->dev, (u32)mem_addr->phy_addr, 0,(void*)(le32_to_cpu(qtd->hw_buf[0])),length,0);
                break;
        }

    /*qtd is scheduled*/
    qtd->state &= ~QTD_STATE_NEW;
    qtd->state |= QTD_STATE_SCHEDULED;

    pehci_entry("-- %s: Exit\n",__FUNCTION__);
    return;
}



static void 
pehci_hcd_urb_complete(phci_hcd *hcd,struct ehci_qh *qh, struct urb *urb, 
        td_ptd_map_t    *td_ptd_map)
{

    static u32 remove  = 0;
    urb_priv_t *urb_priv = (urb_priv_t *)urb->hcpriv;

    pehci_entry("++ %s: Entered\n",__FUNCTION__);
    pehci_check("complete the td , length: %d\n", td_ptd_map->qtd->length);
    urb_priv->timeout = 0;

    if((td_ptd_map->state == TD_PTD_REMOVE) ||
            (urb_priv->state == DELETE_URB)    ||
            !HCD_IS_RUNNING(hcd->state))
        remove = 1;

    qh->qh_state = QH_STATE_COMPLETING;
    /*remove the done tds*/
    spin_lock(&hcd_data_lock);
    phci_hcd_urb_free_priv(hcd, urb_priv,qh);
    spin_unlock(&hcd_data_lock);

    urb_priv->timeout = 0;
    kfree(urb_priv);
    urb->hcpriv = 0;


    /*if normal completion???*/
    if(urb->status == -EINPROGRESS)
        urb->status = 0;

    spin_unlock(&hcd->lock);
    usb_hcd_giveback_urb (&hcd->usb_hcd, urb);
    spin_lock(&hcd->lock);

    /*lets handle to the remove case*/
    if(remove){
        remove  = 0;
        if(list_empty(&qh->qtd_list)){
            pehci_check("no transfers anymore, free the endpoint\n");
            phci_hcd_release_td_ptd_index(qh);
        }
    }
    pehci_entry("-- %s: Exit\n",__FUNCTION__);
}

/*update the error status of the td*/
    static void
pehci_hcd_update_error_status(u32 ptdstatus,struct urb *urb)
{
    /*if ptd status is halted*/
    if(ptdstatus & PTD_STATUS_HALTED){
        if(ptdstatus & PTD_XACT_ERROR){
            /*transaction error results due to retry count goes to zero*/
            if(PTD_RETRY(ptdstatus)){
                /*halt the endpoint*/
                pehci_check("transaction error , retries %d\n", PTD_RETRY(ptdstatus));
                urb->status = -EPIPE;}
            else {
                pehci_check("transaction error , retries %d\n", PTD_RETRY(ptdstatus));
                /*protocol error*/
                urb->status = -EPROTO;}
        }
        else if(ptdstatus & PTD_BABBLE){
            pehci_check("babble error, qha %x\n", ptdstatus);
            /*babble error*/
            urb->status = -EOVERFLOW;}
        else if(PTD_RETRY(ptdstatus)){
            pehci_check("endpoint halted with retrie remaining %d\n",PTD_RETRY(ptdstatus));
            urb->status = -EPIPE;}
        else { /*unknown error, i will report it as halted, as i will never see xact error bit set*/
            pehci_check("protocol error, qha %x\n", ptdstatus);
            urb->status = -EPIPE;}

            /*if halted need to recover*/
            if (urb->status == -EPIPE) {
            }
    }
}

#ifdef CONFIG_ISO_SUPPORT /* New code for ISO support */

/*******************************************************************
 * phcd_iso_handler - ISOCHRONOUS Transfer handler
 *
 * phci_hcd *hcd,
 *      Host controller driver structure which contains almost all data
 *      needed by the host controller driver to process data and interact
 *      with the host controller.
 *
 * struct pt_regs *regs
 *
 * API Description
 * This is the ISOCHRONOUS Transfer handler, mainly responsible for:
 *  - Checking the periodic list if there are any ITDs for scheduling or 
 *    removal.
 *  - For ITD scheduling, converting an ITD into a PTD, which is the data 
 *    structure that the host contrtoller can understand and process.
 *  - For ITD completion, checking the transfer status and performing the 
 *    required actions depending on status.
 *  - Freeing up memory used by an ITDs once it is not needed anymore.
 ************************************************************************/
void phcd_iso_handler(phci_hcd *hcd)
{
    struct _isp1761_isoptd *iso_ptd;
    struct isp1761_mem_addr *mem_addr;
    struct ehci_itd *itd, *current_itd; 
    td_ptd_map_t *td_ptd_map;
    td_ptd_map_buff_t *ptd_map_buff;

    struct list_head *itd_sched, *itd_remove, *position, *lst_temp;     
    struct urb *urb;

    unsigned long buff_stat, skip_map;
    unsigned long last_map;
    unsigned long frame_num, rmv_frm_num, sched_frm_num;
    unsigned long uframe_cnt, usof_stat, length;
    unsigned char schedule, remove, last_td;

    /* Local variable initialization */                 
    buff_stat = 0;
    skip_map = 0;
    frame_num = 0;
    schedule = FALSE;
    remove = FALSE;     
    iso_ptd = &hcd->isotd;
    last_map = 0;

    /* Check if there are any ITDs scheduled  for processing */
    if( hcd->periodic_sched == 0 )
    {
        return;
    }

    ptd_map_buff = &(td_ptd_map_buff[TD_PTD_BUFF_TYPE_ISTL]);

    /* Read buffer status register to check later if the ISO buffer is filled or not */
    buff_stat = isp1761_reg_read32(hcd->dev, hcd->regs.buffer_status, buff_stat);

    /* Read the contents of the ISO skipmap register */
    skip_map = isp1761_reg_read32(hcd->dev, hcd->regs.isotdskipmap, skip_map);

    /* Read the contents of the ISO lastmap  register */
    last_map = isp1761_reg_read32(hcd->dev, hcd->regs.isotdlastmap, last_map);

    /* Get also the frame number, which we will use as index into the periodic frame list */
    frame_num = isp1761_reg_read32(hcd->dev, hcd->regs.frameindex, frame_num);

    /* Bits 0 to 2 are don't care, only bits 3 to 7 are used as index */
    frame_num &= 0xff;
    frame_num >>= 3;

    /* Get a copy of the current frame number to adjust it depending on what we will be processing */
    rmv_frm_num = frame_num;
    sched_frm_num = frame_num;

    /* For ITD removal, work on the ITD linked to the frame prior to the current frame */
    if(rmv_frm_num == 0)
        rmv_frm_num = 31;
    else
        rmv_frm_num = rmv_frm_num - 1;

    rmv_frm_num %= PTD_PERIODIC_SIZE;

    /* Process ITDs linked to this frame, checking for completed ITDs */
    itd_remove = &hcd->periodic_list[rmv_frm_num].itd_head;
    iso_dbg(ISO_DBG_DATA, "[phcd_iso_handler]: Removal Frame number: %d\n", (int) rmv_frm_num);            

    /* For ITD scheduling, work on the ITD linked to the frame after the current frame */
    if(sched_frm_num == 31)
        sched_frm_num = 0;
    else
        sched_frm_num = sched_frm_num + 1;

    sched_frm_num %= PTD_PERIODIC_SIZE;

    /* Process ITDs linked to this frame, checking if there are any that needs to be scheduled */
    itd_sched = &hcd->periodic_list[sched_frm_num].itd_head;
    iso_dbg(ISO_DBG_DATA, "[phcd_iso_handler]: Schedule Frame number: %d\n", (int) sched_frm_num);         

    /* Check if the ITD lists are empty */
    if( !list_empty(itd_sched))
    {
        iso_dbg(ISO_DBG_INFO, "[phcd_iso_handler]: ISO schedule list not empty\n");          
        schedule = TRUE;
    }
    else
    {
        iso_dbg(ISO_DBG_INFO, "[phcd_iso_handler]: ISO schedule list empty\n");              
    }

    if( !list_empty(itd_remove))
    {
        iso_dbg(ISO_DBG_INFO, "[phcd_iso_handler]: ISO remove list not empty\n");            
        remove = TRUE;
    }
    else
    {
        iso_dbg(ISO_DBG_INFO, "[phcd_iso_handler]: ISO remove list empty\n");                
    }

    if( schedule == TRUE )
    {
        iso_dbg(ISO_DBG_INFO, "[phcd_iso_handler]: Something is scheduled\n");               
        /* There is an ITD to be scheduled, go over and check each ITD in this list */
        list_for_each(position, itd_sched)
        {
            /* Get an ITD in the list for processing */
            itd = list_entry(position, struct ehci_itd, itd_list);

            iso_dbg(ISO_DBG_DATA, "[phcd_iso_handler]: ITD Index: %d\n", itd->itd_index);            
            /* Get the PTD allocated for this ITD. */                   
            td_ptd_map = &ptd_map_buff->map_list[itd->itd_index];
            memset(iso_ptd, 0, sizeof(struct _isp1761_isoptd));                 

            /* Create a PTD from an ITD*/
            phcd_iso_itd_to_ptd( hcd,
                    itd,
                    itd->urb,
                    (void *) iso_ptd
                    );

            /* Indicate that this ITD's PTD have been filled up */
            ptd_map_buff->pending_ptd_bitmap &= ~td_ptd_map->ptd_bitmap;

            /*
             * Place the newly initialized ISO PTD structure into the location allocated 
             * for this PTD in the ISO PTD memory region.
             */
            isp1761_mem_write( hcd->dev,
                    td_ptd_map->ptd_header_addr,
                    0,
                    (__u32 *) iso_ptd,
                    PHCI_QHA_LENGTH,
                    0
                    );

            /* 
             * Set this flag to avoid unlinking before schedule
             * at particular frame number
             */
            td_ptd_map->state = TD_PTD_IN_SCHEDULE;

            /* 
             * If the length is not zero and the direction is OUT then copy the
             * data to be transferred into the PAYLOAD memory area.
             */
            if(itd->length)
            {
                switch(PTD_PID(iso_ptd->td_info2)) 
                {
                    case OUT_PID:                                       
                        /* Get the Payload memory allocated for this PTD */
                        mem_addr = &itd->mem_addr;
                        isp1761_mem_write( hcd->dev,
                                (unsigned long )mem_addr->phy_addr,
                                0,
                                (__u32 *) (le32_to_cpu(itd->hw_bufp[0])),
                                itd->length,
                                0
                                );
                        break;
                } /* switch(PTD_PID(iso_ptd->td_info2)) */
            } /* if(itd->length) */

            /* If this is the last td, indicate to complete the URB */
            if(itd->hw_next == EHCI_LIST_END)
                td_ptd_map->lasttd = 1;

            /*
             * Clear the bit corresponding to this PTD in the skip map so that it will be
             * processed on the next schedule traversal.
             */
            skip_map &= ~td_ptd_map->ptd_bitmap;                

            iso_dbg(ISO_DBG_DATA, "[phcd_iso_handler]: Skip Map: 0x%08x\n", (unsigned int) skip_map);
            isp1761_reg_write32(hcd->dev, hcd->regs.isotdskipmap, skip_map);

            /* 
             * Update the last map register to indicate that the newly created PTD is the 
             * last PTD added only if it is larger than the previous bitmap.
             */                 
            if(last_map < td_ptd_map->ptd_bitmap)
            {
                isp1761_reg_write32(hcd->dev, hcd->regs.isotdlastmap, td_ptd_map->ptd_bitmap);
                iso_dbg(ISO_DBG_DATA, "[phcd_iso_handler]: Last Map: 0x%08x\n", td_ptd_map->ptd_bitmap);     
            }

            /*
             * Set the ISO_BUF_FILL bit to 1 to indicate that there is a PTD for ISO that needs to
             * be processed.
             */
            iso_dbg(ISO_DBG_DATA, "[phcd_iso_handler]: Buffer Status: 0x%08x\n", (unsigned int) (buff_stat | ISO_BUFFER));
            isp1761_reg_write32(hcd->dev, hcd->regs.buffer_status, (buff_stat | ISO_BUFFER));
        } /* list_for_each(position, itd_sched) */      

        iso_dbg(ISO_DBG_INFO, "[phcd_iso_handler]: ISO-Frame scheduling done\n");
    } /* if( schedule == TRUE ) */

    if( remove == TRUE)
    {
        iso_dbg(ISO_DBG_INFO, "[phcd_iso_handler]: Something is for removal\n");             
        list_for_each_safe(position, lst_temp, itd_remove)
        {
            last_td = FALSE;

            /* Get an ITD in the list for processing */
            itd = list_entry(position, struct ehci_itd, itd_list);

            /* Get the PTD that was allocated for this particular ITD. */
            td_ptd_map = &ptd_map_buff->map_list[itd->itd_index];

            iso_dbg(ISO_DBG_DATA, "[phcd_iso_handler]: ITD Index: %d\n", itd->itd_index);            
            urb = itd->urb;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人av一区二区三区| 91在线云播放| 一本色道久久综合亚洲aⅴ蜜桃| 欧美群妇大交群中文字幕| 久久久精品2019中文字幕之3| 亚洲精品成a人| 成人免费视频视频| 精品va天堂亚洲国产| 亚洲福利视频导航| 91一区在线观看| 欧美激情一区二区在线| 久久99国产精品成人| 欧美日韩日日摸| 一区二区在线观看免费| 成人禁用看黄a在线| 久久夜色精品国产欧美乱极品| 天堂精品中文字幕在线| 日本道在线观看一区二区| ●精品国产综合乱码久久久久| 日本sm残虐另类| 91精品国产全国免费观看| 亚洲一区二区三区精品在线| 91免费视频大全| 一色屋精品亚洲香蕉网站| 成人一区二区三区视频| 久久久精品欧美丰满| 国产一区二区三区观看| 日韩欧美三级在线| 免费美女久久99| 精品久久久久99| 久久99久久99| 国产亚洲欧美中文| 国产一区二区三区精品欧美日韩一区二区三区| 欧美一区二区日韩| 蜜臀a∨国产成人精品| 欧美成人性战久久| 另类小说视频一区二区| 欧美精品一区二| 国产美女精品在线| 久久精品一区二区三区不卡牛牛| 国产精品一品视频| 国产日韩三级在线| 99久久伊人精品| 亚洲夂夂婷婷色拍ww47| 欧美高清dvd| 麻豆国产91在线播放| 欧美精品一区二区久久婷婷| 国产精品羞羞答答xxdd| 欧美国产视频在线| 91麻豆产精品久久久久久| 亚洲激情图片qvod| 欧美一区二区三区免费| 国产成人在线免费| 亚洲人妖av一区二区| 欧美日韩高清影院| 国产一区二三区好的| 中文字幕在线免费不卡| 欧美日韩美女一区二区| 精品一区二区三区影院在线午夜| 亚洲国产激情av| 欧美亚洲一区二区三区四区| 秋霞午夜鲁丝一区二区老狼| 久久精品欧美日韩| 欧洲一区二区三区免费视频| 毛片不卡一区二区| 中文字幕在线播放不卡一区| 欧美一区二区精美| av在线不卡网| 免费在线观看不卡| 亚洲婷婷综合色高清在线| 欧美精品色综合| av在线播放成人| 久久99热这里只有精品| 艳妇臀荡乳欲伦亚洲一区| 精品免费视频.| 欧美丝袜自拍制服另类| 国产经典欧美精品| 日韩av一区二区三区| 中文字幕一区二区三中文字幕| 日韩欧美高清dvd碟片| 色综合久久综合网97色综合| 九九**精品视频免费播放| 亚洲精品视频免费看| 国产亚洲综合性久久久影院| 欧美精选在线播放| 91在线一区二区三区| 国产一区二区在线影院| 天天影视色香欲综合网老头| 最新成人av在线| 欧美激情一区二区在线| 精品久久久久久无| 欧美一级高清大全免费观看| 欧洲中文字幕精品| 972aa.com艺术欧美| 国产69精品久久久久毛片| 蜜臀a∨国产成人精品| 五月天网站亚洲| 一区二区三区资源| 中文字幕一区二区三区蜜月| 亚洲国产精品精华液ab| wwww国产精品欧美| 日韩精品综合一本久道在线视频| 欧美午夜精品理论片a级按摩| eeuss影院一区二区三区| 国产精品一区二区久久不卡| 国产麻豆精品theporn| 久久精品国产精品亚洲红杏| 青青草91视频| 蜜臀av性久久久久蜜臀aⅴ四虎| 首页亚洲欧美制服丝腿| 亚洲r级在线视频| 亚洲大片精品永久免费| 亚洲国产精品麻豆| 亚洲国产精品久久人人爱蜜臀| 亚洲精品乱码久久久久久黑人| 自拍偷拍亚洲欧美日韩| 中文字幕日韩精品一区| 日韩美女视频一区二区 | 欧美日韩在线三级| 欧美视频一区在线| 欧美老年两性高潮| 91精品国产综合久久精品图片| 欧美人动与zoxxxx乱| 欧美一区二区黄| 精品福利二区三区| 中文字幕不卡在线观看| 国产精品久久久久久久久快鸭| 国产精品久久久久久久久久久免费看| 国产精品伦一区二区三级视频| 国产精品国产三级国产普通话蜜臀 | 成人短视频下载| 色综合一个色综合| 欧美日韩精品免费观看视频| 欧美精品一级二级三级| 欧美精品一区二区三区蜜桃| 中文字幕欧美区| 一区二区三区在线视频观看| 亚洲国产裸拍裸体视频在线观看乱了| 亚洲成av人片在线观看| 久久国产精品无码网站| 成人性生交大片免费看中文网站| 成人免费黄色在线| 日本高清无吗v一区| 91精品国产丝袜白色高跟鞋| 久久精品夜夜夜夜久久| 亚洲另类在线制服丝袜| 日本午夜精品视频在线观看 | 国产精品久久看| 亚洲成a人片在线不卡一二三区| 美女尤物国产一区| 91麻豆精品一区二区三区| 日韩一区二区免费电影| 中文在线一区二区| 视频一区视频二区在线观看| 成人手机在线视频| 欧美在线999| 国产日韩欧美一区二区三区综合| 一区二区三区毛片| 国产a级毛片一区| 欧美日韩在线直播| 中文字幕在线不卡一区| 激情亚洲综合在线| 欧美日韩一区小说| 国产精品久久久久久久久免费丝袜 | 久久久精品2019中文字幕之3| 一区二区在线电影| 成人听书哪个软件好| 3d动漫精品啪啪一区二区竹菊 | 久久久综合九色合综国产精品| 亚洲老妇xxxxxx| 国产不卡视频一区二区三区| 8x8x8国产精品| 亚洲精品综合在线| 成人激情动漫在线观看| 久久亚洲私人国产精品va媚药| 亚洲国产一区二区视频| heyzo一本久久综合| 久久免费看少妇高潮| 美国三级日本三级久久99| 欧美日韩视频在线第一区| 一区二区三区免费观看| 91亚洲国产成人精品一区二区三| www成人在线观看| 韩国一区二区视频| 日韩天堂在线观看| 日本一不卡视频| 日韩限制级电影在线观看| 图片区日韩欧美亚洲| 欧美三级电影精品| 有码一区二区三区| 91蝌蚪porny九色| 亚洲视频中文字幕| 色就色 综合激情| 一区2区3区在线看| 欧美亚洲综合色| 亚洲尤物在线视频观看| 欧美优质美女网站| 亚洲成人动漫一区| 91精品国产综合久久福利 | 精品国产乱码久久久久久蜜臀|