Exemplo n.º 1
0
        protected static UHCI_qTD_Struct *AllocQTD(uint *next)
        {
#if UHCI_TRACE
            BasicConsole.WriteLine("UHCI: Alloc qTD");
            BasicConsole.DelayOutput(5);
#endif

            UHCI_qTD_Struct *td = (UHCI_qTD_Struct *)FOS_System.Heap.AllocZeroedAPB((uint)sizeof(UHCI_qTD_Struct), 32, "UHCI : AllocQTD");

            if ((uint)next != Utils.BIT(0))
            {
                td->next   = ((uint)VirtMemManager.GetPhysicalAddress(next) & 0xFFFFFFF0) | UHCI_Consts.BIT_Vf;
                td->q_next = (UHCI_qTD_Struct *)next;
            }
            else
            {
                td->next = UHCI_Consts.BIT_T;
            }

            UHCI_qTD.SetActive(td, true);    // to be executed
            UHCI_qTD.SetPacketID(td, UHCI_Consts.TD_SETUP);
            UHCI_qTD.SetMaxLength(td, 0x3F); // 64 byte // uhci, rev. 1.1, page 24

            return(td);
        }
Exemplo n.º 2
0
        protected static void ShowPortState(ushort val)
        {
            if ((val & UHCI_Consts.PORT_RESET) != 0)
            {
                BasicConsole.WriteLine(" RESET");
            }

            if ((val & UHCI_Consts.SUSPEND) != 0)
            {
                BasicConsole.WriteLine(" SUSPEND");
            }
            if ((val & UHCI_Consts.PORT_RESUME_DETECT) != 0)
            {
                BasicConsole.WriteLine(" RESUME DETECT");
            }

            if ((val & UHCI_Consts.PORT_LOWSPEED_DEVICE) != 0)
            {
                BasicConsole.WriteLine(" LOWSPEED DEVICE");
            }
            else
            {
                BasicConsole.WriteLine(" FULLSPEED DEVICE");
            }
            if ((val & Utils.BIT(5)) != 0)
            {
                BasicConsole.WriteLine(" Line State: D-");
            }
            if ((val & Utils.BIT(4)) != 0)
            {
                BasicConsole.WriteLine(" Line State: D+");
            }

            if ((val & UHCI_Consts.PORT_ENABLE_CHANGE) != 0)
            {
                BasicConsole.WriteLine(" ENABLE CHANGE");
            }
            if ((val & UHCI_Consts.PORT_ENABLE) != 0)
            {
                BasicConsole.WriteLine(" ENABLED");
            }

            if ((val & UHCI_Consts.PORT_CS_CHANGE) != 0)
            {
                BasicConsole.WriteLine(" DEVICE CHANGE");
            }
            if ((val & UHCI_Consts.PORT_CS) != 0)
            {
                BasicConsole.WriteLine(" DEVICE ATTACHED");
            }
            else
            {
                BasicConsole.WriteLine(" NO DEVICE ATTACHED");
            }
        }
Exemplo n.º 3
0
 public static void SetDataToggle(UHCI_qTD_Struct *qTD, bool val)
 {
     if (val)
     {
         qTD->u2 |= Utils.BIT(19);
     }
     else
     {
         qTD->u2 &= ~Utils.BIT(19);
     }
 }
Exemplo n.º 4
0
 public static void SetIntOnComplete(UHCI_qTD_Struct *qTD, bool val)
 {
     if (val)
     {
         qTD->u1 |= Utils.BIT(24);
     }
     else
     {
         qTD->u1 &= ~Utils.BIT(24);
     }
 }
Exemplo n.º 5
0
 public static void SetActive(UHCI_qTD_Struct *qTD, bool val)
 {
     if (val)
     {
         qTD->u1 |= Utils.BIT(23);
     }
     else
     {
         qTD->u1 &= ~Utils.BIT(23);
     }
 }
Exemplo n.º 6
0
 public static bool GetDataToggle(UHCI_qTD_Struct *qTD)
 {
     return((qTD->u2 & Utils.BIT(19)) != 0);
 }
Exemplo n.º 7
0
 public static bool GetIntOnComplete(UHCI_qTD_Struct *qTD)
 {
     return((qTD->u1 & Utils.BIT(24)) != 0);
 }
Exemplo n.º 8
0
 //u1
 public static bool GetActive(UHCI_qTD_Struct *qTD)
 {
     return((qTD->u1 & Utils.BIT(23)) != 0);
 }