Changeset 44d8853 in mainline
- Timestamp:
- 2011-01-28T23:51:36Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4046c1ea, c8ca07e
- Parents:
- e68de30
- Location:
- uspace/drv/uhci
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci/callback.c
re68de30 r44d8853 9 9 assert(instance); 10 10 assert(func_in == NULL || func_out == NULL); 11 instance->new_buffer = malloc32(size); 12 if (!instance->new_buffer) { 13 uhci_print_error("Failed to allocate device acessible buffer.\n"); 14 return ENOMEM; 11 if (size > 0) { 12 instance->new_buffer = malloc32(size); 13 if (!instance->new_buffer) { 14 uhci_print_error("Failed to allocate device acessible buffer.\n"); 15 return ENOMEM; 16 } 17 if (func_out) 18 memcpy(instance->new_buffer, buffer, size); 19 } else { 20 instance->new_buffer = NULL; 15 21 } 16 22 17 if (func_out)18 memcpy(instance->new_buffer, buffer, size);19 23 20 24 instance->callback_out = func_out; -
uspace/drv/uhci/uhci.c
re68de30 r44d8853 175 175 assert(instance); 176 176 177 uhci_print_verbose("Appending a new transfer to queue.\n"); 177 178 ret = transfer_list_append(&instance->transfers[transfer_type], td); 178 179 CHECK_RET_TRANS_FREE_JOB_TD("Failed to append transfer descriptor.\n"); … … 226 227 uint16_t reg; 227 228 reg = pio_read_16(&instance->registers->usbcmd); 228 uhci_print_ verbose("Command register: %X\n", reg);229 uhci_print_info("Command register: %X\n", reg); 229 230 reg = pio_read_16(&instance->registers->usbsts); 230 uhci_print_ verbose("Status register: %X\n", reg);231 uhci_print_info("Status register: %X\n", reg); 231 232 /* 232 233 uintptr_t frame_list = pio_read_32(&instance->registers->flbaseadd); -
uspace/drv/uhci/uhci_struct/transfer_descriptor.c
re68de30 r44d8853 27 27 uhci_print_verbose("Creating device field: %x.\n", instance->device); 28 28 29 instance->buffer_ptr = (uintptr_t)addr_to_phys(buffer); 29 if (size) { 30 instance->buffer_ptr = (uintptr_t)addr_to_phys(buffer); 30 31 31 uhci_print_verbose("Creating buffer field: %p(%p).\n",32 32 uhci_print_verbose("Creating buffer field: %p(%p).\n", 33 buffer, instance->buffer_ptr); 33 34 34 char * buff = buffer; 35 if (size >= 8) { 36 char * buff = buffer; 35 37 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]); 38 uhci_print_verbose("Buffer dump(8B): %x %x %x %x %x %x %x %x.\n", 39 buff[0], buff[1], buff[2], buff[3], buff[4], buff[5], buff[6], buff[7]); 40 } 41 } else { 42 instance->buffer_ptr = 0; 43 } 38 44 39 45 instance->next_va = NULL; 40 46 instance->callback = NULL; 47 uhci_print_info("Created a new TD.\n"); 41 48 } 42 49 … … 74 81 callback_run(instance->callback, 75 82 convert_outcome(instance->status), 76 instance->status >> TD_STATUS_ACTLEN_POS& TD_STATUS_ACTLEN_MASK83 ((instance->status >> TD_STATUS_ACTLEN_POS) + 1) & TD_STATUS_ACTLEN_MASK 77 84 ); 78 85 }
Note:
See TracChangeset
for help on using the changeset viewer.