Changeset 62f4212 in mainline for uspace/drv/usbhub/main.c
- Timestamp:
- 2011-03-22T10:07:53Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f8e4cb6
- Parents:
- 18b3cfd (diff), b01995b (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
r18b3cfd r62f4212 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 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, 44 /** Hub status-change endpoint description. 45 * 46 * For more information see section 11.15.1 of USB 1.1 specification. 47 */ 48 static usb_endpoint_description_t hub_status_change_endpoint_description = { 49 .transfer_type = USB_TRANSFER_INTERRUPT, 50 .direction = USB_DIRECTION_IN, 51 .interface_class = USB_CLASS_HUB, 52 .interface_subclass = 0, 53 .interface_protocol = 0, 54 .flags = 0 47 55 }; 48 56 49 static driver_t hub_driver = { 50 .name = "usbhub", 51 . driver_ops = &hub_driver_ops57 58 static usb_driver_ops_t usb_hub_driver_ops = { 59 .add_device = usb_hub_add_device 52 60 }; 61 62 static usb_endpoint_description_t *usb_hub_endpoints[] = { 63 &hub_status_change_endpoint_description, 64 NULL 65 }; 66 67 static usb_driver_t usb_hub_driver = { 68 .name = NAME, 69 .ops = &usb_hub_driver_ops, 70 .endpoints = usb_hub_endpoints 71 }; 72 53 73 54 74 int main(int argc, char *argv[]) 55 75 { 56 usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME); 57 dprintf(USB_LOG_LEVEL_INFO, "starting hub driver"); 76 printf(NAME ": HelenOS USB hub driver.\n"); 58 77 59 //this is probably not needed anymore 60 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); 78 usb_log_enable(USB_LOG_LEVEL_DEFAULT, NAME); 64 79 65 return ddf_driver_main(&hub_driver);80 return usb_driver_main(&usb_hub_driver); 66 81 } 67 82
Note:
See TracChangeset
for help on using the changeset viewer.