From owner-p4-projects@FreeBSD.ORG Sun Apr 26 00:31:03 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A4D841065677; Sun, 26 Apr 2009 00:31:03 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E4DA1065674 for ; Sun, 26 Apr 2009 00:31:03 +0000 (UTC) (envelope-from anchie@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 31D808FC1A for ; Sun, 26 Apr 2009 00:31:03 +0000 (UTC) (envelope-from anchie@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3Q0V26p076875 for ; Sun, 26 Apr 2009 00:31:02 GMT (envelope-from anchie@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3Q0V2pa076873 for perforce@freebsd.org; Sun, 26 Apr 2009 00:31:02 GMT (envelope-from anchie@FreeBSD.org) Date: Sun, 26 Apr 2009 00:31:02 GMT Message-Id: <200904260031.n3Q0V2pa076873@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to anchie@FreeBSD.org using -f From: Ana Kukec To: Perforce Change Reviews Cc: Subject: PERFORCE change 161090 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 00:31:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=161090 Change 161090 by anchie@anchie_malimis on 2009/04/26 00:30:26 Milestones (a high-level overview). Affected files ... .. //depot/projects/soc2009/anchie_send/Milestones#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Sun Apr 26 02:23:59 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7CAC810656E9; Sun, 26 Apr 2009 02:23:58 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AAF110656DA for ; Sun, 26 Apr 2009 02:23:58 +0000 (UTC) (envelope-from zhaoshuai@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 0E49E8FC08 for ; Sun, 26 Apr 2009 02:23:58 +0000 (UTC) (envelope-from zhaoshuai@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3Q2Nv0b025583 for ; Sun, 26 Apr 2009 02:23:57 GMT (envelope-from zhaoshuai@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3Q2NvIn025581 for perforce@freebsd.org; Sun, 26 Apr 2009 02:23:57 GMT (envelope-from zhaoshuai@FreeBSD.org) Date: Sun, 26 Apr 2009 02:23:57 GMT Message-Id: <200904260223.n3Q2NvIn025581@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zhaoshuai@FreeBSD.org using -f From: Zhao Shuai To: Perforce Change Reviews Cc: Subject: PERFORCE change 161092 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 02:23:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=161092 Change 161092 by zhaoshuai@zhaoshuai on 2009/04/26 02:23:09 First commit by Zhao Shuai, just test perforce Affected files ... .. //depot/projects/soc2009/fifo/Milestones#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Sun Apr 26 06:47:26 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B061A1065676; Sun, 26 Apr 2009 06:47:25 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FD981065670 for ; Sun, 26 Apr 2009 06:47:25 +0000 (UTC) (envelope-from tatsianka@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 03FF38FC12 for ; Sun, 26 Apr 2009 06:47:25 +0000 (UTC) (envelope-from tatsianka@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3Q6lOb1011183 for ; Sun, 26 Apr 2009 06:47:24 GMT (envelope-from tatsianka@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3Q6lOMM011181 for perforce@freebsd.org; Sun, 26 Apr 2009 06:47:24 GMT (envelope-from tatsianka@FreeBSD.org) Date: Sun, 26 Apr 2009 06:47:24 GMT Message-Id: <200904260647.n3Q6lOMM011181@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to tatsianka@FreeBSD.org using -f From: Tatsiana Severyna To: Perforce Change Reviews Cc: Subject: PERFORCE change 161093 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 06:47:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=161093 Change 161093 by tatsianka@tatsianka_zonder on 2009/04/26 06:47:00 Add Milestones file Affected files ... .. //depot/projects/soc2009/tatsianka_puffs/Milestones#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Sun Apr 26 07:23:02 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D24C91065675; Sun, 26 Apr 2009 07:23:01 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79C1D106566B for ; Sun, 26 Apr 2009 07:23:01 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 670B18FC12 for ; Sun, 26 Apr 2009 07:23:01 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3Q7N1cR022811 for ; Sun, 26 Apr 2009 07:23:01 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3Q7N0aH022809 for perforce@freebsd.org; Sun, 26 Apr 2009 07:23:00 GMT (envelope-from zec@fer.hr) Date: Sun, 26 Apr 2009 07:23:00 GMT Message-Id: <200904260723.n3Q7N0aH022809@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 161095 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 07:23:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=161095 Change 161095 by zec@zec_tpx32 on 2009/04/26 07:22:20 IFC @ 161094 Affected files ... .. //depot/projects/vimage-commit/src/sys/conf/files.powerpc#8 integrate .. //depot/projects/vimage-commit/src/sys/dev/ed/if_ed_pccard.c#10 integrate .. //depot/projects/vimage-commit/src/sys/dev/pccard/pccarddevs#11 integrate .. //depot/projects/vimage-commit/src/sys/dev/usb/controller/ehci.c#5 integrate .. //depot/projects/vimage-commit/src/sys/dev/usb/controller/ohci.c#5 integrate .. //depot/projects/vimage-commit/src/sys/dev/usb/controller/uhci.c#5 integrate .. //depot/projects/vimage-commit/src/sys/dev/usb/usb_core.h#5 integrate .. //depot/projects/vimage-commit/src/sys/dev/usb/usb_device.c#5 integrate .. //depot/projects/vimage-commit/src/sys/dev/usb/usb_device.h#5 integrate .. //depot/projects/vimage-commit/src/sys/dev/usb/usb_generic.c#4 integrate .. //depot/projects/vimage-commit/src/sys/dev/usb/usb_hub.c#5 integrate .. //depot/projects/vimage-commit/src/sys/dev/usb/usb_request.c#5 integrate .. //depot/projects/vimage-commit/src/sys/dev/usb/usb_revision.h#2 integrate .. //depot/projects/vimage-commit/src/sys/dev/usb/usb_transfer.c#5 integrate .. //depot/projects/vimage-commit/src/sys/ia64/isa/isa.c#3 integrate .. //depot/projects/vimage-commit/src/sys/kern/kern_vimage.c#10 integrate .. //depot/projects/vimage-commit/src/sys/kern/tty_pts.c#7 integrate .. //depot/projects/vimage-commit/src/sys/netgraph/netgraph.h#9 integrate .. //depot/projects/vimage-commit/src/sys/netgraph/ng_base.c#16 integrate .. //depot/projects/vimage-commit/src/sys/netgraph/ng_eiface.c#14 integrate .. //depot/projects/vimage-commit/src/sys/netgraph/ng_ether.c#13 integrate .. //depot/projects/vimage-commit/src/sys/netgraph/ng_iface.c#13 integrate .. //depot/projects/vimage-commit/src/sys/netinet/in.c#13 integrate .. //depot/projects/vimage-commit/src/sys/powerpc/aim/machdep.c#8 integrate .. //depot/projects/vimage-commit/src/sys/powerpc/booke/pmap.c#7 integrate .. //depot/projects/vimage-commit/src/sys/powerpc/conf/MPC85XX#5 integrate .. //depot/projects/vimage-commit/src/sys/powerpc/include/intr_machdep.h#3 integrate .. //depot/projects/vimage-commit/src/sys/powerpc/include/pte.h#5 integrate .. //depot/projects/vimage-commit/src/sys/powerpc/mpc85xx/atpic.c#1 branch .. //depot/projects/vimage-commit/src/sys/powerpc/mpc85xx/isa.c#1 branch .. //depot/projects/vimage-commit/src/sys/powerpc/mpc85xx/ocpbus.c#5 integrate .. //depot/projects/vimage-commit/src/sys/powerpc/mpc85xx/pci_ocp.c#3 integrate .. //depot/projects/vimage-commit/src/sys/powerpc/powerpc/autoconf.c#4 integrate .. //depot/projects/vimage-commit/src/sys/powerpc/powerpc/bus_machdep.c#4 integrate .. //depot/projects/vimage-commit/src/sys/powerpc/powerpc/intr_machdep.c#6 integrate .. //depot/projects/vimage-commit/src/sys/sys/vimage.h#14 integrate .. //depot/projects/vimage-commit/src/sys/vm/swap_pager.c#7 integrate .. //depot/projects/vimage-commit/src/sys/vm/vnode_pager.c#6 integrate Differences ... ==== //depot/projects/vimage-commit/src/sys/conf/files.powerpc#8 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.powerpc,v 1.98 2009/04/05 18:40:15 nwhitehorn Exp $ +# $FreeBSD: src/sys/conf/files.powerpc,v 1.99 2009/04/24 03:51:11 marcel Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -103,6 +103,8 @@ powerpc/fpu/fpu_mul.c optional fpu_emu powerpc/fpu/fpu_sqrt.c optional fpu_emu powerpc/fpu/fpu_subr.c optional fpu_emu +powerpc/mpc85xx/atpic.c optional mpc85xx isa +powerpc/mpc85xx/isa.c optional mpc85xx isa powerpc/mpc85xx/lbc.c optional mpc85xx powerpc/mpc85xx/mpc85xx.c optional mpc85xx powerpc/mpc85xx/nexus.c optional mpc85xx ==== //depot/projects/vimage-commit/src/sys/dev/ed/if_ed_pccard.c#10 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ed/if_ed_pccard.c,v 1.154 2009/04/22 16:51:01 imp Exp $ + * $FreeBSD: src/sys/dev/ed/if_ed_pccard.c,v 1.155 2009/04/24 17:28:12 imp Exp $ */ /* @@ -210,8 +210,9 @@ { PCMCIA_CARD(NEXTCOM, NEXTHAWK), 0}, { PCMCIA_CARD(NEWMEDIA, LANSURFER), NE2000DVF_ANYFUNC}, { PCMCIA_CARD(NEWMEDIA, LIVEWIRE), 0}, + { PCMCIA_CARD(OEM2, 100BASE), NE2000DVF_AX88X90}, { PCMCIA_CARD(OEM2, ETHERNET), 0}, - { PCMCIA_CARD(OEM2, FAST_ETHERNET), NE2000DVF_AX88X90 }, + { PCMCIA_CARD(OEM2, FAST_ETHERNET), NE2000DVF_AX88X90}, { PCMCIA_CARD(OEM2, NE2000), 0}, { PCMCIA_CARD(PLANET, SMARTCOM2000), 0 }, { PCMCIA_CARD(PREMAX, PE200), 0}, ==== //depot/projects/vimage-commit/src/sys/dev/pccard/pccarddevs#11 (text+ko) ==== @@ -1,4 +1,4 @@ -$FreeBSD: src/sys/dev/pccard/pccarddevs,v 1.147 2009/04/22 16:50:44 imp Exp $ +$FreeBSD: src/sys/dev/pccard/pccarddevs,v 1.148 2009/04/24 17:27:45 imp Exp $ /* $NetBSD: pcmciadevs,v 1.226 2008/06/19 18:20:33 imp Exp $ */ /* $OpenBSD: pcmciadevs,v 1.93 2002/06/21 08:31:10 henning Exp $ */ @@ -772,6 +772,7 @@ product OEM2 CDROM1 { "PCMCIA", "CD-ROM", NULL, NULL } Generic PCMCIA CD-ROM product OEM2 IDE { "PCMCIA", "IDE&spCARD", NULL, NULL } Generic PCMCIA IDE CARD product OEM2 ETHERNET { "PCMCIA", "Ethernet", NULL, NULL } NE2000 PC Card +product OEM2 100BASE { "PCMCIA", "100BASE", NULL, NULL } NE2000 PC Card product OEM2 FAST_ETHERNET { "PCMCIA", "FAST&spETHERNET&spCARD", NULL, NULL } NE2000 PC Card product OEM2 NE2000 { "NE2000&spCompatible&spPC&spCard", "PCMCIA", NULL, NULL } Generic NE2000 PC Card product PHISON CF_CARD { "PHISON", "CF&spCard", NULL, NULL } Generic CF or SD/MMC/SmartMedia Reader ==== //depot/projects/vimage-commit/src/sys/dev/usb/controller/ehci.c#5 (text+ko) ==== @@ -44,7 +44,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb/controller/ehci.c,v 1.14 2009/04/22 17:08:16 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb/controller/ehci.c,v 1.15 2009/04/25 21:10:06 thompsa Exp $"); #include #include @@ -1964,7 +1964,7 @@ usb2_pc_cpu_flush(qh->page_cache); - if (xfer->xroot->udev->pwr_save.suspended == 0) { + if (xfer->xroot->udev->state != USB_STATE_SUSPENDED) { EHCI_APPEND_QH(qh, *qh_last); } } ==== //depot/projects/vimage-commit/src/sys/dev/usb/controller/ohci.c#5 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb/controller/ohci.c,v 1.11 2009/04/22 17:08:16 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb/controller/ohci.c,v 1.12 2009/04/25 21:10:06 thompsa Exp $"); /* * USB Open Host Controller driver. @@ -1020,7 +1020,7 @@ * writing the BLF and CLF bits: */ - if (xfer->xroot->udev->pwr_save.suspended) { + if (xfer->xroot->udev->state == USB_STATE_SUSPENDED) { /* nothing to do */ } else if (xfer->pipe->methods == &ohci_device_bulk_methods) { ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); @@ -1589,7 +1589,7 @@ ed->ed_headp = td->td_self; - if (xfer->xroot->udev->pwr_save.suspended == 0) { + if (xfer->xroot->udev->state != USB_STATE_SUSPENDED) { /* the append function will flush the endpoint descriptor */ OHCI_APPEND_QH(ed, *ed_last); ==== //depot/projects/vimage-commit/src/sys/dev/usb/controller/uhci.c#5 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb/controller/uhci.c,v 1.10 2009/04/22 17:08:16 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb/controller/uhci.c,v 1.11 2009/04/25 21:10:06 thompsa Exp $"); /* * USB Universal Host Controller driver. @@ -1921,7 +1921,7 @@ qh->e_next = td; qh->qh_e_next = td->td_self; - if (xfer->xroot->udev->pwr_save.suspended == 0) { + if (xfer->xroot->udev->state != USB_STATE_SUSPENDED) { UHCI_APPEND_QH(qh, sc->sc_bulk_p_last); uhci_add_loop(sc); xfer->flags_int.bandwidth_reclaimed = 1; @@ -1982,7 +1982,7 @@ * NOTE: some devices choke on bandwidth- reclamation for control * transfers */ - if (xfer->xroot->udev->pwr_save.suspended == 0) { + if (xfer->xroot->udev->state != USB_STATE_SUSPENDED) { if (xfer->xroot->udev->speed == USB_SPEED_LOW) { UHCI_APPEND_QH(qh, sc->sc_ls_ctl_p_last); } else { @@ -2071,7 +2071,7 @@ qh->e_next = td; qh->qh_e_next = td->td_self; - if (xfer->xroot->udev->pwr_save.suspended == 0) { + if (xfer->xroot->udev->state != USB_STATE_SUSPENDED) { /* enter QHs into the controller data structures */ UHCI_APPEND_QH(qh, sc->sc_intr_p_last[xfer->qh_pos]); ==== //depot/projects/vimage-commit/src/sys/dev/usb/usb_core.h#5 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_core.h,v 1.12 2009/04/22 17:08:16 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_core.h,v 1.14 2009/04/25 21:25:52 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -515,6 +515,7 @@ /* prototypes */ const char *usb2_errstr(usb2_error_t error); +const char *usb2_statestr(enum usb_dev_state state); struct usb2_config_descriptor *usb2_get_config_descriptor( struct usb2_device *udev); struct usb2_device_descriptor *usb2_get_device_descriptor( @@ -552,5 +553,6 @@ uint8_t usb2_get_bus_index(struct usb2_device *udev); uint8_t usb2_get_device_index(struct usb2_device *udev); void usb2_set_power_mode(struct usb2_device *udev, uint8_t power_mode); +int usb2_device_attached(struct usb2_device *udev); #endif /* _USB2_CORE_H_ */ ==== //depot/projects/vimage-commit/src/sys/dev/usb/usb_device.c#5 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_device.c,v 1.27 2009/04/22 17:08:16 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_device.c,v 1.29 2009/04/25 21:25:52 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -90,6 +90,22 @@ SYSCTL_INT(_hw_usb2, OID_AUTO, template, CTLFLAG_RW, &usb2_template, 0, "Selected USB device side template"); +static const char* statestr[USB_STATE_MAX] = { + [USB_STATE_DETACHED] = "DETACHED", + [USB_STATE_ATTACHED] = "ATTACHED", + [USB_STATE_POWERED] = "POWERED", + [USB_STATE_ADDRESSED] = "ADDRESSED", + [USB_STATE_CONFIGURED] = "CONFIGURED", + [USB_STATE_SUSPENDED] = "SUSPENDED" +}; + +const char * +usb2_statestr(enum usb_dev_state state) +{ + KASSERT(state < USB_STATE_MAX, ("invalid udev state")); + + return (statestr[state]); +} /*------------------------------------------------------------------------* * usb2_get_pipe_by_addr @@ -457,6 +473,8 @@ * the current config number and index. */ err = usb2_req_set_config(udev, NULL, USB_UNCONFIG_NO); + if (udev->state == USB_STATE_CONFIGURED) + usb2_set_device_state(udev, USB_STATE_ADDRESSED); goto done; } /* get the full config descriptor */ @@ -524,6 +542,7 @@ udev->power = power; udev->curr_config_no = cdp->bConfigurationValue; udev->curr_config_index = index; + usb2_set_device_state(udev, USB_STATE_CONFIGURED); /* Set the actual configuration value. */ err = usb2_req_set_config(udev, NULL, cdp->bConfigurationValue); @@ -980,7 +999,7 @@ udev->port_no, udev->address); if (device_is_attached(dev)) { - if (udev->flags.suspended) { + if (udev->state == USB_STATE_SUSPENDED) { err = DEVICE_RESUME(dev); if (err) { device_printf(dev, "Resume failed!\n"); @@ -1120,7 +1139,7 @@ uaa->temp_dev = NULL; device_set_ivars(iface->subdev, NULL); - if (udev->flags.suspended) { + if (udev->state == USB_STATE_SUSPENDED) { err = DEVICE_SUSPEND(iface->subdev); if (err) device_printf(iface->subdev, "Suspend failed\n"); @@ -1341,12 +1360,12 @@ USB_BUS_LOCK(udev->bus); /* filter the suspend events */ - if (udev->flags.suspended == do_suspend) { + if ((udev->state == USB_STATE_SUSPENDED && do_suspend) || + (udev->state != USB_STATE_SUSPENDED && !do_suspend)) { USB_BUS_UNLOCK(udev->bus); /* nothing to do */ return (0); } - udev->flags.suspended = do_suspend; USB_BUS_UNLOCK(udev->bus); /* do the suspend or resume */ @@ -1471,6 +1490,7 @@ udev->bus = bus; udev->address = USB_START_ADDR; /* default value */ udev->plugtime = (usb2_ticks_t)ticks; + usb2_set_device_state(udev, USB_STATE_POWERED); /* * We need to force the power mode to "on" because there are plenty * of USB devices out there that do not work very well with @@ -1572,6 +1592,7 @@ goto done; } } + usb2_set_device_state(udev, USB_STATE_ADDRESSED); /* * Get the first 8 bytes of the device descriptor ! @@ -1927,7 +1948,8 @@ DPRINTFN(4, "udev=%p port=%d\n", udev, udev->port_no); - bus = udev->bus;; + bus = udev->bus; + usb2_set_device_state(udev, USB_STATE_DETACHED); #if USB_HAVE_UGEN usb2_notify_addq("-", udev); @@ -2438,3 +2460,20 @@ } return (0); /* not supported */ } + +void +usb2_set_device_state(struct usb2_device *udev, enum usb_dev_state state) +{ + + KASSERT(state < USB_STATE_MAX, ("invalid udev state")); + + DPRINTF("udev %p state %s -> %s\n", udev, + usb2_statestr(udev->state), usb2_statestr(state)); + udev->state = state; +} + +int +usb2_device_attached(struct usb2_device *udev) +{ + return (udev->state > USB_STATE_DETACHED); +} ==== //depot/projects/vimage-commit/src/sys/dev/usb/usb_device.h#5 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_device.h,v 1.14 2009/04/22 17:07:53 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_device.h,v 1.15 2009/04/25 21:10:06 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -85,7 +85,6 @@ struct usb2_device_flags { uint8_t usb2_mode:1; /* USB mode (see USB_MODE_XXX) */ uint8_t self_powered:1; /* set if USB device is self powered */ - uint8_t suspended:1; /* set if USB device is suspended */ uint8_t no_strings:1; /* set if USB device does not support * strings */ uint8_t remote_wakeup:1; /* set if remote wakeup is enabled */ @@ -101,7 +100,6 @@ usb2_size_t type_refs[4]; /* transfer reference count */ usb2_size_t read_refs; /* data read references */ usb2_size_t write_refs; /* data write references */ - uint8_t suspended; /* set if USB device is suspended */ }; /* @@ -139,6 +137,7 @@ #endif usb2_ticks_t plugtime; /* copy of "ticks" */ + enum usb_dev_state state; uint16_t refcount; #define USB_DEV_REF_MAX 0xffff @@ -205,5 +204,7 @@ void usb_linux_free_device(struct usb_device *dev); uint8_t usb2_peer_can_wakeup(struct usb2_device *udev); struct usb2_pipe *usb2_pipe_foreach(struct usb2_device *udev, struct usb2_pipe *pipe); +void usb2_set_device_state(struct usb2_device *udev, + enum usb_dev_state state); #endif /* _USB2_DEVICE_H_ */ ==== //depot/projects/vimage-commit/src/sys/dev/usb/usb_generic.c#4 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_generic.c,v 1.9 2009/04/05 18:20:38 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_generic.c,v 1.10 2009/04/25 21:10:06 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -823,7 +823,7 @@ di->udi_speed = udev->speed; di->udi_mode = udev->flags.usb2_mode; di->udi_power_mode = udev->power_mode; - if (udev->flags.suspended) { + if (udev->state == USB_STATE_SUSPENDED) { di->udi_suspended = 1; } else { di->udi_suspended = 0; ==== //depot/projects/vimage-commit/src/sys/dev/usb/usb_hub.c#5 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_hub.c,v 1.13 2009/04/22 17:07:56 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_hub.c,v 1.14 2009/04/25 21:10:06 thompsa Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. * Copyright (c) 1998 Lennart Augustsson. All rights reserved. @@ -544,7 +544,7 @@ if (udev->depth > USB_HUB_MAX_DEPTH) { return (USB_ERR_TOO_DEEP); } - if (udev->pwr_save.suspended) { + if (udev->state == USB_STATE_SUSPENDED) { /* need to wait until the child signals resume */ DPRINTF("Device is suspended!\n"); return (0); @@ -1518,7 +1518,7 @@ udev->pwr_save.write_refs += val; } - if (udev->pwr_save.suspended) + if (udev->state == USB_STATE_SUSPENDED) needs_explore = (udev->pwr_save.write_refs != 0) || ((udev->pwr_save.read_refs != 0) && @@ -1600,7 +1600,7 @@ (rem_wakeup == 0))) { /* check if we are suspended */ - if (udev->pwr_save.suspended != 0) { + if (udev->state == USB_STATE_SUSPENDED) { USB_BUS_UNLOCK(bus); usb2_dev_resume_peer(udev); USB_BUS_LOCK(bus); @@ -1608,7 +1608,7 @@ } else if (temp >= limit) { /* check if we are not suspended */ - if (udev->pwr_save.suspended == 0) { + if (udev->state != USB_STATE_SUSPENDED) { USB_BUS_UNLOCK(bus); usb2_dev_suspend_peer(udev); USB_BUS_LOCK(bus); @@ -1647,7 +1647,7 @@ if (temp < mintime) mintime = temp; - if (udev->pwr_save.suspended == 0) { + if (udev->state != USB_STATE_SUSPENDED) { type_refs[0] += udev->pwr_save.type_refs[0]; type_refs[1] += udev->pwr_save.type_refs[1]; type_refs[2] += udev->pwr_save.type_refs[2]; @@ -1697,7 +1697,7 @@ return; /* check if already resumed */ - if (udev->pwr_save.suspended == 0) + if (udev->state != USB_STATE_SUSPENDED) return; /* we need a parent HUB to do resume */ @@ -1737,7 +1737,7 @@ } USB_BUS_LOCK(bus); /* set that this device is now resumed */ - udev->pwr_save.suspended = 0; + usb2_set_device_state(udev, USB_STATE_CONFIGURED); #if USB_HAVE_POWERD /* make sure that we don't go into suspend right away */ udev->pwr_save.last_xfer_time = ticks; @@ -1797,7 +1797,7 @@ return; /* check if already suspended */ - if (udev->pwr_save.suspended) + if (udev->state == USB_STATE_SUSPENDED) return; /* we need a parent HUB to do suspend */ @@ -1819,7 +1819,7 @@ if (child == NULL) continue; - if (child->pwr_save.suspended) + if (child->state == USB_STATE_SUSPENDED) continue; DPRINTFN(1, "Port %u is busy on the HUB!\n", x + 1); @@ -1846,7 +1846,7 @@ * Set that this device is suspended. This variable must be set * before calling USB controller suspend callbacks. */ - udev->pwr_save.suspended = 1; + usb2_set_device_state(udev, USB_STATE_SUSPENDED); USB_BUS_UNLOCK(udev->bus); if (udev->bus->methods->device_suspend != NULL) { ==== //depot/projects/vimage-commit/src/sys/dev/usb/usb_request.c#5 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_request.c,v 1.13 2009/04/22 17:08:16 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_request.c,v 1.14 2009/04/25 21:10:06 thompsa Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. * Copyright (c) 1998 Lennart Augustsson. All rights reserved. @@ -271,6 +271,12 @@ req->wIndex[1], req->wIndex[0], req->wLength[1], req->wLength[0]); + /* Check if the device is still alive */ + if (udev->state < USB_STATE_POWERED) { + DPRINTF("usb device has gone\n"); + return (USB_ERR_NOT_CONFIGURED); + } + /* * Set "actlen" to a known value in case the caller does not * check the return value: ==== //depot/projects/vimage-commit/src/sys/dev/usb/usb_revision.h#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_revision.h,v 1.1 2009/02/23 18:31:00 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_revision.h,v 1.2 2009/04/25 21:10:06 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -62,4 +62,16 @@ USB_MODE_MAX }; +/* + * The "USB_MODE" macro defines all the supported device states. + */ +enum usb_dev_state { + USB_STATE_DETACHED, + USB_STATE_ATTACHED, + USB_STATE_POWERED, + USB_STATE_ADDRESSED, + USB_STATE_CONFIGURED, + USB_STATE_SUSPENDED, + USB_STATE_MAX, +}; #endif /* _USB2_REVISION_H_ */ ==== //depot/projects/vimage-commit/src/sys/dev/usb/usb_transfer.c#5 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_transfer.c,v 1.12 2009/04/22 17:08:10 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_transfer.c,v 1.13 2009/04/25 21:10:06 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -1365,24 +1365,37 @@ void usb2_start_hardware(struct usb2_xfer *xfer) { + struct usb2_xfer_root *info; + struct usb2_bus *bus; usb2_frcount_t x; + info = xfer->xroot; + bus = info->bus; + DPRINTF("xfer=%p, pipe=%p, nframes=%d, dir=%s\n", xfer, xfer->pipe, xfer->nframes, USB_GET_DATA_ISREAD(xfer) ? "read" : "write"); + /* Check if the device is still alive */ + if (info->udev->state < USB_STATE_POWERED) { + USB_BUS_LOCK(bus); + usb2_transfer_done(xfer, USB_ERR_NOT_CONFIGURED); + USB_BUS_UNLOCK(bus); + return; + } + #if USB_DEBUG if (USB_DEBUG_VAR > 0) { - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); usb2_dump_pipe(xfer->pipe); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); } #endif USB_XFER_LOCK_ASSERT(xfer, MA_OWNED); - USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_NOTOWNED); + USB_BUS_LOCK_ASSERT(bus, MA_NOTOWNED); /* Only open the USB transfer once! */ if (!xfer->flags_int.open) { @@ -1390,9 +1403,9 @@ DPRINTF("open\n"); - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); (xfer->pipe->methods->open) (xfer); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); } /* set "transferring" flag */ xfer->flags_int.transferring = 1; @@ -1406,9 +1419,9 @@ * frequently the "done_q": */ if (xfer->wait_queue) { - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); usb2_transfer_dequeue(xfer); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); } /* clear "did_dma_delay" flag */ xfer->flags_int.did_dma_delay = 0; @@ -1441,16 +1454,16 @@ */ DPRINTF("xfer=%p nframes=0: stall " "or clear stall!\n", xfer); - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); xfer->flags_int.can_cancel_immed = 1; /* start the transfer */ usb2_command_wrapper(&xfer->pipe->pipe_q, xfer); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); return; } - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); usb2_transfer_done(xfer, USB_ERR_INVAL); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); return; } /* compute total transfer length */ @@ -1459,9 +1472,9 @@ xfer->sumlen += xfer->frlengths[x]; if (xfer->sumlen < xfer->frlengths[x]) { /* length wrapped around */ - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); usb2_transfer_done(xfer, USB_ERR_INVAL); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); return; } } @@ -1476,9 +1489,9 @@ if (xfer->flags_int.control_xfr) { if (usb2_start_hardware_sub(xfer)) { - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); usb2_transfer_done(xfer, USB_ERR_STALLED); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); return; } } ==== //depot/projects/vimage-commit/src/sys/ia64/isa/isa.c#3 (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/ia64/isa/isa.c,v 1.4 2007/02/24 16:56:22 piso Exp $ + * $FreeBSD: src/sys/ia64/isa/isa.c,v 1.5 2009/04/24 03:43:20 marcel Exp $ */ /* @@ -73,17 +73,6 @@ { } -intrmask_t -isa_irq_pending(void) -{ - u_char irr1; - u_char irr2; - - irr1 = inb(IO_ICU1); - irr2 = inb(IO_ICU2); - return ((irr2 << 8) | irr1); -} - /* * This implementation simply passes the request up to the parent * bus, which in our case is the special i386 nexus, substituting any ==== //depot/projects/vimage-commit/src/sys/kern/kern_vimage.c#10 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_vimage.c,v 1.2 2009/04/11 05:58:58 zec Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_vimage.c,v 1.3 2009/04/26 07:09:39 zec Exp $"); #include #include ==== //depot/projects/vimage-commit/src/sys/kern/tty_pts.c#7 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/tty_pts.c,v 1.30 2009/03/01 09:50:13 ed Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/tty_pts.c,v 1.31 2009/04/25 10:05:55 ed Exp $"); #include "opt_tty.h" @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -58,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -66,8 +68,16 @@ #include +/* + * Our utmp(5) format is limited to 8-byte TTY line names. This means + * we can at most allocate 1000 pseudo-terminals ("pts/999"). Allow + * users to increase this number, assuming they have manually increased + * UT_LINESIZE. + */ static struct unrhdr *pts_pool; -#define MAXPTSDEVS 999 +static unsigned int pts_maxdev = 999; +SYSCTL_UINT(_kern, OID_AUTO, pts_maxdev, CTLFLAG_RW, &pts_maxdev, 0, + "Maximum amount of pts(4) pseudo-terminals"); static MALLOC_DEFINE(M_PTS, "pts", "pseudo tty device"); @@ -716,6 +726,11 @@ chgptscnt(uid, -1, 0); return (EAGAIN); } + if (unit > pts_maxdev) { + free_unr(pts_pool, unit); + chgptscnt(uid, -1, 0); + return (EAGAIN); + } /* Allocate TTY and softc. */ psc = malloc(sizeof(struct pts_softc), M_PTS, M_WAITOK|M_ZERO); @@ -829,7 +844,7 @@ pts_init(void *unused) { - pts_pool = new_unrhdr(0, MAXPTSDEVS, NULL); + pts_pool = new_unrhdr(0, INT_MAX, NULL); #if defined(PTS_COMPAT) || defined(PTS_LINUX) make_dev(&ptmx_cdevsw, 0, UID_ROOT, GID_WHEEL, 0666, "ptmx"); #endif /* PTS_COMPAT || PTS_LINUX */ ==== //depot/projects/vimage-commit/src/sys/netgraph/netgraph.h#9 (text+ko) ==== @@ -37,7 +37,7 @@ * * Author: Julian Elischer * - * $FreeBSD: src/sys/netgraph/netgraph.h,v 1.80 2008/12/13 22:26:24 mav Exp $ + * $FreeBSD: src/sys/netgraph/netgraph.h,v 1.81 2009/04/26 07:14:50 zec Exp $ * $Whistle: netgraph.h,v 1.29 1999/11/01 07:56:13 julian Exp $ */ ==== //depot/projects/vimage-commit/src/sys/netgraph/ng_base.c#16 (text+ko) ==== @@ -38,7 +38,7 @@ * Authors: Julian Elischer * Archie Cobbs * - * $FreeBSD: src/sys/netgraph/ng_base.c,v 1.171 2008/12/14 20:15:30 mav Exp $ + * $FreeBSD: src/sys/netgraph/ng_base.c,v 1.172 2009/04/26 07:14:50 zec Exp $ * $Whistle: ng_base.c,v 1.39 1999/01/28 23:54:53 julian Exp $ */ ==== //depot/projects/vimage-commit/src/sys/netgraph/ng_eiface.c#14 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/netgraph/ng_eiface.c,v 1.46 2009/04/19 22:04:29 rwatson Exp $ + * $FreeBSD: src/sys/netgraph/ng_eiface.c,v 1.47 2009/04/26 07:14:50 zec Exp $ */ #include ==== //depot/projects/vimage-commit/src/sys/netgraph/ng_ether.c#13 (text+ko) ==== @@ -39,7 +39,7 @@ * Authors: Archie Cobbs * Julian Elischer * - * $FreeBSD: src/sys/netgraph/ng_ether.c,v 1.67 2009/02/27 14:12:05 bz Exp $ + * $FreeBSD: src/sys/netgraph/ng_ether.c,v 1.68 2009/04/26 07:14:50 zec Exp $ */ /* ==== //depot/projects/vimage-commit/src/sys/netgraph/ng_iface.c#13 (text+ko) ==== @@ -37,7 +37,7 @@ * * Author: Archie Cobbs * - * $FreeBSD: src/sys/netgraph/ng_iface.c,v 1.58 2009/04/19 22:05:39 rwatson Exp $ + * $FreeBSD: src/sys/netgraph/ng_iface.c,v 1.59 2009/04/26 07:14:50 zec Exp $ * $Whistle: ng_iface.c,v 1.33 1999/11/01 09:24:51 julian Exp $ */ ==== //depot/projects/vimage-commit/src/sys/netinet/in.c#13 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/netinet/in.c,v 1.126 2009/04/23 21:41:37 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/netinet/in.c,v 1.129 2009/04/25 23:02:57 rwatson Exp $"); #include "opt_carp.h" @@ -280,6 +280,31 @@ return (EADDRNOTAVAIL); /* + * Security checks before we get involved in any work. + */ + switch (cmd) { + case SIOCAIFADDR: + case SIOCSIFADDR: + case SIOCSIFBRDADDR: + case SIOCSIFNETMASK: + case SIOCSIFDSTADDR: + if (td != NULL) { + error = priv_check(td, PRIV_NET_ADDIFADDR); + if (error) + return (error); + } + break; + + case SIOCDIFADDR: + if (td != NULL) { + error = priv_check(td, PRIV_NET_DELIFADDR); + if (error) + return (error); + } + break; + } + + /* * Find address for this interface, if it exists. * * If an alias address was specified, find that one instead of the @@ -295,6 +320,7 @@ break; } } + IF_ADDR_LOCK(ifp); if (ia == NULL) { TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { iap = ifatoia(ifa); @@ -311,6 +337,7 @@ if (ia == NULL) iaIsFirst = 1; + error = 0; switch (cmd) { case SIOCAIFADDR: case SIOCDIFADDR: @@ -325,31 +352,27 @@ && (cmd == SIOCAIFADDR) && (ifra->ifra_dstaddr.sin_addr.s_addr == INADDR_ANY)) { - return (EDESTADDRREQ); + error = EDESTADDRREQ; + goto out_unlock; } } - if (cmd == SIOCDIFADDR && ia == NULL) - return (EADDRNOTAVAIL); + if (cmd == SIOCDIFADDR && ia == NULL) { + error = EADDRNOTAVAIL; + goto out_unlock; + } /* FALLTHROUGH */ case SIOCSIFADDR: case SIOCSIFNETMASK: case SIOCSIFDSTADDR: - if (td != NULL) { - error = priv_check(td, (cmd == SIOCDIFADDR) ? - PRIV_NET_DELIFADDR : PRIV_NET_ADDIFADDR); - if (error) - return (error); - } - if (ia == NULL) { ia = (struct in_ifaddr *) - malloc(sizeof *ia, M_IFADDR, M_WAITOK | M_ZERO); - if (ia == NULL) - return (ENOBUFS); - /* - * Protect from ipintr() traversing address list - * while we're modifying it. - */ + malloc(sizeof *ia, M_IFADDR, M_NOWAIT | + M_ZERO); + if (ia == NULL) { + error = ENOBUFS; + goto out_unlock; + } + ifa = &ia->ia_ifa; IFA_LOCK_INIT(ifa); ifa->ifa_addr = (struct sockaddr *)&ia->ia_addr; @@ -365,9 +388,7 @@ } ia->ia_ifp = ifp; - IF_ADDR_LOCK(ifp); TAILQ_INSERT_TAIL(&ifp->if_addrhead, ifa, ifa_link); - IF_ADDR_UNLOCK(ifp); s = splnet(); TAILQ_INSERT_TAIL(&V_in_ifaddrhead, ia, ia_link); splx(s); @@ -376,48 +397,64 @@ break; case SIOCSIFBRDADDR: - if (td != NULL) { - error = priv_check(td, PRIV_NET_ADDIFADDR); - if (error) - return (error); - } - /* FALLTHROUGH */ - case SIOCGIFADDR: case SIOCGIFNETMASK: case SIOCGIFDSTADDR: case SIOCGIFBRDADDR: - if (ia == NULL) - return (EADDRNOTAVAIL); + if (ia == NULL) { + error = EADDRNOTAVAIL; + goto out_unlock; + } break; } + + /* + * Most paths in this switch return directly or via out_unlock. Only + * paths that remove the address break in order to hit common removal + * code. + * + * XXXRW: We enter the switch with IF_ADDR_LOCK() held, but leave + * without it. This is a bug. + */ + IF_ADDR_LOCK_ASSERT(ifp); switch (cmd) { - case SIOCGIFADDR: *((struct sockaddr_in *)&ifr->ifr_addr) = ia->ia_addr; - return (0); + goto out_unlock; case SIOCGIFBRDADDR: >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Sun Apr 26 07:25:04 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 58BBD1065675; Sun, 26 Apr 2009 07:25:04 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 150141065670 for ; Sun, 26 Apr 2009 07:25:04 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 021078FC13 for ; Sun, 26 Apr 2009 07:25:04 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3Q7P3HT022978 for ; Sun, 26 Apr 2009 07:25:03 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3Q7P3R6022972 for perforce@freebsd.org; Sun, 26 Apr 2009 07:25:03 GMT (envelope-from zec@fer.hr) Date: Sun, 26 Apr 2009 07:25:03 GMT Message-Id: <200904260725.n3Q7P3R6022972@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 161096 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 07:25:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=161096 Change 161096 by zec@zec_tpx32 on 2009/04/26 07:25:02 IFC @ 161094 Affected files ... .. //depot/projects/vimage-commit2/src/sys/conf/files.powerpc#11 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ed/if_ed_pccard.c#9 integrate .. //depot/projects/vimage-commit2/src/sys/dev/pccard/pccarddevs#11 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb/controller/ehci.c#7 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb/controller/ohci.c#6 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb/controller/uhci.c#6 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb/usb_core.h#7 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb/usb_device.c#7 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb/usb_device.h#6 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb/usb_generic.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb/usb_hub.c#7 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb/usb_request.c#6 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb/usb_revision.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/dev/usb/usb_transfer.c#6 integrate .. //depot/projects/vimage-commit2/src/sys/ia64/isa/isa.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/kern/kern_vimage.c#18 integrate .. //depot/projects/vimage-commit2/src/sys/kern/tty_pts.c#10 integrate .. //depot/projects/vimage-commit2/src/sys/netgraph/netgraph.h#22 integrate .. //depot/projects/vimage-commit2/src/sys/netgraph/ng_base.c#27 integrate .. //depot/projects/vimage-commit2/src/sys/netgraph/ng_eiface.c#22 integrate .. //depot/projects/vimage-commit2/src/sys/netgraph/ng_ether.c#14 integrate .. //depot/projects/vimage-commit2/src/sys/netgraph/ng_iface.c#21 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/in.c#23 integrate .. //depot/projects/vimage-commit2/src/sys/powerpc/aim/machdep.c#8 integrate .. //depot/projects/vimage-commit2/src/sys/powerpc/booke/pmap.c#8 integrate .. //depot/projects/vimage-commit2/src/sys/powerpc/conf/MPC85XX#4 integrate .. //depot/projects/vimage-commit2/src/sys/powerpc/include/intr_machdep.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/powerpc/include/pte.h#4 integrate .. //depot/projects/vimage-commit2/src/sys/powerpc/mpc85xx/atpic.c#1 branch .. //depot/projects/vimage-commit2/src/sys/powerpc/mpc85xx/isa.c#1 branch .. //depot/projects/vimage-commit2/src/sys/powerpc/mpc85xx/ocpbus.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/powerpc/mpc85xx/pci_ocp.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/powerpc/powerpc/autoconf.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/powerpc/powerpc/bus_machdep.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/powerpc/powerpc/intr_machdep.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/sys/vimage.h#43 integrate .. //depot/projects/vimage-commit2/src/sys/vm/swap_pager.c#7 integrate .. //depot/projects/vimage-commit2/src/sys/vm/vnode_pager.c#7 integrate Differences ... ==== //depot/projects/vimage-commit2/src/sys/conf/files.powerpc#11 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.powerpc,v 1.98 2009/04/05 18:40:15 nwhitehorn Exp $ +# $FreeBSD: src/sys/conf/files.powerpc,v 1.99 2009/04/24 03:51:11 marcel Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -103,6 +103,8 @@ powerpc/fpu/fpu_mul.c optional fpu_emu powerpc/fpu/fpu_sqrt.c optional fpu_emu powerpc/fpu/fpu_subr.c optional fpu_emu +powerpc/mpc85xx/atpic.c optional mpc85xx isa +powerpc/mpc85xx/isa.c optional mpc85xx isa powerpc/mpc85xx/lbc.c optional mpc85xx powerpc/mpc85xx/mpc85xx.c optional mpc85xx powerpc/mpc85xx/nexus.c optional mpc85xx ==== //depot/projects/vimage-commit2/src/sys/dev/ed/if_ed_pccard.c#9 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ed/if_ed_pccard.c,v 1.154 2009/04/22 16:51:01 imp Exp $ + * $FreeBSD: src/sys/dev/ed/if_ed_pccard.c,v 1.155 2009/04/24 17:28:12 imp Exp $ */ /* @@ -210,8 +210,9 @@ { PCMCIA_CARD(NEXTCOM, NEXTHAWK), 0}, { PCMCIA_CARD(NEWMEDIA, LANSURFER), NE2000DVF_ANYFUNC}, { PCMCIA_CARD(NEWMEDIA, LIVEWIRE), 0}, + { PCMCIA_CARD(OEM2, 100BASE), NE2000DVF_AX88X90}, { PCMCIA_CARD(OEM2, ETHERNET), 0}, - { PCMCIA_CARD(OEM2, FAST_ETHERNET), NE2000DVF_AX88X90 }, + { PCMCIA_CARD(OEM2, FAST_ETHERNET), NE2000DVF_AX88X90}, { PCMCIA_CARD(OEM2, NE2000), 0}, { PCMCIA_CARD(PLANET, SMARTCOM2000), 0 }, { PCMCIA_CARD(PREMAX, PE200), 0}, ==== //depot/projects/vimage-commit2/src/sys/dev/pccard/pccarddevs#11 (text+ko) ==== @@ -1,4 +1,4 @@ -$FreeBSD: src/sys/dev/pccard/pccarddevs,v 1.147 2009/04/22 16:50:44 imp Exp $ +$FreeBSD: src/sys/dev/pccard/pccarddevs,v 1.148 2009/04/24 17:27:45 imp Exp $ /* $NetBSD: pcmciadevs,v 1.226 2008/06/19 18:20:33 imp Exp $ */ /* $OpenBSD: pcmciadevs,v 1.93 2002/06/21 08:31:10 henning Exp $ */ @@ -772,6 +772,7 @@ product OEM2 CDROM1 { "PCMCIA", "CD-ROM", NULL, NULL } Generic PCMCIA CD-ROM product OEM2 IDE { "PCMCIA", "IDE&spCARD", NULL, NULL } Generic PCMCIA IDE CARD product OEM2 ETHERNET { "PCMCIA", "Ethernet", NULL, NULL } NE2000 PC Card +product OEM2 100BASE { "PCMCIA", "100BASE", NULL, NULL } NE2000 PC Card product OEM2 FAST_ETHERNET { "PCMCIA", "FAST&spETHERNET&spCARD", NULL, NULL } NE2000 PC Card product OEM2 NE2000 { "NE2000&spCompatible&spPC&spCard", "PCMCIA", NULL, NULL } Generic NE2000 PC Card product PHISON CF_CARD { "PHISON", "CF&spCard", NULL, NULL } Generic CF or SD/MMC/SmartMedia Reader ==== //depot/projects/vimage-commit2/src/sys/dev/usb/controller/ehci.c#7 (text+ko) ==== @@ -44,7 +44,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb/controller/ehci.c,v 1.14 2009/04/22 17:08:16 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb/controller/ehci.c,v 1.15 2009/04/25 21:10:06 thompsa Exp $"); #include #include @@ -1964,7 +1964,7 @@ usb2_pc_cpu_flush(qh->page_cache); - if (xfer->xroot->udev->pwr_save.suspended == 0) { + if (xfer->xroot->udev->state != USB_STATE_SUSPENDED) { EHCI_APPEND_QH(qh, *qh_last); } } ==== //depot/projects/vimage-commit2/src/sys/dev/usb/controller/ohci.c#6 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb/controller/ohci.c,v 1.11 2009/04/22 17:08:16 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb/controller/ohci.c,v 1.12 2009/04/25 21:10:06 thompsa Exp $"); /* * USB Open Host Controller driver. @@ -1020,7 +1020,7 @@ * writing the BLF and CLF bits: */ - if (xfer->xroot->udev->pwr_save.suspended) { + if (xfer->xroot->udev->state == USB_STATE_SUSPENDED) { /* nothing to do */ } else if (xfer->pipe->methods == &ohci_device_bulk_methods) { ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); @@ -1589,7 +1589,7 @@ ed->ed_headp = td->td_self; - if (xfer->xroot->udev->pwr_save.suspended == 0) { + if (xfer->xroot->udev->state != USB_STATE_SUSPENDED) { /* the append function will flush the endpoint descriptor */ OHCI_APPEND_QH(ed, *ed_last); ==== //depot/projects/vimage-commit2/src/sys/dev/usb/controller/uhci.c#6 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb/controller/uhci.c,v 1.10 2009/04/22 17:08:16 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb/controller/uhci.c,v 1.11 2009/04/25 21:10:06 thompsa Exp $"); /* * USB Universal Host Controller driver. @@ -1921,7 +1921,7 @@ qh->e_next = td; qh->qh_e_next = td->td_self; - if (xfer->xroot->udev->pwr_save.suspended == 0) { + if (xfer->xroot->udev->state != USB_STATE_SUSPENDED) { UHCI_APPEND_QH(qh, sc->sc_bulk_p_last); uhci_add_loop(sc); xfer->flags_int.bandwidth_reclaimed = 1; @@ -1982,7 +1982,7 @@ * NOTE: some devices choke on bandwidth- reclamation for control * transfers */ - if (xfer->xroot->udev->pwr_save.suspended == 0) { + if (xfer->xroot->udev->state != USB_STATE_SUSPENDED) { if (xfer->xroot->udev->speed == USB_SPEED_LOW) { UHCI_APPEND_QH(qh, sc->sc_ls_ctl_p_last); } else { @@ -2071,7 +2071,7 @@ qh->e_next = td; qh->qh_e_next = td->td_self; - if (xfer->xroot->udev->pwr_save.suspended == 0) { + if (xfer->xroot->udev->state != USB_STATE_SUSPENDED) { /* enter QHs into the controller data structures */ UHCI_APPEND_QH(qh, sc->sc_intr_p_last[xfer->qh_pos]); ==== //depot/projects/vimage-commit2/src/sys/dev/usb/usb_core.h#7 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_core.h,v 1.12 2009/04/22 17:08:16 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_core.h,v 1.14 2009/04/25 21:25:52 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -515,6 +515,7 @@ /* prototypes */ const char *usb2_errstr(usb2_error_t error); +const char *usb2_statestr(enum usb_dev_state state); struct usb2_config_descriptor *usb2_get_config_descriptor( struct usb2_device *udev); struct usb2_device_descriptor *usb2_get_device_descriptor( @@ -552,5 +553,6 @@ uint8_t usb2_get_bus_index(struct usb2_device *udev); uint8_t usb2_get_device_index(struct usb2_device *udev); void usb2_set_power_mode(struct usb2_device *udev, uint8_t power_mode); +int usb2_device_attached(struct usb2_device *udev); #endif /* _USB2_CORE_H_ */ ==== //depot/projects/vimage-commit2/src/sys/dev/usb/usb_device.c#7 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_device.c,v 1.27 2009/04/22 17:08:16 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_device.c,v 1.29 2009/04/25 21:25:52 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -90,6 +90,22 @@ SYSCTL_INT(_hw_usb2, OID_AUTO, template, CTLFLAG_RW, &usb2_template, 0, "Selected USB device side template"); +static const char* statestr[USB_STATE_MAX] = { + [USB_STATE_DETACHED] = "DETACHED", + [USB_STATE_ATTACHED] = "ATTACHED", + [USB_STATE_POWERED] = "POWERED", + [USB_STATE_ADDRESSED] = "ADDRESSED", + [USB_STATE_CONFIGURED] = "CONFIGURED", + [USB_STATE_SUSPENDED] = "SUSPENDED" +}; + +const char * +usb2_statestr(enum usb_dev_state state) +{ + KASSERT(state < USB_STATE_MAX, ("invalid udev state")); + + return (statestr[state]); +} /*------------------------------------------------------------------------* * usb2_get_pipe_by_addr @@ -457,6 +473,8 @@ * the current config number and index. */ err = usb2_req_set_config(udev, NULL, USB_UNCONFIG_NO); + if (udev->state == USB_STATE_CONFIGURED) + usb2_set_device_state(udev, USB_STATE_ADDRESSED); goto done; } /* get the full config descriptor */ @@ -524,6 +542,7 @@ udev->power = power; udev->curr_config_no = cdp->bConfigurationValue; udev->curr_config_index = index; + usb2_set_device_state(udev, USB_STATE_CONFIGURED); /* Set the actual configuration value. */ err = usb2_req_set_config(udev, NULL, cdp->bConfigurationValue); @@ -980,7 +999,7 @@ udev->port_no, udev->address); if (device_is_attached(dev)) { - if (udev->flags.suspended) { + if (udev->state == USB_STATE_SUSPENDED) { err = DEVICE_RESUME(dev); if (err) { device_printf(dev, "Resume failed!\n"); @@ -1120,7 +1139,7 @@ uaa->temp_dev = NULL; device_set_ivars(iface->subdev, NULL); - if (udev->flags.suspended) { + if (udev->state == USB_STATE_SUSPENDED) { err = DEVICE_SUSPEND(iface->subdev); if (err) device_printf(iface->subdev, "Suspend failed\n"); @@ -1341,12 +1360,12 @@ USB_BUS_LOCK(udev->bus); /* filter the suspend events */ - if (udev->flags.suspended == do_suspend) { + if ((udev->state == USB_STATE_SUSPENDED && do_suspend) || + (udev->state != USB_STATE_SUSPENDED && !do_suspend)) { USB_BUS_UNLOCK(udev->bus); /* nothing to do */ return (0); } - udev->flags.suspended = do_suspend; USB_BUS_UNLOCK(udev->bus); /* do the suspend or resume */ @@ -1471,6 +1490,7 @@ udev->bus = bus; udev->address = USB_START_ADDR; /* default value */ udev->plugtime = (usb2_ticks_t)ticks; + usb2_set_device_state(udev, USB_STATE_POWERED); /* * We need to force the power mode to "on" because there are plenty * of USB devices out there that do not work very well with @@ -1572,6 +1592,7 @@ goto done; } } + usb2_set_device_state(udev, USB_STATE_ADDRESSED); /* * Get the first 8 bytes of the device descriptor ! @@ -1927,7 +1948,8 @@ DPRINTFN(4, "udev=%p port=%d\n", udev, udev->port_no); - bus = udev->bus;; + bus = udev->bus; + usb2_set_device_state(udev, USB_STATE_DETACHED); #if USB_HAVE_UGEN usb2_notify_addq("-", udev); @@ -2438,3 +2460,20 @@ } return (0); /* not supported */ } + +void +usb2_set_device_state(struct usb2_device *udev, enum usb_dev_state state) +{ + + KASSERT(state < USB_STATE_MAX, ("invalid udev state")); + + DPRINTF("udev %p state %s -> %s\n", udev, + usb2_statestr(udev->state), usb2_statestr(state)); + udev->state = state; +} + +int +usb2_device_attached(struct usb2_device *udev) +{ + return (udev->state > USB_STATE_DETACHED); +} ==== //depot/projects/vimage-commit2/src/sys/dev/usb/usb_device.h#6 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_device.h,v 1.14 2009/04/22 17:07:53 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_device.h,v 1.15 2009/04/25 21:10:06 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -85,7 +85,6 @@ struct usb2_device_flags { uint8_t usb2_mode:1; /* USB mode (see USB_MODE_XXX) */ uint8_t self_powered:1; /* set if USB device is self powered */ - uint8_t suspended:1; /* set if USB device is suspended */ uint8_t no_strings:1; /* set if USB device does not support * strings */ uint8_t remote_wakeup:1; /* set if remote wakeup is enabled */ @@ -101,7 +100,6 @@ usb2_size_t type_refs[4]; /* transfer reference count */ usb2_size_t read_refs; /* data read references */ usb2_size_t write_refs; /* data write references */ - uint8_t suspended; /* set if USB device is suspended */ }; /* @@ -139,6 +137,7 @@ #endif usb2_ticks_t plugtime; /* copy of "ticks" */ + enum usb_dev_state state; uint16_t refcount; #define USB_DEV_REF_MAX 0xffff @@ -205,5 +204,7 @@ void usb_linux_free_device(struct usb_device *dev); uint8_t usb2_peer_can_wakeup(struct usb2_device *udev); struct usb2_pipe *usb2_pipe_foreach(struct usb2_device *udev, struct usb2_pipe *pipe); +void usb2_set_device_state(struct usb2_device *udev, + enum usb_dev_state state); #endif /* _USB2_DEVICE_H_ */ ==== //depot/projects/vimage-commit2/src/sys/dev/usb/usb_generic.c#5 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_generic.c,v 1.9 2009/04/05 18:20:38 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_generic.c,v 1.10 2009/04/25 21:10:06 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -823,7 +823,7 @@ di->udi_speed = udev->speed; di->udi_mode = udev->flags.usb2_mode; di->udi_power_mode = udev->power_mode; - if (udev->flags.suspended) { + if (udev->state == USB_STATE_SUSPENDED) { di->udi_suspended = 1; } else { di->udi_suspended = 0; ==== //depot/projects/vimage-commit2/src/sys/dev/usb/usb_hub.c#7 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_hub.c,v 1.13 2009/04/22 17:07:56 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_hub.c,v 1.14 2009/04/25 21:10:06 thompsa Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. * Copyright (c) 1998 Lennart Augustsson. All rights reserved. @@ -544,7 +544,7 @@ if (udev->depth > USB_HUB_MAX_DEPTH) { return (USB_ERR_TOO_DEEP); } - if (udev->pwr_save.suspended) { + if (udev->state == USB_STATE_SUSPENDED) { /* need to wait until the child signals resume */ DPRINTF("Device is suspended!\n"); return (0); @@ -1518,7 +1518,7 @@ udev->pwr_save.write_refs += val; } - if (udev->pwr_save.suspended) + if (udev->state == USB_STATE_SUSPENDED) needs_explore = (udev->pwr_save.write_refs != 0) || ((udev->pwr_save.read_refs != 0) && @@ -1600,7 +1600,7 @@ (rem_wakeup == 0))) { /* check if we are suspended */ - if (udev->pwr_save.suspended != 0) { + if (udev->state == USB_STATE_SUSPENDED) { USB_BUS_UNLOCK(bus); usb2_dev_resume_peer(udev); USB_BUS_LOCK(bus); @@ -1608,7 +1608,7 @@ } else if (temp >= limit) { /* check if we are not suspended */ - if (udev->pwr_save.suspended == 0) { + if (udev->state != USB_STATE_SUSPENDED) { USB_BUS_UNLOCK(bus); usb2_dev_suspend_peer(udev); USB_BUS_LOCK(bus); @@ -1647,7 +1647,7 @@ if (temp < mintime) mintime = temp; - if (udev->pwr_save.suspended == 0) { + if (udev->state != USB_STATE_SUSPENDED) { type_refs[0] += udev->pwr_save.type_refs[0]; type_refs[1] += udev->pwr_save.type_refs[1]; type_refs[2] += udev->pwr_save.type_refs[2]; @@ -1697,7 +1697,7 @@ return; /* check if already resumed */ - if (udev->pwr_save.suspended == 0) + if (udev->state != USB_STATE_SUSPENDED) return; /* we need a parent HUB to do resume */ @@ -1737,7 +1737,7 @@ } USB_BUS_LOCK(bus); /* set that this device is now resumed */ - udev->pwr_save.suspended = 0; + usb2_set_device_state(udev, USB_STATE_CONFIGURED); #if USB_HAVE_POWERD /* make sure that we don't go into suspend right away */ udev->pwr_save.last_xfer_time = ticks; @@ -1797,7 +1797,7 @@ return; /* check if already suspended */ - if (udev->pwr_save.suspended) + if (udev->state == USB_STATE_SUSPENDED) return; /* we need a parent HUB to do suspend */ @@ -1819,7 +1819,7 @@ if (child == NULL) continue; - if (child->pwr_save.suspended) + if (child->state == USB_STATE_SUSPENDED) continue; DPRINTFN(1, "Port %u is busy on the HUB!\n", x + 1); @@ -1846,7 +1846,7 @@ * Set that this device is suspended. This variable must be set * before calling USB controller suspend callbacks. */ - udev->pwr_save.suspended = 1; + usb2_set_device_state(udev, USB_STATE_SUSPENDED); USB_BUS_UNLOCK(udev->bus); if (udev->bus->methods->device_suspend != NULL) { ==== //depot/projects/vimage-commit2/src/sys/dev/usb/usb_request.c#6 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_request.c,v 1.13 2009/04/22 17:08:16 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_request.c,v 1.14 2009/04/25 21:10:06 thompsa Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. * Copyright (c) 1998 Lennart Augustsson. All rights reserved. @@ -271,6 +271,12 @@ req->wIndex[1], req->wIndex[0], req->wLength[1], req->wLength[0]); + /* Check if the device is still alive */ + if (udev->state < USB_STATE_POWERED) { + DPRINTF("usb device has gone\n"); + return (USB_ERR_NOT_CONFIGURED); + } + /* * Set "actlen" to a known value in case the caller does not * check the return value: ==== //depot/projects/vimage-commit2/src/sys/dev/usb/usb_revision.h#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_revision.h,v 1.1 2009/02/23 18:31:00 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_revision.h,v 1.2 2009/04/25 21:10:06 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -62,4 +62,16 @@ USB_MODE_MAX }; +/* + * The "USB_MODE" macro defines all the supported device states. + */ +enum usb_dev_state { + USB_STATE_DETACHED, + USB_STATE_ATTACHED, + USB_STATE_POWERED, + USB_STATE_ADDRESSED, + USB_STATE_CONFIGURED, + USB_STATE_SUSPENDED, + USB_STATE_MAX, +}; #endif /* _USB2_REVISION_H_ */ ==== //depot/projects/vimage-commit2/src/sys/dev/usb/usb_transfer.c#6 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_transfer.c,v 1.12 2009/04/22 17:08:10 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_transfer.c,v 1.13 2009/04/25 21:10:06 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -1365,24 +1365,37 @@ void usb2_start_hardware(struct usb2_xfer *xfer) { + struct usb2_xfer_root *info; + struct usb2_bus *bus; usb2_frcount_t x; + info = xfer->xroot; + bus = info->bus; + DPRINTF("xfer=%p, pipe=%p, nframes=%d, dir=%s\n", xfer, xfer->pipe, xfer->nframes, USB_GET_DATA_ISREAD(xfer) ? "read" : "write"); + /* Check if the device is still alive */ + if (info->udev->state < USB_STATE_POWERED) { + USB_BUS_LOCK(bus); + usb2_transfer_done(xfer, USB_ERR_NOT_CONFIGURED); + USB_BUS_UNLOCK(bus); + return; + } + #if USB_DEBUG if (USB_DEBUG_VAR > 0) { - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); usb2_dump_pipe(xfer->pipe); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); } #endif USB_XFER_LOCK_ASSERT(xfer, MA_OWNED); - USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_NOTOWNED); + USB_BUS_LOCK_ASSERT(bus, MA_NOTOWNED); /* Only open the USB transfer once! */ if (!xfer->flags_int.open) { @@ -1390,9 +1403,9 @@ DPRINTF("open\n"); - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); (xfer->pipe->methods->open) (xfer); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); } /* set "transferring" flag */ xfer->flags_int.transferring = 1; @@ -1406,9 +1419,9 @@ * frequently the "done_q": */ if (xfer->wait_queue) { - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); usb2_transfer_dequeue(xfer); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); } /* clear "did_dma_delay" flag */ xfer->flags_int.did_dma_delay = 0; @@ -1441,16 +1454,16 @@ */ DPRINTF("xfer=%p nframes=0: stall " "or clear stall!\n", xfer); - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); xfer->flags_int.can_cancel_immed = 1; /* start the transfer */ usb2_command_wrapper(&xfer->pipe->pipe_q, xfer); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); return; } - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); usb2_transfer_done(xfer, USB_ERR_INVAL); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); return; } /* compute total transfer length */ @@ -1459,9 +1472,9 @@ xfer->sumlen += xfer->frlengths[x]; if (xfer->sumlen < xfer->frlengths[x]) { /* length wrapped around */ - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); usb2_transfer_done(xfer, USB_ERR_INVAL); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); return; } } @@ -1476,9 +1489,9 @@ if (xfer->flags_int.control_xfr) { if (usb2_start_hardware_sub(xfer)) { - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); usb2_transfer_done(xfer, USB_ERR_STALLED); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); return; } } ==== //depot/projects/vimage-commit2/src/sys/ia64/isa/isa.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/ia64/isa/isa.c,v 1.4 2007/02/24 16:56:22 piso Exp $ + * $FreeBSD: src/sys/ia64/isa/isa.c,v 1.5 2009/04/24 03:43:20 marcel Exp $ */ /* @@ -73,17 +73,6 @@ { } -intrmask_t -isa_irq_pending(void) -{ - u_char irr1; - u_char irr2; - - irr1 = inb(IO_ICU1); - irr2 = inb(IO_ICU2); - return ((irr2 << 8) | irr1); -} - /* * This implementation simply passes the request up to the parent * bus, which in our case is the special i386 nexus, substituting any ==== //depot/projects/vimage-commit2/src/sys/kern/kern_vimage.c#18 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_vimage.c,v 1.2 2009/04/11 05:58:58 zec Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_vimage.c,v 1.3 2009/04/26 07:09:39 zec Exp $"); #include #include @@ -155,6 +155,7 @@ void vnet_mod_deregister(const struct vnet_modinfo *vmi) { + vnet_mod_deregister_multi(vmi, NULL, NULL); } ==== //depot/projects/vimage-commit2/src/sys/kern/tty_pts.c#10 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/tty_pts.c,v 1.30 2009/03/01 09:50:13 ed Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/tty_pts.c,v 1.31 2009/04/25 10:05:55 ed Exp $"); #include "opt_tty.h" @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -58,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -66,8 +68,16 @@ #include +/* + * Our utmp(5) format is limited to 8-byte TTY line names. This means + * we can at most allocate 1000 pseudo-terminals ("pts/999"). Allow + * users to increase this number, assuming they have manually increased + * UT_LINESIZE. + */ static struct unrhdr *pts_pool; -#define MAXPTSDEVS 999 +static unsigned int pts_maxdev = 999; +SYSCTL_UINT(_kern, OID_AUTO, pts_maxdev, CTLFLAG_RW, &pts_maxdev, 0, + "Maximum amount of pts(4) pseudo-terminals"); static MALLOC_DEFINE(M_PTS, "pts", "pseudo tty device"); @@ -716,6 +726,11 @@ chgptscnt(uid, -1, 0); return (EAGAIN); } + if (unit > pts_maxdev) { + free_unr(pts_pool, unit); + chgptscnt(uid, -1, 0); + return (EAGAIN); + } /* Allocate TTY and softc. */ psc = malloc(sizeof(struct pts_softc), M_PTS, M_WAITOK|M_ZERO); @@ -829,7 +844,7 @@ pts_init(void *unused) { - pts_pool = new_unrhdr(0, MAXPTSDEVS, NULL); + pts_pool = new_unrhdr(0, INT_MAX, NULL); #if defined(PTS_COMPAT) || defined(PTS_LINUX) make_dev(&ptmx_cdevsw, 0, UID_ROOT, GID_WHEEL, 0666, "ptmx"); #endif /* PTS_COMPAT || PTS_LINUX */ ==== //depot/projects/vimage-commit2/src/sys/netgraph/netgraph.h#22 (text+ko) ==== @@ -37,7 +37,7 @@ * * Author: Julian Elischer * - * $FreeBSD: src/sys/netgraph/netgraph.h,v 1.80 2008/12/13 22:26:24 mav Exp $ + * $FreeBSD: src/sys/netgraph/netgraph.h,v 1.81 2009/04/26 07:14:50 zec Exp $ * $Whistle: netgraph.h,v 1.29 1999/11/01 07:56:13 julian Exp $ */ ==== //depot/projects/vimage-commit2/src/sys/netgraph/ng_base.c#27 (text+ko) ==== @@ -38,7 +38,7 @@ * Authors: Julian Elischer * Archie Cobbs * - * $FreeBSD: src/sys/netgraph/ng_base.c,v 1.171 2008/12/14 20:15:30 mav Exp $ + * $FreeBSD: src/sys/netgraph/ng_base.c,v 1.172 2009/04/26 07:14:50 zec Exp $ * $Whistle: ng_base.c,v 1.39 1999/01/28 23:54:53 julian Exp $ */ ==== //depot/projects/vimage-commit2/src/sys/netgraph/ng_eiface.c#22 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/netgraph/ng_eiface.c,v 1.46 2009/04/19 22:04:29 rwatson Exp $ + * $FreeBSD: src/sys/netgraph/ng_eiface.c,v 1.47 2009/04/26 07:14:50 zec Exp $ */ #include ==== //depot/projects/vimage-commit2/src/sys/netgraph/ng_ether.c#14 (text+ko) ==== @@ -39,7 +39,7 @@ * Authors: Archie Cobbs * Julian Elischer * - * $FreeBSD: src/sys/netgraph/ng_ether.c,v 1.67 2009/02/27 14:12:05 bz Exp $ + * $FreeBSD: src/sys/netgraph/ng_ether.c,v 1.68 2009/04/26 07:14:50 zec Exp $ */ /* @@ -826,7 +826,7 @@ INIT_VNET_NET(curvnet); struct ifnet *ifp; - /* Create nodes for any already-existing Ethernet interfaces */ + /* Create nodes for any already-existing Ethernet interfaces. */ IFNET_RLOCK(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if (ifp->if_type == IFT_ETHER ==== //depot/projects/vimage-commit2/src/sys/netgraph/ng_iface.c#21 (text+ko) ==== @@ -37,7 +37,7 @@ * * Author: Archie Cobbs * - * $FreeBSD: src/sys/netgraph/ng_iface.c,v 1.58 2009/04/19 22:05:39 rwatson Exp $ + * $FreeBSD: src/sys/netgraph/ng_iface.c,v 1.59 2009/04/26 07:14:50 zec Exp $ * $Whistle: ng_iface.c,v 1.33 1999/11/01 09:24:51 julian Exp $ */ ==== //depot/projects/vimage-commit2/src/sys/netinet/in.c#23 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/netinet/in.c,v 1.126 2009/04/23 21:41:37 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/netinet/in.c,v 1.129 2009/04/25 23:02:57 rwatson Exp $"); #include "opt_carp.h" @@ -280,6 +280,31 @@ return (EADDRNOTAVAIL); /* + * Security checks before we get involved in any work. + */ + switch (cmd) { + case SIOCAIFADDR: + case SIOCSIFADDR: + case SIOCSIFBRDADDR: + case SIOCSIFNETMASK: + case SIOCSIFDSTADDR: + if (td != NULL) { + error = priv_check(td, PRIV_NET_ADDIFADDR); + if (error) + return (error); + } + break; + + case SIOCDIFADDR: + if (td != NULL) { + error = priv_check(td, PRIV_NET_DELIFADDR); + if (error) + return (error); + } + break; + } + + /* * Find address for this interface, if it exists. * * If an alias address was specified, find that one instead of the @@ -295,6 +320,7 @@ break; } } + IF_ADDR_LOCK(ifp); if (ia == NULL) { TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { iap = ifatoia(ifa); @@ -311,6 +337,7 @@ if (ia == NULL) iaIsFirst = 1; + error = 0; switch (cmd) { case SIOCAIFADDR: case SIOCDIFADDR: @@ -325,31 +352,27 @@ && (cmd == SIOCAIFADDR) && (ifra->ifra_dstaddr.sin_addr.s_addr == INADDR_ANY)) { - return (EDESTADDRREQ); + error = EDESTADDRREQ; + goto out_unlock; } } - if (cmd == SIOCDIFADDR && ia == NULL) - return (EADDRNOTAVAIL); + if (cmd == SIOCDIFADDR && ia == NULL) { + error = EADDRNOTAVAIL; + goto out_unlock; + } /* FALLTHROUGH */ case SIOCSIFADDR: case SIOCSIFNETMASK: case SIOCSIFDSTADDR: - if (td != NULL) { - error = priv_check(td, (cmd == SIOCDIFADDR) ? - PRIV_NET_DELIFADDR : PRIV_NET_ADDIFADDR); - if (error) - return (error); - } - if (ia == NULL) { ia = (struct in_ifaddr *) - malloc(sizeof *ia, M_IFADDR, M_WAITOK | M_ZERO); - if (ia == NULL) - return (ENOBUFS); - /* - * Protect from ipintr() traversing address list - * while we're modifying it. - */ + malloc(sizeof *ia, M_IFADDR, M_NOWAIT | + M_ZERO); + if (ia == NULL) { + error = ENOBUFS; + goto out_unlock; + } + ifa = &ia->ia_ifa; IFA_LOCK_INIT(ifa); ifa->ifa_addr = (struct sockaddr *)&ia->ia_addr; @@ -365,9 +388,7 @@ } ia->ia_ifp = ifp; - IF_ADDR_LOCK(ifp); TAILQ_INSERT_TAIL(&ifp->if_addrhead, ifa, ifa_link); - IF_ADDR_UNLOCK(ifp); s = splnet(); TAILQ_INSERT_TAIL(&V_in_ifaddrhead, ia, ia_link); splx(s); @@ -376,48 +397,64 @@ break; case SIOCSIFBRDADDR: - if (td != NULL) { - error = priv_check(td, PRIV_NET_ADDIFADDR); - if (error) - return (error); - } - /* FALLTHROUGH */ - case SIOCGIFADDR: case SIOCGIFNETMASK: case SIOCGIFDSTADDR: case SIOCGIFBRDADDR: - if (ia == NULL) - return (EADDRNOTAVAIL); + if (ia == NULL) { + error = EADDRNOTAVAIL; + goto out_unlock; + } break; } + >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Sun Apr 26 07:32:12 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BE0991065674; Sun, 26 Apr 2009 07:32:11 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D8731065670 for ; Sun, 26 Apr 2009 07:32:11 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6AC328FC2F for ; Sun, 26 Apr 2009 07:32:11 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3Q7WBgs025925 for ; Sun, 26 Apr 2009 07:32:11 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3Q7WBD9025923 for perforce@freebsd.org; Sun, 26 Apr 2009 07:32:11 GMT (envelope-from zec@fer.hr) Date: Sun, 26 Apr 2009 07:32:11 GMT Message-Id: <200904260732.n3Q7WBD9025923@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 161097 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 07:32:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=161097 Change 161097 by zec@zec_amdx2 on 2009/04/26 07:32:02 IFC @ 161094 Affected files ... .. //depot/projects/vimage/src/share/man/man4/pts.4#2 integrate .. //depot/projects/vimage/src/share/man/man5/rc.conf.5#6 integrate .. //depot/projects/vimage/src/sys/conf/files.powerpc#21 integrate .. //depot/projects/vimage/src/sys/dev/ed/if_ed_pccard.c#11 integrate .. //depot/projects/vimage/src/sys/dev/pccard/pccarddevs#15 integrate .. //depot/projects/vimage/src/sys/dev/usb/controller/ehci.c#8 integrate .. //depot/projects/vimage/src/sys/dev/usb/controller/ohci.c#7 integrate .. //depot/projects/vimage/src/sys/dev/usb/controller/uhci.c#7 integrate .. //depot/projects/vimage/src/sys/dev/usb/usb_core.h#9 integrate .. //depot/projects/vimage/src/sys/dev/usb/usb_device.c#9 integrate .. //depot/projects/vimage/src/sys/dev/usb/usb_device.h#8 integrate .. //depot/projects/vimage/src/sys/dev/usb/usb_generic.c#7 integrate .. //depot/projects/vimage/src/sys/dev/usb/usb_hub.c#9 integrate .. //depot/projects/vimage/src/sys/dev/usb/usb_request.c#7 integrate .. //depot/projects/vimage/src/sys/dev/usb/usb_revision.h#3 integrate .. //depot/projects/vimage/src/sys/dev/usb/usb_transfer.c#7 integrate .. //depot/projects/vimage/src/sys/ia64/isa/isa.c#3 integrate .. //depot/projects/vimage/src/sys/kern/kern_vimage.c#80 integrate .. //depot/projects/vimage/src/sys/kern/tty_pts.c#14 integrate .. //depot/projects/vimage/src/sys/netgraph/netgraph.h#20 integrate .. //depot/projects/vimage/src/sys/netgraph/ng_base.c#55 integrate .. //depot/projects/vimage/src/sys/netgraph/ng_eiface.c#26 integrate .. //depot/projects/vimage/src/sys/netgraph/ng_ether.c#23 integrate .. //depot/projects/vimage/src/sys/netgraph/ng_iface.c#23 integrate .. //depot/projects/vimage/src/sys/netinet/in.c#32 integrate .. //depot/projects/vimage/src/sys/powerpc/aim/machdep.c#11 integrate .. //depot/projects/vimage/src/sys/powerpc/booke/pmap.c#9 integrate .. //depot/projects/vimage/src/sys/powerpc/conf/MPC85XX#5 integrate .. //depot/projects/vimage/src/sys/powerpc/include/intr_machdep.h#7 integrate .. //depot/projects/vimage/src/sys/powerpc/include/pte.h#5 integrate .. //depot/projects/vimage/src/sys/powerpc/mpc85xx/atpic.c#1 branch .. //depot/projects/vimage/src/sys/powerpc/mpc85xx/isa.c#1 branch .. //depot/projects/vimage/src/sys/powerpc/mpc85xx/ocpbus.c#5 integrate .. //depot/projects/vimage/src/sys/powerpc/mpc85xx/pci_ocp.c#2 integrate .. //depot/projects/vimage/src/sys/powerpc/powerpc/autoconf.c#5 integrate .. //depot/projects/vimage/src/sys/powerpc/powerpc/bus_machdep.c#3 integrate .. //depot/projects/vimage/src/sys/powerpc/powerpc/intr_machdep.c#13 integrate .. //depot/projects/vimage/src/sys/sys/vimage.h#88 integrate .. //depot/projects/vimage/src/sys/vm/swap_pager.c#17 integrate .. //depot/projects/vimage/src/sys/vm/vnode_pager.c#13 integrate Differences ... ==== //depot/projects/vimage/src/share/man/man4/pts.4#2 (text+ko) ==== @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)pty.4 8.2 (Berkeley) 11/30/93 -.\" $FreeBSD: src/share/man/man4/pts.4,v 1.2 2008/09/04 16:39:02 ed Exp $ +.\" $FreeBSD: src/share/man/man4/pts.4,v 1.3 2009/04/25 10:05:55 ed Exp $ .\" .Dd August 20, 2008 .Dt PTS 4 @@ -156,6 +156,26 @@ .It Pa /dev/pts/[num] Pseudo-terminal slave devices. .El +.Sh SYSCTL VARIABLES +The following +.Xr sysctl 8 +variables can be used to modify or monitor +.Nm +behavior. +.Bl -tag -width indent +.It Va kern.pts_maxdev +Highest pseudo-terminal unit number to be allocated. +Because +.Xr utmp 5 +is restricted to an 8-byte line name size, +.Nm +will not create any pseudo-terminals with a unit number above 999 by +default. +After increasing +.Dv UT_LINESIZE , +this variable can be changed to allow more than 1000 pseudo-terminals to +be allocated simultaneously. +.El .Sh DIAGNOSTICS None. .Sh SEE ALSO ==== //depot/projects/vimage/src/share/man/man5/rc.conf.5#6 (text+ko) ==== @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/share/man/man5/rc.conf.5,v 1.357 2009/03/13 07:12:25 brooks Exp $ +.\" $FreeBSD: src/share/man/man5/rc.conf.5,v 1.358 2009/04/24 06:44:58 maxim Exp $ .\" .Dd January 27, 2009 .Dt RC.CONF 5 @@ -1503,7 +1503,7 @@ .Xr geli 8 utility when encrypted GEOM providers for swap partitions are created. The default is -.Dq Li "-a aes -l 256 -s 4096 -d" . +.Dq Li "-e aes -l 256 -s 4096 -d" . .It Va root_rw_mount .Pq Vt bool Set to ==== //depot/projects/vimage/src/sys/conf/files.powerpc#21 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.powerpc,v 1.98 2009/04/05 18:40:15 nwhitehorn Exp $ +# $FreeBSD: src/sys/conf/files.powerpc,v 1.99 2009/04/24 03:51:11 marcel Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -103,6 +103,8 @@ powerpc/fpu/fpu_mul.c optional fpu_emu powerpc/fpu/fpu_sqrt.c optional fpu_emu powerpc/fpu/fpu_subr.c optional fpu_emu +powerpc/mpc85xx/atpic.c optional mpc85xx isa +powerpc/mpc85xx/isa.c optional mpc85xx isa powerpc/mpc85xx/lbc.c optional mpc85xx powerpc/mpc85xx/mpc85xx.c optional mpc85xx powerpc/mpc85xx/nexus.c optional mpc85xx ==== //depot/projects/vimage/src/sys/dev/ed/if_ed_pccard.c#11 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ed/if_ed_pccard.c,v 1.154 2009/04/22 16:51:01 imp Exp $ + * $FreeBSD: src/sys/dev/ed/if_ed_pccard.c,v 1.155 2009/04/24 17:28:12 imp Exp $ */ /* @@ -210,8 +210,9 @@ { PCMCIA_CARD(NEXTCOM, NEXTHAWK), 0}, { PCMCIA_CARD(NEWMEDIA, LANSURFER), NE2000DVF_ANYFUNC}, { PCMCIA_CARD(NEWMEDIA, LIVEWIRE), 0}, + { PCMCIA_CARD(OEM2, 100BASE), NE2000DVF_AX88X90}, { PCMCIA_CARD(OEM2, ETHERNET), 0}, - { PCMCIA_CARD(OEM2, FAST_ETHERNET), NE2000DVF_AX88X90 }, + { PCMCIA_CARD(OEM2, FAST_ETHERNET), NE2000DVF_AX88X90}, { PCMCIA_CARD(OEM2, NE2000), 0}, { PCMCIA_CARD(PLANET, SMARTCOM2000), 0 }, { PCMCIA_CARD(PREMAX, PE200), 0}, ==== //depot/projects/vimage/src/sys/dev/pccard/pccarddevs#15 (text+ko) ==== @@ -1,4 +1,4 @@ -$FreeBSD: src/sys/dev/pccard/pccarddevs,v 1.147 2009/04/22 16:50:44 imp Exp $ +$FreeBSD: src/sys/dev/pccard/pccarddevs,v 1.148 2009/04/24 17:27:45 imp Exp $ /* $NetBSD: pcmciadevs,v 1.226 2008/06/19 18:20:33 imp Exp $ */ /* $OpenBSD: pcmciadevs,v 1.93 2002/06/21 08:31:10 henning Exp $ */ @@ -772,6 +772,7 @@ product OEM2 CDROM1 { "PCMCIA", "CD-ROM", NULL, NULL } Generic PCMCIA CD-ROM product OEM2 IDE { "PCMCIA", "IDE&spCARD", NULL, NULL } Generic PCMCIA IDE CARD product OEM2 ETHERNET { "PCMCIA", "Ethernet", NULL, NULL } NE2000 PC Card +product OEM2 100BASE { "PCMCIA", "100BASE", NULL, NULL } NE2000 PC Card product OEM2 FAST_ETHERNET { "PCMCIA", "FAST&spETHERNET&spCARD", NULL, NULL } NE2000 PC Card product OEM2 NE2000 { "NE2000&spCompatible&spPC&spCard", "PCMCIA", NULL, NULL } Generic NE2000 PC Card product PHISON CF_CARD { "PHISON", "CF&spCard", NULL, NULL } Generic CF or SD/MMC/SmartMedia Reader ==== //depot/projects/vimage/src/sys/dev/usb/controller/ehci.c#8 (text+ko) ==== @@ -44,7 +44,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb/controller/ehci.c,v 1.14 2009/04/22 17:08:16 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb/controller/ehci.c,v 1.15 2009/04/25 21:10:06 thompsa Exp $"); #include #include @@ -1964,7 +1964,7 @@ usb2_pc_cpu_flush(qh->page_cache); - if (xfer->xroot->udev->pwr_save.suspended == 0) { + if (xfer->xroot->udev->state != USB_STATE_SUSPENDED) { EHCI_APPEND_QH(qh, *qh_last); } } ==== //depot/projects/vimage/src/sys/dev/usb/controller/ohci.c#7 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb/controller/ohci.c,v 1.11 2009/04/22 17:08:16 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb/controller/ohci.c,v 1.12 2009/04/25 21:10:06 thompsa Exp $"); /* * USB Open Host Controller driver. @@ -1020,7 +1020,7 @@ * writing the BLF and CLF bits: */ - if (xfer->xroot->udev->pwr_save.suspended) { + if (xfer->xroot->udev->state == USB_STATE_SUSPENDED) { /* nothing to do */ } else if (xfer->pipe->methods == &ohci_device_bulk_methods) { ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); @@ -1589,7 +1589,7 @@ ed->ed_headp = td->td_self; - if (xfer->xroot->udev->pwr_save.suspended == 0) { + if (xfer->xroot->udev->state != USB_STATE_SUSPENDED) { /* the append function will flush the endpoint descriptor */ OHCI_APPEND_QH(ed, *ed_last); ==== //depot/projects/vimage/src/sys/dev/usb/controller/uhci.c#7 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb/controller/uhci.c,v 1.10 2009/04/22 17:08:16 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb/controller/uhci.c,v 1.11 2009/04/25 21:10:06 thompsa Exp $"); /* * USB Universal Host Controller driver. @@ -1921,7 +1921,7 @@ qh->e_next = td; qh->qh_e_next = td->td_self; - if (xfer->xroot->udev->pwr_save.suspended == 0) { + if (xfer->xroot->udev->state != USB_STATE_SUSPENDED) { UHCI_APPEND_QH(qh, sc->sc_bulk_p_last); uhci_add_loop(sc); xfer->flags_int.bandwidth_reclaimed = 1; @@ -1982,7 +1982,7 @@ * NOTE: some devices choke on bandwidth- reclamation for control * transfers */ - if (xfer->xroot->udev->pwr_save.suspended == 0) { + if (xfer->xroot->udev->state != USB_STATE_SUSPENDED) { if (xfer->xroot->udev->speed == USB_SPEED_LOW) { UHCI_APPEND_QH(qh, sc->sc_ls_ctl_p_last); } else { @@ -2071,7 +2071,7 @@ qh->e_next = td; qh->qh_e_next = td->td_self; - if (xfer->xroot->udev->pwr_save.suspended == 0) { + if (xfer->xroot->udev->state != USB_STATE_SUSPENDED) { /* enter QHs into the controller data structures */ UHCI_APPEND_QH(qh, sc->sc_intr_p_last[xfer->qh_pos]); ==== //depot/projects/vimage/src/sys/dev/usb/usb_core.h#9 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_core.h,v 1.12 2009/04/22 17:08:16 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_core.h,v 1.14 2009/04/25 21:25:52 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -515,6 +515,7 @@ /* prototypes */ const char *usb2_errstr(usb2_error_t error); +const char *usb2_statestr(enum usb_dev_state state); struct usb2_config_descriptor *usb2_get_config_descriptor( struct usb2_device *udev); struct usb2_device_descriptor *usb2_get_device_descriptor( @@ -552,5 +553,6 @@ uint8_t usb2_get_bus_index(struct usb2_device *udev); uint8_t usb2_get_device_index(struct usb2_device *udev); void usb2_set_power_mode(struct usb2_device *udev, uint8_t power_mode); +int usb2_device_attached(struct usb2_device *udev); #endif /* _USB2_CORE_H_ */ ==== //depot/projects/vimage/src/sys/dev/usb/usb_device.c#9 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_device.c,v 1.27 2009/04/22 17:08:16 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_device.c,v 1.29 2009/04/25 21:25:52 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -90,6 +90,22 @@ SYSCTL_INT(_hw_usb2, OID_AUTO, template, CTLFLAG_RW, &usb2_template, 0, "Selected USB device side template"); +static const char* statestr[USB_STATE_MAX] = { + [USB_STATE_DETACHED] = "DETACHED", + [USB_STATE_ATTACHED] = "ATTACHED", + [USB_STATE_POWERED] = "POWERED", + [USB_STATE_ADDRESSED] = "ADDRESSED", + [USB_STATE_CONFIGURED] = "CONFIGURED", + [USB_STATE_SUSPENDED] = "SUSPENDED" +}; + +const char * +usb2_statestr(enum usb_dev_state state) +{ + KASSERT(state < USB_STATE_MAX, ("invalid udev state")); + + return (statestr[state]); +} /*------------------------------------------------------------------------* * usb2_get_pipe_by_addr @@ -457,6 +473,8 @@ * the current config number and index. */ err = usb2_req_set_config(udev, NULL, USB_UNCONFIG_NO); + if (udev->state == USB_STATE_CONFIGURED) + usb2_set_device_state(udev, USB_STATE_ADDRESSED); goto done; } /* get the full config descriptor */ @@ -524,6 +542,7 @@ udev->power = power; udev->curr_config_no = cdp->bConfigurationValue; udev->curr_config_index = index; + usb2_set_device_state(udev, USB_STATE_CONFIGURED); /* Set the actual configuration value. */ err = usb2_req_set_config(udev, NULL, cdp->bConfigurationValue); @@ -980,7 +999,7 @@ udev->port_no, udev->address); if (device_is_attached(dev)) { - if (udev->flags.suspended) { + if (udev->state == USB_STATE_SUSPENDED) { err = DEVICE_RESUME(dev); if (err) { device_printf(dev, "Resume failed!\n"); @@ -1120,7 +1139,7 @@ uaa->temp_dev = NULL; device_set_ivars(iface->subdev, NULL); - if (udev->flags.suspended) { + if (udev->state == USB_STATE_SUSPENDED) { err = DEVICE_SUSPEND(iface->subdev); if (err) device_printf(iface->subdev, "Suspend failed\n"); @@ -1341,12 +1360,12 @@ USB_BUS_LOCK(udev->bus); /* filter the suspend events */ - if (udev->flags.suspended == do_suspend) { + if ((udev->state == USB_STATE_SUSPENDED && do_suspend) || + (udev->state != USB_STATE_SUSPENDED && !do_suspend)) { USB_BUS_UNLOCK(udev->bus); /* nothing to do */ return (0); } - udev->flags.suspended = do_suspend; USB_BUS_UNLOCK(udev->bus); /* do the suspend or resume */ @@ -1471,6 +1490,7 @@ udev->bus = bus; udev->address = USB_START_ADDR; /* default value */ udev->plugtime = (usb2_ticks_t)ticks; + usb2_set_device_state(udev, USB_STATE_POWERED); /* * We need to force the power mode to "on" because there are plenty * of USB devices out there that do not work very well with @@ -1572,6 +1592,7 @@ goto done; } } + usb2_set_device_state(udev, USB_STATE_ADDRESSED); /* * Get the first 8 bytes of the device descriptor ! @@ -1927,7 +1948,8 @@ DPRINTFN(4, "udev=%p port=%d\n", udev, udev->port_no); - bus = udev->bus;; + bus = udev->bus; + usb2_set_device_state(udev, USB_STATE_DETACHED); #if USB_HAVE_UGEN usb2_notify_addq("-", udev); @@ -2438,3 +2460,20 @@ } return (0); /* not supported */ } + +void +usb2_set_device_state(struct usb2_device *udev, enum usb_dev_state state) +{ + + KASSERT(state < USB_STATE_MAX, ("invalid udev state")); + + DPRINTF("udev %p state %s -> %s\n", udev, + usb2_statestr(udev->state), usb2_statestr(state)); + udev->state = state; +} + +int +usb2_device_attached(struct usb2_device *udev) +{ + return (udev->state > USB_STATE_DETACHED); +} ==== //depot/projects/vimage/src/sys/dev/usb/usb_device.h#8 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_device.h,v 1.14 2009/04/22 17:07:53 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_device.h,v 1.15 2009/04/25 21:10:06 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -85,7 +85,6 @@ struct usb2_device_flags { uint8_t usb2_mode:1; /* USB mode (see USB_MODE_XXX) */ uint8_t self_powered:1; /* set if USB device is self powered */ - uint8_t suspended:1; /* set if USB device is suspended */ uint8_t no_strings:1; /* set if USB device does not support * strings */ uint8_t remote_wakeup:1; /* set if remote wakeup is enabled */ @@ -101,7 +100,6 @@ usb2_size_t type_refs[4]; /* transfer reference count */ usb2_size_t read_refs; /* data read references */ usb2_size_t write_refs; /* data write references */ - uint8_t suspended; /* set if USB device is suspended */ }; /* @@ -139,6 +137,7 @@ #endif usb2_ticks_t plugtime; /* copy of "ticks" */ + enum usb_dev_state state; uint16_t refcount; #define USB_DEV_REF_MAX 0xffff @@ -205,5 +204,7 @@ void usb_linux_free_device(struct usb_device *dev); uint8_t usb2_peer_can_wakeup(struct usb2_device *udev); struct usb2_pipe *usb2_pipe_foreach(struct usb2_device *udev, struct usb2_pipe *pipe); +void usb2_set_device_state(struct usb2_device *udev, + enum usb_dev_state state); #endif /* _USB2_DEVICE_H_ */ ==== //depot/projects/vimage/src/sys/dev/usb/usb_generic.c#7 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_generic.c,v 1.9 2009/04/05 18:20:38 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_generic.c,v 1.10 2009/04/25 21:10:06 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -823,7 +823,7 @@ di->udi_speed = udev->speed; di->udi_mode = udev->flags.usb2_mode; di->udi_power_mode = udev->power_mode; - if (udev->flags.suspended) { + if (udev->state == USB_STATE_SUSPENDED) { di->udi_suspended = 1; } else { di->udi_suspended = 0; ==== //depot/projects/vimage/src/sys/dev/usb/usb_hub.c#9 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_hub.c,v 1.13 2009/04/22 17:07:56 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_hub.c,v 1.14 2009/04/25 21:10:06 thompsa Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. * Copyright (c) 1998 Lennart Augustsson. All rights reserved. @@ -544,7 +544,7 @@ if (udev->depth > USB_HUB_MAX_DEPTH) { return (USB_ERR_TOO_DEEP); } - if (udev->pwr_save.suspended) { + if (udev->state == USB_STATE_SUSPENDED) { /* need to wait until the child signals resume */ DPRINTF("Device is suspended!\n"); return (0); @@ -1518,7 +1518,7 @@ udev->pwr_save.write_refs += val; } - if (udev->pwr_save.suspended) + if (udev->state == USB_STATE_SUSPENDED) needs_explore = (udev->pwr_save.write_refs != 0) || ((udev->pwr_save.read_refs != 0) && @@ -1600,7 +1600,7 @@ (rem_wakeup == 0))) { /* check if we are suspended */ - if (udev->pwr_save.suspended != 0) { + if (udev->state == USB_STATE_SUSPENDED) { USB_BUS_UNLOCK(bus); usb2_dev_resume_peer(udev); USB_BUS_LOCK(bus); @@ -1608,7 +1608,7 @@ } else if (temp >= limit) { /* check if we are not suspended */ - if (udev->pwr_save.suspended == 0) { + if (udev->state != USB_STATE_SUSPENDED) { USB_BUS_UNLOCK(bus); usb2_dev_suspend_peer(udev); USB_BUS_LOCK(bus); @@ -1647,7 +1647,7 @@ if (temp < mintime) mintime = temp; - if (udev->pwr_save.suspended == 0) { + if (udev->state != USB_STATE_SUSPENDED) { type_refs[0] += udev->pwr_save.type_refs[0]; type_refs[1] += udev->pwr_save.type_refs[1]; type_refs[2] += udev->pwr_save.type_refs[2]; @@ -1697,7 +1697,7 @@ return; /* check if already resumed */ - if (udev->pwr_save.suspended == 0) + if (udev->state != USB_STATE_SUSPENDED) return; /* we need a parent HUB to do resume */ @@ -1737,7 +1737,7 @@ } USB_BUS_LOCK(bus); /* set that this device is now resumed */ - udev->pwr_save.suspended = 0; + usb2_set_device_state(udev, USB_STATE_CONFIGURED); #if USB_HAVE_POWERD /* make sure that we don't go into suspend right away */ udev->pwr_save.last_xfer_time = ticks; @@ -1797,7 +1797,7 @@ return; /* check if already suspended */ - if (udev->pwr_save.suspended) + if (udev->state == USB_STATE_SUSPENDED) return; /* we need a parent HUB to do suspend */ @@ -1819,7 +1819,7 @@ if (child == NULL) continue; - if (child->pwr_save.suspended) + if (child->state == USB_STATE_SUSPENDED) continue; DPRINTFN(1, "Port %u is busy on the HUB!\n", x + 1); @@ -1846,7 +1846,7 @@ * Set that this device is suspended. This variable must be set * before calling USB controller suspend callbacks. */ - udev->pwr_save.suspended = 1; + usb2_set_device_state(udev, USB_STATE_SUSPENDED); USB_BUS_UNLOCK(udev->bus); if (udev->bus->methods->device_suspend != NULL) { ==== //depot/projects/vimage/src/sys/dev/usb/usb_request.c#7 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_request.c,v 1.13 2009/04/22 17:08:16 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_request.c,v 1.14 2009/04/25 21:10:06 thompsa Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. * Copyright (c) 1998 Lennart Augustsson. All rights reserved. @@ -271,6 +271,12 @@ req->wIndex[1], req->wIndex[0], req->wLength[1], req->wLength[0]); + /* Check if the device is still alive */ + if (udev->state < USB_STATE_POWERED) { + DPRINTF("usb device has gone\n"); + return (USB_ERR_NOT_CONFIGURED); + } + /* * Set "actlen" to a known value in case the caller does not * check the return value: ==== //depot/projects/vimage/src/sys/dev/usb/usb_revision.h#3 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_revision.h,v 1.1 2009/02/23 18:31:00 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_revision.h,v 1.2 2009/04/25 21:10:06 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -62,4 +62,16 @@ USB_MODE_MAX }; +/* + * The "USB_MODE" macro defines all the supported device states. + */ +enum usb_dev_state { + USB_STATE_DETACHED, + USB_STATE_ATTACHED, + USB_STATE_POWERED, + USB_STATE_ADDRESSED, + USB_STATE_CONFIGURED, + USB_STATE_SUSPENDED, + USB_STATE_MAX, +}; #endif /* _USB2_REVISION_H_ */ ==== //depot/projects/vimage/src/sys/dev/usb/usb_transfer.c#7 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/usb_transfer.c,v 1.12 2009/04/22 17:08:10 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_transfer.c,v 1.13 2009/04/25 21:10:06 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -1365,24 +1365,37 @@ void usb2_start_hardware(struct usb2_xfer *xfer) { + struct usb2_xfer_root *info; + struct usb2_bus *bus; usb2_frcount_t x; + info = xfer->xroot; + bus = info->bus; + DPRINTF("xfer=%p, pipe=%p, nframes=%d, dir=%s\n", xfer, xfer->pipe, xfer->nframes, USB_GET_DATA_ISREAD(xfer) ? "read" : "write"); + /* Check if the device is still alive */ + if (info->udev->state < USB_STATE_POWERED) { + USB_BUS_LOCK(bus); + usb2_transfer_done(xfer, USB_ERR_NOT_CONFIGURED); + USB_BUS_UNLOCK(bus); + return; + } + #if USB_DEBUG if (USB_DEBUG_VAR > 0) { - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); usb2_dump_pipe(xfer->pipe); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); } #endif USB_XFER_LOCK_ASSERT(xfer, MA_OWNED); - USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_NOTOWNED); + USB_BUS_LOCK_ASSERT(bus, MA_NOTOWNED); /* Only open the USB transfer once! */ if (!xfer->flags_int.open) { @@ -1390,9 +1403,9 @@ DPRINTF("open\n"); - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); (xfer->pipe->methods->open) (xfer); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); } /* set "transferring" flag */ xfer->flags_int.transferring = 1; @@ -1406,9 +1419,9 @@ * frequently the "done_q": */ if (xfer->wait_queue) { - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); usb2_transfer_dequeue(xfer); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); } /* clear "did_dma_delay" flag */ xfer->flags_int.did_dma_delay = 0; @@ -1441,16 +1454,16 @@ */ DPRINTF("xfer=%p nframes=0: stall " "or clear stall!\n", xfer); - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); xfer->flags_int.can_cancel_immed = 1; /* start the transfer */ usb2_command_wrapper(&xfer->pipe->pipe_q, xfer); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); return; } - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); usb2_transfer_done(xfer, USB_ERR_INVAL); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); return; } /* compute total transfer length */ @@ -1459,9 +1472,9 @@ xfer->sumlen += xfer->frlengths[x]; if (xfer->sumlen < xfer->frlengths[x]) { /* length wrapped around */ - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); usb2_transfer_done(xfer, USB_ERR_INVAL); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); return; } } @@ -1476,9 +1489,9 @@ if (xfer->flags_int.control_xfr) { if (usb2_start_hardware_sub(xfer)) { - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(bus); usb2_transfer_done(xfer, USB_ERR_STALLED); - USB_BUS_UNLOCK(xfer->xroot->bus); + USB_BUS_UNLOCK(bus); return; } } ==== //depot/projects/vimage/src/sys/ia64/isa/isa.c#3 (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/ia64/isa/isa.c,v 1.4 2007/02/24 16:56:22 piso Exp $ + * $FreeBSD: src/sys/ia64/isa/isa.c,v 1.5 2009/04/24 03:43:20 marcel Exp $ */ /* @@ -73,17 +73,6 @@ { } -intrmask_t -isa_irq_pending(void) -{ - u_char irr1; - u_char irr2; - - irr1 = inb(IO_ICU1); - irr2 = inb(IO_ICU2); - return ((irr2 << 8) | irr1); -} - /* * This implementation simply passes the request up to the parent * bus, which in our case is the special i386 nexus, substituting any ==== //depot/projects/vimage/src/sys/kern/kern_vimage.c#80 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_vimage.c,v 1.2 2009/04/11 05:58:58 zec Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_vimage.c,v 1.3 2009/04/26 07:09:39 zec Exp $"); #include "opt_ddb.h" @@ -221,6 +221,7 @@ void vnet_mod_deregister(const struct vnet_modinfo *vmi) { + vnet_mod_deregister_multi(vmi, NULL, NULL); } @@ -258,8 +259,10 @@ if (vml->vml_iarg) printf("/%s", vml->vml_iname); printf(": "); +#ifdef VIMAGE if (vmi->vmi_size) printf("malloc(%zu); ", vmi->vmi_size); +#endif if (vmi->vmi_iattach != NULL) printf("iattach()"); printf("\n"); ==== //depot/projects/vimage/src/sys/kern/tty_pts.c#14 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/tty_pts.c,v 1.30 2009/03/01 09:50:13 ed Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/tty_pts.c,v 1.31 2009/04/25 10:05:55 ed Exp $"); #include "opt_tty.h" @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -58,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -66,8 +68,16 @@ #include +/* + * Our utmp(5) format is limited to 8-byte TTY line names. This means + * we can at most allocate 1000 pseudo-terminals ("pts/999"). Allow + * users to increase this number, assuming they have manually increased + * UT_LINESIZE. + */ static struct unrhdr *pts_pool; -#define MAXPTSDEVS 999 +static unsigned int pts_maxdev = 999; +SYSCTL_UINT(_kern, OID_AUTO, pts_maxdev, CTLFLAG_RW, &pts_maxdev, 0, + "Maximum amount of pts(4) pseudo-terminals"); static MALLOC_DEFINE(M_PTS, "pts", "pseudo tty device"); @@ -716,6 +726,11 @@ chgptscnt(uid, -1, 0); return (EAGAIN); } + if (unit > pts_maxdev) { + free_unr(pts_pool, unit); + chgptscnt(uid, -1, 0); + return (EAGAIN); + } /* Allocate TTY and softc. */ psc = malloc(sizeof(struct pts_softc), M_PTS, M_WAITOK|M_ZERO); @@ -829,7 +844,7 @@ pts_init(void *unused) { - pts_pool = new_unrhdr(0, MAXPTSDEVS, NULL); + pts_pool = new_unrhdr(0, INT_MAX, NULL); #if defined(PTS_COMPAT) || defined(PTS_LINUX) make_dev(&ptmx_cdevsw, 0, UID_ROOT, GID_WHEEL, 0666, "ptmx"); #endif /* PTS_COMPAT || PTS_LINUX */ ==== //depot/projects/vimage/src/sys/netgraph/netgraph.h#20 (text+ko) ==== @@ -37,7 +37,7 @@ * * Author: Julian Elischer * - * $FreeBSD: src/sys/netgraph/netgraph.h,v 1.80 2008/12/13 22:26:24 mav Exp $ + * $FreeBSD: src/sys/netgraph/netgraph.h,v 1.81 2009/04/26 07:14:50 zec Exp $ * $Whistle: netgraph.h,v 1.29 1999/11/01 07:56:13 julian Exp $ */ ==== //depot/projects/vimage/src/sys/netgraph/ng_base.c#55 (text+ko) ==== @@ -38,7 +38,7 @@ * Authors: Julian Elischer * Archie Cobbs * - * $FreeBSD: src/sys/netgraph/ng_base.c,v 1.171 2008/12/14 20:15:30 mav Exp $ + * $FreeBSD: src/sys/netgraph/ng_base.c,v 1.172 2009/04/26 07:14:50 zec Exp $ * $Whistle: ng_base.c,v 1.39 1999/01/28 23:54:53 julian Exp $ */ @@ -84,6 +84,8 @@ /* Mutex to protect topology events. */ static struct mtx ng_topo_mtx; +static vnet_attach_fn vnet_netgraph_iattach; + #ifdef NETGRAPH_DEBUG static struct mtx ng_nodelist_mtx; /* protects global node/hook lists */ static struct mtx ngq_mtx; /* protects the queue item list */ @@ -3088,6 +3090,27 @@ return (error); } +#ifndef VIMAGE_GLOBALS +static const vnet_modinfo_t vnet_netgraph_modinfo = { + .vmi_id = VNET_MOD_NETGRAPH, + .vmi_name = "netgraph", +#ifdef VIMAGE + .vmi_size = sizeof(struct vnet_netgraph), +#endif + .vmi_iattach = vnet_netgraph_iattach +}; +#endif + +static int +vnet_netgraph_iattach(const void *arg __unused) +{ + INIT_VNET_NETGRAPH(curvnet); + + V_nextID = 1; + + return (0); +} + /* * Handle loading and unloading for this code. * The only thing we need to link into is the NETISR strucure. @@ -3106,7 +3129,7 @@ vnet_mod_register(&vnet_netgraph_modinfo); #else vnet_netgraph_iattach(NULL); -#endif /* !VIMAGE */ +#endif NG_WORKLIST_LOCK_INIT(); mtx_init(&ng_typelist_mtx, "netgraph types mutex", NULL, MTX_DEF); ==== //depot/projects/vimage/src/sys/netgraph/ng_eiface.c#26 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/netgraph/ng_eiface.c,v 1.46 2009/04/19 22:04:29 rwatson Exp $ + * $FreeBSD: src/sys/netgraph/ng_eiface.c,v 1.47 2009/04/26 07:14:50 zec Exp $ */ #include @@ -126,7 +126,7 @@ .vmi_name = "ng_eiface", .vmi_dependson = VNET_MOD_NETGRAPH, .vmi_iattach = ng_eiface_iattach, - .vmi_idetach = ng_eiface_idetach, + .vmi_idetach = ng_eiface_idetach }; #endif @@ -641,7 +641,7 @@ V_ng_eiface_unit = new_unrhdr(0, 0xffff, NULL); - return 0; + return (0); } static int ng_eiface_idetach(const void *unused) @@ -661,5 +661,5 @@ delete_unrhdr(V_ng_eiface_unit); - return 0; + return (0); } ==== //depot/projects/vimage/src/sys/netgraph/ng_ether.c#23 (text+ko) ==== @@ -39,7 +39,7 @@ * Authors: Archie Cobbs * Julian Elischer * - * $FreeBSD: src/sys/netgraph/ng_ether.c,v 1.67 2009/02/27 14:12:05 bz Exp $ + * $FreeBSD: src/sys/netgraph/ng_ether.c,v 1.68 2009/04/26 07:14:50 zec Exp $ */ /* @@ -301,8 +301,9 @@ /* * Do not create / attach an ether node to this ifnet if * a netgraph node with the same name already exists. - * This should prevent ether nodes to be attached to - * eiface nodes in the same vnet, which is pointless. + * This should prevent ether nodes to become attached to + * eiface nodes, which may be problematic due to naming + * clashes. */ if ((node = ng_name2noderef(NULL, ifp->if_xname)) != NULL) { NG_NODE_UNREF(node); @@ -798,7 +799,7 @@ * is MOD_UNLOAD, so there's no need to detach any nodes. */ >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Sun Apr 26 08:03:44 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4C7111065678; Sun, 26 Apr 2009 08:03:44 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 048FA1065676 for ; Sun, 26 Apr 2009 08:03:44 +0000 (UTC) (envelope-from fangwang@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id CCECF8FC0C for ; Sun, 26 Apr 2009 08:03:43 +0000 (UTC) (envelope-from fangwang@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3Q83hGn034411 for ; Sun, 26 Apr 2009 08:03:43 GMT (envelope-from fangwang@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3Q83hIj034409 for perforce@freebsd.org; Sun, 26 Apr 2009 08:03:43 GMT (envelope-from fangwang@FreeBSD.org) Date: Sun, 26 Apr 2009 08:03:43 GMT Message-Id: <200904260803.n3Q83hIj034409@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to fangwang@FreeBSD.org using -f From: Fang Wang To: Perforce Change Reviews Cc: Subject: PERFORCE change 161099 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 08:03:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=161099 Change 161099 by fangwang@tcputo_perforce on 2009/04/26 08:03:18 Submit Milestones, First submit Affected files ... .. //depot/projects/soc2009/tcputo/Milestones#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Sun Apr 26 09:05:47 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 13BEA106566C; Sun, 26 Apr 2009 09:05:47 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7B9E106564A for ; Sun, 26 Apr 2009 09:05:46 +0000 (UTC) (envelope-from bz@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id B5DDD8FC1C for ; Sun, 26 Apr 2009 09:05:46 +0000 (UTC) (envelope-from bz@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3Q95kxj062546 for ; Sun, 26 Apr 2009 09:05:46 GMT (envelope-from bz@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3Q95kQ0062544 for perforce@freebsd.org; Sun, 26 Apr 2009 09:05:46 GMT (envelope-from bz@freebsd.org) Date: Sun, 26 Apr 2009 09:05:46 GMT Message-Id: <200904260905.n3Q95kQ0062544@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bz@freebsd.org using -f From: "Bjoern A. Zeeb" To: Perforce Change Reviews Cc: Subject: PERFORCE change 161101 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 09:05:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=161101 Change 161101 by bz@bz_dumpster on 2009/04/26 09:05:10 Make compile again. Affected files ... .. //depot/projects/s390/sys/s390/include/elf.h#3 edit .. //depot/projects/s390/sys/s390/include/pmap.h#6 edit .. //depot/projects/s390/sys/s390x/include/elf.h#2 edit .. //depot/projects/s390/sys/sys/vimage.h#4 edit Differences ... ==== //depot/projects/s390/sys/s390/include/elf.h#3 (text+ko) ==== @@ -72,8 +72,9 @@ #define AT_EUID 12 /* Effective uid. */ #define AT_GID 13 /* Real gid. */ #define AT_EGID 14 /* Effective gid. */ +#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_COUNT 15 /* Count of defined aux entry types. */ +#define AT_COUNT 16 /* Count of defined aux entry types. */ /* Relocation types. */ #define R_390_NONE 0 ==== //depot/projects/s390/sys/s390/include/pmap.h#6 (text+ko) ==== @@ -91,6 +91,9 @@ #define PMAP_MTX(pmap) (&(pmap)->pm_mtx) #define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx) #define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) + +extern struct pmap kernel_pmap_store; +#define kernel_pmap (&kernel_pmap_store) #endif /* ==== //depot/projects/s390/sys/s390x/include/elf.h#2 (text+ko) ==== @@ -72,8 +72,9 @@ #define AT_EUID 12 /* Effective uid. */ #define AT_GID 13 /* Real gid. */ #define AT_EGID 14 /* Effective gid. */ +#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_COUNT 15 /* Count of defined aux entry types. */ +#define AT_COUNT 16 /* Count of defined aux entry types. */ /* Relocation types. */ #define R_390_NONE 0 ==== //depot/projects/s390/sys/sys/vimage.h#4 (text+ko) ==== @@ -211,6 +211,21 @@ #define SIZEOF_vnet_inet6 8536 #define SIZEOF_vnet_ipsec 31048 #endif +#ifdef __s390__ +#ifdef __s390x__ +#define SIZEOF_vnet_net 0 +#define SIZEOF_vnet_net_LINT 0 +#define SIZEOF_vnet_inet 0 +#define SIZEOF_vnet_inet6 0 +#define SIZEOF_vnet_ipsec 0 +#else +#define SIZEOF_vnet_net 0 +#define SIZEOF_vnet_net_LINT 0 +#define SIZEOF_vnet_inet 0 +#define SIZEOF_vnet_inet6 0 +#define SIZEOF_vnet_ipsec 0 +#endif +#endif #ifdef __sparc64__ /* incl. sun4v */ #define SIZEOF_vnet_net 464 #define SIZEOF_vnet_net_LINT 5144 From owner-p4-projects@FreeBSD.ORG Sun Apr 26 09:11:54 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D6A531065674; Sun, 26 Apr 2009 09:11:53 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 982B3106564A for ; Sun, 26 Apr 2009 09:11:53 +0000 (UTC) (envelope-from syl@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6C8348FC12 for ; Sun, 26 Apr 2009 09:11:53 +0000 (UTC) (envelope-from syl@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3Q9Br3F063429 for ; Sun, 26 Apr 2009 09:11:53 GMT (envelope-from syl@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3Q9BrG3063427 for perforce@freebsd.org; Sun, 26 Apr 2009 09:11:53 GMT (envelope-from syl@FreeBSD.org) Date: Sun, 26 Apr 2009 09:11:53 GMT Message-Id: <200904260911.n3Q9BrG3063427@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to syl@FreeBSD.org using -f From: Sylvestre Gallon To: Perforce Change Reviews Cc: Subject: PERFORCE change 161102 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 09:11:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=161102 Change 161102 by syl@syl_atuin on 2009/04/26 09:11:44 Submit milestones Affected files ... .. //depot/projects/soc2009/syl_usb/Milestones#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Sun Apr 26 09:32:14 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9D4EE1065744; Sun, 26 Apr 2009 09:32:14 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D9B01065740 for ; Sun, 26 Apr 2009 09:32:14 +0000 (UTC) (envelope-from anchie@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 4B7D38FC08 for ; Sun, 26 Apr 2009 09:32:14 +0000 (UTC) (envelope-from anchie@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3Q9WETD068631 for ; Sun, 26 Apr 2009 09:32:14 GMT (envelope-from anchie@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3Q9WEIR068629 for perforce@freebsd.org; Sun, 26 Apr 2009 09:32:14 GMT (envelope-from anchie@FreeBSD.org) Date: Sun, 26 Apr 2009 09:32:14 GMT Message-Id: <200904260932.n3Q9WEIR068629@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to anchie@FreeBSD.org using -f From: Ana Kukec To: Perforce Change Reviews Cc: Subject: PERFORCE change 161104 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 09:32:15 -0000 http://perforce.freebsd.org/chv.cgi?CH=161104 Change 161104 by anchie@anchie_malimis on 2009/04/26 09:31:45 Minor corrections. Added GSoC dates. Affected files ... .. //depot/projects/soc2009/anchie_send/Milestones#2 edit Differences ... ==== //depot/projects/soc2009/anchie_send/Milestones#2 (text+ko) ==== @@ -1,17 +1,24 @@ +20.4 - GSoC: Student proposal accepted. + now - 29.4. All the initial paper work done. -30.4 - 06.4. Testing DoCoMo's send-0.2 (sendd, cgatool, ipexttool). +30.4 - 06.5. Testing DoCoMo's send-0.2 (sendd, cgatool, ipexttool). 07.5 - 14.5. Investigating the NDP code. -15.5 - 21.5. Understanding where to code the kernel-userspace hooks into the NDP code, which parts of the code should be places in the kernel/userspace. +15.5 - 23.5. Understanding where to code the kernel-userspace hooks into the NDP code, which parts of the code should be places in the kernel/userspace. + +23.5 - GSoC: Students begin coding for their GSoCprojects. -22.5 - 25.5. Documenting all the previous work/conclusions about the NDP/SeND IPv6 stack. +23.5 - 25.5. Documenting all the previous work/conclusions about the NDP/SeND IPv6 stack. 26.5 - 26.6. Implementation: kernel-userspace hooks in the NDP code, new NDP options (SeND-specific options), certificate processing (Authorization Delegation Discovery Process). 27.6 - 05.7. Testing: kernel-userspace hooks and crypto processing (NDP options and ADD process). +06.7 - GSoC: Mentors and students can begin submitting mid-term evaluations. +13.7 - GSoC: Mid-term evaluations deadline. + 06.7 - 15.7. Implementation: CGAs and RFC3779, testing ? 16.7 - 25.7. Implementation of current SeND IETF drafts (IETF CSI WG) @@ -20,3 +27,4 @@ 01.8 - 10.8. Testing, Interoperability testing (send-0.2, chinese guys from IETF CSI WG with linux implementation, ..) +10.8 - Suggested "pencils down" date. From owner-p4-projects@FreeBSD.ORG Sun Apr 26 09:51:35 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6D1A41065674; Sun, 26 Apr 2009 09:51:35 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C033106567C for ; Sun, 26 Apr 2009 09:51:35 +0000 (UTC) (envelope-from syl@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1A4F18FC0A for ; Sun, 26 Apr 2009 09:51:35 +0000 (UTC) (envelope-from syl@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3Q9pYcA076824 for ; Sun, 26 Apr 2009 09:51:34 GMT (envelope-from syl@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3Q9pY0F076822 for perforce@freebsd.org; Sun, 26 Apr 2009 09:51:34 GMT (envelope-from syl@FreeBSD.org) Date: Sun, 26 Apr 2009 09:51:34 GMT Message-Id: <200904260951.n3Q9pY0F076822@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to syl@FreeBSD.org using -f From: Sylvestre Gallon To: Perforce Change Reviews Cc: Subject: PERFORCE change 161105 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 09:51:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=161105 Change 161105 by syl@syl_atuin on 2009/04/26 09:50:42 Add my milestones. Affected files ... .. //depot/projects/soc2009/syl_usb/Milestones#2 edit Differences ... ==== //depot/projects/soc2009/syl_usb/Milestones#2 (text+ko) ==== @@ -1,0 +1,19 @@ +Milestones : + +May 23 - June 15 : Finishing the port of at91sam9261ek board to FreeBSD. + +June 16 - June 30 : Adding support for the libusb v1.0 API through the + already existing /usr/src/lib/libusb. + +July 1 - July 20 : Improving the USB Function subsystem. + +July 20 - August 10 : Writing some USB Function Class driver (like cdc ACM). + +August 10 - soc end : Writing man pages in section 9 about USB Function framework + and in section 4 for Atmel board and new class function driver. + +Idea if I have the time : + +- Create dummy loopback HCD+DCD. +- Device mode support for HUC Class. +- Device mode support for CDC ACM Class (Serial). From owner-p4-projects@FreeBSD.ORG Sun Apr 26 12:08:55 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9258A1065674; Sun, 26 Apr 2009 12:08:55 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52233106566C for ; Sun, 26 Apr 2009 12:08:55 +0000 (UTC) (envelope-from pvaibhav@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 25DD08FC0A for ; Sun, 26 Apr 2009 12:08:55 +0000 (UTC) (envelope-from pvaibhav@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3QC8tiT016317 for ; Sun, 26 Apr 2009 12:08:55 GMT (envelope-from pvaibhav@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3QC8txL016315 for perforce@freebsd.org; Sun, 26 Apr 2009 12:08:55 GMT (envelope-from pvaibhav@FreeBSD.org) Date: Sun, 26 Apr 2009 12:08:55 GMT Message-Id: <200904261208.n3QC8txL016315@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to pvaibhav@FreeBSD.org using -f From: Prashant Vaibhav To: Perforce Change Reviews Cc: Subject: PERFORCE change 161108 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 12:08:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=161108 Change 161108 by pvaibhav@matrix on 2009/04/26 12:08:09 Adding initial weekly plan for project Affected files ... .. //depot/projects/soc2009/calloutapi/Milestones#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Sun Apr 26 13:58:47 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id ED9CF1065678; Sun, 26 Apr 2009 13:58:46 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE33A1065676 for ; Sun, 26 Apr 2009 13:58:46 +0000 (UTC) (envelope-from fangwang@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 9C5398FC15 for ; Sun, 26 Apr 2009 13:58:46 +0000 (UTC) (envelope-from fangwang@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3QDwkQY062911 for ; Sun, 26 Apr 2009 13:58:46 GMT (envelope-from fangwang@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3QDwkAu062909 for perforce@freebsd.org; Sun, 26 Apr 2009 13:58:46 GMT (envelope-from fangwang@FreeBSD.org) Date: Sun, 26 Apr 2009 13:58:46 GMT Message-Id: <200904261358.n3QDwkAu062909@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to fangwang@FreeBSD.org using -f From: Fang Wang To: Perforce Change Reviews Cc: Subject: PERFORCE change 161110 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 13:58:47 -0000 http://perforce.freebsd.org/chv.cgi?CH=161110 Change 161110 by fangwang@tcputo_perforce on 2009/04/26 13:58:36 Fix stupid mistake Affected files ... .. //depot/projects/soc2009/tcputo/Milestones#2 edit Differences ... ==== //depot/projects/soc2009/tcputo/Milestones#2 (text+ko) ==== @@ -3,9 +3,10 @@ RFCs. Get familiar with kernel building and installing, kernel configuring, kernel debug method and tools, programming tools, regression and performance resting concept and method, kernel architecture in FreeBSD. And relative - respects like process(UTO is process independent option) and so on. - For some important respects mentioned above, I may write some articles on my - blog or on the wiki page about what I have learned. + respects like process(UTO is an connection dependent option, so it can be + process dependent in a way) and so on. For some important respects mentioned + above, I may write some articles on my blog or on the wiki page about what I + have learned. 2. May 25 - June 5: Read the source code of the TCP stack, especially "tcp_usrreq.c", "tcp_subr.c", "tcp_timer.c", "tcp_output.c" and "tcp_input.c". From owner-p4-projects@FreeBSD.ORG Sun Apr 26 14:49:39 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 412141065675; Sun, 26 Apr 2009 14:49:39 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC7C01065670 for ; Sun, 26 Apr 2009 14:49:38 +0000 (UTC) (envelope-from sathya@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C0E548FC0A for ; Sun, 26 Apr 2009 14:49:38 +0000 (UTC) (envelope-from sathya@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3QEncoB081705 for ; Sun, 26 Apr 2009 14:49:38 GMT (envelope-from sathya@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3QEncv5081703 for perforce@freebsd.org; Sun, 26 Apr 2009 14:49:38 GMT (envelope-from sathya@FreeBSD.org) Date: Sun, 26 Apr 2009 14:49:38 GMT Message-Id: <200904261449.n3QEncv5081703@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sathya@FreeBSD.org using -f From: Satish Srinivasan To: Perforce Change Reviews Cc: Subject: PERFORCE change 161112 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 14:49:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=161112 Change 161112 by sathya@sathya-fbsd on 2009/04/26 14:49:15 Just checking this out! Affected files ... .. //depot/projects/soc2009/trailconv/Milestones#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Sun Apr 26 17:02:54 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A3E3910656E6; Sun, 26 Apr 2009 17:02:54 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6270110656E3 for ; Sun, 26 Apr 2009 17:02:54 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 51C588FC12 for ; Sun, 26 Apr 2009 17:02:54 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3QH2sj1035430 for ; Sun, 26 Apr 2009 17:02:54 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3QH2sFb035428 for perforce@freebsd.org; Sun, 26 Apr 2009 17:02:54 GMT (envelope-from zec@fer.hr) Date: Sun, 26 Apr 2009 17:02:54 GMT Message-Id: <200904261702.n3QH2sFb035428@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 161114 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 17:02:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=161114 Change 161114 by zec@zec_tpx32 on 2009/04/26 17:02:34 s/bellow/below/ Submitted by: Peter Cornelius Affected files ... .. //depot/projects/vimage/src/usr.sbin/vimage/vimage.8#2 edit Differences ... ==== //depot/projects/vimage/src/usr.sbin/vimage/vimage.8#2 (text+ko) ==== @@ -113,7 +113,7 @@ virtual image will be reassigned to the virtual image's parent. .It Fl l List the properties, custom parameters and statistics for virtual -images bellow the current one in the hierarchy. If an optional argument +images below the current one in the hierarchy. If an optional argument .Ar vi_name is provided, only the information regarding the target virtual image .Ar vi_name @@ -142,7 +142,7 @@ The parameter is specified as percentage in range between 0 and 90. The guaranteed CPU share for the .So default -.Sc virtual image cannot be set bellow 10%. +.Sc virtual image cannot be set below 10%. Note that the system does not enforce strict global budgeting on guaranteed CPU time shares. Therefore it is in the sole responsibility of the system administrator whether he/she will allow for guaranteed CPU shares to be @@ -160,7 +160,7 @@ .It Cm cpuweight If the current average CPU usage of a virtual image is above the .Cm cpumin -level, but bellow the +level, but below the .Cm cpumax, the virtual image becomes subject to a proportional share CPU scheduler. The From owner-p4-projects@FreeBSD.ORG Sun Apr 26 17:36:34 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 629801065672; Sun, 26 Apr 2009 17:36:34 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2259E106564A for ; Sun, 26 Apr 2009 17:36:34 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 118BE8FC1E for ; Sun, 26 Apr 2009 17:36:34 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3QHaXQQ055046 for ; Sun, 26 Apr 2009 17:36:33 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3QHaXBY055044 for perforce@freebsd.org; Sun, 26 Apr 2009 17:36:33 GMT (envelope-from zec@fer.hr) Date: Sun, 26 Apr 2009 17:36:33 GMT Message-Id: <200904261736.n3QHaXBY055044@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 161116 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 17:36:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=161116 Change 161116 by zec@zec_amdx2 on 2009/04/26 17:36:10 Access from userland to igmpstat is provided via a sysctl (which is already V_irtualized). Hence, there's no need for kmem / kldsym kludges, so vnet_igmp_symmap can go away. If not, it should be added to vnet_inet_symmap, because struct vnet_igmp doesn't exist anyway. XXX why was igi_head ever put in vnet_iugmp_symmap? Affected files ... .. //depot/projects/vimage-commit/src/sys/netinet/igmp.c#15 edit Differences ... ==== //depot/projects/vimage-commit/src/sys/netinet/igmp.c#15 (text+ko) ==== @@ -3620,19 +3620,6 @@ return (0); } -/* - * XXX Are igi_head and igmpstat really accessed via kmem / kldsym? - * If so, given that they are members of struct vnet_inet, they should - * be registered with VNET_MOD_INET, not here. Revisit!!! - */ -#if 0 -static struct vnet_symmap vnet_igmp_symmap[] = { - VNET_SYMMAP(igmp, igi_head), - VNET_SYMMAP(igmp, igmpstat), - VNET_SYMMAP_END -}; -#endif - #ifndef VIMAGE_GLOBALS static vnet_modinfo_t vnet_igmp_modinfo = { .vmi_id = VNET_MOD_IGMP, From owner-p4-projects@FreeBSD.ORG Sun Apr 26 17:44:43 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BDEF8106566B; Sun, 26 Apr 2009 17:44:42 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 799DB106567B for ; Sun, 26 Apr 2009 17:44:42 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 68EA08FC19 for ; Sun, 26 Apr 2009 17:44:42 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3QHigw4059589 for ; Sun, 26 Apr 2009 17:44:42 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3QHigqk059586 for perforce@freebsd.org; Sun, 26 Apr 2009 17:44:42 GMT (envelope-from zec@fer.hr) Date: Sun, 26 Apr 2009 17:44:42 GMT Message-Id: <200904261744.n3QHigqk059586@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 161117 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 17:44:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=161117 Change 161117 by zec@zec_amdx2 on 2009/04/26 17:44:07 Remove a few XXX revisit notes, after comparing code with vimage branch. Affected files ... .. //depot/projects/vimage-commit/src/sys/netinet/in_rmx.c#12 edit .. //depot/projects/vimage-commit/src/sys/netinet6/in6_rmx.c#13 edit Differences ... ==== //depot/projects/vimage-commit/src/sys/netinet/in_rmx.c#12 (text+ko) ==== @@ -250,8 +250,8 @@ static void in_rtqtimo(void *rock) { - INIT_VNET_NET(curvnet); /* XXX revisit!!! */ - INIT_VNET_INET(curvnet); /* XXX revisit!!! */ + INIT_VNET_NET(curvnet); + INIT_VNET_INET(curvnet); int fibnum; void *newrock; struct timeval atv; ==== //depot/projects/vimage-commit/src/sys/netinet6/in6_rmx.c#13 (text+ko) ==== @@ -288,8 +288,8 @@ static void in6_rtqtimo(void *rock) { - CURVNET_SET_QUIET((struct vnet *) rock); /* XXX revisit ! */ - INIT_VNET_INET6(curvnet); /* XXX revisit ! */ + CURVNET_SET_QUIET((struct vnet *) rock); + INIT_VNET_INET6(curvnet); struct radix_node_head *rnh = rock; struct rtqk_arg arg; struct timeval atv; @@ -375,8 +375,8 @@ static void in6_mtutimo(void *rock) { - CURVNET_SET_QUIET((struct vnet *) rock); /* XXX revisit! */ - INIT_VNET_INET6(curvnet); /* XXX revisit! */ + CURVNET_SET_QUIET((struct vnet *) rock); + INIT_VNET_INET6(curvnet); struct radix_node_head *rnh = rock; struct mtuex_arg arg; struct timeval atv; From owner-p4-projects@FreeBSD.ORG Sun Apr 26 18:12:11 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5160210656DC; Sun, 26 Apr 2009 18:12:11 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08C4210656CB for ; Sun, 26 Apr 2009 18:12:11 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id EB0308FC0C for ; Sun, 26 Apr 2009 18:12:10 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3QICAGe076008 for ; Sun, 26 Apr 2009 18:12:10 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3QICAr9076006 for perforce@freebsd.org; Sun, 26 Apr 2009 18:12:10 GMT (envelope-from zec@fer.hr) Date: Sun, 26 Apr 2009 18:12:10 GMT Message-Id: <200904261812.n3QICAr9076006@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 161120 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 18:12:12 -0000 http://perforce.freebsd.org/chv.cgi?CH=161120 Change 161120 by zec@zec_amdx2 on 2009/04/26 18:12:08 Attempt at integ vimage-commit -> vimage-commit2 Affected files ... .. //depot/projects/vimage-commit2/src/sys/compat/linux/linux_socket.c#13 integrate .. //depot/projects/vimage-commit2/src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c#18 integrate .. //depot/projects/vimage-commit2/src/sys/net/route.c#35 integrate .. //depot/projects/vimage-commit2/src/sys/net/rtsock.c#23 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/igmp.c#26 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/in.c#24 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/in_mcast.c#21 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/in_rmx.c#26 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/ip_divert.c#27 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/ip_fw2.c#40 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/ip_mroute.c#14 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/tcp_subr.c#48 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/tcp_timewait.c#24 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/udp_usrreq.c#35 integrate .. //depot/projects/vimage-commit2/src/sys/netinet6/in6_rmx.c#28 integrate .. //depot/projects/vimage-commit2/src/sys/netinet6/nd6_rtr.c#25 integrate Differences ... ==== //depot/projects/vimage-commit2/src/sys/compat/linux/linux_socket.c#13 (text+ko) ==== ==== //depot/projects/vimage-commit2/src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c#18 (text+ko) ==== ==== //depot/projects/vimage-commit2/src/sys/net/route.c#35 (text+ko) ==== ==== //depot/projects/vimage-commit2/src/sys/net/rtsock.c#23 (text+ko) ==== ==== //depot/projects/vimage-commit2/src/sys/netinet/igmp.c#26 (text+ko) ==== @@ -3626,10 +3626,6 @@ * be registered with VNET_MOD_INET, not here. Revisit!!! */ #if 0 -static struct vnet_symmap vnet_igmp_symmap[] = { - VNET_SYMMAP(igmp, igi_head), - VNET_SYMMAP(igmp, igmpstat), - VNET_SYMMAP_END }; #endif ==== //depot/projects/vimage-commit2/src/sys/netinet/in.c#24 (text+ko) ==== ==== //depot/projects/vimage-commit2/src/sys/netinet/in_mcast.c#21 (text+ko) ==== ==== //depot/projects/vimage-commit2/src/sys/netinet/in_rmx.c#26 (text+ko) ==== @@ -250,8 +250,8 @@ static void in_rtqtimo(void *rock) { - INIT_VNET_NET(curvnet); /* XXX revisit!!! */ - INIT_VNET_INET(curvnet); /* XXX revisit!!! */ + INIT_VNET_NET(curvnet); + INIT_VNET_INET(curvnet); int fibnum; void *newrock; struct timeval atv; ==== //depot/projects/vimage-commit2/src/sys/netinet/ip_divert.c#27 (text+ko) ==== ==== //depot/projects/vimage-commit2/src/sys/netinet/ip_fw2.c#40 (text+ko) ==== ==== //depot/projects/vimage-commit2/src/sys/netinet/ip_mroute.c#14 (text+ko) ==== ==== //depot/projects/vimage-commit2/src/sys/netinet/tcp_subr.c#48 (text+ko) ==== ==== //depot/projects/vimage-commit2/src/sys/netinet/tcp_timewait.c#24 (text+ko) ==== ==== //depot/projects/vimage-commit2/src/sys/netinet/udp_usrreq.c#35 (text+ko) ==== ==== //depot/projects/vimage-commit2/src/sys/netinet6/in6_rmx.c#28 (text+ko) ==== @@ -288,8 +288,8 @@ static void in6_rtqtimo(void *rock) { - CURVNET_SET_QUIET((struct vnet *) rock); /* XXX revisit ! */ - INIT_VNET_INET6(curvnet); /* XXX revisit ! */ + CURVNET_SET_QUIET((struct vnet *) rock); + INIT_VNET_INET6(curvnet); struct radix_node_head *rnh = rock; struct rtqk_arg arg; struct timeval atv; @@ -375,8 +375,8 @@ static void in6_mtutimo(void *rock) { - CURVNET_SET_QUIET((struct vnet *) rock); /* XXX revisit! */ - INIT_VNET_INET6(curvnet); /* XXX revisit! */ + CURVNET_SET_QUIET((struct vnet *) rock); + INIT_VNET_INET6(curvnet); struct radix_node_head *rnh = rock; struct mtuex_arg arg; struct timeval atv; ==== //depot/projects/vimage-commit2/src/sys/netinet6/nd6_rtr.c#25 (text+ko) ==== From owner-p4-projects@FreeBSD.ORG Sun Apr 26 20:05:07 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8756F1065675; Sun, 26 Apr 2009 20:05:07 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E71C91065672 for ; Sun, 26 Apr 2009 20:05:06 +0000 (UTC) (envelope-from marta@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id BCF7E8FC13 for ; Sun, 26 Apr 2009 20:05:06 +0000 (UTC) (envelope-from marta@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3QK56Fm022987 for ; Sun, 26 Apr 2009 20:05:06 GMT (envelope-from marta@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3QK56gc022985 for perforce@freebsd.org; Sun, 26 Apr 2009 20:05:06 GMT (envelope-from marta@FreeBSD.org) Date: Sun, 26 Apr 2009 20:05:06 GMT Message-Id: <200904262005.n3QK56gc022985@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marta@FreeBSD.org using -f From: Marta Carbone To: Perforce Change Reviews Cc: Subject: PERFORCE change 161128 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 20:05:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=161128 Change 161128 by marta@marta_onelab1 on 2009/04/26 20:04:23 Add project workplan and Milestones. Affected files ... .. //depot/projects/soc2009/marta_ipfw/Milestones#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Sun Apr 26 20:59:10 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 835821065672; Sun, 26 Apr 2009 20:59:10 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 437FD106564A for ; Sun, 26 Apr 2009 20:59:10 +0000 (UTC) (envelope-from marinosi@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 187DF8FC12 for ; Sun, 26 Apr 2009 20:59:10 +0000 (UTC) (envelope-from marinosi@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3QKx9JR045469 for ; Sun, 26 Apr 2009 20:59:09 GMT (envelope-from marinosi@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3QKx9gM045467 for perforce@freebsd.org; Sun, 26 Apr 2009 20:59:09 GMT (envelope-from marinosi@FreeBSD.org) Date: Sun, 26 Apr 2009 20:59:09 GMT Message-Id: <200904262059.n3QKx9gM045467@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marinosi@FreeBSD.org using -f From: Ilias Marinos To: Perforce Change Reviews Cc: Subject: PERFORCE change 161132 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 20:59:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=161132 Change 161132 by marinosi@marinos on 2009/04/26 20:58:45 Test commit.. Affected files ... .. //depot/projects/soc2009/marinosi_appaudit/Milestones#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Sun Apr 26 21:01:14 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 24E54106567D; Sun, 26 Apr 2009 21:01:14 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92AFC1065675 for ; Sun, 26 Apr 2009 21:01:12 +0000 (UTC) (envelope-from marinosi@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 926FE8FC15 for ; Sun, 26 Apr 2009 21:01:12 +0000 (UTC) (envelope-from marinosi@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3QL1CUv045908 for ; Sun, 26 Apr 2009 21:01:12 GMT (envelope-from marinosi@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3QL1CO3045906 for perforce@freebsd.org; Sun, 26 Apr 2009 21:01:12 GMT (envelope-from marinosi@FreeBSD.org) Date: Sun, 26 Apr 2009 21:01:12 GMT Message-Id: <200904262101.n3QL1CO3045906@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marinosi@FreeBSD.org using -f From: Ilias Marinos To: Perforce Change Reviews Cc: Subject: PERFORCE change 161134 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 21:01:15 -0000 http://perforce.freebsd.org/chv.cgi?CH=161134 Change 161134 by marinosi@marinos on 2009/04/26 21:00:42 Test commit.Project's milestones. Affected files ... .. //depot/projects/soc2009/marinosi_appaudit/Milestones#2 edit Differences ... ==== //depot/projects/soc2009/marinosi_appaudit/Milestones#2 (text+ko) ==== @@ -1,0 +1,13 @@ + * 3 weeks : A functional application specific audit framework, in kernel space is ready. + * 1 week : Extend the existing API(libbsm) to support multiple trails. + * 2 weeks : Cleanup above code, look for bugs and security holes. + +Midterm Evaluations + + * 2 weeks : Extend Auditd to support multiple trails/Test functionality + * 1 week : Mysql Audit Support + * 1 week : Apache2 Audit Support + * 2 weeks : Clean up all code, add comments and do extensive testing of the completed features. + o Stress Test the system at several conditions/Search for security holes. + +End of GSoC From owner-p4-projects@FreeBSD.ORG Sun Apr 26 22:14:32 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 21DDC1065674; Sun, 26 Apr 2009 22:14:32 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D596E106566C for ; Sun, 26 Apr 2009 22:14:31 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C256F8FC0C for ; Sun, 26 Apr 2009 22:14:31 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3QMEVNv060676 for ; Sun, 26 Apr 2009 22:14:31 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3QMEVPB060674 for perforce@freebsd.org; Sun, 26 Apr 2009 22:14:31 GMT (envelope-from zec@fer.hr) Date: Sun, 26 Apr 2009 22:14:31 GMT Message-Id: <200904262214.n3QMEVPB060674@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 161148 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 22:14:33 -0000 http://perforce.freebsd.org/chv.cgi?CH=161148 Change 161148 by zec@zec_amdx2 on 2009/04/26 22:13:33 IFC @ 161147 Affected files ... .. //depot/projects/vimage-commit/src/sys/compat/linux/linux_socket.c#9 integrate .. //depot/projects/vimage-commit/src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c#9 integrate .. //depot/projects/vimage-commit/src/sys/dev/ata/atapi-tape.c#5 integrate .. //depot/projects/vimage-commit/src/sys/kern/kern_rmlock.c#4 integrate .. //depot/projects/vimage-commit/src/sys/net/if_loop.c#18 integrate .. //depot/projects/vimage-commit/src/sys/net/route.c#15 integrate .. //depot/projects/vimage-commit/src/sys/net/rtsock.c#14 integrate .. //depot/projects/vimage-commit/src/sys/net80211/ieee80211_adhoc.c#6 integrate .. //depot/projects/vimage-commit/src/sys/net80211/ieee80211_hostap.c#7 integrate .. //depot/projects/vimage-commit/src/sys/net80211/ieee80211_ioctl.c#9 integrate .. //depot/projects/vimage-commit/src/sys/net80211/ieee80211_output.c#10 integrate .. //depot/projects/vimage-commit/src/sys/net80211/ieee80211_sta.c#7 integrate .. //depot/projects/vimage-commit/src/sys/net80211/ieee80211_superg.c#2 integrate .. //depot/projects/vimage-commit/src/sys/net80211/ieee80211_var.h#10 integrate .. //depot/projects/vimage-commit/src/sys/net80211/ieee80211_wds.c#7 integrate .. //depot/projects/vimage-commit/src/sys/netinet/igmp.c#16 integrate .. //depot/projects/vimage-commit/src/sys/netinet/in.c#14 integrate .. //depot/projects/vimage-commit/src/sys/netinet/in_mcast.c#15 integrate .. //depot/projects/vimage-commit/src/sys/netinet/in_rmx.c#13 integrate .. //depot/projects/vimage-commit/src/sys/netinet/ip_carp.c#11 integrate .. //depot/projects/vimage-commit/src/sys/netinet/ip_divert.c#12 integrate .. //depot/projects/vimage-commit/src/sys/netinet/ip_fw2.c#15 integrate .. //depot/projects/vimage-commit/src/sys/netinet/ip_mroute.c#13 integrate .. //depot/projects/vimage-commit/src/sys/netinet/tcp_subr.c#18 integrate .. //depot/projects/vimage-commit/src/sys/netinet/tcp_timewait.c#14 integrate .. //depot/projects/vimage-commit/src/sys/netinet/udp_usrreq.c#14 integrate .. //depot/projects/vimage-commit/src/sys/netinet6/in6_rmx.c#14 integrate .. //depot/projects/vimage-commit/src/sys/netinet6/nd6_rtr.c#13 integrate .. //depot/projects/vimage-commit/src/sys/netipx/spx_usrreq.c#4 integrate .. //depot/projects/vimage-commit/src/sys/sys/mbuf.h#7 integrate .. //depot/projects/vimage-commit/src/sys/sys/queue.h#3 integrate .. //depot/projects/vimage-commit/src/sys/vm/swap_pager.c#8 integrate .. //depot/projects/vimage-commit/src/sys/vm/vm_fault.c#5 integrate Differences ... ==== //depot/projects/vimage-commit/src/sys/compat/linux/linux_socket.c#9 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.80 2008/12/02 21:37:28 bz Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.81 2009/04/26 22:06:42 zec Exp $"); /* XXX we use functions that might not exist. */ #include "opt_compat.h" ==== //depot/projects/vimage-commit/src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c#9 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c,v 1.16 2009/04/16 20:30:28 kmacy Exp $ */ +/* $FreeBSD: src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c,v 1.17 2009/04/26 22:06:42 zec Exp $ */ /* * Copyright (C) 1993-2003 by Darren Reed. ==== //depot/projects/vimage-commit/src/sys/dev/ata/atapi-tape.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-tape.c,v 1.113 2009/02/28 22:07:15 mav Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-tape.c,v 1.114 2009/04/26 09:21:37 ed Exp $"); #include "opt_ata.h" #include @@ -138,15 +138,13 @@ DEVSTAT_NO_ORDERED_TAGS, DEVSTAT_TYPE_SEQUENTIAL | DEVSTAT_TYPE_IF_IDE, DEVSTAT_PRIORITY_TAPE); - device = make_dev(&ast_cdevsw, 2 * device_get_unit(dev), - UID_ROOT, GID_OPERATOR, 0640, "ast%d", - device_get_unit(dev)); + device = make_dev(&ast_cdevsw, 0, UID_ROOT, GID_OPERATOR, 0640, + "ast%d", device_get_unit(dev)); device->si_drv1 = dev; device->si_iosize_max = ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS; stp->dev1 = device; - device = make_dev(&ast_cdevsw, 2 * device_get_unit(dev) + 1, - UID_ROOT, GID_OPERATOR, 0640, "nast%d", - device_get_unit(dev)); + device = make_dev(&ast_cdevsw, 1, UID_ROOT, GID_OPERATOR, 0640, + "nast%d", device_get_unit(dev)); device->si_drv1 = dev; device->si_iosize_max = ch->dma.max_iosize; stp->dev2 = device; @@ -238,8 +236,8 @@ (stp->flags & (F_DATA_WRITTEN | F_FM_WRITTEN)) == F_DATA_WRITTEN) ast_write_filemark(dev, ATAPI_WF_WRITE); - /* if minor is even rewind on close */ - if (!(dev2unit(cdev) & 0x01)) + /* if unit is zero rewind on close */ + if (dev2unit(cdev) == 0) ast_rewind(dev); if (stp->cap.lock && count_dev(cdev) == 1) ==== //depot/projects/vimage-commit/src/sys/kern/kern_rmlock.c#4 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_rmlock.c,v 1.4 2008/09/10 19:13:30 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_rmlock.c,v 1.5 2009/04/26 21:16:03 rwatson Exp $"); #include "opt_ddb.h" @@ -55,25 +55,23 @@ #ifdef DDB #include #endif - + #define RMPF_ONQUEUE 1 #define RMPF_SIGNAL 2 -/* - * To support usage of rmlock in CVs and msleep - * yet another list for the priority tracker - * would be needed. - * Using this lock for cv and msleep also does - * not seem very useful +/* + * To support usage of rmlock in CVs and msleep yet another list for the + * priority tracker would be needed. Using this lock for cv and msleep also + * does not seem very useful */ static __inline void compiler_memory_barrier(void) { __asm __volatile("":::"memory"); } -static void assert_rm(struct lock_object *lock, int what); -static void lock_rm(struct lock_object *lock, int how); -static int unlock_rm(struct lock_object *lock); +static void assert_rm(struct lock_object *lock, int what); +static void lock_rm(struct lock_object *lock, int how); +static int unlock_rm(struct lock_object *lock); struct lock_class lock_class_rm = { .lc_name = "rm", @@ -96,12 +94,16 @@ } static void -lock_rm(struct lock_object *lock, int how) { +lock_rm(struct lock_object *lock, int how) +{ + panic("lock_rm called"); } static int -unlock_rm(struct lock_object *lock) { +unlock_rm(struct lock_object *lock) +{ + panic("unlock_rm called"); } @@ -111,75 +113,79 @@ /* * Add or remove tracker from per cpu list. - * The per cpu list can be traversed at any time in forward - * direction from an interrupt on the *local* cpu. + * + * The per cpu list can be traversed at any time in forward direction from an + * interrupt on the *local* cpu. */ - -static void inline -rm_tracker_add(struct pcpu *pc, struct rm_priotracker* tracker) { - struct rm_queue* next; +static void inline +rm_tracker_add(struct pcpu *pc, struct rm_priotracker *tracker) +{ + struct rm_queue *next; + /* Initialize all tracker pointers */ tracker->rmp_cpuQueue.rmq_prev = &pc->pc_rm_queue; next = pc->pc_rm_queue.rmq_next; tracker->rmp_cpuQueue.rmq_next = next; - /* rmq_prev is not used during froward traversal */ + + /* rmq_prev is not used during froward traversal. */ next->rmq_prev = &tracker->rmp_cpuQueue; - /* Update pointer to first element */ + + /* Update pointer to first element. */ pc->pc_rm_queue.rmq_next = &tracker->rmp_cpuQueue; } +static void inline +rm_tracker_remove(struct pcpu *pc, struct rm_priotracker *tracker) +{ + struct rm_queue *next, *prev; -static void inline -rm_tracker_remove(struct pcpu *pc, struct rm_priotracker* tracker) { - struct rm_queue *next, *prev; - next = tracker->rmp_cpuQueue.rmq_next; - prev = tracker->rmp_cpuQueue.rmq_prev; - /* Not used during forward traversal */ + next = tracker->rmp_cpuQueue.rmq_next; + prev = tracker->rmp_cpuQueue.rmq_prev; + + /* Not used during forward traversal. */ next->rmq_prev = prev; - /* Remove from list */ + + /* Remove from list. */ prev->rmq_next = next; } - - - -static void rm_cleanIPI(void *arg) { +static void +rm_cleanIPI(void *arg) +{ struct pcpu *pc; - struct rmlock* rm = arg; + struct rmlock *rm = arg; struct rm_priotracker *tracker; - struct rm_queue* queue; + struct rm_queue *queue; pc = pcpu_find(curcpu); - for(queue = pc->pc_rm_queue.rmq_next; - queue != &pc->pc_rm_queue; + for (queue = pc->pc_rm_queue.rmq_next; queue != &pc->pc_rm_queue; queue = queue->rmq_next) { - tracker = (struct rm_priotracker *) queue; - if(tracker->rmp_rmlock == rm && tracker->rmp_flags == 0 ) { + tracker = (struct rm_priotracker *)queue; + if (tracker->rmp_rmlock == rm && tracker->rmp_flags == 0) { tracker->rmp_flags = RMPF_ONQUEUE; mtx_lock_spin(&rm_spinlock); - LIST_INSERT_HEAD(&rm->rm_activeReaders,tracker, + LIST_INSERT_HEAD(&rm->rm_activeReaders, tracker, rmp_qentry); mtx_unlock_spin(&rm_spinlock); } } - return; } - - void rm_init(struct rmlock *rm, const char *name, int opts) { + rm->rm_noreadtoken = 1; LIST_INIT(&rm->rm_activeReaders); mtx_init(&rm->rm_lock, name, "RM_MTX",MTX_NOWITNESS); - lock_init(&rm->lock_object, &lock_class_rm, name, NULL, (opts & LO_RECURSABLE)| LO_WITNESS); - + lock_init(&rm->lock_object, &lock_class_rm, name, NULL, + (opts & LO_RECURSABLE)| LO_WITNESS); } void rm_destroy(struct rmlock *rm) { + mtx_destroy(&rm->rm_lock); lock_destroy(&rm->lock_object); } @@ -194,71 +200,64 @@ void rm_sysinit(void *arg) { + struct rm_args *args = arg; rm_init(args->ra_rm, args->ra_desc, args->ra_opts); } - static void -_rm_rlock_hard(struct rmlock *rm, struct rm_priotracker* tracker) +_rm_rlock_hard(struct rmlock *rm, struct rm_priotracker *tracker) { struct pcpu *pc; struct rm_queue *queue; - struct rm_priotracker* atracker; + struct rm_priotracker *atracker; critical_enter(); pc = pcpu_find(curcpu); - /* Check if we just need to do a proper critical_exit */ + /* Check if we just need to do a proper critical_exit. */ if (0 == rm->rm_noreadtoken) { critical_exit(); return; } - /* Remove our tracker from the per cpu list */ - rm_tracker_remove(pc,tracker); + /* Remove our tracker from the per cpu list. */ + rm_tracker_remove(pc, tracker); - /* Check to see if the IPI granted us the lock after all */ - if(tracker->rmp_flags) { - /* Just add back tracker - we hold the lock */ - rm_tracker_add(pc,tracker); + /* Check to see if the IPI granted us the lock after all. */ + if (tracker->rmp_flags) { + /* Just add back tracker - we hold the lock. */ + rm_tracker_add(pc, tracker); critical_exit(); return; } - - /* - * We allow readers to aquire a lock even if a writer - * is blocked if the lock is recursive and the reader - * already holds the lock + * We allow readers to aquire a lock even if a writer is blocked if + * the lock is recursive and the reader already holds the lock. */ - if ((rm->lock_object.lo_flags & LO_RECURSABLE) != 0) { /* * Just grand the lock if this thread already have a tracker - * for this lock on the per cpu queue + * for this lock on the per cpu queue. */ - - for(queue = pc->pc_rm_queue.rmq_next; - queue != &pc->pc_rm_queue; - queue = queue->rmq_next) { - atracker = (struct rm_priotracker *) queue; - if (( atracker->rmp_rmlock == rm) && - ( atracker->rmp_thread == tracker->rmp_thread )) { + for (queue = pc->pc_rm_queue.rmq_next; + queue != &pc->pc_rm_queue; queue = queue->rmq_next) { + atracker = (struct rm_priotracker *)queue; + if ((atracker->rmp_rmlock == rm) && + (atracker->rmp_thread == tracker->rmp_thread)) { mtx_lock_spin(&rm_spinlock); - LIST_INSERT_HEAD(&rm->rm_activeReaders,tracker, - rmp_qentry); + LIST_INSERT_HEAD(&rm->rm_activeReaders, + tracker, rmp_qentry); tracker->rmp_flags = RMPF_ONQUEUE; mtx_unlock_spin(&rm_spinlock); - rm_tracker_add(pc,tracker); + rm_tracker_add(pc, tracker); critical_exit(); return; } } } - sched_unpin(); critical_exit(); @@ -267,16 +266,15 @@ critical_enter(); pc = pcpu_find(curcpu); - rm_tracker_add(pc,tracker); + rm_tracker_add(pc, tracker); sched_pin(); critical_exit(); - + mtx_unlock(&rm->rm_lock); - return; } void -_rm_rlock(struct rmlock *rm, struct rm_priotracker* tracker) +_rm_rlock(struct rmlock *rm, struct rm_priotracker *tracker) { struct thread *td = curthread; struct pcpu *pc; @@ -291,51 +289,46 @@ pc = cpuid_to_pcpu[td->td_oncpu]; /* pcpu_find(td->td_oncpu); */ - rm_tracker_add(pc,tracker); + rm_tracker_add(pc, tracker); td->td_pinned++; /* sched_pin(); */ compiler_memory_barrier(); td->td_critnest--; - - /* - * Fast path to combine two common conditions - * into a single conditional jump + + /* + * Fast path to combine two common conditions into a single + * conditional jump. */ - - if (0 == (td->td_owepreempt | rm->rm_noreadtoken)) { + if (0 == (td->td_owepreempt | rm->rm_noreadtoken)) return; - } - /* We do not have a read token and need to acquire one */ - _rm_rlock_hard(rm,tracker); + /* We do not have a read token and need to acquire one. */ + _rm_rlock_hard(rm, tracker); } - static void -_rm_unlock_hard(struct thread *td,struct rm_priotracker* tracker) +_rm_unlock_hard(struct thread *td,struct rm_priotracker *tracker) { - + if (td->td_owepreempt) { td->td_critnest++; critical_exit(); } - - if (!tracker->rmp_flags) { + + if (!tracker->rmp_flags) return; - } - mtx_lock_spin(&rm_spinlock); - LIST_REMOVE(tracker,rmp_qentry); + LIST_REMOVE(tracker, rmp_qentry); if (tracker->rmp_flags & RMPF_SIGNAL) { struct rmlock *rm; - struct turnstile* ts; + struct turnstile *ts; rm = tracker->rmp_rmlock; - + turnstile_chain_lock(&rm->lock_object); mtx_unlock_spin(&rm_spinlock); @@ -344,35 +337,28 @@ turnstile_signal(ts, TS_EXCLUSIVE_QUEUE); turnstile_unpend(ts, TS_EXCLUSIVE_LOCK); turnstile_chain_unlock(&rm->lock_object); - - } else mtx_unlock_spin(&rm_spinlock); - -} +} void -_rm_runlock(struct rmlock *rm, struct rm_priotracker* tracker) +_rm_runlock(struct rmlock *rm, struct rm_priotracker *tracker) { struct pcpu *pc; struct thread *td = tracker->rmp_thread; td->td_critnest++; /* critical_enter(); */ pc = cpuid_to_pcpu[td->td_oncpu]; /* pcpu_find(td->td_oncpu); */ - rm_tracker_remove(pc,tracker); + rm_tracker_remove(pc, tracker); td->td_critnest--; td->td_pinned--; /* sched_unpin(); */ - if (0 == (td->td_owepreempt | tracker->rmp_flags)) + if (0 == (td->td_owepreempt | tracker->rmp_flags)) return; - - _rm_unlock_hard(td,tracker); - - + _rm_unlock_hard(td, tracker); } - void _rm_wlock(struct rmlock *rm) { @@ -386,53 +372,46 @@ rm->rm_noreadtoken = 1; - /* - * Assumes rm->rm_noreadtoken update is visible - * on other CPUs before rm_cleanIPI is called + /* + * Assumes rm->rm_noreadtoken update is visible on other CPUs + * before rm_cleanIPI is called. */ #ifdef SMP smp_rendezvous(smp_no_rendevous_barrier, rm_cleanIPI, - smp_no_rendevous_barrier - ,rm); + smp_no_rendevous_barrier, + rm); #else rm_cleanIPI(rm); #endif - mtx_lock_spin(&rm_spinlock); - - while((prio = LIST_FIRST(&rm->rm_activeReaders)) != NULL) { + while ((prio = LIST_FIRST(&rm->rm_activeReaders)) != NULL) { ts = turnstile_trywait(&rm->lock_object); prio->rmp_flags = RMPF_ONQUEUE | RMPF_SIGNAL; mtx_unlock_spin(&rm_spinlock); - turnstile_wait(ts,prio->rmp_thread, - TS_EXCLUSIVE_QUEUE); + turnstile_wait(ts, prio->rmp_thread, + TS_EXCLUSIVE_QUEUE); mtx_lock_spin(&rm_spinlock); - } - mtx_unlock_spin(&rm_spinlock); } - } - void _rm_wunlock(struct rmlock *rm) { + mtx_unlock(&rm->rm_lock); } - #ifdef LOCK_DEBUG void _rm_wlock_debug(struct rmlock *rm, const char *file, int line) { - - WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER | LOP_EXCLUSIVE, + WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL); _rm_wlock(rm); @@ -445,71 +424,75 @@ } -void _rm_wunlock_debug(struct rmlock *rm, const char *file, int line) +void +_rm_wunlock_debug(struct rmlock *rm, const char *file, int line) { + curthread->td_locks--; WITNESS_UNLOCK(&rm->lock_object, LOP_EXCLUSIVE, file, line); LOCK_LOG_LOCK("RMWUNLOCK", &rm->lock_object, 0, 0, file, line); _rm_wunlock(rm); -} +} - -void +void _rm_rlock_debug(struct rmlock *rm, struct rm_priotracker *tracker, const char *file, int line) { + WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER, file, line, NULL); - WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER , file, line, NULL); - _rm_rlock(rm, tracker); LOCK_LOG_LOCK("RMRLOCK", &rm->lock_object, 0, 0, file, line); - WITNESS_LOCK(&rm->lock_object, 0 , file, line); + WITNESS_LOCK(&rm->lock_object, 0, file, line); - curthread->td_locks++; + curthread->td_locks++; } -void +void _rm_runlock_debug(struct rmlock *rm, struct rm_priotracker *tracker, - const char *file, int line) { + const char *file, int line) +{ + curthread->td_locks--; - WITNESS_UNLOCK(&rm->lock_object, 0 , file, line); + WITNESS_UNLOCK(&rm->lock_object, 0, file, line); LOCK_LOG_LOCK("RMRUNLOCK", &rm->lock_object, 0, 0, file, line); _rm_runlock(rm, tracker); } - - - #else -/* - * Just strip out file and line arguments if no lock debugging is enabled - * in the kernel - we are called from a kernel module. -*/ +/* + * Just strip out file and line arguments if no lock debugging is enabled in + * the kernel - we are called from a kernel module. + */ +void +_rm_wlock_debug(struct rmlock *rm, const char *file, int line) +{ -void _rm_wlock_debug(struct rmlock *rm, const char *file, int line) -{ _rm_wlock(rm); } -void _rm_wunlock_debug(struct rmlock *rm, const char *file, int line) +void +_rm_wunlock_debug(struct rmlock *rm, const char *file, int line) { + _rm_wunlock(rm); -} - -void +} + +void _rm_rlock_debug(struct rmlock *rm, struct rm_priotracker *tracker, const char *file, int line) { + _rm_rlock(rm, tracker); } -void +void _rm_runlock_debug(struct rmlock *rm, struct rm_priotracker *tracker, const char *file, int line) { + _rm_runlock(rm, tracker); } ==== //depot/projects/vimage-commit/src/sys/net/if_loop.c#18 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)if_loop.c 8.2 (Berkeley) 1/9/95 - * $FreeBSD: src/sys/net/if_loop.c,v 1.131 2009/04/16 20:30:28 kmacy Exp $ + * $FreeBSD: src/sys/net/if_loop.c,v 1.132 2009/04/26 22:06:42 zec Exp $ */ /* ==== //depot/projects/vimage-commit/src/sys/net/route.c#15 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)route.c 8.3.1.1 (Berkeley) 2/23/95 - * $FreeBSD: src/sys/net/route.c,v 1.153 2009/04/14 23:05:36 kmacy Exp $ + * $FreeBSD: src/sys/net/route.c,v 1.154 2009/04/26 22:06:42 zec Exp $ */ /************************************************************************ * Note: In this file a 'fib' is a "forwarding information base" * ==== //depot/projects/vimage-commit/src/sys/net/rtsock.c#14 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)rtsock.c 8.7 (Berkeley) 10/12/95 - * $FreeBSD: src/sys/net/rtsock.c,v 1.169 2009/04/20 23:23:31 rwatson Exp $ + * $FreeBSD: src/sys/net/rtsock.c,v 1.170 2009/04/26 22:06:42 zec Exp $ */ #include "opt_sctp.h" #include "opt_mpath.h" ==== //depot/projects/vimage-commit/src/sys/net80211/ieee80211_adhoc.c#6 (text+ko) ==== @@ -25,7 +25,7 @@ #include #ifdef __FreeBSD__ -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_adhoc.c,v 1.10 2009/03/24 20:39:08 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_adhoc.c,v 1.13 2009/04/26 21:50:21 sam Exp $"); #endif /* @@ -74,6 +74,7 @@ int subtype, int rssi, int noise, uint32_t rstamp); static void ahdemo_recv_mgmt(struct ieee80211_node *, struct mbuf *, int subtype, int rssi, int noise, uint32_t rstamp); +static void adhoc_recv_ctl(struct ieee80211_node *, struct mbuf *, int subtype); void ieee80211_adhoc_attach(struct ieee80211com *ic) @@ -101,6 +102,7 @@ vap->iv_recv_mgmt = adhoc_recv_mgmt; else vap->iv_recv_mgmt = ahdemo_recv_mgmt; + vap->iv_recv_ctl = adhoc_recv_ctl; vap->iv_opdetach = adhoc_vdetach; #ifdef IEEE80211_SUPPORT_TDMA /* @@ -339,7 +341,8 @@ if ((wh->i_fc[0] & IEEE80211_FC0_VERSION_MASK) != IEEE80211_FC0_VERSION_0) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, - ni->ni_macaddr, NULL, "wrong version %x", wh->i_fc[0]); + ni->ni_macaddr, NULL, "wrong version, fc %02x:%02x", + wh->i_fc[0], wh->i_fc[1]); vap->iv_stats.is_rx_badversion++; goto err; } @@ -637,15 +640,13 @@ vap->iv_stats.is_rx_mgtdiscard++; /* XXX */ goto out; } - if (bpf_peers_present(vap->iv_rawbpf)) - bpf_mtap(vap->iv_rawbpf, m); vap->iv_recv_mgmt(ni, m, subtype, rssi, noise, rstamp); - m_freem(m); - return IEEE80211_FC0_TYPE_MGT; + goto out; case IEEE80211_FC0_TYPE_CTL: vap->iv_stats.is_rx_ctl++; IEEE80211_NODE_STAT(ni, rx_ctrl); + vap->iv_recv_ctl(ni, m, subtype); goto out; default: IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY, @@ -657,7 +658,7 @@ ifp->if_ierrors++; out: if (m != NULL) { - if (bpf_peers_present(vap->iv_rawbpf) && need_tap) + if (need_tap && bpf_peers_present(vap->iv_rawbpf)) bpf_mtap(vap->iv_rawbpf, m); m_freem(m); } @@ -924,3 +925,8 @@ else vap->iv_stats.is_rx_mgtdiscard++; } + +static void +adhoc_recv_ctl(struct ieee80211_node *ni, struct mbuf *m0, int subtype) +{ +} ==== //depot/projects/vimage-commit/src/sys/net80211/ieee80211_hostap.c#7 (text+ko) ==== @@ -25,7 +25,7 @@ #include #ifdef __FreeBSD__ -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_hostap.c,v 1.16 2009/03/30 21:53:27 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_hostap.c,v 1.19 2009/04/26 21:50:21 sam Exp $"); #endif /* @@ -72,6 +72,7 @@ struct ieee80211_node *, struct mbuf *); static void hostap_recv_mgmt(struct ieee80211_node *, struct mbuf *, int subtype, int rssi, int noise, uint32_t rstamp); +static void hostap_recv_ctl(struct ieee80211_node *, struct mbuf *, int); static void hostap_recv_pspoll(struct ieee80211_node *, struct mbuf *); void @@ -96,6 +97,7 @@ vap->iv_newstate = hostap_newstate; vap->iv_input = hostap_input; vap->iv_recv_mgmt = hostap_recv_mgmt; + vap->iv_recv_ctl = hostap_recv_ctl; vap->iv_opdetach = hostap_vdetach; vap->iv_deliver_data = hostap_deliver_data; } @@ -473,7 +475,8 @@ if ((wh->i_fc[0] & IEEE80211_FC0_VERSION_MASK) != IEEE80211_FC0_VERSION_0) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, - ni->ni_macaddr, NULL, "wrong version %x", wh->i_fc[0]); + ni->ni_macaddr, NULL, "wrong version, fc %02x:%02x", + wh->i_fc[0], wh->i_fc[1]); vap->iv_stats.is_rx_badversion++; goto err; } @@ -831,23 +834,13 @@ wh = mtod(m, struct ieee80211_frame *); wh->i_fc[1] &= ~IEEE80211_FC1_WEP; } - if (bpf_peers_present(vap->iv_rawbpf)) - bpf_mtap(vap->iv_rawbpf, m); vap->iv_recv_mgmt(ni, m, subtype, rssi, noise, rstamp); - m_freem(m); - return IEEE80211_FC0_TYPE_MGT; + goto out; case IEEE80211_FC0_TYPE_CTL: vap->iv_stats.is_rx_ctl++; IEEE80211_NODE_STAT(ni, rx_ctrl); - switch (subtype) { - case IEEE80211_FC0_SUBTYPE_PS_POLL: - hostap_recv_pspoll(ni, m); - break; - case IEEE80211_FC0_SUBTYPE_BAR: - ieee80211_recv_bar(ni, m); - break; - } + vap->iv_recv_ctl(ni, m, subtype); goto out; default: IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY, @@ -859,7 +852,7 @@ ifp->if_ierrors++; out: if (m != NULL) { - if (bpf_peers_present(vap->iv_rawbpf) && need_tap) + if (need_tap && bpf_peers_present(vap->iv_rawbpf)) bpf_mtap(vap->iv_rawbpf, m); m_freem(m); } @@ -2165,6 +2158,19 @@ } } +static void +hostap_recv_ctl(struct ieee80211_node *ni, struct mbuf *m, int subtype) +{ + switch (subtype) { + case IEEE80211_FC0_SUBTYPE_PS_POLL: + hostap_recv_pspoll(ni, m); + break; + case IEEE80211_FC0_SUBTYPE_BAR: + ieee80211_recv_bar(ni, m); + break; + } +} + /* * Process a received ps-poll frame. */ ==== //depot/projects/vimage-commit/src/sys/net80211/ieee80211_ioctl.c#9 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_ioctl.c,v 1.84 2009/03/29 21:17:08 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_ioctl.c,v 1.85 2009/04/26 20:55:31 sam Exp $"); /* * IEEE 802.11 ioctl support (FreeBSD-specific) @@ -915,10 +915,13 @@ case IEEE80211_IOC_BSSID: if (ireq->i_len != IEEE80211_ADDR_LEN) return EINVAL; - error = copyout(vap->iv_state == IEEE80211_S_RUN ? - vap->iv_bss->ni_bssid : - vap->iv_des_bssid, - ireq->i_data, ireq->i_len); + if (vap->iv_state == IEEE80211_S_RUN) { + error = copyout(vap->iv_opmode == IEEE80211_M_WDS ? + vap->iv_bss->ni_macaddr : vap->iv_bss->ni_bssid, + ireq->i_data, ireq->i_len); + } else + error = copyout(vap->iv_des_bssid, ireq->i_data, + ireq->i_len); break; case IEEE80211_IOC_WPAIE: error = ieee80211_ioctl_getwpaie(vap, ireq, ireq->i_type); ==== //depot/projects/vimage-commit/src/sys/net80211/ieee80211_output.c#10 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.84 2009/04/16 20:30:28 kmacy Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.90 2009/04/26 21:37:02 sam Exp $"); #include "opt_inet.h" #include "opt_wlan.h" @@ -273,6 +273,10 @@ */ m->m_pkthdr.rcvif = (void *)ni; + /* XXX fragmented frames not handled */ + if (bpf_peers_present(vap->iv_rawbpf)) + bpf_mtap(vap->iv_rawbpf, m); + error = parent->if_transmit(parent, m); if (error != 0) { /* NB: IFQ_HANDOFF reclaims mbuf */ @@ -288,9 +292,7 @@ /* * 802.11 output routine. This is (currently) used only to * connect bpf write calls to the 802.11 layer for injecting - * raw 802.11 frames. Note we locate the ieee80211com from - * the ifnet using a spare field setup at attach time. This - * will go away when the virtual ap support comes in. + * raw 802.11 frames. */ int ieee80211_output(struct ifnet *ifp, struct mbuf *m, @@ -384,7 +386,17 @@ if (ieee80211_classify(ni, m)) senderr(EIO); /* XXX */ - BPF_MTAP(ifp, m); + if (bpf_peers_present(vap->iv_rawbpf)) + bpf_mtap(vap->iv_rawbpf, m); + + IEEE80211_NODE_STAT(ni, tx_data); + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { + IEEE80211_NODE_STAT(ni, tx_mcast); + m->m_flags |= M_MCAST; + } else + IEEE80211_NODE_STAT(ni, tx_ucast); + /* NB: ieee80211_encap does not include 802.11 header */ + IEEE80211_NODE_STAT_ADD(ni, tx_bytes, m->m_pkthdr.len); /* * NB: DLT_IEEE802_11_RADIO identifies the parameters are @@ -412,13 +424,15 @@ static void ieee80211_send_setup( struct ieee80211_node *ni, - struct ieee80211_frame *wh, + struct mbuf *m, int type, int tid, const uint8_t sa[IEEE80211_ADDR_LEN], const uint8_t da[IEEE80211_ADDR_LEN], const uint8_t bssid[IEEE80211_ADDR_LEN]) { #define WH4(wh) ((struct ieee80211_frame_addr4 *)wh) + struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); + ieee80211_seq seqno; wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | type; if ((type & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_DATA) { @@ -461,9 +475,12 @@ IEEE80211_ADDR_COPY(wh->i_addr3, bssid); } *(uint16_t *)&wh->i_dur[0] = 0; - *(uint16_t *)&wh->i_seq[0] = - htole16(ni->ni_txseqs[tid] << IEEE80211_SEQ_SEQ_SHIFT); - ni->ni_txseqs[tid]++; + + seqno = ni->ni_txseqs[tid]++; + *(uint16_t *)&wh->i_seq[0] = htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); + + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + m->m_flags |= M_MCAST; #undef WH4 } @@ -504,7 +521,7 @@ } wh = mtod(m, struct ieee80211_frame *); - ieee80211_send_setup(ni, wh, + ieee80211_send_setup(ni, m, IEEE80211_FC0_TYPE_MGT | type, IEEE80211_NONQOS_TID, vap->iv_myaddr, ni->ni_macaddr, ni->ni_bssid); if (params->ibp_flags & IEEE80211_BPF_CRYPTO) { @@ -595,7 +612,7 @@ const int tid = WME_AC_TO_TID(WME_AC_BE); uint8_t *qos; - ieee80211_send_setup(ni, wh, >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Sun Apr 26 22:16:34 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 89F86106566C; Sun, 26 Apr 2009 22:16:34 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4957B106566B for ; Sun, 26 Apr 2009 22:16:34 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 35C6F8FC16 for ; Sun, 26 Apr 2009 22:16:34 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3QMGXeD060879 for ; Sun, 26 Apr 2009 22:16:33 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3QMGXOv060877 for perforce@freebsd.org; Sun, 26 Apr 2009 22:16:33 GMT (envelope-from zec@fer.hr) Date: Sun, 26 Apr 2009 22:16:33 GMT Message-Id: <200904262216.n3QMGXOv060877@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 161149 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 22:16:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=161149 Change 161149 by zec@zec_amdx2 on 2009/04/26 22:15:43 IFC @ 161147 Affected files ... .. //depot/projects/vimage-commit2/src/sys/compat/linux/linux_socket.c#14 integrate .. //depot/projects/vimage-commit2/src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c#19 integrate .. //depot/projects/vimage-commit2/src/sys/dev/ata/atapi-tape.c#5 integrate .. //depot/projects/vimage-commit2/src/sys/kern/kern_rmlock.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/net/if_loop.c#27 integrate .. //depot/projects/vimage-commit2/src/sys/net/route.c#36 integrate .. //depot/projects/vimage-commit2/src/sys/net/rtsock.c#24 integrate .. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_adhoc.c#7 integrate .. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_hostap.c#10 integrate .. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_ioctl.c#9 integrate .. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_output.c#12 integrate .. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_sta.c#9 integrate .. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_superg.c#2 integrate .. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_var.h#10 integrate .. //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_wds.c#8 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/igmp.c#27 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/in.c#25 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/in_mcast.c#22 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/in_rmx.c#27 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/ip_carp.c#15 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/ip_divert.c#28 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/ip_fw2.c#41 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/ip_mroute.c#15 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/tcp_subr.c#49 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/tcp_timewait.c#25 integrate .. //depot/projects/vimage-commit2/src/sys/netinet/udp_usrreq.c#36 integrate .. //depot/projects/vimage-commit2/src/sys/netinet6/in6_rmx.c#29 integrate .. //depot/projects/vimage-commit2/src/sys/netinet6/nd6_rtr.c#26 integrate .. //depot/projects/vimage-commit2/src/sys/netipx/spx_usrreq.c#3 integrate .. //depot/projects/vimage-commit2/src/sys/sys/mbuf.h#6 integrate .. //depot/projects/vimage-commit2/src/sys/sys/queue.h#2 integrate .. //depot/projects/vimage-commit2/src/sys/vm/swap_pager.c#8 integrate .. //depot/projects/vimage-commit2/src/sys/vm/vm_fault.c#5 integrate Differences ... ==== //depot/projects/vimage-commit2/src/sys/compat/linux/linux_socket.c#14 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.80 2008/12/02 21:37:28 bz Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.81 2009/04/26 22:06:42 zec Exp $"); /* XXX we use functions that might not exist. */ #include "opt_compat.h" ==== //depot/projects/vimage-commit2/src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c#19 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c,v 1.16 2009/04/16 20:30:28 kmacy Exp $ */ +/* $FreeBSD: src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c,v 1.17 2009/04/26 22:06:42 zec Exp $ */ /* * Copyright (C) 1993-2003 by Darren Reed. ==== //depot/projects/vimage-commit2/src/sys/dev/ata/atapi-tape.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-tape.c,v 1.113 2009/02/28 22:07:15 mav Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-tape.c,v 1.114 2009/04/26 09:21:37 ed Exp $"); #include "opt_ata.h" #include @@ -138,15 +138,13 @@ DEVSTAT_NO_ORDERED_TAGS, DEVSTAT_TYPE_SEQUENTIAL | DEVSTAT_TYPE_IF_IDE, DEVSTAT_PRIORITY_TAPE); - device = make_dev(&ast_cdevsw, 2 * device_get_unit(dev), - UID_ROOT, GID_OPERATOR, 0640, "ast%d", - device_get_unit(dev)); + device = make_dev(&ast_cdevsw, 0, UID_ROOT, GID_OPERATOR, 0640, + "ast%d", device_get_unit(dev)); device->si_drv1 = dev; device->si_iosize_max = ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS; stp->dev1 = device; - device = make_dev(&ast_cdevsw, 2 * device_get_unit(dev) + 1, - UID_ROOT, GID_OPERATOR, 0640, "nast%d", - device_get_unit(dev)); + device = make_dev(&ast_cdevsw, 1, UID_ROOT, GID_OPERATOR, 0640, + "nast%d", device_get_unit(dev)); device->si_drv1 = dev; device->si_iosize_max = ch->dma.max_iosize; stp->dev2 = device; @@ -238,8 +236,8 @@ (stp->flags & (F_DATA_WRITTEN | F_FM_WRITTEN)) == F_DATA_WRITTEN) ast_write_filemark(dev, ATAPI_WF_WRITE); - /* if minor is even rewind on close */ - if (!(dev2unit(cdev) & 0x01)) + /* if unit is zero rewind on close */ + if (dev2unit(cdev) == 0) ast_rewind(dev); if (stp->cap.lock && count_dev(cdev) == 1) ==== //depot/projects/vimage-commit2/src/sys/kern/kern_rmlock.c#3 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_rmlock.c,v 1.4 2008/09/10 19:13:30 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_rmlock.c,v 1.5 2009/04/26 21:16:03 rwatson Exp $"); #include "opt_ddb.h" @@ -55,25 +55,23 @@ #ifdef DDB #include #endif - + #define RMPF_ONQUEUE 1 #define RMPF_SIGNAL 2 -/* - * To support usage of rmlock in CVs and msleep - * yet another list for the priority tracker - * would be needed. - * Using this lock for cv and msleep also does - * not seem very useful +/* + * To support usage of rmlock in CVs and msleep yet another list for the + * priority tracker would be needed. Using this lock for cv and msleep also + * does not seem very useful */ static __inline void compiler_memory_barrier(void) { __asm __volatile("":::"memory"); } -static void assert_rm(struct lock_object *lock, int what); -static void lock_rm(struct lock_object *lock, int how); -static int unlock_rm(struct lock_object *lock); +static void assert_rm(struct lock_object *lock, int what); +static void lock_rm(struct lock_object *lock, int how); +static int unlock_rm(struct lock_object *lock); struct lock_class lock_class_rm = { .lc_name = "rm", @@ -96,12 +94,16 @@ } static void -lock_rm(struct lock_object *lock, int how) { +lock_rm(struct lock_object *lock, int how) +{ + panic("lock_rm called"); } static int -unlock_rm(struct lock_object *lock) { +unlock_rm(struct lock_object *lock) +{ + panic("unlock_rm called"); } @@ -111,75 +113,79 @@ /* * Add or remove tracker from per cpu list. - * The per cpu list can be traversed at any time in forward - * direction from an interrupt on the *local* cpu. + * + * The per cpu list can be traversed at any time in forward direction from an + * interrupt on the *local* cpu. */ - -static void inline -rm_tracker_add(struct pcpu *pc, struct rm_priotracker* tracker) { - struct rm_queue* next; +static void inline +rm_tracker_add(struct pcpu *pc, struct rm_priotracker *tracker) +{ + struct rm_queue *next; + /* Initialize all tracker pointers */ tracker->rmp_cpuQueue.rmq_prev = &pc->pc_rm_queue; next = pc->pc_rm_queue.rmq_next; tracker->rmp_cpuQueue.rmq_next = next; - /* rmq_prev is not used during froward traversal */ + + /* rmq_prev is not used during froward traversal. */ next->rmq_prev = &tracker->rmp_cpuQueue; - /* Update pointer to first element */ + + /* Update pointer to first element. */ pc->pc_rm_queue.rmq_next = &tracker->rmp_cpuQueue; } +static void inline +rm_tracker_remove(struct pcpu *pc, struct rm_priotracker *tracker) +{ + struct rm_queue *next, *prev; -static void inline -rm_tracker_remove(struct pcpu *pc, struct rm_priotracker* tracker) { - struct rm_queue *next, *prev; - next = tracker->rmp_cpuQueue.rmq_next; - prev = tracker->rmp_cpuQueue.rmq_prev; - /* Not used during forward traversal */ + next = tracker->rmp_cpuQueue.rmq_next; + prev = tracker->rmp_cpuQueue.rmq_prev; + + /* Not used during forward traversal. */ next->rmq_prev = prev; - /* Remove from list */ + + /* Remove from list. */ prev->rmq_next = next; } - - - -static void rm_cleanIPI(void *arg) { +static void +rm_cleanIPI(void *arg) +{ struct pcpu *pc; - struct rmlock* rm = arg; + struct rmlock *rm = arg; struct rm_priotracker *tracker; - struct rm_queue* queue; + struct rm_queue *queue; pc = pcpu_find(curcpu); - for(queue = pc->pc_rm_queue.rmq_next; - queue != &pc->pc_rm_queue; + for (queue = pc->pc_rm_queue.rmq_next; queue != &pc->pc_rm_queue; queue = queue->rmq_next) { - tracker = (struct rm_priotracker *) queue; - if(tracker->rmp_rmlock == rm && tracker->rmp_flags == 0 ) { + tracker = (struct rm_priotracker *)queue; + if (tracker->rmp_rmlock == rm && tracker->rmp_flags == 0) { tracker->rmp_flags = RMPF_ONQUEUE; mtx_lock_spin(&rm_spinlock); - LIST_INSERT_HEAD(&rm->rm_activeReaders,tracker, + LIST_INSERT_HEAD(&rm->rm_activeReaders, tracker, rmp_qentry); mtx_unlock_spin(&rm_spinlock); } } - return; } - - void rm_init(struct rmlock *rm, const char *name, int opts) { + rm->rm_noreadtoken = 1; LIST_INIT(&rm->rm_activeReaders); mtx_init(&rm->rm_lock, name, "RM_MTX",MTX_NOWITNESS); - lock_init(&rm->lock_object, &lock_class_rm, name, NULL, (opts & LO_RECURSABLE)| LO_WITNESS); - + lock_init(&rm->lock_object, &lock_class_rm, name, NULL, + (opts & LO_RECURSABLE)| LO_WITNESS); } void rm_destroy(struct rmlock *rm) { + mtx_destroy(&rm->rm_lock); lock_destroy(&rm->lock_object); } @@ -194,71 +200,64 @@ void rm_sysinit(void *arg) { + struct rm_args *args = arg; rm_init(args->ra_rm, args->ra_desc, args->ra_opts); } - static void -_rm_rlock_hard(struct rmlock *rm, struct rm_priotracker* tracker) +_rm_rlock_hard(struct rmlock *rm, struct rm_priotracker *tracker) { struct pcpu *pc; struct rm_queue *queue; - struct rm_priotracker* atracker; + struct rm_priotracker *atracker; critical_enter(); pc = pcpu_find(curcpu); - /* Check if we just need to do a proper critical_exit */ + /* Check if we just need to do a proper critical_exit. */ if (0 == rm->rm_noreadtoken) { critical_exit(); return; } - /* Remove our tracker from the per cpu list */ - rm_tracker_remove(pc,tracker); + /* Remove our tracker from the per cpu list. */ + rm_tracker_remove(pc, tracker); - /* Check to see if the IPI granted us the lock after all */ - if(tracker->rmp_flags) { - /* Just add back tracker - we hold the lock */ - rm_tracker_add(pc,tracker); + /* Check to see if the IPI granted us the lock after all. */ + if (tracker->rmp_flags) { + /* Just add back tracker - we hold the lock. */ + rm_tracker_add(pc, tracker); critical_exit(); return; } - - /* - * We allow readers to aquire a lock even if a writer - * is blocked if the lock is recursive and the reader - * already holds the lock + * We allow readers to aquire a lock even if a writer is blocked if + * the lock is recursive and the reader already holds the lock. */ - if ((rm->lock_object.lo_flags & LO_RECURSABLE) != 0) { /* * Just grand the lock if this thread already have a tracker - * for this lock on the per cpu queue + * for this lock on the per cpu queue. */ - - for(queue = pc->pc_rm_queue.rmq_next; - queue != &pc->pc_rm_queue; - queue = queue->rmq_next) { - atracker = (struct rm_priotracker *) queue; - if (( atracker->rmp_rmlock == rm) && - ( atracker->rmp_thread == tracker->rmp_thread )) { + for (queue = pc->pc_rm_queue.rmq_next; + queue != &pc->pc_rm_queue; queue = queue->rmq_next) { + atracker = (struct rm_priotracker *)queue; + if ((atracker->rmp_rmlock == rm) && + (atracker->rmp_thread == tracker->rmp_thread)) { mtx_lock_spin(&rm_spinlock); - LIST_INSERT_HEAD(&rm->rm_activeReaders,tracker, - rmp_qentry); + LIST_INSERT_HEAD(&rm->rm_activeReaders, + tracker, rmp_qentry); tracker->rmp_flags = RMPF_ONQUEUE; mtx_unlock_spin(&rm_spinlock); - rm_tracker_add(pc,tracker); + rm_tracker_add(pc, tracker); critical_exit(); return; } } } - sched_unpin(); critical_exit(); @@ -267,16 +266,15 @@ critical_enter(); pc = pcpu_find(curcpu); - rm_tracker_add(pc,tracker); + rm_tracker_add(pc, tracker); sched_pin(); critical_exit(); - + mtx_unlock(&rm->rm_lock); - return; } void -_rm_rlock(struct rmlock *rm, struct rm_priotracker* tracker) +_rm_rlock(struct rmlock *rm, struct rm_priotracker *tracker) { struct thread *td = curthread; struct pcpu *pc; @@ -291,51 +289,46 @@ pc = cpuid_to_pcpu[td->td_oncpu]; /* pcpu_find(td->td_oncpu); */ - rm_tracker_add(pc,tracker); + rm_tracker_add(pc, tracker); td->td_pinned++; /* sched_pin(); */ compiler_memory_barrier(); td->td_critnest--; - - /* - * Fast path to combine two common conditions - * into a single conditional jump + + /* + * Fast path to combine two common conditions into a single + * conditional jump. */ - - if (0 == (td->td_owepreempt | rm->rm_noreadtoken)) { + if (0 == (td->td_owepreempt | rm->rm_noreadtoken)) return; - } - /* We do not have a read token and need to acquire one */ - _rm_rlock_hard(rm,tracker); + /* We do not have a read token and need to acquire one. */ + _rm_rlock_hard(rm, tracker); } - static void -_rm_unlock_hard(struct thread *td,struct rm_priotracker* tracker) +_rm_unlock_hard(struct thread *td,struct rm_priotracker *tracker) { - + if (td->td_owepreempt) { td->td_critnest++; critical_exit(); } - - if (!tracker->rmp_flags) { + + if (!tracker->rmp_flags) return; - } - mtx_lock_spin(&rm_spinlock); - LIST_REMOVE(tracker,rmp_qentry); + LIST_REMOVE(tracker, rmp_qentry); if (tracker->rmp_flags & RMPF_SIGNAL) { struct rmlock *rm; - struct turnstile* ts; + struct turnstile *ts; rm = tracker->rmp_rmlock; - + turnstile_chain_lock(&rm->lock_object); mtx_unlock_spin(&rm_spinlock); @@ -344,35 +337,28 @@ turnstile_signal(ts, TS_EXCLUSIVE_QUEUE); turnstile_unpend(ts, TS_EXCLUSIVE_LOCK); turnstile_chain_unlock(&rm->lock_object); - - } else mtx_unlock_spin(&rm_spinlock); - -} +} void -_rm_runlock(struct rmlock *rm, struct rm_priotracker* tracker) +_rm_runlock(struct rmlock *rm, struct rm_priotracker *tracker) { struct pcpu *pc; struct thread *td = tracker->rmp_thread; td->td_critnest++; /* critical_enter(); */ pc = cpuid_to_pcpu[td->td_oncpu]; /* pcpu_find(td->td_oncpu); */ - rm_tracker_remove(pc,tracker); + rm_tracker_remove(pc, tracker); td->td_critnest--; td->td_pinned--; /* sched_unpin(); */ - if (0 == (td->td_owepreempt | tracker->rmp_flags)) + if (0 == (td->td_owepreempt | tracker->rmp_flags)) return; - - _rm_unlock_hard(td,tracker); - - + _rm_unlock_hard(td, tracker); } - void _rm_wlock(struct rmlock *rm) { @@ -386,53 +372,46 @@ rm->rm_noreadtoken = 1; - /* - * Assumes rm->rm_noreadtoken update is visible - * on other CPUs before rm_cleanIPI is called + /* + * Assumes rm->rm_noreadtoken update is visible on other CPUs + * before rm_cleanIPI is called. */ #ifdef SMP smp_rendezvous(smp_no_rendevous_barrier, rm_cleanIPI, - smp_no_rendevous_barrier - ,rm); + smp_no_rendevous_barrier, + rm); #else rm_cleanIPI(rm); #endif - mtx_lock_spin(&rm_spinlock); - - while((prio = LIST_FIRST(&rm->rm_activeReaders)) != NULL) { + while ((prio = LIST_FIRST(&rm->rm_activeReaders)) != NULL) { ts = turnstile_trywait(&rm->lock_object); prio->rmp_flags = RMPF_ONQUEUE | RMPF_SIGNAL; mtx_unlock_spin(&rm_spinlock); - turnstile_wait(ts,prio->rmp_thread, - TS_EXCLUSIVE_QUEUE); + turnstile_wait(ts, prio->rmp_thread, + TS_EXCLUSIVE_QUEUE); mtx_lock_spin(&rm_spinlock); - } - mtx_unlock_spin(&rm_spinlock); } - } - void _rm_wunlock(struct rmlock *rm) { + mtx_unlock(&rm->rm_lock); } - #ifdef LOCK_DEBUG void _rm_wlock_debug(struct rmlock *rm, const char *file, int line) { - - WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER | LOP_EXCLUSIVE, + WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL); _rm_wlock(rm); @@ -445,71 +424,75 @@ } -void _rm_wunlock_debug(struct rmlock *rm, const char *file, int line) +void +_rm_wunlock_debug(struct rmlock *rm, const char *file, int line) { + curthread->td_locks--; WITNESS_UNLOCK(&rm->lock_object, LOP_EXCLUSIVE, file, line); LOCK_LOG_LOCK("RMWUNLOCK", &rm->lock_object, 0, 0, file, line); _rm_wunlock(rm); -} +} - -void +void _rm_rlock_debug(struct rmlock *rm, struct rm_priotracker *tracker, const char *file, int line) { + WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER, file, line, NULL); - WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER , file, line, NULL); - _rm_rlock(rm, tracker); LOCK_LOG_LOCK("RMRLOCK", &rm->lock_object, 0, 0, file, line); - WITNESS_LOCK(&rm->lock_object, 0 , file, line); + WITNESS_LOCK(&rm->lock_object, 0, file, line); - curthread->td_locks++; + curthread->td_locks++; } -void +void _rm_runlock_debug(struct rmlock *rm, struct rm_priotracker *tracker, - const char *file, int line) { + const char *file, int line) +{ + curthread->td_locks--; - WITNESS_UNLOCK(&rm->lock_object, 0 , file, line); + WITNESS_UNLOCK(&rm->lock_object, 0, file, line); LOCK_LOG_LOCK("RMRUNLOCK", &rm->lock_object, 0, 0, file, line); _rm_runlock(rm, tracker); } - - - #else -/* - * Just strip out file and line arguments if no lock debugging is enabled - * in the kernel - we are called from a kernel module. -*/ +/* + * Just strip out file and line arguments if no lock debugging is enabled in + * the kernel - we are called from a kernel module. + */ +void +_rm_wlock_debug(struct rmlock *rm, const char *file, int line) +{ -void _rm_wlock_debug(struct rmlock *rm, const char *file, int line) -{ _rm_wlock(rm); } -void _rm_wunlock_debug(struct rmlock *rm, const char *file, int line) +void +_rm_wunlock_debug(struct rmlock *rm, const char *file, int line) { + _rm_wunlock(rm); -} - -void +} + +void _rm_rlock_debug(struct rmlock *rm, struct rm_priotracker *tracker, const char *file, int line) { + _rm_rlock(rm, tracker); } -void +void _rm_runlock_debug(struct rmlock *rm, struct rm_priotracker *tracker, const char *file, int line) { + _rm_runlock(rm, tracker); } ==== //depot/projects/vimage-commit2/src/sys/net/if_loop.c#27 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)if_loop.c 8.2 (Berkeley) 1/9/95 - * $FreeBSD: src/sys/net/if_loop.c,v 1.131 2009/04/16 20:30:28 kmacy Exp $ + * $FreeBSD: src/sys/net/if_loop.c,v 1.132 2009/04/26 22:06:42 zec Exp $ */ /* ==== //depot/projects/vimage-commit2/src/sys/net/route.c#36 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)route.c 8.3.1.1 (Berkeley) 2/23/95 - * $FreeBSD: src/sys/net/route.c,v 1.153 2009/04/14 23:05:36 kmacy Exp $ + * $FreeBSD: src/sys/net/route.c,v 1.154 2009/04/26 22:06:42 zec Exp $ */ /************************************************************************ * Note: In this file a 'fib' is a "forwarding information base" * ==== //depot/projects/vimage-commit2/src/sys/net/rtsock.c#24 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)rtsock.c 8.7 (Berkeley) 10/12/95 - * $FreeBSD: src/sys/net/rtsock.c,v 1.169 2009/04/20 23:23:31 rwatson Exp $ + * $FreeBSD: src/sys/net/rtsock.c,v 1.170 2009/04/26 22:06:42 zec Exp $ */ #include "opt_sctp.h" #include "opt_mpath.h" ==== //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_adhoc.c#7 (text+ko) ==== @@ -25,7 +25,7 @@ #include #ifdef __FreeBSD__ -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_adhoc.c,v 1.10 2009/03/24 20:39:08 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_adhoc.c,v 1.13 2009/04/26 21:50:21 sam Exp $"); #endif /* @@ -74,6 +74,7 @@ int subtype, int rssi, int noise, uint32_t rstamp); static void ahdemo_recv_mgmt(struct ieee80211_node *, struct mbuf *, int subtype, int rssi, int noise, uint32_t rstamp); +static void adhoc_recv_ctl(struct ieee80211_node *, struct mbuf *, int subtype); void ieee80211_adhoc_attach(struct ieee80211com *ic) @@ -101,6 +102,7 @@ vap->iv_recv_mgmt = adhoc_recv_mgmt; else vap->iv_recv_mgmt = ahdemo_recv_mgmt; + vap->iv_recv_ctl = adhoc_recv_ctl; vap->iv_opdetach = adhoc_vdetach; #ifdef IEEE80211_SUPPORT_TDMA /* @@ -339,7 +341,8 @@ if ((wh->i_fc[0] & IEEE80211_FC0_VERSION_MASK) != IEEE80211_FC0_VERSION_0) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, - ni->ni_macaddr, NULL, "wrong version %x", wh->i_fc[0]); + ni->ni_macaddr, NULL, "wrong version, fc %02x:%02x", + wh->i_fc[0], wh->i_fc[1]); vap->iv_stats.is_rx_badversion++; goto err; } @@ -637,15 +640,13 @@ vap->iv_stats.is_rx_mgtdiscard++; /* XXX */ goto out; } - if (bpf_peers_present(vap->iv_rawbpf)) - bpf_mtap(vap->iv_rawbpf, m); vap->iv_recv_mgmt(ni, m, subtype, rssi, noise, rstamp); - m_freem(m); - return IEEE80211_FC0_TYPE_MGT; + goto out; case IEEE80211_FC0_TYPE_CTL: vap->iv_stats.is_rx_ctl++; IEEE80211_NODE_STAT(ni, rx_ctrl); + vap->iv_recv_ctl(ni, m, subtype); goto out; default: IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY, @@ -657,7 +658,7 @@ ifp->if_ierrors++; out: if (m != NULL) { - if (bpf_peers_present(vap->iv_rawbpf) && need_tap) + if (need_tap && bpf_peers_present(vap->iv_rawbpf)) bpf_mtap(vap->iv_rawbpf, m); m_freem(m); } @@ -924,3 +925,8 @@ else vap->iv_stats.is_rx_mgtdiscard++; } + +static void +adhoc_recv_ctl(struct ieee80211_node *ni, struct mbuf *m0, int subtype) +{ +} ==== //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_hostap.c#10 (text+ko) ==== @@ -25,7 +25,7 @@ #include #ifdef __FreeBSD__ -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_hostap.c,v 1.16 2009/03/30 21:53:27 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_hostap.c,v 1.19 2009/04/26 21:50:21 sam Exp $"); #endif /* @@ -72,6 +72,7 @@ struct ieee80211_node *, struct mbuf *); static void hostap_recv_mgmt(struct ieee80211_node *, struct mbuf *, int subtype, int rssi, int noise, uint32_t rstamp); +static void hostap_recv_ctl(struct ieee80211_node *, struct mbuf *, int); static void hostap_recv_pspoll(struct ieee80211_node *, struct mbuf *); void @@ -96,6 +97,7 @@ vap->iv_newstate = hostap_newstate; vap->iv_input = hostap_input; vap->iv_recv_mgmt = hostap_recv_mgmt; + vap->iv_recv_ctl = hostap_recv_ctl; vap->iv_opdetach = hostap_vdetach; vap->iv_deliver_data = hostap_deliver_data; } @@ -473,7 +475,8 @@ if ((wh->i_fc[0] & IEEE80211_FC0_VERSION_MASK) != IEEE80211_FC0_VERSION_0) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, - ni->ni_macaddr, NULL, "wrong version %x", wh->i_fc[0]); + ni->ni_macaddr, NULL, "wrong version, fc %02x:%02x", + wh->i_fc[0], wh->i_fc[1]); vap->iv_stats.is_rx_badversion++; goto err; } @@ -831,23 +834,13 @@ wh = mtod(m, struct ieee80211_frame *); wh->i_fc[1] &= ~IEEE80211_FC1_WEP; } - if (bpf_peers_present(vap->iv_rawbpf)) - bpf_mtap(vap->iv_rawbpf, m); vap->iv_recv_mgmt(ni, m, subtype, rssi, noise, rstamp); - m_freem(m); - return IEEE80211_FC0_TYPE_MGT; + goto out; case IEEE80211_FC0_TYPE_CTL: vap->iv_stats.is_rx_ctl++; IEEE80211_NODE_STAT(ni, rx_ctrl); - switch (subtype) { - case IEEE80211_FC0_SUBTYPE_PS_POLL: - hostap_recv_pspoll(ni, m); - break; - case IEEE80211_FC0_SUBTYPE_BAR: - ieee80211_recv_bar(ni, m); - break; - } + vap->iv_recv_ctl(ni, m, subtype); goto out; default: IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY, @@ -859,7 +852,7 @@ ifp->if_ierrors++; out: if (m != NULL) { - if (bpf_peers_present(vap->iv_rawbpf) && need_tap) + if (need_tap && bpf_peers_present(vap->iv_rawbpf)) bpf_mtap(vap->iv_rawbpf, m); m_freem(m); } @@ -2165,6 +2158,19 @@ } } +static void +hostap_recv_ctl(struct ieee80211_node *ni, struct mbuf *m, int subtype) +{ + switch (subtype) { + case IEEE80211_FC0_SUBTYPE_PS_POLL: + hostap_recv_pspoll(ni, m); + break; + case IEEE80211_FC0_SUBTYPE_BAR: + ieee80211_recv_bar(ni, m); + break; + } +} + /* * Process a received ps-poll frame. */ ==== //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_ioctl.c#9 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_ioctl.c,v 1.84 2009/03/29 21:17:08 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_ioctl.c,v 1.85 2009/04/26 20:55:31 sam Exp $"); /* * IEEE 802.11 ioctl support (FreeBSD-specific) @@ -915,10 +915,13 @@ case IEEE80211_IOC_BSSID: if (ireq->i_len != IEEE80211_ADDR_LEN) return EINVAL; - error = copyout(vap->iv_state == IEEE80211_S_RUN ? - vap->iv_bss->ni_bssid : - vap->iv_des_bssid, - ireq->i_data, ireq->i_len); + if (vap->iv_state == IEEE80211_S_RUN) { + error = copyout(vap->iv_opmode == IEEE80211_M_WDS ? + vap->iv_bss->ni_macaddr : vap->iv_bss->ni_bssid, + ireq->i_data, ireq->i_len); + } else + error = copyout(vap->iv_des_bssid, ireq->i_data, + ireq->i_len); break; case IEEE80211_IOC_WPAIE: error = ieee80211_ioctl_getwpaie(vap, ireq, ireq->i_type); ==== //depot/projects/vimage-commit2/src/sys/net80211/ieee80211_output.c#12 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.84 2009/04/16 20:30:28 kmacy Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.90 2009/04/26 21:37:02 sam Exp $"); #include "opt_inet.h" #include "opt_wlan.h" @@ -273,6 +273,10 @@ */ m->m_pkthdr.rcvif = (void *)ni; + /* XXX fragmented frames not handled */ + if (bpf_peers_present(vap->iv_rawbpf)) + bpf_mtap(vap->iv_rawbpf, m); + error = parent->if_transmit(parent, m); if (error != 0) { /* NB: IFQ_HANDOFF reclaims mbuf */ @@ -288,9 +292,7 @@ /* * 802.11 output routine. This is (currently) used only to * connect bpf write calls to the 802.11 layer for injecting - * raw 802.11 frames. Note we locate the ieee80211com from - * the ifnet using a spare field setup at attach time. This - * will go away when the virtual ap support comes in. + * raw 802.11 frames. */ int ieee80211_output(struct ifnet *ifp, struct mbuf *m, @@ -384,7 +386,17 @@ if (ieee80211_classify(ni, m)) senderr(EIO); /* XXX */ - BPF_MTAP(ifp, m); + if (bpf_peers_present(vap->iv_rawbpf)) + bpf_mtap(vap->iv_rawbpf, m); + + IEEE80211_NODE_STAT(ni, tx_data); + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { + IEEE80211_NODE_STAT(ni, tx_mcast); + m->m_flags |= M_MCAST; + } else + IEEE80211_NODE_STAT(ni, tx_ucast); + /* NB: ieee80211_encap does not include 802.11 header */ + IEEE80211_NODE_STAT_ADD(ni, tx_bytes, m->m_pkthdr.len); /* * NB: DLT_IEEE802_11_RADIO identifies the parameters are @@ -412,13 +424,15 @@ static void ieee80211_send_setup( struct ieee80211_node *ni, - struct ieee80211_frame *wh, + struct mbuf *m, int type, int tid, const uint8_t sa[IEEE80211_ADDR_LEN], const uint8_t da[IEEE80211_ADDR_LEN], const uint8_t bssid[IEEE80211_ADDR_LEN]) { #define WH4(wh) ((struct ieee80211_frame_addr4 *)wh) + struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); + ieee80211_seq seqno; wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | type; if ((type & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_DATA) { @@ -461,9 +475,12 @@ IEEE80211_ADDR_COPY(wh->i_addr3, bssid); } *(uint16_t *)&wh->i_dur[0] = 0; - *(uint16_t *)&wh->i_seq[0] = - htole16(ni->ni_txseqs[tid] << IEEE80211_SEQ_SEQ_SHIFT); - ni->ni_txseqs[tid]++; + + seqno = ni->ni_txseqs[tid]++; + *(uint16_t *)&wh->i_seq[0] = htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); + + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + m->m_flags |= M_MCAST; #undef WH4 } @@ -504,7 +521,7 @@ } wh = mtod(m, struct ieee80211_frame *); - ieee80211_send_setup(ni, wh, + ieee80211_send_setup(ni, m, IEEE80211_FC0_TYPE_MGT | type, IEEE80211_NONQOS_TID, vap->iv_myaddr, ni->ni_macaddr, ni->ni_bssid); if (params->ibp_flags & IEEE80211_BPF_CRYPTO) { @@ -595,7 +612,7 @@ const int tid = WME_AC_TO_TID(WME_AC_BE); uint8_t *qos; - ieee80211_send_setup(ni, wh, >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Sun Apr 26 22:27:46 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 42AE91065675; Sun, 26 Apr 2009 22:27:46 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02058106564A for ; Sun, 26 Apr 2009 22:27:45 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id AD87F8FC17 for ; Sun, 26 Apr 2009 22:27:45 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3QMRjBd061680 for ; Sun, 26 Apr 2009 22:27:45 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3QMRjab061678 for perforce@freebsd.org; Sun, 26 Apr 2009 22:27:45 GMT (envelope-from zec@fer.hr) Date: Sun, 26 Apr 2009 22:27:45 GMT Message-Id: <200904262227.n3QMRjab061678@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 161150 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 22:27:47 -0000 http://perforce.freebsd.org/chv.cgi?CH=161150 Change 161150 by zec@zec_amdx2 on 2009/04/26 22:26:59 IFC @ 161147 Affected files ... .. //depot/projects/vimage/src/sys/compat/linux/linux_socket.c#17 integrate .. //depot/projects/vimage/src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c#17 integrate .. //depot/projects/vimage/src/sys/dev/ata/atapi-tape.c#9 integrate .. //depot/projects/vimage/src/sys/kern/kern_rmlock.c#3 integrate .. //depot/projects/vimage/src/sys/net/if_loop.c#45 integrate .. //depot/projects/vimage/src/sys/net/route.c#48 integrate .. //depot/projects/vimage/src/sys/net/rtsock.c#32 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_adhoc.c#9 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_hostap.c#10 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_ioctl.c#22 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_output.c#23 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_sta.c#9 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_superg.c#2 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_var.h#25 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_wds.c#9 integrate .. //depot/projects/vimage/src/sys/netinet/igmp.c#34 integrate .. //depot/projects/vimage/src/sys/netinet/in.c#33 integrate .. //depot/projects/vimage/src/sys/netinet/in_mcast.c#25 integrate .. //depot/projects/vimage/src/sys/netinet/in_rmx.c#32 integrate .. //depot/projects/vimage/src/sys/netinet/ip_carp.c#22 integrate .. //depot/projects/vimage/src/sys/netinet/ip_divert.c#29 integrate .. //depot/projects/vimage/src/sys/netinet/ip_fw2.c#74 integrate .. //depot/projects/vimage/src/sys/netinet/ip_mroute.c#21 integrate .. //depot/projects/vimage/src/sys/netinet/tcp_subr.c#81 integrate .. //depot/projects/vimage/src/sys/netinet/tcp_timewait.c#31 integrate .. //depot/projects/vimage/src/sys/netinet/udp_usrreq.c#52 integrate .. //depot/projects/vimage/src/sys/netinet6/in6_rmx.c#33 integrate .. //depot/projects/vimage/src/sys/netinet6/nd6_rtr.c#34 integrate .. //depot/projects/vimage/src/sys/netipx/spx_usrreq.c#5 integrate .. //depot/projects/vimage/src/sys/sys/mbuf.h#18 integrate .. //depot/projects/vimage/src/sys/sys/queue.h#3 integrate .. //depot/projects/vimage/src/sys/vm/swap_pager.c#18 integrate .. //depot/projects/vimage/src/sys/vm/vm_fault.c#15 integrate Differences ... ==== //depot/projects/vimage/src/sys/compat/linux/linux_socket.c#17 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.80 2008/12/02 21:37:28 bz Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_socket.c,v 1.81 2009/04/26 22:06:42 zec Exp $"); /* XXX we use functions that might not exist. */ #include "opt_compat.h" @@ -583,9 +583,11 @@ static int linux_socket(struct thread *td, struct linux_socket_args *args) { -#if defined(INET6) && !defined(KLD_MODULE) +#ifdef INET6 +#ifndef KLD_MODULE INIT_VNET_INET6(curvnet); #endif +#endif struct socket_args /* { int domain; int type; ==== //depot/projects/vimage/src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c#17 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c,v 1.16 2009/04/16 20:30:28 kmacy Exp $ */ +/* $FreeBSD: src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c,v 1.17 2009/04/26 22:06:42 zec Exp $ */ /* * Copyright (C) 1993-2003 by Darren Reed. @@ -213,6 +213,7 @@ int ipfattach() { + INIT_VNET_INET(curvnet); #ifdef USE_SPL int s; #endif @@ -266,6 +267,7 @@ */ int ipfdetach() { + INIT_VNET_INET(curvnet); #ifdef USE_SPL int s; #endif ==== //depot/projects/vimage/src/sys/dev/ata/atapi-tape.c#9 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-tape.c,v 1.113 2009/02/28 22:07:15 mav Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-tape.c,v 1.114 2009/04/26 09:21:37 ed Exp $"); #include "opt_ata.h" #include @@ -138,15 +138,13 @@ DEVSTAT_NO_ORDERED_TAGS, DEVSTAT_TYPE_SEQUENTIAL | DEVSTAT_TYPE_IF_IDE, DEVSTAT_PRIORITY_TAPE); - device = make_dev(&ast_cdevsw, 2 * device_get_unit(dev), - UID_ROOT, GID_OPERATOR, 0640, "ast%d", - device_get_unit(dev)); + device = make_dev(&ast_cdevsw, 0, UID_ROOT, GID_OPERATOR, 0640, + "ast%d", device_get_unit(dev)); device->si_drv1 = dev; device->si_iosize_max = ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS; stp->dev1 = device; - device = make_dev(&ast_cdevsw, 2 * device_get_unit(dev) + 1, - UID_ROOT, GID_OPERATOR, 0640, "nast%d", - device_get_unit(dev)); + device = make_dev(&ast_cdevsw, 1, UID_ROOT, GID_OPERATOR, 0640, + "nast%d", device_get_unit(dev)); device->si_drv1 = dev; device->si_iosize_max = ch->dma.max_iosize; stp->dev2 = device; @@ -238,8 +236,8 @@ (stp->flags & (F_DATA_WRITTEN | F_FM_WRITTEN)) == F_DATA_WRITTEN) ast_write_filemark(dev, ATAPI_WF_WRITE); - /* if minor is even rewind on close */ - if (!(dev2unit(cdev) & 0x01)) + /* if unit is zero rewind on close */ + if (dev2unit(cdev) == 0) ast_rewind(dev); if (stp->cap.lock && count_dev(cdev) == 1) ==== //depot/projects/vimage/src/sys/kern/kern_rmlock.c#3 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_rmlock.c,v 1.4 2008/09/10 19:13:30 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_rmlock.c,v 1.5 2009/04/26 21:16:03 rwatson Exp $"); #include "opt_ddb.h" @@ -55,25 +55,23 @@ #ifdef DDB #include #endif - + #define RMPF_ONQUEUE 1 #define RMPF_SIGNAL 2 -/* - * To support usage of rmlock in CVs and msleep - * yet another list for the priority tracker - * would be needed. - * Using this lock for cv and msleep also does - * not seem very useful +/* + * To support usage of rmlock in CVs and msleep yet another list for the + * priority tracker would be needed. Using this lock for cv and msleep also + * does not seem very useful */ static __inline void compiler_memory_barrier(void) { __asm __volatile("":::"memory"); } -static void assert_rm(struct lock_object *lock, int what); -static void lock_rm(struct lock_object *lock, int how); -static int unlock_rm(struct lock_object *lock); +static void assert_rm(struct lock_object *lock, int what); +static void lock_rm(struct lock_object *lock, int how); +static int unlock_rm(struct lock_object *lock); struct lock_class lock_class_rm = { .lc_name = "rm", @@ -96,12 +94,16 @@ } static void -lock_rm(struct lock_object *lock, int how) { +lock_rm(struct lock_object *lock, int how) +{ + panic("lock_rm called"); } static int -unlock_rm(struct lock_object *lock) { +unlock_rm(struct lock_object *lock) +{ + panic("unlock_rm called"); } @@ -111,75 +113,79 @@ /* * Add or remove tracker from per cpu list. - * The per cpu list can be traversed at any time in forward - * direction from an interrupt on the *local* cpu. + * + * The per cpu list can be traversed at any time in forward direction from an + * interrupt on the *local* cpu. */ - -static void inline -rm_tracker_add(struct pcpu *pc, struct rm_priotracker* tracker) { - struct rm_queue* next; +static void inline +rm_tracker_add(struct pcpu *pc, struct rm_priotracker *tracker) +{ + struct rm_queue *next; + /* Initialize all tracker pointers */ tracker->rmp_cpuQueue.rmq_prev = &pc->pc_rm_queue; next = pc->pc_rm_queue.rmq_next; tracker->rmp_cpuQueue.rmq_next = next; - /* rmq_prev is not used during froward traversal */ + + /* rmq_prev is not used during froward traversal. */ next->rmq_prev = &tracker->rmp_cpuQueue; - /* Update pointer to first element */ + + /* Update pointer to first element. */ pc->pc_rm_queue.rmq_next = &tracker->rmp_cpuQueue; } +static void inline +rm_tracker_remove(struct pcpu *pc, struct rm_priotracker *tracker) +{ + struct rm_queue *next, *prev; -static void inline -rm_tracker_remove(struct pcpu *pc, struct rm_priotracker* tracker) { - struct rm_queue *next, *prev; - next = tracker->rmp_cpuQueue.rmq_next; - prev = tracker->rmp_cpuQueue.rmq_prev; - /* Not used during forward traversal */ + next = tracker->rmp_cpuQueue.rmq_next; + prev = tracker->rmp_cpuQueue.rmq_prev; + + /* Not used during forward traversal. */ next->rmq_prev = prev; - /* Remove from list */ + + /* Remove from list. */ prev->rmq_next = next; } - - - -static void rm_cleanIPI(void *arg) { +static void +rm_cleanIPI(void *arg) +{ struct pcpu *pc; - struct rmlock* rm = arg; + struct rmlock *rm = arg; struct rm_priotracker *tracker; - struct rm_queue* queue; + struct rm_queue *queue; pc = pcpu_find(curcpu); - for(queue = pc->pc_rm_queue.rmq_next; - queue != &pc->pc_rm_queue; + for (queue = pc->pc_rm_queue.rmq_next; queue != &pc->pc_rm_queue; queue = queue->rmq_next) { - tracker = (struct rm_priotracker *) queue; - if(tracker->rmp_rmlock == rm && tracker->rmp_flags == 0 ) { + tracker = (struct rm_priotracker *)queue; + if (tracker->rmp_rmlock == rm && tracker->rmp_flags == 0) { tracker->rmp_flags = RMPF_ONQUEUE; mtx_lock_spin(&rm_spinlock); - LIST_INSERT_HEAD(&rm->rm_activeReaders,tracker, + LIST_INSERT_HEAD(&rm->rm_activeReaders, tracker, rmp_qentry); mtx_unlock_spin(&rm_spinlock); } } - return; } - - void rm_init(struct rmlock *rm, const char *name, int opts) { + rm->rm_noreadtoken = 1; LIST_INIT(&rm->rm_activeReaders); mtx_init(&rm->rm_lock, name, "RM_MTX",MTX_NOWITNESS); - lock_init(&rm->lock_object, &lock_class_rm, name, NULL, (opts & LO_RECURSABLE)| LO_WITNESS); - + lock_init(&rm->lock_object, &lock_class_rm, name, NULL, + (opts & LO_RECURSABLE)| LO_WITNESS); } void rm_destroy(struct rmlock *rm) { + mtx_destroy(&rm->rm_lock); lock_destroy(&rm->lock_object); } @@ -194,71 +200,64 @@ void rm_sysinit(void *arg) { + struct rm_args *args = arg; rm_init(args->ra_rm, args->ra_desc, args->ra_opts); } - static void -_rm_rlock_hard(struct rmlock *rm, struct rm_priotracker* tracker) +_rm_rlock_hard(struct rmlock *rm, struct rm_priotracker *tracker) { struct pcpu *pc; struct rm_queue *queue; - struct rm_priotracker* atracker; + struct rm_priotracker *atracker; critical_enter(); pc = pcpu_find(curcpu); - /* Check if we just need to do a proper critical_exit */ + /* Check if we just need to do a proper critical_exit. */ if (0 == rm->rm_noreadtoken) { critical_exit(); return; } - /* Remove our tracker from the per cpu list */ - rm_tracker_remove(pc,tracker); + /* Remove our tracker from the per cpu list. */ + rm_tracker_remove(pc, tracker); - /* Check to see if the IPI granted us the lock after all */ - if(tracker->rmp_flags) { - /* Just add back tracker - we hold the lock */ - rm_tracker_add(pc,tracker); + /* Check to see if the IPI granted us the lock after all. */ + if (tracker->rmp_flags) { + /* Just add back tracker - we hold the lock. */ + rm_tracker_add(pc, tracker); critical_exit(); return; } - - /* - * We allow readers to aquire a lock even if a writer - * is blocked if the lock is recursive and the reader - * already holds the lock + * We allow readers to aquire a lock even if a writer is blocked if + * the lock is recursive and the reader already holds the lock. */ - if ((rm->lock_object.lo_flags & LO_RECURSABLE) != 0) { /* * Just grand the lock if this thread already have a tracker - * for this lock on the per cpu queue + * for this lock on the per cpu queue. */ - - for(queue = pc->pc_rm_queue.rmq_next; - queue != &pc->pc_rm_queue; - queue = queue->rmq_next) { - atracker = (struct rm_priotracker *) queue; - if (( atracker->rmp_rmlock == rm) && - ( atracker->rmp_thread == tracker->rmp_thread )) { + for (queue = pc->pc_rm_queue.rmq_next; + queue != &pc->pc_rm_queue; queue = queue->rmq_next) { + atracker = (struct rm_priotracker *)queue; + if ((atracker->rmp_rmlock == rm) && + (atracker->rmp_thread == tracker->rmp_thread)) { mtx_lock_spin(&rm_spinlock); - LIST_INSERT_HEAD(&rm->rm_activeReaders,tracker, - rmp_qentry); + LIST_INSERT_HEAD(&rm->rm_activeReaders, + tracker, rmp_qentry); tracker->rmp_flags = RMPF_ONQUEUE; mtx_unlock_spin(&rm_spinlock); - rm_tracker_add(pc,tracker); + rm_tracker_add(pc, tracker); critical_exit(); return; } } } - sched_unpin(); critical_exit(); @@ -267,16 +266,15 @@ critical_enter(); pc = pcpu_find(curcpu); - rm_tracker_add(pc,tracker); + rm_tracker_add(pc, tracker); sched_pin(); critical_exit(); - + mtx_unlock(&rm->rm_lock); - return; } void -_rm_rlock(struct rmlock *rm, struct rm_priotracker* tracker) +_rm_rlock(struct rmlock *rm, struct rm_priotracker *tracker) { struct thread *td = curthread; struct pcpu *pc; @@ -291,51 +289,46 @@ pc = cpuid_to_pcpu[td->td_oncpu]; /* pcpu_find(td->td_oncpu); */ - rm_tracker_add(pc,tracker); + rm_tracker_add(pc, tracker); td->td_pinned++; /* sched_pin(); */ compiler_memory_barrier(); td->td_critnest--; - - /* - * Fast path to combine two common conditions - * into a single conditional jump + + /* + * Fast path to combine two common conditions into a single + * conditional jump. */ - - if (0 == (td->td_owepreempt | rm->rm_noreadtoken)) { + if (0 == (td->td_owepreempt | rm->rm_noreadtoken)) return; - } - /* We do not have a read token and need to acquire one */ - _rm_rlock_hard(rm,tracker); + /* We do not have a read token and need to acquire one. */ + _rm_rlock_hard(rm, tracker); } - static void -_rm_unlock_hard(struct thread *td,struct rm_priotracker* tracker) +_rm_unlock_hard(struct thread *td,struct rm_priotracker *tracker) { - + if (td->td_owepreempt) { td->td_critnest++; critical_exit(); } - - if (!tracker->rmp_flags) { + + if (!tracker->rmp_flags) return; - } - mtx_lock_spin(&rm_spinlock); - LIST_REMOVE(tracker,rmp_qentry); + LIST_REMOVE(tracker, rmp_qentry); if (tracker->rmp_flags & RMPF_SIGNAL) { struct rmlock *rm; - struct turnstile* ts; + struct turnstile *ts; rm = tracker->rmp_rmlock; - + turnstile_chain_lock(&rm->lock_object); mtx_unlock_spin(&rm_spinlock); @@ -344,35 +337,28 @@ turnstile_signal(ts, TS_EXCLUSIVE_QUEUE); turnstile_unpend(ts, TS_EXCLUSIVE_LOCK); turnstile_chain_unlock(&rm->lock_object); - - } else mtx_unlock_spin(&rm_spinlock); - -} +} void -_rm_runlock(struct rmlock *rm, struct rm_priotracker* tracker) +_rm_runlock(struct rmlock *rm, struct rm_priotracker *tracker) { struct pcpu *pc; struct thread *td = tracker->rmp_thread; td->td_critnest++; /* critical_enter(); */ pc = cpuid_to_pcpu[td->td_oncpu]; /* pcpu_find(td->td_oncpu); */ - rm_tracker_remove(pc,tracker); + rm_tracker_remove(pc, tracker); td->td_critnest--; td->td_pinned--; /* sched_unpin(); */ - if (0 == (td->td_owepreempt | tracker->rmp_flags)) + if (0 == (td->td_owepreempt | tracker->rmp_flags)) return; - - _rm_unlock_hard(td,tracker); - - + _rm_unlock_hard(td, tracker); } - void _rm_wlock(struct rmlock *rm) { @@ -386,53 +372,46 @@ rm->rm_noreadtoken = 1; - /* - * Assumes rm->rm_noreadtoken update is visible - * on other CPUs before rm_cleanIPI is called + /* + * Assumes rm->rm_noreadtoken update is visible on other CPUs + * before rm_cleanIPI is called. */ #ifdef SMP smp_rendezvous(smp_no_rendevous_barrier, rm_cleanIPI, - smp_no_rendevous_barrier - ,rm); + smp_no_rendevous_barrier, + rm); #else rm_cleanIPI(rm); #endif - mtx_lock_spin(&rm_spinlock); - - while((prio = LIST_FIRST(&rm->rm_activeReaders)) != NULL) { + while ((prio = LIST_FIRST(&rm->rm_activeReaders)) != NULL) { ts = turnstile_trywait(&rm->lock_object); prio->rmp_flags = RMPF_ONQUEUE | RMPF_SIGNAL; mtx_unlock_spin(&rm_spinlock); - turnstile_wait(ts,prio->rmp_thread, - TS_EXCLUSIVE_QUEUE); + turnstile_wait(ts, prio->rmp_thread, + TS_EXCLUSIVE_QUEUE); mtx_lock_spin(&rm_spinlock); - } - mtx_unlock_spin(&rm_spinlock); } - } - void _rm_wunlock(struct rmlock *rm) { + mtx_unlock(&rm->rm_lock); } - #ifdef LOCK_DEBUG void _rm_wlock_debug(struct rmlock *rm, const char *file, int line) { - - WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER | LOP_EXCLUSIVE, + WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL); _rm_wlock(rm); @@ -445,71 +424,75 @@ } -void _rm_wunlock_debug(struct rmlock *rm, const char *file, int line) +void +_rm_wunlock_debug(struct rmlock *rm, const char *file, int line) { + curthread->td_locks--; WITNESS_UNLOCK(&rm->lock_object, LOP_EXCLUSIVE, file, line); LOCK_LOG_LOCK("RMWUNLOCK", &rm->lock_object, 0, 0, file, line); _rm_wunlock(rm); -} +} - -void +void _rm_rlock_debug(struct rmlock *rm, struct rm_priotracker *tracker, const char *file, int line) { + WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER, file, line, NULL); - WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER , file, line, NULL); - _rm_rlock(rm, tracker); LOCK_LOG_LOCK("RMRLOCK", &rm->lock_object, 0, 0, file, line); - WITNESS_LOCK(&rm->lock_object, 0 , file, line); + WITNESS_LOCK(&rm->lock_object, 0, file, line); - curthread->td_locks++; + curthread->td_locks++; } -void +void _rm_runlock_debug(struct rmlock *rm, struct rm_priotracker *tracker, - const char *file, int line) { + const char *file, int line) +{ + curthread->td_locks--; - WITNESS_UNLOCK(&rm->lock_object, 0 , file, line); + WITNESS_UNLOCK(&rm->lock_object, 0, file, line); LOCK_LOG_LOCK("RMRUNLOCK", &rm->lock_object, 0, 0, file, line); _rm_runlock(rm, tracker); } - - - #else -/* - * Just strip out file and line arguments if no lock debugging is enabled - * in the kernel - we are called from a kernel module. -*/ +/* + * Just strip out file and line arguments if no lock debugging is enabled in + * the kernel - we are called from a kernel module. + */ +void +_rm_wlock_debug(struct rmlock *rm, const char *file, int line) +{ -void _rm_wlock_debug(struct rmlock *rm, const char *file, int line) -{ _rm_wlock(rm); } -void _rm_wunlock_debug(struct rmlock *rm, const char *file, int line) +void +_rm_wunlock_debug(struct rmlock *rm, const char *file, int line) { + _rm_wunlock(rm); -} - -void +} + +void _rm_rlock_debug(struct rmlock *rm, struct rm_priotracker *tracker, const char *file, int line) { + _rm_rlock(rm, tracker); } -void +void _rm_runlock_debug(struct rmlock *rm, struct rm_priotracker *tracker, const char *file, int line) { + _rm_runlock(rm, tracker); } ==== //depot/projects/vimage/src/sys/net/if_loop.c#45 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)if_loop.c 8.2 (Berkeley) 1/9/95 - * $FreeBSD: src/sys/net/if_loop.c,v 1.131 2009/04/16 20:30:28 kmacy Exp $ + * $FreeBSD: src/sys/net/if_loop.c,v 1.132 2009/04/26 22:06:42 zec Exp $ */ /* ==== //depot/projects/vimage/src/sys/net/route.c#48 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)route.c 8.3.1.1 (Berkeley) 2/23/95 - * $FreeBSD: src/sys/net/route.c,v 1.153 2009/04/14 23:05:36 kmacy Exp $ + * $FreeBSD: src/sys/net/route.c,v 1.154 2009/04/26 22:06:42 zec Exp $ */ /************************************************************************ * Note: In this file a 'fib' is a "forwarding information base" * ==== //depot/projects/vimage/src/sys/net/rtsock.c#32 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)rtsock.c 8.7 (Berkeley) 10/12/95 - * $FreeBSD: src/sys/net/rtsock.c,v 1.169 2009/04/20 23:23:31 rwatson Exp $ + * $FreeBSD: src/sys/net/rtsock.c,v 1.170 2009/04/26 22:06:42 zec Exp $ */ #include "opt_sctp.h" #include "opt_mpath.h" @@ -1206,7 +1206,6 @@ static void rt_dispatch(struct mbuf *m, const struct sockaddr *sa) { - INIT_VNET_NET(curvnet); struct m_tag *tag; /* ==== //depot/projects/vimage/src/sys/net80211/ieee80211_adhoc.c#9 (text+ko) ==== @@ -25,7 +25,7 @@ #include #ifdef __FreeBSD__ -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_adhoc.c,v 1.10 2009/03/24 20:39:08 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_adhoc.c,v 1.13 2009/04/26 21:50:21 sam Exp $"); #endif /* @@ -74,6 +74,7 @@ int subtype, int rssi, int noise, uint32_t rstamp); static void ahdemo_recv_mgmt(struct ieee80211_node *, struct mbuf *, int subtype, int rssi, int noise, uint32_t rstamp); +static void adhoc_recv_ctl(struct ieee80211_node *, struct mbuf *, int subtype); void ieee80211_adhoc_attach(struct ieee80211com *ic) @@ -101,6 +102,7 @@ vap->iv_recv_mgmt = adhoc_recv_mgmt; else vap->iv_recv_mgmt = ahdemo_recv_mgmt; + vap->iv_recv_ctl = adhoc_recv_ctl; vap->iv_opdetach = adhoc_vdetach; #ifdef IEEE80211_SUPPORT_TDMA /* @@ -339,7 +341,8 @@ if ((wh->i_fc[0] & IEEE80211_FC0_VERSION_MASK) != IEEE80211_FC0_VERSION_0) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, - ni->ni_macaddr, NULL, "wrong version %x", wh->i_fc[0]); + ni->ni_macaddr, NULL, "wrong version, fc %02x:%02x", + wh->i_fc[0], wh->i_fc[1]); vap->iv_stats.is_rx_badversion++; goto err; } @@ -637,15 +640,13 @@ vap->iv_stats.is_rx_mgtdiscard++; /* XXX */ goto out; } - if (bpf_peers_present(vap->iv_rawbpf)) - bpf_mtap(vap->iv_rawbpf, m); vap->iv_recv_mgmt(ni, m, subtype, rssi, noise, rstamp); - m_freem(m); - return IEEE80211_FC0_TYPE_MGT; + goto out; case IEEE80211_FC0_TYPE_CTL: vap->iv_stats.is_rx_ctl++; IEEE80211_NODE_STAT(ni, rx_ctrl); + vap->iv_recv_ctl(ni, m, subtype); goto out; default: IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY, @@ -657,7 +658,7 @@ ifp->if_ierrors++; out: if (m != NULL) { - if (bpf_peers_present(vap->iv_rawbpf) && need_tap) + if (need_tap && bpf_peers_present(vap->iv_rawbpf)) bpf_mtap(vap->iv_rawbpf, m); m_freem(m); } @@ -924,3 +925,8 @@ else vap->iv_stats.is_rx_mgtdiscard++; } + +static void +adhoc_recv_ctl(struct ieee80211_node *ni, struct mbuf *m0, int subtype) +{ +} ==== //depot/projects/vimage/src/sys/net80211/ieee80211_hostap.c#10 (text+ko) ==== @@ -25,7 +25,7 @@ #include #ifdef __FreeBSD__ -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_hostap.c,v 1.16 2009/03/30 21:53:27 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_hostap.c,v 1.19 2009/04/26 21:50:21 sam Exp $"); #endif /* @@ -72,6 +72,7 @@ struct ieee80211_node *, struct mbuf *); static void hostap_recv_mgmt(struct ieee80211_node *, struct mbuf *, int subtype, int rssi, int noise, uint32_t rstamp); +static void hostap_recv_ctl(struct ieee80211_node *, struct mbuf *, int); static void hostap_recv_pspoll(struct ieee80211_node *, struct mbuf *); void @@ -96,6 +97,7 @@ vap->iv_newstate = hostap_newstate; vap->iv_input = hostap_input; vap->iv_recv_mgmt = hostap_recv_mgmt; + vap->iv_recv_ctl = hostap_recv_ctl; vap->iv_opdetach = hostap_vdetach; vap->iv_deliver_data = hostap_deliver_data; } @@ -473,7 +475,8 @@ if ((wh->i_fc[0] & IEEE80211_FC0_VERSION_MASK) != IEEE80211_FC0_VERSION_0) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, - ni->ni_macaddr, NULL, "wrong version %x", wh->i_fc[0]); + ni->ni_macaddr, NULL, "wrong version, fc %02x:%02x", + wh->i_fc[0], wh->i_fc[1]); vap->iv_stats.is_rx_badversion++; goto err; } @@ -831,23 +834,13 @@ wh = mtod(m, struct ieee80211_frame *); wh->i_fc[1] &= ~IEEE80211_FC1_WEP; } - if (bpf_peers_present(vap->iv_rawbpf)) - bpf_mtap(vap->iv_rawbpf, m); vap->iv_recv_mgmt(ni, m, subtype, rssi, noise, rstamp); - m_freem(m); - return IEEE80211_FC0_TYPE_MGT; + goto out; case IEEE80211_FC0_TYPE_CTL: vap->iv_stats.is_rx_ctl++; IEEE80211_NODE_STAT(ni, rx_ctrl); - switch (subtype) { - case IEEE80211_FC0_SUBTYPE_PS_POLL: - hostap_recv_pspoll(ni, m); - break; - case IEEE80211_FC0_SUBTYPE_BAR: - ieee80211_recv_bar(ni, m); - break; - } + vap->iv_recv_ctl(ni, m, subtype); goto out; default: IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY, @@ -859,7 +852,7 @@ ifp->if_ierrors++; out: if (m != NULL) { - if (bpf_peers_present(vap->iv_rawbpf) && need_tap) + if (need_tap && bpf_peers_present(vap->iv_rawbpf)) bpf_mtap(vap->iv_rawbpf, m); m_freem(m); } @@ -2165,6 +2158,19 @@ } } +static void +hostap_recv_ctl(struct ieee80211_node *ni, struct mbuf *m, int subtype) +{ + switch (subtype) { + case IEEE80211_FC0_SUBTYPE_PS_POLL: + hostap_recv_pspoll(ni, m); + break; + case IEEE80211_FC0_SUBTYPE_BAR: + ieee80211_recv_bar(ni, m); + break; + } +} + /* * Process a received ps-poll frame. */ ==== //depot/projects/vimage/src/sys/net80211/ieee80211_ioctl.c#22 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_ioctl.c,v 1.84 2009/03/29 21:17:08 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_ioctl.c,v 1.85 2009/04/26 20:55:31 sam Exp $"); /* * IEEE 802.11 ioctl support (FreeBSD-specific) @@ -915,10 +915,13 @@ case IEEE80211_IOC_BSSID: if (ireq->i_len != IEEE80211_ADDR_LEN) return EINVAL; - error = copyout(vap->iv_state == IEEE80211_S_RUN ? - vap->iv_bss->ni_bssid : - vap->iv_des_bssid, - ireq->i_data, ireq->i_len); + if (vap->iv_state == IEEE80211_S_RUN) { + error = copyout(vap->iv_opmode == IEEE80211_M_WDS ? + vap->iv_bss->ni_macaddr : vap->iv_bss->ni_bssid, + ireq->i_data, ireq->i_len); + } else + error = copyout(vap->iv_des_bssid, ireq->i_data, + ireq->i_len); break; case IEEE80211_IOC_WPAIE: error = ieee80211_ioctl_getwpaie(vap, ireq, ireq->i_type); ==== //depot/projects/vimage/src/sys/net80211/ieee80211_output.c#23 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.84 2009/04/16 20:30:28 kmacy Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.90 2009/04/26 21:37:02 sam Exp $"); #include "opt_inet.h" #include "opt_wlan.h" @@ -273,6 +273,10 @@ */ m->m_pkthdr.rcvif = (void *)ni; + /* XXX fragmented frames not handled */ + if (bpf_peers_present(vap->iv_rawbpf)) + bpf_mtap(vap->iv_rawbpf, m); + error = parent->if_transmit(parent, m); if (error != 0) { /* NB: IFQ_HANDOFF reclaims mbuf */ @@ -288,9 +292,7 @@ /* * 802.11 output routine. This is (currently) used only to * connect bpf write calls to the 802.11 layer for injecting - * raw 802.11 frames. Note we locate the ieee80211com from - * the ifnet using a spare field setup at attach time. This - * will go away when the virtual ap support comes in. + * raw 802.11 frames. */ int ieee80211_output(struct ifnet *ifp, struct mbuf *m, @@ -384,7 +386,17 @@ if (ieee80211_classify(ni, m)) senderr(EIO); /* XXX */ - BPF_MTAP(ifp, m); + if (bpf_peers_present(vap->iv_rawbpf)) + bpf_mtap(vap->iv_rawbpf, m); + + IEEE80211_NODE_STAT(ni, tx_data); + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { + IEEE80211_NODE_STAT(ni, tx_mcast); + m->m_flags |= M_MCAST; + } else + IEEE80211_NODE_STAT(ni, tx_ucast); + /* NB: ieee80211_encap does not include 802.11 header */ + IEEE80211_NODE_STAT_ADD(ni, tx_bytes, m->m_pkthdr.len); /* * NB: DLT_IEEE802_11_RADIO identifies the parameters are @@ -412,13 +424,15 @@ static void ieee80211_send_setup( struct ieee80211_node *ni, - struct ieee80211_frame *wh, + struct mbuf *m, int type, int tid, const uint8_t sa[IEEE80211_ADDR_LEN], const uint8_t da[IEEE80211_ADDR_LEN], const uint8_t bssid[IEEE80211_ADDR_LEN]) >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Sun Apr 26 22:33:55 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1F3A21065674; Sun, 26 Apr 2009 22:33:55 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D35E9106564A for ; Sun, 26 Apr 2009 22:33:54 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C15428FC08 for ; Sun, 26 Apr 2009 22:33:54 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3QMXsZV062138 for ; Sun, 26 Apr 2009 22:33:54 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3QMXsfM062136 for perforce@freebsd.org; Sun, 26 Apr 2009 22:33:54 GMT (envelope-from zec@fer.hr) Date: Sun, 26 Apr 2009 22:33:54 GMT Message-Id: <200904262233.n3QMXsfM062136@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 161151 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 22:33:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=161151 Change 161151 by zec@zec_amdx2 on 2009/04/26 22:33:41 Fix misintegrations. Affected files ... .. //depot/projects/vimage-commit2/src/sys/netinet/igmp.c#28 edit Differences ... ==== //depot/projects/vimage-commit2/src/sys/netinet/igmp.c#28 (text+ko) ==== @@ -3620,15 +3620,6 @@ return (0); } -/* - * XXX Are igi_head and igmpstat really accessed via kmem / kldsym? - * If so, given that they are members of struct vnet_inet, they should - * be registered with VNET_MOD_INET, not here. Revisit!!! - */ -#if 0 -}; -#endif - #ifndef VIMAGE_GLOBALS static vnet_modinfo_t vnet_igmp_modinfo = { .vmi_id = VNET_MOD_IGMP, From owner-p4-projects@FreeBSD.ORG Sun Apr 26 22:49:11 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C8AD31065672; Sun, 26 Apr 2009 22:49:10 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88AB2106564A for ; Sun, 26 Apr 2009 22:49:10 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 764E98FC2B for ; Sun, 26 Apr 2009 22:49:10 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3QMnAlh063353 for ; Sun, 26 Apr 2009 22:49:10 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3QMnA59063351 for perforce@freebsd.org; Sun, 26 Apr 2009 22:49:10 GMT (envelope-from zec@fer.hr) Date: Sun, 26 Apr 2009 22:49:10 GMT Message-Id: <200904262249.n3QMnA59063351@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 161153 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 22:49:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=161153 Change 161153 by zec@zec_amdx2 on 2009/04/26 22:48:24 Unbreak options VIMAGE kernel build. Affected files ... .. //depot/projects/vimage-commit2/src/sys/net/if.c#48 edit .. //depot/projects/vimage-commit2/src/sys/net/if_mib.c#14 edit Differences ... ==== //depot/projects/vimage-commit2/src/sys/net/if.c#48 (text+ko) ==== @@ -546,6 +546,7 @@ static void if_free_internal(struct ifnet *ifp) { + INIT_VNET_NET(ifp->if_vnet); KASSERT((ifp->if_flags & IFF_DYING), ("if_free_internal: interface not dying")); @@ -583,7 +584,6 @@ void if_free_type(struct ifnet *ifp, u_char type) { - INIT_VNET_NET(curvnet); /* ifp->if_vnet can be NULL here ! */ KASSERT(ifp->if_alloctype == type, ("if_free_type: type (%d) != alloctype (%d)", type, ==== //depot/projects/vimage-commit2/src/sys/net/if_mib.c#14 (text+ko) ==== @@ -77,7 +77,6 @@ static int sysctl_ifdata(SYSCTL_HANDLER_ARGS) /* XXX bad syntax! */ { - INIT_VNET_NET(curvnet); int *name = (int *)arg1; int error; u_int namelen = arg2; From owner-p4-projects@FreeBSD.ORG Sun Apr 26 23:26:50 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1DF391065674; Sun, 26 Apr 2009 23:26:50 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1593106566C for ; Sun, 26 Apr 2009 23:26:49 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id BE1AE8FC13 for ; Sun, 26 Apr 2009 23:26:49 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3QNQnbs067829 for ; Sun, 26 Apr 2009 23:26:49 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3QNQnxm067827 for perforce@freebsd.org; Sun, 26 Apr 2009 23:26:49 GMT (envelope-from zec@fer.hr) Date: Sun, 26 Apr 2009 23:26:49 GMT Message-Id: <200904262326.n3QNQnxm067827@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 161158 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 23:26:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=161158 Change 161158 by zec@zec_amdx2 on 2009/04/26 23:26:22 Unbreak GENERIC and VIMAGE kernel builds. Affected files ... .. //depot/projects/vimage/src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c#18 edit .. //depot/projects/vimage/src/sys/net/if.c#79 edit .. //depot/projects/vimage/src/sys/net/if_mib.c#14 edit .. //depot/projects/vimage/src/sys/net/rtsock.c#33 edit .. //depot/projects/vimage/src/sys/netgraph/ng_base.c#56 edit .. //depot/projects/vimage/src/sys/netinet/igmp.c#35 edit .. //depot/projects/vimage/src/sys/netinet/in_mcast.c#26 edit .. //depot/projects/vimage/src/sys/netinet/ip_divert.c#30 edit .. //depot/projects/vimage/src/sys/netinet6/in6_rmx.c#34 edit Differences ... ==== //depot/projects/vimage/src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c#18 (text+ko) ==== @@ -246,7 +246,6 @@ fr_running = 1; if (fr_control_forwarding & 1) { - INIT_VNET_INET(curvnet); V_ipforwarding = 1; } @@ -272,7 +271,6 @@ int s; #endif if (fr_control_forwarding & 2) { - INIT_VNET_INET(curvnet); V_ipforwarding = 0; } ==== //depot/projects/vimage/src/sys/net/if.c#79 (text+ko) ==== @@ -571,6 +571,7 @@ static void if_free_internal(struct ifnet *ifp) { + INIT_VNET_NET(ifp->if_vnet); KASSERT((ifp->if_flags & IFF_DYING), ("if_free_internal: interface not dying")); @@ -608,7 +609,6 @@ void if_free_type(struct ifnet *ifp, u_char type) { - INIT_VNET_NET(curvnet); /* ifp->if_vnet can be NULL here ! */ KASSERT(ifp->if_alloctype == type, ("if_free_type: type (%d) != alloctype (%d)", type, ==== //depot/projects/vimage/src/sys/net/if_mib.c#14 (text+ko) ==== @@ -77,7 +77,6 @@ static int sysctl_ifdata(SYSCTL_HANDLER_ARGS) /* XXX bad syntax! */ { - INIT_VNET_NET(curvnet); int *name = (int *)arg1; int error; u_int namelen = arg2; ==== //depot/projects/vimage/src/sys/net/rtsock.c#33 (text+ko) ==== @@ -1206,6 +1206,7 @@ static void rt_dispatch(struct mbuf *m, const struct sockaddr *sa) { + INIT_VNET_NET(curvnet); struct m_tag *tag; /* ==== //depot/projects/vimage/src/sys/netgraph/ng_base.c#56 (text+ko) ==== @@ -84,8 +84,6 @@ /* Mutex to protect topology events. */ static struct mtx ng_topo_mtx; -static vnet_attach_fn vnet_netgraph_iattach; - #ifdef NETGRAPH_DEBUG static struct mtx ng_nodelist_mtx; /* protects global node/hook lists */ static struct mtx ngq_mtx; /* protects the queue item list */ @@ -273,19 +271,6 @@ static vnet_detach_fn vnet_netgraph_idetach; #endif /* VIMAGE */ -#ifndef VIMAGE_GLOBALS -static vnet_modinfo_t vnet_netgraph_modinfo = { - .vmi_id = VNET_MOD_NETGRAPH, - .vmi_name = "netgraph", - .vmi_size = sizeof(struct vnet_netgraph), - .vmi_dependson = VNET_MOD_LOIF, - .vmi_iattach = vnet_netgraph_iattach, -#ifdef VIMAGE - .vmi_idetach = vnet_netgraph_idetach -#endif -}; -#endif - #ifdef NETGRAPH_DEBUG /*----------------------------------------------*/ /* * In debug mode: @@ -3091,26 +3076,18 @@ } #ifndef VIMAGE_GLOBALS -static const vnet_modinfo_t vnet_netgraph_modinfo = { +static vnet_modinfo_t vnet_netgraph_modinfo = { .vmi_id = VNET_MOD_NETGRAPH, .vmi_name = "netgraph", + .vmi_size = sizeof(struct vnet_netgraph), + .vmi_dependson = VNET_MOD_LOIF, + .vmi_iattach = vnet_netgraph_iattach, #ifdef VIMAGE - .vmi_size = sizeof(struct vnet_netgraph), + .vmi_idetach = vnet_netgraph_idetach #endif - .vmi_iattach = vnet_netgraph_iattach }; #endif -static int -vnet_netgraph_iattach(const void *arg __unused) -{ - INIT_VNET_NETGRAPH(curvnet); - - V_nextID = 1; - - return (0); -} - /* * Handle loading and unloading for this code. * The only thing we need to link into is the NETISR strucure. ==== //depot/projects/vimage/src/sys/netinet/igmp.c#35 (text+ko) ==== @@ -2053,7 +2053,6 @@ { INIT_VNET_INET(curvnet); - INIT_VNET_INET(curvnet); IGMP_LOCK_ASSERT(); if (igi->igi_v1_timer == 0 && igi->igi_v2_timer == 0) { @@ -3374,7 +3373,6 @@ * unique to each VIMAGE and must be retrieved. */ CURVNET_SET((struct vnet *)(m->m_pkthdr.header)); - INIT_VNET_INET(curvnet); INIT_VNET_NET(curvnet); INIT_VNET_INET(curvnet); ifindex = igmp_restore_context(m); @@ -3616,7 +3614,6 @@ return (0); } -#ifdef VIMAGE static int vnet_igmp_idetach(const void *unused __unused) { @@ -3629,35 +3626,14 @@ return (0); } -#endif - -struct vnet_igmp { - int dummy; -}; -#ifndef VIMAGE -#ifndef VIMAGE_GLOBALS -struct vnet_igmp vnet_igmp_0; -#endif -#endif -/* XXX VIMAGE [julian] - * BMS seems unsure if this should be a separate module or not as he's - * put the extra fields into vnet_inet instead of a vnet_igmp. - * yet it has module setup functions.. - */ #ifndef VIMAGE_GLOBALS - VNET_SYMMAP(inet, igi_head), - VNET_SYMMAP(inet, igmpstat), -}; static vnet_modinfo_t vnet_igmp_modinfo = { .vmi_id = VNET_MOD_IGMP, .vmi_name = "igmp", .vmi_dependson = VNET_MOD_INET, - .vmi_symmap = vnet_igmp_symmap, .vmi_iattach = vnet_igmp_iattach, -#ifdef VIMAGE .vmi_idetach = vnet_igmp_idetach -#endif }; #endif ==== //depot/projects/vimage/src/sys/netinet/in_mcast.c#26 (text+ko) ==== @@ -2307,7 +2307,6 @@ inp_set_multicast_if(struct inpcb *inp, struct sockopt *sopt) { INIT_VNET_NET(curvnet); - INIT_VNET_INET(curvnet); struct in_addr addr; struct ip_mreqn mreqn; struct ifnet *ifp; ==== //depot/projects/vimage/src/sys/netinet/ip_divert.c#30 (text+ko) ==== @@ -126,23 +126,6 @@ static u_long div_sendspace = DIVSNDQ; /* XXX sysctl ? */ static u_long div_recvspace = DIVRCVQ; /* XXX sysctl ? */ -static int -div_inpcb_init(void *mem, int size, int flags) -{ - struct inpcb *inp = mem; - - INP_LOCK_INIT(inp, "inp", "divinp"); - return (0); -} - -static void -div_inpcb_fini(void *mem, int size) -{ - struct inpcb *inp = mem; - - INP_LOCK_DESTROY(inp); -} - void div_init(void) { ==== //depot/projects/vimage/src/sys/netinet6/in6_rmx.c#34 (text+ko) ==== @@ -292,6 +292,7 @@ in6_rtqtimo(void *rock) { CURVNET_SET_QUIET((struct vnet *) rock); + INIT_VNET_NET(curvnet); INIT_VNET_INET6(curvnet); struct radix_node_head *rnh = V_rt_tables[0][AF_INET6]; struct rtqk_arg arg; @@ -379,6 +380,7 @@ in6_mtutimo(void *rock) { CURVNET_SET_QUIET((struct vnet *) rock); + INIT_VNET_NET(curvnet); INIT_VNET_INET6(curvnet); struct radix_node_head *rnh = V_rt_tables[0][AF_INET6]; struct mtuex_arg arg; From owner-p4-projects@FreeBSD.ORG Sun Apr 26 23:34:58 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Receive