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