diff -r 96e5fb8b040d -r 36bfc973b146 kernel/eka/include/drivers/usbc.h --- a/kernel/eka/include/drivers/usbc.h Thu Dec 17 09:24:54 2009 +0200 +++ b/kernel/eka/include/drivers/usbc.h Thu Jan 07 13:38:45 2010 +0200 @@ -79,9 +79,10 @@ TDmaBuf(TUsbcEndpointInfo* aEndpointInfo, TInt aBandwidthPriority); ~TDmaBuf(); TInt Construct(TUsbcEndpointInfo* aEndpointInfo); - TUint8* SetBufferBase(TUint8* aBase); TInt BufferTotalSize() const; - TUint8* BufferBase() const; + TInt BufferSize() const; + TInt SetBufferAddr(TInt aBufInd, TUint8* aBufAddr); + TInt BufferNumber() const; void SetMaxPacketSize(TInt aSize); void Flush(); // Rx (OUT) variants @@ -190,8 +191,11 @@ void AbortTransfer(); inline TUsbcEndpointInfo* EndpointInfo(); inline TInt RxBytesAvailable() const; - inline TInt BufferTotalSize() const; - inline TUint8* SetBufferBase(TUint8* aBase); + + inline TInt BufferSize() const; + inline TInt SetBufferAddr( TInt aBufInd, TUint8* aAddr); + inline TInt BufferNumber() const; + inline void SetTransferInfo(TEndpointTransferInfo* aTransferInfo); inline void ResetTransferInfo(); inline void SetClientReadPending(TBool aVal); @@ -239,6 +243,7 @@ TUsbcAlternateSettingList* iNext; TInt iNumberOfEndpoints; TUint iSetting; + TInt iEpNumDeOrderedByBufSize[KMaxEndpointsPerClient + 1]; TUsbcEndpoint* iEndpoint[KMaxEndpointsPerClient + 1]; }; @@ -302,13 +307,14 @@ TInt ProcessDeviceState(TUsbcDeviceState aDeviceState); void ResetInterface(TInt aErrorCode); void AbortInterface(); - void RebaseInterfaceMemory(TUsbcAlternateSettingList* aAlternateSettingListRec, TUint8* aBase, - TUint aDirection); + // Set buffer address of the interface + void ReSetInterfaceMemory(TUsbcAlternateSettingList* aAlternateSettingListRec, + RArray &aHwChunks ); void UpdateEndpointSizes(); - DPlatChunkHw* SetupInterfaceMemory(TInt aBufferSize, DPlatChunkHw* aHwChunk, TUint aDirection, - TUint32 aCacheAttribs); + // Check and alloc memory for the interface + TInt SetupInterfaceMemory(RArray &aHwChunks, + TUint32 aCacheAttribs ); void PanicClientThread(TInt aReason); - TInt PinMemory(TDesC8 *aDes, TVirtualPinObject *iPinObj); //Descriptor pinning helper. void CompleteBufferRequest(DThread* aThread, TInt aReqNo, TInt aReason); private: @@ -326,12 +332,10 @@ TUsbcEndpointStatusCallback iEndpointStatusCallbackInfo; TAny* iOtgFeatureChangePtr; TUsbcOtgFeatureCallback iOtgFeatureCallbackInfo; - TUint8* iBufferBaseEp0; - TInt iBufferSizeEp0; TInt iNumberOfEndpoints; - DPlatChunkHw* iHwChunkIN; - DPlatChunkHw* iHwChunkOUT; - DPlatChunkHw* iHwChunkEp0; + RArray iHwChunksEp0; + RArray iHwChunks; + TUsbcDeviceState iDeviceState; TUsbcDeviceState iOldDeviceState; TBool iOwnsDeviceControl;