Changes in uspace/drv/usbhub/main.c [5097bed4:dff940f8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/main.c
r5097bed4 rdff940f8 27 27 */ 28 28 29 #include <driver.h> 29 /** @addtogroup drvusbhub 30 * @{ 31 */ 32 33 #include <ddf/driver.h> 30 34 #include <errno.h> 31 35 #include <async.h> 32 33 #include <usb/usbdrv.h> 36 #include <stdio.h> 34 37 35 38 #include "usbhub.h" … … 38 41 39 42 usb_general_list_t usb_hub_list; 40 f utex_t usb_hub_list_lock;43 fibril_mutex_t usb_hub_list_lock; 41 44 42 45 static driver_ops_t hub_driver_ops = { … … 49 52 }; 50 53 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; 54 int main(int argc, char *argv[]) 55 { 56 usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME); 57 dprintf(USB_LOG_LEVEL_INFO, "starting hub driver"); 58 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); 57 66 } 58 67 68 /** 69 * @} 70 */ 59 71 60 int main(int argc, char *argv[])61 {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);73 74 return driver_main(&hub_driver);75 }
Note:
See TracChangeset
for help on using the changeset viewer.