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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? pehci.c

?? usb isp1761驅(qū)動(dòng)源代碼 可編進(jìn)內(nèi)核。
?? C
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
/******************************************************************************
 * Philips ISP176x Host Controller Interface code file
 *
 * (c) 2002 Koninklijke Philips Electronics N.V. All rights reserved. <usb.linux@philips.com>
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 * 
 * File Name: pehci.c
 * 
 * Refering linux kernel version 2.6.9
 *
 * History:     
 *
 * Date                  Author                  Comments
 * ------------------------------------------------------------------------------
 * June 21, 2005         krishan                  Initial version
 * July 4, 2005          krishan                  Handling unprotected urbs
 * Feb 6, 2006           Grant H.                 Added ISO support
 * April 21, 2006        Grant H.                 Added bug fixes
 * 
 ********************************************************************************
 */

#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/timer.h>
#include <linux/list.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/usb.h>
#include <linux/version.h>
#include <stdarg.h>
#include <asm/byteorder.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <asm/irq.h>
#include <asm/system.h>
#include <asm/unaligned.h>

#include "pehci.h"
#include "../hal/hal_intf.h"
#include "../hal/isp1761.h"

#define EHCI_TUNE_CERR          3
#define URB_NO_INTERRUPT        0x0080
#define EHCI_TUNE_RL_TT         0
#define EHCI_TUNE_MULT_TT       1
#define EHCI_TUNE_RL_HS         0
#define EHCI_TUNE_MULT_HS       1

#ifdef CONFIG_ISO_SUPPORT

#define FALSE 0
#define TRUE (!FALSE)

extern void * phcd_iso_itd_to_ptd( phci_hcd *hcd,
        struct ehci_itd *itd,
        struct urb *urb,
        void  * ptd
        );

extern  unsigned long phcd_submit_iso( phci_hcd *hcd,
	struct usb_host_endpoint *ep,
        struct urb *urb,
        unsigned long *status
        );
#endif /* CONFIG_ISO_SUPPORT */

#ifdef OTG
#include "otg.c"
#endif

/*Enable all other interrupt.*/
#ifdef MSEC_INT_BASED
#define INTR_ENABLE_MASK (HC_MSEC_INT /* | HC_EOT_INT | HC_CLKREADY_INT | HC_INTL_INT | HC_ATL_INT | HC_ISO_INT*/)
#else
#define INTR_ENABLE_MASK (/*HC_MSEC_INT |*/ HC_INTL_INT | HC_ATL_INT | HC_EOT_INT /*| HC_ISO_INT*/)
#endif

/*---------------------------------------------------
 *    Globals for EHCI 
 -----------------------------------------------------*/

/* used when updating hcd data */
static spinlock_t hcd_data_lock = SPIN_LOCK_UNLOCKED;

static const char       hcd_name [] = "Philips";
static td_ptd_map_buff_t td_ptd_map_buff[TD_PTD_TOTAL_BUFF_TYPES];      /* td-ptd map buffer for all 1362 buffers */

static __u8             td_ptd_pipe_x_buff_type[TD_PTD_TOTAL_BUFF_TYPES] = {    
    TD_PTD_BUFF_TYPE_ATL,                                       
    TD_PTD_BUFF_TYPE_INTL,                                      
    TD_PTD_BUFF_TYPE_ISTL                                       
};

/*global memory blocks*/
isp1761_mem_addr_t memalloc[BLK_TOTAL];
#include "mem.c"
#include "qtdptd.c"

#ifdef CONFIG_ISO_SUPPORT 
#include "itdptd.c"
#endif /* CONFIG_ISO_SUPPORT */

static int
pehci_rh_control (struct usb_hcd *usb_hcd,u16  typeReq,
        u16 wValue,u16 wIndex,char *buf,u16 wLength);

/*----------------------------------------------------*/
    static void 
pehci_complete_device_removal(phci_hcd *hcd,struct ehci_qh *qh)
{
    td_ptd_map_t *td_ptd_map;
    td_ptd_map_buff_t *td_ptd_buff;

    if(qh->type == TD_PTD_BUFF_TYPE_ISTL){
        return;
    }

    td_ptd_buff = &td_ptd_map_buff[qh->type];
    td_ptd_map = &td_ptd_buff->map_list[qh->qtd_ptd_index];

    /*this flag should only be set when device is going*/
    td_ptd_map->state = TD_PTD_REMOVE;
    /*if nothing there*/
    if(list_empty(&qh->qtd_list)){
        if(td_ptd_map->state != TD_PTD_NEW){
            phci_hcd_release_td_ptd_index(qh);
        }
        qha_free(qha_cache, qh);
        qh = 0;
        return;
    }
    /*MUST not come down below this*/
    err("Never Error: Should not come to this portion of code\n");    

    return;
}

