Changeset 7e1b130 in mainline for uspace/lib/usb/src/ddfiface.c


Ignore:
Timestamp:
2011-12-23T18:13:33Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3819ce5, b39eb79, f0b74b2
Parents:
2f0dd2a (diff), 153cc76a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

USB branch changes.

+ USB device drivers use single async session to host controller, this session (represented by usb_hc_connection_t) is used for both HC requests and to back usb device connection.
+ Pipe locking was removed. Reference counting was moved to usb_hc_connection_t. Every read/write operation uses separate parallel exchange thus any contention is resolved on hc side.

  • async_sess_t setup using EXCHANGE_PARALLEL uses one extra phone (session phone, each exch creates its own), thus the number of phones used by usb dvice driver might increase. Possible solutions are: make read/write calls atomic (all other calls are atomic) and use EXCHANGE_ATOMIC, any other solution provided by changes to async_sess_t.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/ddfiface.c

    r2f0dd2a r7e1b130  
    4444#include <assert.h>
    4545
     46#include <usb/dev.h>
     47
    4648/** DDF interface for USB device, implementation for typical hub. */
    4749usb_iface_t usb_iface_hub_impl = {
     
    6668{
    6769        assert(fun);
    68         return usb_hc_find(fun->handle, handle);
     70        return usb_get_hc_by_handle(fun->handle, handle);
    6971}
    7072
     
    9799{
    98100        assert(fun);
    99 
    100         async_sess_t *parent_sess =
    101             devman_parent_device_connect(EXCHANGE_SERIALIZE, fun->handle,
    102             IPC_FLAG_BLOCKING);
    103         if (!parent_sess)
    104                 return ENOMEM;
    105 
    106         async_exch_t *exch = async_exchange_begin(parent_sess);
    107         if (!exch) {
    108                 async_hangup(parent_sess);
    109                 return ENOMEM;
    110         }
    111 
    112         const int ret = usb_get_my_address(exch, address);
    113 
    114         async_exchange_end(exch);
    115         async_hangup(parent_sess);
    116 
    117         return ret;
     101        return usb_get_address_by_handle(fun->handle, address);
    118102}
    119103
     
    134118        assert(fun);
    135119        assert(fun->driver_data);
    136         usb_hub_attached_device_t *device = fun->driver_data;
     120        const usb_hub_attached_device_t *device = fun->driver_data;
    137121        assert(device->fun == fun);
    138122        if (address)
Note: See TracChangeset for help on using the changeset viewer.