424 if (!foundBulkIN && |
424 if (!foundBulkIN && |
425 (caps->iTypesAndDir & (KUsbEpTypeBulk | KUsbEpDirIn)) == (KUsbEpTypeBulk | KUsbEpDirIn)) |
425 (caps->iTypesAndDir & (KUsbEpTypeBulk | KUsbEpDirIn)) == (KUsbEpTypeBulk | KUsbEpDirIn)) |
426 { |
426 { |
427 // InEndpoint is going to be our TX (IN, write) endpoint |
427 // InEndpoint is going to be our TX (IN, write) endpoint |
428 ifc().iEndpointData[0].iType = KUsbEpTypeBulk; |
428 ifc().iEndpointData[0].iType = KUsbEpTypeBulk; |
|
429 if((d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) == KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) |
|
430 ifc().iEndpointData[0].iFeatureWord1 = KUsbcEndpointInfoFeatureWord1_DMA|KUsbcEndpointInfoFeatureWord1_DoubleBuffering; |
429 ifc().iEndpointData[0].iDir = KUsbEpDirIn; |
431 ifc().iEndpointData[0].iDir = KUsbEpDirIn; |
430 ifc().iEndpointData[0].iSize = maxPacketSize; |
432 ifc().iEndpointData[0].iSize = maxPacketSize; |
431 ifc().iEndpointData[0].iInterval_Hs = 0; |
433 ifc().iEndpointData[0].iInterval_Hs = 0; |
432 ifc().iEndpointData[0].iBufferSize = KMaxScBufferSize; |
434 ifc().iEndpointData[0].iBufferSize = KMaxScBufferSize; |
433 foundBulkIN = ETrue; |
435 foundBulkIN = ETrue; |
440 if (!foundBulkOUT && |
442 if (!foundBulkOUT && |
441 (caps->iTypesAndDir & (KUsbEpTypeBulk | KUsbEpDirOut)) == (KUsbEpTypeBulk | KUsbEpDirOut)) |
443 (caps->iTypesAndDir & (KUsbEpTypeBulk | KUsbEpDirOut)) == (KUsbEpTypeBulk | KUsbEpDirOut)) |
442 { |
444 { |
443 // OutEndpoint is going to be our RX (OUT, read) endpoint |
445 // OutEndpoint is going to be our RX (OUT, read) endpoint |
444 ifc().iEndpointData[1].iType = KUsbEpTypeBulk; |
446 ifc().iEndpointData[1].iType = KUsbEpTypeBulk; |
|
447 if((d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) == KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) |
|
448 ifc().iEndpointData[1].iFeatureWord1 = KUsbcEndpointInfoFeatureWord1_DMA|KUsbcEndpointInfoFeatureWord1_DoubleBuffering; |
445 ifc().iEndpointData[1].iDir = KUsbEpDirOut; |
449 ifc().iEndpointData[1].iDir = KUsbEpDirOut; |
446 ifc().iEndpointData[1].iSize = maxPacketSize; |
450 ifc().iEndpointData[1].iSize = maxPacketSize; |
447 ifc().iEndpointData[1].iInterval_Hs = 0; |
451 ifc().iEndpointData[1].iInterval_Hs = 0; |
448 ifc().iEndpointData[1].iBufferSize = KMaxScBufferSize; |
452 ifc().iEndpointData[1].iBufferSize = KMaxScBufferSize; |
449 ifc().iEndpointData[1].iReadSize = KMaxScReadSize; |
453 ifc().iEndpointData[1].iReadSize = KMaxScReadSize; |
551 { |
555 { |
552 iInEndpoint = j; |
556 iInEndpoint = j; |
553 } |
557 } |
554 } |
558 } |
555 } |
559 } |
556 |
560 |
557 __PRINT(_L("CBulkOnlyTransportUsbcScLdd::Start - Setting up DMA and double buffering\n")); |
561 TUsbDeviceCaps d_caps; |
558 // Set up DMA if possible (errors are non-critical) |
562 TInt err; |
559 TInt err = iLdd.AllocateEndpointResource(iOutEndpoint, EUsbcEndpointResourceDMA); |
563 TInt ret = iLdd.DeviceCaps(d_caps); |
560 if (err != KErrNone) |
564 if (ret == KErrNone) |
561 { |
565 { |
562 __PRINT1(_L("Set DMA on OUT endpoint failed with error code: %d"), err); |
566 if((d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) != KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) |
563 } |
567 { |
564 err = iLdd.AllocateEndpointResource(iInEndpoint, EUsbcEndpointResourceDMA); |
568 __PRINT(_L("CBulkOnlyTransportUsbcScLdd::Start - Setting up DMA and double buffering\n")); |
565 if (err != KErrNone) |
569 // Set up DMA if possible (errors are non-critical) |
566 { |
570 err = iLdd.AllocateEndpointResource(iOutEndpoint, EUsbcEndpointResourceDMA); |
567 __PRINT1(_L("Set DMA on IN endpoint failed with error code: %d"), err); |
571 if (err != KErrNone) |
568 } |
572 { |
569 |
573 __PRINT1(_L("Set DMA on OUT endpoint failed with error code: %d"), err); |
570 // Set up Double Buffering if possible (errors are non-critical) |
574 } |
571 err = iLdd.AllocateEndpointResource(iOutEndpoint, EUsbcEndpointResourceDoubleBuffering); |
575 err = iLdd.AllocateEndpointResource(iInEndpoint, EUsbcEndpointResourceDMA); |
572 if (err != KErrNone) |
576 if (err != KErrNone) |
573 { |
577 { |
574 __PRINT1(_L("Set Double Buffering on OUT endpoint failed with error code: %d"), err); |
578 __PRINT1(_L("Set DMA on IN endpoint failed with error code: %d"), err); |
575 } |
579 } |
576 err = iLdd.AllocateEndpointResource(iInEndpoint, EUsbcEndpointResourceDoubleBuffering); |
580 |
577 if (err != KErrNone) |
581 // Set up Double Buffering if possible (errors are non-critical) |
578 { |
582 err = iLdd.AllocateEndpointResource(iOutEndpoint, EUsbcEndpointResourceDoubleBuffering); |
579 __PRINT1(_L("Set Double Buffering on IN endpoint failed with error code: %d"), err); |
583 if (err != KErrNone) |
580 } |
584 { |
581 |
585 __PRINT1(_L("Set Double Buffering on OUT endpoint failed with error code: %d"), err); |
|
586 } |
|
587 err = iLdd.AllocateEndpointResource(iInEndpoint, EUsbcEndpointResourceDoubleBuffering); |
|
588 if (err != KErrNone) |
|
589 { |
|
590 __PRINT1(_L("Set Double Buffering on IN endpoint failed with error code: %d"), err); |
|
591 } |
|
592 } |
|
593 } |
582 |
594 |
583 err = OpenEndpoints(); |
595 err = OpenEndpoints(); |
584 } |
596 } |
585 |
597 |
586 TInt CBulkOnlyTransportUsbcScLdd::OpenEndpoints() |
598 TInt CBulkOnlyTransportUsbcScLdd::OpenEndpoints() |