From 745a4e432edade619ea9eaa021c1cede686465f0 Mon Sep 17 00:00:00 2001 From: mdodd Date: Thu, 13 Jan 2000 06:46:02 +0000 Subject: When I converted this driver to newbus I also cleaned up the code layout. It seems that I cleaned it up a bit too much and confused a few if () { if () { } else { } } statements in the obvious manner. This allows the driver to transmit packets again. *sigh* --- sys/dev/ex/if_ex.c | 101 +++++++++++++++++++++++++++-------------------------- 1 file changed, 51 insertions(+), 50 deletions(-) (limited to 'sys/dev/ex') diff --git a/sys/dev/ex/if_ex.c b/sys/dev/ex/if_ex.c index 2472301..3ee3f01 100644 --- a/sys/dev/ex/if_ex.c +++ b/sys/dev/ex/if_ex.c @@ -616,10 +616,10 @@ ex_start(struct ifnet *ifp) XMT_HEADER_LEN) { dest = sc->tx_lower_limit; next = dest + len; + } else { + next = sc->tx_lower_limit + + next - sc->tx_upper_limit - 2; } - } else { - next = sc->tx_lower_limit + - next - sc->tx_upper_limit - 2; } /* @@ -655,60 +655,61 @@ ex_start(struct ifnet *ifp) } if (i) { outsw(iobase + IO_PORT_REG, tmp16, 1); + } - /* - * If there were other frames chained, update the - * chain in the last one. - */ - if (sc->tx_head != sc->tx_tail) { - if (sc->tx_tail != dest) { - outw(iobase + HOST_ADDR_REG, - sc->tx_last + XMT_Chain_Point); - outw(iobase + IO_PORT_REG, dest); - } - outw(iobase + HOST_ADDR_REG, - sc->tx_last + XMT_Byte_Count); - i = inw(iobase + IO_PORT_REG); + /* + * If there were other frames chained, update the + * chain in the last one. + */ + if (sc->tx_head != sc->tx_tail) { + if (sc->tx_tail != dest) { outw(iobase + HOST_ADDR_REG, - sc->tx_last + XMT_Byte_Count); - outw(iobase + IO_PORT_REG, i | Ch_bit); + sc->tx_last + XMT_Chain_Point); + outw(iobase + IO_PORT_REG, dest); } - - /* - * Resume normal operation of the card: - * - Make a dummy read to flush the DRAM write - * pipeline. - * - Enable receive and transmit interrupts. - * - Send Transmit or Resume_XMT command, as - * appropriate. - */ - inw(iobase + IO_PORT_REG); + outw(iobase + HOST_ADDR_REG, + sc->tx_last + XMT_Byte_Count); + i = inw(iobase + IO_PORT_REG); + outw(iobase + HOST_ADDR_REG, + sc->tx_last + XMT_Byte_Count); + outw(iobase + IO_PORT_REG, i | Ch_bit); + } + + /* + * Resume normal operation of the card: + * - Make a dummy read to flush the DRAM write + * pipeline. + * - Enable receive and transmit interrupts. + * - Send Transmit or Resume_XMT command, as + * appropriate. + */ + inw(iobase + IO_PORT_REG); #ifdef EX_PSA_INTR - outb(iobase + MASK_REG, All_Int & ~(Rx_Int | Tx_Int)); + outb(iobase + MASK_REG, All_Int & ~(Rx_Int | Tx_Int)); #endif - if (sc->tx_head == sc->tx_tail) { - outw(iobase + XMT_BAR, dest); - outb(iobase + CMD_REG, Transmit_CMD); - sc->tx_head = dest; - DODEBUG(Sent_Pkts, printf("Transmit\n");); - } else { - outb(iobase + CMD_REG, Resume_XMT_List_CMD); - DODEBUG(Sent_Pkts, printf("Resume\n");); - } - - sc->tx_last = dest; - sc->tx_tail = next; - - if (ifp->if_bpf != NULL) { - bpf_mtap(ifp, opkt); - } - ifp->if_timer = 2; - ifp->if_opackets++; - m_freem(opkt); + if (sc->tx_head == sc->tx_tail) { + outw(iobase + XMT_BAR, dest); + outb(iobase + CMD_REG, Transmit_CMD); + sc->tx_head = dest; + DODEBUG(Sent_Pkts, printf("Transmit\n");); } else { - ifp->if_flags |= IFF_OACTIVE; - DODEBUG(Status, printf("OACTIVE start\n");); + outb(iobase + CMD_REG, Resume_XMT_List_CMD); + DODEBUG(Sent_Pkts, printf("Resume\n");); } + + sc->tx_last = dest; + sc->tx_tail = next; + + if (ifp->if_bpf != NULL) { + bpf_mtap(ifp, opkt); + } + + ifp->if_timer = 2; + ifp->if_opackets++; + m_freem(opkt); + } else { + ifp->if_flags |= IFF_OACTIVE; + DODEBUG(Status, printf("OACTIVE start\n");); } } -- cgit v1.1