PERFORCE change 105747 for review

Matt Jacob mjacob at FreeBSD.org
Wed Sep 6 22:17:23 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=105747

Change 105747 by mjacob at newisp on 2006/09/06 22:15:12

	IFC

Affected files ...

.. //depot/projects/newisp/amd64/amd64/local_apic.c#3 integrate
.. //depot/projects/newisp/contrib/pf/net/pf_ioctl.c#2 integrate
.. //depot/projects/newisp/dev/iicbus/iic.c#2 integrate
.. //depot/projects/newisp/dev/isp/isp.c#9 edit
.. //depot/projects/newisp/dev/usb/ugen.c#2 integrate
.. //depot/projects/newisp/i386/acpica/Makefile#2 integrate
.. //depot/projects/newisp/i386/i386/local_apic.c#3 integrate
.. //depot/projects/newisp/kern/uipc_sockbuf.c#2 integrate
.. //depot/projects/newisp/kern/vfs_aio.c#2 integrate
.. //depot/projects/newisp/net/if.c#2 integrate
.. //depot/projects/newisp/net/if.h#2 integrate
.. //depot/projects/newisp/net/if_var.h#2 integrate
.. //depot/projects/newisp/netinet/in_pcb.c#2 integrate
.. //depot/projects/newisp/netinet/ip_output.c#2 integrate
.. //depot/projects/newisp/netinet/raw_ip.c#2 integrate
.. //depot/projects/newisp/netinet/tcp_input.c#2 integrate
.. //depot/projects/newisp/netinet/tcp_subr.c#3 integrate
.. //depot/projects/newisp/netinet/tcp_timer.c#2 integrate
.. //depot/projects/newisp/netinet/tcp_var.h#2 integrate
.. //depot/projects/newisp/netinet/udp_usrreq.c#3 integrate
.. //depot/projects/newisp/netinet6/icmp6.c#2 integrate
.. //depot/projects/newisp/sys/mbuf.h#2 integrate

Differences ...

==== //depot/projects/newisp/amd64/amd64/local_apic.c#3 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.27 2006/09/05 17:15:24 sobomax Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.28 2006/09/06 22:05:34 sobomax Exp $");
 
 #include "opt_hwpmc_hooks.h"
 
@@ -613,6 +613,7 @@
 	/* Send EOI first thing. */
 	lapic_eoi();
 
+#ifdef SMP
 	/*
 	 * Don't do any accounting for the disabled HTT cores, since it
 	 * will provide misleading numbers for the userland.
@@ -622,6 +623,7 @@
 	 */
 	if ((hlt_cpus_mask & (1 << PCPU_GET(cpuid))) != 0)
 		return;
+#endif
 
 	/* Look up our local APIC structure for the tick counters. */
 	la = &lapics[PCPU_GET(apic_id)];

==== //depot/projects/newisp/contrib/pf/net/pf_ioctl.c#2 (text+ko) ====

@@ -1,4 +1,4 @@
-/*	$FreeBSD: src/sys/contrib/pf/net/pf_ioctl.c,v 1.25 2006/07/21 09:48:13 mlaier Exp $	*/
+/*	$FreeBSD: src/sys/contrib/pf/net/pf_ioctl.c,v 1.26 2006/09/06 17:19:45 mlaier Exp $	*/
 /*	$OpenBSD: pf_ioctl.c,v 1.139 2005/03/03 07:13:39 dhartmei Exp $	*/
 /* add:	$OpenBSD: pf_ioctl.c,v 1.168 2006/07/21 01:21:17 dhartmei Exp $ */
 
