Rev 4351 | Rev 4708 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4351 | Rev 4498 | ||
---|---|---|---|
Line 349... | Line 349... | ||
349 | dep->de_client= mp->DL_PROC; |
349 | dep->de_client= mp->DL_PROC; |
350 | */ |
350 | */ |
351 | if (dep->de_mode == DEM_SINK) |
351 | if (dep->de_mode == DEM_SINK) |
352 | { |
352 | { |
353 | assert(!from_int); |
353 | assert(!from_int); |
354 | dep->de_flags |= DEF_PACK_SEND; |
354 | // dep->de_flags |= DEF_PACK_SEND; |
355 | reply(dep, OK, FALSE); |
355 | reply(dep, OK, FALSE); |
356 | // return; |
356 | // return; |
357 | return EOK; |
357 | return EOK; |
358 | } |
358 | } |
359 | assert(dep->de_mode == DEM_ENABLED); |
359 | assert(dep->de_mode == DEM_ENABLED); |
360 | assert(dep->de_flags & DEF_ENABLED); |
360 | assert(dep->de_flags & DEF_ENABLED); |
- | 361 | if( dep->packet_queue && ( ! from_int )){ |
|
361 | if (dep->de_flags & DEF_SEND_AVAIL){ |
362 | // if (dep->de_flags & DEF_SEND_AVAIL){ |
362 | // panic("", "dp8390: send already in progress", NO_NUM); |
363 | // panic("", "dp8390: send already in progress", NO_NUM); |
363 | return queue_packet( dep, packet ); |
364 | return queue_packet( dep, packet ); |
364 | } |
365 | } |
365 | 366 | ||
366 | sendq_head= dep->de_sendq_head; |
367 | sendq_head= dep->de_sendq_head; |
367 | if (dep->de_sendq[sendq_head].sq_filled) |
368 | // if (dep->de_sendq[sendq_head].sq_filled) |
368 | { |
369 | // { |
369 | if (from_int) |
370 | // if (from_int) |
370 | panic("", "dp8390: should not be sending\n", NO_NUM); |
371 | // panic("", "dp8390: should not be sending\n", NO_NUM); |
371 | // dep->de_sendmsg= *mp; |
372 | // dep->de_sendmsg= *mp; |
372 | dep->de_flags |= DEF_SEND_AVAIL; |
373 | // dep->de_flags |= DEF_SEND_AVAIL; |
373 | reply(dep, OK, FALSE); |
374 | // reply(dep, OK, FALSE); |
374 | // return; |
375 | // return; |
375 | return queue_packet( dep, packet ); |
376 | // return queue_packet( dep, packet ); |
376 | } |
377 | // } |
377 | assert(!(dep->de_flags & DEF_PACK_SEND)); |
378 | // assert(!(dep->de_flags & DEF_PACK_SEND)); |
378 | 379 | ||
379 | /* if (vectored) |
380 | /* if (vectored) |
380 | { |
381 | { |
381 | get_userdata(mp->DL_PROC, (vir_bytes) mp->DL_ADDR, |
382 | get_userdata(mp->DL_PROC, (vir_bytes) mp->DL_ADDR, |
382 | (count > IOVEC_NR ? IOVEC_NR : count) * |
383 | (count > IOVEC_NR ? IOVEC_NR : count) * |
Line 428... | Line 429... | ||
428 | if (++sendq_head == dep->de_sendq_nr) |
429 | if (++sendq_head == dep->de_sendq_nr) |
429 | sendq_head= 0; |
430 | sendq_head= 0; |
430 | assert(sendq_head < SENDQ_NR); |
431 | assert(sendq_head < SENDQ_NR); |
431 | dep->de_sendq_head= sendq_head; |
432 | dep->de_sendq_head= sendq_head; |
432 | 433 | ||
433 | dep->de_flags |= DEF_PACK_SEND; |
434 | // dep->de_flags |= DEF_PACK_SEND; |
434 | 435 | ||
435 | /* If the interrupt handler called, don't send a reply. The reply |
436 | /* If the interrupt handler called, don't send a reply. The reply |
436 | * will be sent after all interrupts are handled. |
437 | * will be sent after all interrupts are handled. |
437 | */ |
438 | */ |
438 | if (from_int) |
439 | if (from_int) |
Line 718... | Line 719... | ||
718 | dep->de_sendq[sendq_tail].sq_sendpage); |
719 | dep->de_sendq[sendq_tail].sq_sendpage); |
719 | outb_reg0(dep, DP_TBCR1, size >> 8); |
720 | outb_reg0(dep, DP_TBCR1, size >> 8); |
720 | outb_reg0(dep, DP_TBCR0, size & 0xff); |
721 | outb_reg0(dep, DP_TBCR0, size & 0xff); |
721 | outb_reg0(dep, DP_CR, CR_TXP | CR_EXTRA); |
722 | outb_reg0(dep, DP_CR, CR_TXP | CR_EXTRA); |
722 | } |
723 | } |
723 | if (dep->de_flags & DEF_SEND_AVAIL) |
724 | // if (dep->de_flags & DEF_SEND_AVAIL) |
724 | dp_send(dep); |
725 | dp_send(dep); |
725 | } |
726 | } |
726 | 727 | ||
727 | if (isr & ISR_PRX) |
728 | if (isr & ISR_PRX) |
728 | { |
729 | { |
Line 881... | Line 882... | ||
881 | static void dp_send(dep) |
882 | static void dp_send(dep) |
882 | dpeth_t *dep; |
883 | dpeth_t *dep; |
883 | { |
884 | { |
884 | packet_t packet; |
885 | packet_t packet; |
885 | 886 | ||
886 | if (!(dep->de_flags & DEF_SEND_AVAIL)) |
887 | // if (!(dep->de_flags & DEF_SEND_AVAIL)) |
887 | return; |
888 | // return; |
888 | 889 | ||
889 | dep->de_flags &= ~DEF_SEND_AVAIL; |
- | |
890 | while( dep->packet_queue ){ |
890 | if( dep->packet_queue ){ |
891 | packet = dep->packet_queue; |
891 | packet = dep->packet_queue; |
892 | dep->packet_queue = pq_detach( packet ); |
892 | dep->packet_queue = pq_detach( packet ); |
893 | do_pwrite( dep, packet, TRUE ); |
893 | do_pwrite( dep, packet, TRUE ); |
894 | netif_pq_release( packet_get_id( packet )); |
894 | netif_pq_release( packet_get_id( packet )); |
895 | -- dep->packet_count; |
895 | -- dep->packet_count; |
896 | } |
896 | } |
- | 897 | // if( ! dep->packet_queue ){ |
|
- | 898 | // dep->de_flags &= ~DEF_SEND_AVAIL; |
|
- | 899 | // } |
|
897 | /* switch(dep->de_sendmsg.m_type) |
900 | /* switch(dep->de_sendmsg.m_type) |
898 | { |
901 | { |
899 | case DL_WRITE: do_vwrite(&dep->de_sendmsg, TRUE, FALSE); break; |
902 | case DL_WRITE: do_vwrite(&dep->de_sendmsg, TRUE, FALSE); break; |
900 | case DL_WRITEV: do_vwrite(&dep->de_sendmsg, TRUE, TRUE); break; |
903 | case DL_WRITEV: do_vwrite(&dep->de_sendmsg, TRUE, TRUE); break; |
901 | case DL_WRITEV_S: do_vwrite_s(&dep->de_sendmsg, TRUE); break; |
904 | case DL_WRITEV_S: do_vwrite_s(&dep->de_sendmsg, TRUE); break; |
Line 1555... | Line 1558... | ||
1555 | 1558 | ||
1556 | if (r < 0) |
1559 | if (r < 0) |
1557 | panic("", "dp8390: send failed:", r); |
1560 | panic("", "dp8390: send failed:", r); |
1558 | |
1561 | |
1559 | */ dep->de_read_s = 0; |
1562 | */ dep->de_read_s = 0; |
1560 | dep->de_flags &= ~(DEF_PACK_SEND | DEF_PACK_RECV); |
1563 | // dep->de_flags &= ~(DEF_PACK_SEND | DEF_PACK_RECV); |
1561 | } |
1564 | } |
1562 | 1565 | ||
1563 | /*===========================================================================* |
1566 | /*===========================================================================* |
1564 | * get_userdata * |
1567 | * get_userdata * |
1565 | *===========================================================================*/ |
1568 | *===========================================================================*/ |