Changes in uspace/drv/usbhub/main.c [dff940f8:5097bed4] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/main.c
rdff940f8 r5097bed4 27 27 */ 28 28 29 /** @addtogroup drvusbhub 30 * @{ 31 */ 32 33 #include <ddf/driver.h> 29 #include <driver.h> 34 30 #include <errno.h> 35 31 #include <async.h> 36 #include <stdio.h> 32 33 #include <usb/usbdrv.h> 37 34 38 35 #include "usbhub.h" … … 41 38 42 39 usb_general_list_t usb_hub_list; 43 f ibril_mutex_t usb_hub_list_lock;40 futex_t usb_hub_list_lock; 44 41 45 42 static driver_ops_t hub_driver_ops = { … … 52 49 }; 53 50 51 int usb_hub_control_loop(void * noparam){ 52 while(true){ 53 usb_hub_check_hub_changes(); 54 async_usleep(1000 * 1000); 55 } 56 return 0; 57 } 58 59 54 60 int main(int argc, char *argv[]) 55 61 { 56 usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME); 57 dprintf(USB_LOG_LEVEL_INFO, "starting hub driver"); 62 usb_dprintf_enable(NAME,1); 63 futex_initialize(&usb_hub_list_lock, 0); 64 usb_lst_init(&usb_hub_list); 65 futex_up(&usb_hub_list_lock); 66 fid_t fid = fibril_create(usb_hub_control_loop, NULL); 67 if (fid == 0) { 68 dprintf(1, "failed to start fibril for HUB devices"); 69 //printf("%s: failed to start fibril for HUB devices\n", NAME); 70 return ENOMEM; 71 } 72 fibril_add_ready(fid); 58 73 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); 64 65 return ddf_driver_main(&hub_driver); 74 return driver_main(&hub_driver); 66 75 } 67 68 /**69 * @}70 */71
Note:
See TracChangeset
for help on using the changeset viewer.