Ignore:
Timestamp:
2011-02-22T23:30:56Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3b5d1535, a9c674e0
Parents:
dbe25f1 (diff), 664af708 (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:

Merge mainline changes (DDF refactoring)

This merge includes DDF refactoring that brought multifunctional devices
(i.e. ddf_dev_t and ddf_fun_t). Please, see ticket #295 at HelenOS
upstream Trac.

The conflicts themselves were easy to solve (merely several renamings).

Changes to USB subsystem:

  • drivers uses ddf_dev_t and ddf_fun_t
  • different signatures of many library functions
  • several hacks around communication with parent device (now the communication is clearer and somehow what we have now is hack about other hacks)
    • will repair and clean later
  • maybe added some extra debugging messages (the diff has about 240K, and I admit I have no energy to double check that)

WARNING:

  • the diff is VERY long, recommended is viewing partial diffs of the merge (i.e. merges in mainline branch that lead to the parent one)
  • merging with your branches might involve huge renamings, sorry, no other way is possible

BUGS:

  • hub driver will not work (no function created)

GOOD NEWS:

  • QEMU keyboard seems to work with QEMU 0.13 and 0.14
  • we are up-to-date with mainline again
File:
1 edited

Legend:

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

    rdbe25f1 reb1a2f4  
    3535#include <async.h>
    3636#include <errno.h>
     37#include <assert.h>
    3738
    3839#include "usbhc_iface.h"
    39 #include "driver.h"
     40#include "ddf/driver.h"
    4041
    4142#define USB_MAX_PAYLOAD_SIZE 1020
     
    4344#define HACK_MAX_PACKET_SIZE_INTERRUPT_IN 4
    4445
    45 static void remote_usbhc_interrupt_out(device_t *, void *, ipc_callid_t, ipc_call_t *);
    46 static void remote_usbhc_interrupt_in(device_t *, void *, ipc_callid_t, ipc_call_t *);
    47 static void remote_usbhc_bulk_out(device_t *, void *, ipc_callid_t, ipc_call_t *);
    48 static void remote_usbhc_bulk_in(device_t *, void *, ipc_callid_t, ipc_call_t *);
    49 static void remote_usbhc_control_write(device_t *, void *, ipc_callid_t, ipc_call_t *);
    50 static void remote_usbhc_control_read(device_t *, void *, ipc_callid_t, ipc_call_t *);
    51 static void remote_usbhc_reserve_default_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
    52 static void remote_usbhc_release_default_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
    53 static void remote_usbhc_request_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
    54 static void remote_usbhc_bind_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
    55 static void remote_usbhc_release_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
    56 //static void remote_usbhc(device_t *, void *, ipc_callid_t, ipc_call_t *);
     46static void remote_usbhc_interrupt_out(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     47static void remote_usbhc_interrupt_in(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     48static void remote_usbhc_bulk_out(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     49static void remote_usbhc_bulk_in(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     50static void remote_usbhc_control_write(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     51static void remote_usbhc_control_read(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     52static void remote_usbhc_reserve_default_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     53static void remote_usbhc_release_default_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     54static void remote_usbhc_request_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     55static void remote_usbhc_bind_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     56static void remote_usbhc_release_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     57//static void remote_usbhc(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    5758
    5859/** Remote USB host controller interface operations. */
     
    123124}
    124125
    125 void remote_usbhc_reserve_default_address(device_t *device, void *iface,
     126void remote_usbhc_reserve_default_address(ddf_fun_t *fun, void *iface,
    126127    ipc_callid_t callid, ipc_call_t *call)
    127128{
     
    135136        usb_speed_t speed = DEV_IPC_GET_ARG1(*call);
    136137       
    137         int rc = usb_iface->reserve_default_address(device, speed);
     138        int rc = usb_iface->reserve_default_address(fun, speed);
    138139
    139140        async_answer_0(callid, rc);
    140141}
    141142
    142 void remote_usbhc_release_default_address(device_t *device, void *iface,
     143void remote_usbhc_release_default_address(ddf_fun_t *fun, void *iface,
    143144    ipc_callid_t callid, ipc_call_t *call)
    144145{
     
    150151        }
    151152
    152         int rc = usb_iface->release_default_address(device);
     153        int rc = usb_iface->release_default_address(fun);
    153154
    154155        async_answer_0(callid, rc);
    155156}
    156157
    157 void remote_usbhc_request_address(device_t *device, void *iface,
     158void remote_usbhc_request_address(ddf_fun_t *fun, void *iface,
    158159    ipc_callid_t callid, ipc_call_t *call)
    159160{
     
    168169
    169170        usb_address_t address;
    170         int rc = usb_iface->request_address(device, speed, &address);
     171        int rc = usb_iface->request_address(fun, speed, &address);
    171172        if (rc != EOK) {
    172173                async_answer_0(callid, rc);
     
    176177}
    177178
    178 void remote_usbhc_bind_address(device_t *device, void *iface,
     179void remote_usbhc_bind_address(ddf_fun_t *fun, void *iface,
    179180    ipc_callid_t callid, ipc_call_t *call)
    180181{
     
    189190        devman_handle_t handle = (devman_handle_t) DEV_IPC_GET_ARG2(*call);
    190191
    191         int rc = usb_iface->bind_address(device, address, handle);
     192        int rc = usb_iface->bind_address(fun, address, handle);
    192193
    193194        async_answer_0(callid, rc);
    194195}
    195196
    196 void remote_usbhc_release_address(device_t *device, void *iface,
     197void remote_usbhc_release_address(ddf_fun_t *fun, void *iface,
    197198    ipc_callid_t callid, ipc_call_t *call)
    198199{
     
    206207        usb_address_t address = (usb_address_t) DEV_IPC_GET_ARG1(*call);
    207208
    208         int rc = usb_iface->release_address(device, address);
     209        int rc = usb_iface->release_address(fun, address);
    209210
    210211        async_answer_0(callid, rc);
     
    212213
    213214
    214 static void callback_out(device_t *device,
     215static void callback_out(ddf_fun_t *fun,
    215216    int outcome, void *arg)
    216217{
     
    222223}
    223224
    224 static void callback_in(device_t *device,
     225static void callback_in(ddf_fun_t *fun,
    225226    int outcome, size_t actual_size, void *arg)
    226227{
     
    255256 * @param transfer_func Transfer function (might be NULL).
    256257 */
    257 static void remote_usbhc_out_transfer(device_t *device,
     258static void remote_usbhc_out_transfer(ddf_fun_t *fun,
    258259    ipc_callid_t callid, ipc_call_t *call,
    259260    usbhc_iface_transfer_out_t transfer_func)
     
    294295        trans->size = len;
    295296
    296         rc = transfer_func(device, target, max_packet_size,
     297        rc = transfer_func(fun, target, max_packet_size,
    297298            buffer, len,
    298299            callback_out, trans);
     
    311312 * @param transfer_func Transfer function (might be NULL).
    312313 */
    313 static void remote_usbhc_in_transfer(device_t *device,
     314static void remote_usbhc_in_transfer(ddf_fun_t *fun,
    314315    ipc_callid_t callid, ipc_call_t *call,
    315316    usbhc_iface_transfer_in_t transfer_func)
     
    342343        trans->size = len;
    343344
    344         int rc = transfer_func(device, target, max_packet_size,
     345        int rc = transfer_func(fun, target, max_packet_size,
    345346            trans->buffer, len,
    346347            callback_in, trans);
     
    352353}
    353354
    354 void remote_usbhc_interrupt_out(device_t *device, void *iface,
     355void remote_usbhc_interrupt_out(ddf_fun_t *fun, void *iface,
    355356    ipc_callid_t callid, ipc_call_t *call)
    356357{
     
    358359        assert(usb_iface != NULL);
    359360
    360         return remote_usbhc_out_transfer(device, callid, call,
     361        return remote_usbhc_out_transfer(fun, callid, call,
    361362            usb_iface->interrupt_out);
    362363}
    363364
    364 void remote_usbhc_interrupt_in(device_t *device, void *iface,
     365void remote_usbhc_interrupt_in(ddf_fun_t *fun, void *iface,
    365366    ipc_callid_t callid, ipc_call_t *call)
    366367{
     
    368369        assert(usb_iface != NULL);
    369370
    370         return remote_usbhc_in_transfer(device, callid, call,
     371        return remote_usbhc_in_transfer(fun, callid, call,
    371372            usb_iface->interrupt_in);
    372373}
    373374
    374 void remote_usbhc_bulk_out(device_t *device, void *iface,
     375void remote_usbhc_bulk_out(ddf_fun_t *fun, void *iface,
    375376    ipc_callid_t callid, ipc_call_t *call)
    376377{
     
    378379        assert(usb_iface != NULL);
    379380
    380         return remote_usbhc_out_transfer(device, callid, call,
     381        return remote_usbhc_out_transfer(fun, callid, call,
    381382            usb_iface->bulk_out);
    382383}
    383384
    384 void remote_usbhc_bulk_in(device_t *device, void *iface,
     385void remote_usbhc_bulk_in(ddf_fun_t *fun, void *iface,
    385386    ipc_callid_t callid, ipc_call_t *call)
    386387{
     
    388389        assert(usb_iface != NULL);
    389390
    390         return remote_usbhc_in_transfer(device, callid, call,
     391        return remote_usbhc_in_transfer(fun, callid, call,
    391392            usb_iface->bulk_in);
    392393}
    393394
    394 void remote_usbhc_control_write(device_t *device, void *iface,
     395void remote_usbhc_control_write(ddf_fun_t *fun, void *iface,
    395396ipc_callid_t callid, ipc_call_t *call)
    396397{
     
    444445        trans->size = data_buffer_len;
    445446
    446         rc = usb_iface->control_write(device, target, max_packet_size,
     447        rc = usb_iface->control_write(fun, target, max_packet_size,
    447448            setup_packet, setup_packet_len,
    448449            data_buffer, data_buffer_len,
     
    456457
    457458
    458 void remote_usbhc_control_read(device_t *device, void *iface,
     459void remote_usbhc_control_read(ddf_fun_t *fun, void *iface,
    459460ipc_callid_t callid, ipc_call_t *call)
    460461{
     
    509510        }
    510511
    511         rc = usb_iface->control_read(device, target, max_packet_size,
     512        rc = usb_iface->control_read(fun, target, max_packet_size,
    512513            setup_packet, setup_packet_len,
    513514            trans->buffer, trans->size,
Note: See TracChangeset for help on using the changeset viewer.