mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Patches from Serge Babkin to fix interrupt handling bugs.
Submitted by: Serge Babkin
This commit is contained in:
parent
fadfd39bdf
commit
0602287958
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=7267
@ -27,7 +27,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_ep.c,v 1.18 1995/01/08 10:47:23 davidg Exp $
|
||||
* $Id: if_ep.c,v 1.19 1995/01/24 20:53:45 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -451,8 +451,12 @@ epinit(unit)
|
||||
|
||||
outw(BASE + EP_COMMAND, SET_INTR_MASK | S_5_INTS);
|
||||
|
||||
outw(BASE + EP_COMMAND, SET_RX_FILTER | FIL_INDIVIDUAL |
|
||||
FIL_GROUP | FIL_BRDCST);
|
||||
if(ep_ftst(F_PROMISC))
|
||||
outw(BASE + EP_COMMAND, SET_RX_FILTER | FIL_INDIVIDUAL |
|
||||
FIL_GROUP | FIL_BRDCST | FIL_ALL);
|
||||
else
|
||||
outw(BASE + EP_COMMAND, SET_RX_FILTER | FIL_INDIVIDUAL |
|
||||
FIL_GROUP | FIL_BRDCST);
|
||||
|
||||
/*
|
||||
* you can `ifconfig ep0 (bnc|aui)' to get the following
|
||||
@ -643,8 +647,8 @@ epintr(unit)
|
||||
struct ifnet *ifp = &sc->arpcom.ac_if;
|
||||
struct mbuf *m;
|
||||
|
||||
outw(BASE + EP_COMMAND, SET_INTR_MASK); /* disable all Ints */
|
||||
outw(BASE + EP_COMMAND, C_INTR_LATCH); /* ACK int Latch */
|
||||
rescan:
|
||||
/* outw(BASE + EP_COMMAND, SET_INTR_MASK); /* disable all Ints */
|
||||
|
||||
while ((status = inw(BASE + EP_STATUS)) & S_5_INTS) {
|
||||
if (status & (S_RX_COMPLETE | S_RX_EARLY)) {
|
||||
@ -672,7 +676,7 @@ epintr(unit)
|
||||
sc->rx_no_first, sc->rx_no_mbuf, sc->rx_bpf_disc, sc->rx_overrunf,
|
||||
sc->rx_overrunl, sc->tx_underrun);
|
||||
#else
|
||||
printf("ep%d: Status: %x\n", unit, status);
|
||||
printf("ep%d: Status: %x\n", unit, status);
|
||||
#endif
|
||||
epinit(unit);
|
||||
return;
|
||||
@ -716,7 +720,12 @@ epintr(unit)
|
||||
} /* end TX_COMPLETE */
|
||||
}
|
||||
/* re-enable ints */
|
||||
outw(BASE + EP_COMMAND, SET_INTR_MASK | S_5_INTS);
|
||||
/* outw(BASE + EP_COMMAND, SET_INTR_MASK | S_5_INTS); */
|
||||
|
||||
outw(BASE + EP_COMMAND, C_INTR_LATCH); /* ACK int Latch */
|
||||
|
||||
if ((status = inw(BASE + EP_STATUS)) & S_5_INTS)
|
||||
goto rescan;
|
||||
}
|
||||
|
||||
void
|
||||
@ -1016,6 +1025,16 @@ epioctl(ifp, cmd, data)
|
||||
}
|
||||
if (ifp->if_flags & IFF_UP && (ifp->if_flags & IFF_RUNNING) == 0)
|
||||
epinit(ifp->if_unit);
|
||||
|
||||
if ( (ifp->if_flags & IFF_PROMISC) && !ep_ftst(F_PROMISC) ) {
|
||||
ep_fset(F_PROMISC);
|
||||
epinit(ifp->if_unit);
|
||||
}
|
||||
else if( !(ifp->if_flags & IFF_PROMISC) && ep_ftst(F_PROMISC) ) {
|
||||
ep_frst(F_PROMISC);
|
||||
epinit(ifp->if_unit);
|
||||
}
|
||||
|
||||
break;
|
||||
#ifdef notdef
|
||||
case SIOCGHWADDR:
|
||||
|
@ -19,7 +19,7 @@
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_epreg.h,v 1.2 1994/01/10 19:13:50 ats Exp $ Modified by:
|
||||
* $Id: if_epreg.h,v 1.4 1994/11/13 10:12:37 gibbs Exp $ Modified by:
|
||||
*
|
||||
October 2, 1994
|
||||
|
||||
@ -55,6 +55,7 @@ struct ep_softc {
|
||||
#define F_RX_FIRST 0x1
|
||||
#define F_WAIT_TRAIL 0x2
|
||||
#define F_RX_TRAILER 0x4
|
||||
#define F_PROMISC 0x8
|
||||
|
||||
#define F_ACCESS_32_BITS 0x100
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_ep.c,v 1.18 1995/01/08 10:47:23 davidg Exp $
|
||||
* $Id: if_ep.c,v 1.19 1995/01/24 20:53:45 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -451,8 +451,12 @@ epinit(unit)
|
||||
|
||||
outw(BASE + EP_COMMAND, SET_INTR_MASK | S_5_INTS);
|
||||
|
||||
outw(BASE + EP_COMMAND, SET_RX_FILTER | FIL_INDIVIDUAL |
|
||||
FIL_GROUP | FIL_BRDCST);
|
||||
if(ep_ftst(F_PROMISC))
|
||||
outw(BASE + EP_COMMAND, SET_RX_FILTER | FIL_INDIVIDUAL |
|
||||
FIL_GROUP | FIL_BRDCST | FIL_ALL);
|
||||
else
|
||||
outw(BASE + EP_COMMAND, SET_RX_FILTER | FIL_INDIVIDUAL |
|
||||
FIL_GROUP | FIL_BRDCST);
|
||||
|
||||
/*
|
||||
* you can `ifconfig ep0 (bnc|aui)' to get the following
|
||||
@ -643,8 +647,8 @@ epintr(unit)
|
||||
struct ifnet *ifp = &sc->arpcom.ac_if;
|
||||
struct mbuf *m;
|
||||
|
||||
outw(BASE + EP_COMMAND, SET_INTR_MASK); /* disable all Ints */
|
||||
outw(BASE + EP_COMMAND, C_INTR_LATCH); /* ACK int Latch */
|
||||
rescan:
|
||||
/* outw(BASE + EP_COMMAND, SET_INTR_MASK); /* disable all Ints */
|
||||
|
||||
while ((status = inw(BASE + EP_STATUS)) & S_5_INTS) {
|
||||
if (status & (S_RX_COMPLETE | S_RX_EARLY)) {
|
||||
@ -672,7 +676,7 @@ epintr(unit)
|
||||
sc->rx_no_first, sc->rx_no_mbuf, sc->rx_bpf_disc, sc->rx_overrunf,
|
||||
sc->rx_overrunl, sc->tx_underrun);
|
||||
#else
|
||||
printf("ep%d: Status: %x\n", unit, status);
|
||||
printf("ep%d: Status: %x\n", unit, status);
|
||||
#endif
|
||||
epinit(unit);
|
||||
return;
|
||||
@ -716,7 +720,12 @@ epintr(unit)
|
||||
} /* end TX_COMPLETE */
|
||||
}
|
||||
/* re-enable ints */
|
||||
outw(BASE + EP_COMMAND, SET_INTR_MASK | S_5_INTS);
|
||||
/* outw(BASE + EP_COMMAND, SET_INTR_MASK | S_5_INTS); */
|
||||
|
||||
outw(BASE + EP_COMMAND, C_INTR_LATCH); /* ACK int Latch */
|
||||
|
||||
if ((status = inw(BASE + EP_STATUS)) & S_5_INTS)
|
||||
goto rescan;
|
||||
}
|
||||
|
||||
void
|
||||
@ -1016,6 +1025,16 @@ epioctl(ifp, cmd, data)
|
||||
}
|
||||
if (ifp->if_flags & IFF_UP && (ifp->if_flags & IFF_RUNNING) == 0)
|
||||
epinit(ifp->if_unit);
|
||||
|
||||
if ( (ifp->if_flags & IFF_PROMISC) && !ep_ftst(F_PROMISC) ) {
|
||||
ep_fset(F_PROMISC);
|
||||
epinit(ifp->if_unit);
|
||||
}
|
||||
else if( !(ifp->if_flags & IFF_PROMISC) && ep_ftst(F_PROMISC) ) {
|
||||
ep_frst(F_PROMISC);
|
||||
epinit(ifp->if_unit);
|
||||
}
|
||||
|
||||
break;
|
||||
#ifdef notdef
|
||||
case SIOCGHWADDR:
|
||||
|
@ -19,7 +19,7 @@
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_epreg.h,v 1.2 1994/01/10 19:13:50 ats Exp $ Modified by:
|
||||
* $Id: if_epreg.h,v 1.4 1994/11/13 10:12:37 gibbs Exp $ Modified by:
|
||||
*
|
||||
October 2, 1994
|
||||
|
||||
@ -55,6 +55,7 @@ struct ep_softc {
|
||||
#define F_RX_FIRST 0x1
|
||||
#define F_WAIT_TRAIL 0x2
|
||||
#define F_RX_TRAILER 0x4
|
||||
#define F_PROMISC 0x8
|
||||
|
||||
#define F_ACCESS_32_BITS 0x100
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user