Ignore:
Timestamp:
2024-05-17T17:51:56Z (7 weeks ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
1801005
Parents:
646849b3
Message:

Let driver specify any argument to IRQ handler

This allows the driver to register a single handler for multiple
interrupts and still distinguish between them. It also removes
the extra step of having to get softstate from ddf_dev_t.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/virtio-net/virtio-net.c

    r646849b3 r60744cb  
    7070};
    7171
    72 static void virtio_net_irq_handler(ipc_call_t *icall, ddf_dev_t *dev)
    73 {
    74         nic_t *nic = ddf_dev_data_get(dev);
     72/** VirtIO net IRQ handler.
     73 *
     74 * @param icall IRQ event notification
     75 * @param arg Argument (nic_t *)
     76 */
     77static void virtio_net_irq_handler(ipc_call_t *icall, void *arg)
     78{
     79        nic_t *nic = (nic_t *)arg;
    7580        virtio_net_t *virtio_net = nic_get_specific(nic);
    7681        virtio_dev_t *vdev = &virtio_net->virtio_dev;
     
    164169
    165170        return register_interrupt_handler(dev, virtio_net->irq,
    166             virtio_net_irq_handler, &irq_code, &virtio_net->irq_handle);
     171            virtio_net_irq_handler, (void *)nic, &irq_code,
     172            &virtio_net->irq_handle);
    167173}
    168174
Note: See TracChangeset for help on using the changeset viewer.