@@ -3438,11 +3438,17 @@
     struct inpcb *inp)
 {
 	/*
-	 * IPv6 does not affected ip_len/ip_off byte order changes.
+	 * IPv6 is not affected by ip_len/ip_off byte order changes.
 	 */
 	int chk;
 
-	chk = pf_test6(PF_IN, ifp, m, NULL, inp);
+	/*
+	 * In case of loopback traffic IPv6 uses the real interface in
+	 * order to support scoped addresses. In order to support stateful
+	 * filtering we have change this to lo0 as it is the case in IPv4.
+	 */
+	chk = pf_test6(PF_IN, (*m)->m_flags & M_LOOP ? &loif[0] : ifp, m,
+	    NULL, inp);
 	if (chk && *m) {
 		m_freem(*m);
 		*m = NULL;

==== //depot/projects/newisp/dev/iicbus/iic.c#2 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/iicbus/iic.c,v 1.35 2006/07/14 23:15:06 imp Exp $
+ * $FreeBSD: src/sys/dev/iicbus/iic.c,v 1.37 2006/09/06 20:22:43 imp Exp $
  *
  */
 #include <sys/param.h>

==== //depot/projects/newisp/dev/isp/isp.c#9 (text+ko) ====

@@ -2095,11 +2095,7 @@
 	plp->plogx_portlo = portid;
 	plp->plogx_rspsz_porthi = (portid >> 16) & 0xff;
 	if (log_ret) {
-		if (*log_ret) {
-			plp->plogx_flags = 0;
-		} else {
-			plp->plogx_flags = 0xc8;
-		}
+		plp->plogx_flags = *log_ret;
 	} else {
 		log_ret = &junk;
 	}
@@ -2192,7 +2188,7 @@
 		*log_ret = MBOX_PORT_ID_USED;
 		break;
 	case PLOGX_IOCBERR_HNDLUSED:
-		isp_prt(isp, /* ISP_LOGDEBUG0 */ ISP_LOGALL,
+		isp_prt(isp, ISP_LOGDEBUG0,
 		    "N-port handle 0x%x already used for portid 0x%x",
 		    handle, parm1);
 		*log_ret = MBOX_LOOP_ID_USED;
@@ -3092,7 +3088,6 @@
 		return (1);
 	}
 
-
 	/*
 	 * Build a Passthrough IOCB in memory.
 	 */
@@ -3198,7 +3193,7 @@
 		FC_SCRATCH_RELEASE(isp);
 		return (0);
 	} else if (r < 0) {
-		fcp->isp_loopstate = LOOP_PDB_RCVD;	/* try again */
+		fcp->isp_loopstate = LOOP_LIP_RCVD;	/* try again */
 		FC_SCRATCH_RELEASE(isp);
 		return (0);
 	}
@@ -3500,7 +3495,7 @@
 			 * Try and log out of the device first.
 			 */
 			if (IS_24XX(isp)) {
-				logval = 0;
+				logval = 0xc8;
 				isp_plogx_24xx(isp, handle, portid, &logval);
 			} else {
 				isp_port_logout(isp, handle, portid);
@@ -3514,7 +3509,7 @@
 			 * Try and log into the device.
 			 */
 			if (IS_24XX(isp)) {
-				logval = 1;
+				logval = 0;
 				isp_plogx_24xx(isp, handle, portid, &logval);
 			} else {
 				logval = isp_port_login(isp, handle, portid);
@@ -6830,7 +6825,7 @@
 isp_reinit(ispsoftc_t *isp)
 {
 	XS_T *xs;
-	int i;
+	uint32_t tmp;
 
 	if (IS_FC(isp)) {
 		isp_mark_portdb(isp, 0);
@@ -6850,13 +6845,17 @@
 	}
 	isp->isp_nactive = 0;
 
-	for (i = 0; i < isp->isp_maxcmds; i++) {
+	for (tmp = 0; tmp < isp->isp_maxcmds; tmp++) {
 		uint16_t handle;
-		xs = isp->isp_xflist[i];
+
+		xs = isp->isp_xflist[tmp];
 		if (xs == NULL) {
 			continue;
 		}
-		handle = isp_index_handle(i);
+		handle = isp_find_handle(isp, xs);
+		if (handle == 0) {
+			continue;
+		}
 		isp_destroy_handle(isp, handle);
 		if (XS_XFRLEN(xs)) {
 			ISP_DMAFREE(isp, xs, handle);

==== //depot/projects/newisp/dev/usb/ugen.c#2 (text+ko) ====

@@ -8,7 +8,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/ugen.c,v 1.106 2006/06/05 14:44:39 iedowse Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/ugen.c,v 1.107 2006/09/06 21:53:28 imp Exp $");
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -52,24 +52,15 @@
 #include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/malloc.h>
-#if defined(__NetBSD__) || defined(__OpenBSD__)
-#include <sys/device.h>
-#include <sys/ioctl.h>
-#elif defined(__FreeBSD__)
 #include <sys/module.h>
 #include <sys/bus.h>
 #include <sys/ioccom.h>
 #include <sys/conf.h>
 #include <sys/fcntl.h>
 #include <sys/filio.h>
-#endif
 #include <sys/tty.h>
 #include <sys/file.h>
-#if __FreeBSD_version >= 500014
 #include <sys/selinfo.h>
-#else
-#include <sys/select.h>
-#endif
 #include <sys/poll.h>
 #include <sys/sysctl.h>
 #include <sys/uio.h>
@@ -79,8 +70,8 @@
 #include <dev/usb/usbdi_util.h>
 
 #ifdef USB_DEBUG
-#define DPRINTF(x)	if (ugendebug) logprintf x
-#define DPRINTFN(n,x)	if (ugendebug>(n)) logprintf x
+#define DPRINTF(x)	if (ugendebug) printf x
+#define DPRINTFN(n,x)	if (ugendebug>(n)) printf x
 int	ugendebug = 0;
 SYSCTL_NODE(_hw_usb, OID_AUTO, ugen, CTLFLAG_RW, 0, "USB ugen");
 SYSCTL_INT(_hw_usb_ugen, OID_AUTO, debug, CTLFLAG_RW,
@@ -100,9 +91,7 @@
 
 struct ugen_endpoint {
 	struct ugen_softc *sc;
-#if defined(__FreeBSD__)
 	struct cdev *dev;
-#endif
 	usb_endpoint_descriptor_t *edesc;
 	usbd_interface_handle iface;
 	int state;
@@ -127,16 +116,13 @@
 struct ugen_softc {
 	USBBASEDEVICE sc_dev;		/* base device */
 	usbd_device_handle sc_udev;
-#if defined(__FreeBSD__)
 	struct cdev *dev;
-#endif
 
 	char sc_is_open[USB_MAX_ENDPOINTS];
 	struct ugen_endpoint sc_endpoints[USB_MAX_ENDPOINTS][2];
 #define OUT 0
 #define IN  1
 
-#ifdef __FreeBSD__
 #define	UGEN_DEV_REF(dev, sc)					\
 	if ((sc)->sc_dying || dev_refthread(dev) == NULL)	\
 		return (ENXIO)
@@ -146,26 +132,9 @@
 	/* handled by dev layer */
 #define	UGEN_DEV_CLOSE(dev, sc)		\
 	/* handled by dev layer */
-#else
-	int sc_refcnt;
-#define	UGEN_DEV_REF(dev, sc)	\
-	if ((sc)->sc_dying)	\
-		return (ENXIO);	\
-	(sc)->sc_refcnt++
-#define	UGEN_DEV_RELE(dev, sc)				\
-	if (--(sc)->sc_refcnt < 0)			\
-		usb_detach_wakeup(USBDEV((sc)->sc_dev))
-#define	UGEN_DEV_OPEN(dev, sc)	\
-	(sc)->sc_refcnt++
-#define	UGEN_DEV_CLOSE(dev, sc)	\
-	UGEN_DEV_RELE(dev, sc)
-#endif
 	u_char sc_dying;
 };
 
-#if defined(__NetBSD__) || defined(__OpenBSD__)
-cdev_decl(ugen);
-#elif defined(__FreeBSD__)
 d_open_t  ugenopen;
 d_close_t ugenclose;
 d_read_t  ugenread;
@@ -174,7 +143,7 @@
 d_poll_t  ugenpoll;
 d_purge_t ugenpurge;
 
-Static struct cdevsw ugenctl_cdevsw = {
+static struct cdevsw ugenctl_cdevsw = {
 	.d_version =	D_VERSION,
 	.d_flags =	D_NEEDGIANT,
 	.d_open =	ugenopen,
@@ -182,12 +151,9 @@
 	.d_ioctl =	ugenioctl,
 	.d_purge =	ugenpurge,
 	.d_name =	"ugenctl",
-#if __FreeBSD_version < 500014
-	.d_bmaj		-1
-#endif
 };
 
-Static struct cdevsw ugen_cdevsw = {
+static struct cdevsw ugen_cdevsw = {
 	.d_version =	D_VERSION,
 	.d_flags =	D_NEEDGIANT,
 	.d_open =	ugenopen,
@@ -198,39 +164,54 @@
 	.d_poll =	ugenpoll,
 	.d_purge =	ugenpurge,
 	.d_name =	"ugen",
-#if __FreeBSD_version < 500014
-	.d_bmaj		-1
-#endif
 };
-#endif
 
-Static void ugenintr(usbd_xfer_handle xfer, usbd_private_handle addr,
+static void ugenintr(usbd_xfer_handle xfer, usbd_private_handle addr,
 		     usbd_status status);
-Static void ugen_isoc_rintr(usbd_xfer_handle xfer, usbd_private_handle addr,
+static void ugen_isoc_rintr(usbd_xfer_handle xfer, usbd_private_handle addr,
 			    usbd_status status);
-Static int ugen_do_read(struct ugen_softc *, int, struct uio *, int);
-Static int ugen_do_write(struct ugen_softc *, int, struct uio *, int);
-Static int ugen_do_ioctl(struct ugen_softc *, int, u_long,
+static int ugen_do_read(struct ugen_softc *, int, struct uio *, int);
+static int ugen_do_write(struct ugen_softc *, int, struct uio *, int);
+static int ugen_do_ioctl(struct ugen_softc *, int, u_long,
 			 caddr_t, int, usb_proc_ptr);
-#if defined(__FreeBSD__)
-Static void ugen_make_devnodes(struct ugen_softc *sc);
-Static void ugen_destroy_devnodes(struct ugen_softc *sc);
-#endif
-Static int ugen_set_config(struct ugen_softc *sc, int configno);
-Static usb_config_descriptor_t *ugen_get_cdesc(struct ugen_softc *sc,
+static void ugen_make_devnodes(struct ugen_softc *sc);
+static void ugen_destroy_devnodes(struct ugen_softc *sc);
+static int ugen_set_config(struct ugen_softc *sc, int configno);
+static usb_config_descriptor_t *ugen_get_cdesc(struct ugen_softc *sc,
 					       int index, int *lenp);
-Static usbd_status ugen_set_interface(struct ugen_softc *, int, int);
-Static int ugen_get_alt_index(struct ugen_softc *sc, int ifaceidx);
+static usbd_status ugen_set_interface(struct ugen_softc *, int, int);
+static int ugen_get_alt_index(struct ugen_softc *sc, int ifaceidx);
 
 #define UGENUNIT(n) ((minor(n) >> 4) & 0xf)
 #define UGENENDPOINT(n) (minor(n) & 0xf)
 #define UGENMINOR(u, e) (((u) << 4) | (e))
 
-USB_DECLARE_DRIVER(ugen);
+static device_probe_t ugen_match;
+static device_attach_t ugen_attach;
+static device_detach_t ugen_detach;
+
+static devclass_t ugen_devclass;
+
+static device_method_t ugen_methods[] = {
+	DEVMETHOD(device_probe, ugen_match),
+	DEVMETHOD(device_attach, ugen_attach),
+	DEVMETHOD(device_detach, ugen_detach),
+	{0,0},
+	{0,0}
+};
+
+static driver_t ugen_driver = {
+	"ugen",
+        ugen_methods,
+        sizeof(struct ugen_softc)
+};
+
+MODULE_DEPEND(ugen, usb, 1, 1, 1);
 
-USB_MATCH(ugen)
+static int
+ugen_match(device_t self)
 {
-	USB_MATCH_START(ugen, uaa);
+        struct usb_attach_arg *uaa = device_get_ivars(self);
 
 #if 0
 	if (uaa->matchlvl)
@@ -242,16 +223,19 @@
 		return (UMATCH_NONE);
 }
 
-USB_ATTACH(ugen)
+static int
+ugen_attach(device_t self)
 {
-	USB_ATTACH_START(ugen, sc, uaa);
+        struct ugen_softc *sc = device_get_softc(self);
+        struct usb_attach_arg *uaa = device_get_ivars(self);
 	usbd_device_handle udev;
 	char devinfo[1024];
 	usbd_status err;
 	int conf;
 
 	usbd_devinfo(uaa->device, 0, devinfo);
-	USB_ATTACH_SETUP;
+	sc->sc_dev = self;
+	device_set_desc_copy(self, devinfo);
 
 	sc->sc_udev = udev = uaa->device;
 
@@ -263,7 +247,7 @@
 		printf("%s: setting configuration index 0 failed\n",
 		       USBDEVNAME(sc->sc_dev));
 		sc->sc_dying = 1;
-		USB_ATTACH_ERROR_RETURN;
+		return (ENXIO);
 	}
 	conf = usbd_get_config_descriptor(udev)->bConfigurationValue;
 
@@ -273,25 +257,22 @@
 		printf("%s: setting configuration %d failed\n",
 		       USBDEVNAME(sc->sc_dev), conf);
 		sc->sc_dying = 1;
-		USB_ATTACH_ERROR_RETURN;
+		return (ENXIO);
 	}
 
-#if defined(__FreeBSD__)
 	/* the main device, ctrl endpoint */
 	sc->dev = make_dev(&ugenctl_cdevsw,
 	    UGENMINOR(USBDEVUNIT(sc->sc_dev), 0), UID_ROOT, GID_OPERATOR, 0644,
 	    "%s", USBDEVNAME(sc->sc_dev));
 	ugen_make_devnodes(sc);
-#endif
 
 	usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
 	    USBDEV(sc->sc_dev));
 
-	USB_ATTACH_SUCCESS_RETURN;
+	return (0);
 }
 
-#if defined(__FreeBSD__)
-Static void
+static void
 ugen_make_devnodes(struct ugen_softc *sc)
 {
 	int endptno;
@@ -322,7 +303,7 @@
 	}
 }
 
-Static void
+static void
 ugen_destroy_devnodes(struct ugen_softc *sc)
 {
 	int endptno, prev_sc_dying;
@@ -358,9 +339,8 @@
 	}
 	sc->sc_dying = prev_sc_dying;
 }
-#endif
 
-Static int
+static int
 ugen_set_config(struct ugen_softc *sc, int configno)
 {
 	usbd_device_handle dev = sc->sc_udev;
@@ -433,9 +413,7 @@
 		}
 	}
 
-#if defined(__FreeBSD__)
 	ugen_destroy_devnodes(sc);
-#endif
 
 	/* now we can clear the old interface's ugen_endpoints */
 	for(ifaceno = 0; ifaceno < niface_cache; ifaceno++) {
@@ -504,7 +482,9 @@
 	void *buf;
 	int i, j;
 
-	USB_GET_SC_OPEN(ugen, unit, sc);
+	sc = devclass_get_softc(ugen_devclass, unit);
+	if (sc == NULL)
+		return (ENXIO);
 
  	DPRINTFN(5, ("ugenopen: flag=%d, mode=%d, unit=%d endpt=%d\n",
 		     flag, mode, unit, endpt));
@@ -641,7 +621,7 @@
 	int dir;
 	int i;
 
-	USB_GET_SC(ugen, UGENUNIT(dev), sc);
+	sc = devclass_get_softc(ugen_devclass, UGENUNIT(dev));
 
 	DPRINTFN(5, ("ugenclose: flag=%d, mode=%d, unit=%d, endpt=%d\n",
 		     flag, mode, UGENUNIT(dev), endpt));
@@ -698,7 +678,7 @@
 	return (0);
 }
 
-Static int
+static int
 ugen_do_read(struct ugen_softc *sc, int endpt, struct uio *uio, int flag)
 {
 	struct ugen_endpoint *sce = &sc->sc_endpoints[endpt][IN];
@@ -847,7 +827,7 @@
 	struct ugen_softc *sc;
 	int error;
 
-	USB_GET_SC(ugen, UGENUNIT(dev), sc);
+	sc = devclass_get_softc(ugen_devclass, UGENUNIT(dev));
 
 	if (sc->sc_dying)
 		return (EIO);
@@ -858,7 +838,7 @@
 	return (error);
 }
 
-Static int
+static int
 ugen_do_write(struct ugen_softc *sc, int endpt, struct uio *uio, int flag)
 {
 	struct ugen_endpoint *sce = &sc->sc_endpoints[endpt][OUT];
@@ -951,7 +931,7 @@
 	struct ugen_softc *sc;
 	int error;
 
-	USB_GET_SC(ugen, UGENUNIT(dev), sc);
+	sc = devclass_get_softc(ugen_devclass, UGENUNIT(dev));
 
 	if (sc->sc_dying)
 		return (EIO);
@@ -962,25 +942,6 @@
 	return (error);
 }
 
-#if defined(__NetBSD__) || defined(__OpenBSD__)
-int
-ugen_activate(device_ptr_t self, enum devact act)
-{
-	struct ugen_softc *sc = (struct ugen_softc *)self;
-
-	switch (act) {
-	case DVACT_ACTIVATE:
-		return (EOPNOTSUPP);
-
-	case DVACT_DEACTIVATE:
-		sc->sc_dying = 1;
-		break;
-	}
-	return (0);
-}
-#endif
-
-#ifdef __FreeBSD__
 void
 ugenpurge(struct cdev *dev)
 {
@@ -990,7 +951,7 @@
 
 	if (endpt == USB_CONTROL_ENDPOINT)
 		return;
-	USB_GET_SC(ugen, UGENUNIT(dev), sc);
+	sc = devclass_get_softc(ugen_devclass, UGENUNIT(dev));
 	sce = &sc->sc_endpoints[endpt][IN];
 	if (sce->pipeh)
 		usbd_abort_pipe(sce->pipeh);
@@ -1009,22 +970,15 @@
 	}
 	selwakeuppri(&sce->rsel, PZERO);
 }
-#endif
 
-USB_DETACH(ugen)
+static int
+ugen_detach(device_t self)
 {
-	USB_DETACH_START(ugen, sc);
+	struct ugen_softc *sc = device_get_softc(self);
 	struct ugen_endpoint *sce;
 	int i, dir;
-#if defined(__NetBSD__) || defined(__OpenBSD__)
-	int maj, mn, c, s;
-#endif
 
-#if defined(__NetBSD__) || defined(__OpenBSD__)
-	DPRINTF(("ugen_detach: sc=%p flags=%d\n", sc, flags));
-#elif defined(__FreeBSD__)
 	DPRINTF(("ugen_detach: sc=%p\n", sc));
-#endif
 
 	sc->sc_dying = 1;
 	/* Abort all pipes.  Causes processes waiting for transfer to wake. */
@@ -1037,41 +991,8 @@
 		}
 	}
 
-#if defined(__NetBSD__) || defined(__OpenBSD__)
-	s = splusb();
-	if (sc->sc_refcnt > 0) {
-		/* Wake everyone */
-		for (i = 0; i < USB_MAX_ENDPOINTS; i++)
-			wakeup(&sc->sc_endpoints[i][IN]);
-		/* Wait for processes to go away. */
-		while (sc->sc_refcnt > 0)
-			usb_detach_wait(USBDEV(sc->sc_dev));
-	}
-	splx(s);
-
-	/* Wait for opens to go away. */
-	do {
-		c = 0;
-		for (i = 0; i < USB_MAX_ENDPOINTS; i++) {
-			if (sc->sc_is_open[i])
-				c++;
-		}
-		if (c != 0)
-			tsleep(&sc->sc_dying, PZERO, "ugendr", hz);
-	} while (c != 0);
-
-	/* locate the major number */
-	for (maj = 0; maj < nchrdev; maj++)
-		if (cdevsw[maj].d_open == ugenopen)
-			break;
-
-	/* Nuke the vnodes for any open instances (calls close). */
-	mn = self->dv_unit * USB_MAX_ENDPOINTS;
-	vdevgone(maj, mn, mn + USB_MAX_ENDPOINTS - 1, VCHR);
-#elif defined(__FreeBSD__)
 	/* destroy the device for the control endpoint */
 	destroy_dev(sc->dev);
-#endif
 
 	usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
 	    USBDEV(sc->sc_dev));
@@ -1079,7 +1000,7 @@
 	return (0);
 }
 
-Static void
+static void
 ugenintr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
 {
 	struct ugen_endpoint *sce = addr;
@@ -1115,7 +1036,7 @@
 	selwakeuppri(&sce->rsel, PZERO);
 }
 
-Static void
+static void
 ugen_isoc_rintr(usbd_xfer_handle xfer, usbd_private_handle addr,
 		usbd_status status)
 {
@@ -1174,7 +1095,7 @@
 	selwakeuppri(&sce->rsel, PZERO);
 }
 
-Static usbd_status
+static usbd_status
 ugen_set_interface(struct ugen_softc *sc, int ifaceidx, int altno)
 {
 	usbd_interface_handle iface;
@@ -1222,10 +1143,8 @@
 	if (err)
 		panic("ugen_set_interface: endpoint count failed");
 
-#if defined(__FreeBSD__)
 	/* destroy the existing devices, we remake the new ones in a moment */
 	ugen_destroy_devnodes(sc);
-#endif
 
 	/* now we can clear the old interface's ugen_endpoints */
 	for (endptno = 0; endptno < nendpt_cache; endptno++) {
@@ -1247,16 +1166,14 @@
 		sce->iface = iface;
 	}
 
-#if defined(__FreeBSD__)
 	/* make the new devices */
 	ugen_make_devnodes(sc);
-#endif
 
 	return (0);
 }
 
 /* Retrieve a complete descriptor for a certain device and index. */
-Static usb_config_descriptor_t *
+static usb_config_descriptor_t *
 ugen_get_cdesc(struct ugen_softc *sc, int index, int *lenp)
 {
 	usb_config_descriptor_t *cdesc, *tdesc, cdescr;
@@ -1289,7 +1206,7 @@
 	return (cdesc);
 }
 
-Static int
+static int
 ugen_get_alt_index(struct ugen_softc *sc, int ifaceidx)
 {
 	usbd_interface_handle iface;
@@ -1301,7 +1218,7 @@
 	return (usbd_get_interface_altindex(iface));
 }
 
-Static int
+static int
 ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
 	      caddr_t addr, int flag, usb_proc_ptr p)
 {
@@ -1374,9 +1291,7 @@
 		err = ugen_set_config(sc, *(int *)addr);
 		switch (err) {
 		case USBD_NORMAL_COMPLETION:
-#if defined(__FreeBSD__)
 			ugen_make_devnodes(sc);
-#endif
 			break;
 		case USBD_IN_USE:
 			return (EBUSY);
@@ -1582,7 +1497,7 @@
 	struct ugen_softc *sc;
 	int error;
 
-	USB_GET_SC(ugen, UGENUNIT(dev), sc);
+	sc = devclass_get_softc(ugen_devclass, UGENUNIT(dev));
 
 	if (sc->sc_dying)
 		return (EIO);
@@ -1602,7 +1517,7 @@
 	int revents = 0;
 	int s;
 
-	USB_GET_SC(ugen, UGENUNIT(dev), sc);
+	sc = devclass_get_softc(ugen_devclass, UGENUNIT(dev));
 
 	if (sc->sc_dying)
 		return ((events & (POLLIN | POLLOUT | POLLRDNORM |
@@ -1666,6 +1581,4 @@
 	return (revents);
 }
 
-#if defined(__FreeBSD__)
 DRIVER_MODULE(ugen, uhub, ugen_driver, ugen_devclass, usbd_driver_load, 0);
-#endif

==== //depot/projects/newisp/i386/acpica/Makefile#2 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/i386/acpica/Makefile,v 1.6 2004/04/13 13:43:11 des Exp $
+# $FreeBSD: src/sys/i386/acpica/Makefile,v 1.7 2006/09/06 14:23:40 ru Exp $
 
 # Correct path for kernel builds
 # Don't rely on the kernel's .depend file
@@ -9,7 +9,13 @@
 MAKESRCPATH= ${.CURDIR}
 CLEANFILES= acpi_wakecode.h acpi_wakecode.bin acpi_wakecode.o
 .endif
-CFLAGS+=	-I. -I@
+.if ${CC} == "icc"
+CFLAGS+=	-restrict
+NOSTDINC=	-X
+.else
+NOSTDINC=	-nostdinc
+.endif
+CFLAGS+=	${NOSTDINC} -I. -I${MAKESRCPATH}/../..
 
 all: acpi_wakecode.h
 

==== //depot/projects/newisp/i386/i386/local_apic.c#3 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/local_apic.c,v 1.29 2006/09/05 17:15:24 sobomax Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/local_apic.c,v 1.30 2006/09/06 22:05:33 sobomax Exp $");
 
 #include "opt_hwpmc_hooks.h"
 
@@ -615,6 +615,7 @@
 	/* Send EOI first thing. */
 	lapic_eoi();
 
+#ifdef SMP
 	/*
 	 * Don't do any accounting for the disabled HTT cores, since it
 	 * will provide misleading numbers for the userland.
@@ -624,6 +625,7 @@
 	 */
 	if ((hlt_cpus_mask & (1 << PCPU_GET(cpuid))) != 0)
 		return;
+#endif
 
 	/* Look up our local APIC structure for the tick counters. */
 	la = &lapics[PCPU_GET(apic_id)];

==== //depot/projects/newisp/kern/uipc_sockbuf.c#2 (text+ko) ====

@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/uipc_sockbuf.c,v 1.164 2006/08/02 13:01:58 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/uipc_sockbuf.c,v 1.165 2006/09/06 21:59:36 jhb Exp $");
 
 #include "opt_param.h"
 
@@ -253,18 +253,14 @@
 sysctl_handle_sb_max(SYSCTL_HANDLER_ARGS)
 {
 	int error = 0;
-	u_long old_sb_max = sb_max;
+	u_long tmp_sb_max = sb_max;
 
-	error = SYSCTL_OUT(req, arg1, sizeof(u_long));
+	error = sysctl_handle_long(oidp, &tmp_sb_max, arg2, req);
 	if (error || !req->newptr)
 		return (error);
-	error = SYSCTL_IN(req, arg1, sizeof(u_long));
-	if (error)
-		return (error);
-	if (sb_max < MSIZE + MCLBYTES) {
-		sb_max = old_sb_max;
+	if (tmp_sb_max < MSIZE + MCLBYTES)
 		return (EINVAL);
-	}
+	sb_max = tmp_sb_max;
 	sb_max_adj = (u_quad_t)sb_max * MCLBYTES / (MSIZE + MCLBYTES);
 	return (0);
 }

==== //depot/projects/newisp/kern/vfs_aio.c#2 (text+ko) ====

@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/vfs_aio.c,v 1.225 2006/08/15 12:10:57 netchild Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/vfs_aio.c,v 1.226 2006/09/06 15:11:20 mp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -977,12 +977,6 @@
 	aiop->aiothread = td;
 	aiop->aiothreadflags = 0;
 
-	/*
-	 * Get rid of our current filedescriptors.  AIOD's don't need any
-	 * filedescriptors, except as temporarily inherited from the client.
-	 */
-	fdfree(td);
-
 	/* The daemon resides in its own pgrp. */
 	setsid(td, NULL);
 

==== //depot/projects/newisp/net/if.c#2 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)if.c	8.5 (Berkeley) 1/9/95
- * $FreeBSD: src/sys/net/if.c,v 1.261 2006/07/09 06:04:00 sam Exp $
+ * $FreeBSD: src/sys/net/if.c,v 1.262 2006/09/06 17:12:10 andre Exp $
  */
 
 #include "opt_compat.h"
@@ -1006,6 +1006,33 @@
 }
 
 /*
+ * Locate an interface based on the broadcast address.
+ */
+/* ARGSUSED */
+struct ifaddr *
+ifa_ifwithbroadaddr(struct sockaddr *addr)
+{
+	struct ifnet *ifp;
+	struct ifaddr *ifa;
+
+	IFNET_RLOCK();
+	TAILQ_FOREACH(ifp, &ifnet, if_link)
+		TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+			if (ifa->ifa_addr->sa_family != addr->sa_family)
+				continue;
+			if ((ifp->if_flags & IFF_BROADCAST) &&
+			    ifa->ifa_broadaddr &&
+			    ifa->ifa_broadaddr->sa_len != 0 &&
+			    sa_equal(ifa->ifa_broadaddr, addr))
+				goto done;
+		}
+	ifa = NULL;
+done:
+	IFNET_RUNLOCK();
+	return (ifa);
+}
+
+/*
  * Locate the point to point interface with a given destination address.
  */
 /*ARGSUSED*/

==== //depot/projects/newisp/net/if.h#2 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)if.h	8.1 (Berkeley) 6/10/93
- * $FreeBSD: src/sys/net/if.h,v 1.103 2006/06/19 22:20:44 mlaier Exp $
+ * $FreeBSD: src/sys/net/if.h,v 1.105 2006/09/06 21:51:58 andre Exp $
  */
 
 #ifndef _NET_IF_H_
@@ -101,7 +101,7 @@
 	u_long	ifi_omcasts;		/* packets sent via multicast */
 	u_long	ifi_iqdrops;		/* dropped on input, this interface */
 	u_long	ifi_noproto;		/* destined for unsupported protocol */
-	u_long	ifi_hwassist;		/* HW offload capabilities */
+	u_long	ifi_hwassist;		/* HW offload capabilities, see IFCAP */
 	time_t	ifi_epoch;		/* uptime at attach or stat reset */
 	struct	timeval ifi_lastchange;	/* time of last administrative change */
 };
@@ -180,7 +180,24 @@
 #define	IF_Mbps(x)	(IF_Kbps((x) * 1000))	/* megabits/sec. */
 #define	IF_Gbps(x)	(IF_Mbps((x) * 1000))	/* gigabits/sec. */
 
-/* Capabilities that interfaces can advertise. */
+/*
+ * Capabilities that interfaces can advertise.
+ *
+ * struct ifnet.if_capabilities
+ *   contains the optional features & capabilities a particular interface
+ *   supports (not only the driver but also the detected hw revision).
+ *   Capabilities are defined by IFCAP_* below.
+ * struct ifnet.if_capenabled
+ *   contains the enabled (either by default or through ifconfig) optional
+ *   features & capabilities on this interface.
+ *   Capabilities are defined by IFCAP_* below.
+ * struct if_data.ifi_hwassist in mbuf CSUM_ flag form, controlled by above
+ *   contains the enabled optional feature & capabilites that can be used
+ *   individually per packet and are specified in the mbuf pkthdr.csum_flags
+ *   field.  IFCAP_* and CSUM_* do not match one to one and CSUM_* may be
+ *   more detailed or differenciated that IFCAP_*.
+ *   Hwassist features are defined CSUM_* in sys/mbuf.h
+ */
 #define IFCAP_RXCSUM		0x0001  /* can offload checksum on RX */
 #define IFCAP_TXCSUM		0x0002  /* can offload checksum on TX */
 #define IFCAP_NETCONS		0x0004  /* can be a network console */
@@ -189,8 +206,11 @@
 #define	IFCAP_JUMBO_MTU		0x0020	/* 9000 byte MTU supported */
 #define	IFCAP_POLLING		0x0040	/* driver supports polling */
 #define	IFCAP_VLAN_HWCSUM	0x0080	/* can do IFCAP_HWCSUM on VLANs */
+#define	IFCAP_TSO4		0x0100	/* can do TCP Segmentation Offload */
+#define	IFCAP_TSO6		0x0200	/* can do TCP6 Segmentation Offload */
 
 #define IFCAP_HWCSUM		(IFCAP_RXCSUM | IFCAP_TXCSUM)
+#define	IFCAP_TSO		(IFCAP_TSO4 | IFCAP_TSO6)
 
 #define	IFQ_MAXLEN	50
 #define	IFNET_SLOWHZ	1		/* granularity is 1 second */

==== //depot/projects/newisp/net/if_var.h#2 (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.108 2006/08/04 21:27:37 brooks Exp $
+ * $FreeBSD: src/sys/net/if_var.h,v 1.110 2006/09/06 18:06:03 andre Exp $
  */
 
 #ifndef	_NET_IF_VAR_H_
@@ -137,8 +137,8 @@
 	short	if_timer;		/* time 'til if_watchdog called */
 	struct  ifvlantrunk *if_vlantrunk; /* pointer to 802.1q data */
 	int	if_flags;		/* up/down, broadcast, etc. */
-	int	if_capabilities;	/* interface capabilities */
-	int	if_capenable;		/* enabled features */
+	int	if_capabilities;	/* interface features & capabilities */
+	int	if_capenable;		/* enabled features & capabilities */
 	void	*if_linkmib;		/* link-type-specific MIB data */
 	size_t	if_linkmiblen;		/* length of above data */
 	struct	if_data if_data;
@@ -683,6 +683,7 @@
 struct	ifnet *ifunit(const char *);
 
 struct	ifaddr *ifa_ifwithaddr(struct sockaddr *);
+struct	ifaddr *ifa_ifwithbroadaddr(struct sockaddr *);
 struct	ifaddr *ifa_ifwithdstaddr(struct sockaddr *);
 struct	ifaddr *ifa_ifwithnet(struct sockaddr *);
 struct	ifaddr *ifa_ifwithroute(int, struct sockaddr *, struct sockaddr *);

==== //depot/projects/newisp/netinet/in_pcb.c#2 (text+ko) ====

@@ -27,7 +27,7 @@

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list