Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/src/pipesinit.c

    r160b75e r79ae36dd  
    358358        fibril_mutex_initialize(&pipe->guard);
    359359        pipe->wire = connection;
    360         pipe->hc_phone = -1;
    361         fibril_mutex_initialize(&pipe->hc_phone_mutex);
     360        pipe->hc_sess = NULL;
     361        fibril_mutex_initialize(&pipe->hc_sess_mutex);
    362362        pipe->endpoint_no = endpoint_no;
    363363        pipe->transfer_type = transfer_type;
     
    482482        assert(pipe);
    483483        assert(hc_connection);
    484 
    485         if (!usb_hc_connection_is_opened(hc_connection)) {
     484       
     485        if (!usb_hc_connection_is_opened(hc_connection))
    486486                return EBADF;
    487         }
    488 
     487       
    489488#define _PACK2(high, low) (((high) << 16) + (low))
    490489#define _PACK3(high, middle, low) (((((high) << 8) + (middle)) << 8) + (low))
    491 
    492         return async_req_4_0(hc_connection->hc_phone,
    493             DEV_IFACE_ID(USBHC_DEV_IFACE), IPC_M_USBHC_REGISTER_ENDPOINT,
     490       
     491        async_exch_t *exch = async_exchange_begin(hc_connection->hc_sess);
     492        int rc = async_req_4_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
     493            IPC_M_USBHC_REGISTER_ENDPOINT,
    494494            _PACK2(pipe->wire->address, pipe->endpoint_no),
    495495            _PACK3(speed, pipe->transfer_type, pipe->direction),
    496496            _PACK2(pipe->max_packet_size, interval));
    497 
     497        async_exchange_end(exch);
     498       
    498499#undef _PACK2
    499500#undef _PACK3
     501       
     502        return rc;
    500503}
    501504
     
    511514        assert(pipe);
    512515        assert(hc_connection);
    513 
    514         if (!usb_hc_connection_is_opened(hc_connection)) {
     516       
     517        if (!usb_hc_connection_is_opened(hc_connection))
    515518                return EBADF;
    516         }
    517 
    518         return async_req_4_0(hc_connection->hc_phone,
    519             DEV_IFACE_ID(USBHC_DEV_IFACE), IPC_M_USBHC_UNREGISTER_ENDPOINT,
     519       
     520        async_exch_t *exch = async_exchange_begin(hc_connection->hc_sess);
     521        int rc = async_req_4_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
     522            IPC_M_USBHC_UNREGISTER_ENDPOINT,
    520523            pipe->wire->address, pipe->endpoint_no, pipe->direction);
     524        async_exchange_end(exch);
     525       
     526        return rc;
    521527}
    522528
Note: See TracChangeset for help on using the changeset viewer.