OS developement (USB 1.0 /1.0 and USB 2.0 )

OS developement (USB 1.0 /1.0 and USB 2.0 )

im developing an OS and im currently adding USB 1.0 /1.1 and USB 2.0 support.

Im experiencing a problem linking  Async Queue Heads

        //Set Memory Address of 2 Queues Heads

        static unsafe qHead* aHead1 = (qHead*)(0x10000);
        static unsafe qHead* aHead2 = (qHead*)(0x20000);
        static unsafe qHead* aHead3 = (qHead*)(0x30000);

            //Initialise Queue Heads with required values

            aHead1->CurrentTD = 0x0;
            aHead1->NextTD = 0x10080;
            aHead1->QueueHeadLinkPointer = 0x20002; 
            aHead1->EndpointCapabilities0 = 0x40E000;   / /Lower Dword for Capatibilities 
            aHead1->EndpointCapabilities1 = 0x40000000;

            
            aHead2->CurrentTD = 0x0;
            aHead2->NextTD = 0x20080;
            aHead2->QueueHeadLinkPointer = 0x30002;
            aHead2->EndpointCapabilities0 = 0x406000;
            aHead2->EndpointCapabilities1 = 0x40000000;

            aHead3->CurrentTD = 0x1;
            aHead3->NextTD = 0x1;
            aHead3->QueueHeadLinkPointer = 0x00001;
            aHead3->EndpointCapabilities0 = 0x406000;
            aHead3->EndpointCapabilities1 = 0x40000000;

           

     aTDList[Index] = (qElement*)(0x10080);//Set Address of TD
                aTDList[Index]->NextTDPointer = 0x10100;
                aTDList[Index]->AlternateTDPointer = 0x1;
                aTDList[Index]->TDBufferPointer = (uint)TmpBuffer;
                aTDList[Index]->TDToken = 0x00088E80;//Setup 

                CreatePacket(ref TmpBuffer, RequestType.Device2Host, StandardRequest.SET_ADDRESS, 0x1, 0, 0x0);
     
                Index++;

                aTDList[Index] = (qElement*)(0x10100);//
                aTDList[Index]->NextTDPointer = 0x1; //End this Queue
                aTDList[Index]->AlternateTDPointer = 0x1;
                aTDList[Index]->TDBufferPointer = (uint)(AckB);
                aTDList[Index]->TDToken = 0x80400D80;// Ack
                Index++;

     
                aTDList[Index] = (qElement*)(0x20080);//Set Address of TD
                aTDList[Index]->NextTDPointer = 0x20100;
                aTDList[Index]->AlternateTDPointer = 0x1;
                aTDList[Index]->TDBufferPointer = (uint)SetupB; //Pointer to Setup Buffer ( 0x14000);
                aTDList[Index]->TDToken = 0x00088E80;//Setup 

                CreatePacket(ref SetupB, RequestType.Device2Host, StandardRequest.GET_DESCRIPTOR, (ushort)DescriptorType.DEVICE, 0, 0x12);
          
                Index++;

                aTDList[Index] = (qElement*)(0x20100);//Set Address of TD
                aTDList[Index]->NextTDPointer = 0x20120;
                aTDList[Index]->AlternateTDPointer = 0x1;
                aTDList[Index]->TDBufferPointer = (uint)DataB; //Pointer to Data buffer (0x15000)
                aTDList[Index]->TDToken = 0x80400D80;// Data
                Index++;

                aTDList[Index] = (qElement*)(0x20120);//Set Address of TD
                aTDList[Index]->NextTDPointer = 0xDEAD0001;
                aTDList[Index]->AlternateTDPointer = 0x1;
                aTDList[Index]->TDBufferPointer =(uint)AckB; //Pointer to ACK Buffer(0x16000)
                aTDList[Index]->TDToken = 0x80008C80;//Ack
                Index++;

 

The problems is it doesn't go to the next Queue Head and gives me a transaction Error at the when its done with Queue Head1. if i use the two queue sseperately it works fine.

And another question about USB UHCI. I noticed the USBBASE register returns 0x00000000 instead of 0x00000001 for I/O Space though the ICH6-ICH9 manuals say its default to 0x00000001 . Should i use memory space in this case?

Thanks for you response in advance.

 

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.