Changeset 67b6fc5 in mainline for uspace/drv
- Timestamp:
- 2011-02-12T03:23:39Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 600733e
- Parents:
- e0df6c2 (diff), 8f5b6561 (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
- Files:
-
- 5 edited
-
uhci-hcd/uhci.h (modified) (1 diff)
-
uhci-rhd/port.c (modified) (2 diffs)
-
usbhid/main.c (modified) (9 diffs)
-
usbhub/usbhub.c (modified) (2 diffs)
-
vhc/hub.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/uhci.h
re0df6c2 r67b6fc5 72 72 73 73 #define UHCI_FRAME_LIST_COUNT 1024 74 #define UHCI_CLEANER_TIMEOUT 10000 0074 #define UHCI_CLEANER_TIMEOUT 10000 75 75 #define UHCI_DEBUGER_TIMEOUT 5000000 76 76 -
uspace/drv/uhci-rhd/port.c
re0df6c2 r67b6fc5 33 33 */ 34 34 #include <errno.h> 35 #include <str_error.h> 35 36 36 37 #include <usb/usb.h> /* usb_address_t */ 37 38 #include <usb/usbdrv.h> /* usb_drv_* */ 38 39 #include <usb/debug.h> 40 #include <usb/recognise.h> 39 41 40 42 #include "port.h" … … 204 206 assert(port->attached_device == 0); 205 207 206 ret = usb_drv_register_child_in_devman(port->hc_phone, port->rh, 207 usb_address, &port->attached_device); 208 208 devman_handle_t hc_handle; 209 ret = usb_drv_find_hc(port->rh, &hc_handle); 210 if (ret != EOK) { 211 usb_log_error("Failed to get handle of host controller: %s.\n", 212 str_error(ret)); 213 uhci_port_set_enabled(port, false); 214 return ENOMEM; 215 } 216 217 ret = usb_device_register_child_in_devman(usb_address, hc_handle, 218 port->rh, &port->attached_device); 209 219 if (ret != EOK) { /* something went wrong */ 210 220 usb_log_error("Failed(%d) in usb_drv_register_child.\n", ret); -
uspace/drv/usbhid/main.c
re0df6c2 r67b6fc5 45 45 #include <str_error.h> 46 46 #include <fibril.h> 47 #include <usb/debug.h> 48 #include <usb/classes/classes.h> 47 49 #include <usb/classes/hid.h> 48 50 #include <usb/classes/hidparser.h> … … 61 63 #define GUESSED_POLL_ENDPOINT 1 62 64 65 /** Keyboard polling endpoint description for boot protocol class. */ 66 static usb_endpoint_description_t poll_endpoint_description = { 67 .transfer_type = USB_TRANSFER_INTERRUPT, 68 .direction = USB_DIRECTION_IN, 69 .interface_class = USB_CLASS_HID, 70 .interface_subclass = USB_HID_SUBCLASS_BOOT, 71 .interface_protocol = USB_HID_PROTOCOL_KEYBOARD, 72 .flags = 0 73 }; 74 63 75 static void default_connection_handler(device_t *, ipc_callid_t, ipc_call_t *); 64 76 static device_ops_t keyboard_ops = { … … 330 342 } 331 343 344 /* 345 * Initialize the interrupt in endpoint. 346 */ 347 usb_endpoint_mapping_t endpoint_mapping[1] = { 348 { 349 .pipe = &kbd_dev->poll_pipe, 350 .description = &poll_endpoint_description 351 } 352 }; 353 rc = usb_endpoint_pipe_initialize_from_configuration( 354 endpoint_mapping, 1, 355 descriptors, config_desc.total_length, 356 &kbd_dev->wire); 357 if (rc != EOK) { 358 usb_log_error("Failed to initialize poll pipe: %s.\n", 359 str_error(rc)); 360 return rc; 361 } 362 if (!endpoint_mapping[0].present) { 363 usb_log_warning("Not accepting device, " \ 364 "not boot-protocol keyboard.\n"); 365 return EREFUSED; 366 } 367 368 369 370 332 371 kbd_dev->conf = (usb_hid_configuration_t *)calloc(1, 333 372 sizeof(usb_hid_configuration_t)); … … 337 376 } 338 377 339 rc = usbkbd_parse_descriptors(descriptors, transferred, kbd_dev->conf);378 /*rc = usbkbd_parse_descriptors(descriptors, transferred, kbd_dev->conf); 340 379 free(descriptors); 341 380 if (rc != EOK) { … … 344 383 } 345 384 346 // get and report descriptors 385 // get and report descriptors*/ 347 386 rc = usbkbd_get_report_descriptor(kbd_dev); 348 387 if (rc != EOK) { … … 361 400 * as the endpoint for polling 362 401 */ 363 402 364 403 return EOK; 365 404 } … … 396 435 if (rc != EOK) { 397 436 printf("Failed to initialize default control pipe: %s.\n", 398 str_error(rc));399 goto error_leave;400 }401 402 rc = usb_endpoint_pipe_initialize(&kbd_dev->poll_pipe, &kbd_dev->wire,403 GUESSED_POLL_ENDPOINT, USB_TRANSFER_INTERRUPT, USB_DIRECTION_IN);404 if (rc != EOK) {405 printf("Failed to initialize interrupt in pipe: %s.\n",406 437 str_error(rc)); 407 438 goto error_leave; … … 418 449 usb_endpoint_pipe_start_session(&kbd_dev->ctrl_pipe); 419 450 //usb_request_set_configuration(&kbd_dev->ctrl_pipe, 1); 420 usbkbd_process_descriptors(kbd_dev);451 rc = usbkbd_process_descriptors(kbd_dev); 421 452 usb_endpoint_pipe_end_session(&kbd_dev->ctrl_pipe); 453 if (rc != EOK) { 454 goto error_leave; 455 } 422 456 423 457 return kbd_dev; … … 577 611 int main(int argc, char *argv[]) 578 612 { 613 usb_log_enable(USB_LOG_LEVEL_INFO, "usbhid"); 579 614 return driver_main(&kbd_driver); 580 615 } -
uspace/drv/usbhub/usbhub.c
re0df6c2 r67b6fc5 36 36 #include <bool.h> 37 37 #include <errno.h> 38 #include <str_error.h> 38 39 39 40 #include <usb_iface.h> 40 41 #include <usb/usbdrv.h> 41 42 #include <usb/descriptor.h> 43 #include <usb/recognise.h> 42 44 #include <usb/devreq.h> 43 45 #include <usb/classes/hub.h> … … 317 319 } 318 320 321 devman_handle_t hc_handle; 322 opResult = usb_drv_find_hc(hub->device, &hc_handle); 323 if (opResult != EOK) { 324 usb_log_error("Failed to get handle of host controller: %s.\n", 325 str_error(opResult)); 326 return; 327 } 328 319 329 devman_handle_t child_handle; 320 opResult = usb_drv_register_child_in_devman(hc, hub->device,321 new_device_address, &child_handle);330 opResult = usb_device_register_child_in_devman(new_device_address, 331 hc_handle, hub->device, &child_handle); 322 332 if (opResult != EOK) { 323 333 dprintf(USB_LOG_LEVEL_ERROR, "could not start driver for new device"); -
uspace/drv/vhc/hub.c
re0df6c2 r67b6fc5 41 41 #include <driver.h> 42 42 #include <usb/usbdrv.h> 43 #include <usb/recognise.h> 43 44 44 45 #include "hub.h" … … 93 94 94 95 devman_handle_t hub_handle; 95 usb_drv_register_child_in_devman(hc, hc_dev, hub_address, &hub_handle); 96 usb_device_register_child_in_devman(hub_address, hc_dev->handle, 97 hc_dev, &hub_handle); 98 //usb_drv_register_child_in_devman(hc, hc_dev, hub_address, &hub_handle); 96 99 usb_drv_bind_address(hc, hub_address, hub_handle); 97 100
Note:
See TracChangeset
for help on using the changeset viewer.
