From flash@eru.tubank.msk.su  Fri May 24 05:52:56 1996
Received: from eru.tubank.msk.su (eru.tubank.msk.su [194.87.210.41])
          by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id FAA27336
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 24 May 1996 05:52:46 -0700 (PDT)
Received: by eru.tubank.msk.su (8.7.5/8.7.3)
	id QAA03516; Fri, 24 May 1996 16:52:16 +0400 (MSD)
Message-Id: <199605241252.QAA03516@eru.tubank.msk.su>
Date: Fri, 24 May 1996 16:52:16 +0400 (MSD)
From: flash@eru.tubank.msk.su
Reply-To: flash@eru.tubank.msk.su
To: FreeBSD-gnats-submit@freebsd.org
Subject: Bug in if_ep driver
X-Send-Pr-Version: 3.2

>Number:         1243
>Category:       i386
>Synopsis:       if_ep calculates wrong offset in 32-bit mode
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 24 06:00:01 PDT 1996
>Closed-Date:    Fri May 24 08:23:41 PDT 1996
>Last-Modified:  Fri May 24 08:26:19 PDT 1996
>Originator:     Alexander Tischenko
>Release:        FreeBSD 2.2-960501-SNAP i386
>Organization:
Society of Financial Telecommunications
>Environment:

Compaq Prosignia/300, Pentium 90MHz, 3C579/EISA EtherLink III.

>Description:

3C579 board is detected ok, reception in 32-bit mode works,
transmission not.

>How-To-Repeat:

	    outsl(BASE + EP_W1_TX_PIO_WR_1, mtod(m, caddr_t),
		  m->m_len / 4);
	    if (m->m_len & 3)
		outsb(BASE + EP_W1_TX_PIO_WR_1,
		      mtod(m, caddr_t) + m->m_len / 4,
		      m->m_len & 3);     ------------ !

>Fix:

Bug in the driver code.
i386/isa/if_ep.c, Line 798, offset from the start is incorrectly calculated.
Should be (m->m_len & (~3)) , not the number of long words in the buffer.

	    outsl(BASE + EP_W1_TX_PIO_WR_1, mtod(m, caddr_t),
		  m->m_len / 4);
	    if (m->m_len & 3)
		outsb(BASE + EP_W1_TX_PIO_WR_1,
		      mtod(m, caddr_t) + (m->m_len & (~3)),
		      m->m_len & 3);     -----------------
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: gibbs 
State-Changed-When: Fri May 24 08:23:41 PDT 1996 
State-Changed-Why:  
Suggested fix applied in revision 1.28.4.4 and 1.44 of i386/isa/if_ep.c. 
>Unformatted:
