Changeset 984a9ba in mainline for uspace/drv/hid/ps2mouse/ps2mouse.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/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        }
Note: See TracChangeset for help on using the changeset viewer.