/*functions looks for the values in register
  specified in ptr, if register values masked
  with the mask and result is equal to done,
  operation is successful else fails with timeout*/
    static int
pehci_hcd_handshake (phci_hcd *hcd,u32 ptr,u32 mask,u32 done,int usec)
{
    u32 result = 0;
    do {
        result = isp1761_reg_read32(hcd->dev,ptr,result);
        if (result == ~(u32)0)          /* card removed */
            return -ENODEV;
        result &= mask;
        if (result == done)
            return 0;
        udelay (1);
        usec--;
    } while (usec > 0);
    return -ETIMEDOUT;
}

#ifndef MSEC_INT_BASED
/*schedule atl and interrupt tds,
  only when we are not running on sof interrupt
 */
    static void
pehci_hcd_td_ptd_submit_urb(phci_hcd *hcd,struct ehci_qh *qh,u8 bufftype)
{
    unsigned long flags;
    struct ehci_qtd *qtd = 0;
    struct urb *urb = 0;
    struct _isp1761_qha *qha = 0;
    u32 location  = 0;
    u32 skipmap = 0;
    u32 buffstatus = 0;
    u32 ormask = 0;
    u32 intormask = 0;
    u32 length = 0;
    struct list_head *head;

    td_ptd_map_t        *td_ptd_map;
    td_ptd_map_buff_t *ptd_map_buff;
    struct isp1761_mem_addr *mem_addr = 0;

    pehci_entry("++ %s: Entered\n",__FUNCTION__);
    pehci_print("Buuffer type %d\n",bufftype);

    spin_lock_irqsave(&hcd->lock, flags);
    ptd_map_buff = &td_ptd_map_buff[bufftype];
    qha = &hcd->qha;
    switch(bufftype){
        case TD_PTD_BUFF_TYPE_ATL:
            skipmap = isp1761_reg_read32(hcd->dev, hcd->regs.atltdskipmap, skipmap);
            ormask = isp1761_reg_read32(hcd->dev, hcd->regs.atl_irq_mask_or, ormask);
            break;
        case TD_PTD_BUFF_TYPE_INTL:
            skipmap = isp1761_reg_read32(hcd->dev, hcd->regs.inttdskipmap, skipmap);
            intormask = isp1761_reg_read32(hcd->dev, hcd->regs.int_irq_mask_or,intormask);
            break;
        default:
            skipmap = isp1761_reg_read32(hcd->dev, hcd->regs.isotdskipmap, skipmap);
            break;

    }

    buffstatus = isp1761_reg_read32(hcd->dev,hcd->regs.buffer_status,buffstatus);

    /*header, qtd, and urb of current transfer*/
    location = qh->qtd_ptd_index;
    td_ptd_map = &ptd_map_buff->map_list[location];

    if(!(qh->qh_state & QH_STATE_TAKE_NEXT)){
        pehci_check("qh will schdule from interrupt routine,map %x\n",td_ptd_map->ptd_bitmap);
        spin_unlock_irqrestore(&hcd->lock, flags);
        return;
    }
    head = &qh->qtd_list;
    qtd = list_entry(head->next, struct ehci_qtd, qtd_list);

    /*already scheduled??????, may be from interrupt*/
    if(!(qtd->state & QTD_STATE_NEW)){
        pehci_check("qtd already in, state %x\n",qtd->state);
        spin_unlock_irqrestore(&hcd->lock, flags);
        return;
    }

    qtd->state &= ~QTD_STATE_NEW;
    qtd->state |= QTD_STATE_SCHEDULED;

    qh->qh_state &= ~QH_STATE_TAKE_NEXT;
    /*take the first td*/
    td_ptd_map->qtd = qtd;
    /*take the urb*/
    urb = qtd->urb;
    ptd_map_buff->active_ptds++;

    /*trust the atl worker, at this location there wont be any td*/
    /*if this td is the last one*/
    if(qtd->state & QTD_STATE_LAST){
        qh->hw_current = cpu_to_le32(0);
        /*else update the hw_next of qh to the next td*/
    }else{
        qh->hw_current = qtd->hw_next;
    }
    memset(qha, 0, sizeof( isp1761_qha));

    pehci_check("td being scheduled : length: %d, device: %d, map: %x\n", qtd->length,urb->dev->devnum, td_ptd_map->ptd_bitmap);
    /*NEW, now need to get the memory for this transfer*/
    length = qtd->length;
    mem_addr = &qtd->mem_addr;
    phci_hcd_mem_alloc(length,mem_addr,0);
    if(length && ((mem_addr->phy_addr == 0 )
                || (mem_addr->virt_addr == 0))){
        err("Never Error: Can not allocate memory for the current td,length %d\n",length);
        /*should not happen*/
        /*can happen only when we exceed the limit of devices we support
          MAX 4 mass storage at a time*/        
    }   
    phci_hcd_qha_from_qtd(hcd,qtd,qtd->urb, (void *)qha,
            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);
    }
    /*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 and supported by the ptd*/
    if(qtd->length && (qtd->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,(le32_to_cpu(qtd->hw_buf[0])),length,0);
                break;
        }

    /*unskip the tds at this location*/
    switch(bufftype){
        case TD_PTD_BUFF_TYPE_ATL:
            skipmap &= ~td_ptd_map->ptd_bitmap;
            /*enable atl interrupts on donemap*/
            ormask |=  td_ptd_map->ptd_bitmap;
            isp1761_reg_write32(hcd->dev, hcd->regs.atl_irq_mask_or, ormask);
            break;

        case TD_PTD_BUFF_TYPE_INTL:
            skipmap &= ~td_ptd_map->ptd_bitmap;
            intormask |= td_ptd_map->ptd_bitmap;
            isp1761_reg_write32(hcd->dev, hcd->regs.int_irq_mask_or, intormask);
            break;

        case TD_PTD_BUFF_TYPE_ISTL:
            skipmap &= ~td_ptd_map->ptd_bitmap;
            isp1761_reg_write32(hcd->dev, hcd->regs.isotdskipmap, skipmap);
            break;
    }

    /*if any new schedule, enable the atl buffer*/
    switch(bufftype){
        case TD_PTD_BUFF_TYPE_ATL:
            isp1761_reg_write32(hcd->dev, hcd->regs.buffer_status, buffstatus | ATL_BUFFER);
            isp1761_reg_write32(hcd->dev, hcd->regs.atltdskipmap, skipmap);
            buffstatus |= ATL_BUFFER;
            break;
        case TD_PTD_BUFF_TYPE_INTL:
            isp1761_reg_write32(hcd->dev, hcd->regs.buffer_status, buffstatus | INT_BUFFER);
            isp1761_reg_write32(hcd->dev, hcd->regs.inttdskipmap, skipmap);
            break;
        case TD_PTD_BUFF_TYPE_ISTL:
            /*not supposed to be seen here*/
            isp1761_reg_write32(hcd->dev, hcd->regs.buffer_status, buffstatus | ISO_BUFFER);
            break;
    }
    spin_unlock_irqrestore(&hcd->lock, flags);
    pehci_entry("-- %s: Exit\n",__FUNCTION__);
    return;

}
#endif

