Changeset 6fc0edd in mainline
- Timestamp:
- 2011-01-06T16:37:53Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b590c21
- Parents:
- 0777f4c5
- Location:
- uspace/srv/hw/netif/dp8390
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/netif/dp8390/dp8390.c
r0777f4c5 r6fc0edd 478 478 } 479 479 480 void dp_check_ints(dpeth_t *dep )481 { 482 int isr,tsr;480 void dp_check_ints(dpeth_t *dep, int isr) 481 { 482 int tsr; 483 483 int size, sendq_tail; 484 484 … … 486 486 fprintf(stderr, "dp8390: got premature interrupt\n"); 487 487 488 for (;;) { 489 isr = inb_reg0(dep, DP_ISR); 490 if (!isr) 491 break; 492 488 for (; isr; isr = inb_reg0(dep, DP_ISR)) { 493 489 outb_reg0(dep, DP_ISR, isr); 494 490 … … 524 520 525 521 if (!(dep->de_sendq[sendq_tail].sq_filled)) { 526 /* Software bug? */527 assert(false);528 529 522 /* Or hardware bug? */ 530 523 printf("%s: transmit interrupt, but not sending\n", dep->de_name); … … 601 594 } 602 595 603 /*===========================================================================* 604 * dp_recv * 605 *===========================================================================*/ 606 static void dp_recv(dep) 607 dpeth_t *dep; 596 static void dp_recv(dpeth_t *dep) 608 597 { 609 598 dp_rcvhdr_t header; -
uspace/srv/hw/netif/dp8390/dp8390.h
r0777f4c5 r6fc0edd 263 263 phys_bytes de_linmem; 264 264 int de_irq; 265 int de_int_pending; 266 dp_initf_t de_initf; 267 dp_stopf_t de_stopf; 265 dp_initf_t de_initf; 266 dp_stopf_t de_stopf; 268 267 char de_name[sizeof("dp8390#n")]; 269 268 -
uspace/srv/hw/netif/dp8390/dp8390_drv.h
r0777f4c5 r6fc0edd 56 56 * @param[in,out] dep The network interface structure. 57 57 */ 58 void dp_check_ints(dpeth_t *dep );58 void dp_check_ints(dpeth_t *dep, int isr); 59 59 60 60 /** Probes and initializes the network interface. -
uspace/srv/hw/netif/dp8390/dp8390_module.c
r0777f4c5 r6fc0edd 58 58 #define NAME "dp8390" 59 59 60 /** Returns the device from the interrupt call. 60 /** Return the device from the interrupt call. 61 * 61 62 * @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)) 64 73 65 74 /** DP8390 kernel interrupt command sequence. … … 72 81 }, 73 82 { 83 .cmd = CMD_BTEST, 84 .value = 0x7f, 85 .srcarg = 2, 86 .dstarg = 3, 87 }, 88 { 74 89 .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 77 97 }, 78 98 { … … 101 121 int phone; 102 122 103 device_id = IRQ_GET_DEVICE( call);123 device_id = IRQ_GET_DEVICE(*call); 104 124 fibril_rwlock_write_lock(&netif_globals.lock); 105 125 … … 117 137 assert(dep->de_flags & DEF_ENABLED); 118 138 119 dep->de_int_pending = 0; 120 dp_check_ints(dep); 139 dp_check_ints(dep, IRQ_GET_ISR(*call)); 121 140 122 141 if (dep->received_queue) { … … 279 298 280 299 if (do_pwrite(dep, packet, false) != EBUSY) 281 netif_pq_release(packet_get_id(packet)); \300 netif_pq_release(packet_get_id(packet)); 282 301 283 302 packet = next; … … 295 314 dep = (dpeth_t *) device->specific; 296 315 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; 298 317 299 318 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.