- 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;
-
- printf( "===========================\n"
- "===========================\n");
- control_quirk(); //required? YES! :O ... erm... or no? :/ ... in fact I have no idea
-
- struct endpoint_descriptor *dummyconfig = allocate_endpoint();
- dummyconfig->flags = ACCESS_LE(OHCI_ENDPOINT_GENERAL_FORMAT);
- dummyconfig->headp = dummyconfig->tailp = dummyconfig->nexted = ACCESS_LE(0);
- dummyconfig->flags |= ACCESS_LE(OHCI_ENDPOINT_LOW_SPEED |
- OHCI_ENDPOINT_SET_DEVICE_ADDRESS(td->devaddress) |
- OHCI_ENDPOINT_SET_ENDPOINT_NUMBER(td->endpoint) |
- OHCI_ENDPOINT_SET_MAX_PACKET_SIZE(td->maxp));
- write32(OHCI0_HC_CTRL_HEAD_ED, virt_to_phys(dummyconfig));
-
-#define ED_MASK ((u32)~0x0f)
- dummyconfig->headp |= ACCESS_LE(virt_to_phys((void*) ((u32)tSetup & ED_MASK)));
- tSetup->nexttd = ACCESS_LE(virt_to_phys((void*) ((u32)tData & ED_MASK)));
- tData->nexttd = ACCESS_LE(virt_to_phys((void*) ((u32)tStatus & ED_MASK)));
-
- sync_after_write(dummyconfig, 16);
- sync_after_write(tSetup, sizeof(struct general_td));
- sync_after_write(tData, sizeof(struct general_td));
- sync_after_write(tStatus, sizeof(struct general_td));
-
- dump_address(tSetup, sizeof(struct general_td), "tSetup(before)");
- dump_address((void*) phys_to_virt(ACCESS_LE(tSetup->cbp)), tSetupblen, "tSetup->cbp(before)");
-
- dump_address(tData, sizeof(struct general_td), "tData(before)");
- dump_address((void*) phys_to_virt(ACCESS_LE(tData->cbp)), tDatablen, "tData->cbp(before)");
-
- dump_address(tStatus, sizeof(struct general_td), "tStatus(before)");
- dump_address((void*) phys_to_virt(ACCESS_LE(tStatus->cbp)), tStatusblen, "tStatus->cbp(before)");
-
- dump_address(dummyconfig, sizeof(struct endpoint_descriptor), "dummyconfig(before)");
-
- printf("ctrl head: 0x%08X\n", read32(OHCI0_HC_CTRL_HEAD_ED));