Changeset 7013b14 in mainline
- Timestamp:
- 2011-04-13T14:19:12Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d6522dd
- Parents:
- 9a6fde4
- Location:
- uspace/drv/ohci
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/batch.c
r9a6fde4 r7013b14 169 169 } 170 170 /*----------------------------------------------------------------------------*/ 171 void batch_commit(usb_transfer_batch_t *instance) 172 { 173 assert(instance); 174 ohci_transfer_batch_t *data = instance->private_data; 175 assert(data); 176 ed_set_end_td(data->ed, data->tds[data->td_count]); 177 } 178 /*----------------------------------------------------------------------------*/ 171 179 void batch_control_write(usb_transfer_batch_t *instance) 172 180 { -
uspace/drv/ohci/batch.h
r9a6fde4 r7013b14 52 52 bool batch_is_complete(usb_transfer_batch_t *instance); 53 53 54 void batch_commit(usb_transfer_batch_t *instance); 55 54 56 void batch_control_write(usb_transfer_batch_t *instance); 55 57 -
uspace/drv/ohci/endpoint_list.c
r9a6fde4 r7013b14 191 191 assert(hcd_ep); 192 192 assert(hcd_ep->ed); 193 assert(fibril_mutex_is_locked(&instance->guard)); 193 194 fibril_mutex_lock(&instance->guard); 194 195 195 196 usb_log_debug2( … … 218 219 /* Remove from the endpoint list */ 219 220 list_remove(&hcd_ep->link); 221 fibril_mutex_unlock(&instance->guard); 220 222 } 221 223 /** -
uspace/drv/ohci/hc.c
r9a6fde4 r7013b14 109 109 ret, str_error(ret)); 110 110 111 instance->ddf_instance = fun;112 111 usb_device_keeper_init(&instance->manager); 113 112 ret = usb_endpoint_manager_init(&instance->ep_manager, … … 130 129 fibril_add_ready(instance->interrupt_emulator); 131 130 } 131 132 list_initialize(&instance->pending_batches); 132 133 #undef CHECK_RET_RETURN 133 134 return EOK; … … 262 263 return rh_request(&instance->rh, batch); 263 264 } 264 #if 0 265 265 266 fibril_mutex_lock(&instance->guard); 267 list_append(&batch->link, &instance->pending_batches); 268 batch_commit(batch); 266 269 switch (batch->ep->transfer_type) { 267 270 case USB_TRANSFER_CONTROL: 268 instance->registers->control &= ~C_CLE;269 transfer_list_add_batch(270 instance->transfers[batch->ep->transfer_type], batch);271 271 instance->registers->command_status |= CS_CLF; 272 usb_log_debug2("Set CS control transfer filled: %x.\n",273 instance->registers->command_status);274 instance->registers->control_current = 0;275 instance->registers->control |= C_CLE;276 272 break; 277 273 case USB_TRANSFER_BULK: 278 instance->registers->control &= ~C_BLE;279 transfer_list_add_batch(280 instance->transfers[batch->ep->transfer_type], batch);281 274 instance->registers->command_status |= CS_BLF; 282 usb_log_debug2("Set bulk transfer filled: %x.\n",283 instance->registers->command_status);284 instance->registers->control |= C_BLE;285 break;286 case USB_TRANSFER_INTERRUPT:287 case USB_TRANSFER_ISOCHRONOUS:288 instance->registers->control &= (~C_PLE & ~C_IE);289 transfer_list_add_batch(290 instance->transfers[batch->ep->transfer_type], batch);291 instance->registers->control |= C_PLE | C_IE;292 usb_log_debug2("Added periodic transfer: %x.\n",293 instance->registers->periodic_current);294 275 break; 295 276 default: 296 277 break; 297 278 } 279 298 280 fibril_mutex_unlock(&instance->guard); 299 #endif300 281 return EOK; 301 282 } … … 317 298 usb_log_debug2("Periodic current: %p.\n", 318 299 instance->registers->periodic_current); 319 #if 0 320 LIST_INITIALIZE(done); 321 transfer_list_remove_finished( 322 &instance->transfers_interrupt, &done); 323 transfer_list_remove_finished( 324 &instance->transfers_isochronous, &done); 325 transfer_list_remove_finished( 326 &instance->transfers_control, &done); 327 transfer_list_remove_finished( 328 &instance->transfers_bulk, &done); 329 330 while (!list_empty(&done)) { 331 link_t *item = done.next; 332 list_remove(item); 300 301 link_t *current = instance->pending_batches.next; 302 while (current != &instance->pending_batches) { 303 link_t *next = current->next; 333 304 usb_transfer_batch_t *batch = 334 list_get_instance(item, usb_transfer_batch_t, link); 335 usb_transfer_batch_finish(batch); 305 usb_transfer_batch_from_link(current); 306 307 if (batch_is_complete(batch)) { 308 usb_transfer_batch_finish(batch); 309 } 310 current = next; 336 311 } 337 312 fibril_mutex_unlock(&instance->guard); 338 #endif339 313 } 340 314 } -
uspace/drv/ohci/hc.h
r9a6fde4 r7013b14 53 53 typedef struct hc { 54 54 ohci_regs_t *registers; 55 hcca_t *hcca; 56 55 57 usb_address_t rh_address; 56 58 rh_t rh; 57 59 58 hcca_t *hcca; 60 endpoint_list_t lists[4]; 61 link_t pending_batches; 59 62 60 endpoint_list_t lists[4];61 62 ddf_fun_t *ddf_instance;63 63 usb_device_keeper_t manager; 64 64 usb_endpoint_manager_t ep_manager; … … 80 80 int hc_add_endpoint(hc_t *instance, usb_address_t address, usb_endpoint_t ep, 81 81 usb_speed_t speed, usb_transfer_type_t type, usb_direction_t direction, 82 82 size_t max_packet_size, size_t size, unsigned interval); 83 83 84 84 int hc_remove_endpoint(hc_t *instance, usb_address_t address,
Note:
See TracChangeset
for help on using the changeset viewer.