Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 11e9e613 in mainline


Ignore:
Timestamp:
2013-01-27T19:14:46Z (9 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
48fa501
Parents:
d3a1ad58
Message:

libusbdev: Switch pipes to register via usb session.

File:
1 edited

Legend:

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

    rd3a1ad58 r11e9e613  
    318318{
    319319        assert(pipe);
    320         assert(pipe->wire);
    321 
    322         return usb_device_register_endpoint(pipe->wire,
    323            pipe->endpoint_no, pipe->transfer_type,
    324            pipe->direction, pipe->max_packet_size, interval);
     320        assert(pipe->bus_session);
     321        async_exch_t *exch = async_exchange_begin(pipe->bus_session);
     322        if (!exch)
     323                return ENOMEM;
     324        const int ret = usb_register_endpoint(exch, pipe->endpoint_no,
     325            pipe->transfer_type, pipe->direction, pipe->max_packet_size,
     326            interval);
     327        async_exchange_end(exch);
     328        return ret;
    325329}
    326330
     
    333337{
    334338        assert(pipe);
    335         assert(pipe->wire);
    336 
    337         return usb_device_unregister_endpoint(pipe->wire,
    338             pipe->endpoint_no, pipe->direction);
     339        assert(pipe->bus_session);
     340        async_exch_t *exch = async_exchange_begin(pipe->bus_session);
     341        if (!exch)
     342                return ENOMEM;
     343        const int ret = usb_unregister_endpoint(exch, pipe->endpoint_no,
     344            pipe->direction);
     345        async_exchange_end(exch);
     346        return ret;
    339347}
    340348
Note: See TracChangeset for help on using the changeset viewer.