Changeset 5595841 in mainline for uspace/lib/drv/include/usbhc_iface.h


Ignore:
Timestamp:
2018-01-31T16:02:34Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3b60ea0
Parents:
2b3dd78
git-author:
Ondřej Hlavatý <aearsis@…> (2018-01-31 15:49:24)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-01-31 16:02:34)
Message:

libdrv: usbhc_iface now shares memory instead of sending data

Two more things that come along:
1) The two callbacks (read, write) were joined. As they were joined in

the only implementation (ddf_helpers) anyway, and now the code is
almost the same, we took the opportunity and joined them. The bad
thing about it is that there are not enough IPC arguments to
transfer the direction, so we still have to use two "interface IPC
methods".

2) The copying is still done by the former methods (usbhc_read and

usbhc_write) to ensure the page alignment, so this method just
moves the burden of copying from kernel to the caller (which is why
this is actually a performance regression).

But, the two sides can now resolve their issues separately. The caller
can prepare the memory area in advance, and HC can use the memory
directly if it can.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/include/usbhc_iface.h

    r2b3dd78 r5595841  
    148148extern errno_t usbhc_unregister_endpoint(async_exch_t *, const usb_pipe_desc_t *);
    149149
     150extern errno_t usbhc_transfer(async_exch_t *, usb_endpoint_t, usb_direction_t,
     151    uint64_t, void *, size_t, size_t *);
    150152extern errno_t usbhc_read(async_exch_t *, usb_endpoint_t, uint64_t, void *, size_t,
    151153    size_t *);
     
    166168        int (*unregister_endpoint)(ddf_fun_t *, const usb_pipe_desc_t *);
    167169
    168         errno_t (*read)(ddf_fun_t *, usb_target_t,
    169                 uint64_t, char *, size_t,
    170                 usbhc_iface_transfer_callback_t, void *);
    171         errno_t (*write)(ddf_fun_t *, usb_target_t,
    172                 uint64_t, const char *, size_t,
     170        errno_t (*transfer)(ddf_fun_t *, usb_target_t,
     171                usb_direction_t, uint64_t, char *, size_t,
    173172                usbhc_iface_transfer_callback_t, void *);
    174173} usbhc_iface_t;
Note: See TracChangeset for help on using the changeset viewer.