Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/driver.c

    r45059d6b rb72efe8  
    314314                    " %" PRIun " was found.\n", driver->name, handle);
    315315                async_answer_0(iid, ENOENT);
    316                 return;
    317         }
    318        
    319         if (fun->conn_handler != NULL) {
    320                 /* Driver has a custom connection handler. */
    321                 (*fun->conn_handler)(iid, icall, (void *)fun);
    322316                return;
    323317        }
     
    428422static void driver_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    429423{
    430         sysarg_t conn_type;
    431 
    432         if (iid == 0) {
    433                 /* Callback connection from devman */
    434                 /* XXX Use separate handler for this type of connection */
    435                 conn_type = DRIVER_DEVMAN;
    436         } else {
    437                 conn_type = IPC_GET_ARG1(*icall);
    438         }
    439 
    440424        /* Select interface */
    441         switch (conn_type) {
     425        switch ((sysarg_t) (IPC_GET_ARG1(*icall))) {
    442426        case DRIVER_DEVMAN:
    443427                /* Handle request from device manager */
     
    592576int ddf_fun_bind(ddf_fun_t *fun)
    593577{
    594         assert(fun->bound == false);
    595578        assert(fun->name != NULL);
    596579       
     
    609592}
    610593
    611 /** Unbind a function node.
    612  *
    613  * Unbind the specified function from the system. This effectively makes
    614  * the function invisible to the system.
    615  *
    616  * @param fun           Function to bind
    617  * @return              EOK on success or negative error code
    618  */
    619 int ddf_fun_unbind(ddf_fun_t *fun)
    620 {
    621         int res;
    622        
    623         assert(fun->bound == true);
    624        
    625         add_to_functions_list(fun);
    626         res = devman_remove_function(fun->handle);
    627         if (res != EOK)
    628                 return res;
    629 
    630         remove_from_functions_list(fun);
    631        
    632         fun->bound = false;
    633         return EOK;
    634 }
    635 
    636594/** Add single match ID to inner function.
    637595 *
     
    656614                return ENOMEM;
    657615       
    658         match_id->id = str_dup(match_id_str);
     616        match_id->id = match_id_str;
    659617        match_id->score = 90;
    660618       
     
    671629}
    672630
    673 /** Add exposed function to category.
     631/** Add exposed function to class.
    674632 *
    675633 * Must only be called when the function is bound.
    676634 */
    677 int ddf_fun_add_to_category(ddf_fun_t *fun, const char *cat_name)
     635int ddf_fun_add_to_class(ddf_fun_t *fun, const char *class_name)
    678636{
    679637        assert(fun->bound == true);
    680638        assert(fun->ftype == fun_exposed);
    681639       
    682         return devman_add_device_to_category(fun->handle, cat_name);
     640        return devman_add_device_to_class(fun->handle, class_name);
    683641}
    684642
Note: See TracChangeset for help on using the changeset viewer.