--- a/obex/obexprotocol/obexusbtransport/src/usbconn.cpp Tue Feb 02 01:11:40 2010 +0200
+++ b/obex/obexprotocol/obexusbtransport/src/usbconn.cpp Fri Mar 19 09:40:39 2010 +0200
@@ -1056,6 +1056,15 @@
maxSize = maxPacketSize;
}
dataifc2().iEndpointData[KTransmitEndpoint - 1].iSize = maxSize;
+
+ // Allocate dma if requested and the device support resource allocation scheme version 2
+ // for resource allocation scheme version1, refer to AllocateDma()
+ if (iRequestDmaOnInEndpoint &&
+ ((dCaps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) != 0))
+ {
+ dataifc2().iEndpointData[KTransmitEndpoint - 1].iFeatureWord1 |= KUsbcEndpointInfoFeatureWord1_DMA;
+ }
+
foundIn = ETrue;
}
else if (!foundOut && (caps->iTypesAndDir & KBulkOutFlags) == KBulkOutFlags)
@@ -1068,6 +1077,15 @@
maxSize = maxPacketSize;
}
dataifc2().iEndpointData[KReceiveEndpoint - 1].iSize = maxSize;
+
+ //Allocate dma here if requested and the device support resource allocation scheme version 2
+ // for resource allocation scheme version1, refer to AllocateDma()
+ if (iRequestDmaOnOutEndpoint &&
+ ((dCaps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) != 0))
+ {
+ dataifc2().iEndpointData[KReceiveEndpoint - 1].iFeatureWord1 |= KUsbcEndpointInfoFeatureWord1_DMA;
+ }
+
foundOut = ETrue;
}
}
@@ -1155,6 +1173,14 @@
{
LOG_FUNC
+ TUsbDeviceCaps dCaps;
+ iUsb.DeviceCaps(dCaps);
+ if ((dCaps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) != 0)
+ {
+ // for resource allocation version2, refer to CObexUsbHandler::RegInterfacesL()
+ return;
+ }
+
if (iRequestDmaOnInEndpoint)
{
TInt err = iUsb.AllocateEndpointResource(KTransmitEndpoint, EUsbcEndpointResourceDMA);