Ignore:
File:
1 edited

Legend:

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

    r79ae36dd r8869f7b  
    4545static fibril_local char plugged_device_name[PLUGGED_DEVICE_NAME_MAXLEN + 1] = "<unknown>";
    4646
    47 #if 0
    4847/** Receive device name.
    4948 *
     
    8584        plugged_device_name[len] = 0;
    8685}
    87 #endif
    8886
    8987/** Default handler for IPC methods not handled by DDF.
     
    9391 * @param icall Call data.
    9492 */
    95 void default_connection_handler(ddf_fun_t *fun,
    96     ipc_callid_t icallid, ipc_call_t *icall)
     93void default_connection_handler(ddf_fun_t *fun, ipc_callid_t icallid,
     94    ipc_call_t *icall)
    9795{
    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
    10496        vhc_data_t *vhc = fun->dev->driver_data;
    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);
     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);
    111103                if (rc != EOK) {
    112104                        async_answer_0(icallid, rc);
     
    114106                        return;
    115107                }
    116 
     108               
    117109                async_answer_0(icallid, EOK);
    118 
     110               
    119111                receive_device_name(callback);
    120 
     112               
    121113                usb_log_info("New virtual device `%s' (id: %" PRIxn ").\n",
    122114                    plugged_device_name, plugged_device_handle);
    123 
    124                 return;
    125         }
    126 #endif
    127 
    128         async_answer_0(icallid, EINVAL);
     115        } else
     116                async_answer_0(icallid, EINVAL);
    129117}
    130118
Note: See TracChangeset for help on using the changeset viewer.