Changeset 79c8a96 in mainline for uspace/drv/usbhub/main.c
- Timestamp:
- 2011-03-21T10:27:44Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2e1d5d70, c15070c
- Parents:
- 81dce9f (diff), f0fdc7d (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/usbhub/main.c
r81dce9f r79c8a96 36 36 #include <stdio.h> 37 37 38 #include <usb/devdrv.h> 39 #include <usb/classes/classes.h> 40 38 41 #include "usbhub.h" 39 42 #include "usbhub_private.h" 40 43 41 44 42 usb_general_list_t usb_hub_list; 43 fibril_mutex_t usb_hub_list_lock; 44 45 static driver_ops_t hub_driver_ops = { 46 .add_device = usb_add_hub_device, 45 usb_endpoint_description_t hub_status_change_endpoint_description = { 46 .transfer_type = USB_TRANSFER_INTERRUPT, 47 .direction = USB_DIRECTION_IN, 48 .interface_class = USB_CLASS_HUB, 49 .interface_subclass = 0, 50 .interface_protocol = 0, 51 .flags = 0 47 52 }; 48 53 49 static driver_t hub_driver = { 54 55 static usb_driver_ops_t usb_hub_driver_ops = { 56 .add_device = usb_hub_add_device 57 }; 58 59 static usb_driver_t usb_hub_driver = { 50 60 .name = "usbhub", 51 . driver_ops = &hub_driver_ops61 .ops = &usb_hub_driver_ops 52 62 }; 63 53 64 54 65 int main(int argc, char *argv[]) 55 66 { 56 67 usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME); 57 dprintf(USB_LOG_LEVEL_INFO, "starting hub driver");68 usb_log_info("starting hub driver\n"); 58 69 59 //this is probably not needed anymore60 fibril_mutex_initialize(&usb_hub_list_lock);61 fibril_mutex_lock(&usb_hub_list_lock);62 usb_lst_init(&usb_hub_list);63 fibril_mutex_unlock(&usb_hub_list_lock);64 70 65 return ddf_driver_main(&hub_driver); 71 usb_hub_driver.endpoints = (usb_endpoint_description_t**) 72 malloc(2 * sizeof(usb_endpoint_description_t*)); 73 usb_hub_driver.endpoints[0] = &hub_status_change_endpoint_description; 74 usb_hub_driver.endpoints[1] = NULL; 75 76 return usb_driver_main(&usb_hub_driver); 66 77 } 67 78
Note:
See TracChangeset
for help on using the changeset viewer.