From owner-p4-projects@FreeBSD.ORG Mon Mar 3 14:17:27 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9C5E81065673; Mon, 3 Mar 2008 14:17:26 +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 51CED1065671 for ; Mon, 3 Mar 2008 14:17:26 +0000 (UTC) (envelope-from raj@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 4E8A18FC3E for ; Mon, 3 Mar 2008 14:17:26 +0000 (UTC) (envelope-from raj@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m23EHQ6p039229 for ; Mon, 3 Mar 2008 14:17:26 GMT (envelope-from raj@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m23EHQbC039227 for perforce@freebsd.org; Mon, 3 Mar 2008 14:17:26 GMT (envelope-from raj@freebsd.org) Date: Mon, 3 Mar 2008 14:17:26 GMT Message-Id: <200803031417.m23EHQbC039227@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to raj@freebsd.org using -f From: Rafal Jaworowski To: Perforce Change Reviews Cc: Subject: PERFORCE change 136745 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: Mon, 03 Mar 2008 14:17:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=136745 Change 136745 by raj@raj_mimi on 2008/03/03 14:17:22 IFC @136744 Affected files ... .. //depot/projects/e500/games/fortune/datfiles/fortunes#10 integrate .. //depot/projects/e500/include/pthread_np.h#5 integrate .. //depot/projects/e500/lib/libelf/elf_update.c#3 integrate .. //depot/projects/e500/lib/libthr/pthread.map#7 integrate .. //depot/projects/e500/lib/libthr/thread/Makefile.inc#2 integrate .. //depot/projects/e500/lib/libthr/thread/thr_affinity.c#1 branch .. //depot/projects/e500/share/man/man4/fwohci.4#3 integrate .. //depot/projects/e500/share/misc/committers-ports.dot#7 integrate .. //depot/projects/e500/sys/arm/xscale/ixp425/ixp425_iic.c#2 integrate .. //depot/projects/e500/sys/dev/re/if_re.c#5 integrate .. //depot/projects/e500/sys/modules/cxgb/cxgb_t3fw/Makefile#2 integrate .. //depot/projects/e500/sys/netgraph/ng_pppoe.c#5 integrate .. //depot/projects/e500/sys/netinet/ip_fw_pfil.c#4 integrate .. //depot/projects/e500/sys/pci/if_rl.c#4 integrate .. //depot/projects/e500/sys/pci/if_rlreg.h#5 integrate .. //depot/projects/e500/sys/powerpc/include/pmap.h#6 edit .. //depot/projects/e500/sys/powerpc/include/psl.h#3 integrate .. //depot/projects/e500/sys/powerpc/include/pte.h#3 integrate .. //depot/projects/e500/sys/powerpc/include/sf_buf.h#3 integrate .. //depot/projects/e500/sys/powerpc/include/spr.h#5 integrate .. //depot/projects/e500/sys/powerpc/include/trap.h#7 edit .. //depot/projects/e500/sys/powerpc/include/vmparam.h#9 integrate .. //depot/projects/e500/sys/ufs/ufs/ufs_extattr.c#5 integrate .. //depot/projects/e500/usr.bin/calendar/calendars/calendar.freebsd#10 integrate .. //depot/projects/e500/usr.bin/find/find.1#4 integrate .. //depot/projects/e500/usr.bin/find/main.c#2 integrate .. //depot/projects/e500/usr.bin/unifdef/unifdef.c#3 integrate Differences ... ==== //depot/projects/e500/games/fortune/datfiles/fortunes#10 (text+ko) ==== @@ -1,5 +1,5 @@ This fortune brought to you by: -$FreeBSD: src/games/fortune/datfiles/fortunes,v 1.257 2008/02/28 15:16:24 yar Exp $ +$FreeBSD: src/games/fortune/datfiles/fortunes,v 1.258 2008/03/03 10:06:52 dds Exp $ % ======================================================================= || || @@ -49242,7 +49242,7 @@ admit it, I tell him, `Forget it'. If they bring a car back late we overlook it. If they've had a crash and it doesn't involve another vehicle we might overlook that too." - "Where's the ashtray?" asked on Los Angeles wife, as she settled + "Where's the ashtray?" asked one Los Angeles wife, as she settled into the ripped interior. "Honey," said her husband, "the whole car's the ash tray." -- Stephen Pile, "The Book of Heroic Failures" ==== //depot/projects/e500/include/pthread_np.h#5 (text+ko) ==== @@ -26,11 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/include/pthread_np.h,v 1.20 2008/02/06 19:34:31 des Exp $ + * $FreeBSD: src/include/pthread_np.h,v 1.21 2008/03/03 08:28:13 davidxu Exp $ */ #ifndef _PTHREAD_NP_H_ #define _PTHREAD_NP_H_ +#include +#include + /* * Non-POSIX type definitions: */ @@ -42,6 +45,9 @@ __BEGIN_DECLS int pthread_attr_setcreatesuspend_np(pthread_attr_t *); int pthread_attr_get_np(pthread_t, pthread_attr_t *); +int pthread_attr_getaffinity_np(const pthread_attr_t *, size_t, cpuset_t *); +int pthread_attr_setaffinity_np(pthread_attr_t *, size_t, const cpuset_t *); +int pthread_getaffinity_np(pthread_t, size_t, cpuset_t *); int pthread_main_np(void); int pthread_multi_np(void); int pthread_mutexattr_getkind_np(pthread_mutexattr_t); @@ -54,6 +60,7 @@ int pthread_mutex_getyieldloops_np(pthread_mutex_t *mutex, int *count); int pthread_mutex_setyieldloops_np(pthread_mutex_t *mutex, int count); int pthread_mutex_isowned_np(pthread_mutex_t *mutex); +int pthread_setaffinity_np(pthread_t, size_t, const cpuset_t *); int pthread_single_np(void); void pthread_suspend_all_np(void); int pthread_suspend_np(pthread_t); ==== //depot/projects/e500/lib/libelf/elf_update.c#3 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006 Joseph Koshy + * Copyright (c) 2006-2008 Joseph Koshy * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libelf/elf_update.c,v 1.3 2007/09/08 08:20:12 jkoshy Exp $"); +__FBSDID("$FreeBSD: src/lib/libelf/elf_update.c,v 1.4 2008/03/03 04:29:25 jkoshy Exp $"); #include #include @@ -246,13 +246,19 @@ tmin = t->s_offset; tmax = tmin + t->s_size; - /* check if there is an overlap */ - if (tmax < smin) { + if (tmax <= smin) { + /* + * 't' lies entirely before 's': ...| t |...| s |... + */ prevt = t; continue; - } else if (smax < tmin) + } else if (smax <= tmin) + /* + * 's' lies entirely before 't', and after 'prevt': + * ...| prevt |...| s |...| t |... + */ break; - else { + else { /* 's' and 't' overlap. */ LIBELF_SET_ERROR(LAYOUT, 0); return (0); } ==== //depot/projects/e500/lib/libthr/pthread.map#7 (text+ko) ==== @@ -1,5 +1,5 @@ /* - * $FreeBSD: src/lib/libthr/pthread.map,v 1.26 2008/02/06 20:45:46 des Exp $ + * $FreeBSD: src/lib/libthr/pthread.map,v 1.27 2008/03/03 09:16:28 davidxu Exp $ */ /* @@ -117,8 +117,8 @@ pthread_rwlockattr_getpshared; pthread_rwlockattr_init; pthread_rwlockattr_setpshared; + pthread_set_name_np; pthread_self; - pthread_set_name_np; pthread_setcancelstate; pthread_setcanceltype; pthread_setconcurrency; @@ -388,6 +388,8 @@ }; FBSD_1.1 { + pthread_getaffinity_np; + pthread_setaffinity_np; pthread_mutex_getspinloops_np; pthread_mutex_getyieldloops_np; pthread_mutex_isowned_np; ==== //depot/projects/e500/lib/libthr/thread/Makefile.inc#2 (text+ko) ==== @@ -1,9 +1,10 @@ -# $FreeBSD: src/lib/libthr/thread/Makefile.inc,v 1.16 2006/04/04 02:57:49 davidxu Exp $ +# $FreeBSD: src/lib/libthr/thread/Makefile.inc,v 1.17 2008/03/03 09:16:29 davidxu Exp $ # thr sources .PATH: ${.CURDIR}/thread SRCS+= \ + thr_affinity.c \ thr_attr.c \ thr_barrier.c \ thr_barrierattr.c \ ==== //depot/projects/e500/share/man/man4/fwohci.4#3 (text+ko) ==== @@ -29,10 +29,10 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.\" $FreeBSD: src/share/man/man4/fwohci.4,v 1.16 2007/06/17 10:40:25 simokawa Exp $ +.\" $FreeBSD: src/share/man/man4/fwohci.4,v 1.17 2008/03/03 08:55:50 brueffer Exp $ .\" .\" -.Dd June 23, 2005 +.Dd March 3, 2008 .Dt FWOHCI 4 .Os .Sh NAME @@ -99,8 +99,6 @@ .It Sony CX3022 .It -Sony i.LINK (CXD1947) -.It Sony i.LINK (CXD3222) .It Sun PCIO-2 (RIO 1394) ==== //depot/projects/e500/share/misc/committers-ports.dot#7 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/share/misc/committers-ports.dot,v 1.66 2008/02/26 15:38:46 gahr Exp $ +# $FreeBSD: src/share/misc/committers-ports.dot,v 1.67 2008/03/03 13:12:27 jadawin Exp $ # This file is meant to list all FreeBSD ports committers and describe the # mentor-mentee relationships between them. @@ -80,6 +80,7 @@ hq [label="Herve Quiroz\nhq@FreeBSD.org\n2004/08/05"] ijliao [label="Ying-Chieh Liao\nijliao@FreeBSD.org\n2001/01/20"] itetcu [label="Ion-Mihai Tetcu\nitetcu@FreeBSD.org\n2006/06/07"] +jadawin [label="Philippe Audeoud\njadawin@FreeBSD.org\n2008/03/02"] jkim [label="Jung-uk Kim\njkim@FreeBSD.org\n2007/09/12"] jmelo [label="Jean Milanez Melo\njmelo@FreeBSD.org\n2006/03/31"] joerg [label="Joerg Wunsch\njoerg@FreeBSD.org\n1994/08/22"] @@ -290,6 +291,10 @@ steve -> netchild +tabthorpe -> jadawin + +thierry -> jadawin + tmclaugh -> itetcu tmclaugh -> xride ==== //depot/projects/e500/sys/arm/xscale/ixp425/ixp425_iic.c#2 (text+ko) ==== @@ -9,13 +9,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. * * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -31,7 +24,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/ixp425_iic.c,v 1.1 2006/11/19 23:55:23 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/ixp425_iic.c,v 1.2 2008/03/03 06:39:36 kevlo Exp $"); #include #include ==== //depot/projects/e500/sys/dev/re/if_re.c#5 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.103 2008/01/17 23:37:47 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.106 2008/03/03 04:15:07 yongari Exp $"); /* * RealTek 8139C+/8169/8169S/8110S/8168/8111/8101E PCI NIC driver @@ -201,8 +201,7 @@ { LINKSYS_VENDORID, LINKSYS_DEVICEID_EG1032, RL_HWREV_8169S, "Linksys EG1032 (RTL8169S) Gigabit Ethernet" }, { USR_VENDORID, USR_DEVICEID_997902, RL_HWREV_8169S, - "US Robotics 997902 (RTL8169S) Gigabit Ethernet" }, - { 0, 0, 0, NULL } + "US Robotics 997902 (RTL8169S) Gigabit Ethernet" } }; static struct rl_hwrev re_hwrevs[] = { @@ -280,6 +279,8 @@ static void re_setmulti (struct rl_softc *); static void re_reset (struct rl_softc *); +static void re_setwol (struct rl_softc *); +static void re_clrwol (struct rl_softc *); #ifdef RE_DIAG static int re_diag (struct rl_softc *); @@ -916,51 +917,38 @@ device_t dev; { struct rl_type *t; - struct rl_softc *sc; - int rid; - u_int32_t hwrev; + uint16_t devid, vendor; + uint16_t revid, sdevid; + int i; + + vendor = pci_get_vendor(dev); + devid = pci_get_device(dev); + revid = pci_get_revid(dev); + sdevid = pci_get_subdevice(dev); - t = re_devs; - sc = device_get_softc(dev); - - while (t->rl_name != NULL) { - if ((pci_get_vendor(dev) == t->rl_vid) && - (pci_get_device(dev) == t->rl_did)) { + if (vendor == LINKSYS_VENDORID && devid == LINKSYS_DEVICEID_EG1032) { + if (sdevid != LINKSYS_SUBDEVICE_EG1032_REV3) { /* * Only attach to rev. 3 of the Linksys EG1032 adapter. - * Rev. 2 i supported by sk(4). + * Rev. 2 is supported by sk(4). */ - if ((t->rl_vid == LINKSYS_VENDORID) && - (t->rl_did == LINKSYS_DEVICEID_EG1032) && - (pci_get_subdevice(dev) != - LINKSYS_SUBDEVICE_EG1032_REV3)) { - t++; - continue; - } + return (ENXIO); + } + } + + if (vendor == RT_VENDORID && devid == RT_DEVICEID_8139) { + if (revid != 0x20) { + /* 8139, let rl(4) take care of this device. */ + return (ENXIO); + } + } - /* - * Temporarily map the I/O space - * so we can read the chip ID register. - */ - rid = RL_RID; - sc->rl_res = bus_alloc_resource_any(dev, RL_RES, &rid, - RF_ACTIVE); - if (sc->rl_res == NULL) { - device_printf(dev, - "couldn't map ports/memory\n"); - return (ENXIO); - } - sc->rl_btag = rman_get_bustag(sc->rl_res); - sc->rl_bhandle = rman_get_bushandle(sc->rl_res); - hwrev = CSR_READ_4(sc, RL_TXCFG) & RL_TXCFG_HWREV; - bus_release_resource(dev, RL_RES, - RL_RID, sc->rl_res); - if (t->rl_basetype == hwrev) { - device_set_desc(dev, t->rl_name); - return (BUS_PROBE_DEFAULT); - } + t = re_devs; + for (i = 0; i < sizeof(re_devs) / sizeof(re_devs[0]); i++, t++) { + if (vendor == t->rl_vid && devid == t->rl_did) { + device_set_desc(dev, t->rl_name); + return (BUS_PROBE_DEFAULT); } - t++; } return (ENXIO); @@ -1266,6 +1254,11 @@ sc->rl_ldata.rl_tx_desc_cnt = RL_8139_TX_DESC_CNT; sc->rl_ldata.rl_rx_desc_cnt = RL_8139_RX_DESC_CNT; } + if (hw_rev->rl_desc == NULL) { + device_printf(dev, "Unsupported revision : 0x%08x\n", hwrev); + error = ENXIO; + goto fail; + } error = re_allocmem(dev, sc); if (error) @@ -1334,6 +1327,9 @@ ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING; if (ifp->if_capabilities & IFCAP_HWCSUM) ifp->if_capabilities |= IFCAP_VLAN_HWCSUM; + /* Enable WOL if PM is supported. */ + if (pci_find_extcap(sc->rl_dev, PCIY_PMG, ®) == 0) + ifp->if_capabilities |= IFCAP_WOL; ifp->if_capenable = ifp->if_capabilities; #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; @@ -2635,10 +2631,18 @@ switch (command) { case SIOCSIFMTU: + if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > RL_JUMBO_MTU) { + error = EINVAL; + break; + } + if (sc->rl_type == RL_8139CPLUS && + ifr->ifr_mtu > RL_MAX_FRAMELEN) { + error = EINVAL; + break; + } RL_LOCK(sc); - if (ifr->ifr_mtu > RL_JUMBO_MTU) - error = EINVAL; - ifp->if_mtu = ifr->ifr_mtu; + if (ifp->if_mtu != ifr->ifr_mtu) + ifp->if_mtu = ifr->ifr_mtu; RL_UNLOCK(sc); break; case SIOCSIFFLAGS: @@ -2715,6 +2719,15 @@ else ifp->if_hwassist &= ~CSUM_TSO; } + if ((mask & IFCAP_WOL) != 0 && + (ifp->if_capabilities & IFCAP_WOL) != 0) { + if ((mask & IFCAP_WOL_UCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_UCAST; + if ((mask & IFCAP_WOL_MCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_MCAST; + if ((mask & IFCAP_WOL_MAGIC) != 0) + ifp->if_capenable ^= IFCAP_WOL_MAGIC; + } if (reinit && ifp->if_drv_flags & IFF_DRV_RUNNING) re_init(sc); VLAN_CAPABILITIES(ifp); @@ -2820,6 +2833,7 @@ RL_LOCK(sc); re_stop(sc); + re_setwol(sc); sc->suspended = 1; RL_UNLOCK(sc); @@ -2848,6 +2862,11 @@ if (ifp->if_flags & IFF_UP) re_init_locked(sc); + /* + * Clear WOL matching such that normal Rx filtering + * wouldn't interfere with WOL patterns. + */ + re_clrwol(sc); sc->suspended = 0; RL_UNLOCK(sc); @@ -2874,7 +2893,95 @@ * cases. */ sc->rl_ifp->if_flags &= ~IFF_UP; + re_setwol(sc); RL_UNLOCK(sc); return (0); } + +static void +re_setwol(sc) + struct rl_softc *sc; +{ + struct ifnet *ifp; + int pmc; + uint16_t pmstat; + uint8_t v; + + RL_LOCK_ASSERT(sc); + + if (pci_find_extcap(sc->rl_dev, PCIY_PMG, &pmc) != 0) + return; + + ifp = sc->rl_ifp; + /* Enable config register write. */ + CSR_WRITE_1(sc, RL_EECMD, RL_EE_MODE); + + /* Enable PME. */ + v = CSR_READ_1(sc, RL_CFG1); + v &= ~RL_CFG1_PME; + if ((ifp->if_capenable & IFCAP_WOL) != 0) + v |= RL_CFG1_PME; + CSR_WRITE_1(sc, RL_CFG1, v); + + v = CSR_READ_1(sc, RL_CFG3); + v &= ~(RL_CFG3_WOL_LINK | RL_CFG3_WOL_MAGIC); + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + v |= RL_CFG3_WOL_MAGIC; + CSR_WRITE_1(sc, RL_CFG3, v); + + /* Config register write done. */ + CSR_WRITE_1(sc, RL_EECMD, 0); + + v = CSR_READ_1(sc, RL_CFG5); + v &= ~(RL_CFG5_WOL_BCAST | RL_CFG5_WOL_MCAST | RL_CFG5_WOL_UCAST); + v &= ~RL_CFG5_WOL_LANWAKE; + if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0) + v |= RL_CFG5_WOL_UCAST; + if ((ifp->if_capenable & IFCAP_WOL_MCAST) != 0) + v |= RL_CFG5_WOL_MCAST | RL_CFG5_WOL_BCAST; + if ((ifp->if_capenable & IFCAP_WOL) != 0) + v |= RL_CFG5_WOL_LANWAKE; + CSR_WRITE_1(sc, RL_CFG5, v); + + /* + * It seems that hardware resets its link speed to 100Mbps in + * power down mode so switching to 100Mbps in driver is not + * needed. + */ + + /* Request PME if WOL is requested. */ + pmstat = pci_read_config(sc->rl_dev, pmc + PCIR_POWER_STATUS, 2); + pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); + if ((ifp->if_capenable & IFCAP_WOL) != 0) + pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->rl_dev, pmc + PCIR_POWER_STATUS, pmstat, 2); +} + +static void +re_clrwol(sc) + struct rl_softc *sc; +{ + int pmc; + uint8_t v; + + RL_LOCK_ASSERT(sc); + + if (pci_find_extcap(sc->rl_dev, PCIY_PMG, &pmc) != 0) + return; + + /* Enable config register write. */ + CSR_WRITE_1(sc, RL_EECMD, RL_EE_MODE); + + v = CSR_READ_1(sc, RL_CFG3); + v &= ~(RL_CFG3_WOL_LINK | RL_CFG3_WOL_MAGIC); + CSR_WRITE_1(sc, RL_CFG3, v); + + /* Config register write done. */ + CSR_WRITE_1(sc, RL_EECMD, 0); + + v = CSR_READ_1(sc, RL_CFG5); + v &= ~(RL_CFG5_WOL_BCAST | RL_CFG5_WOL_MCAST | RL_CFG5_WOL_UCAST); + v &= ~RL_CFG5_WOL_LANWAKE; + CSR_WRITE_1(sc, RL_CFG5, v); +} ==== //depot/projects/e500/sys/modules/cxgb/cxgb_t3fw/Makefile#2 (text+ko) ==== @@ -1,8 +1,9 @@ -# $FreeBSD: src/sys/modules/cxgb/cxgb_t3fw/Makefile,v 1.1 2008/02/26 03:02:20 kmacy Exp $ +# $FreeBSD: src/sys/modules/cxgb/cxgb_t3fw/Makefile,v 1.2 2008/03/03 03:34:52 kmacy Exp $ CXGB = ${.CURDIR}/../../../dev/cxgb .PATH: ${CXGB} +KMOD= cxgb_t3fw SRCS+= cxgb_t3fw.c .include ==== //depot/projects/e500/sys/netgraph/ng_pppoe.c#5 (text+ko) ==== @@ -37,7 +37,7 @@ * * Author: Julian Elischer * - * $FreeBSD: src/sys/netgraph/ng_pppoe.c,v 1.92 2008/02/06 20:37:34 mav Exp $ + * $FreeBSD: src/sys/netgraph/ng_pppoe.c,v 1.93 2008/03/02 23:26:35 mav Exp $ * $Whistle: ng_pppoe.c,v 1.10 1999/11/01 09:24:52 julian Exp $ */ @@ -281,45 +281,8 @@ * Author: Michal Ostrowski * ************************************************************************/ -/* - * Generate a new session id - * XXX find out the FreeBSD locking scheme. - */ -static uint16_t -get_new_sid(node_p node) -{ - static int pppoe_sid = 10; - hook_p hook; - uint16_t val; - -restart: - val = pppoe_sid++; - /* - * Spec says 0xFFFF is reserved. - * Also don't use 0x0000 - */ - if (val == 0xffff) { - pppoe_sid = 20; - goto restart; - } - - /* Check it isn't already in use. */ - LIST_FOREACH(hook, &node->nd_hooks, hk_hooks) { - sessp sp = NG_HOOK_PRIVATE(hook); - - /* Skip any nonsession hook. */ - if (sp == NULL) - continue; - if (sp->Session_ID == val) - goto restart; - } - - CTR2(KTR_NET, "%20s: new sid %d", __func__, val); - return (val); -} - /* * Return the location where the next tag can be put */ @@ -559,6 +522,42 @@ /************************************************************************** * Routines to find a particular session that matches an incoming packet. * **************************************************************************/ +/* Find free session and add to hash. */ +static uint16_t +pppoe_getnewsession(sessp sp) +{ + const priv_p privp = NG_NODE_PRIVATE(NG_HOOK_NODE(sp->hook)); + static uint16_t pppoe_sid = 1; + sessp tsp; + uint16_t val, hash; + +restart: + /* Atomicity is not needed here as value will be checked. */ + val = pppoe_sid++; + /* Spec says 0xFFFF is reserved, also don't use 0x0000. */ + if (val == 0xffff || val == 0x0000) + val = pppoe_sid = 1; + + /* Check it isn't already in use. */ + hash = SESSHASH(val); + mtx_lock(&privp->sesshash[hash].mtx); + TAILQ_FOREACH(tsp, &privp->sesshash[hash].head, sessions) { + if (tsp->Session_ID == val) + break; + } + if (!tsp) { + sp->Session_ID = val; + TAILQ_INSERT_HEAD(&privp->sesshash[hash].head, sp, sessions); + } + mtx_unlock(&privp->sesshash[hash].mtx); + if (tsp) + goto restart; + + CTR2(KTR_NET, "%20s: new sid %d", __func__, val); + + return (val); +} + /* Add specified session to hash. */ static void pppoe_addsession(sessp sp) @@ -1545,9 +1544,7 @@ neg->pkt->pkt_header.ph.code = PADS_CODE; if (sp->Session_ID == 0) { neg->pkt->pkt_header.ph.sid = - htons(sp->Session_ID - = get_new_sid(node)); - pppoe_addsession(sp); + htons(pppoe_getnewsession(sp)); } send_sessionid(sp); neg->timeout = 0; ==== //depot/projects/e500/sys/netinet/ip_fw_pfil.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/netinet/ip_fw_pfil.c,v 1.26 2007/11/06 23:01:42 oleg Exp $"); +__FBSDID("$FreeBSD: src/sys/netinet/ip_fw_pfil.c,v 1.27 2008/03/03 10:12:46 piso Exp $"); #if !defined(KLD_MODULE) #include "opt_ipfw.h" @@ -566,5 +566,5 @@ ipfw_modevent, 0 }; -DECLARE_MODULE(ipfw, ipfwmod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); +DECLARE_MODULE(ipfw, ipfwmod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY - 256); MODULE_VERSION(ipfw, 2); ==== //depot/projects/e500/sys/pci/if_rl.c#4 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/pci/if_rl.c,v 1.172 2007/11/26 18:25:07 remko Exp $"); +__FBSDID("$FreeBSD: src/sys/pci/if_rl.c,v 1.173 2008/03/03 04:15:08 yongari Exp $"); /* * RealTek 8129/8139 PCI NIC driver @@ -175,8 +175,7 @@ { LEVEL1_VENDORID, LEVEL1_DEVICEID_FPC0106TX, RL_8139, "LevelOne FPC-0106TX" }, { EDIMAX_VENDORID, EDIMAX_DEVICEID_EP4103DL, RL_8139, - "Edimax EP-4103DL CardBus" }, - { 0, 0, 0, NULL } + "Edimax EP-4103DL CardBus" } }; static int rl_attach(device_t); @@ -730,48 +729,26 @@ static int rl_probe(device_t dev) { - struct rl_softc *sc; - struct rl_type *t = rl_devs; - int rid; - uint32_t hwrev; + struct rl_type *t; + uint16_t devid, revid, vendor; + int i; + + vendor = pci_get_vendor(dev); + devid = pci_get_device(dev); + revid = pci_get_revid(dev); - sc = device_get_softc(dev); - - while (t->rl_name != NULL) { - if ((pci_get_vendor(dev) == t->rl_vid) && - (pci_get_device(dev) == t->rl_did)) { - /* - * Temporarily map the I/O space - * so we can read the chip ID register. - */ - rid = RL_RID; - sc->rl_res = bus_alloc_resource_any(dev, RL_RES, &rid, - RF_ACTIVE); - if (sc->rl_res == NULL) { - device_printf(dev, - "couldn't map ports/memory\n"); - return (ENXIO); - } - sc->rl_btag = rman_get_bustag(sc->rl_res); - sc->rl_bhandle = rman_get_bushandle(sc->rl_res); - - hwrev = CSR_READ_4(sc, RL_TXCFG) & RL_TXCFG_HWREV; - bus_release_resource(dev, RL_RES, RL_RID, sc->rl_res); - - /* Don't attach to 8139C+ or 8169/8110 chips. */ - if (hwrev == RL_HWREV_8139CPLUS || - (hwrev == RL_HWREV_8169 && - t->rl_did == RT_DEVICEID_8169) || - hwrev == RL_HWREV_8169S || - hwrev == RL_HWREV_8110S) { - t++; - continue; - } - + if (vendor == RT_VENDORID && devid == RT_DEVICEID_8139) { + if (revid == 0x20) { + /* 8139C+, let re(4) take care of this device. */ + return (ENXIO); + } + } + t = rl_devs; + for (i = 0; i < sizeof(rl_devs) / sizeof(rl_devs[0]); i++, t++) { + if (vendor == t->rl_vid && devid == t->rl_did) { device_set_desc(dev, t->rl_name); return (BUS_PROBE_DEFAULT); } - t++; } return (ENXIO); ==== //depot/projects/e500/sys/pci/if_rlreg.h#5 (text+ko) ==== @@ -29,7 +29,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/pci/if_rlreg.h,v 1.70 2008/01/15 01:10:31 yongari Exp $ + * $FreeBSD: src/sys/pci/if_rlreg.h,v 1.72 2008/03/03 03:41:06 yongari Exp $ */ /* @@ -76,7 +76,11 @@ #define RL_EECMD 0x0050 /* EEPROM command register */ #define RL_CFG0 0x0051 /* config register #0 */ #define RL_CFG1 0x0052 /* config register #1 */ - /* 0053-0057 reserved */ +#define RL_CFG2 0x0053 /* config register #2 */ +#define RL_CFG3 0x0054 /* config register #3 */ +#define RL_CFG4 0x0055 /* config register #4 */ +#define RL_CFG5 0x0056 /* config register #5 */ + /* 0057 reserved */ #define RL_MEDIASTAT 0x0058 /* media status register (8139) */ /* 0059-005A reserved */ #define RL_MII 0x005A /* 8129 chip only */ @@ -359,16 +363,50 @@ * Config 1 register */ #define RL_CFG1_PWRDWN 0x01 +#define RL_CFG1_PME 0x01 #define RL_CFG1_SLEEP 0x02 +#define RL_CFG1_VPDEN 0x02 #define RL_CFG1_IOMAP 0x04 #define RL_CFG1_MEMMAP 0x08 #define RL_CFG1_RSVD 0x10 +#define RL_CFG1_LWACT 0x10 #define RL_CFG1_DRVLOAD 0x20 #define RL_CFG1_LED0 0x40 #define RL_CFG1_FULLDUPLEX 0x40 /* 8129 only */ #define RL_CFG1_LED1 0x80 /* + * Config 2 register + */ +#define RL_CFG2_PCI33MHZ 0x00 +#define RL_CFG2_PCI66MHZ 0x01 +#define RL_CFG2_PCI64BIT 0x08 +#define RL_CFG2_AUXPWR 0x10 + +/* + * Config 3 register + */ +#define RL_CFG3_GRANTSEL 0x80 +#define RL_CFG3_WOL_MAGIC 0x20 +#define RL_CFG3_WOL_LINK 0x10 +#define RL_CFG3_FAST_B2B 0x01 + +/* + * Config 4 register + */ +#define RL_CFG4_LWPTN 0x04 +#define RL_CFG4_LWPME 0x10 + +/* + * Config 5 register + */ +#define RL_CFG5_WOL_BCAST 0x40 +#define RL_CFG5_WOL_MCAST 0x20 +#define RL_CFG5_WOL_UCAST 0x10 +#define RL_CFG5_WOL_LANWAKE 0x02 +#define RL_CFG5_PME_STS 0x01 + +/* * 8139C+ register definitions */ @@ -684,6 +722,8 @@ /* see comment in dev/re/if_re.c */ #define RL_JUMBO_FRAMELEN 7440 #define RL_JUMBO_MTU (RL_JUMBO_FRAMELEN-ETHER_HDR_LEN-ETHER_CRC_LEN) +#define RL_MAX_FRAMELEN \ + (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN) struct rl_txdesc { struct mbuf *tx_m; ==== //depot/projects/e500/sys/powerpc/include/pmap.h#6 (text+ko) ==== @@ -26,7 +26,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/powerpc/include/pmap.h,v 1.20 2006/12/05 04:01:52 grehan Exp $ + * $FreeBSD: src/sys/powerpc/include/pmap.h,v 1.21 2008/03/03 13:20:52 raj Exp $ */ /*- * Copyright (C) 1995, 1996 Wolfgang Solfrank. ==== //depot/projects/e500/sys/powerpc/include/psl.h#3 (text+ko) ==== @@ -29,7 +29,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $NetBSD: psl.h,v 1.5 2000/11/19 19:52:37 matt Exp $ - * $FreeBSD: src/sys/powerpc/include/psl.h,v 1.4 2005/01/07 02:29:19 imp Exp $ + * $FreeBSD: src/sys/powerpc/include/psl.h,v 1.5 2008/03/03 13:20:52 raj Exp $ */ #ifndef _MACHINE_PSL_H_ ==== //depot/projects/e500/sys/powerpc/include/pte.h#3 (text+ko) ==== @@ -29,7 +29,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $NetBSD: pte.h,v 1.2 1998/08/31 14:43:40 tsubai Exp $ - * $FreeBSD: src/sys/powerpc/include/pte.h,v 1.5 2005/11/11 12:03:28 grehan Exp $ + * $FreeBSD: src/sys/powerpc/include/pte.h,v 1.6 2008/03/03 13:20:52 raj Exp $ */ #ifndef _MACHINE_PTE_H_ ==== //depot/projects/e500/sys/powerpc/include/sf_buf.h#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/powerpc/include/sf_buf.h,v 1.2 2004/04/18 08:10:04 alc Exp $ + * $FreeBSD: src/sys/powerpc/include/sf_buf.h,v 1.3 2008/03/03 13:20:52 raj Exp $ */ #ifndef _MACHINE_SF_BUF_H_ ==== //depot/projects/e500/sys/powerpc/include/spr.h#5 (text+ko) ==== @@ -31,7 +31,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $NetBSD: spr.h,v 1.25 2002/08/14 15:38:40 matt Exp $ - * $FreeBSD: src/sys/powerpc/include/spr.h,v 1.7 2008/02/25 00:09:23 raj Exp $ + * $FreeBSD: src/sys/powerpc/include/spr.h,v 1.8 2008/03/03 13:20:52 raj Exp $ */ #ifndef _POWERPC_SPR_H_ #define _POWERPC_SPR_H_ ==== //depot/projects/e500/sys/powerpc/include/trap.h#7 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD$ */ +/* $FreeBSD: src/sys/powerpc/include/trap.h,v 1.6 2008/03/03 13:20:52 raj Exp $ */ #if defined(AIM) #include ==== //depot/projects/e500/sys/powerpc/include/vmparam.h#9 (text+ko) ==== @@ -29,7 +29,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $NetBSD: vmparam.h,v 1.11 2000/02/11 19:25:16 thorpej Exp $ - * $FreeBSD: src/sys/powerpc/include/vmparam.h,v 1.11 2007/12/27 16:45:39 alc Exp $ + * $FreeBSD: src/sys/powerpc/include/vmparam.h,v 1.12 2008/03/03 13:20:52 raj Exp $ */ #ifndef _MACHINE_VMPARAM_H_ ==== //depot/projects/e500/sys/ufs/ufs/ufs_extattr.c#5 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/ufs/ufs/ufs_extattr.c,v 1.89 2008/01/24 12:34:30 attilio Exp $"); +__FBSDID("$FreeBSD: src/sys/ufs/ufs/ufs_extattr.c,v 1.90 2008/03/02 22:52:14 rwatson Exp $"); #include "opt_ufs.h" @@ -448,9 +448,17 @@ ufs_extattr_autostart(struct mount *mp, struct thread *td) { struct vnode *rvp, *attr_dvp, *attr_system_dvp, *attr_user_dvp; + struct ufsmount *ump = VFSTOUFS(mp); int error; /* + * UFS_EXTATTR applies only to UFS1, as UFS2 uses native extended + * attributes, so don't autostart. + */ + if (ump->um_fstype != UFS1) + return (0); + + /* * Does UFS_EXTATTR_FSROOTSUBDIR exist off the filesystem root? * If so, automatically start EA's. */ @@ -706,6 +714,16 @@ return (error); } + /* + * We only allow extattrctl(2) on UFS1 file systems, as UFS2 uses + * native extended attributes. + */ + if (ump->um_fstype != UFS1) { + if (filename_vp != NULL) + VOP_UNLOCK(filename_vp, 0); + return (EOPNOTSUPP); + } + switch(cmd) { case UFS_EXTATTR_CMD_START: if (filename_vp != NULL) { ==== //depot/projects/e500/usr.bin/calendar/calendars/calendar.freebsd#10 (text+ko) ==== @@ -1,7 +1,7 @@ /* * FreeBSD * - * $FreeBSD: src/usr.bin/calendar/calendars/calendar.freebsd,v 1.226 2008/02/27 07:39:31 ganbold Exp $ + * $FreeBSD: src/usr.bin/calendar/calendars/calendar.freebsd,v 1.227 2008/03/03 13:14:39 jadawin Exp $ */ #ifndef _calendar_freebsd_ @@ -12,6 +12,7 @@ 01/02 Patrick Li born in Beijing, People's Republic of China, 1985 >>> TRUNCATED FOR MAIL (1000 lines) <<<