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

    r646849b3 r60744cb  
    819819 *
    820820 * @param icall  The IPC call structure
    821  * @param dev    The rtl8139 device
    822  *
    823  */
    824 static void rtl8139_interrupt_handler(ipc_call_t *icall, ddf_dev_t *dev)
    825 {
    826         assert(dev);
    827         assert(icall);
    828 
     821 * @param arg    Argument (nic_t *)
     822 *
     823 */
     824static void rtl8139_interrupt_handler(ipc_call_t *icall, void *arg)
     825{
    829826        uint16_t isr = (uint16_t) ipc_get_arg2(icall);
    830         nic_t *nic_data = nic_get_from_ddf_dev(dev);
     827        nic_t *nic_data = (nic_t *)arg;
    831828        rtl8139_t *rtl8139 = nic_get_specific(nic_data);
    832829
     
    861858        rtl8139_irq_code.cmds[3].addr = rtl8139->io_addr + IMR;
    862859        errno_t rc = register_interrupt_handler(nic_get_ddf_dev(nic_data),
    863             rtl8139->irq, rtl8139_interrupt_handler, &rtl8139_irq_code, handle);
     860            rtl8139->irq, rtl8139_interrupt_handler, (void *)nic_data,
     861            &rtl8139_irq_code, handle);
    864862
    865863        RTL8139_IRQ_STRUCT_UNLOCK();
Note: See TracChangeset for help on using the changeset viewer.