equal
deleted
inserted
replaced
1 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Eclipse Public License v1.0" |
4 // under the terms of the License "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
554 __KTRACE_OPT(KUSB, Kern::Printf("TUsbcOtgDescriptor::TUsbcOtgDescriptor()")); |
554 __KTRACE_OPT(KUSB, Kern::Printf("TUsbcOtgDescriptor::TUsbcOtgDescriptor()")); |
555 } |
555 } |
556 |
556 |
557 |
557 |
558 TInt TUsbcOtgDescriptor::Construct(TBool aHnpSupport, TBool aSrpSupport) |
558 TInt TUsbcOtgDescriptor::Construct(TBool aHnpSupport, TBool aSrpSupport) |
559 { |
559 { |
560 __KTRACE_OPT(KUSB, Kern::Printf("TUsbcOtgDescriptor::Construct()")); |
560 __KTRACE_OPT(KUSB, Kern::Printf("TUsbcOtgDescriptor::Construct()")); |
561 iBuf.SetMax(); |
561 iBuf.SetMax(); |
562 SetBufferPointer(iBuf); |
562 SetBufferPointer(iBuf); |
563 iBuf[0] = iBuf.Size(); // bLength |
563 iBuf[0] = iBuf.Size(); // bLength |
564 iBuf[1] = KUsbDescType_Otg; // bDescriptorType |
564 iBuf[1] = KUsbDescType_Otg; // bDescriptorType |
565 iBuf[2] = (aHnpSupport ? KUsbOtgAttr_HnpSupp : 0) | |
565 // B HNP not supported which is temporarily hard coded here. |
566 (aSrpSupport ? KUsbOtgAttr_SrpSupp : 0); // bmAttributes |
566 iBuf[2] = ( aHnpSupport ? 0 : 0 ) | ( aSrpSupport ? KUsbOtgAttr_SrpSupp : 0 ); // bmAttributes |
567 return KErrNone; |
567 iBuf[3] = KUsbOtgDesc_bcdOTG & 0x00ff; |
|
568 iBuf[4] = ( KUsbOtgDesc_bcdOTG >> 8 ) & 0x00ff; |
|
569 |
|
570 return KErrNone; |
568 } |
571 } |
569 |
572 |
570 |
573 |
571 // --- TUsbcClassSpecificDescriptor |
574 // --- TUsbcClassSpecificDescriptor |
572 |
575 |