WINCE USB Research

本文概述了OHCI(开放主机控制器接口)与WinCEUSB架构的关系,详细介绍了OHCI设备初始化流程、根集线器创建过程及状态变化监测线程的工作原理,并解释了相关代码结构。

浏览了一下OHCI代码和WINCE USB构架,总结一下,怕以后忘记了。

host                                                                           -----            function

client driver (Mass storage, rndis...)               -----            client  driver(Mass storage, rndis...)  

controller driver(OHCI,UHCI...)                          -----            controller driver(ufn ctrolller)

 

controller find usb hardware device and load client driver.

Bus manage and service drivers under bus

 

About OHCI:

 

MDD

entery : hcddrv.cpp --> hcd_init hcd_open ...

 

 

PDD

entery: s3c6410_ohci.c -->HcdPdd_Init HcdPdd_Open ...

 

 

Cdevice.cpp:

//     This file manages the USB devices

//

//                  CDevice (ADT)

//                /               /

//            CFunction        CHub (ADT)

//                            /          /

//                        CRootHub   CExternalHub

 

We Create CRootHub when init in HcdMdd_CreateHcdObject()--->Create a COhcd object-->call COhcd::DeviceInitialize()-->

 

CRootHub::EnterOperationalState() create a HubStatusChangeThreadStub to run for detect hubport state change

---> in the thread we call  WaitForPortStatusChange() to get if any port state change go on to AttachDevice() , if

no port state change check if there is no device on the port suspend the port and go on WaitForPortStatusChange()....

 

Notes: the port state is defined in OHCI registers , we read the register in WaitForPortStatusChange() funciton

 

Others about code:

CHW.cpp:

         class CHW : public CHcd  ---> class CHcd : public  LockObject, public CDeviceGlobal

Cohcd.cpp:

         class COhcd : public CHW, public CHCCAera

         when Cohcd::DeviceInitialize() is called by HcdMdd_CreateHcdObject() when driver init,we create a root hub and

         set it to  m_pCRootHub by CHcd::SetRootHub()

 

the hcd_init function return a SOhcdPdd struct object and the struct is initialized in HcdPdd_Init,

SOhcdPdd::lpvOhcdMddObject = pobOhcd(this is the Cohcd object we created ).when we call

 hcd_poweron or hcd_deinit and etc , the struct object will be send  for us to use.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值