-
-
-/**
- * Enqueue a transfer descriptor.
- */
-u8 first = 1;
-u8 hcdi_enqueue(usb_transfer_descriptor *td) {
- printf( "===========================\n"
- "===========================\n");
- control_quirk(); //required? YES! :O ... erm... or no? :/ ... in fact I have no idea
- u32 tmptdbuffer;
-
- static struct endpoint_descriptor dummyconfig;
- if(first) {
- first = 0;
- memset(&dummyconfig, 0, 16);
- 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));
- } else {
- sync_before_read(&dummyconfig, 16);
- dummyconfig.flags |= ACCESS_LE(OHCI_ENDPOINT_SKIP);
- printf("HALTED set?: %d\n", ACCESS_LE(dummyconfig.headp)&OHCI_ENDPOINT_HALTED);
- sync_after_write(&dummyconfig, 16);
-
- udelay(2000);
- dummyconfig.headp = ACCESS_LE(0);
- sync_after_write(&dummyconfig, 16);
- }
-
- sync_before_read(&hcca_oh0, 256);
- printf("done head (nach sync): 0x%08X\n", ACCESS_LE(hcca_oh0.done_head));
- printf("HCCA->frame_no: %d\nhcca->hccapad1: %d\n",
- ((ACCESS_LE(hcca_oh0.frame_no) & 0xffff)>>16),
- ACCESS_LE(hcca_oh0.frame_no)&0x0000ffff );
-
- struct general_td *tmptd = allocate_general_td(td->actlen);
- (void) memcpy((void*) (phys_to_virt(ACCESS_LE(tmptd->cbp))), td->buffer, td->actlen);
-
- tmptd->flags &= ACCESS_LE(~OHCI_TD_DIRECTION_PID_MASK);
- switch(td->pid) {