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