cvs commit: src/sys/i386/i386 nexus.c src/sys/i386/include atomic.h src/sys/kern kern_poll.c lwkt_serialize.c src/sys/net if.c if_var.h rtsock.c src/sbin/ifconfig ifconfig.c src/sys/dev/netif/dc if_dc.c src/sys/dev/netif/em if_em.c if_em.h ...

Hiten Pandya hmp at backplane.com
Fri May 27 06:20:47 PDT 2005


Joerg Sonnenberger wrote:
On Wed, May 25, 2005 at 11:18:51AM -0700, Matthew Dillon wrote:

   My main desire is to simplify the APIs.  e.g. Having the driver's
   *interrupt* routine try to register the poll really complicates the
   poll registration code.


Attached is a better patch. The change to if_re illustrate the idea
how to handle some capabitilities specially and others not. I think
we can do the same for the checksum support in most drivers, they
can still override it if they want / have to. Even the up/down handling
could be implemented that way.
Joerg

------------------------------------------------------------------------

Index: sys/dev/netif/fwe/if_fwe.c
===================================================================
RCS file: /home/joerg/wd/repository/dragonflybsd/src/sys/dev/netif/fwe/if_fwe.c,v
retrieving revision 1.16
diff -u -r1.16 if_fwe.c
--- sys/dev/netif/fwe/if_fwe.c	25 May 2005 13:12:22 -0000	1.16
+++ sys/dev/netif/fwe/if_fwe.c	26 May 2005 19:08:46 -0000
@@ -204,6 +204,7 @@
 	ifp->if_capabilities = IFCAP_VLAN_MTU;
 #ifdef DEVICE_POLLING
 	ifp->if_poll = fwe_poll;
+	ifp->if_capabilities |= DEVICE_POLLING;
 #endif
 	ifp->if_mtu = ETHERMTU;
 	ifp->if_flags = (IFF_BROADCAST|IFF_SIMPLEX|IFF_MULTICAST);
	First, you are inconsistently setting DEVICE_POLLING in some
	places, when it should be IFCAP_POLLING.
	Secondly, why not just check if ifp->if_poll is set and then
	mark the interface has having polling capability in the generic
	interface code? i.e. in net/if.c somewhere ?
				Hiten





More information about the Commits mailing list