Ignore:
File:
1 edited

Legend:

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

    r79ae36dd r160b75e  
    358358        fibril_mutex_initialize(&pipe->guard);
    359359        pipe->wire = connection;
    360         pipe->hc_sess = NULL;
    361         fibril_mutex_initialize(&pipe->hc_sess_mutex);
     360        pipe->hc_phone = -1;
     361        fibril_mutex_initialize(&pipe->hc_phone_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        
     487        }
     488
    488489#define _PACK2(high, low) (((high) << 16) + (low))
    489490#define _PACK3(high, middle, low) (((((high) << 8) + (middle)) << 8) + (low))
    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,
     491
     492        return async_req_4_0(hc_connection->hc_phone,
     493            DEV_IFACE_ID(USBHC_DEV_IFACE), 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         async_exchange_end(exch);
    498        
     497
    499498#undef _PACK2
    500499#undef _PACK3
    501        
    502         return rc;
    503500}
    504501
     
    514511        assert(pipe);
    515512        assert(hc_connection);
    516        
    517         if (!usb_hc_connection_is_opened(hc_connection))
     513
     514        if (!usb_hc_connection_is_opened(hc_connection)) {
    518515                return EBADF;
    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,
     516        }
     517
     518        return async_req_4_0(hc_connection->hc_phone,
     519            DEV_IFACE_ID(USBHC_DEV_IFACE), IPC_M_USBHC_UNREGISTER_ENDPOINT,
    523520            pipe->wire->address, pipe->endpoint_no, pipe->direction);
    524         async_exchange_end(exch);
    525        
    526         return rc;
    527521}
    528522
Note: See TracChangeset for help on using the changeset viewer.