Changeset 984a9ba in mainline for uspace/drv/hid/usbhid/kbd/kbddev.c


Ignore:
Timestamp:
2018-07-05T09:34:09Z (6 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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        }
Note: See TracChangeset for help on using the changeset viewer.