Changeset 3da5eb9 in mainline
- Timestamp:
- 2011-01-28T19:07:41Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f0e25e8
- Parents:
- 01656f2
- Location:
- uspace/drv/uhci
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci/uhci.c
r01656f2 r3da5eb9 85 85 86 86 uhci_print_verbose("Starting UHCI HC.\n"); 87 pio_write_16(&instance->registers->usbcmd, UHCI_CMD_RUN_STOP); 88 /* 87 89 uint16_t cmd = pio_read_16(&instance->registers->usbcmd); 88 cmd |= UHCI_CMD_ RUN_STOP | UHCI_CMD_CONFIGURE;90 cmd |= UHCI_CMD_DEBUG; 89 91 pio_write_16(&instance->registers->usbcmd, cmd); 90 92 */ 91 93 device->driver_data = instance; 92 94 return EOK; … … 163 165 CHECK_RET_TRANS_FREE_JOB_TD("Failed to allocate callback structure.\n"); 164 166 165 td = transfer_descriptor_get(3, size, false, target, pid );167 td = transfer_descriptor_get(3, size, false, target, pid, job->new_buffer); 166 168 ret = td ? EOK : ENOMEM; 167 169 CHECK_RET_TRANS_FREE_JOB_TD("Failed to setup transfer descriptor.\n"); … … 178 180 return EOK; 179 181 } 180 /*--------------------------------------------------------------------------- -*/182 /*---------------------------------------------------------------------------*/ 181 183 int uhci_clean_finished(void* arg) 182 184 { … … 196 198 uhci_print_verbose("Running cleaning fibril on queue: %p (%s).\n", 197 199 &instance->transfers[i], it ? "SOMETHING" : "EMPTY"); 200 201 if (it) 202 uhci_print_verbose("First in queue: %p (%x).\n", 203 it, it->status); 204 198 205 while (instance->transfers[i].first && 199 206 !(instance->transfers[i].first->status & TD_STATUS_ERROR_ACTIVE)) { 200 207 transfer_descriptor_t *transfer = instance->transfers[i].first; 201 uhci_print_info("Inactive transfer calling callback.\n"); 208 uhci_print_info("Inactive transfer calling callback with status %x.\n", 209 transfer->status); 202 210 instance->transfers[i].first = transfer->next_va; 203 211 transfer_descriptor_dispose(transfer); … … 213 221 int uhci_debug_checker(void *arg) 214 222 { 215 return 0;216 223 uhci_t *instance = (uhci_t*)arg; 217 224 assert(instance); … … 222 229 reg = pio_read_16(&instance->registers->usbsts); 223 230 uhci_print_verbose("Status register: %X\n", reg); 231 /* 224 232 uintptr_t frame_list = pio_read_32(&instance->registers->flbaseadd); 225 233 uhci_print_verbose("Framelist address: %p vs. %p.\n", … … 238 246 uhci_print_verbose("Bulk QH: %p vs. %p.\n", qh->next_queue, 239 247 addr_to_phys(instance->transfers[USB_TRANSFER_BULK].queue_head)); 248 uint16_t cmd = pio_read_16(&instance->registers->usbcmd); 249 cmd |= UHCI_CMD_RUN_STOP; 250 pio_write_16(&instance->registers->usbcmd, cmd); 251 */ 240 252 241 253 async_usleep(UHCI_DEBUGER_TIMEOUT); -
uspace/drv/uhci/uhci.h
r01656f2 r3da5eb9 65 65 #define UHCI_FRAME_LIST_COUNT 1024 66 66 #define UHCI_CLEANER_TIMEOUT 5000000 67 #define UHCI_DEBUGER_TIMEOUT 300000067 #define UHCI_DEBUGER_TIMEOUT 2500000 68 68 69 69 typedef struct uhci { -
uspace/drv/uhci/uhci_struct/transfer_descriptor.c
r01656f2 r3da5eb9 3 3 void transfer_descriptor_init(transfer_descriptor_t *instance, 4 4 int error_count, size_t size, bool isochronous, usb_target_t target, 5 int pid )5 int pid, void *buffer) 6 6 { 7 7 assert(instance); 8 8 9 9 instance->next = 10 0 | LINK_POINTER_VERTICAL_FLAG | LINK_POINTER_TERMINATE_FLAG; 10 0 | LINK_POINTER_TERMINATE_FLAG; 11 12 uhci_print_verbose("Creating link field: %x.\n", instance->next); 11 13 12 14 assert(size < 1024); … … 18 20 19 21 instance->device = 0 20 | (( size& TD_DEVICE_MAXLEN_MASK) << TD_DEVICE_MAXLEN_POS)22 | (((size - 1) & TD_DEVICE_MAXLEN_MASK) << TD_DEVICE_MAXLEN_POS) 21 23 | ((target.address & TD_DEVICE_ADDRESS_MASK) << TD_DEVICE_ADDRESS_POS) 22 24 | ((target.endpoint & TD_DEVICE_ENDPOINT_MASK) << TD_DEVICE_ENDPOINT_POS) 23 25 | ((pid & TD_DEVICE_PID_MASK) << TD_DEVICE_PID_POS); 26 27 uhci_print_verbose("Creating device field: %x.\n", instance->device); 28 29 instance->buffer_ptr = (uintptr_t)addr_to_phys(buffer); 30 31 uhci_print_verbose("Creating buffer field: %p(%p).\n", 32 buffer, instance->buffer_ptr); 33 34 char * buff = buffer; 35 36 uhci_print_verbose("Buffer dump(8B): %x %x %x %x %x %x %x %x.\n", 37 buff[0], buff[1], buff[2], buff[3], buff[4], buff[5], buff[6], buff[7]); 24 38 25 39 instance->next_va = NULL; -
uspace/drv/uhci/uhci_struct/transfer_descriptor.h
r01656f2 r3da5eb9 98 98 void transfer_descriptor_init(transfer_descriptor_t *instance, 99 99 int error_count, size_t size, bool isochronous, usb_target_t target, 100 int pid );100 int pid, void *buffer); 101 101 102 102 static inline transfer_descriptor_t * transfer_descriptor_get( 103 int error_count, size_t size, bool isochronous, usb_target_t target, int pid) 103 int error_count, size_t size, bool isochronous, usb_target_t target, 104 int pid, void *buffer) 104 105 { 105 106 transfer_descriptor_t * instance = … … 108 109 if (instance) 109 110 transfer_descriptor_init( 110 instance, error_count, size, isochronous, target, pid );111 instance, error_count, size, isochronous, target, pid, buffer); 111 112 return instance; 112 113 }
Note:
See TracChangeset
for help on using the changeset viewer.