Changeset 6991188 in mainline
- Timestamp:
- 2011-04-11T13:40:00Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d91645ab
- Parents:
- 1a46610 (diff), 9f104af4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- uspace/drv/ohci
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/batch.c
r1a46610 r6991188 145 145 data->tds[i].status, data->tds[i].cbp, data->tds[i].next, 146 146 data->tds[i].be); 147 if (!td_is_finished(&data->tds[i])) 147 if (!td_is_finished(&data->tds[i])) { 148 148 return false; 149 } 149 150 instance->error = td_error(&data->tds[i]); 150 151 /* FIXME: calculate real transfered size */ … … 287 288 288 289 /* data stage */ 289 size_t td_current = 1;290 size_t td_current = 0; 290 291 size_t remain_size = instance->buffer_size; 291 292 char *transfer_buffer = instance->transport_buffer; -
uspace/drv/ohci/hc.c
r1a46610 r6991188 113 113 ret, str_error(ret)); 114 114 hc_init_hw(instance); 115 fibril_mutex_initialize(&instance->guard); 115 116 116 117 rh_init(&instance->rh, dev, instance->registers); … … 135 136 } 136 137 138 fibril_mutex_lock(&instance->guard); 137 139 switch (batch->transfer_type) { 138 140 case USB_TRANSFER_CONTROL: … … 157 159 case USB_TRANSFER_INTERRUPT: 158 160 case USB_TRANSFER_ISOCHRONOUS: 159 instance->registers->control &= ~C_PLE;161 instance->registers->control &= (~C_PLE & ~C_IE); 160 162 transfer_list_add_batch( 161 163 instance->transfers[batch->transfer_type], batch); 162 instance->registers->control |= C_PLE; 164 instance->registers->control |= C_PLE | C_IE; 165 usb_log_debug2("Added periodic transfer: %x.\n", 166 instance->registers->periodic_current); 163 167 break; 164 168 default: 165 169 break; 166 170 } 171 fibril_mutex_unlock(&instance->guard); 167 172 return EOK; 168 173 } … … 178 183 usb_log_debug("OHCI interrupt: %x.\n", status); 179 184 180 181 185 if (status & IS_WDH) { 186 fibril_mutex_lock(&instance->guard); 187 usb_log_debug2("HCCA: %p-%p(%p).\n", instance->hcca, 188 instance->registers->hcca, addr_to_phys(instance->hcca)); 189 usb_log_debug2("Periodic current: %p.\n", 190 instance->registers->periodic_current); 182 191 LIST_INITIALIZE(done); 183 192 transfer_list_remove_finished( … … 197 206 usb_transfer_batch_finish(batch); 198 207 } 208 fibril_mutex_unlock(&instance->guard); 199 209 } 200 210 } … … 208 218 instance->registers->interrupt_status = status; 209 219 hc_interrupt(instance, status); 210 async_usleep( 10000);220 async_usleep(50000); 211 221 } 212 222 return EOK; … … 345 355 SETUP_TRANSFER_LIST(transfers_control, "CONTROL"); 346 356 SETUP_TRANSFER_LIST(transfers_bulk, "BULK"); 347 357 #undef SETUP_TRANSFER_LIST 348 358 transfer_list_set_next(&instance->transfers_interrupt, 349 359 &instance->transfers_isochronous); … … 360 370 361 371 return EOK; 362 #undef CHECK_RET_CLEAR_RETURN363 372 } 364 373 /*----------------------------------------------------------------------------*/ -
uspace/drv/ohci/hc.h
r1a46610 r6991188 69 69 usb_endpoint_manager_t ep_manager; 70 70 fid_t interrupt_emulator; 71 fibril_mutex_t guard; 71 72 } hc_t; 72 73 -
uspace/drv/ohci/hw_struct/hcca.h
r1a46610 r6991188 43 43 uint32_t done_head; 44 44 uint32_t reserved[29]; 45 } __attribute__((packed )) hcca_t;45 } __attribute__((packed, aligned)) hcca_t; 46 46 47 47 #endif -
uspace/drv/ohci/hw_struct/transfer_descriptor.c
r1a46610 r6991188 53 53 } 54 54 if (buffer != NULL) { 55 assert(size != 0); 55 56 instance->cbp = addr_to_phys(buffer); 56 57 instance->be = addr_to_phys(buffer + size - 1); -
uspace/drv/ohci/hw_struct/transfer_descriptor.h
r1a46610 r6991188 86 86 int cc = (instance->status >> TD_STATUS_CC_SHIFT) & TD_STATUS_CC_MASK; 87 87 /* something went wrong, error code is set */ 88 if (cc != CC_NOACCESS1 && cc != CC_NOACCESS2 && cc != CC_NOERROR) {88 if (cc != CC_NOACCESS1 && cc != CC_NOACCESS2) { 89 89 return true; 90 90 } -
uspace/drv/ohci/main.c
r1a46610 r6991188 92 92 int main(int argc, char *argv[]) 93 93 { 94 usb_log_enable(USB_LOG_LEVEL_DE BUG, NAME);94 usb_log_enable(USB_LOG_LEVEL_DEFAULT, NAME); 95 95 sleep(5); 96 96 return ddf_driver_main(&ohci_driver); -
uspace/drv/ohci/ohci_regs.h
r1a46610 r6991188 100 100 #define HCCA_PTR_MASK 0xffffff00 /* HCCA is 256B aligned */ 101 101 102 /** Currently executed period endpoint */103 const volatile uint32_t period _current;102 /** Currently executed periodic endpoint */ 103 const volatile uint32_t periodic_current; 104 104 105 105 /** The first control endpoint */ -
uspace/drv/ohci/transfer_list.c
r1a46610 r6991188 79 79 assert(instance); 80 80 assert(next); 81 /* Set both queue_head.next to point to the follower */82 81 ed_append_ed(instance->list_head, next->list_head); 83 82 } … … 125 124 batch, instance->name, first, batch_ed(first)); 126 125 if (last_ed == instance->list_head) { 127 usb_log_debug2("%s head ED: %x:%x:%x:%x.\n", instance->name, 128 last_ed->status, last_ed->td_tail, last_ed->td_head, 129 last_ed->next); 126 usb_log_debug2("%s head ED(%p-%p): %x:%x:%x:%x.\n", 127 instance->name, last_ed, instance->list_head_pa, 128 last_ed->status, last_ed->td_tail, last_ed->td_head, 129 last_ed->next); 130 130 } 131 131 fibril_mutex_unlock(&instance->guard); -
uspace/drv/ohci/utils/malloc32.h
r1a46610 r6991188 41 41 #include <as.h> 42 42 43 #define UHCI_STRCUTURES_ALIGNMENT 1644 43 #define UHCI_REQUIRED_PAGE_SIZE 4096 45 44 … … 65 64 */ 66 65 static inline void * malloc32(size_t size) 67 { return memalign( UHCI_STRCUTURES_ALIGNMENT, size); }66 { return memalign(size, size); } 68 67 /*----------------------------------------------------------------------------*/ 69 68 /** Physical mallocator simulator
Note:
See TracChangeset
for help on using the changeset viewer.