Changeset 7265558 in mainline for uspace/drv/bus/usb/uhci/hc.c


Ignore:
Timestamp:
2011-10-28T20:53:41Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
48ae3ef
Parents:
83c3123
Message:

libusbhost: Drop hash_table and use multiple lists instead.

This has several advantages:
Knowing that all endpoints on one address are in one list makes toggle resets more efficient.
Endpoint search is done only once for inserts and deletes.
Lists are part of the structure and not allocated separately, removing one more failure point from init path.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/uhci/hc.c

    r83c3123 r7265558  
    192192            "Device registers at %p (%zuB) accessible.\n", io, reg_size);
    193193
    194         ret = hcd_init(&instance->generic, BANDWIDTH_AVAILABLE_USB11,
     194        ret = hc_init_mem_structures(instance);
     195        CHECK_RET_RETURN(ret,
     196            "Failed to initialize UHCI memory structures: %s.\n",
     197            str_error(ret));
     198
     199#undef CHECK_RET_RETURN
     200
     201        hcd_init(&instance->generic, BANDWIDTH_AVAILABLE_USB11,
    195202            bandwidth_count_usb11);
    196         CHECK_RET_RETURN(ret, "Failed to initialize HCD generic driver: %s.\n",
    197             str_error(ret));
    198203
    199204        instance->generic.private_data = instance;
    200205        instance->generic.schedule = hc_schedule;
    201206        instance->generic.ep_add_hook = NULL;
    202 
    203 #undef CHECK_RET_DEST_FUN_RETURN
    204 
    205         ret = hc_init_mem_structures(instance);
    206         if (ret != EOK) {
    207                 usb_log_error(
    208                     "Failed to initialize UHCI memory structures: %s.\n",
    209                     str_error(ret));
    210                 hcd_destroy(&instance->generic);
    211                 return ret;
    212         }
    213207
    214208        hc_init_hw(instance);
Note: See TracChangeset for help on using the changeset viewer.