Changeset 186d630 in mainline for uspace/lib/usbvirt/main.c


Ignore:
Timestamp:
2010-10-20T20:44:55Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bbfb86c
Parents:
47e3a8e
Message:

libusbvirt allows local device

By local device is meant virtual device in current task
(i.e. not connected through phones but called statically).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbvirt/main.c

    r47e3a8e r186d630  
    6969        }
    7070       
    71         handle_incoming_data(endpoint, buffer, len);
     71        device->receive_data(device, endpoint, buffer, len);
    7272       
    7373        free(buffer);
     
    104104{
    105105        dev->send_data = usbvirt_data_to_host;
     106        dev->receive_data = handle_incoming_data;
    106107        dev->state = USBVIRT_STATE_DEFAULT;
    107108        dev->address = 0;
     
    160161 * @param hcd_path HCD identification under devfs
    161162 *     (without <code>/dev/usb/</code>).
    162  * @param device_id Internal device identification (used by HCD).
    163  * @param callback Handler for callbacks from HCD.
     163 * @param dev Device to connect.
    164164 * @return EOK on success or error code from errno.h.
    165165 */
     
    197197}
    198198
    199 
     199/** Prepares device as local.
     200 * This is useful if you want to have a virtual device in the same task
     201 * as HCD.
     202 *
     203 * @param dev Device to connect.
     204 * @return Always EOK.
     205 */
     206int usbvirt_connect_local(usbvirt_device_t *dev)
     207{
     208        dev->vhcd_phone_ = -1;
     209        device_init(dev);
     210       
     211        return EOK;
     212}
     213
     214/** Disconnects device from HCD.
     215 *
     216 * @return Always EOK.
     217 */
    200218int usbvirt_disconnect(void)
    201219{
Note: See TracChangeset for help on using the changeset viewer.