Changeset 48ae3ef in mainline for uspace/drv/bus/usb/vhc


Ignore:
Timestamp:
2011-10-28T21:52:15Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
57e06ef
Parents:
7265558
Message:

libusbhost: Make interfaces more symmetric.

Make usb_endpoint_manager interface easier to use and understand.
Move ep removal hook pointer from endpoint_t to hcd_t.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/vhc/connhost.c

    r7265558 r48ae3ef  
    140140    size_t max_packet_size, unsigned int interval)
    141141{
    142         /* TODO: Use usb_endpoint_manager_add_ep */
    143         VHC_DATA(vhc, fun);
    144 
    145         endpoint_t *ep = endpoint_create(
    146             address, endpoint, direction, transfer_type, USB_SPEED_FULL, 1, 0);
    147         if (ep == NULL) {
    148                 return ENOMEM;
    149         }
    150 
    151         int rc = usb_endpoint_manager_register_ep(&vhc->ep_manager, ep, 1);
    152         if (rc != EOK) {
    153                 endpoint_destroy(ep);
    154                 return rc;
    155         }
    156 
    157         return EOK;
     142        VHC_DATA(vhc, fun);
     143
     144        return usb_endpoint_manager_add_ep(&vhc->ep_manager,
     145            address, endpoint, direction, transfer_type, USB_SPEED_FULL, 1, 0,
     146            NULL, NULL);
     147
    158148}
    159149
     
    171161        VHC_DATA(vhc, fun);
    172162
    173         int rc = usb_endpoint_manager_unregister_ep(&vhc->ep_manager,
    174             address, endpoint, direction);
     163        int rc = usb_endpoint_manager_remove_ep(&vhc->ep_manager,
     164            address, endpoint, direction, NULL, NULL);
    175165
    176166        return rc;
     
    413403        VHC_DATA(vhc, fun);
    414404
    415         endpoint_t *ep = usb_endpoint_manager_get_ep(&vhc->ep_manager,
     405        endpoint_t *ep = usb_endpoint_manager_find_ep(&vhc->ep_manager,
    416406            target.address, target.endpoint, USB_DIRECTION_IN);
    417407        if (ep == NULL) {
     
    455445        VHC_DATA(vhc, fun);
    456446
    457         endpoint_t *ep = usb_endpoint_manager_get_ep(&vhc->ep_manager,
     447        endpoint_t *ep = usb_endpoint_manager_find_ep(&vhc->ep_manager,
    458448            target.address, target.endpoint, USB_DIRECTION_OUT);
    459449        if (ep == NULL) {
Note: See TracChangeset for help on using the changeset viewer.