Changes in uspace/srv/hw/netif/dp8390/ne2000.c [7300c37:3c106e88] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/netif/dp8390/ne2000.c
r7300c37 r3c106e88 68 68 #define IRQ_GET_ISR(call) ((int) IPC_GET_ARG2(call)) 69 69 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 77 70 static int irc_service = 0; 78 71 static int irc_phone = -1; … … 83 76 static irq_cmd_t ne2k_cmds[] = { 84 77 { 85 /* Read Interrupt Status Register */86 78 .cmd = CMD_PIO_READ_8, 87 79 .addr = NULL, … … 89 81 }, 90 82 { 91 /* Mask supported interrupt causes */92 83 .cmd = CMD_BTEST, 93 .value = (ISR_PRX | ISR_PTX | ISR_RXE | ISR_TXE | ISR_OVW | 94 ISR_CNT | ISR_RDC), 84 .value = 0x7f, 95 85 .srcarg = 2, 96 86 .dstarg = 3, 97 87 }, 98 88 { 99 /* Predicate for accepting the interrupt */100 89 .cmd = CMD_PREDICATE, 101 .value = 4,90 .value = 2, 102 91 .srcarg = 3 103 92 }, 104 93 { 105 /*106 * Mask future interrupts via107 * Interrupt Mask Register108 */109 .cmd = CMD_PIO_WRITE_8,110 .addr = NULL,111 .value = 0112 },113 {114 /* Acknowledge the current interrupt */115 94 .cmd = CMD_PIO_WRITE_A_8, 116 95 .addr = NULL, … … 118 97 }, 119 98 { 120 /* Read Transmit Status Register */121 .cmd = CMD_PIO_READ_8,122 .addr = NULL,123 .dstarg = 3124 },125 {126 99 .cmd = CMD_ACCEPT 127 100 } … … 138 111 /** Handle the interrupt notification. 139 112 * 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). 113 * This is the interrupt notification function. 145 114 * 146 115 * @param[in] iid Interrupt notification identifier. … … 165 134 fibril_rwlock_read_unlock(&netif_globals.lock); 166 135 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 } 136 if (ne2k != NULL) 137 ne2k_interrupt(ne2k, IRQ_GET_ISR(*call), nil_phone, device_id); 185 138 } 186 139 … … 312 265 313 266 ne2k_cmds[0].addr = ne2k->port + DP_ISR; 314 ne2k_cmds[3].addr = ne2k->port + DP_IMR; 315 ne2k_cmds[4].addr = ne2k_cmds[0].addr; 267 ne2k_cmds[3].addr = ne2k_cmds[0].addr; 316 268 317 269 int rc = ipc_register_irq(ne2k->irq, device->device_id, … … 326 278 } 327 279 328 change_state(device, NETIF_ACTIVE);329 330 280 if (irc_service) 331 281 async_msg_1(irc_phone, IRC_ENABLE_INTERRUPT, ne2k->irq); 282 283 change_state(device, NETIF_ACTIVE); 332 284 } 333 285
Note:
See TracChangeset
for help on using the changeset viewer.