Changeset 984a9ba in mainline for uspace/drv


Ignore:
Timestamp:
2018-07-05T09:34:09Z (8 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
63d46341
Parents:
76f566d
Message:

do not expose the call capability handler from the async framework

Keep the call capability handler encapsulated within the async framework
and do not expose it explicitly via its API. Use the pointer to
ipc_call_t as the sole object identifying an IPC call in the code that
uses the async framework.

This plugs a major leak in the abstraction and also simplifies both the
async framework (slightly) and all IPC servers.

Location:
uspace/drv
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/block/ata_bd/main.c

    r76f566d r984a9ba  
    4747static errno_t ata_fun_offline(ddf_fun_t *fun);
    4848
    49 static void ata_bd_connection(cap_call_handle_t, ipc_call_t *, void *);
     49static void ata_bd_connection(ipc_call_t *, void *);
    5050
    5151static driver_ops_t driver_ops = {
     
    313313
    314314/** Block device connection handler */
    315 static void ata_bd_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     315static void ata_bd_connection(ipc_call_t *icall, void *arg)
    316316{
    317317        ata_fun_t *afun;
    318318
    319319        afun = (ata_fun_t *) ddf_fun_data_get((ddf_fun_t *)arg);
    320         bd_conn(icall_handle, icall, &afun->bds);
     320        bd_conn(icall, &afun->bds);
    321321}
    322322
  • uspace/drv/block/ddisk/ddisk.c

    r76f566d r984a9ba  
    6262static errno_t ddisk_fun_offline(ddf_fun_t *);
    6363
    64 static void ddisk_bd_connection(cap_call_handle_t, ipc_call_t *, void *);
     64static void ddisk_bd_connection(ipc_call_t *, void *);
    6565
    6666static void ddisk_irq_handler(ipc_call_t *, ddf_dev_t *);
     
    585585
    586586/** Block device connection handler */
    587 static void ddisk_bd_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     587static void ddisk_bd_connection(ipc_call_t *icall, void *arg)
    588588{
    589589        ddisk_t *ddisk;
     
    591591
    592592        ddisk = (ddisk_t *) ddf_dev_data_get(ddf_fun_get_dev(fun));
    593         bd_conn(icall_handle, icall, &ddisk->bds);
     593        bd_conn(icall, &ddisk->bds);
    594594}
    595595
  • uspace/drv/block/usbmast/main.c

    r76f566d r984a9ba  
    7979
    8080static errno_t usbmast_fun_create(usbmast_dev_t *mdev, unsigned lun);
    81 static void usbmast_bd_connection(cap_call_handle_t icall_handle, ipc_call_t *icall,
    82     void *arg);
     81static void usbmast_bd_connection(ipc_call_t *icall, void *arg);
    8382
    8483static errno_t usbmast_bd_open(bd_srvs_t *, bd_srv_t *);
     
    317316
    318317/** Blockdev client connection handler. */
    319 static void usbmast_bd_connection(cap_call_handle_t icall_handle, ipc_call_t *icall,
    320     void *arg)
     318static void usbmast_bd_connection(ipc_call_t *icall, void *arg)
    321319{
    322320        usbmast_fun_t *mfun;
    323321
    324322        mfun = (usbmast_fun_t *) ddf_fun_data_get((ddf_fun_t *)arg);
    325         bd_conn(icall_handle, icall, &mfun->bds);
     323        bd_conn(icall, &mfun->bds);
    326324}
    327325
  • uspace/drv/bus/adb/cuda_adb/cuda_adb.c

    r76f566d r984a9ba  
    5555#define NAME  "cuda_adb"
    5656
    57 static void cuda_dev_connection(cap_call_handle_t, ipc_call_t *, void *);
     57static void cuda_dev_connection(ipc_call_t *, void *);
    5858static errno_t cuda_init(cuda_t *);
    5959static void cuda_irq_handler(ipc_call_t *, void *);
     
    198198
    199199/** Device connection handler */
    200 static void cuda_dev_connection(cap_call_handle_t icall_handle,
    201     ipc_call_t *icall, void *arg)
     200static void cuda_dev_connection(ipc_call_t *icall, void *arg)
    202201{
    203202        adb_dev_t *dev = (adb_dev_t *) ddf_fun_data_get((ddf_fun_t *) arg);
    204         cap_call_handle_t chandle;
    205203        ipc_call_t call;
    206204        sysarg_t method;
    207205
    208206        /* Answer the IPC_M_CONNECT_ME_TO call. */
    209         async_answer_0(icall_handle, EOK);
     207        async_answer_0(icall, EOK);
    210208
    211209        while (true) {
    212                 chandle = async_get_call(&call);
     210                async_get_call(&call);
    213211                method = IPC_GET_IMETHOD(call);
    214212
    215213                if (!method) {
    216214                        /* The other side has hung up. */
    217                         async_answer_0(chandle, EOK);
     215                        async_answer_0(&call, EOK);
    218216                        return;
    219217                }
     
    223221                if (sess != NULL) {
    224222                        dev->client_sess = sess;
    225                         async_answer_0(chandle, EOK);
     223                        async_answer_0(&call, EOK);
    226224                } else {
    227                         async_answer_0(chandle, EINVAL);
     225                        async_answer_0(&call, EINVAL);
    228226                }
    229227        }
  • uspace/drv/bus/usb/vhc/conndev.c

    r76f566d r984a9ba  
    8989/** Default handler for IPC methods not handled by DDF.
    9090 *
    91  * @param fun           Device handling the call.
    92  * @param icall_handle  Call handle.
    93  * @param icall         Call data.
     91 * @param fun   Device handling the call.
     92 * @param icall Call data.
     93 *
    9494 */
    95 void default_connection_handler(ddf_fun_t *fun, cap_call_handle_t icall_handle,
    96     ipc_call_t *icall)
     95void default_connection_handler(ddf_fun_t *fun, ipc_call_t *icall)
    9796{
    9897        vhc_data_t *vhc = ddf_fun_data_get(fun);
     
    104103                errno_t rc = vhc_virtdev_plug(vhc, callback, &plugged_device_handle);
    105104                if (rc != EOK) {
    106                         async_answer_0(icall_handle, rc);
     105                        async_answer_0(icall, rc);
    107106                        async_hangup(callback);
    108107                        return;
    109108                }
    110109
    111                 async_answer_0(icall_handle, EOK);
     110                async_answer_0(icall, EOK);
    112111
    113112                receive_device_name(callback);
     
    116115                    plugged_device_name, plugged_device_handle);
    117116        } else
    118                 async_answer_0(icall_handle, EINVAL);
     117                async_answer_0(icall, EINVAL);
    119118}
    120119
  • uspace/drv/bus/usb/vhc/vhcd.h

    r76f566d r984a9ba  
    8888
    8989void on_client_close(ddf_fun_t *fun);
    90 void default_connection_handler(ddf_fun_t *fun, cap_call_handle_t icall_handle,
    91     ipc_call_t *icall);
     90void default_connection_handler(ddf_fun_t *fun, ipc_call_t *icall);
    9291
    9392errno_t vhc_virtdev_plug(vhc_data_t *, async_sess_t *, uintptr_t *);
  • uspace/drv/char/i8042/i8042.c

    r76f566d r984a9ba  
    6767#define i8042_KBD_TRANSLATE  0x40  /* Use this to switch to XT scancodes */
    6868
    69 static void i8042_char_conn(cap_call_handle_t, ipc_call_t *, void *);
     69static void i8042_char_conn(ipc_call_t *, void *);
    7070static errno_t i8042_read(chardev_srv_t *, void *, size_t, size_t *);
    7171static errno_t i8042_write(chardev_srv_t *, const void *, size_t, size_t *);
     
    415415/** Handle data requests.
    416416 *
    417  * @param id   chandle
    418417 * @param call IPC request.
    419418 * @param arg  ddf_fun_t function.
    420  */
    421 void i8042_char_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     419 *
     420 */
     421void i8042_char_conn(ipc_call_t *icall, void *arg)
    422422{
    423423        i8042_port_t *port = ddf_fun_data_get((ddf_fun_t *)arg);
    424424
    425         chardev_conn(icall_handle, icall, &port->cds);
     425        chardev_conn(icall, &port->cds);
    426426}
    427427
  • uspace/drv/char/msim-con/msim-con.c

    r76f566d r984a9ba  
    4141#include "msim-con.h"
    4242
    43 static void msim_con_connection(cap_call_handle_t, ipc_call_t *, void *);
     43static void msim_con_connection(ipc_call_t *, void *);
    4444
    4545static errno_t msim_con_read(chardev_srv_t *, void *, size_t, size_t *);
     
    217217
    218218/** Character device connection handler. */
    219 static void msim_con_connection(cap_call_handle_t icall_handle, ipc_call_t *icall,
    220     void *arg)
     219static void msim_con_connection(ipc_call_t *icall, void *arg)
    221220{
    222221        msim_con_t *con = (msim_con_t *) ddf_dev_data_get(
    223222            ddf_fun_get_dev((ddf_fun_t *) arg));
    224223
    225         chardev_conn(icall_handle, icall, &con->cds);
     224        chardev_conn(icall, &con->cds);
    226225}
    227226
  • uspace/drv/char/ns8250/ns8250.c

    r76f566d r984a9ba  
    311311static errno_t ns8250_open(chardev_srvs_t *, chardev_srv_t *);
    312312static errno_t ns8250_close(chardev_srv_t *);
    313 static void ns8250_default_handler(chardev_srv_t *, cap_call_handle_t, ipc_call_t *);
     313static void ns8250_default_handler(chardev_srv_t *, ipc_call_t *);
    314314
    315315/** The character interface's callbacks. */
     
    322322};
    323323
    324 static void ns8250_char_conn(cap_call_handle_t, ipc_call_t *, void *);
     324static void ns8250_char_conn(ipc_call_t *, void *);
    325325
    326326static errno_t ns8250_dev_add(ddf_dev_t *dev);
     
    10671067 * Configure the parameters of the serial communication.
    10681068 */
    1069 static void ns8250_default_handler(chardev_srv_t *srv, cap_call_handle_t chandle,
    1070     ipc_call_t *call)
     1069static void ns8250_default_handler(chardev_srv_t *srv, ipc_call_t *call)
    10711070{
    10721071        ns8250_t *ns8250 = srv_ns8250(srv);
     
    10791078                ns8250_get_props(ns8250->dev, &baud_rate, &parity, &word_length,
    10801079                    &stop_bits);
    1081                 async_answer_4(chandle, EOK, baud_rate, parity, word_length,
     1080                async_answer_4(call, EOK, baud_rate, parity, word_length,
    10821081                    stop_bits);
    10831082                break;
     
    10901089                ret = ns8250_set_props(ns8250->dev, baud_rate, parity, word_length,
    10911090                    stop_bits);
    1092                 async_answer_0(chandle, ret);
     1091                async_answer_0(call, ret);
    10931092                break;
    10941093
    10951094        default:
    1096                 async_answer_0(chandle, ENOTSUP);
    1097         }
    1098 }
    1099 
    1100 void ns8250_char_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     1095                async_answer_0(call, ENOTSUP);
     1096        }
     1097}
     1098
     1099void ns8250_char_conn(ipc_call_t *icall, void *arg)
    11011100{
    11021101        ns8250_t *ns8250 = fun_ns8250((ddf_fun_t *)arg);
    11031102
    1104         chardev_conn(icall_handle, icall, &ns8250->cds);
     1103        chardev_conn(icall, &ns8250->cds);
    11051104}
    11061105
  • uspace/drv/char/pl050/pl050.c

    r76f566d r984a9ba  
    5454static errno_t pl050_fun_online(ddf_fun_t *);
    5555static errno_t pl050_fun_offline(ddf_fun_t *);
    56 static void pl050_char_conn(cap_call_handle_t, ipc_call_t *, void *);
     56static void pl050_char_conn(ipc_call_t *, void *);
    5757static errno_t pl050_read(chardev_srv_t *, void *, size_t, size_t *);
    5858static errno_t pl050_write(chardev_srv_t *, const void *, size_t, size_t *);
     
    286286}
    287287
    288 void pl050_char_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     288void pl050_char_conn(ipc_call_t *icall, void *arg)
    289289{
    290290        pl050_t *pl050 = pl050_from_fun((ddf_fun_t *)arg);
    291291
    292         chardev_conn(icall_handle, icall, &pl050->cds);
     292        chardev_conn(icall, &pl050->cds);
    293293}
    294294
  • uspace/drv/char/ski-con/ski-con.c

    r76f566d r984a9ba  
    5050static errno_t ski_con_fibril(void *arg);
    5151static int32_t ski_con_getchar(void);
    52 static void ski_con_connection(cap_call_handle_t, ipc_call_t *, void *);
     52static void ski_con_connection(ipc_call_t *, void *);
    5353
    5454static errno_t ski_con_read(chardev_srv_t *, void *, size_t, size_t *);
     
    255255
    256256/** Character device connection handler. */
    257 static void ski_con_connection(cap_call_handle_t icall_handle, ipc_call_t *icall,
    258     void *arg)
     257static void ski_con_connection(ipc_call_t *icall, void *arg)
    259258{
    260259        ski_con_t *con = (ski_con_t *) ddf_dev_data_get(
    261260            ddf_fun_get_dev((ddf_fun_t *) arg));
    262261
    263         chardev_conn(icall_handle, icall, &con->cds);
     262        chardev_conn(icall, &con->cds);
    264263}
    265264
  • uspace/drv/char/sun4v-con/sun4v-con.c

    r76f566d r984a9ba  
    4242#include "sun4v-con.h"
    4343
    44 static void sun4v_con_connection(cap_call_handle_t, ipc_call_t *, void *);
     44static void sun4v_con_connection(ipc_call_t *, void *);
    4545
    4646#define POLL_INTERVAL  10000
     
    181181
    182182/** Character device connection handler. */
    183 static void sun4v_con_connection(cap_call_handle_t icall_handle, ipc_call_t *icall,
    184     void *arg)
     183static void sun4v_con_connection(ipc_call_t *icall, void *arg)
    185184{
    186185        sun4v_con_t *con = (sun4v_con_t *) ddf_dev_data_get(
    187186            ddf_fun_get_dev((ddf_fun_t *) arg));
    188187
    189         chardev_conn(icall_handle, icall, &con->cds);
     188        chardev_conn(icall, &con->cds);
    190189}
    191190
  • uspace/drv/fb/amdm37x_dispc/main.c

    r76f566d r984a9ba  
    4646#define NAME  "amdm37x_dispc"
    4747
    48 static void graph_vsl_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     48static void graph_vsl_connection(ipc_call_t *icall, void *arg)
    4949{
    5050        visualizer_t *vsl;
    5151
    5252        vsl = (visualizer_t *) ddf_fun_data_get((ddf_fun_t *)arg);
    53         graph_visualizer_connection(vsl, icall_handle, icall, NULL);
     53        graph_visualizer_connection(vsl, icall, NULL);
    5454}
    5555
  • uspace/drv/fb/kfb/port.c

    r76f566d r984a9ba  
    162162};
    163163
    164 static void graph_vsl_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     164static void graph_vsl_connection(ipc_call_t *icall, void *arg)
    165165{
    166166        visualizer_t *vsl;
     
    168168
    169169        vsl = (visualizer_t *) ddf_fun_data_get((ddf_fun_t *)arg);
    170         graph_visualizer_connection(vsl, icall_handle, icall, NULL);
     170        graph_visualizer_connection(vsl, icall, NULL);
    171171
    172172        if (kfb.addr != NULL) {
  • uspace/drv/hid/adb-kbd/adb-kbd.c

    r76f566d r984a9ba  
    4343#include "ctl.h"
    4444
    45 static void adb_kbd_events(cap_call_handle_t, ipc_call_t *, void *);
     45static void adb_kbd_events(ipc_call_t *, void *);
    4646static void adb_kbd_reg0_data(adb_kbd_t *, uint16_t);
    47 static void adb_kbd_conn(cap_call_handle_t, ipc_call_t *, void *);
     47static void adb_kbd_conn(ipc_call_t *, void *);
    4848
    4949/** Add ADB keyboard device */
     
    130130}
    131131
    132 static void adb_kbd_events(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     132static void adb_kbd_events(ipc_call_t *icall, void *arg)
    133133{
    134134        adb_kbd_t *kbd = (adb_kbd_t *) arg;
     
    136136        /* Ignore parameters, the connection is already opened */
    137137        while (true) {
    138 
    139138                ipc_call_t call;
    140                 cap_call_handle_t chandle = async_get_call(&call);
     139                async_get_call(&call);
    141140
    142141                errno_t retval = EOK;
     
    154153                        retval = ENOENT;
    155154                }
    156                 async_answer_0(chandle, retval);
     155                async_answer_0(&call, retval);
    157156        }
    158157}
     
    191190
    192191/** Handle client connection */
    193 static void adb_kbd_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
    194 {
    195         cap_call_handle_t chandle;
     192static void adb_kbd_conn(ipc_call_t *icall, void *arg)
     193{
    196194        ipc_call_t call;
    197195        sysarg_t method;
     
    201199         * Answer the first IPC_M_CONNECT_ME_TO call.
    202200         */
    203         async_answer_0(icall_handle, EOK);
     201        async_answer_0(icall, EOK);
    204202
    205203        kbd = (adb_kbd_t *)ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *)arg));
    206204
    207205        while (true) {
    208                 chandle = async_get_call(&call);
     206                async_get_call(&call);
    209207                method = IPC_GET_IMETHOD(call);
    210208
    211209                if (!method) {
    212210                        /* The other side has hung up. */
    213                         async_answer_0(chandle, EOK);
     211                        async_answer_0(&call, EOK);
    214212                        return;
    215213                }
     
    219217                if (sess != NULL) {
    220218                        kbd->client_sess = sess;
    221                         async_answer_0(chandle, EOK);
     219                        async_answer_0(&call, EOK);
    222220                } else {
    223                         async_answer_0(chandle, EINVAL);
     221                        async_answer_0(&call, EINVAL);
    224222                }
    225223        }
  • uspace/drv/hid/adb-mouse/adb-mouse.c

    r76f566d r984a9ba  
    4141#include "adb-mouse.h"
    4242
    43 static void adb_mouse_conn(cap_call_handle_t, ipc_call_t *, void *);
     43static void adb_mouse_conn(ipc_call_t *, void *);
    4444
    4545static void adb_mouse_event_button(adb_mouse_t *mouse, int bnum, int bpress)
     
    8888}
    8989
    90 static void adb_mouse_events(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     90static void adb_mouse_events(ipc_call_t *icall, void *arg)
    9191{
    9292        adb_mouse_t *mouse = (adb_mouse_t *) arg;
     
    9595        while (true) {
    9696                ipc_call_t call;
    97                 cap_call_handle_t chandle = async_get_call(&call);
     97                async_get_call(&call);
    9898
    9999                errno_t retval = EOK;
     
    112112                }
    113113
    114                 async_answer_0(chandle, retval);
     114                async_answer_0(&call, retval);
    115115        }
    116116}
     
    200200
    201201/** Handle client connection */
    202 static void adb_mouse_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
    203 {
    204         cap_call_handle_t chandle;
     202static void adb_mouse_conn(ipc_call_t *icall, void *arg)
     203{
    205204        ipc_call_t call;
    206205        sysarg_t method;
     
    210209         * Answer the first IPC_M_CONNECT_ME_TO call.
    211210         */
    212         async_answer_0(icall_handle, EOK);
     211        async_answer_0(icall, EOK);
    213212
    214213        mouse = (adb_mouse_t *)ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *)arg));
    215214
    216215        while (true) {
    217                 chandle = async_get_call(&call);
     216                async_get_call(&call);
    218217                method = IPC_GET_IMETHOD(call);
    219218
    220219                if (!method) {
    221220                        /* The other side has hung up. */
    222                         async_answer_0(chandle, EOK);
     221                        async_answer_0(&call, EOK);
    223222                        return;
    224223                }
     
    228227                if (sess != NULL) {
    229228                        mouse->client_sess = sess;
    230                         async_answer_0(chandle, EOK);
     229                        async_answer_0(&call, EOK);
    231230                } else {
    232                         async_answer_0(chandle, EINVAL);
    233                 }
    234         }
    235 }
    236 
     231                        async_answer_0(&call, EINVAL);
     232                }
     233        }
     234}
    237235
    238236/**
  • uspace/drv/hid/atkbd/atkbd.c

    r76f566d r984a9ba  
    292292/** Default handler for IPC methods not handled by DDF.
    293293 *
    294  * @param fun           Device function handling the call.
    295  * @param icall_handle  Call handle.
    296  * @param icall         Call data.
    297  *
    298  */
    299 static void
    300 default_connection_handler(ddf_fun_t *fun, cap_call_handle_t icall_handle,
    301     ipc_call_t *icall)
     294 * @param fun   Device function handling the call.
     295 * @param icall Call data.
     296 *
     297 */
     298static void default_connection_handler(ddf_fun_t *fun, ipc_call_t *icall)
    302299{
    303300        const sysarg_t method = IPC_GET_IMETHOD(*icall);
     
    307304        switch (method) {
    308305        case KBDEV_SET_IND:
    309                 async_answer_0(icall_handle, ENOTSUP);
     306                async_answer_0(icall, ENOTSUP);
    310307                break;
    311308        case IPC_M_CONNECT_TO_ME:
     
    320317                        ddf_msg(LVL_WARN,
    321318                            "Failed creating callback session");
    322                         async_answer_0(icall_handle, EAGAIN);
     319                        async_answer_0(icall, EAGAIN);
    323320                        break;
    324321                }
     
    327324                        kbd->client_sess = sess;
    328325                        ddf_msg(LVL_DEBUG, "Set client session");
    329                         async_answer_0(icall_handle, EOK);
     326                        async_answer_0(icall, EOK);
    330327                } else {
    331328                        ddf_msg(LVL_ERROR, "Client session already set");
    332                         async_answer_0(icall_handle, ELIMIT);
     329                        async_answer_0(icall, ELIMIT);
    333330                }
    334331
     
    336333        default:
    337334                ddf_msg(LVL_ERROR, "Unknown method: %d.", (int)method);
    338                 async_answer_0(icall_handle, EINVAL);
     335                async_answer_0(icall, EINVAL);
    339336                break;
    340337        }
  • uspace/drv/hid/ps2mouse/ps2mouse.c

    r76f566d r984a9ba  
    104104static errno_t polling_intellimouse(void *);
    105105static errno_t probe_intellimouse(ps2_mouse_t *, bool);
    106 static void default_connection_handler(ddf_fun_t *, cap_call_handle_t, ipc_call_t *);
     106static void default_connection_handler(ddf_fun_t *, ipc_call_t *);
    107107
    108108/** ps/2 mouse driver ops. */
     
    401401/** Default handler for IPC methods not handled by DDF.
    402402 *
    403  * @param fun           Device function handling the call.
    404  * @param icall_handle  Call handle.
    405  * @param icall         Call data.
    406  */
    407 void default_connection_handler(ddf_fun_t *fun, cap_call_handle_t icall_handle,
    408     ipc_call_t *icall)
     403 * @param fun   Device function handling the call.
     404 * @param icall Call data.
     405 *
     406 */
     407void default_connection_handler(ddf_fun_t *fun, ipc_call_t *icall)
    409408{
    410409        const sysarg_t method = IPC_GET_IMETHOD(*icall);
     
    423422                        ddf_msg(LVL_WARN,
    424423                            "Failed creating client callback session");
    425                         async_answer_0(icall_handle, EAGAIN);
     424                        async_answer_0(icall, EAGAIN);
    426425                        break;
    427426                }
     
    429428                        mouse->client_sess = sess;
    430429                        ddf_msg(LVL_DEBUG, "Set client session");
    431                         async_answer_0(icall_handle, EOK);
     430                        async_answer_0(icall, EOK);
    432431                } else {
    433432                        ddf_msg(LVL_ERROR, "Client session already set");
    434                         async_answer_0(icall_handle, ELIMIT);
     433                        async_answer_0(icall, ELIMIT);
    435434                }
    436435                break;
    437436        default:
    438437                ddf_msg(LVL_ERROR, "Unknown method: %d.", (int)method);
    439                 async_answer_0(icall_handle, EINVAL);
     438                async_answer_0(icall, EINVAL);
    440439                break;
    441440        }
  • uspace/drv/hid/usbhid/kbd/kbddev.c

    r76f566d r984a9ba  
    7272#include "../usbhid.h"
    7373
    74 static void default_connection_handler(ddf_fun_t *, cap_call_handle_t, ipc_call_t *);
     74static void default_connection_handler(ddf_fun_t *, ipc_call_t *);
    7575static ddf_dev_ops_t kbdops = { .default_handler = default_connection_handler };
    7676
     
    148148/* IPC method handler                                                         */
    149149
    150 /**
    151  * Default handler for IPC methods not handled by DDF.
     150/** Default handler for IPC methods not handled by DDF.
    152151 *
    153152 * Currently recognizes only two methods (IPC_M_CONNECT_TO_ME and KBDEV_SET_IND)
     
    156155 * KBDEV_SET_IND sets LED keyboard indicators.
    157156 *
    158  * @param fun           Device function handling the call.
    159  * @param icall_handle  Call handle.
    160  * @param icall         Call data.
    161  */
    162 static void
    163 default_connection_handler(ddf_fun_t *fun, cap_call_handle_t icall_handle,
    164     ipc_call_t *icall)
     157 * @param fun   Device function handling the call.
     158 * @param icall Call data.
     159 *
     160 */
     161static void default_connection_handler(ddf_fun_t *fun, ipc_call_t *icall)
    165162{
    166163        const sysarg_t method = IPC_GET_IMETHOD(*icall);
     
    172169                kbd_dev->mods = IPC_GET_ARG1(*icall);
    173170                usb_kbd_set_led(kbd_dev->hid_dev, kbd_dev);
    174                 async_answer_0(icall_handle, EOK);
     171                async_answer_0(icall, EOK);
    175172                break;
    176173                /*
     
    184181                        usb_log_warning(
    185182                            "Failed to create start console session.\n");
    186                         async_answer_0(icall_handle, EAGAIN);
     183                        async_answer_0(icall, EAGAIN);
    187184                        break;
    188185                }
     
    190187                        kbd_dev->client_sess = sess;
    191188                        usb_log_debug("%s: OK", __FUNCTION__);
    192                         async_answer_0(icall_handle, EOK);
     189                        async_answer_0(icall, EOK);
    193190                } else {
    194191                        usb_log_error("%s: console session already set",
    195192                            __FUNCTION__);
    196                         async_answer_0(icall_handle, ELIMIT);
     193                        async_answer_0(icall, ELIMIT);
    197194                }
    198195                break;
     
    200197                usb_log_error("%s: Unknown method: %d.",
    201198                    __FUNCTION__, (int) method);
    202                 async_answer_0(icall_handle, EINVAL);
     199                async_answer_0(icall, EINVAL);
    203200                break;
    204201        }
  • uspace/drv/hid/usbhid/mouse/mousedev.c

    r76f566d r984a9ba  
    5656#define NAME "mouse"
    5757
    58 static void default_connection_handler(ddf_fun_t *, cap_call_handle_t, ipc_call_t *);
     58static void default_connection_handler(ddf_fun_t *, ipc_call_t *);
    5959
    6060static ddf_dev_ops_t ops = { .default_handler = default_connection_handler };
     
    110110/** Default handler for IPC methods not handled by DDF.
    111111 *
    112  * @param fun           Device function handling the call.
    113  * @param icall_handle  Call handle.
    114  * @param icall         Call data.
    115  */
    116 static void
    117 default_connection_handler(ddf_fun_t *fun, cap_call_handle_t icall_handle,
    118     ipc_call_t *icall)
     112 * @param fun   Device function handling the call.
     113 * @param icall Call data.
     114 *
     115 */
     116static void default_connection_handler(ddf_fun_t *fun, ipc_call_t *icall)
    119117{
    120118        usb_mouse_t *mouse_dev = ddf_fun_data_get(fun);
     
    122120        if (mouse_dev == NULL) {
    123121                usb_log_debug("%s: Missing parameters.", __FUNCTION__);
    124                 async_answer_0(icall_handle, EINVAL);
     122                async_answer_0(icall, EINVAL);
    125123                return;
    126124        }
     
    137135                        usb_log_debug("Console session to %s set ok (%p).",
    138136                            ddf_fun_get_name(fun), sess);
    139                         async_answer_0(icall_handle, EOK);
     137                        async_answer_0(icall, EOK);
    140138                } else {
    141139                        usb_log_error("Console session to %s already set.",
    142140                            ddf_fun_get_name(fun));
    143                         async_answer_0(icall_handle, ELIMIT);
     141                        async_answer_0(icall, ELIMIT);
    144142                        async_hangup(sess);
    145143                }
    146144        } else {
    147145                usb_log_debug("%s: Invalid function.", __FUNCTION__);
    148                 async_answer_0(icall_handle, EINVAL);
     146                async_answer_0(icall, EINVAL);
    149147        }
    150148}
  • uspace/drv/hid/usbhid/multimedia/multimedia.c

    r76f566d r984a9ba  
    7373
    7474
    75 /**
    76  * Default handler for IPC methods not handled by DDF.
     75/** Default handler for IPC methods not handled by DDF.
    7776 *
    7877 * Currently recognizes only one method (IPC_M_CONNECT_TO_ME), in which case it
     
    8079 * later use by the driver to notify about key events.
    8180 *
    82  * @param fun           Device function handling the call.
    83  * @param icall_handle  Call handle.
    84  * @param icall         Call data.
    85  */
    86 static void
    87 default_connection_handler(ddf_fun_t *fun, cap_call_handle_t icall_handle,
    88     ipc_call_t *icall)
     81 * @param fun   Device function handling the call.
     82 * @param icall Call data.
     83 *
     84 */
     85static void default_connection_handler(ddf_fun_t *fun, ipc_call_t *icall)
    8986{
    9087        usb_log_debug(NAME " default_connection_handler()");
     
    9996                        usb_log_debug(NAME " Saved session to console: %p",
    10097                            sess);
    101                         async_answer_0(icall_handle, EOK);
     98                        async_answer_0(icall, EOK);
    10299                } else
    103                         async_answer_0(icall_handle, ELIMIT);
     100                        async_answer_0(icall, ELIMIT);
    104101        } else
    105                 async_answer_0(icall_handle, EINVAL);
     102                async_answer_0(icall, EINVAL);
    106103}
    107104
  • uspace/drv/hid/xtkbd/xtkbd.c

    r76f566d r984a9ba  
    328328/** Default handler for IPC methods not handled by DDF.
    329329 *
    330  * @param fun           Device function handling the call.
    331  * @param icall_handle  Call handle.
    332  * @param icall         Call data.
    333  *
    334  */
    335 static void default_connection_handler(ddf_fun_t *fun,
    336     cap_call_handle_t icall_handle, ipc_call_t *icall)
     330 * @param fun   Device function handling the call.
     331 * @param icall Call data.
     332 *
     333 */
     334static void default_connection_handler(ddf_fun_t *fun, ipc_call_t *icall)
    337335{
    338336        const sysarg_t method = IPC_GET_IMETHOD(*icall);
     
    357355                errno_t rc = chardev_write(kbd->chardev, &cmds[0], 1, &nwr);
    358356                if (rc != EOK) {
    359                         async_answer_0(icall_handle, rc);
     357                        async_answer_0(icall, rc);
    360358                        break;
    361359                }
    362360
    363361                rc = chardev_write(kbd->chardev, &cmds[1], 1, &nwr);
    364                 async_answer_0(icall_handle, rc);
     362                async_answer_0(icall, rc);
    365363                break;
    366364        case IPC_M_CONNECT_TO_ME:
     
    375373                        ddf_msg(LVL_WARN,
    376374                            "Failed creating callback session");
    377                         async_answer_0(icall_handle, EAGAIN);
     375                        async_answer_0(icall, EAGAIN);
    378376                        break;
    379377                }
     
    382380                        kbd->client_sess = sess;
    383381                        ddf_msg(LVL_DEBUG, "Set client session");
    384                         async_answer_0(icall_handle, EOK);
     382                        async_answer_0(icall, EOK);
    385383                } else {
    386384                        ddf_msg(LVL_ERROR, "Client session already set");
    387                         async_answer_0(icall_handle, ELIMIT);
     385                        async_answer_0(icall, ELIMIT);
    388386                }
    389387
     
    391389        default:
    392390                ddf_msg(LVL_ERROR, "Unknown method: %d.", (int)method);
    393                 async_answer_0(icall_handle, EINVAL);
     391                async_answer_0(icall, EINVAL);
    394392                break;
    395393        }
  • uspace/drv/intctl/apic/apic.c

    r76f566d r984a9ba  
    160160/** Handle one connection to APIC.
    161161 *
    162  * @param iid   Hash of the request that opened the connection.
    163162 * @param icall Call data of the request that opened the connection.
    164  * @param arg   Local argument.
    165  */
    166 static void apic_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
    167 {
    168         cap_call_handle_t chandle;
     163 * @param arg   Local argument.
     164 *
     165 */
     166static void apic_connection(ipc_call_t *icall, void *arg)
     167{
    169168        ipc_call_t call;
    170169        apic_t *apic;
     
    173172         * Answer the first IPC_M_CONNECT_ME_TO call.
    174173         */
    175         async_answer_0(icall_handle, EOK);
    176 
    177         apic = (apic_t *)ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *)arg));
     174        async_answer_0(icall, EOK);
     175
     176        apic = (apic_t *) ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *) arg));
    178177
    179178        while (true) {
    180                 chandle = async_get_call(&call);
     179                async_get_call(&call);
    181180
    182181                if (!IPC_GET_IMETHOD(call)) {
    183182                        /* The other side has hung up. */
    184                         async_answer_0(chandle, EOK);
     183                        async_answer_0(&call, EOK);
    185184                        return;
    186185                }
     
    188187                switch (IPC_GET_IMETHOD(call)) {
    189188                case IRC_ENABLE_INTERRUPT:
    190                         async_answer_0(chandle, apic_enable_irq(apic,
     189                        async_answer_0(&call, apic_enable_irq(apic,
    191190                            IPC_GET_ARG1(call)));
    192191                        break;
    193192                case IRC_DISABLE_INTERRUPT:
    194193                        /* XXX TODO */
    195                         async_answer_0(chandle, EOK);
     194                        async_answer_0(&call, EOK);
    196195                        break;
    197196                case IRC_CLEAR_INTERRUPT:
    198197                        /* Noop */
    199                         async_answer_0(chandle, EOK);
     198                        async_answer_0(&call, EOK);
    200199                        break;
    201200                default:
    202                         async_answer_0(chandle, EINVAL);
     201                        async_answer_0(&call, EINVAL);
    203202                        break;
    204203                }
  • uspace/drv/intctl/i8259/i8259.c

    r76f566d r984a9ba  
    8989/** Handle one connection to i8259.
    9090 *
    91  * @param iid   Hash of the request that opened the connection.
    9291 * @param icall Call data of the request that opened the connection.
    93  * @param arg   Local argument.
    94  */
    95 static void i8259_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
    96 {
    97         cap_call_handle_t chandle;
     92 * @param arg   Local argument.
     93 *
     94 */
     95static void i8259_connection(ipc_call_t *icall, void *arg)
     96{
    9897        ipc_call_t call;
    9998        i8259_t *i8259 = NULL /* XXX */;
     
    102101         * Answer the first IPC_M_CONNECT_ME_TO call.
    103102         */
    104         async_answer_0(icall_handle, EOK);
    105 
    106         i8259 = (i8259_t *)ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *)arg));
     103        async_answer_0(icall, EOK);
     104
     105        i8259 = (i8259_t *) ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *) arg));
    107106
    108107        while (true) {
    109                 chandle = async_get_call(&call);
     108                async_get_call(&call);
    110109
    111110                if (!IPC_GET_IMETHOD(call)) {
    112111                        /* The other side has hung up. */
    113                         async_answer_0(chandle, EOK);
     112                        async_answer_0(&call, EOK);
    114113                        return;
    115114                }
     
    117116                switch (IPC_GET_IMETHOD(call)) {
    118117                case IRC_ENABLE_INTERRUPT:
    119                         async_answer_0(chandle, pic_enable_irq(i8259,
     118                        async_answer_0(&call, pic_enable_irq(i8259,
    120119                            IPC_GET_ARG1(call)));
    121120                        break;
    122121                case IRC_DISABLE_INTERRUPT:
    123122                        /* XXX TODO */
    124                         async_answer_0(chandle, EOK);
     123                        async_answer_0(&call, EOK);
    125124                        break;
    126125                case IRC_CLEAR_INTERRUPT:
    127126                        /* Noop */
    128                         async_answer_0(chandle, EOK);
     127                        async_answer_0(&call, EOK);
    129128                        break;
    130129                default:
    131                         async_answer_0(chandle, EINVAL);
     130                        async_answer_0(&call, EINVAL);
    132131                        break;
    133132                }
  • uspace/drv/intctl/icp-ic/icp-ic.c

    r76f566d r984a9ba  
    6565/** Client connection handler.
    6666 *
    67  * @param iid   Hash of the request that opened the connection.
    6867 * @param icall Call data of the request that opened the connection.
    69  * @param arg   Local argument.
     68 * @param arg   Local argument.
     69 *
    7070 */
    71 static void icpic_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     71static void icpic_connection(ipc_call_t *icall, void *arg)
    7272{
    73         cap_call_handle_t chandle;
    7473        ipc_call_t call;
    7574        icpic_t *icpic;
     
    7877         * Answer the first IPC_M_CONNECT_ME_TO call.
    7978         */
    80         async_answer_0(icall_handle, EOK);
     79        async_answer_0(icall, EOK);
    8180
    82         icpic = (icpic_t *)ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *)arg));
     81        icpic = (icpic_t *) ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *) arg));
    8382
    8483        while (true) {
    85                 chandle = async_get_call(&call);
     84                async_get_call(&call);
    8685
    8786                if (!IPC_GET_IMETHOD(call)) {
    8887                        /* The other side has hung up. */
    89                         async_answer_0(chandle, EOK);
     88                        async_answer_0(&call, EOK);
    9089                        return;
    9190                }
     
    9392                switch (IPC_GET_IMETHOD(call)) {
    9493                case IRC_ENABLE_INTERRUPT:
    95                         async_answer_0(chandle,
     94                        async_answer_0(&call,
    9695                            icpic_enable_irq(icpic, IPC_GET_ARG1(call)));
    9796                        break;
    9897                case IRC_DISABLE_INTERRUPT:
    9998                        /* XXX TODO */
    100                         async_answer_0(chandle, EOK);
     99                        async_answer_0(&call, EOK);
    101100                        break;
    102101                case IRC_CLEAR_INTERRUPT:
    103102                        /* Noop */
    104                         async_answer_0(chandle, EOK);
     103                        async_answer_0(&call, EOK);
    105104                        break;
    106105                default:
    107                         async_answer_0(chandle, EINVAL);
     106                        async_answer_0(&call, EINVAL);
    108107                        break;
    109108                }
  • uspace/drv/intctl/obio/obio.c

    r76f566d r984a9ba  
    6969/** Handle one connection to obio.
    7070 *
    71  * @param iid           Hash of the request that opened the connection.
    72  * @param icall         Call data of the request that opened the connection.
    73  * @param arg           Local argument.
     71 * @param icall Call data of the request that opened the connection.
     72 * @param arg   Local argument.
     73 *
    7474 */
    75 static void obio_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     75static void obio_connection(ipc_call_t *icall, void *arg)
    7676{
    77         cap_call_handle_t chandle;
    7877        ipc_call_t call;
    7978        obio_t *obio;
     
    8281         * Answer the first IPC_M_CONNECT_ME_TO call.
    8382         */
    84         async_answer_0(icall_handle, EOK);
     83        async_answer_0(icall, EOK);
    8584
    86         obio = (obio_t *)ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *)arg));
     85        obio = (obio_t *) ddf_dev_data_get(ddf_fun_get_dev((ddf_fun_t *) arg));
    8786
    8887        while (true) {
    8988                int inr;
    9089
    91                 chandle = async_get_call(&call);
     90                async_get_call(&call);
     91
    9292                switch (IPC_GET_IMETHOD(call)) {
    9393                case IRC_ENABLE_INTERRUPT:
     
    9595                        pio_set_64(&obio->regs[OBIO_IMR(inr & INO_MASK)],
    9696                            1UL << 31, 0);
    97                         async_answer_0(chandle, EOK);
     97                        async_answer_0(&call, EOK);
    9898                        break;
    9999                case IRC_DISABLE_INTERRUPT:
    100100                        /* XXX TODO */
    101                         async_answer_0(chandle, EOK);
     101                        async_answer_0(&call, EOK);
    102102                        break;
    103103                case IRC_CLEAR_INTERRUPT:
    104104                        inr = IPC_GET_ARG1(call);
    105105                        pio_write_64(&obio->regs[OBIO_CIR(inr & INO_MASK)], 0);
    106                         async_answer_0(chandle, EOK);
     106                        async_answer_0(&call, EOK);
    107107                        break;
    108108                default:
    109                         async_answer_0(chandle, EINVAL);
     109                        async_answer_0(&call, EINVAL);
    110110                        break;
    111111                }
Note: See TracChangeset for help on using the changeset viewer.