Changeset 94fbf78 in mainline


Ignore:
Timestamp:
2013-01-15T19:55:03Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
16b64b8
Parents:
1c73603
Message:

libdrv: Add function for creating direct connections to devices.

Location:
uspace/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/remote_usb.c

    r1c73603 r94fbf78  
    4242#include "ddf/driver.h"
    4343
    44 usb_dev_session_t *usb_dev_connect(ddf_dev_t *parent)
     44
     45usb_dev_session_t *usb_dev_connect(devman_handle_t handle)
    4546{
    4647        // TODO All usb requests are atomic so this is safe,
    47         // it will need to change once USING EXCHNAGE PARALLEL is safe with
     48        // it will need to change once USING EXCHANGE PARALLEL is safe with
     49        // devman_device_connect
     50        return devman_device_connect(EXCHANGE_ATOMIC, handle, IPC_FLAG_BLOCKING);
     51}
     52
     53usb_dev_session_t *usb_dev_connect_to_self(ddf_dev_t *dev)
     54{
     55        // TODO All usb requests are atomic so this is safe,
     56        // it will need to change once USING EXCHANGE PARALLEL is safe with
    4857        // devman_parent_device_connect
    4958        return devman_parent_device_connect(EXCHANGE_ATOMIC,
    50             ddf_dev_get_handle(parent), IPC_FLAG_BLOCKING);
     59            ddf_dev_get_handle(dev), IPC_FLAG_BLOCKING);
    5160}
    5261
  • uspace/lib/drv/include/usb_iface.h

    r1c73603 r94fbf78  
    4848typedef async_sess_t usb_dev_session_t;
    4949
    50 usb_dev_session_t *usb_dev_connect(ddf_dev_t *dev);
     50usb_dev_session_t *usb_dev_connect(devman_handle_t);
     51usb_dev_session_t *usb_dev_connect_to_self(ddf_dev_t *);
    5152void usb_dev_session_close(usb_dev_session_t *);
    5253
  • uspace/lib/usbdev/src/devdrv.c

    r1c73603 r94fbf78  
    411411        usb_dev->pipes = NULL;
    412412
    413         usb_dev->bus_session = usb_dev_connect(ddf_dev);
     413        usb_dev->bus_session = usb_dev_connect_to_self(ddf_dev);
    414414        if (!usb_dev->bus_session) {
    415415                *errstr_ptr = "device bus session create";
Note: See TracChangeset for help on using the changeset viewer.