201038_01
authorhgs
Wed, 13 Oct 2010 18:04:14 +0800
changeset 55 3b97f0de7605
parent 49 93c0009bd947
child 58 84c26be382f0
201038_01
usbdrv/peripheral/pdd/pil/src/descriptors.cpp
usbdrv/peripheral/public/d32usbdescriptors.h
usbdrv/peripheral/public/usb.h
usbmgmt/usbmgr/host/fdf/production/server/src/deviceproxy.cpp
usbmgmt/usbmgr/usbman/server/public/usbhostdefs.h
--- 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;
     }
 
 
--- 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);
 	};
 
 
--- 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
--- 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<SetOtgDescriptorL");
 	}
 
 // Used during instantiation to read supported strings.
--- a/usbmgmt/usbmgr/usbman/server/public/usbhostdefs.h	Thu Sep 16 12:03:29 2010 +0800
+++ b/usbmgmt/usbmgr/usbman/server/public/usbhostdefs.h	Wed Oct 13 18:04:14 2010 +0800
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -118,6 +118,7 @@
 	inline TOtgDescriptor()
 		:	iDeviceId(0),
 		    iAttributes(0),
+		    iBcdOTG(0),
 		    iReserved1(0),
 		    iReserved2(0),
 		    iReserved3(0)
@@ -129,8 +130,9 @@
 	// The OTG attributes - currently only D0 and D1 are used for SRP and HNP.
 	TUint8 iAttributes;
 	
+	TUint16 iBcdOTG;
 	// Reserved
-	TInt iReserved1;
+	TUint16 iReserved1;
 	
 	// Reserved
 	TInt iReserved2;