Changeset a39cfb8 in mainline for uspace/drv/ohci/root_hub.c
- Timestamp:
- 2011-04-14T07:54:33Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e05d6c3
- Parents:
- 3f3afb9 (diff), 34e8bab (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/root_hub.c
r3f3afb9 ra39cfb8 205 205 * @return Error code. 206 206 */ 207 int rh_init(rh_t *instance, ddf_dev_t *dev,ohci_regs_t *regs) {207 int rh_init(rh_t *instance, ohci_regs_t *regs) { 208 208 assert(instance); 209 //instance->address = -1;210 209 instance->registers = regs; 211 instance->device = dev;212 210 instance->port_count = 213 211 (instance->registers->rh_desc_a >> RHDA_NDS_SHIFT) & RHDA_NDS_MASK; 214 212 rh_init_descriptors(instance); 215 213 // set port power mode to no-power-switching 216 instance->registers->rh_desc_a = 217 instance->registers->rh_desc_a | (1<<9); 214 instance->registers->rh_desc_a |= RHDA_NPS_FLAG; 218 215 219 216 usb_log_info("OHCI root hub with %d ports.\n", instance->port_count); 220 221 //start generic usb hub driver222 223 /* TODO: implement */224 217 return EOK; 225 218 } … … 237 230 assert(request); 238 231 int opResult; 239 if (request-> transfer_type == USB_TRANSFER_CONTROL) {232 if (request->ep->transfer_type == USB_TRANSFER_CONTROL) { 240 233 usb_log_info("Root hub got CONTROL packet\n"); 241 234 opResult = process_ctrl_request(instance, request); 242 } else if (request-> transfer_type == USB_TRANSFER_INTERRUPT) {235 } else if (request->ep->transfer_type == USB_TRANSFER_INTERRUPT) { 243 236 usb_log_info("Root hub got INTERRUPT packet\n"); 244 237 void * buffer; 245 238 create_interrupt_mask(instance, &buffer, 246 239 &(request->transfered_size)); 247 memcpy(request-> transport_buffer, buffer,240 memcpy(request->data_buffer, buffer, 248 241 request->transfered_size); 249 242 opResult = EOK; … … 374 367 if (port < 1 || port > instance->port_count) 375 368 return EINVAL; 376 uint32_t * uint32_buffer = (uint32_t*) request-> transport_buffer;369 uint32_t * uint32_buffer = (uint32_t*) request->data_buffer; 377 370 request->transfered_size = 4; 378 371 uint32_buffer[0] = instance->registers->rh_port_status[port - 1]; … … 400 393 static int process_get_hub_status_request(rh_t *instance, 401 394 usb_transfer_batch_t * request) { 402 uint32_t * uint32_buffer = (uint32_t*) request-> transport_buffer;395 uint32_t * uint32_buffer = (uint32_t*) request->data_buffer; 403 396 request->transfered_size = 4; 404 397 //bits, 0,1,16,17 … … 550 543 } 551 544 request->transfered_size = size; 552 memcpy(request-> transport_buffer, result_descriptor, size);545 memcpy(request->data_buffer, result_descriptor, size); 553 546 if (del) 554 547 free(result_descriptor); … … 571 564 if (request->buffer_size != 1) 572 565 return EINVAL; 573 request-> transport_buffer[0] = 1;566 request->data_buffer[0] = 1; 574 567 request->transfered_size = 1; 575 568 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.