Ignore:
File:
1 edited

Legend:

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

    r80a96d2 ra996ae31  
    8080
    8181static irq_code_t default_pseudocode = {
     82        0,
     83        NULL,
    8284        sizeof(default_cmds) / sizeof(irq_cmd_t),
    8385        default_cmds
     
    198200                pseudocode = &default_pseudocode;
    199201       
    200         int res = register_irq(irq, dev->handle, ctx->id, pseudocode);
     202        int res = irq_register(irq, dev->handle, ctx->id, pseudocode);
    201203        if (res != EOK) {
    202204                remove_interrupt_context(&interrupt_contexts, ctx);
     
    211213        interrupt_context_t *ctx = find_interrupt_context(&interrupt_contexts,
    212214            dev, irq);
    213         int res = unregister_irq(irq, dev->handle);
     215        int res = irq_unregister(irq, dev->handle);
    214216       
    215217        if (ctx != NULL) {
     
    271273       
    272274        devman_handle_t dev_handle = IPC_GET_ARG1(*icall);
    273         devman_handle_t parent_fun_handle = IPC_GET_ARG2(*icall);
     275        devman_handle_t parent_fun_handle = IPC_GET_ARG2(*icall);
    274276       
    275277        ddf_dev_t *dev = create_device();
     
    288290        (void) parent_fun_handle;
    289291       
    290         res = driver->driver_ops->add_device(dev);
     292        res = driver->driver_ops->dev_add(dev);
    291293       
    292294        if (res != EOK) {
     
    301303       
    302304        async_answer_0(iid, res);
     305}
     306
     307static void driver_dev_added(ipc_callid_t iid, ipc_call_t *icall)
     308{
     309        fibril_mutex_lock(&devices_mutex);
     310        ddf_dev_t *dev = driver_get_device(IPC_GET_ARG1(*icall));
     311        fibril_mutex_unlock(&devices_mutex);
     312       
     313        if (dev != NULL && driver->driver_ops->device_added != NULL)
     314                driver->driver_ops->device_added(dev);
    303315}
    304316
     
    450462                case DRIVER_DEV_ADD:
    451463                        driver_dev_add(callid, &call);
     464                        break;
     465                case DRIVER_DEV_ADDED:
     466                        async_answer_0(callid, EOK);
     467                        driver_dev_added(callid, &call);
    452468                        break;
    453469                case DRIVER_DEV_REMOVE:
     
    956972       
    957973        match_id->id = str_dup(match_id_str);
    958         match_id->score = 90;
     974        match_id->score = match_score;
    959975       
    960976        add_match_id(&fun->match_ids, match_id);
     
    10021018         * incoming connections.
    10031019         */
    1004         rc = devman_driver_register(driver->name, driver_connection);
     1020        async_set_client_connection(driver_connection);
     1021        rc = devman_driver_register(driver->name);
    10051022        if (rc != EOK) {
    10061023                printf("Error: Failed to register driver with device manager "
Note: See TracChangeset for help on using the changeset viewer.