- printf("tmptd hexdump (before) 0x%08X:\n", tmptd);
- hexdump(tmptd, sizeof(struct general_td));
- printf("tmptd->cbp hexdump (before) 0x%08X:\n", phys_to_virt(ACCESS_LE(tmptd->cbp)));
- hexdump((void*) phys_to_virt(ACCESS_LE(tmptd->cbp)), td->actlen);
+/**
+ * Enqueue a transfer descriptor.
+ */
+u8 first = 0;
+u8 hcdi_enqueue(usb_transfer_descriptor *td) {
+ static struct general_td *tSetup,*tData;
+ static u32 tSetupbuffer, tDatabuffer, tStatusbuffer;
+ static u32 tSetupblen, tDatablen, tStatusblen;
+
+ if(first == 0) {
+ printf("step 0\n");
+ tSetup = allocate_general_td(td->actlen);
+ general_td_fill(tSetup, td);
+ tSetupbuffer = (u32) phys_to_virt(ACCESS_LE(tSetup->cbp));
+ tSetupblen = td->actlen;
+ first++;
+ return 0;
+ }
+ if(first == 1) {
+ printf("step 1\n");
+ tData = allocate_general_td(td->actlen);
+ general_td_fill(tData, td);
+ tDatabuffer = (u32) phys_to_virt(ACCESS_LE(tData->cbp));
+ tDatablen = td->actlen;
+ first++;
+ return 0;
+ }
+ first = 0;
+ struct general_td *tStatus = allocate_general_td(td->actlen);
+ general_td_fill(tStatus, td);
+ tStatusbuffer = (u32) phys_to_virt(ACCESS_LE(tStatus->cbp));
+ tStatusblen = td->actlen;