Ignore:
Timestamp:
2011-01-06T16:37:53Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b590c21
Parents:
0777f4c5
Message:

more robust interrupt processing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/netif/dp8390/dp8390_module.c

    r0777f4c5 r6fc0edd  
    5858#define NAME  "dp8390"
    5959
    60 /** Returns the device from the interrupt call.
     60/** Return the device from the interrupt call.
     61 *
    6162 *  @param[in] call The interrupt call.
    62  */
    63 #define IRQ_GET_DEVICE(call)  (device_id_t) IPC_GET_IMETHOD(*call)
     63 *
     64 */
     65#define IRQ_GET_DEVICE(call)  ((device_id_t) IPC_GET_IMETHOD(call))
     66
     67/** Return the ISR from the interrupt call.
     68 *
     69 *  @param[in] call The interrupt call.
     70 *
     71 */
     72#define IRQ_GET_ISR(call)  ((int) IPC_GET_ARG2(call))
    6473
    6574/** DP8390 kernel interrupt command sequence.
     
    7281        },
    7382        {
     83                .cmd = CMD_BTEST,
     84                .value = 0x7f,
     85                .srcarg = 2,
     86                .dstarg = 3,
     87        },
     88        {
    7489                .cmd = CMD_PREDICATE,
    75                 .value = 1,
    76                 .srcarg = 2
     90                .value = 2,
     91                .srcarg = 3
     92        },
     93        {
     94                .cmd = CMD_PIO_WRITE_8,
     95                .addr = NULL,
     96                .value = 0xff
    7797        },
    7898        {
     
    101121        int phone;
    102122       
    103         device_id = IRQ_GET_DEVICE(call);
     123        device_id = IRQ_GET_DEVICE(*call);
    104124        fibril_rwlock_write_lock(&netif_globals.lock);
    105125       
     
    117137        assert(dep->de_flags & DEF_ENABLED);
    118138       
    119         dep->de_int_pending = 0;
    120         dp_check_ints(dep);
     139        dp_check_ints(dep, IRQ_GET_ISR(*call));
    121140       
    122141        if (dep->received_queue) {
     
    279298               
    280299                if (do_pwrite(dep, packet, false) != EBUSY)
    281                         netif_pq_release(packet_get_id(packet));\
     300                        netif_pq_release(packet_get_id(packet));
    282301               
    283302                packet = next;
     
    295314                dep = (dpeth_t *) device->specific;
    296315                dp8390_cmds[0].addr = (void *) (uintptr_t) (dep->de_dp8390_port + DP_ISR);
    297                 dp8390_cmds[2].addr = dp8390_cmds[0].addr;
     316                dp8390_cmds[3].addr = dp8390_cmds[0].addr;
    298317               
    299318                rc = ipc_register_irq(dep->de_irq, device->device_id, device->device_id, &dp8390_code);
Note: See TracChangeset for help on using the changeset viewer.