Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Apr 2004 10:13:13 -0700 (PDT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 50856 for review
Message-ID:  <200404111713.i3BHDDUX035974@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=50856

Change 50856 by rwatson@rwatson_paprika on 2004/04/11 10:13:08

	Integrate netperf_socket:
	
	nge if_ipending -> if_flags fix in nge.
	if_xe doesn't match every card.
	if_ipending GC from struct ifnet.
	if_rl supports configurable polling.

Affected files ...

.. //depot/projects/netperf_socket/sys/dev/nge/if_nge.c#5 integrate
.. //depot/projects/netperf_socket/sys/dev/xe/if_xe_pccard.c#3 integrate
.. //depot/projects/netperf_socket/sys/net/if_var.h#6 integrate
.. //depot/projects/netperf_socket/sys/pci/if_rl.c#7 integrate

Differences ...

==== //depot/projects/netperf_socket/sys/dev/nge/if_nge.c#5 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/nge/if_nge.c,v 1.55 2004/03/30 10:24:52 ru Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/nge/if_nge.c,v 1.56 2004/04/11 16:26:39 rwatson Exp $");
 
 /*
  * National Semiconductor DP83820/DP83821 gigabit ethernet driver
@@ -1310,7 +1310,7 @@
 		u_int32_t		extsts;
 
 #ifdef DEVICE_POLLING
-		if (ifp->if_ipending & IFF_POLLING) {
+		if (ifp->if_flags & IFF_POLLING) {
 			if (sc->rxcycles <= 0)
 				break;
 			sc->rxcycles--;
@@ -1576,7 +1576,7 @@
 	ifp = &sc->arpcom.ac_if;
 
 #ifdef DEVICE_POLLING
-	if (ifp->if_ipending & IFF_POLLING)
+	if (ifp->if_flags & IFF_POLLING)
 		return;
 	if (ether_poll_register(nge_poll, ifp)) { /* ok, disable interrupts */
 		CSR_WRITE_4(sc, NGE_IER, 0);
@@ -1956,7 +1956,7 @@
 	 * ... only enable interrupts if we are not polling, make sure
 	 * they are off otherwise.
 	 */
-	if (ifp->if_ipending & IFF_POLLING)
+	if (ifp->if_flags & IFF_POLLING)
 		CSR_WRITE_4(sc, NGE_IER, 0);
 	else
 #endif /* DEVICE_POLLING */

==== //depot/projects/netperf_socket/sys/dev/xe/if_xe_pccard.c#3 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/xe/if_xe_pccard.c,v 1.16 2004/04/09 17:34:54 rsm Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/xe/if_xe_pccard.c,v 1.17 2004/04/11 16:34:29 rsm Exp $");
 
 /* xe pccard interface driver */
 
@@ -408,7 +408,7 @@
 	pccard_get_prodext(dev, &prodext);
 
 	if (xpp->prodext != prodext)
-		vpfmatch--;
+		vpfmatch = 0;
 
 	return (vpfmatch);
 }

==== //depot/projects/netperf_socket/sys/net/if_var.h#6 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	From: @(#)if.h	8.1 (Berkeley) 6/10/93
- * $FreeBSD: src/sys/net/if_var.h,v 1.67 2004/04/07 20:46:11 imp Exp $
+ * $FreeBSD: src/sys/net/if_var.h,v 1.68 2004/04/11 16:35:53 rwatson Exp $
  */
 
 #ifndef	_NET_IF_VAR_H_
@@ -140,7 +140,6 @@
 	int	if_flags;		/* up/down, broadcast, etc. */
 	int	if_capabilities;	/* interface capabilities */
 	int	if_capenable;		/* enabled features */
-	int	if_ipending;		/* interrupts pending */
 	void	*if_linkmib;		/* link-type-specific MIB data */
 	size_t	if_linkmiblen;		/* length of above data */
 	struct	if_data if_data;
@@ -207,12 +206,6 @@
 #define	if_list		if_link
 
 /*
- * Bit values in if_ipending
- */
-#define	IFI_RECV	1	/* I want to receive */
-#define	IFI_XMIT	2	/* I want to transmit */
-
-/*
  * Output queues (ifp->if_snd) and slow device input queues (*ifp->if_slowq)
  * are queues of messages stored on ifqueue structures
  * (defined above).  Entries are added to and deleted from these structures

==== //depot/projects/netperf_socket/sys/pci/if_rl.c#7 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_rl.c,v 1.134 2004/04/03 00:42:33 ru Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/if_rl.c,v 1.135 2004/04/11 16:23:16 ru Exp $");
 
 /*
  * RealTek 8129/8139 PCI NIC driver
@@ -1096,6 +1096,9 @@
 	ifp->if_init = rl_init;
 	ifp->if_baudrate = 10000000;
 	ifp->if_capabilities = IFCAP_VLAN_MTU;
+#ifdef DEVICE_POLLING
+	ifp->if_capabilities |= IFCAP_POLLING;
+#endif
 	ifp->if_capenable = ifp->if_capabilities;
 	ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
 	
@@ -1430,6 +1433,10 @@
 	struct rl_softc *sc = ifp->if_softc;
 
 	RL_LOCK(sc);
+	if (!(ifp->if_capenable & IFCAP_POLLING)) {
+		ether_poll_deregister(ifp);
+		cmd = POLL_DEREGISTER;
+	}
 	if (cmd == POLL_DEREGISTER) { /* final call, enable interrupts */
 		CSR_WRITE_2(sc, RL_IMR, RL_INTRS);
 		goto done;
@@ -1484,7 +1491,8 @@
 #ifdef DEVICE_POLLING
 	if  (ifp->if_flags & IFF_POLLING)
 		goto done;
-	if (ether_poll_register(rl_poll, ifp)) { /* ok, disable interrupts */
+	if ((ifp->if_capenable & IFCAP_POLLING) &&
+	    ether_poll_register(rl_poll, ifp)) { /* ok, disable interrupts */
 		CSR_WRITE_2(sc, RL_IMR, 0x0000);
 		rl_poll(ifp, 0, 1);
 		goto done;
@@ -1821,6 +1829,9 @@
 		mii = device_get_softc(sc->rl_miibus);
 		error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
 		break;
+	case SIOCSIFCAP:
+		ifp->if_capenable = ifr->ifr_reqcap;
+		break;
 	default:
 		error = ether_ioctl(ifp, command, data);
 		break;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200404111713.i3BHDDUX035974>