Changeset 7a51d75 in mainline for uspace/drv


Ignore:
Timestamp:
2011-01-28T15:30:42Z (15 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ea991e84
Parents:
c5c003c (diff), 2b96463 (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.
Message:

Merge development/ changes

Location:
uspace/drv
Files:
4 edited

Legend:

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

    rc5c003c r7a51d75  
    4242
    4343usb_general_list_t usb_hub_list;
    44 futex_t usb_hub_list_lock;
     44fibril_mutex_t usb_hub_list_lock;
    4545
    4646static driver_ops_t hub_driver_ops = {
     
    6565{
    6666        usb_dprintf_enable(NAME, 0);
    67 
    68         futex_initialize(&usb_hub_list_lock, 0);
     67       
     68        fibril_mutex_initialize(&usb_hub_list_lock);
     69        fibril_mutex_lock(&usb_hub_list_lock);
    6970        usb_lst_init(&usb_hub_list);
    70         futex_up(&usb_hub_list_lock);
     71        fibril_mutex_unlock(&usb_hub_list_lock);
    7172
    7273        fid_t fid = fibril_create(usb_hub_control_loop, NULL);
  • uspace/drv/usbhub/usbhub.c

    rc5c003c r7a51d75  
    203203
    204204        //add the hub to list
    205         futex_down(&usb_hub_list_lock);
     205        fibril_mutex_lock(&usb_hub_list_lock);
    206206        usb_lst_append(&usb_hub_list, hub_info);
    207         futex_up(&usb_hub_list_lock);
     207        fibril_mutex_unlock(&usb_hub_list_lock);
    208208
    209209        dprintf(1, "hub info added to list");
     
    445445         */
    446446        usb_general_list_t * lst_item;
    447         futex_down(&usb_hub_list_lock);
     447        fibril_mutex_lock(&usb_hub_list_lock);
    448448        for (lst_item = usb_hub_list.next;
    449449                        lst_item != &usb_hub_list;
    450450                        lst_item = lst_item->next) {
    451                 futex_up(&usb_hub_list_lock);
     451                fibril_mutex_unlock(&usb_hub_list_lock);
    452452                usb_hub_info_t * hub_info = ((usb_hub_info_t*)lst_item->data);
    453453                /*
     
    488488
    489489                if (opResult != EOK) {
     490                        free(change_bitmap);
    490491                        dprintf(1, "something went wrong while getting status of hub");
    491492                        continue;
     
    503504
    504505                ipc_hangup(hc);
    505                 futex_down(&usb_hub_list_lock);
    506         }
    507         futex_up(&usb_hub_list_lock);
     506                fibril_mutex_lock(&usb_hub_list_lock);
     507        }
     508        fibril_mutex_unlock(&usb_hub_list_lock);
    508509}
    509510
  • uspace/drv/usbhub/usbhub_private.h

    rc5c003c r7a51d75  
    4343#include <bool.h>
    4444#include <driver.h>
    45 #include <futex.h>
     45#include <fibril_synch.h>
    4646
    4747#include <usb/usb.h>
     
    8282
    8383/** Lock for hub list*/
    84 extern futex_t usb_hub_list_lock;
     84extern fibril_mutex_t usb_hub_list_lock;
    8585
    8686
  • uspace/drv/vhc/hub.c

    rc5c003c r7a51d75  
    6363            = fibril_create(hub_register_in_devman_fibril, hc_dev);
    6464        if (root_hub_registration == 0) {
    65                 printf(NAME ": failed to register root hub\n");
     65                printf(NAME ": failed to create hub registration fibril\n");
    6666                return;
    6767        }
     
    7979        device_t *hc_dev = (device_t *) arg;
    8080
    81         int hc = usb_drv_hc_connect(hc_dev, hc_dev->handle, IPC_FLAG_BLOCKING);
    82         if (hc < 0) {
    83                 printf(NAME ": failed to register root hub\n");
    84                 return hc;
    85         }
     81        int hc;
     82        do {
     83                hc = usb_drv_hc_connect(hc_dev, hc_dev->handle,
     84                    IPC_FLAG_BLOCKING);
     85        } while (hc < 0);
    8686
    8787        usb_drv_reserve_default_address(hc);
Note: See TracChangeset for help on using the changeset viewer.