Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 7300c37 in mainline for uspace/srv/hw/netif/dp8390/ne2000.c


Ignore:
Timestamp:
2011-01-11T01:33:13Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial
Children:
8136102
Parents:
4fc2b3b
Message:

fetching of frames from the network card is still single-threaded, but sending the frames to NIL uses parallelism

File:
1 edited

Legend:

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

    r4fc2b3b r7300c37  
    6868#define IRQ_GET_ISR(call)  ((int) IPC_GET_ARG2(call))
    6969
     70/** Return the TSR from the interrupt call.
     71 *
     72 * @param[in] call The interrupt call.
     73 *
     74 */
     75#define IRQ_GET_TSR(call)  ((int) IPC_GET_ARG3(call))
     76
    7077static int irc_service = 0;
    7178static int irc_phone = -1;
     
    9299                /* Predicate for accepting the interrupt */
    93100                .cmd = CMD_PREDICATE,
    94                 .value = 3,
     101                .value = 4,
    95102                .srcarg = 3
    96103        },
     
    111118        },
    112119        {
     120                /* Read Transmit Status Register */
     121                .cmd = CMD_PIO_READ_8,
     122                .addr = NULL,
     123                .dstarg = 3
     124        },
     125        {
    113126                .cmd = CMD_ACCEPT
    114127        }
     
    125138/** Handle the interrupt notification.
    126139 *
    127  * This is the interrupt notification function.
     140 * This is the interrupt notification function. It is quarantied
     141 * that there is only a single instance of this notification
     142 * function running at one time until the return from the
     143 * ne2k_interrupt() function (where the interrupts are unmasked
     144 * again).
    128145 *
    129146 * @param[in] iid  Interrupt notification identifier.
     
    148165        fibril_rwlock_read_unlock(&netif_globals.lock);
    149166       
    150         if (ne2k != NULL)
    151                 ne2k_interrupt(ne2k, IRQ_GET_ISR(*call), nil_phone, device_id);
     167        if (ne2k != NULL) {
     168                link_t *frames =
     169                    ne2k_interrupt(ne2k, IRQ_GET_ISR(*call), IRQ_GET_TSR(*call));
     170               
     171                if (frames != NULL) {
     172                        while (!list_empty(frames)) {
     173                                frame_t *frame =
     174                                    list_get_instance(frames->next, frame_t, link);
     175                               
     176                                list_remove(&frame->link);
     177                                nil_received_msg(nil_phone, device_id, frame->packet,
     178                                    SERVICE_NONE);
     179                                free(frame);
     180                        }
     181                       
     182                        free(frames);
     183                }
     184        }
    152185}
    153186
Note: See TracChangeset for help on using the changeset viewer.