Changeset e86b8f0 in mainline for uspace/drv/nic/e1k/e1k.c


Ignore:
Timestamp:
2012-01-21T12:50:28Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
77a69ea, 86c71de
Parents:
3fe58d3c
Message:

Create DDF functions manually.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/e1k/e1k.c

    r3fe58d3c re86b8f0  
    20972097int e1000_dev_add(ddf_dev_t *dev)
    20982098{
     2099        ddf_fun_t *fun;
    20992100        assert(dev);
    21002101       
     
    21272128        e1000_initialize_vlan(e1000);
    21282129       
    2129         rc = nic_register_as_ddf_fun(nic, &e1000_dev_ops);
    2130         if (rc != EOK)
     2130        fun = ddf_fun_create(nic_get_ddf_dev(nic), fun_exposed, "port0");
     2131        if (fun == NULL)
    21312132                goto err_tx_structure;
     2133        nic_set_ddf_fun(nic, fun);
     2134        fun->ops = &e1000_dev_ops;
     2135        fun->driver_data = nic;
    21322136       
    21332137        rc = e1000_register_int_handler(nic);
    21342138        if (rc != EOK)
    2135                 goto err_tx_structure;
     2139                goto err_fun_create;
    21362140       
    21372141        rc = nic_connect_to_services(nic);
     
    21562160                goto err_rx_structure;
    21572161       
     2162        rc = ddf_fun_bind(fun);
     2163        if (rc != EOK)
     2164                goto err_fun_bind;
     2165       
     2166        rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC);
     2167        if (rc != EOK)
     2168                goto err_add_to_cat;
     2169       
    21582170        return EOK;
    21592171       
     2172err_add_to_cat:
     2173        ddf_fun_unbind(fun);
     2174err_fun_bind:
    21602175err_rx_structure:
    21612176        e1000_uninitialize_rx_structure(nic);
    21622177err_irq:
    21632178        unregister_interrupt_handler(dev, DRIVER_DATA_DEV(dev)->irq);
     2179err_fun_create:
     2180        ddf_fun_destroy(fun);
     2181        nic_set_ddf_fun(nic, NULL);
    21642182err_tx_structure:
    21652183        e1000_uninitialize_tx_structure(e1000);
Note: See TracChangeset for help on using the changeset viewer.