Changeset 60744cb in mainline for uspace/drv/nic/e1k/e1k.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/e1k/e1k.c

    r646849b3 r60744cb  
    12441244 *
    12451245 * @param icall IPC call structure
    1246  * @param dev   E1000 device
    1247  *
    1248  */
    1249 static void e1000_interrupt_handler(ipc_call_t *icall,
    1250     ddf_dev_t *dev)
     1246 * @param arg   Argument (nic_t *)
     1247 *
     1248 */
     1249static void e1000_interrupt_handler(ipc_call_t *icall, void *arg)
    12511250{
    12521251        uint32_t icr = (uint32_t) ipc_get_arg2(icall);
    1253         nic_t *nic = NIC_DATA_DEV(dev);
     1252        nic_t *nic = (nic_t *)arg;
    12541253        e1000_t *e1000 = DRIVER_DATA_NIC(nic);
    12551254
     
    12831282
    12841283        errno_t rc = register_interrupt_handler(nic_get_ddf_dev(nic), e1000->irq,
    1285             e1000_interrupt_handler, &e1000_irq_code, handle);
     1284            e1000_interrupt_handler, (void *)nic, &e1000_irq_code, handle);
    12861285
    12871286        fibril_mutex_unlock(&irq_reg_mutex);
Note: See TracChangeset for help on using the changeset viewer.