Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/vhc/conndev.c

    r8869f7b r79ae36dd  
    4545static fibril_local char plugged_device_name[PLUGGED_DEVICE_NAME_MAXLEN + 1] = "<unknown>";
    4646
     47#if 0
    4748/** Receive device name.
    4849 *
     
    8485        plugged_device_name[len] = 0;
    8586}
     87#endif
    8688
    8789/** Default handler for IPC methods not handled by DDF.
     
    9193 * @param icall Call data.
    9294 */
    93 void default_connection_handler(ddf_fun_t *fun, ipc_callid_t icallid,
    94     ipc_call_t *icall)
     95void default_connection_handler(ddf_fun_t *fun,
     96    ipc_callid_t icallid, ipc_call_t *icall)
    9597{
     98// FIXME:
     99// This code needs to be refactored since the async
     100// framework does not support automatic callback connections
     101// yet.
     102
     103#if 0
    96104        vhc_data_t *vhc = fun->dev->driver_data;
    97        
    98         async_sess_t *callback =
    99             async_callback_receive_start(EXCHANGE_SERIALIZE, icall);
    100        
    101         if (callback) {
    102                 int rc = vhc_virtdev_plug(vhc, callback, &plugged_device_handle);
     105        sysarg_t method = IPC_GET_IMETHOD(*icall);
     106
     107        if (method == IPC_M_CONNECT_TO_ME) {
     108                int callback = IPC_GET_ARG5(*icall);
     109                int rc = vhc_virtdev_plug(vhc, callback,
     110                    &plugged_device_handle);
    103111                if (rc != EOK) {
    104112                        async_answer_0(icallid, rc);
     
    106114                        return;
    107115                }
    108                
     116
    109117                async_answer_0(icallid, EOK);
    110                
     118
    111119                receive_device_name(callback);
    112                
     120
    113121                usb_log_info("New virtual device `%s' (id: %" PRIxn ").\n",
    114122                    plugged_device_name, plugged_device_handle);
    115         } else
    116                 async_answer_0(icallid, EINVAL);
     123
     124                return;
     125        }
     126#endif
     127
     128        async_answer_0(icallid, EINVAL);
    117129}
    118130
Note: See TracChangeset for help on using the changeset viewer.