# HG changeset patch # User hgs # Date 1286964254 -28800 # Node ID 3b97f0de760531d0a84dd3c9678feeb295620fd1 # Parent 93c0009bd9470e020aff7c7e2b81688f2e614691 201038_01 diff -r 93c0009bd947 -r 3b97f0de7605 usbdrv/peripheral/pdd/pil/src/descriptors.cpp --- a/usbdrv/peripheral/pdd/pil/src/descriptors.cpp Thu Sep 16 12:03:29 2010 +0800 +++ b/usbdrv/peripheral/pdd/pil/src/descriptors.cpp Wed Oct 13 18:04:14 2010 +0800 @@ -1,4 +1,4 @@ -// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of the License "Eclipse Public License v1.0" @@ -556,15 +556,18 @@ TInt TUsbcOtgDescriptor::Construct(TBool aHnpSupport, TBool aSrpSupport) - { - __KTRACE_OPT(KUSB, Kern::Printf("TUsbcOtgDescriptor::Construct()")); - iBuf.SetMax(); - SetBufferPointer(iBuf); - iBuf[0] = iBuf.Size(); // bLength - iBuf[1] = KUsbDescType_Otg; // bDescriptorType - iBuf[2] = (aHnpSupport ? KUsbOtgAttr_HnpSupp : 0) | - (aSrpSupport ? KUsbOtgAttr_SrpSupp : 0); // bmAttributes - return KErrNone; + { + __KTRACE_OPT(KUSB, Kern::Printf("TUsbcOtgDescriptor::Construct()")); + iBuf.SetMax(); + SetBufferPointer(iBuf); + iBuf[0] = iBuf.Size(); // bLength + iBuf[1] = KUsbDescType_Otg; // bDescriptorType + // B HNP not supported which is temporarily hard coded here. + iBuf[2] = ( aHnpSupport ? 0 : 0 ) | ( aSrpSupport ? KUsbOtgAttr_SrpSupp : 0 ); // bmAttributes + iBuf[3] = KUsbOtgDesc_bcdOTG & 0x00ff; + iBuf[4] = ( KUsbOtgDesc_bcdOTG >> 8 ) & 0x00ff; + + return KErrNone; } diff -r 93c0009bd947 -r 3b97f0de7605 usbdrv/peripheral/public/d32usbdescriptors.h --- a/usbdrv/peripheral/public/d32usbdescriptors.h Thu Sep 16 12:03:29 2010 +0800 +++ b/usbdrv/peripheral/public/d32usbdescriptors.h Wed Oct 13 18:04:14 2010 +0800 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of the License "Eclipse Public License v1.0" @@ -528,20 +528,24 @@ IMPORT_C static TUsbOTGDescriptor* Cast(TUsbGenericDescriptor* aOriginal); public: - static const TInt KSizeInOctets = 3; + static const TInt KSizeInOctets = 3; //OTG1.3 otg descriptor length enum TFieldOffsets { - EbmAttributes = 2 + EbmLength = 0, + EbmAttributes = 2, + EbcdOTG = 3 }; public: IMPORT_C TUint8 Attributes() const; IMPORT_C TBool HNPSupported() const; IMPORT_C TBool SRPSupported() const; + IMPORT_C TUint16 BcdOTG() const; public: static TUsbOTGDescriptor* ParseL(TPtrC8& aUsbDes, TUsbGenericDescriptor* aPreviousDesc); virtual TBool IsParent(TUsbGenericDescriptor& aPotentialParent); virtual TBool IsPeer(TUsbGenericDescriptor& aPotentialPeer); + static TBool IsValidOTGDescriptorLength(TUint8 aLength); }; diff -r 93c0009bd947 -r 3b97f0de7605 usbdrv/peripheral/public/usb.h --- a/usbdrv/peripheral/public/usb.h Thu Sep 16 12:03:29 2010 +0800 +++ b/usbdrv/peripheral/public/usb.h Wed Oct 13 18:04:14 2010 +0800 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of the License "Eclipse Public License v1.0" @@ -84,7 +84,7 @@ const TUint KUsbDescSize_Config = 9; const TUint KUsbDescSize_Interface = 9; const TUint KUsbDescSize_Endpoint = 7; -const TUint KUsbDescSize_Otg = 3; +const TUint KUsbDescSize_Otg = 5; const TUint KUsbDescSize_DeviceQualifier = 10; const TUint KUsbDescSize_OtherSpeedConfig = 9; const TUint KUsbDescSize_InterfaceAssociation = 8; @@ -137,6 +137,7 @@ const TUint8 KUsbOtgAttr_B_HnpEnable = 0x04; const TUint8 KUsbOtgAttr_A_HnpSupport = 0x08; const TUint8 KUsbOtgAttr_A_AltHnpSupport = 0x10; +const TUint16 KUsbOtgDesc_bcdOTG = 0x0200; // // Feature Settings diff -r 93c0009bd947 -r 3b97f0de7605 usbmgmt/usbmgr/host/fdf/production/server/src/deviceproxy.cpp --- a/usbmgmt/usbmgr/host/fdf/production/server/src/deviceproxy.cpp Thu Sep 16 12:03:29 2010 +0800 +++ b/usbmgmt/usbmgr/host/fdf/production/server/src/deviceproxy.cpp Wed Oct 13 18:04:14 2010 +0800 @@ -335,6 +335,10 @@ iOtgDescriptor->iDeviceId = iId; iOtgDescriptor->iAttributes = aDescriptor.Attributes(); + + OstTrace0( TRACE_NORMAL, CDEVICEPROXY_SETOTGDESCRIPTORL0, "\t>SetOtgDescriptorL"); + iOtgDescriptor->iBcdOTG = aDescriptor.BcdOTG(); + OstTrace0( TRACE_NORMAL, CDEVICEPROXY_SETOTGDESCRIPTORL1, "\t