Changeset 984a9ba in mainline for uspace/drv/bus


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

Location:
uspace/drv/bus
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/adb/cuda_adb/cuda_adb.c

    r76f566d r984a9ba  
    5555#define NAME  "cuda_adb"
    5656
    57 static void cuda_dev_connection(cap_call_handle_t, ipc_call_t *, void *);
     57static void cuda_dev_connection(ipc_call_t *, void *);
    5858static errno_t cuda_init(cuda_t *);
    5959static void cuda_irq_handler(ipc_call_t *, void *);
     
    198198
    199199/** Device connection handler */
    200 static void cuda_dev_connection(cap_call_handle_t icall_handle,
    201     ipc_call_t *icall, void *arg)
     200static void cuda_dev_connection(ipc_call_t *icall, void *arg)
    202201{
    203202        adb_dev_t *dev = (adb_dev_t *) ddf_fun_data_get((ddf_fun_t *) arg);
    204         cap_call_handle_t chandle;
    205203        ipc_call_t call;
    206204        sysarg_t method;
    207205
    208206        /* Answer the IPC_M_CONNECT_ME_TO call. */
    209         async_answer_0(icall_handle, EOK);
     207        async_answer_0(icall, EOK);
    210208
    211209        while (true) {
    212                 chandle = async_get_call(&call);
     210                async_get_call(&call);
    213211                method = IPC_GET_IMETHOD(call);
    214212
    215213                if (!method) {
    216214                        /* The other side has hung up. */
    217                         async_answer_0(chandle, EOK);
     215                        async_answer_0(&call, EOK);
    218216                        return;
    219217                }
     
    223221                if (sess != NULL) {
    224222                        dev->client_sess = sess;
    225                         async_answer_0(chandle, EOK);
     223                        async_answer_0(&call, EOK);
    226224                } else {
    227                         async_answer_0(chandle, EINVAL);
     225                        async_answer_0(&call, EINVAL);
    228226                }
    229227        }
  • uspace/drv/bus/usb/vhc/conndev.c

    r76f566d r984a9ba  
    8989/** Default handler for IPC methods not handled by DDF.
    9090 *
    91  * @param fun           Device handling the call.
    92  * @param icall_handle  Call handle.
    93  * @param icall         Call data.
     91 * @param fun   Device handling the call.
     92 * @param icall Call data.
     93 *
    9494 */
    95 void default_connection_handler(ddf_fun_t *fun, cap_call_handle_t icall_handle,
    96     ipc_call_t *icall)
     95void default_connection_handler(ddf_fun_t *fun, ipc_call_t *icall)
    9796{
    9897        vhc_data_t *vhc = ddf_fun_data_get(fun);
     
    104103                errno_t rc = vhc_virtdev_plug(vhc, callback, &plugged_device_handle);
    105104                if (rc != EOK) {
    106                         async_answer_0(icall_handle, rc);
     105                        async_answer_0(icall, rc);
    107106                        async_hangup(callback);
    108107                        return;
    109108                }
    110109
    111                 async_answer_0(icall_handle, EOK);
     110                async_answer_0(icall, EOK);
    112111
    113112                receive_device_name(callback);
     
    116115                    plugged_device_name, plugged_device_handle);
    117116        } else
    118                 async_answer_0(icall_handle, EINVAL);
     117                async_answer_0(icall, EINVAL);
    119118}
    120119
  • uspace/drv/bus/usb/vhc/vhcd.h

    r76f566d r984a9ba  
    8888
    8989void on_client_close(ddf_fun_t *fun);
    90 void default_connection_handler(ddf_fun_t *fun, cap_call_handle_t icall_handle,
    91     ipc_call_t *icall);
     90void default_connection_handler(ddf_fun_t *fun, ipc_call_t *icall);
    9291
    9392errno_t vhc_virtdev_plug(vhc_data_t *, async_sess_t *, uintptr_t *);
Note: See TracChangeset for help on using the changeset viewer.