Ignore:
Timestamp:
2011-02-24T12:03:27Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e7b7ebd5
Parents:
4837092 (diff), a80849c (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:

Merged development (changes in DDF, etc.).

Conflicts in uspace/drv/usbkbd/main.c

File:
1 edited

Legend:

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

    r4837092 r92574f4  
    3333 */
    3434
    35 #include <ipc/ipc.h>
    3635#include <async.h>
    3736#include <errno.h>
    3837
    3938#include "ops/char_dev.h"
    40 #include "driver.h"
     39#include "ddf/driver.h"
    4140
    4241#define MAX_CHAR_RW_COUNT 256
    4342
    44 static void remote_char_read(device_t *, void *, ipc_callid_t, ipc_call_t *);
    45 static void remote_char_write(device_t *, void *, ipc_callid_t, ipc_call_t *);
     43static void remote_char_read(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     44static void remote_char_write(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    4645
    4746/** Remote character interface operations. */
     
    6867 * local interface to the remote client.
    6968 *
    70  * @param dev           The device from which the data are read.
     69 * @param fun           The function from which the data are read.
    7170 * @param ops           The local ops structure.
    7271 */
    7372static void
    74 remote_char_read(device_t *dev, void *ops, ipc_callid_t callid,
     73remote_char_read(ddf_fun_t *fun, void *ops, ipc_callid_t callid,
    7574    ipc_call_t *call)
    7675{
     
    8180        if (!async_data_read_receive(&cid, &len)) {
    8281                /* TODO handle protocol error. */
    83                 ipc_answer_0(callid, EINVAL);
     82                async_answer_0(callid, EINVAL);
    8483                return;
    8584        }
     
    8786        if (!char_dev_ops->read) {
    8887                async_data_read_finalize(cid, NULL, 0);
    89                 ipc_answer_0(callid, ENOTSUP);
     88                async_answer_0(callid, ENOTSUP);
    9089                return;
    9190        }
     
    9594       
    9695        char buf[MAX_CHAR_RW_COUNT];
    97         int ret = (*char_dev_ops->read)(dev, buf, len);
     96        int ret = (*char_dev_ops->read)(fun, buf, len);
    9897       
    9998        if (ret < 0) {
    10099                /* Some error occured. */
    101100                async_data_read_finalize(cid, buf, 0);
    102                 ipc_answer_0(callid, ret);
     101                async_answer_0(callid, ret);
    103102                return;
    104103        }
     
    106105        /* The operation was successful, return the number of data read. */
    107106        async_data_read_finalize(cid, buf, ret);
    108         ipc_answer_1(callid, EOK, ret);
     107        async_answer_1(callid, EOK, ret);
    109108}
    110109
     
    115114 * local interface to the remote client.
    116115 *
    117  * @param dev           The device to which the data are written.
     116 * @param fun           The function to which the data are written.
    118117 * @param ops           The local ops structure.
    119118 */
    120119static void
    121 remote_char_write(device_t *dev, void *ops, ipc_callid_t callid,
     120remote_char_write(ddf_fun_t *fun, void *ops, ipc_callid_t callid,
    122121    ipc_call_t *call)
    123122{
     
    128127        if (!async_data_write_receive(&cid, &len)) {
    129128                /* TODO handle protocol error. */
    130                 ipc_answer_0(callid, EINVAL);
     129                async_answer_0(callid, EINVAL);
    131130                return;
    132131        }
     
    134133        if (!char_dev_ops->write) {
    135134                async_data_write_finalize(cid, NULL, 0);
    136                 ipc_answer_0(callid, ENOTSUP);
     135                async_answer_0(callid, ENOTSUP);
    137136                return;
    138137        }
     
    145144        async_data_write_finalize(cid, buf, len);
    146145       
    147         int ret = (*char_dev_ops->write)(dev, buf, len);
     146        int ret = (*char_dev_ops->write)(fun, buf, len);
    148147        if (ret < 0) {
    149148                /* Some error occured. */
    150                 ipc_answer_0(callid, ret);
     149                async_answer_0(callid, ret);
    151150        } else {
    152151                /*
     
    154153                 * written.
    155154                 */
    156                 ipc_answer_1(callid, EOK, ret);
     155                async_answer_1(callid, EOK, ret);
    157156        }
    158157}
Note: See TracChangeset for help on using the changeset viewer.