Changeset 60744cb in mainline for uspace/drv/nic/ne2k/ne2k.c


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/ne2k/ne2k.c

    r646849b3 r60744cb  
    121121};
    122122
    123 static void ne2k_interrupt_handler(ipc_call_t *, ddf_dev_t *);
     123static void ne2k_interrupt_handler(ipc_call_t *, void *);
    124124
    125125static errno_t ne2k_register_interrupt(nic_t *nic_data,
     
    161161
    162162        return register_interrupt_handler(nic_get_ddf_dev(nic_data),
    163             ne2k->irq, ne2k_interrupt_handler, &ne2k->code, handle);
     163            ne2k->irq, ne2k_interrupt_handler, (void *)nic_data, &ne2k->code,
     164            handle);
    164165}
    165166
     
    237238}
    238239
    239 void ne2k_interrupt_handler(ipc_call_t *call, ddf_dev_t *dev)
    240 {
    241         nic_t *nic_data = DRIVER_DATA(dev);
     240/** NE2K interrupt handler
     241 *
     242 * @param call IRQ event notification
     243 * @param arg Argument (nic_t *)
     244 */
     245void ne2k_interrupt_handler(ipc_call_t *call, void *arg)
     246{
     247        nic_t *nic_data = (nic_t *)arg;
    242248        ne2k_interrupt(nic_data, IRQ_GET_ISR(*call), IRQ_GET_TSR(*call));
    243249}
Note: See TracChangeset for help on using the changeset viewer.