Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhub/main.c

    rdff940f8 r0f21c0c  
    3131 */
    3232
    33 #include <ddf/driver.h>
     33#include <driver.h>
    3434#include <errno.h>
    3535#include <async.h>
    36 #include <stdio.h>
    3736
    3837#include "usbhub.h"
     
    5251};
    5352
     53int usb_hub_control_loop(void * noparam){
     54        while(true){
     55                usb_hub_check_hub_changes();
     56                async_usleep(1000 * 1000 );/// \TODO proper number once
     57        }
     58        return 0;
     59}
     60
     61
    5462int main(int argc, char *argv[])
    5563{
    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
     64        usb_log_enable(USB_LOG_LEVEL_INFO, NAME);
     65       
    6066        fibril_mutex_initialize(&usb_hub_list_lock);
    6167        fibril_mutex_lock(&usb_hub_list_lock);
    6268        usb_lst_init(&usb_hub_list);
    6369        fibril_mutex_unlock(&usb_hub_list_lock);
    64        
    65         return ddf_driver_main(&hub_driver);
     70
     71        fid_t fid = fibril_create(usb_hub_control_loop, NULL);
     72        if (fid == 0) {
     73                fprintf(stderr, NAME ": failed to start monitoring fibril," \
     74                    " driver aborting.\n");
     75                return ENOMEM;
     76        }
     77        fibril_add_ready(fid);
     78
     79        return driver_main(&hub_driver);
    6680}
    6781
Note: See TracChangeset for help on using the changeset viewer.