Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/rtl8139/driver.c

    r60744cb re55d2c1  
    4242#include <stdio.h>
    4343#include <str.h>
     44#include <pcapdump_iface.h>
    4445
    4546#include "defs.h"
     
    819820 *
    820821 * @param icall  The IPC call structure
    821  * @param arg    Argument (nic_t *)
    822  *
    823  */
    824 static void rtl8139_interrupt_handler(ipc_call_t *icall, void *arg)
    825 {
     822 * @param dev    The rtl8139 device
     823 *
     824 */
     825static void rtl8139_interrupt_handler(ipc_call_t *icall, ddf_dev_t *dev)
     826{
     827        assert(dev);
     828        assert(icall);
     829
    826830        uint16_t isr = (uint16_t) ipc_get_arg2(icall);
    827         nic_t *nic_data = (nic_t *)arg;
     831        nic_t *nic_data = nic_get_from_ddf_dev(dev);
    828832        rtl8139_t *rtl8139 = nic_get_specific(nic_data);
    829833
     
    858862        rtl8139_irq_code.cmds[3].addr = rtl8139->io_addr + IMR;
    859863        errno_t rc = register_interrupt_handler(nic_get_ddf_dev(nic_data),
    860             rtl8139->irq, rtl8139_interrupt_handler, (void *)nic_data,
    861             &rtl8139_irq_code, handle);
     864            rtl8139->irq, rtl8139_interrupt_handler, &rtl8139_irq_code, handle);
    862865
    863866        RTL8139_IRQ_STRUCT_UNLOCK();
     
    13051308                goto err_fun_create;
    13061309        }
    1307         rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC);
     1310
     1311        rc = nic_fun_add_to_cats(fun);
    13081312        if (rc != EOK) {
    1309                 ddf_msg(LVL_ERROR, "Failed adding function to category");
    1310                 goto err_fun_bind;
     1313                ddf_msg(LVL_ERROR, "Failed adding function to categories");
     1314                ddf_fun_unbind(fun);
     1315                return rc;
    13111316        }
    13121317
     
    13161321        return EOK;
    13171322
    1318 err_fun_bind:
    1319         ddf_fun_unbind(fun);
     1323        // err_fun_bind:
     1324        // ddf_fun_unbind(fun);
    13201325err_fun_create:
    13211326        ddf_fun_destroy(fun);
Note: See TracChangeset for help on using the changeset viewer.