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