[USBEHCI]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Thu, 16 Feb 2012 23:19:27 +0000 (23:19 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Thu, 16 Feb 2012 23:19:27 +0000 (23:19 +0000)
- Fix a few 64-bit issues

svn path=/trunk/; revision=55653

reactos/drivers/usb/usbehci/usb_request.cpp

index 27be373..dd5f00e 100644 (file)
@@ -634,6 +634,7 @@ CUSBRequest::InitDescriptor(
     OUT PULONG OutDescriptorLength)
 {
     ULONG Index, Length = 0, PageOffset, BufferLength;
     OUT PULONG OutDescriptorLength)
 {
     ULONG Index, Length = 0, PageOffset, BufferLength;
+    PHYSICAL_ADDRESS Address;
 
     //
     // init transfer descriptor
 
     //
     // init transfer descriptor
@@ -653,10 +654,16 @@ CUSBRequest::InitDescriptor(
     Index = 0;
     do
     {
     Index = 0;
     do
     {
+        //
+        // get address
+        //
+        Address = MmGetPhysicalAddress(TransferBuffer);
+
         //
         // use physical address
         //
         //
         // use physical address
         //
-        CurrentDescriptor->BufferPointer[Index] = MmGetPhysicalAddress(TransferBuffer).LowPart;
+        CurrentDescriptor->BufferPointer[Index] = Address.LowPart;
+        CurrentDescriptor->ExtendedBufferPointer[Index] = Address.HighPart;
 
         //
         // Get the offset from page size
 
         //
         // Get the offset from page size
@@ -755,7 +762,6 @@ CUSBRequest::BuildTransferDescriptorChain(
         MaxPacketSize = m_EndpointDescriptor->EndPointDescriptor.wMaxPacketSize;
     }
 
         MaxPacketSize = m_EndpointDescriptor->EndPointDescriptor.wMaxPacketSize;
     }
 
-
     do
     {
         //
     do
     {
         //
@@ -962,7 +968,8 @@ CUSBRequest::BuildControlTransferQueueHead(
     SetupDescriptor->Token.Bits.PIDCode = PID_CODE_SETUP_TOKEN;
     SetupDescriptor->Token.Bits.TotalBytesToTransfer = sizeof(USB_DEFAULT_PIPE_SETUP_PACKET);
     SetupDescriptor->Token.Bits.DataToggle = FALSE;
     SetupDescriptor->Token.Bits.PIDCode = PID_CODE_SETUP_TOKEN;
     SetupDescriptor->Token.Bits.TotalBytesToTransfer = sizeof(USB_DEFAULT_PIPE_SETUP_PACKET);
     SetupDescriptor->Token.Bits.DataToggle = FALSE;
-    SetupDescriptor->BufferPointer[0] = (ULONG)PtrToUlong(m_DescriptorSetupPacket.LowPart);
+    SetupDescriptor->BufferPointer[0] = m_DescriptorSetupPacket.LowPart;
+    SetupDescriptor->ExtendedBufferPointer[0] = m_DescriptorSetupPacket.HighPart;
     InsertTailList(&QueueHead->TransferDescriptorListHead, &SetupDescriptor->DescriptorEntry);
 
 
     InsertTailList(&QueueHead->TransferDescriptorListHead, &SetupDescriptor->DescriptorEntry);
 
 
@@ -1331,7 +1338,7 @@ CUSBRequest::CreateQueueHead(
     QueueHead->Token.Bits.InterruptOnComplete = FALSE;
 
     //
     QueueHead->Token.Bits.InterruptOnComplete = FALSE;
 
     //
-    // FIXME check if that is really needed
+    // store address
     //
     QueueHead->PhysicalAddr = QueueHeadPhysicalAddress.LowPart;
 
     //
     QueueHead->PhysicalAddr = QueueHeadPhysicalAddress.LowPart;