/*schedule next (atl/int)tds and any pending tds*/
    static void
pehci_hcd_schedule_pending_ptds(phci_hcd *hcd,u32 donemap,u8 bufftype,u16 only)
{
    struct ehci_qtd *qtd = 0;
    struct ehci_qh  *qh = 0;
    struct list_head *qtd_list = 0;
    struct _isp1761_qha allqha;
    struct _isp1761_qha *qha = 0;
    u32 mask = 0x1, index = 0;
    u32 location  = 0;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品国内一区二区三区| 蜜臀国产一区二区三区在线播放 | 99r精品视频| 色婷婷狠狠综合| 精品国产99国产精品| 亚洲综合色丁香婷婷六月图片| 激情五月婷婷综合| 337p亚洲精品色噜噜狠狠| 亚洲视频一二三区| 国内成+人亚洲+欧美+综合在线| 91精品91久久久中77777| 欧美国产一区二区在线观看| 免费观看91视频大全| 欧美三区在线观看| 综合久久国产九一剧情麻豆| 国产美女av一区二区三区| 欧美日韩一区二区三区在线| 中文无字幕一区二区三区| 麻豆91在线播放免费| 欧美性生活久久| 亚洲韩国精品一区| 日本韩国欧美一区| 亚洲美女屁股眼交| 99r国产精品| 亚洲精品中文字幕在线观看| 99精品黄色片免费大全| 国产精品私人影院| 不卡视频在线观看| 国产欧美日韩综合精品一区二区| 黄页网站大全一区二区| 欧美成人综合网站| 激情图区综合网| 久久视频一区二区| 国产精品一区二区久久不卡 | 欧美亚洲国产一区二区三区| 最新久久zyz资源站| 97精品久久久久中文字幕| 国产精品美女一区二区三区| 粉嫩aⅴ一区二区三区四区| 久久精品视频网| 成人福利视频网站| 亚洲毛片av在线| 欧美亚洲日本国产| 日韩高清在线观看| 精品电影一区二区三区| 国产成人免费视| 亚洲欧美日韩一区| 在线电影一区二区三区| 蜜桃av一区二区在线观看| 亚洲精品一区二区精华| 国产成人免费视频网站高清观看视频| 欧美激情一区在线| 91色九色蝌蚪| 日本女优在线视频一区二区| 日韩欧美国产午夜精品| 国产不卡视频在线播放| 一区二区三区免费在线观看| 欧美日本韩国一区二区三区视频| 午夜在线电影亚洲一区| 精品国产免费久久| 国产福利视频一区二区三区| 国产精品久久久久久久久快鸭| 91亚洲永久精品| 蜜桃视频一区二区三区| 中文字幕精品—区二区四季| 成a人片亚洲日本久久| 一区二区三区四区在线播放 | 国产盗摄女厕一区二区三区| 久久久久国产精品麻豆| 在线观看亚洲精品视频| 日韩制服丝袜av| 中文字幕二三区不卡| 欧美伦理视频网站| 国产精品资源站在线| 午夜成人免费电影| 国产欧美一区二区在线| 欧美体内she精视频| 风间由美性色一区二区三区| 亚洲国产精品久久不卡毛片| 国产欧美一区二区精品婷婷 | 亚洲欧洲美洲综合色网| 4438x成人网最大色成网站| 成人免费黄色大片| 免费观看久久久4p| 午夜婷婷国产麻豆精品| 国产精品色噜噜| 日韩一级完整毛片| 欧美视频在线观看一区| 99精品热视频| 久久激情五月婷婷| 日韩国产成人精品| 午夜精品免费在线| 日韩理论片网站| 中文字幕欧美三区| 精品三级在线看| 91精品国产色综合久久| 色婷婷精品大在线视频| 国产精品69毛片高清亚洲| 亚洲国产乱码最新视频| 亚洲欧洲韩国日本视频| 亚洲国产成人自拍| 久久夜色精品国产欧美乱极品| 3atv在线一区二区三区| 欧美日韩高清在线播放| av欧美精品.com| 成人综合婷婷国产精品久久免费| 麻豆精品视频在线观看免费| 亚洲成人tv网| 亚洲最色的网站| 亚洲一区二区三区四区的 | 制服丝袜亚洲色图| 在线视频国内一区二区| 不卡视频在线观看| 99re热这里只有精品视频| 成人黄色小视频| 成人高清免费在线播放| 菠萝蜜视频在线观看一区| 波波电影院一区二区三区| 成人毛片老司机大片| hitomi一区二区三区精品| 成人免费毛片app| av在线播放成人| 91麻豆精东视频| 精品视频资源站| 6080亚洲精品一区二区| 日韩丝袜美女视频| xf在线a精品一区二区视频网站| 精品成人免费观看| 欧美国产日本韩| 亚洲乱码国产乱码精品精小说| 一区二区欧美精品| 蜜臀久久99精品久久久画质超高清| 久久99热狠狠色一区二区| 国产v日产∨综合v精品视频| 成人综合在线观看| 欧美三级午夜理伦三级中视频| 3d成人动漫网站| 久久久天堂av| 亚洲自拍偷拍九九九| 蜜桃一区二区三区四区| 成人午夜私人影院| 欧美日韩精品一二三区| 久久综合久久综合久久| 亚洲欧美日韩国产中文在线| 午夜精品福利在线| 国产一区二区在线看| 色激情天天射综合网| 日韩美女一区二区三区| 欧美国产1区2区| 舔着乳尖日韩一区| 懂色av中文字幕一区二区三区| 色狠狠综合天天综合综合| 欧美一区二区三区日韩| 国产精品乱人伦一区二区| 天堂在线一区二区| 成人性生交大片| 日韩免费视频一区| 亚洲精选免费视频| 国产成人在线看| 欧美日本在线一区| 中文字幕在线不卡| 精品一区二区免费| 欧美色综合天天久久综合精品| 日韩欧美国产三级电影视频| 亚洲欧洲国产专区| 国产在线视频精品一区| 欧美性色欧美a在线播放| 久久久91精品国产一区二区精品| 亚洲一区二三区| 风流少妇一区二区| 欧美xxxxx牲另类人与| 亚洲欧美激情插| 成人毛片老司机大片| 精品少妇一区二区三区视频免付费| 一区二区三区欧美在线观看| 成人ar影院免费观看视频| 精品sm在线观看| 久久成人免费电影| 91豆麻精品91久久久久久| 国产精品私人影院| 国产成人超碰人人澡人人澡| 欧美电影免费观看高清完整版在线观看 | 久久99精品久久久久久| 欧亚一区二区三区| 亚洲精选免费视频| 91麻豆福利精品推荐| 欧美韩国日本不卡| 国产精品白丝av| 欧美一级在线免费| 免费观看成人av| 日韩色在线观看| 麻豆精品新av中文字幕| 日韩一区二区三区三四区视频在线观看| 亚洲国产日韩精品| 欧美日韩高清一区二区| 亚洲一区二区三区四区五区黄| 日本道色综合久久| 亚洲国产成人精品视频| 欧美另类高清zo欧美| 午夜精品一区二区三区电影天堂 |